@besaitech/ng-design-system 0.0.37 → 0.0.38

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.
@@ -3156,6 +3156,7 @@ class SdsSelect {
3156
3156
  hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
3157
3157
  error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
3158
3158
  size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
3159
+ appearance = input('default', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
3159
3160
  disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
3160
3161
  clearable = input(false, ...(ngDevMode ? [{ debugName: "clearable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
3161
3162
  filter = input(false, ...(ngDevMode ? [{ debugName: "filter", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
@@ -3169,6 +3170,8 @@ class SdsSelect {
3169
3170
  trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
3170
3171
  panelEl = null;
3171
3172
  isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
3173
+ filled = computed(() => this.appearance() === 'filled', ...(ngDevMode ? [{ debugName: "filled" }] : []));
3174
+ onBrand = computed(() => this.appearance() === 'on-brand', ...(ngDevMode ? [{ debugName: "onBrand" }] : []));
3172
3175
  normalizedOptions = computed(() => this.options().map((o) => this.norm(o)), ...(ngDevMode ? [{ debugName: "normalizedOptions" }] : []));
3173
3176
  filteredOptions = computed(() => {
3174
3177
  const f = this.filterText().trim().toLowerCase();
@@ -3182,9 +3185,26 @@ class SdsSelect {
3182
3185
  activeDescId = computed(() => this.highlightedIndex() >= 0 ? this.optionId(this.highlightedIndex()) : null, ...(ngDevMode ? [{ debugName: "activeDescId" }] : []));
3183
3186
  wrapperClasses = computed(() => {
3184
3187
  const parts = [SIZES$4[this.size()]];
3185
- parts.push(this.error()
3186
- ? 'border-danger focus:border-danger focus:ring-2 focus:ring-danger/25'
3187
- : 'border-border focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25');
3188
+ if (this.filled()) {
3189
+ // border-transparent (not border-0) so a filled field is the same height as a bordered one when a
3190
+ // form mixes them — mirrors sds-input's filled appearance.
3191
+ parts.push('border-transparent bg-muted text-ink');
3192
+ parts.push(this.error()
3193
+ ? 'border-danger focus:ring-2 focus:ring-danger/25'
3194
+ : 'focus:ring-2 focus:ring-brand-500/25');
3195
+ }
3196
+ else if (this.onBrand()) {
3197
+ parts.push('bg-white/10 text-white');
3198
+ parts.push(this.error()
3199
+ ? 'border-danger focus:ring-2 focus:ring-danger/25'
3200
+ : 'border-white/15 focus:border-white/40 focus:ring-2 focus:ring-white/20');
3201
+ }
3202
+ else {
3203
+ parts.push('bg-white text-ink');
3204
+ parts.push(this.error()
3205
+ ? 'border-danger focus:border-danger focus:ring-2 focus:ring-danger/25'
3206
+ : 'border-border focus:border-brand-500 focus:ring-2 focus:ring-brand-500/25');
3207
+ }
3188
3208
  parts.push(this.isDisabled()
3189
3209
  ? 'opacity-60 cursor-not-allowed pointer-events-none'
3190
3210
  : 'cursor-pointer');
@@ -3470,7 +3490,7 @@ class SdsSelect {
3470
3490
  this.close();
3471
3491
  }
3472
3492
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
3473
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsSelect, isStandalone: true, selector: "sds-select", inputs: { 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 }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", 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 }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onDocumentClick($event)" }, classAttribute: "block" }, providers: [
3493
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdsSelect, isStandalone: true, selector: "sds-select", inputs: { 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 }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, filterPlaceholder: { classPropertyName: "filterPlaceholder", publicName: "filterPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onDocumentClick($event)" }, classAttribute: "block" }, providers: [
3474
3494
  { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SdsSelect), multi: true },
3475
3495
  ], viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
3476
3496
  @if (label()) {
@@ -3490,7 +3510,7 @@ class SdsSelect {
3490
3510
  [attr.aria-haspopup]="'listbox'"
3491
3511
  [attr.aria-activedescendant]="open() ? activeDescId() : null"
3492
3512
  [attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
3493
- class="relative flex items-center rounded-control border bg-white transition-colors focus:outline-none"
3513
+ class="relative flex items-center rounded-control border transition-colors focus:outline-none"
3494
3514
  [class]="wrapperClasses()"
3495
3515
  (click)="toggle()"
3496
3516
  (keydown)="onTriggerKeydown($event)"
@@ -3515,7 +3535,7 @@ class SdsSelect {
3515
3535
  }
3516
3536
 
3517
3537
  <span
3518
- class="mr-3 ml-1 shrink-0 text-ink-soft transition-transform duration-150"
3538
+ class="mr-3 ml-1 inline-flex shrink-0 items-center justify-center text-ink-soft transition-transform duration-150"
3519
3539
  [class.rotate-180]="open()"
3520
3540
  >
3521
3541
  <sds-icon name="chevron-down" [size]="18" />
@@ -3610,7 +3630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
3610
3630
  [attr.aria-haspopup]="'listbox'"
3611
3631
  [attr.aria-activedescendant]="open() ? activeDescId() : null"
3612
3632
  [attr.aria-label]="!label() && ariaLabel() ? ariaLabel() : null"
3613
- class="relative flex items-center rounded-control border bg-white transition-colors focus:outline-none"
3633
+ class="relative flex items-center rounded-control border transition-colors focus:outline-none"
3614
3634
  [class]="wrapperClasses()"
3615
3635
  (click)="toggle()"
3616
3636
  (keydown)="onTriggerKeydown($event)"
@@ -3635,7 +3655,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
3635
3655
  }
3636
3656
 
3637
3657
  <span
3638
- class="mr-3 ml-1 shrink-0 text-ink-soft transition-transform duration-150"
3658
+ class="mr-3 ml-1 inline-flex shrink-0 items-center justify-center text-ink-soft transition-transform duration-150"
3639
3659
  [class.rotate-180]="open()"
3640
3660
  >
3641
3661
  <sds-icon name="chevron-down" [size]="18" />
@@ -3699,7 +3719,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
3699
3719
  }
3700
3720
  `,
3701
3721
  }]
3702
- }], propDecorators: { 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 }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
3722
+ }], propDecorators: { 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 }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], filterPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
3703
3723
 
3704
3724
  const SIZES$3 = {
3705
3725
  sm: 'min-h-9 text-sm',
@@ -5494,7 +5514,7 @@ class SdsPaginator {
5494
5514
  </label>
5495
5515
  }
5496
5516
  </div>
5497
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "component", type: SdsSelect, selector: "sds-select", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "dataKey", "placeholder", "label", "ariaLabel", "hint", "error", "size", "disabled", "clearable", "filter", "filterPlaceholder", "emptyMessage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5517
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SdsIcon, selector: "sds-icon", inputs: ["name", "size", "strokeWidth"] }, { kind: "component", type: SdsSelect, selector: "sds-select", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "dataKey", "placeholder", "label", "ariaLabel", "hint", "error", "size", "appearance", "disabled", "clearable", "filter", "filterPlaceholder", "emptyMessage"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5498
5518
  }
5499
5519
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdsPaginator, decorators: [{
5500
5520
  type: Component,