yukit-web 0.9.1 → 0.9.2
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/yukit-web.mjs +36 -8
- package/fesm2022/yukit-web.mjs.map +1 -1
- package/package.json +1 -1
- package/types/yukit-web.d.ts +9 -1
package/fesm2022/yukit-web.mjs
CHANGED
|
@@ -623,8 +623,11 @@ function createPagedList(options) {
|
|
|
623
623
|
* `classes()` utility registers it as base classes and merges it last through `twMerge`, so every
|
|
624
624
|
* class here beats the helm default of the same Tailwind group *and* modifier stack without
|
|
625
625
|
* needing `!important`.
|
|
626
|
+
*
|
|
627
|
+
* The base drops the helm `transition-all` while disabled: a button disabled under the pointer, such as a save that
|
|
628
|
+
* starts saving on click, would otherwise fade from its hover fill to the disabled one instead of turning grey at once.
|
|
626
629
|
*/
|
|
627
|
-
const yuwButtonVariants = cva('', {
|
|
630
|
+
const yuwButtonVariants = cva('data-disabled:transition-none', {
|
|
628
631
|
variants: {
|
|
629
632
|
size: {
|
|
630
633
|
default: 'h-10',
|
|
@@ -1647,19 +1650,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
1647
1650
|
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-accordion-trigger [triggerClass]=\"_triggerClass()\">\n <ng-content />\n</hlm-accordion-trigger>\n" }]
|
|
1648
1651
|
}], propDecorators: { triggerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerClass", required: false }] }], underline: [{ type: i0.Input, args: [{ isSignal: true, alias: "underline", required: false }] }] } });
|
|
1649
1652
|
|
|
1653
|
+
const ACCORDION_NAVIGATION_KEYS = new Set([
|
|
1654
|
+
' ',
|
|
1655
|
+
'Enter',
|
|
1656
|
+
'ArrowUp',
|
|
1657
|
+
'ArrowDown',
|
|
1658
|
+
'ArrowLeft',
|
|
1659
|
+
'ArrowRight',
|
|
1660
|
+
'PageUp',
|
|
1661
|
+
'PageDown',
|
|
1662
|
+
'Home',
|
|
1663
|
+
'End',
|
|
1664
|
+
]);
|
|
1650
1665
|
/**
|
|
1651
1666
|
* Collapsible panel container for a `yuw-accordion-item`.
|
|
1652
1667
|
*
|
|
1653
1668
|
* Projects body content revealed when the item is expanded (supports text, custom markup, or nested components).
|
|
1669
|
+
*
|
|
1670
|
+
* The keys the accordion uses to move between its triggers stop here. `BrnAccordion` listens for them on its whole
|
|
1671
|
+
* host and prevents their default unless the target is a text field, so a switch, a toggle or a button inside the
|
|
1672
|
+
* panel could not be pressed with Space or Enter. Escape and Tab still bubble, so an enclosing sheet or dialog keeps
|
|
1673
|
+
* closing and trapping focus.
|
|
1654
1674
|
*/
|
|
1655
1675
|
class YuwAccordionContentComponent {
|
|
1676
|
+
onKeydown(event) {
|
|
1677
|
+
if (ACCORDION_NAVIGATION_KEYS.has(event.key)) {
|
|
1678
|
+
event.stopPropagation();
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1656
1681
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwAccordionContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1657
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.22", type: YuwAccordionContentComponent, isStandalone: true, selector: "yuw-accordion-content", host: { classAttribute: "contents" }, ngImport: i0, template: "<hlm-accordion-content>\n <ng-content />\n</hlm-accordion-content>\n", dependencies: [{ kind: "component", type: HlmAccordionContent, selector: "hlm-accordion-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1682
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.22", type: YuwAccordionContentComponent, isStandalone: true, selector: "yuw-accordion-content", host: { listeners: { "keydown": "onKeydown($event)" }, classAttribute: "contents" }, ngImport: i0, template: "<hlm-accordion-content>\n <ng-content />\n</hlm-accordion-content>\n", dependencies: [{ kind: "component", type: HlmAccordionContent, selector: "hlm-accordion-content" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1658
1683
|
}
|
|
1659
1684
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwAccordionContentComponent, decorators: [{
|
|
1660
1685
|
type: Component,
|
|
1661
1686
|
args: [{ selector: 'yuw-accordion-content', imports: [HlmAccordionContent], host: {
|
|
1662
1687
|
class: 'contents',
|
|
1688
|
+
'(keydown)': 'onKeydown($event)',
|
|
1663
1689
|
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<hlm-accordion-content>\n <ng-content />\n</hlm-accordion-content>\n" }]
|
|
1664
1690
|
}] });
|
|
1665
1691
|
|
|
@@ -3179,13 +3205,13 @@ class YuwSwitchCardComponent extends YuwValueAccessorBase {
|
|
|
3179
3205
|
this._commit(checked);
|
|
3180
3206
|
}
|
|
3181
3207
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwSwitchCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3182
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwSwitchCardComponent, isStandalone: true, selector: "yuw-switch-card", inputs: { description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "checkedChange" }, host: { classAttribute: "block" }, providers: [provideValueAccessor(YuwSwitchCardComponent)], usesInheritance: true, ngImport: i0, template: "<label [class]=\"_cardClass\" (focusout)=\"_onBlur()\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span [id]=\"_labelId\" class=\"text-
|
|
3208
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwSwitchCardComponent, isStandalone: true, selector: "yuw-switch-card", inputs: { description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "checkedChange" }, host: { classAttribute: "block" }, providers: [provideValueAccessor(YuwSwitchCardComponent)], usesInheritance: true, ngImport: i0, template: "<label [class]=\"_cardClass\" (focusout)=\"_onBlur()\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span [id]=\"_labelId\" class=\"text-sm font-semibold text-foreground\">{{ label() }}</span>\n @if (description(); as text) {\n <span [id]=\"_descriptionId\" class=\"text-sm text-muted-foreground\">{{ text }}</span>\n }\n </span>\n <hlm-switch\n [checked]=\"value()\"\n [class]=\"_switchClass\"\n [disabled]=\"_disabled()\"\n [inputId]=\"inputId() ?? null\"\n [aria-labelledby]=\"_labelId\"\n [aria-describedby]=\"_describedBy()\"\n (checkedChange)=\"onCheckedChange($event)\"\n />\n</label>\n", dependencies: [{ kind: "component", type: i1$c.HlmSwitch, selector: "hlm-switch", inputs: ["class", "checked", "disabled", "size", "inputId", "aria-label", "aria-labelledby", "aria-describedby"], outputs: ["checkedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3183
3209
|
}
|
|
3184
3210
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwSwitchCardComponent, decorators: [{
|
|
3185
3211
|
type: Component,
|
|
3186
3212
|
args: [{ selector: 'yuw-switch-card', imports: [...HlmSwitchImports], providers: [provideValueAccessor(YuwSwitchCardComponent)], host: {
|
|
3187
3213
|
class: 'block',
|
|
3188
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [class]=\"_cardClass\" (focusout)=\"_onBlur()\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span [id]=\"_labelId\" class=\"text-
|
|
3214
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [class]=\"_cardClass\" (focusout)=\"_onBlur()\">\n <span class=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span [id]=\"_labelId\" class=\"text-sm font-semibold text-foreground\">{{ label() }}</span>\n @if (description(); as text) {\n <span [id]=\"_descriptionId\" class=\"text-sm text-muted-foreground\">{{ text }}</span>\n }\n </span>\n <hlm-switch\n [checked]=\"value()\"\n [class]=\"_switchClass\"\n [disabled]=\"_disabled()\"\n [inputId]=\"inputId() ?? null\"\n [aria-labelledby]=\"_labelId\"\n [aria-describedby]=\"_describedBy()\"\n (checkedChange)=\"onCheckedChange($event)\"\n />\n</label>\n" }]
|
|
3189
3215
|
}], propDecorators: { description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
|
|
3190
3216
|
|
|
3191
3217
|
/** Blue dot and outline for a checked radio, the component default. Stacks the helm's own `group-data-[checked=true]` variant on the indicator's inner dot. */
|
|
@@ -8346,6 +8372,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
8346
8372
|
* - `removeDisabled`: Disables the delete button. Default is `false`.
|
|
8347
8373
|
* - `removeLabel`: Renders the delete button with this text. Default is `undefined`.
|
|
8348
8374
|
* - `restoreLabel`: Renders the restore button with this text. Default is `undefined`.
|
|
8375
|
+
* - `saveColor`: Color of the save button (any `YuwColorDto` value). Default is `'primary'`.
|
|
8349
8376
|
* - `saveDisabled`: Disables the save button. Default is `false`.
|
|
8350
8377
|
* - `saving`: Disables the footer actions while the host's write is in flight. Default is `false`.
|
|
8351
8378
|
* - `title` (required): Panel title.
|
|
@@ -8367,6 +8394,7 @@ class YuwsFormSheetComponent {
|
|
|
8367
8394
|
this.removeDisabled = input(false, { ...(ngDevMode ? { debugName: "removeDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8368
8395
|
this.removeLabel = input(...(ngDevMode ? [undefined, { debugName: "removeLabel" }] : /* istanbul ignore next */ []));
|
|
8369
8396
|
this.restoreLabel = input(...(ngDevMode ? [undefined, { debugName: "restoreLabel" }] : /* istanbul ignore next */ []));
|
|
8397
|
+
this.saveColor = input('primary', ...(ngDevMode ? [{ debugName: "saveColor" }] : /* istanbul ignore next */ []));
|
|
8370
8398
|
this.saveDisabled = input(false, { ...(ngDevMode ? { debugName: "saveDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8371
8399
|
this.saving = input(false, { ...(ngDevMode ? { debugName: "saving" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
8372
8400
|
this.title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
@@ -8389,18 +8417,18 @@ class YuwsFormSheetComponent {
|
|
|
8389
8417
|
}
|
|
8390
8418
|
}
|
|
8391
8419
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsFormSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8392
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsFormSheetComponent, isStandalone: true, selector: "yuws-form-sheet", inputs: { backLabel: { classPropertyName: "backLabel", publicName: "backLabel", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, guarded: { classPropertyName: "guarded", publicName: "guarded", isSignal: true, isRequired: false, transformFunction: null }, hideFooter: { classPropertyName: "hideFooter", publicName: "hideFooter", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: true, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, removeDisabled: { classPropertyName: "removeDisabled", publicName: "removeDisabled", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, restoreLabel: { classPropertyName: "restoreLabel", publicName: "restoreLabel", isSignal: true, isRequired: false, transformFunction: null }, saveDisabled: { classPropertyName: "saveDisabled", publicName: "saveDisabled", isSignal: true, isRequired: false, transformFunction: null }, saving: { classPropertyName: "saving", publicName: "saving", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", back: "back", closeRequest: "closeRequest", remove: "remove", restore: "restore", save: "save" }, providers: [
|
|
8420
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: YuwsFormSheetComponent, isStandalone: true, selector: "yuws-form-sheet", inputs: { backLabel: { classPropertyName: "backLabel", publicName: "backLabel", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, guarded: { classPropertyName: "guarded", publicName: "guarded", isSignal: true, isRequired: false, transformFunction: null }, hideFooter: { classPropertyName: "hideFooter", publicName: "hideFooter", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: true, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, removeDisabled: { classPropertyName: "removeDisabled", publicName: "removeDisabled", isSignal: true, isRequired: false, transformFunction: null }, removeLabel: { classPropertyName: "removeLabel", publicName: "removeLabel", isSignal: true, isRequired: false, transformFunction: null }, restoreLabel: { classPropertyName: "restoreLabel", publicName: "restoreLabel", isSignal: true, isRequired: false, transformFunction: null }, saveColor: { classPropertyName: "saveColor", publicName: "saveColor", isSignal: true, isRequired: false, transformFunction: null }, saveDisabled: { classPropertyName: "saveDisabled", publicName: "saveDisabled", isSignal: true, isRequired: false, transformFunction: null }, saving: { classPropertyName: "saving", publicName: "saving", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "openChange", back: "back", closeRequest: "closeRequest", remove: "remove", restore: "restore", save: "save" }, providers: [
|
|
8393
8421
|
provideIcons({ lucideArchiveRestore, lucideArrowLeft, lucideSave, lucideTrash2, lucideX }),
|
|
8394
8422
|
{ provide: YuwSheetOpenState, useExisting: YuwsFormSheetComponent },
|
|
8395
|
-
], ngImport: i0, template: "<yuw-sheet\n side=\"right\"\n [showTrigger]=\"false\"\n [panelClass]=\"panelClass()\"\n bodyClass=\"scroll-fade-y\"\n [title]=\"backLabel() || guarded() ? undefined : title()\"\n [description]=\"backLabel() || guarded() ? undefined : description()\"\n [closeLabel]=\"backLabel() || guarded() ? undefined : labels().close\"\n [disableClose]=\"guarded()\"\n [(open)]=\"open\"\n>\n @if (backLabel(); as label) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-center gap-2 border-b px-4 pb-4\">\n <yuw-button type=\"button\" variant=\"outline\" size=\"icon-sm\" [ariaLabel]=\"label\" (clicked)=\"back.emit()\">\n <ng-icon name=\"lucideArrowLeft\" size=\"16\" />\n </yuw-button>\n <div class=\"min-w-0\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"truncate text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n </div>\n } @else if (guarded()) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-start gap-2 border-b px-4 pb-4\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n <yuw-button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n [ariaLabel]=\"labels().close\"\n (clicked)=\"closeRequest.emit()\"\n >\n <ng-icon name=\"lucideX\" size=\"16\" />\n </yuw-button>\n </div>\n }\n\n <ng-content />\n\n <div\n yuwSheetFooter\n class=\"flex flex-wrap items-center justify-between gap-2\"\n [class.-m-4]=\"_divided()\"\n [class.border-t]=\"_divided()\"\n [class.p-4]=\"_divided()\"\n [style.display]=\"hideFooter() ? 'none' : null\"\n [attr.aria-busy]=\"saving()\"\n >\n @if (errorMessage(); as message) {\n <p role=\"alert\" class=\"w-full rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">{{ message }}</p>\n }\n\n @if (removeLabel(); as label) {\n <yuw-button\n variant=\"ghost\"\n color=\"destructive\"\n class=\"gap-2\"\n [disabled]=\"removeDisabled() || saving()\"\n (clicked)=\"remove.emit()\"\n >\n <ng-icon name=\"lucideTrash2\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n\n <span class=\"ms-auto flex gap-2\">\n <yuw-button variant=\"outline\" (clicked)=\"onCancel()\">\n <ng-icon name=\"lucideX\" size=\"16\" />\n {{ labels().cancel }}\n </yuw-button>\n @if (restoreLabel(); as label) {\n <yuw-button color=\"primary\" [disabled]=\"saving()\" (clicked)=\"restore.emit()\">\n <ng-icon name=\"lucideArchiveRestore\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n @if (!readonly()) {\n <yuw-button color=\"
|
|
8423
|
+
], ngImport: i0, template: "<yuw-sheet\n side=\"right\"\n [showTrigger]=\"false\"\n [panelClass]=\"panelClass()\"\n bodyClass=\"scroll-fade-y\"\n [title]=\"backLabel() || guarded() ? undefined : title()\"\n [description]=\"backLabel() || guarded() ? undefined : description()\"\n [closeLabel]=\"backLabel() || guarded() ? undefined : labels().close\"\n [disableClose]=\"guarded()\"\n [(open)]=\"open\"\n>\n @if (backLabel(); as label) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-center gap-2 border-b px-4 pb-4\">\n <yuw-button type=\"button\" variant=\"outline\" size=\"icon-sm\" [ariaLabel]=\"label\" (clicked)=\"back.emit()\">\n <ng-icon name=\"lucideArrowLeft\" size=\"16\" />\n </yuw-button>\n <div class=\"min-w-0\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"truncate text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n </div>\n } @else if (guarded()) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-start gap-2 border-b px-4 pb-4\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n <yuw-button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n [ariaLabel]=\"labels().close\"\n (clicked)=\"closeRequest.emit()\"\n >\n <ng-icon name=\"lucideX\" size=\"16\" />\n </yuw-button>\n </div>\n }\n\n <ng-content />\n\n <div\n yuwSheetFooter\n class=\"flex flex-wrap items-center justify-between gap-2\"\n [class.-m-4]=\"_divided()\"\n [class.border-t]=\"_divided()\"\n [class.p-4]=\"_divided()\"\n [style.display]=\"hideFooter() ? 'none' : null\"\n [attr.aria-busy]=\"saving()\"\n >\n @if (errorMessage(); as message) {\n <p role=\"alert\" class=\"w-full rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">{{ message }}</p>\n }\n\n @if (removeLabel(); as label) {\n <yuw-button\n variant=\"ghost\"\n color=\"destructive\"\n class=\"gap-2\"\n [disabled]=\"removeDisabled() || saving()\"\n (clicked)=\"remove.emit()\"\n >\n <ng-icon name=\"lucideTrash2\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n\n <span class=\"ms-auto flex gap-2\">\n <yuw-button variant=\"outline\" (clicked)=\"onCancel()\">\n <ng-icon name=\"lucideX\" size=\"16\" />\n {{ labels().cancel }}\n </yuw-button>\n @if (restoreLabel(); as label) {\n <yuw-button color=\"primary\" [disabled]=\"saving()\" (clicked)=\"restore.emit()\">\n <ng-icon name=\"lucideArchiveRestore\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n @if (!readonly()) {\n <yuw-button [color]=\"saveColor()\" [disabled]=\"saveDisabled() || saving()\" (clicked)=\"save.emit()\">\n <ng-icon name=\"lucideSave\" size=\"16\" />\n {{ labels().save }}\n </yuw-button>\n }\n </span>\n </div>\n</yuw-sheet>\n", dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "component", type: YuwButtonComponent, selector: "yuw-button", inputs: ["animationDisabled", "ariaLabel", "color", "disabled", "href", "size", "target", "transparent", "type", "class", "variant", "yuwDropdownMenuAlign", "yuwDropdownMenuTrigger"], outputs: ["clicked"] }, { kind: "component", type: YuwSheetComponent, selector: "yuw-sheet", inputs: ["ariaLabel", "ariaModal", "bodyClass", "closeLabel", "closeOnOutsidePointerEvents", "description", "disableClose", "open", "overlayClass", "panelClass", "scrollStrategy", "showTrigger", "side", "title", "triggerSize", "triggerVariant"], outputs: ["openChange"] }, { kind: "directive", type: YuwSheetFooterDirective, selector: "[yuwSheetFooter]" }, { kind: "directive", type: YuwSheetHeaderDirective, selector: "[yuwSheetHeader]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8396
8424
|
}
|
|
8397
8425
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: YuwsFormSheetComponent, decorators: [{
|
|
8398
8426
|
type: Component,
|
|
8399
8427
|
args: [{ selector: 'yuws-form-sheet', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgIcon, YuwButtonComponent, YuwSheetComponent, YuwSheetFooterDirective, YuwSheetHeaderDirective], providers: [
|
|
8400
8428
|
provideIcons({ lucideArchiveRestore, lucideArrowLeft, lucideSave, lucideTrash2, lucideX }),
|
|
8401
8429
|
{ provide: YuwSheetOpenState, useExisting: YuwsFormSheetComponent },
|
|
8402
|
-
], template: "<yuw-sheet\n side=\"right\"\n [showTrigger]=\"false\"\n [panelClass]=\"panelClass()\"\n bodyClass=\"scroll-fade-y\"\n [title]=\"backLabel() || guarded() ? undefined : title()\"\n [description]=\"backLabel() || guarded() ? undefined : description()\"\n [closeLabel]=\"backLabel() || guarded() ? undefined : labels().close\"\n [disableClose]=\"guarded()\"\n [(open)]=\"open\"\n>\n @if (backLabel(); as label) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-center gap-2 border-b px-4 pb-4\">\n <yuw-button type=\"button\" variant=\"outline\" size=\"icon-sm\" [ariaLabel]=\"label\" (clicked)=\"back.emit()\">\n <ng-icon name=\"lucideArrowLeft\" size=\"16\" />\n </yuw-button>\n <div class=\"min-w-0\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"truncate text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n </div>\n } @else if (guarded()) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-start gap-2 border-b px-4 pb-4\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n <yuw-button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n [ariaLabel]=\"labels().close\"\n (clicked)=\"closeRequest.emit()\"\n >\n <ng-icon name=\"lucideX\" size=\"16\" />\n </yuw-button>\n </div>\n }\n\n <ng-content />\n\n <div\n yuwSheetFooter\n class=\"flex flex-wrap items-center justify-between gap-2\"\n [class.-m-4]=\"_divided()\"\n [class.border-t]=\"_divided()\"\n [class.p-4]=\"_divided()\"\n [style.display]=\"hideFooter() ? 'none' : null\"\n [attr.aria-busy]=\"saving()\"\n >\n @if (errorMessage(); as message) {\n <p role=\"alert\" class=\"w-full rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">{{ message }}</p>\n }\n\n @if (removeLabel(); as label) {\n <yuw-button\n variant=\"ghost\"\n color=\"destructive\"\n class=\"gap-2\"\n [disabled]=\"removeDisabled() || saving()\"\n (clicked)=\"remove.emit()\"\n >\n <ng-icon name=\"lucideTrash2\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n\n <span class=\"ms-auto flex gap-2\">\n <yuw-button variant=\"outline\" (clicked)=\"onCancel()\">\n <ng-icon name=\"lucideX\" size=\"16\" />\n {{ labels().cancel }}\n </yuw-button>\n @if (restoreLabel(); as label) {\n <yuw-button color=\"primary\" [disabled]=\"saving()\" (clicked)=\"restore.emit()\">\n <ng-icon name=\"lucideArchiveRestore\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n @if (!readonly()) {\n <yuw-button color=\"
|
|
8403
|
-
}], propDecorators: { backLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "backLabel", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], guarded: [{ type: i0.Input, args: [{ isSignal: true, alias: "guarded", required: false }] }], hideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFooter", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: true }] }, { type: i0.Output, args: ["openChange"] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], removeDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeDisabled", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], restoreLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreLabel", required: false }] }], saveDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveDisabled", required: false }] }], saving: [{ type: i0.Input, args: [{ isSignal: true, alias: "saving", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], back: [{ type: i0.Output, args: ["back"] }], closeRequest: [{ type: i0.Output, args: ["closeRequest"] }], remove: [{ type: i0.Output, args: ["remove"] }], restore: [{ type: i0.Output, args: ["restore"] }], save: [{ type: i0.Output, args: ["save"] }] } });
|
|
8430
|
+
], template: "<yuw-sheet\n side=\"right\"\n [showTrigger]=\"false\"\n [panelClass]=\"panelClass()\"\n bodyClass=\"scroll-fade-y\"\n [title]=\"backLabel() || guarded() ? undefined : title()\"\n [description]=\"backLabel() || guarded() ? undefined : description()\"\n [closeLabel]=\"backLabel() || guarded() ? undefined : labels().close\"\n [disableClose]=\"guarded()\"\n [(open)]=\"open\"\n>\n @if (backLabel(); as label) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-center gap-2 border-b px-4 pb-4\">\n <yuw-button type=\"button\" variant=\"outline\" size=\"icon-sm\" [ariaLabel]=\"label\" (clicked)=\"back.emit()\">\n <ng-icon name=\"lucideArrowLeft\" size=\"16\" />\n </yuw-button>\n <div class=\"min-w-0\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"truncate text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n </div>\n } @else if (guarded()) {\n <div yuwSheetHeader class=\"-mx-4 -mt-3 flex items-start gap-2 border-b px-4 pb-4\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"text-base font-medium text-foreground\">{{ title() }}</h2>\n @if (description(); as text) {\n <p class=\"text-sm text-muted-foreground\">{{ text }}</p>\n }\n </div>\n <yuw-button\n type=\"button\"\n variant=\"outline\"\n size=\"icon-sm\"\n [ariaLabel]=\"labels().close\"\n (clicked)=\"closeRequest.emit()\"\n >\n <ng-icon name=\"lucideX\" size=\"16\" />\n </yuw-button>\n </div>\n }\n\n <ng-content />\n\n <div\n yuwSheetFooter\n class=\"flex flex-wrap items-center justify-between gap-2\"\n [class.-m-4]=\"_divided()\"\n [class.border-t]=\"_divided()\"\n [class.p-4]=\"_divided()\"\n [style.display]=\"hideFooter() ? 'none' : null\"\n [attr.aria-busy]=\"saving()\"\n >\n @if (errorMessage(); as message) {\n <p role=\"alert\" class=\"w-full rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive\">{{ message }}</p>\n }\n\n @if (removeLabel(); as label) {\n <yuw-button\n variant=\"ghost\"\n color=\"destructive\"\n class=\"gap-2\"\n [disabled]=\"removeDisabled() || saving()\"\n (clicked)=\"remove.emit()\"\n >\n <ng-icon name=\"lucideTrash2\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n\n <span class=\"ms-auto flex gap-2\">\n <yuw-button variant=\"outline\" (clicked)=\"onCancel()\">\n <ng-icon name=\"lucideX\" size=\"16\" />\n {{ labels().cancel }}\n </yuw-button>\n @if (restoreLabel(); as label) {\n <yuw-button color=\"primary\" [disabled]=\"saving()\" (clicked)=\"restore.emit()\">\n <ng-icon name=\"lucideArchiveRestore\" size=\"16\" />\n {{ label }}\n </yuw-button>\n }\n @if (!readonly()) {\n <yuw-button [color]=\"saveColor()\" [disabled]=\"saveDisabled() || saving()\" (clicked)=\"save.emit()\">\n <ng-icon name=\"lucideSave\" size=\"16\" />\n {{ labels().save }}\n </yuw-button>\n }\n </span>\n </div>\n</yuw-sheet>\n" }]
|
|
8431
|
+
}], propDecorators: { backLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "backLabel", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], guarded: [{ type: i0.Input, args: [{ isSignal: true, alias: "guarded", required: false }] }], hideFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideFooter", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: true }] }, { type: i0.Output, args: ["openChange"] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], removeDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeDisabled", required: false }] }], removeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeLabel", required: false }] }], restoreLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "restoreLabel", required: false }] }], saveColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveColor", required: false }] }], saveDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveDisabled", required: false }] }], saving: [{ type: i0.Input, args: [{ isSignal: true, alias: "saving", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], back: [{ type: i0.Output, args: ["back"] }], closeRequest: [{ type: i0.Output, args: ["closeRequest"] }], remove: [{ type: i0.Output, args: ["remove"] }], restore: [{ type: i0.Output, args: ["restore"] }], save: [{ type: i0.Output, args: ["save"] }] } });
|
|
8404
8432
|
|
|
8405
8433
|
/**
|
|
8406
8434
|
* Image field of a form: label and the picker, either an avatar with the current image beside an upload button, or a
|