@4sh/ui-kit 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +12 -11
- package/README.md +12 -11
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +5 -3
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +6 -4
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +206 -25
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +16 -3
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +5 -3
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +282 -0
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +6 -4
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +5 -3
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +6 -4
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +7 -2
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +370 -0
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +5 -3
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +5 -3
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +5 -3
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +6 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-ripple.mjs +298 -0
- package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +5 -3
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +437 -17
- package/mcp/data/ui-config.json +830 -0
- package/mcp/package.json +1 -1
- package/package.json +13 -1
- package/styles/base/_ripple.scss +53 -0
- package/styles/component-vars.scss +59 -1
- package/styles/index.scss +1 -0
- package/styles/settings/_ui-config.scss +9 -0
- package/styles.css +1 -1
- package/types/4sh-ui-kit-actions-ui-button.d.ts +3 -1
- package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +3 -1
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +57 -2
- package/types/4sh-ui-kit-forms-ui-field.d.ts +13 -1
- package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +3 -1
- package/types/4sh-ui-kit-forms-ui-knob.d.ts +93 -0
- package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +3 -1
- package/types/4sh-ui-kit-forms-ui-select.d.ts +3 -1
- package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +3 -1
- package/types/4sh-ui-kit-forms.d.ts +5 -1
- package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +201 -0
- package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +3 -1
- package/types/4sh-ui-kit-navigation-ui-menu.d.ts +3 -1
- package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +3 -1
- package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +3 -1
- package/types/4sh-ui-kit-ripple.d.ts +156 -0
- package/types/4sh-ui-kit-table-ui-paginator.d.ts +3 -1
|
@@ -99,6 +99,8 @@ class UiToggleButton extends BaseFieldControl {
|
|
|
99
99
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
100
100
|
/** Span the full width of the parent (group buttons share the width evenly). */
|
|
101
101
|
this.fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
102
|
+
/** Ripple Effect */
|
|
103
|
+
this.ripple = input(true, { ...(ngDevMode ? { debugName: "ripple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
102
104
|
/** Pill shape. */
|
|
103
105
|
this.rounded = input(false, { ...(ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
104
106
|
/** Whether the last pressed button can be released (single), or the group emptied. */
|
|
@@ -344,9 +346,9 @@ class UiToggleButton extends BaseFieldControl {
|
|
|
344
346
|
return Array.isArray(model) && model.some((v) => this.resolver.equals(v, value));
|
|
345
347
|
}
|
|
346
348
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiToggleButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
347
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: UiToggleButton, isStandalone: true, selector: "ui-toggle-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, onIcon: { classPropertyName: "onIcon", publicName: "onIcon", isSignal: true, isRequired: false, transformFunction: null }, offIcon: { classPropertyName: "offIcon", publicName: "offIcon", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, trueValue: { classPropertyName: "trueValue", publicName: "trueValue", isSignal: true, isRequired: false, transformFunction: null }, falseValue: { classPropertyName: "falseValue", publicName: "falseValue", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionIcon: { classPropertyName: "optionIcon", publicName: "optionIcon", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null }, contentTemplate: { classPropertyName: "contentTemplate", publicName: "contentTemplate", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleChange: "toggleChange", optionClick: "optionClick", toggleFocus: "toggleFocus", toggleBlur: "toggleBlur" }, host: { properties: { "class": "hostClasses()", "attr.role": "isGroup() ? 'group' : null", "attr.aria-label": "groupAriaLabel()", "attr.aria-labelledby": "groupAriaLabelledBy()" } }, providers: [
|
|
349
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: UiToggleButton, isStandalone: true, selector: "ui-toggle-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, onIcon: { classPropertyName: "onIcon", publicName: "onIcon", isSignal: true, isRequired: false, transformFunction: null }, offIcon: { classPropertyName: "offIcon", publicName: "offIcon", isSignal: true, isRequired: false, transformFunction: null }, iconPos: { classPropertyName: "iconPos", publicName: "iconPos", isSignal: true, isRequired: false, transformFunction: null }, trueValue: { classPropertyName: "trueValue", publicName: "trueValue", isSignal: true, isRequired: false, transformFunction: null }, falseValue: { classPropertyName: "falseValue", publicName: "falseValue", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionIcon: { classPropertyName: "optionIcon", publicName: "optionIcon", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null }, contentTemplate: { classPropertyName: "contentTemplate", publicName: "contentTemplate", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleChange: "toggleChange", optionClick: "optionClick", toggleFocus: "toggleFocus", toggleBlur: "toggleBlur" }, host: { properties: { "class": "hostClasses()", "attr.role": "isGroup() ? 'group' : null", "attr.aria-label": "groupAriaLabel()", "attr.aria-labelledby": "groupAriaLabelledBy()" } }, providers: [
|
|
348
350
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiToggleButton), multi: true },
|
|
349
|
-
], viewQueries: [{ propertyName: "buttons", predicate: ["itemEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (isGroup()) {\n @for (item of normalizedOptions(); track item.key) {\n <button\n #itemEl\n type=\"button\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"item.selected\"\n [class._icon-only]=\"item.iconOnly\"\n [disabled]=\"item.disabled\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"item.selected\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggleOption(item, $event)\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"itemContext(item)\" />\n } @else {\n @if (iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n @if (item.label) {\n <span class=\"ui-toggle-button-label\">{{ item.label }}</span>\n }\n @if (!iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n }\n </button>\n }\n} @else {\n <button\n #itemEl\n type=\"button\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"checked()\"\n [class._icon-only]=\"isIconOnly()\"\n [id]=\"resolvedId()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"checked()\"\n [attr.aria-label]=\"buttonAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggle()\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (contentTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else {\n @if (iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n @if (currentLabel()) {\n <span class=\"ui-toggle-button-label\">{{ currentLabel() }}</span>\n }\n @if (!iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n }\n </button>\n}\n\n<ng-template #singleIcon>\n @if (iconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else if (currentIcon(); as iconName) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"iconName\" [size]=\"iconSize()\" />\n }\n</ng-template>\n", styles: [":host{display:inline-flex;gap:var(--ui-toggle-button-group-gap, var(--units-sm));font-family:var(--fontfamily-base);vertical-align:middle}:host .ui-toggle-button-item{height:var(--ui-toggle-button-height, var(--size-components-default));padding:0 var(--ui-toggle-button-padding-x, var(--units-default));font-size:var(--ui-toggle-button-font-size, var(--size-typography-text-default))}:host .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height, var(--size-components-default));padding:0}:host._small .ui-toggle-button-item{height:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0 var(--ui-toggle-button-padding-x-small, var(--units-md));font-size:var(--ui-toggle-button-font-size-small, var(--size-typography-text-md))}:host._small .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0}:host._large .ui-toggle-button-item{height:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0 var(--ui-toggle-button-padding-x-large, var(--units-lg));font-size:var(--ui-toggle-button-font-size-large, var(--size-typography-text-lg))}:host._large .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0}.ui-toggle-button-item{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-toggle-button-gap, var(--units-sm));box-sizing:border-box;border:var(--ui-toggle-button-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_invalid-stroke, var(--_stroke));border-radius:var(--ui-toggle-button-radius, var(--radius-sm));background-color:var(--_surface);color:var(--_content);font-family:inherit;font-weight:var(--weight-bold);line-height:1.2;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),border-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-toggle-button-item:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-toggle-button-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_invalid-stroke, var(--_ring))}.ui-toggle-button-item:disabled{cursor:not-allowed}.ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowoutlined-surface-default);--_content: var(--actions-lowoutlined-content-default);--_stroke: var(--actions-lowoutlined-stroke-default);--_ring: var(--actions-lowoutlined-stroke-focused)}.ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowoutlined-surface-hover);--_content: var(--actions-lowoutlined-content-hover);--_stroke: var(--actions-lowoutlined-stroke-hover)}.ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowoutlined-surface-pressed);--_content: var(--actions-lowoutlined-content-pressed);--_stroke: var(--actions-lowoutlined-stroke-pressed)}.ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowoutlined-surface-disabled);--_content: var(--actions-lowoutlined-content-disabled);--_stroke: var(--actions-lowoutlined-stroke-disabled)}.ui-toggle-button-icon{line-height:0}.ui-toggle-button-label{display:inline-block}:host._filled .ui-toggle-button-item:not(._selected){--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._filled .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._filled .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._filled .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._ghost .ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowghost-surface-default);--_content: var(--actions-lowghost-content-default);--_stroke: var(--actions-lowghost-stroke-default);--_ring: var(--actions-lowghost-stroke-focused)}:host._ghost .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowghost-surface-hover);--_content: var(--actions-lowghost-content-hover);--_stroke: var(--actions-lowghost-stroke-hover)}:host._ghost .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowghost-surface-pressed);--_content: var(--actions-lowghost-content-pressed);--_stroke: var(--actions-lowghost-stroke-pressed)}:host._ghost .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowghost-surface-disabled);--_content: var(--actions-lowghost-content-disabled);--_stroke: var(--actions-lowghost-stroke-disabled)}:host._high .ui-toggle-button-item._selected{--_surface: var(--actions-high-surface-default);--_content: var(--actions-high-content-default);--_stroke: var(--actions-high-stroke-default);--_ring: var(--actions-high-stroke-focused)}:host._high .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-high-surface-hover);--_content: var(--actions-high-content-hover);--_stroke: var(--actions-high-stroke-hover)}:host._high .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-high-surface-pressed);--_content: var(--actions-high-content-pressed);--_stroke: var(--actions-high-stroke-pressed)}:host._high .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-high-surface-disabled);--_content: var(--actions-high-content-disabled);--_stroke: var(--actions-high-stroke-disabled)}:host._low .ui-toggle-button-item._selected{--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._low .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._low .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._low .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._success .ui-toggle-button-item._selected{--_surface: var(--actions-success-surface-default);--_content: var(--actions-success-content-default);--_stroke: var(--actions-success-stroke-default);--_ring: var(--actions-success-stroke-focused)}:host._success .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-success-surface-hover);--_content: var(--actions-success-content-hover);--_stroke: var(--actions-success-stroke-hover)}:host._success .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-success-surface-pressed);--_content: var(--actions-success-content-pressed);--_stroke: var(--actions-success-stroke-pressed)}:host._success .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-success-surface-disabled);--_content: var(--actions-success-content-disabled);--_stroke: var(--actions-success-stroke-disabled)}:host._warning .ui-toggle-button-item._selected{--_surface: var(--actions-warning-surface-default);--_content: var(--actions-warning-content-default);--_stroke: var(--actions-warning-stroke-default);--_ring: var(--actions-warning-stroke-focused)}:host._warning .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-warning-surface-hover);--_content: var(--actions-warning-content-hover);--_stroke: var(--actions-warning-stroke-hover)}:host._warning .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-warning-surface-pressed);--_content: var(--actions-warning-content-pressed);--_stroke: var(--actions-warning-stroke-pressed)}:host._warning .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-warning-surface-disabled);--_content: var(--actions-warning-content-disabled);--_stroke: var(--actions-warning-stroke-disabled)}:host._error .ui-toggle-button-item._selected{--_surface: var(--actions-error-surface-default);--_content: var(--actions-error-content-default);--_stroke: var(--actions-error-stroke-default);--_ring: var(--actions-error-stroke-focused)}:host._error .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-error-surface-hover);--_content: var(--actions-error-content-hover);--_stroke: var(--actions-error-stroke-hover)}:host._error .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-error-surface-pressed);--_content: var(--actions-error-content-pressed);--_stroke: var(--actions-error-stroke-pressed)}:host._error .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-error-surface-disabled);--_content: var(--actions-error-content-disabled);--_stroke: var(--actions-error-stroke-disabled)}:host._rounded .ui-toggle-button-item{border-radius:var(--ui-toggle-button-radius-rounded, var(--radius-full))}:host._fluid{display:flex;width:100%}:host._fluid .ui-toggle-button-item{flex:1 1 0;min-width:0}:host._vertical{flex-direction:column;align-items:stretch}:host._readonly .ui-toggle-button-item{cursor:default}:host._invalid{--_invalid-stroke: var(--form-error-stroke-default)}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
351
|
+
], viewQueries: [{ propertyName: "buttons", predicate: ["itemEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (isGroup()) {\n @for (item of normalizedOptions(); track item.key) {\n <button\n #itemEl\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"item.selected\"\n [class._icon-only]=\"item.iconOnly\"\n [disabled]=\"item.disabled\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"item.selected\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggleOption(item, $event)\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"itemContext(item)\" />\n } @else {\n @if (iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n @if (item.label) {\n <span class=\"ui-toggle-button-label\">{{ item.label }}</span>\n }\n @if (!iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n }\n </button>\n }\n} @else {\n <button\n #itemEl\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"checked()\"\n [class._icon-only]=\"isIconOnly()\"\n [id]=\"resolvedId()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"checked()\"\n [attr.aria-label]=\"buttonAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggle()\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (contentTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else {\n @if (iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n @if (currentLabel()) {\n <span class=\"ui-toggle-button-label\">{{ currentLabel() }}</span>\n }\n @if (!iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n }\n </button>\n}\n\n<ng-template #singleIcon>\n @if (iconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else if (currentIcon(); as iconName) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"iconName\" [size]=\"iconSize()\" />\n }\n</ng-template>\n", styles: [":host{display:inline-flex;gap:var(--ui-toggle-button-group-gap, var(--units-sm));font-family:var(--fontfamily-base);vertical-align:middle}:host .ui-toggle-button-item{height:var(--ui-toggle-button-height, var(--size-components-default));padding:0 var(--ui-toggle-button-padding-x, var(--units-default));font-size:var(--ui-toggle-button-font-size, var(--size-typography-text-default))}:host .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height, var(--size-components-default));padding:0}:host._small .ui-toggle-button-item{height:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0 var(--ui-toggle-button-padding-x-small, var(--units-md));font-size:var(--ui-toggle-button-font-size-small, var(--size-typography-text-md))}:host._small .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0}:host._large .ui-toggle-button-item{height:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0 var(--ui-toggle-button-padding-x-large, var(--units-lg));font-size:var(--ui-toggle-button-font-size-large, var(--size-typography-text-lg))}:host._large .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0}.ui-toggle-button-item{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-toggle-button-gap, var(--units-sm));box-sizing:border-box;border:var(--ui-toggle-button-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_invalid-stroke, var(--_stroke));border-radius:var(--ui-toggle-button-radius, var(--radius-sm));background-color:var(--_surface);color:var(--_content);font-family:inherit;font-weight:var(--weight-bold);line-height:1.2;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),border-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-toggle-button-item:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-toggle-button-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_invalid-stroke, var(--_ring))}.ui-toggle-button-item:disabled{cursor:not-allowed}.ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowoutlined-surface-default);--_content: var(--actions-lowoutlined-content-default);--_stroke: var(--actions-lowoutlined-stroke-default);--_ring: var(--actions-lowoutlined-stroke-focused)}.ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowoutlined-surface-hover);--_content: var(--actions-lowoutlined-content-hover);--_stroke: var(--actions-lowoutlined-stroke-hover)}.ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowoutlined-surface-pressed);--_content: var(--actions-lowoutlined-content-pressed);--_stroke: var(--actions-lowoutlined-stroke-pressed)}.ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowoutlined-surface-disabled);--_content: var(--actions-lowoutlined-content-disabled);--_stroke: var(--actions-lowoutlined-stroke-disabled)}.ui-toggle-button-icon{line-height:0}.ui-toggle-button-label{display:inline-block}:host._filled .ui-toggle-button-item:not(._selected){--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._filled .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._filled .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._filled .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._ghost .ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowghost-surface-default);--_content: var(--actions-lowghost-content-default);--_stroke: var(--actions-lowghost-stroke-default);--_ring: var(--actions-lowghost-stroke-focused)}:host._ghost .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowghost-surface-hover);--_content: var(--actions-lowghost-content-hover);--_stroke: var(--actions-lowghost-stroke-hover)}:host._ghost .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowghost-surface-pressed);--_content: var(--actions-lowghost-content-pressed);--_stroke: var(--actions-lowghost-stroke-pressed)}:host._ghost .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowghost-surface-disabled);--_content: var(--actions-lowghost-content-disabled);--_stroke: var(--actions-lowghost-stroke-disabled)}:host._high .ui-toggle-button-item._selected{--_surface: var(--actions-high-surface-default);--_content: var(--actions-high-content-default);--_stroke: var(--actions-high-stroke-default);--_ring: var(--actions-high-stroke-focused)}:host._high .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-high-surface-hover);--_content: var(--actions-high-content-hover);--_stroke: var(--actions-high-stroke-hover)}:host._high .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-high-surface-pressed);--_content: var(--actions-high-content-pressed);--_stroke: var(--actions-high-stroke-pressed)}:host._high .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-high-surface-disabled);--_content: var(--actions-high-content-disabled);--_stroke: var(--actions-high-stroke-disabled)}:host._low .ui-toggle-button-item._selected{--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._low .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._low .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._low .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._success .ui-toggle-button-item._selected{--_surface: var(--actions-success-surface-default);--_content: var(--actions-success-content-default);--_stroke: var(--actions-success-stroke-default);--_ring: var(--actions-success-stroke-focused)}:host._success .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-success-surface-hover);--_content: var(--actions-success-content-hover);--_stroke: var(--actions-success-stroke-hover)}:host._success .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-success-surface-pressed);--_content: var(--actions-success-content-pressed);--_stroke: var(--actions-success-stroke-pressed)}:host._success .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-success-surface-disabled);--_content: var(--actions-success-content-disabled);--_stroke: var(--actions-success-stroke-disabled)}:host._warning .ui-toggle-button-item._selected{--_surface: var(--actions-warning-surface-default);--_content: var(--actions-warning-content-default);--_stroke: var(--actions-warning-stroke-default);--_ring: var(--actions-warning-stroke-focused)}:host._warning .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-warning-surface-hover);--_content: var(--actions-warning-content-hover);--_stroke: var(--actions-warning-stroke-hover)}:host._warning .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-warning-surface-pressed);--_content: var(--actions-warning-content-pressed);--_stroke: var(--actions-warning-stroke-pressed)}:host._warning .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-warning-surface-disabled);--_content: var(--actions-warning-content-disabled);--_stroke: var(--actions-warning-stroke-disabled)}:host._error .ui-toggle-button-item._selected{--_surface: var(--actions-error-surface-default);--_content: var(--actions-error-content-default);--_stroke: var(--actions-error-stroke-default);--_ring: var(--actions-error-stroke-focused)}:host._error .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-error-surface-hover);--_content: var(--actions-error-content-hover);--_stroke: var(--actions-error-stroke-hover)}:host._error .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-error-surface-pressed);--_content: var(--actions-error-content-pressed);--_stroke: var(--actions-error-stroke-pressed)}:host._error .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-error-surface-disabled);--_content: var(--actions-error-content-disabled);--_stroke: var(--actions-error-stroke-disabled)}:host._rounded .ui-toggle-button-item{border-radius:var(--ui-toggle-button-radius-rounded, var(--radius-full))}:host._fluid{display:flex;width:100%}:host._fluid .ui-toggle-button-item{flex:1 1 0;min-width:0}:host._vertical{flex-direction:column;align-items:stretch}:host._readonly .ui-toggle-button-item{cursor:default}:host._invalid{--_invalid-stroke: var(--form-error-stroke-default)}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
350
352
|
}
|
|
351
353
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: UiToggleButton, decorators: [{
|
|
352
354
|
type: Component,
|
|
@@ -357,8 +359,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
|
|
|
357
359
|
'[attr.role]': "isGroup() ? 'group' : null",
|
|
358
360
|
'[attr.aria-label]': 'groupAriaLabel()',
|
|
359
361
|
'[attr.aria-labelledby]': 'groupAriaLabelledBy()',
|
|
360
|
-
}, template: "@if (isGroup()) {\n @for (item of normalizedOptions(); track item.key) {\n <button\n #itemEl\n type=\"button\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"item.selected\"\n [class._icon-only]=\"item.iconOnly\"\n [disabled]=\"item.disabled\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"item.selected\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggleOption(item, $event)\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"itemContext(item)\" />\n } @else {\n @if (iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n @if (item.label) {\n <span class=\"ui-toggle-button-label\">{{ item.label }}</span>\n }\n @if (!iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n }\n </button>\n }\n} @else {\n <button\n #itemEl\n type=\"button\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"checked()\"\n [class._icon-only]=\"isIconOnly()\"\n [id]=\"resolvedId()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"checked()\"\n [attr.aria-label]=\"buttonAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggle()\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (contentTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else {\n @if (iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n @if (currentLabel()) {\n <span class=\"ui-toggle-button-label\">{{ currentLabel() }}</span>\n }\n @if (!iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n }\n </button>\n}\n\n<ng-template #singleIcon>\n @if (iconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else if (currentIcon(); as iconName) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"iconName\" [size]=\"iconSize()\" />\n }\n</ng-template>\n", styles: [":host{display:inline-flex;gap:var(--ui-toggle-button-group-gap, var(--units-sm));font-family:var(--fontfamily-base);vertical-align:middle}:host .ui-toggle-button-item{height:var(--ui-toggle-button-height, var(--size-components-default));padding:0 var(--ui-toggle-button-padding-x, var(--units-default));font-size:var(--ui-toggle-button-font-size, var(--size-typography-text-default))}:host .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height, var(--size-components-default));padding:0}:host._small .ui-toggle-button-item{height:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0 var(--ui-toggle-button-padding-x-small, var(--units-md));font-size:var(--ui-toggle-button-font-size-small, var(--size-typography-text-md))}:host._small .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0}:host._large .ui-toggle-button-item{height:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0 var(--ui-toggle-button-padding-x-large, var(--units-lg));font-size:var(--ui-toggle-button-font-size-large, var(--size-typography-text-lg))}:host._large .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0}.ui-toggle-button-item{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-toggle-button-gap, var(--units-sm));box-sizing:border-box;border:var(--ui-toggle-button-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_invalid-stroke, var(--_stroke));border-radius:var(--ui-toggle-button-radius, var(--radius-sm));background-color:var(--_surface);color:var(--_content);font-family:inherit;font-weight:var(--weight-bold);line-height:1.2;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),border-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-toggle-button-item:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-toggle-button-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_invalid-stroke, var(--_ring))}.ui-toggle-button-item:disabled{cursor:not-allowed}.ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowoutlined-surface-default);--_content: var(--actions-lowoutlined-content-default);--_stroke: var(--actions-lowoutlined-stroke-default);--_ring: var(--actions-lowoutlined-stroke-focused)}.ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowoutlined-surface-hover);--_content: var(--actions-lowoutlined-content-hover);--_stroke: var(--actions-lowoutlined-stroke-hover)}.ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowoutlined-surface-pressed);--_content: var(--actions-lowoutlined-content-pressed);--_stroke: var(--actions-lowoutlined-stroke-pressed)}.ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowoutlined-surface-disabled);--_content: var(--actions-lowoutlined-content-disabled);--_stroke: var(--actions-lowoutlined-stroke-disabled)}.ui-toggle-button-icon{line-height:0}.ui-toggle-button-label{display:inline-block}:host._filled .ui-toggle-button-item:not(._selected){--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._filled .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._filled .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._filled .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._ghost .ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowghost-surface-default);--_content: var(--actions-lowghost-content-default);--_stroke: var(--actions-lowghost-stroke-default);--_ring: var(--actions-lowghost-stroke-focused)}:host._ghost .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowghost-surface-hover);--_content: var(--actions-lowghost-content-hover);--_stroke: var(--actions-lowghost-stroke-hover)}:host._ghost .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowghost-surface-pressed);--_content: var(--actions-lowghost-content-pressed);--_stroke: var(--actions-lowghost-stroke-pressed)}:host._ghost .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowghost-surface-disabled);--_content: var(--actions-lowghost-content-disabled);--_stroke: var(--actions-lowghost-stroke-disabled)}:host._high .ui-toggle-button-item._selected{--_surface: var(--actions-high-surface-default);--_content: var(--actions-high-content-default);--_stroke: var(--actions-high-stroke-default);--_ring: var(--actions-high-stroke-focused)}:host._high .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-high-surface-hover);--_content: var(--actions-high-content-hover);--_stroke: var(--actions-high-stroke-hover)}:host._high .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-high-surface-pressed);--_content: var(--actions-high-content-pressed);--_stroke: var(--actions-high-stroke-pressed)}:host._high .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-high-surface-disabled);--_content: var(--actions-high-content-disabled);--_stroke: var(--actions-high-stroke-disabled)}:host._low .ui-toggle-button-item._selected{--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._low .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._low .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._low .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._success .ui-toggle-button-item._selected{--_surface: var(--actions-success-surface-default);--_content: var(--actions-success-content-default);--_stroke: var(--actions-success-stroke-default);--_ring: var(--actions-success-stroke-focused)}:host._success .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-success-surface-hover);--_content: var(--actions-success-content-hover);--_stroke: var(--actions-success-stroke-hover)}:host._success .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-success-surface-pressed);--_content: var(--actions-success-content-pressed);--_stroke: var(--actions-success-stroke-pressed)}:host._success .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-success-surface-disabled);--_content: var(--actions-success-content-disabled);--_stroke: var(--actions-success-stroke-disabled)}:host._warning .ui-toggle-button-item._selected{--_surface: var(--actions-warning-surface-default);--_content: var(--actions-warning-content-default);--_stroke: var(--actions-warning-stroke-default);--_ring: var(--actions-warning-stroke-focused)}:host._warning .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-warning-surface-hover);--_content: var(--actions-warning-content-hover);--_stroke: var(--actions-warning-stroke-hover)}:host._warning .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-warning-surface-pressed);--_content: var(--actions-warning-content-pressed);--_stroke: var(--actions-warning-stroke-pressed)}:host._warning .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-warning-surface-disabled);--_content: var(--actions-warning-content-disabled);--_stroke: var(--actions-warning-stroke-disabled)}:host._error .ui-toggle-button-item._selected{--_surface: var(--actions-error-surface-default);--_content: var(--actions-error-content-default);--_stroke: var(--actions-error-stroke-default);--_ring: var(--actions-error-stroke-focused)}:host._error .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-error-surface-hover);--_content: var(--actions-error-content-hover);--_stroke: var(--actions-error-stroke-hover)}:host._error .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-error-surface-pressed);--_content: var(--actions-error-content-pressed);--_stroke: var(--actions-error-stroke-pressed)}:host._error .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-error-surface-disabled);--_content: var(--actions-error-content-disabled);--_stroke: var(--actions-error-stroke-disabled)}:host._rounded .ui-toggle-button-item{border-radius:var(--ui-toggle-button-radius-rounded, var(--radius-full))}:host._fluid{display:flex;width:100%}:host._fluid .ui-toggle-button-item{flex:1 1 0;min-width:0}:host._vertical{flex-direction:column;align-items:stretch}:host._readonly .ui-toggle-button-item{cursor:default}:host._invalid{--_invalid-stroke: var(--form-error-stroke-default)}\n"] }]
|
|
361
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], onLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onLabel", required: false }] }], offLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offLabel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], onIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "onIcon", required: false }] }], offIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "offIcon", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], trueValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "trueValue", required: false }] }], falseValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "falseValue", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], optionIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionIcon", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], contentTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentTemplate", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], toggleChange: [{ type: i0.Output, args: ["toggleChange"] }], optionClick: [{ type: i0.Output, args: ["optionClick"] }], toggleFocus: [{ type: i0.Output, args: ["toggleFocus"] }], toggleBlur: [{ type: i0.Output, args: ["toggleBlur"] }], buttons: [{ type: i0.ViewChildren, args: ['itemEl', { isSignal: true }] }] } });
|
|
362
|
+
}, template: "@if (isGroup()) {\n @for (item of normalizedOptions(); track item.key) {\n <button\n #itemEl\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"item.selected\"\n [class._icon-only]=\"item.iconOnly\"\n [disabled]=\"item.disabled\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"item.selected\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggleOption(item, $event)\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"itemContext(item)\" />\n } @else {\n @if (iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n @if (item.label) {\n <span class=\"ui-toggle-button-label\">{{ item.label }}</span>\n }\n @if (!iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n }\n </button>\n }\n} @else {\n <button\n #itemEl\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"checked()\"\n [class._icon-only]=\"isIconOnly()\"\n [id]=\"resolvedId()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"checked()\"\n [attr.aria-label]=\"buttonAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggle()\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (contentTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else {\n @if (iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n @if (currentLabel()) {\n <span class=\"ui-toggle-button-label\">{{ currentLabel() }}</span>\n }\n @if (!iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n }\n </button>\n}\n\n<ng-template #singleIcon>\n @if (iconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else if (currentIcon(); as iconName) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"iconName\" [size]=\"iconSize()\" />\n }\n</ng-template>\n", styles: [":host{display:inline-flex;gap:var(--ui-toggle-button-group-gap, var(--units-sm));font-family:var(--fontfamily-base);vertical-align:middle}:host .ui-toggle-button-item{height:var(--ui-toggle-button-height, var(--size-components-default));padding:0 var(--ui-toggle-button-padding-x, var(--units-default));font-size:var(--ui-toggle-button-font-size, var(--size-typography-text-default))}:host .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height, var(--size-components-default));padding:0}:host._small .ui-toggle-button-item{height:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0 var(--ui-toggle-button-padding-x-small, var(--units-md));font-size:var(--ui-toggle-button-font-size-small, var(--size-typography-text-md))}:host._small .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-small, var(--size-components-sm));padding:0}:host._large .ui-toggle-button-item{height:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0 var(--ui-toggle-button-padding-x-large, var(--units-lg));font-size:var(--ui-toggle-button-font-size-large, var(--size-typography-text-lg))}:host._large .ui-toggle-button-item._icon-only{width:var(--ui-toggle-button-height-large, var(--size-components-lg));padding:0}.ui-toggle-button-item{display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-toggle-button-gap, var(--units-sm));box-sizing:border-box;border:var(--ui-toggle-button-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_invalid-stroke, var(--_stroke));border-radius:var(--ui-toggle-button-radius, var(--radius-sm));background-color:var(--_surface);color:var(--_content);font-family:inherit;font-weight:var(--weight-bold);line-height:1.2;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),border-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-toggle-button-item:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-toggle-button-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_invalid-stroke, var(--_ring))}.ui-toggle-button-item:disabled{cursor:not-allowed}.ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowoutlined-surface-default);--_content: var(--actions-lowoutlined-content-default);--_stroke: var(--actions-lowoutlined-stroke-default);--_ring: var(--actions-lowoutlined-stroke-focused)}.ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowoutlined-surface-hover);--_content: var(--actions-lowoutlined-content-hover);--_stroke: var(--actions-lowoutlined-stroke-hover)}.ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowoutlined-surface-pressed);--_content: var(--actions-lowoutlined-content-pressed);--_stroke: var(--actions-lowoutlined-stroke-pressed)}.ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowoutlined-surface-disabled);--_content: var(--actions-lowoutlined-content-disabled);--_stroke: var(--actions-lowoutlined-stroke-disabled)}.ui-toggle-button-icon{line-height:0}.ui-toggle-button-label{display:inline-block}:host._filled .ui-toggle-button-item:not(._selected){--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._filled .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._filled .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._filled .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._ghost .ui-toggle-button-item:not(._selected){--_surface: var(--actions-lowghost-surface-default);--_content: var(--actions-lowghost-content-default);--_stroke: var(--actions-lowghost-stroke-default);--_ring: var(--actions-lowghost-stroke-focused)}:host._ghost .ui-toggle-button-item:not(._selected):hover:not(:disabled){--_surface: var(--actions-lowghost-surface-hover);--_content: var(--actions-lowghost-content-hover);--_stroke: var(--actions-lowghost-stroke-hover)}:host._ghost .ui-toggle-button-item:not(._selected):active:not(:disabled){--_surface: var(--actions-lowghost-surface-pressed);--_content: var(--actions-lowghost-content-pressed);--_stroke: var(--actions-lowghost-stroke-pressed)}:host._ghost .ui-toggle-button-item:not(._selected):disabled{--_surface: var(--actions-lowghost-surface-disabled);--_content: var(--actions-lowghost-content-disabled);--_stroke: var(--actions-lowghost-stroke-disabled)}:host._high .ui-toggle-button-item._selected{--_surface: var(--actions-high-surface-default);--_content: var(--actions-high-content-default);--_stroke: var(--actions-high-stroke-default);--_ring: var(--actions-high-stroke-focused)}:host._high .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-high-surface-hover);--_content: var(--actions-high-content-hover);--_stroke: var(--actions-high-stroke-hover)}:host._high .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-high-surface-pressed);--_content: var(--actions-high-content-pressed);--_stroke: var(--actions-high-stroke-pressed)}:host._high .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-high-surface-disabled);--_content: var(--actions-high-content-disabled);--_stroke: var(--actions-high-stroke-disabled)}:host._low .ui-toggle-button-item._selected{--_surface: var(--actions-low-surface-default);--_content: var(--actions-low-content-default);--_stroke: var(--actions-low-stroke-default);--_ring: var(--actions-low-stroke-focused)}:host._low .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-low-surface-hover);--_content: var(--actions-low-content-hover);--_stroke: var(--actions-low-stroke-hover)}:host._low .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-low-surface-pressed);--_content: var(--actions-low-content-pressed);--_stroke: var(--actions-low-stroke-pressed)}:host._low .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-low-surface-disabled);--_content: var(--actions-low-content-disabled);--_stroke: var(--actions-low-stroke-disabled)}:host._success .ui-toggle-button-item._selected{--_surface: var(--actions-success-surface-default);--_content: var(--actions-success-content-default);--_stroke: var(--actions-success-stroke-default);--_ring: var(--actions-success-stroke-focused)}:host._success .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-success-surface-hover);--_content: var(--actions-success-content-hover);--_stroke: var(--actions-success-stroke-hover)}:host._success .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-success-surface-pressed);--_content: var(--actions-success-content-pressed);--_stroke: var(--actions-success-stroke-pressed)}:host._success .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-success-surface-disabled);--_content: var(--actions-success-content-disabled);--_stroke: var(--actions-success-stroke-disabled)}:host._warning .ui-toggle-button-item._selected{--_surface: var(--actions-warning-surface-default);--_content: var(--actions-warning-content-default);--_stroke: var(--actions-warning-stroke-default);--_ring: var(--actions-warning-stroke-focused)}:host._warning .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-warning-surface-hover);--_content: var(--actions-warning-content-hover);--_stroke: var(--actions-warning-stroke-hover)}:host._warning .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-warning-surface-pressed);--_content: var(--actions-warning-content-pressed);--_stroke: var(--actions-warning-stroke-pressed)}:host._warning .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-warning-surface-disabled);--_content: var(--actions-warning-content-disabled);--_stroke: var(--actions-warning-stroke-disabled)}:host._error .ui-toggle-button-item._selected{--_surface: var(--actions-error-surface-default);--_content: var(--actions-error-content-default);--_stroke: var(--actions-error-stroke-default);--_ring: var(--actions-error-stroke-focused)}:host._error .ui-toggle-button-item._selected:hover:not(:disabled){--_surface: var(--actions-error-surface-hover);--_content: var(--actions-error-content-hover);--_stroke: var(--actions-error-stroke-hover)}:host._error .ui-toggle-button-item._selected:active:not(:disabled){--_surface: var(--actions-error-surface-pressed);--_content: var(--actions-error-content-pressed);--_stroke: var(--actions-error-stroke-pressed)}:host._error .ui-toggle-button-item._selected:disabled{--_surface: var(--actions-error-surface-disabled);--_content: var(--actions-error-content-disabled);--_stroke: var(--actions-error-stroke-disabled)}:host._rounded .ui-toggle-button-item{border-radius:var(--ui-toggle-button-radius-rounded, var(--radius-full))}:host._fluid{display:flex;width:100%}:host._fluid .ui-toggle-button-item{flex:1 1 0;min-width:0}:host._vertical{flex-direction:column;align-items:stretch}:host._readonly .ui-toggle-button-item{cursor:default}:host._invalid{--_invalid-stroke: var(--form-error-stroke-default)}\n"] }]
|
|
363
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], onLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "onLabel", required: false }] }], offLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "offLabel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], onIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "onIcon", required: false }] }], offIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "offIcon", required: false }] }], iconPos: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPos", required: false }] }], trueValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "trueValue", required: false }] }], falseValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "falseValue", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], optionIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionIcon", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], ripple: [{ type: i0.Input, args: [{ isSignal: true, alias: "ripple", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], contentTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentTemplate", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], toggleChange: [{ type: i0.Output, args: ["toggleChange"] }], optionClick: [{ type: i0.Output, args: ["optionClick"] }], toggleFocus: [{ type: i0.Output, args: ["toggleFocus"] }], toggleBlur: [{ type: i0.Output, args: ["toggleBlur"] }], buttons: [{ type: i0.ViewChildren, args: ['itemEl', { isSignal: true }] }] } });
|
|
362
364
|
|
|
363
365
|
/*
|
|
364
366
|
* Public API Surface of ui-kit/ui-toggle-button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-toggle-button.mjs","sources":["../../../projects/ui-kit/forms/ui-toggle-button/src/lib/ui-toggle-button.ts","../../../projects/ui-kit/forms/ui-toggle-button/src/lib/ui-toggle-button.html","../../../projects/ui-kit/forms/ui-toggle-button/src/public-api.ts","../../../projects/ui-kit/forms/ui-toggle-button/src/4sh-ui-kit-forms-ui-toggle-button.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n input,\n isDevMode,\n output,\n TemplateRef,\n viewChildren,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n BaseFieldControl,\n createOptionResolver,\n warnMissingAccessibleName,\n} from '@4sh/ui-kit/forms';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\nimport { UiLevel } from '@4sh/ui-kit/types';\n\nexport type ToggleButtonSize = 'default' | 'small' | 'large';\n/** Habillage de l'état **non** sélectionné (l'état sélectionné est toujours plein). */\nexport type ToggleButtonVariant = 'outlined' | 'filled' | 'ghost';\nexport type ToggleButtonIconPos = 'left' | 'right';\nexport type ToggleButtonOrientation = 'horizontal' | 'vertical';\n\n/** Model value: one of the `trueValue`/`falseValue` pair (single), or the array of pressed option values (group). */\nexport type ToggleButtonValue<T> = T | T[] | null;\n\n/**\n * Rich option shape for the group mode. Options may also be primitives\n * (`string`/`number`) or any object, in which case `optionLabel` /\n * `optionValue` / `optionDisabled` / `optionIcon` tell the control how to read\n * them.\n */\nexport interface ToggleButtonOption<T = unknown> {\n /** Text shown inside the button. */\n label?: string;\n /** Value carried into the model when the button is pressed. */\n value: T;\n /** Icon name (design-system icon). */\n icon?: string;\n /** Icon substituted while the button is pressed. */\n selectedIcon?: string;\n /** Disables just this button. */\n disabled?: boolean;\n /** Accessible name (required for an icon-only button). */\n ariaLabel?: string;\n}\n\n/** Context handed to the `icon` / `content` templates (single mode). */\nexport interface ToggleButtonStateContext {\n /** Whether the button is currently pressed (default `$implicit`). */\n $implicit: boolean;\n /** Same as `$implicit`, named for readability. */\n checked: boolean;\n}\n\n/** Context handed to the `item` template (group mode). */\nexport interface ToggleButtonItemContext<T = unknown> {\n /** The original option (default `$implicit`). */\n $implicit: T;\n /** Same as `$implicit`, named for readability. */\n option: T;\n /** Whether this button is currently pressed. */\n selected: boolean;\n /** Index of the option in the list. */\n index: number;\n}\n\n/** Payload emitted when a group button is clicked. */\nexport interface ToggleButtonOptionClickEvent<T = unknown> {\n /** The original option (as passed in `options`). */\n option: T;\n /** The resolved value of that option. */\n value: T;\n /** Index of the option in the list. */\n index: number;\n /** Pressed state after the click. */\n selected: boolean;\n /** Originating DOM event. */\n originalEvent: Event;\n}\n\n/** @ignore Internal, normalized view of a group option. */\ninterface NormalizedToggle {\n key: string;\n index: number;\n value: unknown;\n label: string | null;\n icon: string | null;\n ariaLabel: string | null;\n disabled: boolean;\n selected: boolean;\n iconOnly: boolean;\n original: unknown;\n}\n\n/** @ignore */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * ui-toggle-button — a button that holds a pressed state.\n *\n * Two modes, one component:\n * - **single** (default): one native `<button aria-pressed>` backing a boolean\n * (or the `trueValue`/`falseValue` pair). Labels and icons may differ per\n * state (`onLabel`/`offLabel`, `onIcon`/`offIcon`).\n * - **group** (`options` set): one button per option, `role=\"group\"` on the\n * host, model = the array of pressed values. Deliberately always\n * multi-select: an exclusive choice is `ui-segment-control`'s job, which says\n * it with `radiogroup` semantics instead of `aria-pressed`.\n *\n * `level` colours the pressed state, `variant` draws the released one, both\n * from the `actions.*` token sets. Interactive states (hover/focus/pressed/\n * disabled) are pure CSS.\n *\n * Works standalone, with `[(ngModel)]`, reactive forms, or signal forms\n * (`[formField]`) — it is a `ControlValueAccessor`.\n *\n * @example\n * ```html\n * <ui-toggle-button [(ngModel)]=\"bold\" label=\"Gras\" icon=\"bold\" />\n * <ui-toggle-button [(ngModel)]=\"days\" [options]=\"dayOptions\" ariaLabel=\"Jours ouvrés\" />\n * ```\n */\n@Component({\n selector: 'ui-toggle-button',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-toggle-button.html',\n styleUrl: './ui-toggle-button.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiToggleButton), multi: true },\n ],\n host: {\n '[class]': 'hostClasses()',\n '[attr.role]': \"isGroup() ? 'group' : null\",\n '[attr.aria-label]': 'groupAriaLabel()',\n '[attr.aria-labelledby]': 'groupAriaLabelledBy()',\n },\n})\nexport class UiToggleButton<T = boolean> extends BaseFieldControl<ToggleButtonValue<T>> {\n // --- Single mode ------------------------------------------------------\n /** Label shown in both states (fallback of `onLabel` / `offLabel`). */\n label = input<string>();\n /** Label shown while pressed. */\n onLabel = input<string>();\n /** Label shown while released. */\n offLabel = input<string>();\n /** Icon shown in both states (fallback of `onIcon` / `offIcon`). */\n icon = input<string>();\n /** Icon shown while pressed. */\n onIcon = input<string>();\n /** Icon shown while released. */\n offIcon = input<string>();\n /** Side of the label the icon sits on. */\n iconPos = input<ToggleButtonIconPos>('left');\n /** Model value emitted when pressed. */\n trueValue = input<T>(true as T);\n /** Model value emitted when released. */\n falseValue = input<T>(false as T);\n\n // --- Group mode -------------------------------------------------------\n /** Options to display, one button each. Presence switches the host to group mode. */\n options = input<readonly (T | ToggleButtonOption<T>)[]>();\n /** Field name to read a label from, when options are objects. */\n optionLabel = input<string>();\n /** Field name to read the value from, when options are objects. */\n optionValue = input<string>();\n /** Field name to read the disabled flag from, when options are objects. */\n optionDisabled = input<string>();\n /** Field name to read an icon name from, when options are objects. */\n optionIcon = input<string>();\n /** Property used to compare object values for equality (selection matching). */\n dataKey = input<string>();\n /** Layout axis of the group. */\n orientation = input<ToggleButtonOrientation>('horizontal');\n\n // --- Shared -----------------------------------------------------------\n /** Colour family of the pressed state. */\n level = input<UiLevel>('high');\n /** How the released state is drawn. */\n variant = input<ToggleButtonVariant>('outlined');\n /** Size. */\n size = input<ToggleButtonSize>('default');\n /** Span the full width of the parent (group buttons share the width evenly). */\n fluid = input(false, { transform: booleanAttribute });\n /** Pill shape. */\n rounded = input(false, { transform: booleanAttribute });\n /** Whether the last pressed button can be released (single), or the group emptied. */\n allowEmpty = input(true, { transform: booleanAttribute });\n\n // --- Templates --------------------------------------------------------\n /** Replaces the icon, single mode (receives `{ $implicit, checked }`). */\n iconTemplate = input<TemplateRef<ToggleButtonStateContext>>();\n /** Replaces the whole button content, single mode (receives `{ $implicit, checked }`). */\n contentTemplate = input<TemplateRef<ToggleButtonStateContext>>();\n /** Replaces a group button's content (receives `{ $implicit, option, selected, index }`). */\n itemTemplate = input<TemplateRef<ToggleButtonItemContext<T>>>();\n\n /** Emitted on user interaction with the new model value. */\n toggleChange = output<ToggleButtonValue<T>>();\n /** Emitted when a group button is clicked (even if it does not change the value). */\n optionClick = output<ToggleButtonOptionClickEvent<T>>();\n /** Emitted when a button receives focus. */\n toggleFocus = output<FocusEvent>();\n /** Emitted when a button loses focus. */\n toggleBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly buttons = viewChildren<ElementRef<HTMLButtonElement>>('itemEl');\n\n /** @ignore */\n private readonly resolver = createOptionResolver({\n optionValue: this.optionValue,\n optionLabel: this.optionLabel,\n optionDisabled: this.optionDisabled,\n dataKey: this.dataKey,\n });\n\n constructor() {\n super();\n\n if (isDevMode()) {\n effect(() => {\n if (this.isGroup()) {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n 'Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n if (this.normalizedOptions().some((o) => o.iconOnly && !o.ariaLabel)) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n 'Icon-only option has no accessible name: add `ariaLabel` on the option.',\n );\n }\n return;\n }\n if (this.isIconOnly() && !this.ariaLabel()) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n 'Icon-only button has no accessible name: provide `ariaLabel`.',\n );\n }\n // A name that changes with the state is re-announced on focus, so the\n // control sounds like a different button depending on its value.\n if (this.hasStateLabels() && !this.ariaLabel() && !this.ariaLabelledBy()) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n '`onLabel`/`offLabel` differ: provide a state-independent `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n });\n }\n }\n\n /** @ignore Group mode: an `options` list was provided. */\n protected readonly isGroup = computed(() => !!this.options());\n\n /** @ignore */\n protected readonly iconSize = computed<UiIconSize>(() => {\n const size = this.size();\n if (size === 'small') return 'sm';\n return size === 'large' ? 'lg' : 'default';\n });\n\n /** @ignore */\n protected readonly hostClasses = computed(() => {\n const c = ['ui-toggle-button', `_${this.level()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.variant() !== 'outlined') c.push(`_${this.variant()}`);\n if (this.rounded()) c.push('_rounded');\n if (this.fluid()) c.push('_fluid');\n if (this.isGroup()) {\n c.push('_group');\n if (this.orientation() === 'vertical') c.push('_vertical');\n }\n if (this.readonly()) c.push('_readonly');\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore Only the group carries the group-level ARIA naming. */\n protected readonly groupAriaLabel = computed(() =>\n this.isGroup() ? this.ariaLabel() || null : null,\n );\n /** @ignore */\n protected readonly groupAriaLabelledBy = computed(() =>\n this.isGroup() ? this.ariaLabelledBy() || null : null,\n );\n\n // --- Single mode ------------------------------------------------------\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.trueValue());\n /** @ignore */\n protected readonly hasStateLabels = computed(\n () => !!this.onLabel() && !!this.offLabel() && this.onLabel() !== this.offLabel(),\n );\n /** @ignore Label of the current state, falling back to the shared one. */\n protected readonly currentLabel = computed(\n () => (this.checked() ? this.onLabel() : this.offLabel()) ?? this.label() ?? null,\n );\n /** @ignore Icon of the current state, falling back to the shared one. */\n protected readonly currentIcon = computed(\n () => (this.checked() ? this.onIcon() : this.offIcon()) ?? this.icon() ?? null,\n );\n /** @ignore Square button: an icon, no text. */\n protected readonly isIconOnly = computed(\n () => !this.contentTemplate() && !this.currentLabel() && !!this.currentIcon(),\n );\n /** @ignore */\n protected readonly iconBefore = computed(() => this.iconPos() === 'left');\n /** @ignore */\n protected readonly stateContext = computed<ToggleButtonStateContext>(() => ({\n $implicit: this.checked(),\n checked: this.checked(),\n }));\n /** @ignore Accessible name of the single button (never empty-stringed). */\n protected readonly buttonAriaLabel = computed(\n () => this.ariaLabel() || (this.isIconOnly() ? this.currentLabel() : null),\n );\n\n // --- Group mode -------------------------------------------------------\n\n /** @ignore Options resolved to a flat, render-ready shape. */\n protected readonly normalizedOptions = computed<NormalizedToggle[]>(() => {\n const raw = this.options() ?? [];\n const model = this.modelValue();\n const groupDisabled = this.isDisabled();\n return raw.map((option, index) => {\n const value = this.resolveValue(option);\n const selected = this.isPressed(value, model);\n const label = this.resolveLabel(option);\n const icon = this.resolveIcon(option, selected);\n return {\n key: `${this.uid}-${index}`,\n index,\n value,\n label,\n icon,\n ariaLabel: isRecord(option) ? this.resolver.asText(option['ariaLabel']) : null,\n disabled: groupDisabled || this.resolver.resolveDisabled(option),\n selected,\n iconOnly: !label && !!icon,\n original: option,\n };\n });\n });\n\n /** @ignore */\n protected itemContext(item: NormalizedToggle): ToggleButtonItemContext<T> {\n return {\n $implicit: item.original as T,\n option: item.original as T,\n selected: item.selected,\n index: item.index,\n };\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-toggle-button';\n }\n\n /** Focus the button (the first enabled one in group mode). */\n focus(options?: FocusOptions): void {\n const target = this.buttons().find((ref) => !ref.nativeElement.disabled);\n target?.nativeElement.focus(options);\n }\n\n /** @ignore Single mode: flip the boolean pair. */\n protected toggle(): void {\n if (this.isDisabled() || this.readonly()) return;\n if (this.checked() && !this.allowEmpty()) return;\n\n const next = this.checked() ? this.falseValue() : this.trueValue();\n this.modelValue.set(next);\n this.emitChange(next);\n this.toggleChange.emit(next);\n }\n\n /** @ignore Group mode: press / release one option. */\n protected toggleOption(item: NormalizedToggle, event: Event): void {\n if (item.disabled || this.readonly()) return;\n const value = item.value as T;\n const model = this.modelValue();\n const next = Array.isArray(model) ? [...(model as T[])] : [];\n const at = next.findIndex((v) => this.resolver.equals(v, value));\n let selected: boolean;\n\n if (at !== -1) {\n if (!this.allowEmpty() && next.length === 1) return;\n next.splice(at, 1);\n selected = false;\n } else {\n next.push(value);\n selected = true;\n }\n\n this.modelValue.set(next);\n this.emitChange(next);\n this.toggleChange.emit(next);\n this.optionClick.emit({\n option: item.original as T,\n value,\n index: item.index,\n selected,\n originalEvent: event,\n });\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.toggleBlur.emit(event);\n }\n\n /** @ignore Rich option shape (`{ value }`) resolves without a field mapping. */\n private resolveValue(option: unknown): unknown {\n if (!this.optionValue() && isRecord(option) && 'value' in option) return option['value'];\n return this.resolver.resolveValue(option);\n }\n\n /** @ignore An option object with no label key stays label-less (icon-only button). */\n private resolveLabel(option: unknown): string | null {\n if (!this.optionLabel() && isRecord(option) && !('label' in option)) return null;\n return this.resolver.resolveLabel(option);\n }\n\n /** @ignore */\n private resolveIcon(option: unknown, selected: boolean): string | null {\n if (selected && isRecord(option)) {\n const swapped = this.resolver.asText(option['selectedIcon']);\n if (swapped) return swapped;\n }\n const field = this.optionIcon();\n if (field) return this.resolver.asText(this.resolver.getField(option, field));\n if (isRecord(option)) return this.resolver.asText(option['icon']);\n return null;\n }\n\n /** @ignore A group's model is the array of pressed values. */\n private isPressed(value: unknown, model: ToggleButtonValue<T> | undefined): boolean {\n return Array.isArray(model) && model.some((v) => this.resolver.equals(v, value));\n }\n}\n","@if (isGroup()) {\n @for (item of normalizedOptions(); track item.key) {\n <button\n #itemEl\n type=\"button\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"item.selected\"\n [class._icon-only]=\"item.iconOnly\"\n [disabled]=\"item.disabled\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"item.selected\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggleOption(item, $event)\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"itemContext(item)\" />\n } @else {\n @if (iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n @if (item.label) {\n <span class=\"ui-toggle-button-label\">{{ item.label }}</span>\n }\n @if (!iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n }\n </button>\n }\n} @else {\n <button\n #itemEl\n type=\"button\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"checked()\"\n [class._icon-only]=\"isIconOnly()\"\n [id]=\"resolvedId()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"checked()\"\n [attr.aria-label]=\"buttonAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggle()\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (contentTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else {\n @if (iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n @if (currentLabel()) {\n <span class=\"ui-toggle-button-label\">{{ currentLabel() }}</span>\n }\n @if (!iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n }\n </button>\n}\n\n<ng-template #singleIcon>\n @if (iconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else if (currentIcon(); as iconName) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"iconName\" [size]=\"iconSize()\" />\n }\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-toggle-button\n */\n\nexport * from './lib/ui-toggle-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAqGA;AACA,SAAS,QAAQ,CAAC,KAAc,EAAA;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AACpD;AAEA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAgBG,MAAO,cAA4B,SAAQ,gBAAsC,CAAA;AA+ErF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;;AA7ET,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;AAEvB,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;;AAEzB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK;gGAAU;;AAE1B,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;AAEtB,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK;8FAAU;;AAExB,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;;QAEzB,IAAA,CAAA,OAAO,GAAG,KAAK,CAAsB,MAAM;oFAAC;;QAE5C,IAAA,CAAA,SAAS,GAAG,KAAK,CAAI,IAAS;sFAAC;;QAE/B,IAAA,CAAA,UAAU,GAAG,KAAK,CAAI,KAAU;uFAAC;;;AAIjC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAA0C;;AAEzD,QAAA,IAAA,CAAA,WAAW,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EAAA,MAAA,EAAA,MAAA,EAAA,QAAA,EAAA,YAAA,EAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAavB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAf1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAA,SAAA,EAGxB;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;qBAC3F,EAAA,IAAA,EACK;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC1B,wBAAA,aAAa,EAAE,4BAA4B;AAC3C,wBAAA,mBAAmB,EAAE,kBAAkB;AACvC,wBAAA,wBAAwB,EAAE,uBAAuB;AAClD,qBAAA,EAAA,QAAA,EAAA,2iFAAA,EAAA,MAAA,EAAA,CAAA,s4TAAA,CAAA,EAAA;osFAuEsE,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvNjF;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-toggle-button.mjs","sources":["../../../projects/ui-kit/forms/ui-toggle-button/src/lib/ui-toggle-button.ts","../../../projects/ui-kit/forms/ui-toggle-button/src/lib/ui-toggle-button.html","../../../projects/ui-kit/forms/ui-toggle-button/src/public-api.ts","../../../projects/ui-kit/forms/ui-toggle-button/src/4sh-ui-kit-forms-ui-toggle-button.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n input,\n isDevMode,\n output,\n TemplateRef,\n viewChildren,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n BaseFieldControl,\n createOptionResolver,\n warnMissingAccessibleName,\n} from '@4sh/ui-kit/forms';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\nimport { UiLevel } from '@4sh/ui-kit/types';\n\nexport type ToggleButtonSize = 'default' | 'small' | 'large';\n/** Habillage de l'état **non** sélectionné (l'état sélectionné est toujours plein). */\nexport type ToggleButtonVariant = 'outlined' | 'filled' | 'ghost';\nexport type ToggleButtonIconPos = 'left' | 'right';\nexport type ToggleButtonOrientation = 'horizontal' | 'vertical';\n\n/** Model value: one of the `trueValue`/`falseValue` pair (single), or the array of pressed option values (group). */\nexport type ToggleButtonValue<T> = T | T[] | null;\n\n/**\n * Rich option shape for the group mode. Options may also be primitives\n * (`string`/`number`) or any object, in which case `optionLabel` /\n * `optionValue` / `optionDisabled` / `optionIcon` tell the control how to read\n * them.\n */\nexport interface ToggleButtonOption<T = unknown> {\n /** Text shown inside the button. */\n label?: string;\n /** Value carried into the model when the button is pressed. */\n value: T;\n /** Icon name (design-system icon). */\n icon?: string;\n /** Icon substituted while the button is pressed. */\n selectedIcon?: string;\n /** Disables just this button. */\n disabled?: boolean;\n /** Accessible name (required for an icon-only button). */\n ariaLabel?: string;\n}\n\n/** Context handed to the `icon` / `content` templates (single mode). */\nexport interface ToggleButtonStateContext {\n /** Whether the button is currently pressed (default `$implicit`). */\n $implicit: boolean;\n /** Same as `$implicit`, named for readability. */\n checked: boolean;\n}\n\n/** Context handed to the `item` template (group mode). */\nexport interface ToggleButtonItemContext<T = unknown> {\n /** The original option (default `$implicit`). */\n $implicit: T;\n /** Same as `$implicit`, named for readability. */\n option: T;\n /** Whether this button is currently pressed. */\n selected: boolean;\n /** Index of the option in the list. */\n index: number;\n}\n\n/** Payload emitted when a group button is clicked. */\nexport interface ToggleButtonOptionClickEvent<T = unknown> {\n /** The original option (as passed in `options`). */\n option: T;\n /** The resolved value of that option. */\n value: T;\n /** Index of the option in the list. */\n index: number;\n /** Pressed state after the click. */\n selected: boolean;\n /** Originating DOM event. */\n originalEvent: Event;\n}\n\n/** @ignore Internal, normalized view of a group option. */\ninterface NormalizedToggle {\n key: string;\n index: number;\n value: unknown;\n label: string | null;\n icon: string | null;\n ariaLabel: string | null;\n disabled: boolean;\n selected: boolean;\n iconOnly: boolean;\n original: unknown;\n}\n\n/** @ignore */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * ui-toggle-button — a button that holds a pressed state.\n *\n * Two modes, one component:\n * - **single** (default): one native `<button aria-pressed>` backing a boolean\n * (or the `trueValue`/`falseValue` pair). Labels and icons may differ per\n * state (`onLabel`/`offLabel`, `onIcon`/`offIcon`).\n * - **group** (`options` set): one button per option, `role=\"group\"` on the\n * host, model = the array of pressed values. Deliberately always\n * multi-select: an exclusive choice is `ui-segment-control`'s job, which says\n * it with `radiogroup` semantics instead of `aria-pressed`.\n *\n * `level` colours the pressed state, `variant` draws the released one, both\n * from the `actions.*` token sets. Interactive states (hover/focus/pressed/\n * disabled) are pure CSS.\n *\n * Works standalone, with `[(ngModel)]`, reactive forms, or signal forms\n * (`[formField]`) — it is a `ControlValueAccessor`.\n *\n * @example\n * ```html\n * <ui-toggle-button [(ngModel)]=\"bold\" label=\"Gras\" icon=\"bold\" />\n * <ui-toggle-button [(ngModel)]=\"days\" [options]=\"dayOptions\" ariaLabel=\"Jours ouvrés\" />\n * ```\n */\n@Component({\n selector: 'ui-toggle-button',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-toggle-button.html',\n styleUrl: './ui-toggle-button.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiToggleButton), multi: true },\n ],\n host: {\n '[class]': 'hostClasses()',\n '[attr.role]': \"isGroup() ? 'group' : null\",\n '[attr.aria-label]': 'groupAriaLabel()',\n '[attr.aria-labelledby]': 'groupAriaLabelledBy()',\n },\n})\nexport class UiToggleButton<T = boolean> extends BaseFieldControl<ToggleButtonValue<T>> {\n // --- Single mode ------------------------------------------------------\n /** Label shown in both states (fallback of `onLabel` / `offLabel`). */\n label = input<string>();\n /** Label shown while pressed. */\n onLabel = input<string>();\n /** Label shown while released. */\n offLabel = input<string>();\n /** Icon shown in both states (fallback of `onIcon` / `offIcon`). */\n icon = input<string>();\n /** Icon shown while pressed. */\n onIcon = input<string>();\n /** Icon shown while released. */\n offIcon = input<string>();\n /** Side of the label the icon sits on. */\n iconPos = input<ToggleButtonIconPos>('left');\n /** Model value emitted when pressed. */\n trueValue = input<T>(true as T);\n /** Model value emitted when released. */\n falseValue = input<T>(false as T);\n\n // --- Group mode -------------------------------------------------------\n /** Options to display, one button each. Presence switches the host to group mode. */\n options = input<readonly (T | ToggleButtonOption<T>)[]>();\n /** Field name to read a label from, when options are objects. */\n optionLabel = input<string>();\n /** Field name to read the value from, when options are objects. */\n optionValue = input<string>();\n /** Field name to read the disabled flag from, when options are objects. */\n optionDisabled = input<string>();\n /** Field name to read an icon name from, when options are objects. */\n optionIcon = input<string>();\n /** Property used to compare object values for equality (selection matching). */\n dataKey = input<string>();\n /** Layout axis of the group. */\n orientation = input<ToggleButtonOrientation>('horizontal');\n\n // --- Shared -----------------------------------------------------------\n /** Colour family of the pressed state. */\n level = input<UiLevel>('high');\n /** How the released state is drawn. */\n variant = input<ToggleButtonVariant>('outlined');\n /** Size. */\n size = input<ToggleButtonSize>('default');\n /** Span the full width of the parent (group buttons share the width evenly). */\n fluid = input(false, { transform: booleanAttribute });\n /** Ripple Effect */\n ripple = input(true, { transform: booleanAttribute });\n /** Pill shape. */\n rounded = input(false, { transform: booleanAttribute });\n /** Whether the last pressed button can be released (single), or the group emptied. */\n allowEmpty = input(true, { transform: booleanAttribute });\n\n // --- Templates --------------------------------------------------------\n /** Replaces the icon, single mode (receives `{ $implicit, checked }`). */\n iconTemplate = input<TemplateRef<ToggleButtonStateContext>>();\n /** Replaces the whole button content, single mode (receives `{ $implicit, checked }`). */\n contentTemplate = input<TemplateRef<ToggleButtonStateContext>>();\n /** Replaces a group button's content (receives `{ $implicit, option, selected, index }`). */\n itemTemplate = input<TemplateRef<ToggleButtonItemContext<T>>>();\n\n /** Emitted on user interaction with the new model value. */\n toggleChange = output<ToggleButtonValue<T>>();\n /** Emitted when a group button is clicked (even if it does not change the value). */\n optionClick = output<ToggleButtonOptionClickEvent<T>>();\n /** Emitted when a button receives focus. */\n toggleFocus = output<FocusEvent>();\n /** Emitted when a button loses focus. */\n toggleBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly buttons = viewChildren<ElementRef<HTMLButtonElement>>('itemEl');\n\n /** @ignore */\n private readonly resolver = createOptionResolver({\n optionValue: this.optionValue,\n optionLabel: this.optionLabel,\n optionDisabled: this.optionDisabled,\n dataKey: this.dataKey,\n });\n\n constructor() {\n super();\n\n if (isDevMode()) {\n effect(() => {\n if (this.isGroup()) {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n 'Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n if (this.normalizedOptions().some((o) => o.iconOnly && !o.ariaLabel)) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n 'Icon-only option has no accessible name: add `ariaLabel` on the option.',\n );\n }\n return;\n }\n if (this.isIconOnly() && !this.ariaLabel()) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n 'Icon-only button has no accessible name: provide `ariaLabel`.',\n );\n }\n // A name that changes with the state is re-announced on focus, so the\n // control sounds like a different button depending on its value.\n if (this.hasStateLabels() && !this.ariaLabel() && !this.ariaLabelledBy()) {\n warnMissingAccessibleName(\n 'ui-toggle-button',\n '`onLabel`/`offLabel` differ: provide a state-independent `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n });\n }\n }\n\n /** @ignore Group mode: an `options` list was provided. */\n protected readonly isGroup = computed(() => !!this.options());\n\n /** @ignore */\n protected readonly iconSize = computed<UiIconSize>(() => {\n const size = this.size();\n if (size === 'small') return 'sm';\n return size === 'large' ? 'lg' : 'default';\n });\n\n /** @ignore */\n protected readonly hostClasses = computed(() => {\n const c = ['ui-toggle-button', `_${this.level()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.variant() !== 'outlined') c.push(`_${this.variant()}`);\n if (this.rounded()) c.push('_rounded');\n if (this.fluid()) c.push('_fluid');\n if (this.isGroup()) {\n c.push('_group');\n if (this.orientation() === 'vertical') c.push('_vertical');\n }\n if (this.readonly()) c.push('_readonly');\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore Only the group carries the group-level ARIA naming. */\n protected readonly groupAriaLabel = computed(() =>\n this.isGroup() ? this.ariaLabel() || null : null,\n );\n /** @ignore */\n protected readonly groupAriaLabelledBy = computed(() =>\n this.isGroup() ? this.ariaLabelledBy() || null : null,\n );\n\n // --- Single mode ------------------------------------------------------\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.trueValue());\n /** @ignore */\n protected readonly hasStateLabels = computed(\n () => !!this.onLabel() && !!this.offLabel() && this.onLabel() !== this.offLabel(),\n );\n /** @ignore Label of the current state, falling back to the shared one. */\n protected readonly currentLabel = computed(\n () => (this.checked() ? this.onLabel() : this.offLabel()) ?? this.label() ?? null,\n );\n /** @ignore Icon of the current state, falling back to the shared one. */\n protected readonly currentIcon = computed(\n () => (this.checked() ? this.onIcon() : this.offIcon()) ?? this.icon() ?? null,\n );\n /** @ignore Square button: an icon, no text. */\n protected readonly isIconOnly = computed(\n () => !this.contentTemplate() && !this.currentLabel() && !!this.currentIcon(),\n );\n /** @ignore */\n protected readonly iconBefore = computed(() => this.iconPos() === 'left');\n /** @ignore */\n protected readonly stateContext = computed<ToggleButtonStateContext>(() => ({\n $implicit: this.checked(),\n checked: this.checked(),\n }));\n /** @ignore Accessible name of the single button (never empty-stringed). */\n protected readonly buttonAriaLabel = computed(\n () => this.ariaLabel() || (this.isIconOnly() ? this.currentLabel() : null),\n );\n\n // --- Group mode -------------------------------------------------------\n\n /** @ignore Options resolved to a flat, render-ready shape. */\n protected readonly normalizedOptions = computed<NormalizedToggle[]>(() => {\n const raw = this.options() ?? [];\n const model = this.modelValue();\n const groupDisabled = this.isDisabled();\n return raw.map((option, index) => {\n const value = this.resolveValue(option);\n const selected = this.isPressed(value, model);\n const label = this.resolveLabel(option);\n const icon = this.resolveIcon(option, selected);\n return {\n key: `${this.uid}-${index}`,\n index,\n value,\n label,\n icon,\n ariaLabel: isRecord(option) ? this.resolver.asText(option['ariaLabel']) : null,\n disabled: groupDisabled || this.resolver.resolveDisabled(option),\n selected,\n iconOnly: !label && !!icon,\n original: option,\n };\n });\n });\n\n /** @ignore */\n protected itemContext(item: NormalizedToggle): ToggleButtonItemContext<T> {\n return {\n $implicit: item.original as T,\n option: item.original as T,\n selected: item.selected,\n index: item.index,\n };\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-toggle-button';\n }\n\n /** Focus the button (the first enabled one in group mode). */\n focus(options?: FocusOptions): void {\n const target = this.buttons().find((ref) => !ref.nativeElement.disabled);\n target?.nativeElement.focus(options);\n }\n\n /** @ignore Single mode: flip the boolean pair. */\n protected toggle(): void {\n if (this.isDisabled() || this.readonly()) return;\n if (this.checked() && !this.allowEmpty()) return;\n\n const next = this.checked() ? this.falseValue() : this.trueValue();\n this.modelValue.set(next);\n this.emitChange(next);\n this.toggleChange.emit(next);\n }\n\n /** @ignore Group mode: press / release one option. */\n protected toggleOption(item: NormalizedToggle, event: Event): void {\n if (item.disabled || this.readonly()) return;\n const value = item.value as T;\n const model = this.modelValue();\n const next = Array.isArray(model) ? [...(model as T[])] : [];\n const at = next.findIndex((v) => this.resolver.equals(v, value));\n let selected: boolean;\n\n if (at !== -1) {\n if (!this.allowEmpty() && next.length === 1) return;\n next.splice(at, 1);\n selected = false;\n } else {\n next.push(value);\n selected = true;\n }\n\n this.modelValue.set(next);\n this.emitChange(next);\n this.toggleChange.emit(next);\n this.optionClick.emit({\n option: item.original as T,\n value,\n index: item.index,\n selected,\n originalEvent: event,\n });\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.toggleBlur.emit(event);\n }\n\n /** @ignore Rich option shape (`{ value }`) resolves without a field mapping. */\n private resolveValue(option: unknown): unknown {\n if (!this.optionValue() && isRecord(option) && 'value' in option) return option['value'];\n return this.resolver.resolveValue(option);\n }\n\n /** @ignore An option object with no label key stays label-less (icon-only button). */\n private resolveLabel(option: unknown): string | null {\n if (!this.optionLabel() && isRecord(option) && !('label' in option)) return null;\n return this.resolver.resolveLabel(option);\n }\n\n /** @ignore */\n private resolveIcon(option: unknown, selected: boolean): string | null {\n if (selected && isRecord(option)) {\n const swapped = this.resolver.asText(option['selectedIcon']);\n if (swapped) return swapped;\n }\n const field = this.optionIcon();\n if (field) return this.resolver.asText(this.resolver.getField(option, field));\n if (isRecord(option)) return this.resolver.asText(option['icon']);\n return null;\n }\n\n /** @ignore A group's model is the array of pressed values. */\n private isPressed(value: unknown, model: ToggleButtonValue<T> | undefined): boolean {\n return Array.isArray(model) && model.some((v) => this.resolver.equals(v, value));\n }\n}\n","@if (isGroup()) {\n @for (item of normalizedOptions(); track item.key) {\n <button\n #itemEl\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"item.selected\"\n [class._icon-only]=\"item.iconOnly\"\n [disabled]=\"item.disabled\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"item.selected\"\n [attr.aria-label]=\"item.ariaLabel\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggleOption(item, $event)\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"itemContext(item)\" />\n } @else {\n @if (iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n @if (item.label) {\n <span class=\"ui-toggle-button-label\">{{ item.label }}</span>\n }\n @if (!iconBefore() && item.icon) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"item.icon\" [size]=\"iconSize()\" />\n }\n }\n </button>\n }\n} @else {\n <button\n #itemEl\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-toggle-button-item\"\n [class._selected]=\"checked()\"\n [class._icon-only]=\"isIconOnly()\"\n [id]=\"resolvedId()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"name()\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-pressed]=\"checked()\"\n [attr.aria-label]=\"buttonAriaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (click)=\"toggle()\"\n (focus)=\"toggleFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n >\n @if (contentTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else {\n @if (iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n @if (currentLabel()) {\n <span class=\"ui-toggle-button-label\">{{ currentLabel() }}</span>\n }\n @if (!iconBefore()) {\n <ng-container [ngTemplateOutlet]=\"singleIcon\" />\n }\n }\n </button>\n}\n\n<ng-template #singleIcon>\n @if (iconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"stateContext()\" />\n } @else if (currentIcon(); as iconName) {\n <ui-icon class=\"ui-toggle-button-icon\" [name]=\"iconName\" [size]=\"iconSize()\" />\n }\n</ng-template>\n","/*\n * Public API Sur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AAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAavB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAf1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAA,SAAA,EAGxB;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;qBAC3F,EAAA,IAAA,EACK;AACJ,wBAAA,SAAS,EAAE,eAAe;AAC1B,wBAAA,aAAa,EAAE,4BAA4B;AAC3C,wBAAA,mBAAmB,EAAE,kBAAkB;AACvC,wBAAA,wBAAwB,EAAE,uBAAuB;AAClD,qBAAA,EAAA,QAAA,EAAA,qpFAAA,EAAA,MAAA,EAAA,CAAA,s4TAAA,CAAA,EAAA;gyFAyEsE,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzNjF;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -211,6 +211,11 @@ class BaseFormField extends BaseFieldControl {
|
|
|
211
211
|
/** Error message shown in place of the helper when the field is in error. */
|
|
212
212
|
this.errorText = input(/* @ts-ignore */
|
|
213
213
|
...(ngDevMode ? [undefined, { debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
214
|
+
/** Prefixes the message under the field (helper or error) with a decorative icon. */
|
|
215
|
+
this.showMessageIcon = input(false, { ...(ngDevMode ? { debugName: "showMessageIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
216
|
+
/** Overrides the glyph shown by `showMessageIcon`. */
|
|
217
|
+
this.messageIcon = input(/* @ts-ignore */
|
|
218
|
+
...(ngDevMode ? [undefined, { debugName: "messageIcon" }] : /* istanbul ignore next */ []));
|
|
214
219
|
/** Size. */
|
|
215
220
|
this.size = input('default', /* @ts-ignore */
|
|
216
221
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -242,11 +247,11 @@ class BaseFormField extends BaseFieldControl {
|
|
|
242
247
|
...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
243
248
|
}
|
|
244
249
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: BaseFormField, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
245
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.2", type: BaseFormField, isStandalone: true, inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
250
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.2", type: BaseFormField, isStandalone: true, inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, showMessageIcon: { classPropertyName: "showMessageIcon", publicName: "showMessageIcon", isSignal: true, isRequired: false, transformFunction: null }, messageIcon: { classPropertyName: "messageIcon", publicName: "messageIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, floatLabel: { classPropertyName: "floatLabel", publicName: "floatLabel", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
|
|
246
251
|
}
|
|
247
252
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: BaseFormField, decorators: [{
|
|
248
253
|
type: Directive
|
|
249
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }] } });
|
|
254
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], showMessageIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMessageIcon", required: false }] }], messageIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageIcon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], floatLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatLabel", required: false }] }] } });
|
|
250
255
|
|
|
251
256
|
/**
|
|
252
257
|
* Standard dropdown-panel anchoring shared by the overlay form fields
|