@spartan-ng/brain 0.0.1-alpha.601 → 0.0.1-alpha.603

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.
@@ -51,7 +51,7 @@ class BrnSelectOption {
51
51
  selected = computed(() => this.value() !== undefined && this._select.isSelected(this.value()));
52
52
  _active = signal(false);
53
53
  checkedState = computed(() => (this.selected() ? 'checked' : 'unchecked'));
54
- dir = this._select.dir;
54
+ dir = this._select.direction;
55
55
  select() {
56
56
  if (this._disabled()) {
57
57
  return;
@@ -80,7 +80,7 @@ class BrnSelectOption {
80
80
  this._active.set(true);
81
81
  }
82
82
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: BrnSelectOption, deps: [], target: i0.ɵɵFactoryTarget.Directive });
83
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.7", type: BrnSelectOption, isStandalone: true, selector: "[brnOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select()", "mouseenter": "activate()", "blur": "setInactiveStyles()" }, properties: { "id": "id()", "attr.aria-selected": "selected()", "attr.aria-disabled": "_disabled()", "attr.dir": "_select.dir()", "attr.data-active": "_active() ? '' : undefined", "attr.data-disabled": "_disabled() ? '' : undefined", "tabindex": "-1" } }, ngImport: i0 });
83
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.7", type: BrnSelectOption, isStandalone: true, selector: "[brnOption]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, _disabled: { classPropertyName: "_disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "option" }, listeners: { "click": "select()", "mouseenter": "activate()", "blur": "setInactiveStyles()" }, properties: { "id": "id()", "attr.aria-selected": "selected()", "attr.aria-disabled": "_disabled()", "attr.dir": "_select.direction()", "attr.data-active": "_active() ? '' : undefined", "attr.data-disabled": "_disabled() ? '' : undefined", "tabindex": "-1" } }, ngImport: i0 });
84
84
  }
85
85
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: BrnSelectOption, decorators: [{
86
86
  type: Directive,
@@ -92,7 +92,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
92
92
  '[attr.aria-selected]': 'selected()',
93
93
  '[attr.aria-disabled]': '_disabled()',
94
94
  '(click)': 'select()',
95
- '[attr.dir]': '_select.dir()',
95
+ '[attr.dir]': '_select.direction()',
96
96
  '[attr.data-active]': "_active() ? '' : undefined",
97
97
  '[attr.data-disabled]': "_disabled() ? '' : undefined",
98
98
  '(mouseenter)': 'activate()',
@@ -249,7 +249,7 @@ class BrnSelectContent {
249
249
  }
250
250
  }
251
251
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: BrnSelectContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
252
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.7", type: BrnSelectContent, isStandalone: true, selector: "brn-select-content, hlm-select-content:not(noHlm)", host: { attributes: { "role": "listbox", "aria-orientation": "vertical" }, listeners: { "keydown": "keyManager?.onKeydown($event)", "keydown.enter": "selectActiveItem($event)", "keydown.space": "selectActiveItem($event)" }, properties: { "attr.aria-multiselectable": "_select.multiple()", "attr.aria-disabled": "_select.disabled() || _select.formDisabled()", "attr.aria-labelledBy": "_select.labelId()", "attr.aria-controlledBy": "_select.id() +'--trigger'", "id": "_select.id() + '--content'", "attr.dir": "_select.dir()", "style": "{ display: 'flex', flexDirection: 'column', outline: 'none', pointerEvents: 'auto' }" } }, providers: [provideBrnSelectContent(BrnSelectContent)], queries: [{ propertyName: "_scrollUpBtn", first: true, predicate: BrnSelectScrollUp, descendants: true, isSignal: true }, { propertyName: "_scrollDownBtn", first: true, predicate: BrnSelectScrollDown, descendants: true, isSignal: true }, { propertyName: "_options", predicate: BrnSelectOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_viewport", first: true, predicate: ["viewport"], descendants: true, isSignal: true }], ngImport: i0, template: `
252
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.7", type: BrnSelectContent, isStandalone: true, selector: "brn-select-content, hlm-select-content:not(noHlm)", host: { attributes: { "role": "listbox", "aria-orientation": "vertical" }, listeners: { "keydown": "keyManager?.onKeydown($event)", "keydown.enter": "selectActiveItem($event)", "keydown.space": "selectActiveItem($event)" }, properties: { "attr.aria-multiselectable": "_select.multiple()", "attr.aria-disabled": "_select.disabled() || _select.formDisabled()", "attr.aria-labelledBy": "_select.labelId()", "attr.aria-controlledBy": "_select.id() +'--trigger'", "id": "_select.id() + '--content'", "attr.dir": "_select.direction()", "style": "{ display: 'flex', flexDirection: 'column', outline: 'none', pointerEvents: 'auto' }" } }, providers: [provideBrnSelectContent(BrnSelectContent)], queries: [{ propertyName: "_scrollUpBtn", first: true, predicate: BrnSelectScrollUp, descendants: true, isSignal: true }, { propertyName: "_scrollDownBtn", first: true, predicate: BrnSelectScrollDown, descendants: true, isSignal: true }, { propertyName: "_options", predicate: BrnSelectOption, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_viewport", first: true, predicate: ["viewport"], descendants: true, isSignal: true }], ngImport: i0, template: `
253
253
  <ng-template #scrollUp>
254
254
  <ng-content select="hlm-select-scroll-up" />
255
255
  <ng-content select="brnSelectScrollUp" />
@@ -285,7 +285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
285
285
  '[attr.aria-labelledBy]': '_select.labelId()',
286
286
  '[attr.aria-controlledBy]': "_select.id() +'--trigger'",
287
287
  '[id]': "_select.id() + '--content'",
288
- '[attr.dir]': '_select.dir()',
288
+ '[attr.dir]': '_select.direction()',
289
289
  '(keydown)': 'keyManager?.onKeydown($event)',
290
290
  '(keydown.enter)': 'selectActiveItem($event)',
291
291
  '(keydown.space)': 'selectActiveItem($event)',
@@ -330,10 +330,8 @@ class BrnSelect {
330
330
  disabled = input(false, {
331
331
  transform: booleanAttribute,
332
332
  });
333
- dirInput = input(undefined, {
334
- alias: 'dir',
335
- });
336
- dir = computed(() => this.dirInput() ?? this._dir.valueSignal());
333
+ /** internal **/
334
+ direction = this._dir.valueSignal;
337
335
  closeDelay = input(100, {
338
336
  transform: numberAttribute,
339
337
  });
@@ -496,7 +494,7 @@ class BrnSelect {
496
494
  return false;
497
495
  }
498
496
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: BrnSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
499
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.7", type: BrnSelect, isStandalone: true, selector: "brn-select, hlm-select", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", value: "valueChange", valueChange: "valueChange" }, providers: [
497
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.7", type: BrnSelect, isStandalone: true, selector: "brn-select, hlm-select", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, closeDelay: { classPropertyName: "closeDelay", publicName: "closeDelay", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", value: "valueChange", valueChange: "valueChange" }, providers: [
500
498
  provideExposedSideProviderExisting((() => BrnSelect)),
501
499
  provideExposesStateProviderExisting((() => BrnSelect)),
502
500
  provideBrnSelect(BrnSelect),
@@ -668,7 +666,7 @@ class BrnSelectTrigger {
668
666
  this._elementRef.nativeElement.focus();
669
667
  }
670
668
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: BrnSelectTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
671
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.7", type: BrnSelectTrigger, isStandalone: true, selector: "[brnSelectTrigger]", host: { attributes: { "type": "button", "role": "combobox", "aria-autocomplete": "none" }, listeners: { "keydown.ArrowDown": "_select.show()" }, properties: { "attr.id": "_triggerId()", "disabled": "_disabled()", "attr.aria-expanded": "_select.open()", "attr.aria-controls": "_contentId()", "attr.aria-labelledBy": "_labelledBy()", "attr.dir": "_select.dir()", "class.ng-invalid": "_ngControl?.invalid || null", "class.ng-dirty": "_ngControl?.dirty || null", "class.ng-valid": "_ngControl?.valid || null", "class.ng-touched": "_ngControl?.touched || null", "class.ng-untouched": "_ngControl?.untouched || null", "class.ng-pristine": "_ngControl?.pristine || null" } }, ngImport: i0 });
669
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.7", type: BrnSelectTrigger, isStandalone: true, selector: "[brnSelectTrigger]", host: { attributes: { "type": "button", "role": "combobox", "aria-autocomplete": "none" }, listeners: { "keydown.ArrowDown": "_select.show()" }, properties: { "attr.id": "_triggerId()", "disabled": "_disabled()", "attr.aria-expanded": "_select.open()", "attr.aria-controls": "_contentId()", "attr.aria-labelledBy": "_labelledBy()", "attr.dir": "_select.direction()", "class.ng-invalid": "_ngControl?.invalid || null", "class.ng-dirty": "_ngControl?.dirty || null", "class.ng-valid": "_ngControl?.valid || null", "class.ng-touched": "_ngControl?.touched || null", "class.ng-untouched": "_ngControl?.untouched || null", "class.ng-pristine": "_ngControl?.pristine || null" } }, ngImport: i0 });
672
670
  }
673
671
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImport: i0, type: BrnSelectTrigger, decorators: [{
674
672
  type: Directive,
@@ -683,7 +681,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.7", ngImpor
683
681
  '[attr.aria-controls]': '_contentId()',
684
682
  '[attr.aria-labelledBy]': '_labelledBy()',
685
683
  'aria-autocomplete': 'none',
686
- '[attr.dir]': '_select.dir()',
684
+ '[attr.dir]': '_select.direction()',
687
685
  '[class.ng-invalid]': '_ngControl?.invalid || null',
688
686
  '[class.ng-dirty]': '_ngControl?.dirty || null',
689
687
  '[class.ng-valid]': '_ngControl?.valid || null',
@@ -728,7 +726,7 @@ class BrnSelectValue {
728
726
  return null;
729
727
  }
730
728
  const selectedLabels = selectedOption.map((option) => option?.getLabel());
731
- if (this._select.dir() === 'rtl') {
729
+ if (this._select.direction() === 'rtl') {
732
730
  selectedLabels.reverse();
733
731
  }
734
732
  return this.transformFn()(selectedLabels);