@vallift/ngl 22.0.57 → 22.0.58

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.
@@ -15157,9 +15157,18 @@ const APPEARANCE_CLASSES = {
15157
15157
  ghost: 'bg-transparent border border-transparent text-primary hover:bg-page-secondary active:bg-surface-primary-subtle',
15158
15158
  text: 'bg-transparent border border-transparent text-primary hover:text-primary-hover active:text-primary-active',
15159
15159
  };
15160
- function getSignalButtonClasses(appearance, size, disabled, fullWidth) {
15160
+ function stripBackgroundClasses(classes) {
15161
+ return classes
15162
+ .split(/\s+/)
15163
+ .filter((token) => token && !/^(hover:|active:)?bg-/.test(token))
15164
+ .join(' ');
15165
+ }
15166
+ function getSignalButtonClasses(appearance, size, disabled, fullWidth, customFill = false) {
15161
15167
  const widthClass = fullWidth ? 'w-full' : '';
15162
- const stateClasses = disabled ? DISABLED_CLASSES : APPEARANCE_CLASSES[appearance];
15168
+ let stateClasses = disabled ? DISABLED_CLASSES : APPEARANCE_CLASSES[appearance];
15169
+ if (customFill && !disabled) {
15170
+ stateClasses = stripBackgroundClasses(stateClasses);
15171
+ }
15163
15172
  return `${BASE_CLASSES} ${SIZE_CLASSES[size]} ${stateClasses} ${widthClass}`.trim();
15164
15173
  }
15165
15174
  function getSignalButtonIconClasses(appearance, disabled) {
@@ -15202,8 +15211,11 @@ class SignalButton {
15202
15211
  ...(ngDevMode ? [{ debugName: "iconSrc" }] : /* istanbul ignore next */ []));
15203
15212
  iconSize = input(18, /* @ts-ignore */
15204
15213
  ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
15214
+ /** Optional CSS color for the button surface (e.g. `#ffffff`). Overrides appearance bg classes. */
15215
+ fillColor = input(null, /* @ts-ignore */
15216
+ ...(ngDevMode ? [{ debugName: "fillColor" }] : /* istanbul ignore next */ []));
15205
15217
  clicked = output();
15206
- buttonClasses = computed(() => getSignalButtonClasses(this.appearance(), this.size(), this.disabled(), this.fullWidth()), /* @ts-ignore */
15218
+ buttonClasses = computed(() => getSignalButtonClasses(this.appearance(), this.size(), this.disabled(), this.fullWidth(), !!this.fillColor()?.trim()), /* @ts-ignore */
15207
15219
  ...(ngDevMode ? [{ debugName: "buttonClasses" }] : /* istanbul ignore next */ []));
15208
15220
  iconClasses = computed(() => getSignalButtonIconClasses(this.appearance(), this.disabled()), /* @ts-ignore */
15209
15221
  ...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
@@ -15225,12 +15237,12 @@ class SignalButton {
15225
15237
  this.clicked.emit();
15226
15238
  }
15227
15239
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: SignalButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
15228
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: SignalButton, isStandalone: true, selector: "lib-signal-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n class=\"cursor-pointer\"\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [attr.aria-busy]=\"loading() || null\"\n (click)=\"onClick($event)\">\n @if (iconSrc()) {\n <app-svg-icon\n [src]=\"iconSrc()!\"\n [size]=\"iconSize()\"\n [class]=\"iconClasses() + (loading() ? ' invisible' : '')\" />\n }\n\n <span [class.invisible]=\"loading()\">\n <ng-content />\n </span>\n\n @if (loading()) {\n <app-spinner\n class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n [borderColor]=\"spinnerBorderClass()\" />\n }\n</button>\n", dependencies: [{ kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "component", type: SpinnerComponent, selector: "app-spinner", inputs: ["borderColor"] }] });
15240
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: SignalButton, isStandalone: true, selector: "lib-signal-button", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, fillColor: { classPropertyName: "fillColor", publicName: "fillColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n class=\"cursor-pointer\"\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [style.background-color]=\"disabled() ? null : fillColor() || null\"\n [attr.aria-busy]=\"loading() || null\"\n (click)=\"onClick($event)\">\n @if (iconSrc()) {\n <app-svg-icon\n [src]=\"iconSrc()!\"\n [size]=\"iconSize()\"\n [class]=\"iconClasses() + (loading() ? ' invisible' : '')\" />\n }\n\n <span [class.invisible]=\"loading()\">\n <ng-content />\n </span>\n\n @if (loading()) {\n <app-spinner\n class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n [borderColor]=\"spinnerBorderClass()\" />\n }\n</button>\n", dependencies: [{ kind: "component", type: AppSvgIconComponent, selector: "app-svg-icon", inputs: ["src", "stretch", "size", "svgStyle"] }, { kind: "component", type: SpinnerComponent, selector: "app-spinner", inputs: ["borderColor"] }] });
15229
15241
  }
15230
15242
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: SignalButton, decorators: [{
15231
15243
  type: Component,
15232
- args: [{ selector: 'lib-signal-button', imports: [AppSvgIconComponent, SpinnerComponent], template: "<button\n class=\"cursor-pointer\"\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [attr.aria-busy]=\"loading() || null\"\n (click)=\"onClick($event)\">\n @if (iconSrc()) {\n <app-svg-icon\n [src]=\"iconSrc()!\"\n [size]=\"iconSize()\"\n [class]=\"iconClasses() + (loading() ? ' invisible' : '')\" />\n }\n\n <span [class.invisible]=\"loading()\">\n <ng-content />\n </span>\n\n @if (loading()) {\n <app-spinner\n class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n [borderColor]=\"spinnerBorderClass()\" />\n }\n</button>\n" }]
15233
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
15244
+ args: [{ selector: 'lib-signal-button', imports: [AppSvgIconComponent, SpinnerComponent], template: "<button\n class=\"cursor-pointer\"\n [type]=\"type()\"\n [disabled]=\"disabled() || loading()\"\n [class]=\"buttonClasses()\"\n [style.background-color]=\"disabled() ? null : fillColor() || null\"\n [attr.aria-busy]=\"loading() || null\"\n (click)=\"onClick($event)\">\n @if (iconSrc()) {\n <app-svg-icon\n [src]=\"iconSrc()!\"\n [size]=\"iconSize()\"\n [class]=\"iconClasses() + (loading() ? ' invisible' : '')\" />\n }\n\n <span [class.invisible]=\"loading()\">\n <ng-content />\n </span>\n\n @if (loading()) {\n <app-spinner\n class=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\"\n [borderColor]=\"spinnerBorderClass()\" />\n }\n</button>\n" }]
15245
+ }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], fillColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "fillColor", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
15234
15246
 
15235
15247
  class SignalError {
15236
15248
  signalFormErrors = inject(SIGNAL_FORM_ERRORS);