@ship-ui/core 0.13.18 → 0.13.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ship-ui-core.mjs +32 -3
- package/fesm2022/ship-ui-core.mjs.map +1 -1
- package/index.d.ts +4 -1
- package/package.json +1 -1
- package/styles/components/ship-menu.component.scss +1 -0
- package/styles/components/ship-popover.component.scss +1 -0
- package/styles/components/ship-select.component.scss +12 -0
|
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, ElementRef, Renderer2, ChangeDetectionStrategy, Component, input, computed, viewChild, effect, HostListener, NgModule, signal, Injectable, InjectionToken, model, output, ApplicationRef, createComponent, isSignal, OutputEmitterRef, contentChildren, afterNextRender, assertInInjectionContext, Injector, DestroyRef, HostBinding, contentChild, TemplateRef, runInInjectionContext, Directive, ChangeDetectorRef, viewChildren, ViewContainerRef, EnvironmentInjector } from '@angular/core';
|
|
3
3
|
import { DatePipe, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { SIGNAL } from '@angular/core/primitives/signals';
|
|
5
|
+
import { ShipDividerComponent as ShipDividerComponent$1 } from 'ship-ui';
|
|
5
6
|
|
|
6
7
|
const iconTypes = ['bold', 'thin', 'light', 'fill'];
|
|
7
8
|
class ShipIconComponent {
|
|
@@ -3015,6 +3016,9 @@ class ShipSelectComponent {
|
|
|
3015
3016
|
this.value = input();
|
|
3016
3017
|
this.label = input();
|
|
3017
3018
|
this.asFreeText = input(false);
|
|
3019
|
+
this.optionTitle = input(null);
|
|
3020
|
+
this.freeTextTitle = input(null);
|
|
3021
|
+
this.freeTextPlaceholder = input('Type to create a new option');
|
|
3018
3022
|
this.validateFreeText = input();
|
|
3019
3023
|
this.placeholder = input();
|
|
3020
3024
|
this.readonly = model(false);
|
|
@@ -3188,7 +3192,7 @@ class ShipSelectComponent {
|
|
|
3188
3192
|
e.preventDefault();
|
|
3189
3193
|
this.close();
|
|
3190
3194
|
}
|
|
3191
|
-
if (e.key === 'Enter'
|
|
3195
|
+
if (e.key === 'Enter') {
|
|
3192
3196
|
e.preventDefault();
|
|
3193
3197
|
this.toggleOptionByIndex(this.focusedOptionIndex());
|
|
3194
3198
|
}
|
|
@@ -3572,7 +3576,7 @@ class ShipSelectComponent {
|
|
|
3572
3576
|
}
|
|
3573
3577
|
}
|
|
3574
3578
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ShipSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3575
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: ShipSelectComponent, isStandalone: true, selector: "sh-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, asFreeText: { classPropertyName: "asFreeText", publicName: "asFreeText", isSignal: true, isRequired: false, transformFunction: null }, validateFreeText: { classPropertyName: "validateFreeText", publicName: "validateFreeText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, lazySearch: { classPropertyName: "lazySearch", publicName: "lazySearch", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, asText: { classPropertyName: "asText", publicName: "asText", isSignal: true, isRequired: false, transformFunction: null }, isClearable: { classPropertyName: "isClearable", publicName: "isClearable", isSignal: true, isRequired: false, transformFunction: null }, selectMultiple: { classPropertyName: "selectMultiple", publicName: "selectMultiple", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, selectedOptionTemplate: { classPropertyName: "selectedOptionTemplate", publicName: "selectedOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, placeholderTemplate: { classPropertyName: "placeholderTemplate", publicName: "placeholderTemplate", isSignal: true, isRequired: false, transformFunction: null }, freeTextOptionTemplate: { classPropertyName: "freeTextOptionTemplate", publicName: "freeTextOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selectedOptions: { classPropertyName: "selectedOptions", publicName: "selectedOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { readonly: "readonlyChange", disabled: "disabledChange", isOpen: "isOpenChange", isLoading: "isLoadingChange", options: "optionsChange", selectedOptions: "selectedOptionsChange", cleared: "cleared", onAddNewFreeTextOption: "onAddNewFreeTextOption" }, host: { properties: { "class.multiple": "selectMultiple()" } }, queries: [{ propertyName: "inlineTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsWrapRef", first: true, predicate: ["optionsWrap"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3579
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.4", type: ShipSelectComponent, isStandalone: true, selector: "sh-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, asFreeText: { classPropertyName: "asFreeText", publicName: "asFreeText", isSignal: true, isRequired: false, transformFunction: null }, optionTitle: { classPropertyName: "optionTitle", publicName: "optionTitle", isSignal: true, isRequired: false, transformFunction: null }, freeTextTitle: { classPropertyName: "freeTextTitle", publicName: "freeTextTitle", isSignal: true, isRequired: false, transformFunction: null }, freeTextPlaceholder: { classPropertyName: "freeTextPlaceholder", publicName: "freeTextPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, validateFreeText: { classPropertyName: "validateFreeText", publicName: "validateFreeText", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, lazySearch: { classPropertyName: "lazySearch", publicName: "lazySearch", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, asText: { classPropertyName: "asText", publicName: "asText", isSignal: true, isRequired: false, transformFunction: null }, isClearable: { classPropertyName: "isClearable", publicName: "isClearable", isSignal: true, isRequired: false, transformFunction: null }, selectMultiple: { classPropertyName: "selectMultiple", publicName: "selectMultiple", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, selectedOptionTemplate: { classPropertyName: "selectedOptionTemplate", publicName: "selectedOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, placeholderTemplate: { classPropertyName: "placeholderTemplate", publicName: "placeholderTemplate", isSignal: true, isRequired: false, transformFunction: null }, freeTextOptionTemplate: { classPropertyName: "freeTextOptionTemplate", publicName: "freeTextOptionTemplate", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selectedOptions: { classPropertyName: "selectedOptions", publicName: "selectedOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { readonly: "readonlyChange", disabled: "disabledChange", isOpen: "isOpenChange", isLoading: "isLoadingChange", options: "optionsChange", selectedOptions: "selectedOptionsChange", cleared: "cleared", onAddNewFreeTextOption: "onAddNewFreeTextOption" }, host: { properties: { "class.multiple": "selectMultiple()" } }, queries: [{ propertyName: "inlineTemplate", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "optionsWrapRef", first: true, predicate: ["optionsWrap"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3576
3580
|
@let _placeholderTemplate = placeholderTemplate();
|
|
3577
3581
|
@let _optionTemplate = optionTemplate();
|
|
3578
3582
|
@let _freeTextOptionTemplate = freeTextOptionTemplate();
|
|
@@ -3672,6 +3676,10 @@ class ShipSelectComponent {
|
|
|
3672
3676
|
@let freeTextOptionValue = getValue(freeTextOption);
|
|
3673
3677
|
|
|
3674
3678
|
@if ($any(freeTextOptionValue).length > 0) {
|
|
3679
|
+
@if (freeTextTitle()) {
|
|
3680
|
+
<p title>{{ freeTextTitle() }}</p>
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3675
3683
|
<li
|
|
3676
3684
|
(click)="toggleOptionByIndex(-1)"
|
|
3677
3685
|
class="option"
|
|
@@ -3689,9 +3697,17 @@ class ShipSelectComponent {
|
|
|
3689
3697
|
{{ freeTextOptionValue }}
|
|
3690
3698
|
}
|
|
3691
3699
|
</li>
|
|
3700
|
+
|
|
3701
|
+
@if (freeTextTitle() && filteredOptions().length > 0) {
|
|
3702
|
+
<sh-divider />
|
|
3703
|
+
}
|
|
3692
3704
|
}
|
|
3693
3705
|
}
|
|
3694
3706
|
|
|
3707
|
+
@if (optionTitle() && filteredOptions().length > 0) {
|
|
3708
|
+
<p title>{{ optionTitle() }}</p>
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3695
3711
|
@for (option of filteredOptions(); track $index) {
|
|
3696
3712
|
<li
|
|
3697
3713
|
(click)="toggleOptionByIndex($index)"
|
|
@@ -3713,7 +3729,7 @@ class ShipSelectComponent {
|
|
|
3713
3729
|
}
|
|
3714
3730
|
</div>
|
|
3715
3731
|
</sh-popover>
|
|
3716
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ShipPopoverComponent, selector: "sh-popover", inputs: ["asMultiLayer", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormFieldComponent, selector: "sh-form-field" }, { kind: "component", type: ShipIconComponent, selector: "sh-icon" }, { kind: "component", type: ShipCheckboxComponent, selector: "sh-checkbox" }, { kind: "component", type: ShipSpinnerComponent, selector: "sh-spinner" }, { kind: "component", type: ShipChipComponent, selector: "sh-chip" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3732
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ShipPopoverComponent, selector: "sh-popover", inputs: ["asMultiLayer", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormFieldComponent, selector: "sh-form-field" }, { kind: "component", type: ShipIconComponent, selector: "sh-icon" }, { kind: "component", type: ShipCheckboxComponent, selector: "sh-checkbox" }, { kind: "component", type: ShipSpinnerComponent, selector: "sh-spinner" }, { kind: "component", type: ShipChipComponent, selector: "sh-chip" }, { kind: "component", type: ShipDividerComponent$1, selector: "sh-divider" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3717
3733
|
}
|
|
3718
3734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: ShipSelectComponent, decorators: [{
|
|
3719
3735
|
type: Component,
|
|
@@ -3727,6 +3743,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
3727
3743
|
ShipCheckboxComponent,
|
|
3728
3744
|
ShipSpinnerComponent,
|
|
3729
3745
|
ShipChipComponent,
|
|
3746
|
+
ShipDividerComponent$1,
|
|
3730
3747
|
],
|
|
3731
3748
|
template: `
|
|
3732
3749
|
@let _placeholderTemplate = placeholderTemplate();
|
|
@@ -3828,6 +3845,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
3828
3845
|
@let freeTextOptionValue = getValue(freeTextOption);
|
|
3829
3846
|
|
|
3830
3847
|
@if ($any(freeTextOptionValue).length > 0) {
|
|
3848
|
+
@if (freeTextTitle()) {
|
|
3849
|
+
<p title>{{ freeTextTitle() }}</p>
|
|
3850
|
+
}
|
|
3851
|
+
|
|
3831
3852
|
<li
|
|
3832
3853
|
(click)="toggleOptionByIndex(-1)"
|
|
3833
3854
|
class="option"
|
|
@@ -3845,9 +3866,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
3845
3866
|
{{ freeTextOptionValue }}
|
|
3846
3867
|
}
|
|
3847
3868
|
</li>
|
|
3869
|
+
|
|
3870
|
+
@if (freeTextTitle() && filteredOptions().length > 0) {
|
|
3871
|
+
<sh-divider />
|
|
3872
|
+
}
|
|
3848
3873
|
}
|
|
3849
3874
|
}
|
|
3850
3875
|
|
|
3876
|
+
@if (optionTitle() && filteredOptions().length > 0) {
|
|
3877
|
+
<p title>{{ optionTitle() }}</p>
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3851
3880
|
@for (option of filteredOptions(); track $index) {
|
|
3852
3881
|
<li
|
|
3853
3882
|
(click)="toggleOptionByIndex($index)"
|