@ship-ui/core 0.18.10 → 0.18.12
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.
|
@@ -1347,6 +1347,10 @@
|
|
|
1347
1347
|
"name": "--btn-h",
|
|
1348
1348
|
"defaultValue": "#{p2r(40)}"
|
|
1349
1349
|
},
|
|
1350
|
+
{
|
|
1351
|
+
"name": "--btn-mw",
|
|
1352
|
+
"defaultValue": "#{p2r(40)}"
|
|
1353
|
+
},
|
|
1350
1354
|
{
|
|
1351
1355
|
"name": "--btn-f",
|
|
1352
1356
|
"defaultValue": "var(--paragraph-20)"
|
|
@@ -3093,6 +3097,12 @@
|
|
|
3093
3097
|
"description": "",
|
|
3094
3098
|
"defaultValue": "false"
|
|
3095
3099
|
},
|
|
3100
|
+
{
|
|
3101
|
+
"name": "asSheetOnMobile",
|
|
3102
|
+
"type": "boolean",
|
|
3103
|
+
"description": "",
|
|
3104
|
+
"defaultValue": "false"
|
|
3105
|
+
},
|
|
3096
3106
|
{
|
|
3097
3107
|
"name": "disableOpenByClick",
|
|
3098
3108
|
"type": "boolean",
|
|
@@ -3119,6 +3129,12 @@
|
|
|
3119
3129
|
}
|
|
3120
3130
|
],
|
|
3121
3131
|
"methods": [
|
|
3132
|
+
{
|
|
3133
|
+
"name": "toggleIsOpen",
|
|
3134
|
+
"parameters": "event: MouseEvent",
|
|
3135
|
+
"returnType": "any",
|
|
3136
|
+
"description": ""
|
|
3137
|
+
},
|
|
3122
3138
|
{
|
|
3123
3139
|
"name": "eventClose",
|
|
3124
3140
|
"parameters": "$event: MouseEvent",
|
|
@@ -2931,6 +2931,7 @@ class ShipPopover {
|
|
|
2931
2931
|
this.#document = inject(DOCUMENT);
|
|
2932
2932
|
this.SUPPORTS_ANCHOR = typeof CSS !== 'undefined' && CSS.supports('position-anchor', '--abc') && CSS.supports('anchor-name', '--abc');
|
|
2933
2933
|
this.asMultiLayer = input(false, ...(ngDevMode ? [{ debugName: "asMultiLayer" }] : /* istanbul ignore next */ []));
|
|
2934
|
+
this.asSheetOnMobile = input(false, ...(ngDevMode ? [{ debugName: "asSheetOnMobile" }] : /* istanbul ignore next */ []));
|
|
2934
2935
|
this.disableOpenByClick = input(false, ...(ngDevMode ? [{ debugName: "disableOpenByClick" }] : /* istanbul ignore next */ []));
|
|
2935
2936
|
this.isOpen = model(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
2936
2937
|
this.options = input(...(ngDevMode ? [undefined, { debugName: "options" }] : /* istanbul ignore next */ []));
|
|
@@ -2945,6 +2946,7 @@ class ShipPopover {
|
|
|
2945
2946
|
this.id = signal('--' + generateUniqueId(), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
2946
2947
|
this.menuStyle = signal(null, ...(ngDevMode ? [{ debugName: "menuStyle" }] : /* istanbul ignore next */ []));
|
|
2947
2948
|
this.openAbort = null;
|
|
2949
|
+
this.#originalOverflow = null;
|
|
2948
2950
|
this.openEffect = effect(() => {
|
|
2949
2951
|
const open = this.isOpen();
|
|
2950
2952
|
queueMicrotask(() => {
|
|
@@ -2972,7 +2974,13 @@ class ShipPopover {
|
|
|
2972
2974
|
if (!popoverEl.isConnected)
|
|
2973
2975
|
return;
|
|
2974
2976
|
popoverEl.showPopover();
|
|
2975
|
-
|
|
2977
|
+
const isMobileSheet = this.asSheetOnMobile() && window.innerWidth <= 768;
|
|
2978
|
+
if (isMobileSheet) {
|
|
2979
|
+
this.#originalOverflow = this.#document.body.style.overflow;
|
|
2980
|
+
this.#document.body.style.overflow = 'hidden';
|
|
2981
|
+
this.menuStyle.set(null); // Clear any leftover inline styles
|
|
2982
|
+
}
|
|
2983
|
+
if (!this.SUPPORTS_ANCHOR && !isMobileSheet) {
|
|
2976
2984
|
setTimeout(() => {
|
|
2977
2985
|
const scrollableParent = this.#findScrollableParent(popoverEl);
|
|
2978
2986
|
scrollableParent.addEventListener('scroll', () => this.#calculateMenuPosition(), {
|
|
@@ -2990,11 +2998,16 @@ class ShipPopover {
|
|
|
2990
2998
|
popoverEl.hidePopover();
|
|
2991
2999
|
this.openAbort?.abort();
|
|
2992
3000
|
this.openAbort = null;
|
|
3001
|
+
if (this.asSheetOnMobile() && this.#originalOverflow !== null) {
|
|
3002
|
+
this.#document.body.style.overflow = this.#originalOverflow;
|
|
3003
|
+
this.#originalOverflow = null;
|
|
3004
|
+
}
|
|
2993
3005
|
}
|
|
2994
3006
|
});
|
|
2995
3007
|
}, ...(ngDevMode ? [{ debugName: "openEffect" }] : /* istanbul ignore next */ []));
|
|
2996
3008
|
}
|
|
2997
3009
|
#document;
|
|
3010
|
+
#originalOverflow;
|
|
2998
3011
|
toggleIsOpen(event) {
|
|
2999
3012
|
if (!this.disableOpenByClick()) {
|
|
3000
3013
|
event.preventDefault();
|
|
@@ -3124,7 +3137,7 @@ class ShipPopover {
|
|
|
3124
3137
|
this.openAbort = null;
|
|
3125
3138
|
}
|
|
3126
3139
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ShipPopover, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3127
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: ShipPopover, isStandalone: true, selector: "sh-popover", inputs: { asMultiLayer: { classPropertyName: "asMultiLayer", publicName: "asMultiLayer", isSignal: true, isRequired: false, transformFunction: null }, disableOpenByClick: { classPropertyName: "disableOpenByClick", publicName: "disableOpenByClick", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closed: "closed" }, host: { properties: { "class.multi-layer": "asMultiLayer()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true, isSignal: true }, { propertyName: "popoverRef", first: true, predicate: ["popoverRef"], descendants: true, isSignal: true }, { propertyName: "popoverContentRef", first: true, predicate: ["popoverContentRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.5", type: ShipPopover, isStandalone: true, selector: "sh-popover", inputs: { asMultiLayer: { classPropertyName: "asMultiLayer", publicName: "asMultiLayer", isSignal: true, isRequired: false, transformFunction: null }, asSheetOnMobile: { classPropertyName: "asSheetOnMobile", publicName: "asSheetOnMobile", isSignal: true, isRequired: false, transformFunction: null }, disableOpenByClick: { classPropertyName: "disableOpenByClick", publicName: "disableOpenByClick", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isOpen: "isOpenChange", closed: "closed" }, host: { properties: { "class.multi-layer": "asMultiLayer()", "class.as-sheet": "asSheetOnMobile()" } }, viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true, isSignal: true }, { propertyName: "popoverRef", first: true, predicate: ["popoverRef"], descendants: true, isSignal: true }, { propertyName: "popoverContentRef", first: true, predicate: ["popoverContentRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3128
3141
|
<div class="trigger" #triggerRef [attr.popovertarget]="id() + 'hello'" (click)="toggleIsOpen($event)">
|
|
3129
3142
|
<div class="trigger-wrapper">
|
|
3130
3143
|
<ng-content select="[trigger]" />
|
|
@@ -3171,9 +3184,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
3171
3184
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3172
3185
|
host: {
|
|
3173
3186
|
'[class.multi-layer]': 'asMultiLayer()',
|
|
3187
|
+
'[class.as-sheet]': 'asSheetOnMobile()',
|
|
3174
3188
|
},
|
|
3175
3189
|
}]
|
|
3176
|
-
}], propDecorators: { asMultiLayer: [{ type: i0.Input, args: [{ isSignal: true, alias: "asMultiLayer", required: false }] }], disableOpenByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableOpenByClick", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], triggerRef: [{ type: i0.ViewChild, args: ['triggerRef', { isSignal: true }] }], popoverRef: [{ type: i0.ViewChild, args: ['popoverRef', { isSignal: true }] }], popoverContentRef: [{ type: i0.ViewChild, args: ['popoverContentRef', { isSignal: true }] }] } });
|
|
3190
|
+
}], propDecorators: { asMultiLayer: [{ type: i0.Input, args: [{ isSignal: true, alias: "asMultiLayer", required: false }] }], asSheetOnMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "asSheetOnMobile", required: false }] }], disableOpenByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableOpenByClick", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }, { type: i0.Output, args: ["isOpenChange"] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], triggerRef: [{ type: i0.ViewChild, args: ['triggerRef', { isSignal: true }] }], popoverRef: [{ type: i0.ViewChild, args: ['popoverRef', { isSignal: true }] }], popoverContentRef: [{ type: i0.ViewChild, args: ['popoverContentRef', { isSignal: true }] }] } });
|
|
3177
3191
|
|
|
3178
3192
|
class ShipFormFieldPopover {
|
|
3179
3193
|
constructor() {
|
|
@@ -3235,6 +3249,7 @@ class ShipFormFieldPopover {
|
|
|
3235
3249
|
<sh-popover
|
|
3236
3250
|
[(isOpen)]="isOpen"
|
|
3237
3251
|
(closed)="close()"
|
|
3252
|
+
[asSheetOnMobile]="true"
|
|
3238
3253
|
[options]="{
|
|
3239
3254
|
closeOnButton: false,
|
|
3240
3255
|
closeOnEsc: true,
|
|
@@ -3267,7 +3282,7 @@ class ShipFormFieldPopover {
|
|
|
3267
3282
|
<ng-content select="[hint]"></ng-content>
|
|
3268
3283
|
</div>
|
|
3269
3284
|
</div>
|
|
3270
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3285
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "asSheetOnMobile", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3271
3286
|
}
|
|
3272
3287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ShipFormFieldPopover, decorators: [{
|
|
3273
3288
|
type: Component,
|
|
@@ -3280,6 +3295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
|
|
|
3280
3295
|
<sh-popover
|
|
3281
3296
|
[(isOpen)]="isOpen"
|
|
3282
3297
|
(closed)="close()"
|
|
3298
|
+
[asSheetOnMobile]="true"
|
|
3283
3299
|
[options]="{
|
|
3284
3300
|
closeOnButton: false,
|
|
3285
3301
|
closeOnEsc: true,
|
|
@@ -5211,7 +5227,7 @@ class ShipMenu {
|
|
|
5211
5227
|
<ng-content select="[menu]" />
|
|
5212
5228
|
</div>
|
|
5213
5229
|
</sh-popover>
|
|
5214
|
-
`, isInline: true, dependencies: [{ kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormField, selector: "sh-form-field", inputs: ["color", "variant", "size", "readonly"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5230
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "asSheetOnMobile", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormField, selector: "sh-form-field", inputs: ["color", "variant", "size", "readonly"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5215
5231
|
}
|
|
5216
5232
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ShipMenu, decorators: [{
|
|
5217
5233
|
type: Component,
|
|
@@ -6412,7 +6428,7 @@ class ShipSelect {
|
|
|
6412
6428
|
}
|
|
6413
6429
|
</div>
|
|
6414
6430
|
</sh-popover>
|
|
6415
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormField, selector: "sh-form-field", inputs: ["color", "variant", "size", "readonly"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }, { kind: "component", type: ShipCheckbox, selector: "sh-checkbox", inputs: ["checked", "color", "variant", "readonly", "disabled", "noInternalInput"], outputs: ["checkedChange"] }, { kind: "component", type: ShipSpinner, selector: "sh-spinner", inputs: ["color"] }, { kind: "component", type: ShipChip, selector: "sh-chip", inputs: ["color", "variant", "size", "sharp", "dynamic", "readonly"] }, { kind: "component", type: ShipDivider, selector: "sh-divider" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6431
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ShipPopover, selector: "sh-popover", inputs: ["asMultiLayer", "asSheetOnMobile", "disableOpenByClick", "isOpen", "options"], outputs: ["isOpenChange", "closed"] }, { kind: "component", type: ShipFormField, selector: "sh-form-field", inputs: ["color", "variant", "size", "readonly"] }, { kind: "component", type: ShipIcon, selector: "sh-icon", inputs: ["color", "size"] }, { kind: "component", type: ShipCheckbox, selector: "sh-checkbox", inputs: ["checked", "color", "variant", "readonly", "disabled", "noInternalInput"], outputs: ["checkedChange"] }, { kind: "component", type: ShipSpinner, selector: "sh-spinner", inputs: ["color"] }, { kind: "component", type: ShipChip, selector: "sh-chip", inputs: ["color", "variant", "size", "sharp", "dynamic", "readonly"] }, { kind: "component", type: ShipDivider, selector: "sh-divider" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6416
6432
|
}
|
|
6417
6433
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImport: i0, type: ShipSelect, decorators: [{
|
|
6418
6434
|
type: Component,
|