@ship-ui/core 0.13.26 → 0.13.28
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.
|
@@ -3135,17 +3135,15 @@ class ShipSelectComponent {
|
|
|
3135
3135
|
return;
|
|
3136
3136
|
this.open();
|
|
3137
3137
|
});
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
});
|
|
3148
|
-
}
|
|
3138
|
+
input.addEventListener('input', (e) => {
|
|
3139
|
+
const newInputValue = e.target.value;
|
|
3140
|
+
const inputValue = this.inputValue();
|
|
3141
|
+
if (newInputValue === inputValue)
|
|
3142
|
+
return;
|
|
3143
|
+
this.focusedOptionIndex.set(this.asFreeText() ? -1 : 0);
|
|
3144
|
+
this.inputValue.set(newInputValue);
|
|
3145
|
+
this.updateInputElValue();
|
|
3146
|
+
});
|
|
3149
3147
|
input.addEventListener('inputValueChanged', (event) => {
|
|
3150
3148
|
const newInputValue = event.detail.value;
|
|
3151
3149
|
const inputValue = this.inputValue();
|
|
@@ -3193,7 +3191,7 @@ class ShipSelectComponent {
|
|
|
3193
3191
|
}
|
|
3194
3192
|
if (e.key === 'Enter') {
|
|
3195
3193
|
e.preventDefault();
|
|
3196
|
-
this.toggleOptionByIndex(this.focusedOptionIndex());
|
|
3194
|
+
this.toggleOptionByIndex(this.focusedOptionIndex(), undefined, true);
|
|
3197
3195
|
}
|
|
3198
3196
|
if (e.key === 'ArrowDown') {
|
|
3199
3197
|
e.preventDefault();
|
|
@@ -3390,7 +3388,7 @@ class ShipSelectComponent {
|
|
|
3390
3388
|
return '';
|
|
3391
3389
|
return label.replaceAll(' ', '-');
|
|
3392
3390
|
}
|
|
3393
|
-
toggleOptionByIndex(optionIndex, event) {
|
|
3391
|
+
toggleOptionByIndex(optionIndex, event, enterKey = false) {
|
|
3394
3392
|
let option = this.filteredOptions()[optionIndex];
|
|
3395
3393
|
if (this.asFreeText() && optionIndex === -1) {
|
|
3396
3394
|
const newOption = this.computedFreeTextOption();
|
|
@@ -3587,7 +3585,7 @@ class ShipSelectComponent {
|
|
|
3587
3585
|
@let _selOptionTemplate = _selectedOptionTemplate || _optionTemplate || _inlineTemplate;
|
|
3588
3586
|
@let _listOptionTemplate = _optionTemplate || _inlineTemplate;
|
|
3589
3587
|
@let _asChips = !asText() && selectMultiple();
|
|
3590
|
-
@let _showSearchText = isOpen() && hasSearch() && (_asChips || inputValue().length >
|
|
3588
|
+
@let _showSearchText = isOpen() && hasSearch() && (_asChips || inputValue().length > -1);
|
|
3591
3589
|
|
|
3592
3590
|
<sh-popover
|
|
3593
3591
|
#formFieldWrapper
|
|
@@ -3756,7 +3754,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3756
3754
|
@let _selOptionTemplate = _selectedOptionTemplate || _optionTemplate || _inlineTemplate;
|
|
3757
3755
|
@let _listOptionTemplate = _optionTemplate || _inlineTemplate;
|
|
3758
3756
|
@let _asChips = !asText() && selectMultiple();
|
|
3759
|
-
@let _showSearchText = isOpen() && hasSearch() && (_asChips || inputValue().length >
|
|
3757
|
+
@let _showSearchText = isOpen() && hasSearch() && (_asChips || inputValue().length > -1);
|
|
3760
3758
|
|
|
3761
3759
|
<sh-popover
|
|
3762
3760
|
#formFieldWrapper
|
|
@@ -3968,7 +3966,7 @@ class ShipSidenavComponent {
|
|
|
3968
3966
|
return dragPosition;
|
|
3969
3967
|
}, ...(ngDevMode ? [{ debugName: "dragActualPositionX" }] : []));
|
|
3970
3968
|
this.draggingStyle = computed(() => {
|
|
3971
|
-
if (!this.isOverlay())
|
|
3969
|
+
if (!this.isOverlay() || this.disableDrag())
|
|
3972
3970
|
return null;
|
|
3973
3971
|
if (this.isDragging()) {
|
|
3974
3972
|
return `translateX(${this.dragActualPositionX()}px)`;
|
|
@@ -3976,7 +3974,7 @@ class ShipSidenavComponent {
|
|
|
3976
3974
|
return this.isOpen() ? `translateX(${this.openWidth}px)` : `translateX(0px)`;
|
|
3977
3975
|
}, ...(ngDevMode ? [{ debugName: "draggingStyle" }] : []));
|
|
3978
3976
|
this.draggingEffect = effect(() => {
|
|
3979
|
-
if (typeof document === 'undefined')
|
|
3977
|
+
if (typeof document === 'undefined' || this.disableDrag())
|
|
3980
3978
|
return;
|
|
3981
3979
|
if (this.isDragging()) {
|
|
3982
3980
|
document.body.classList.add('dragging');
|
|
@@ -4051,7 +4049,7 @@ class ShipSidenavComponent {
|
|
|
4051
4049
|
}
|
|
4052
4050
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ShipSidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4053
4051
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ShipSidenavComponent, isStandalone: true, selector: "sh-sidenav", inputs: { disableDrag: { classPropertyName: "disableDrag", publicName: "disableDrag", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange" }, host: { properties: { "class.open": "isOpen()", "class.closed": "!isOpen()", "class.is-dragging": "isDragging()" } }, viewQueries: [{ propertyName: "dragImageElement", first: true, predicate: ["dragImageElement"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
4054
|
-
@if (isOverlay()) {
|
|
4052
|
+
@if (isOverlay() && !disableDrag()) {
|
|
4055
4053
|
<div #dragImageElement class="drag-image"></div>
|
|
4056
4054
|
}
|
|
4057
4055
|
|
|
@@ -4063,7 +4061,7 @@ class ShipSidenavComponent {
|
|
|
4063
4061
|
<ng-content select="[sidenav]"></ng-content>
|
|
4064
4062
|
</div>
|
|
4065
4063
|
|
|
4066
|
-
<div class="main-wrap" [style.transform]="draggingStyle()">
|
|
4064
|
+
<div class="main-wrap" [style.transform]="!disableDrag() && draggingStyle()">
|
|
4067
4065
|
@if (isOverlay() && !disableDrag()) {
|
|
4068
4066
|
<div
|
|
4069
4067
|
class="dragable"
|
|
@@ -4092,7 +4090,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4092
4090
|
args: [{
|
|
4093
4091
|
selector: 'sh-sidenav',
|
|
4094
4092
|
template: `
|
|
4095
|
-
@if (isOverlay()) {
|
|
4093
|
+
@if (isOverlay() && !disableDrag()) {
|
|
4096
4094
|
<div #dragImageElement class="drag-image"></div>
|
|
4097
4095
|
}
|
|
4098
4096
|
|
|
@@ -4104,7 +4102,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4104
4102
|
<ng-content select="[sidenav]"></ng-content>
|
|
4105
4103
|
</div>
|
|
4106
4104
|
|
|
4107
|
-
<div class="main-wrap" [style.transform]="draggingStyle()">
|
|
4105
|
+
<div class="main-wrap" [style.transform]="!disableDrag() && draggingStyle()">
|
|
4108
4106
|
@if (isOverlay() && !disableDrag()) {
|
|
4109
4107
|
<div
|
|
4110
4108
|
class="dragable"
|