@ionic/core 7.4.2 → 7.4.3-dev.11695994917.15d3036b
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/components/ion-fab-list.js +1 -1
- package/components/ion-fab.js +1 -1
- package/components/ion-range.js +1 -0
- package/components/popover.js +3 -4
- package/dist/cjs/ion-fab_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +3 -4
- package/dist/cjs/ion-range.cjs.entry.js +1 -0
- package/dist/collection/components/fab/fab.css +88 -28
- package/dist/collection/components/fab/test/custom-size/fab.e2e.js +17 -0
- package/dist/collection/components/fab-list/fab-list.css +17 -10
- package/dist/collection/components/picker-column/test/test.utils.js +1 -1
- package/dist/collection/components/popover/utils.js +3 -4
- package/dist/collection/components/range/range.js +1 -0
- package/dist/collection/utils/test/playwright/page/utils/index.js +0 -1
- package/dist/collection/utils/test/playwright/playwright-page.js +1 -2
- package/dist/collection/utils/test/playwright/viewports/index.js +4 -0
- package/dist/docs.json +1 -1
- package/dist/esm/ion-fab_3.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +3 -4
- package/dist/esm/ion-range.entry.js +1 -0
- package/dist/esm-es5/ion-fab_3.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-09e15a2a.system.entry.js → p-410beeda.system.entry.js} +1 -1
- package/dist/ionic/p-6dfeeadf.entry.js +4 -0
- package/dist/ionic/p-6edbc09b.system.js +1 -1
- package/dist/ionic/p-95f8cb47.entry.js +4 -0
- package/dist/ionic/p-a76e80db.entry.js +4 -0
- package/dist/ionic/p-af624417.system.entry.js +4 -0
- package/dist/ionic/p-c14fb011.system.entry.js +4 -0
- package/dist/types/utils/test/playwright/page/utils/index.d.ts +0 -1
- package/dist/types/utils/test/playwright/playwright-declarations.d.ts +0 -5
- package/dist/types/utils/test/playwright/viewports/index.d.ts +4 -0
- package/hydrate/index.js +6 -6
- package/package.json +2 -1
- package/dist/collection/utils/test/playwright/page/utils/get-snapshot-settings.js +0 -32
- package/dist/ionic/p-37456282.system.entry.js +0 -4
- package/dist/ionic/p-3af01ae0.system.entry.js +0 -4
- package/dist/ionic/p-3cbcb899.entry.js +0 -4
- package/dist/ionic/p-a720dc73.entry.js +0 -4
- package/dist/ionic/p-a8d33949.entry.js +0 -4
- package/dist/types/utils/test/playwright/page/utils/get-snapshot-settings.d.ts +0 -8
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { b as getIonMode } from './ionic-global.js';
|
|
6
6
|
|
|
7
|
-
const fabListCss = ":host{margin-left:0;margin-right:0;margin-top:
|
|
7
|
+
const fabListCss = ":host{margin-left:0;margin-right:0;margin-top:calc(100% + 10px);margin-bottom:calc(100% + 10px);display:none;position:absolute;top:0;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;min-width:56px;min-height:56px}:host(.fab-list-active){display:-ms-flexbox;display:flex}::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;width:40px;height:40px;-webkit-transform:scale(0);transform:scale(0);opacity:0;visibility:hidden}:host(.fab-list-side-top) ::slotted(.fab-button-in-list),:host(.fab-list-side-bottom) ::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px}:host(.fab-list-side-start) ::slotted(.fab-button-in-list),:host(.fab-list-side-end) ::slotted(.fab-button-in-list){-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:5px;margin-inline-end:5px;margin-top:0;margin-bottom:0}::slotted(.fab-button-in-list.fab-button-show){-webkit-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}:host(.fab-list-side-top){top:auto;bottom:0;-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.fab-list-side-start){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row-reverse;flex-direction:row-reverse}@supports (inset-inline-start: 0){:host(.fab-list-side-start){inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-start){right:0}:host-context([dir=rtl]):host(.fab-list-side-start),:host-context([dir=rtl]).fab-list-side-start{left:unset;right:unset;left:0}@supports selector(:dir(rtl)){:host(.fab-list-side-start):dir(rtl){left:unset;right:unset;left:0}}}:host(.fab-list-side-end){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row;flex-direction:row}@supports (inset-inline-start: 0){:host(.fab-list-side-end){inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-end){left:0}:host-context([dir=rtl]):host(.fab-list-side-end),:host-context([dir=rtl]).fab-list-side-end{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.fab-list-side-end):dir(rtl){left:unset;right:unset;right:0}}}";
|
|
8
8
|
|
|
9
9
|
const FabList = /*@__PURE__*/ proxyCustomElement(class FabList extends HTMLElement {
|
|
10
10
|
constructor() {
|
package/components/ion-fab.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { b as getIonMode } from './ionic-global.js';
|
|
6
6
|
|
|
7
|
-
const fabCss = ":host{position:absolute;
|
|
7
|
+
const fabCss = ":host{position:absolute;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;z-index:999}:host(.fab-horizontal-center){left:0px;right:0px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}@supports (inset-inline-start: 0){:host(.fab-horizontal-start){inset-inline-start:calc(10px + var(--ion-safe-area-left, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-start){left:calc(10px + var(--ion-safe-area-left, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-start),:host-context([dir=rtl]).fab-horizontal-start{left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-start):dir(rtl){left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}}}@supports (inset-inline-start: 0){:host(.fab-horizontal-end){inset-inline-end:calc(10px + var(--ion-safe-area-right, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-end){right:calc(10px + var(--ion-safe-area-right, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-end),:host-context([dir=rtl]).fab-horizontal-end{left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-end):dir(rtl){left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}}}:host(.fab-vertical-top){top:10px}:host(.fab-vertical-top.fab-edge){top:0}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-top:calc((-100% + 16px) / 2)}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-top:calc(50% + 10px)}:host(.fab-vertical-bottom){bottom:10px}:host(.fab-vertical-bottom.fab-edge){bottom:0}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-bottom:calc((-100% + 16px) / 2)}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-bottom:calc(50% + 10px)}:host(.fab-vertical-center){top:0px;bottom:0px;margin-top:auto;margin-bottom:auto}";
|
|
8
8
|
|
|
9
9
|
const Fab = /*@__PURE__*/ proxyCustomElement(class Fab extends HTMLElement {
|
|
10
10
|
constructor() {
|
package/components/ion-range.js
CHANGED
|
@@ -215,6 +215,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
215
215
|
componentDidLoad() {
|
|
216
216
|
this.originalIonInput = this.ionInput;
|
|
217
217
|
this.setupGesture();
|
|
218
|
+
this.updateRatio();
|
|
218
219
|
this.didLoad = true;
|
|
219
220
|
}
|
|
220
221
|
connectedCallback() {
|
package/components/popover.js
CHANGED
|
@@ -659,9 +659,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
659
659
|
let originY = contentOriginY;
|
|
660
660
|
let checkSafeAreaLeft = false;
|
|
661
661
|
let checkSafeAreaRight = false;
|
|
662
|
-
const triggerTop = triggerCoordinates
|
|
663
|
-
? triggerCoordinates.top + triggerCoordinates.height
|
|
664
|
-
: bodyHeight / 2 - contentHeight / 2;
|
|
662
|
+
const triggerTop = triggerCoordinates ? triggerCoordinates.top : bodyHeight / 2 - contentHeight / 2;
|
|
665
663
|
const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0;
|
|
666
664
|
let addPopoverBottomClass = false;
|
|
667
665
|
/**
|
|
@@ -701,7 +699,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
701
699
|
* We chose 12 here so that the popover position looks a bit nicer as
|
|
702
700
|
* it is not right up against the edge of the screen.
|
|
703
701
|
*/
|
|
704
|
-
top = Math.max(12, triggerTop - contentHeight -
|
|
702
|
+
top = Math.max(12, triggerTop - contentHeight - (arrowHeight - 1));
|
|
705
703
|
arrowTop = top + contentHeight;
|
|
706
704
|
originY = 'bottom';
|
|
707
705
|
addPopoverBottomClass = true;
|
|
@@ -714,6 +712,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
714
712
|
bottom = bodyPadding;
|
|
715
713
|
}
|
|
716
714
|
}
|
|
715
|
+
console.log(top, arrowTop);
|
|
717
716
|
return {
|
|
718
717
|
top,
|
|
719
718
|
left,
|
|
@@ -11,7 +11,7 @@ const helpers = require('./helpers-ea4ccbcb.js');
|
|
|
11
11
|
const theme = require('./theme-fbc56b3b.js');
|
|
12
12
|
const index$1 = require('./index-d8d1fc0b.js');
|
|
13
13
|
|
|
14
|
-
const fabCss = ":host{position:absolute;
|
|
14
|
+
const fabCss = ":host{position:absolute;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;z-index:999}:host(.fab-horizontal-center){left:0px;right:0px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}@supports (inset-inline-start: 0){:host(.fab-horizontal-start){inset-inline-start:calc(10px + var(--ion-safe-area-left, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-start){left:calc(10px + var(--ion-safe-area-left, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-start),:host-context([dir=rtl]).fab-horizontal-start{left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-start):dir(rtl){left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}}}@supports (inset-inline-start: 0){:host(.fab-horizontal-end){inset-inline-end:calc(10px + var(--ion-safe-area-right, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-end){right:calc(10px + var(--ion-safe-area-right, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-end),:host-context([dir=rtl]).fab-horizontal-end{left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-end):dir(rtl){left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}}}:host(.fab-vertical-top){top:10px}:host(.fab-vertical-top.fab-edge){top:0}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-top:calc((-100% + 16px) / 2)}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-top:calc(50% + 10px)}:host(.fab-vertical-bottom){bottom:10px}:host(.fab-vertical-bottom.fab-edge){bottom:0}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-bottom:calc((-100% + 16px) / 2)}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-bottom:calc(50% + 10px)}:host(.fab-vertical-center){top:0px;bottom:0px;margin-top:auto;margin-bottom:auto}";
|
|
15
15
|
|
|
16
16
|
const Fab = class {
|
|
17
17
|
constructor(hostRef) {
|
|
@@ -150,7 +150,7 @@ FabButton.style = {
|
|
|
150
150
|
md: fabButtonMdCss
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
const fabListCss = ":host{margin-left:0;margin-right:0;margin-top:
|
|
153
|
+
const fabListCss = ":host{margin-left:0;margin-right:0;margin-top:calc(100% + 10px);margin-bottom:calc(100% + 10px);display:none;position:absolute;top:0;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;min-width:56px;min-height:56px}:host(.fab-list-active){display:-ms-flexbox;display:flex}::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;width:40px;height:40px;-webkit-transform:scale(0);transform:scale(0);opacity:0;visibility:hidden}:host(.fab-list-side-top) ::slotted(.fab-button-in-list),:host(.fab-list-side-bottom) ::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px}:host(.fab-list-side-start) ::slotted(.fab-button-in-list),:host(.fab-list-side-end) ::slotted(.fab-button-in-list){-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:5px;margin-inline-end:5px;margin-top:0;margin-bottom:0}::slotted(.fab-button-in-list.fab-button-show){-webkit-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}:host(.fab-list-side-top){top:auto;bottom:0;-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.fab-list-side-start){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row-reverse;flex-direction:row-reverse}@supports (inset-inline-start: 0){:host(.fab-list-side-start){inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-start){right:0}:host-context([dir=rtl]):host(.fab-list-side-start),:host-context([dir=rtl]).fab-list-side-start{left:unset;right:unset;left:0}@supports selector(:dir(rtl)){:host(.fab-list-side-start):dir(rtl){left:unset;right:unset;left:0}}}:host(.fab-list-side-end){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row;flex-direction:row}@supports (inset-inline-start: 0){:host(.fab-list-side-end){inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-end){left:0}:host-context([dir=rtl]):host(.fab-list-side-end),:host-context([dir=rtl]).fab-list-side-end{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.fab-list-side-end):dir(rtl){left:unset;right:unset;right:0}}}";
|
|
154
154
|
|
|
155
155
|
const FabList = class {
|
|
156
156
|
constructor(hostRef) {
|
|
@@ -664,9 +664,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
664
664
|
let originY = contentOriginY;
|
|
665
665
|
let checkSafeAreaLeft = false;
|
|
666
666
|
let checkSafeAreaRight = false;
|
|
667
|
-
const triggerTop = triggerCoordinates
|
|
668
|
-
? triggerCoordinates.top + triggerCoordinates.height
|
|
669
|
-
: bodyHeight / 2 - contentHeight / 2;
|
|
667
|
+
const triggerTop = triggerCoordinates ? triggerCoordinates.top : bodyHeight / 2 - contentHeight / 2;
|
|
670
668
|
const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0;
|
|
671
669
|
let addPopoverBottomClass = false;
|
|
672
670
|
/**
|
|
@@ -706,7 +704,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
706
704
|
* We chose 12 here so that the popover position looks a bit nicer as
|
|
707
705
|
* it is not right up against the edge of the screen.
|
|
708
706
|
*/
|
|
709
|
-
top = Math.max(12, triggerTop - contentHeight -
|
|
707
|
+
top = Math.max(12, triggerTop - contentHeight - (arrowHeight - 1));
|
|
710
708
|
arrowTop = top + contentHeight;
|
|
711
709
|
originY = 'bottom';
|
|
712
710
|
addPopoverBottomClass = true;
|
|
@@ -719,6 +717,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
719
717
|
bottom = bodyPadding;
|
|
720
718
|
}
|
|
721
719
|
}
|
|
720
|
+
console.log(top, arrowTop);
|
|
722
721
|
return {
|
|
723
722
|
top,
|
|
724
723
|
left,
|
|
@@ -1,33 +1,17 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
position: absolute;
|
|
3
|
+
width: fit-content;
|
|
4
|
+
height: fit-content;
|
|
3
5
|
z-index: 999;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
:host(.fab-horizontal-center) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
@supports not (inset-inline-start: 0) {
|
|
16
|
-
:host(.fab-horizontal-center) {
|
|
17
|
-
left: 50%;
|
|
18
|
-
}
|
|
19
|
-
:host-context([dir=rtl]):host(.fab-horizontal-center), :host-context([dir=rtl]).fab-horizontal-center {
|
|
20
|
-
left: unset;
|
|
21
|
-
right: unset;
|
|
22
|
-
right: 50%;
|
|
23
|
-
}
|
|
24
|
-
@supports selector(:dir(rtl)) {
|
|
25
|
-
:host(.fab-horizontal-center):dir(rtl) {
|
|
26
|
-
left: unset;
|
|
27
|
-
right: unset;
|
|
28
|
-
right: 50%;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
9
|
+
left: 0px;
|
|
10
|
+
right: 0px;
|
|
11
|
+
-webkit-margin-start: auto;
|
|
12
|
+
margin-inline-start: auto;
|
|
13
|
+
-webkit-margin-end: auto;
|
|
14
|
+
margin-inline-end: auto;
|
|
31
15
|
}
|
|
32
16
|
|
|
33
17
|
@supports (inset-inline-start: 0) {
|
|
@@ -80,19 +64,95 @@
|
|
|
80
64
|
top: 10px;
|
|
81
65
|
}
|
|
82
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Reset the top value since edge
|
|
69
|
+
* styles use margin-top.
|
|
70
|
+
*/
|
|
83
71
|
:host(.fab-vertical-top.fab-edge) {
|
|
84
|
-
top:
|
|
72
|
+
top: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* We need to adjust the parent FAB button up by half
|
|
77
|
+
* its height so that half of it sits on the header. As a result,
|
|
78
|
+
* we target the slotted ion-fab-button instead of targeting the host.
|
|
79
|
+
*/
|
|
80
|
+
:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button) {
|
|
81
|
+
margin-top: -50%;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The small FAB button adds top and bottom margin. We need to account for
|
|
86
|
+
* that margin when we adjust the FAB button for edge styles since we
|
|
87
|
+
* are overriding the margin-top value below.
|
|
88
|
+
*/
|
|
89
|
+
:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button.fab-button-small) {
|
|
90
|
+
margin-top: calc((-100% + 16px) / 2);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Since we are adjusting the FAB button we also need
|
|
95
|
+
* to adjust the sibling ion-fab-list otherwise there will be
|
|
96
|
+
* a gap between the parent FAB button and the associated list.
|
|
97
|
+
*/
|
|
98
|
+
:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),
|
|
99
|
+
:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-end) {
|
|
100
|
+
margin-top: -50%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),
|
|
104
|
+
:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom) {
|
|
105
|
+
margin-top: calc(50% + 10px);
|
|
85
106
|
}
|
|
86
107
|
|
|
87
108
|
:host(.fab-vertical-bottom) {
|
|
88
109
|
bottom: 10px;
|
|
89
110
|
}
|
|
90
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Reset the bottom value since edge
|
|
114
|
+
* styles use margin-bottom.
|
|
115
|
+
*/
|
|
91
116
|
:host(.fab-vertical-bottom.fab-edge) {
|
|
92
|
-
bottom:
|
|
117
|
+
bottom: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* We need to adjust the parent FAB button down by half
|
|
122
|
+
* its height so that half of it sits on the footer. As a result,
|
|
123
|
+
* we target the slotted ion-fab-button instead of targeting the host.
|
|
124
|
+
*/
|
|
125
|
+
:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button) {
|
|
126
|
+
margin-bottom: -50%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The small FAB button adds top and bottom margin. We need to account for
|
|
131
|
+
* that margin when we adjust the FAB button for edge styles since we
|
|
132
|
+
* are overriding the margin-bottom value below.
|
|
133
|
+
*/
|
|
134
|
+
:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button.fab-button-small) {
|
|
135
|
+
margin-bottom: calc((-100% + 16px) / 2);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Since we are adjusting the FAB button we also need
|
|
140
|
+
* to adjust the sibling ion-fab-list otherwise there will be
|
|
141
|
+
* a gap between the parent FAB button and the associated list.
|
|
142
|
+
*/
|
|
143
|
+
:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),
|
|
144
|
+
:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-end) {
|
|
145
|
+
margin-bottom: -50%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),
|
|
149
|
+
:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom) {
|
|
150
|
+
margin-bottom: calc(50% + 10px);
|
|
93
151
|
}
|
|
94
152
|
|
|
95
153
|
:host(.fab-vertical-center) {
|
|
96
|
-
|
|
97
|
-
|
|
154
|
+
top: 0px;
|
|
155
|
+
bottom: 0px;
|
|
156
|
+
margin-top: auto;
|
|
157
|
+
margin-bottom: auto;
|
|
98
158
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { expect } from "@playwright/test";
|
|
5
|
+
import { configs, test, Viewports } from "../../../../utils/test/playwright/index";
|
|
6
|
+
/**
|
|
7
|
+
* This behavior does not vary across modes
|
|
8
|
+
*/
|
|
9
|
+
configs({ modes: ['ios'] }).forEach(({ title, config, screenshot }) => {
|
|
10
|
+
test.describe(title('fab: custom size'), () => {
|
|
11
|
+
test('should position fabs correctly with custom sizes', async ({ page }) => {
|
|
12
|
+
await page.goto(`/src/components/fab/test/custom-size`, config);
|
|
13
|
+
await page.setViewportSize(Viewports.tablet.landscape);
|
|
14
|
+
await expect(page).toHaveScreenshot(screenshot(`fab-custom-size`));
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
margin-left: 0;
|
|
3
3
|
margin-right: 0;
|
|
4
|
-
margin-top:
|
|
5
|
-
margin-bottom:
|
|
4
|
+
margin-top: calc(100% + 10px);
|
|
5
|
+
margin-bottom: calc(100% + 10px);
|
|
6
6
|
display: none;
|
|
7
7
|
position: absolute;
|
|
8
8
|
top: 0;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
align-items: center;
|
|
11
|
+
/**
|
|
12
|
+
* The list should be centered relative to the parent
|
|
13
|
+
* FAB button. We set minimum dimensions so the
|
|
14
|
+
* FAB list can be centered relative to the small FAB button.
|
|
15
|
+
* However, the small FAB button adds start/end margin, so we need
|
|
16
|
+
* to account for that in the FAB list dimensions.
|
|
17
|
+
*/
|
|
11
18
|
min-width: 56px;
|
|
12
19
|
min-height: 56px;
|
|
13
20
|
}
|
|
@@ -59,10 +66,10 @@
|
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
:host(.fab-list-side-start) {
|
|
62
|
-
-webkit-margin-start:
|
|
63
|
-
margin-inline-start:
|
|
64
|
-
-webkit-margin-end:
|
|
65
|
-
margin-inline-end:
|
|
69
|
+
-webkit-margin-start: calc(100% + 10px);
|
|
70
|
+
margin-inline-start: calc(100% + 10px);
|
|
71
|
+
-webkit-margin-end: calc(100% + 10px);
|
|
72
|
+
margin-inline-end: calc(100% + 10px);
|
|
66
73
|
margin-top: 0;
|
|
67
74
|
margin-bottom: 0;
|
|
68
75
|
flex-direction: row-reverse;
|
|
@@ -91,10 +98,10 @@
|
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
:host(.fab-list-side-end) {
|
|
94
|
-
-webkit-margin-start:
|
|
95
|
-
margin-inline-start:
|
|
96
|
-
-webkit-margin-end:
|
|
97
|
-
margin-inline-end:
|
|
101
|
+
-webkit-margin-start: calc(100% + 10px);
|
|
102
|
+
margin-inline-start: calc(100% + 10px);
|
|
103
|
+
-webkit-margin-end: calc(100% + 10px);
|
|
104
|
+
margin-inline-end: calc(100% + 10px);
|
|
98
105
|
margin-top: 0;
|
|
99
106
|
margin-bottom: 0;
|
|
100
107
|
flex-direction: row;
|
|
@@ -31,7 +31,7 @@ export async function testPickerColumn(page, screenshot, buttonSelector, descrip
|
|
|
31
31
|
await page.waitForChanges();
|
|
32
32
|
|
|
33
33
|
screenshots.push({
|
|
34
|
-
name: `picker-${description}-column-diff-${i}
|
|
34
|
+
name: screenshot(`picker-${description}-column-diff-${i}`),
|
|
35
35
|
screenshot: await page.screenshot(),
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -650,9 +650,7 @@ export const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding
|
|
|
650
650
|
let originY = contentOriginY;
|
|
651
651
|
let checkSafeAreaLeft = false;
|
|
652
652
|
let checkSafeAreaRight = false;
|
|
653
|
-
const triggerTop = triggerCoordinates
|
|
654
|
-
? triggerCoordinates.top + triggerCoordinates.height
|
|
655
|
-
: bodyHeight / 2 - contentHeight / 2;
|
|
653
|
+
const triggerTop = triggerCoordinates ? triggerCoordinates.top : bodyHeight / 2 - contentHeight / 2;
|
|
656
654
|
const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0;
|
|
657
655
|
let addPopoverBottomClass = false;
|
|
658
656
|
/**
|
|
@@ -692,7 +690,7 @@ export const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding
|
|
|
692
690
|
* We chose 12 here so that the popover position looks a bit nicer as
|
|
693
691
|
* it is not right up against the edge of the screen.
|
|
694
692
|
*/
|
|
695
|
-
top = Math.max(12, triggerTop - contentHeight -
|
|
693
|
+
top = Math.max(12, triggerTop - contentHeight - (arrowHeight - 1));
|
|
696
694
|
arrowTop = top + contentHeight;
|
|
697
695
|
originY = 'bottom';
|
|
698
696
|
addPopoverBottomClass = true;
|
|
@@ -705,6 +703,7 @@ export const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding
|
|
|
705
703
|
bottom = bodyPadding;
|
|
706
704
|
}
|
|
707
705
|
}
|
|
706
|
+
console.log(top, arrowTop);
|
|
708
707
|
return {
|
|
709
708
|
top,
|
|
710
709
|
left,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { test as base } from "@playwright/test";
|
|
5
5
|
import { PageUtils } from "../press-keys";
|
|
6
6
|
import { initPageEvents } from "./page/event-spy";
|
|
7
|
-
import {
|
|
7
|
+
import { goto as goToPage, setContent, setIonViewport, spyOnEvent, waitForChanges, locator } from "./page/utils";
|
|
8
8
|
/**
|
|
9
9
|
* Extends the base `page` test figure within Playwright.
|
|
10
10
|
* @param page The page to extend.
|
|
@@ -19,7 +19,6 @@ export async function extendPageFixture(page, testInfo) {
|
|
|
19
19
|
page.setContent = (html, options) => setContent(page, html, testInfo, options);
|
|
20
20
|
page.locator = (selector, options) => locator(page, originalLocator, selector, options);
|
|
21
21
|
// Custom Ionic methods
|
|
22
|
-
page.getSnapshotSettings = () => getSnapshotSettings(page, testInfo);
|
|
23
22
|
page.setIonViewport = (options) => setIonViewport(page, options);
|
|
24
23
|
page.waitForChanges = (timeoutMs) => waitForChanges(page, timeoutMs);
|
|
25
24
|
page.spyOnEvent = (eventName) => spyOnEvent(page, eventName);
|
|
@@ -7,6 +7,10 @@ export const Viewports = {
|
|
|
7
7
|
width: 768,
|
|
8
8
|
height: 900,
|
|
9
9
|
},
|
|
10
|
+
landscape: {
|
|
11
|
+
width: 900,
|
|
12
|
+
height: 768,
|
|
13
|
+
},
|
|
10
14
|
},
|
|
11
15
|
// Based off https://github.com/ionic-team/ionic-framework/blob/2fe23d9d46c3593843c781c57340332e5a86fd64/core/src/components/split-pane/split-pane.tsx#L9-L13
|
|
12
16
|
large: {
|
package/dist/docs.json
CHANGED
|
@@ -7,7 +7,7 @@ import { i as inheritAriaAttributes } from './helpers-3379ba19.js';
|
|
|
7
7
|
import { h as hostContext, o as openURL, c as createColorClasses } from './theme-17531cdf.js';
|
|
8
8
|
import { t as close } from './index-ecfc2c9f.js';
|
|
9
9
|
|
|
10
|
-
const fabCss = ":host{position:absolute;
|
|
10
|
+
const fabCss = ":host{position:absolute;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;z-index:999}:host(.fab-horizontal-center){left:0px;right:0px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}@supports (inset-inline-start: 0){:host(.fab-horizontal-start){inset-inline-start:calc(10px + var(--ion-safe-area-left, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-start){left:calc(10px + var(--ion-safe-area-left, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-start),:host-context([dir=rtl]).fab-horizontal-start{left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-start):dir(rtl){left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}}}@supports (inset-inline-start: 0){:host(.fab-horizontal-end){inset-inline-end:calc(10px + var(--ion-safe-area-right, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-end){right:calc(10px + var(--ion-safe-area-right, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-end),:host-context([dir=rtl]).fab-horizontal-end{left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-end):dir(rtl){left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}}}:host(.fab-vertical-top){top:10px}:host(.fab-vertical-top.fab-edge){top:0}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-top:calc((-100% + 16px) / 2)}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-top:calc(50% + 10px)}:host(.fab-vertical-bottom){bottom:10px}:host(.fab-vertical-bottom.fab-edge){bottom:0}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-bottom:calc((-100% + 16px) / 2)}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-bottom:calc(50% + 10px)}:host(.fab-vertical-center){top:0px;bottom:0px;margin-top:auto;margin-bottom:auto}";
|
|
11
11
|
|
|
12
12
|
const Fab = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -146,7 +146,7 @@ FabButton.style = {
|
|
|
146
146
|
md: fabButtonMdCss
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
const fabListCss = ":host{margin-left:0;margin-right:0;margin-top:
|
|
149
|
+
const fabListCss = ":host{margin-left:0;margin-right:0;margin-top:calc(100% + 10px);margin-bottom:calc(100% + 10px);display:none;position:absolute;top:0;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;min-width:56px;min-height:56px}:host(.fab-list-active){display:-ms-flexbox;display:flex}::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;width:40px;height:40px;-webkit-transform:scale(0);transform:scale(0);opacity:0;visibility:hidden}:host(.fab-list-side-top) ::slotted(.fab-button-in-list),:host(.fab-list-side-bottom) ::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px}:host(.fab-list-side-start) ::slotted(.fab-button-in-list),:host(.fab-list-side-end) ::slotted(.fab-button-in-list){-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:5px;margin-inline-end:5px;margin-top:0;margin-bottom:0}::slotted(.fab-button-in-list.fab-button-show){-webkit-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}:host(.fab-list-side-top){top:auto;bottom:0;-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.fab-list-side-start){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row-reverse;flex-direction:row-reverse}@supports (inset-inline-start: 0){:host(.fab-list-side-start){inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-start){right:0}:host-context([dir=rtl]):host(.fab-list-side-start),:host-context([dir=rtl]).fab-list-side-start{left:unset;right:unset;left:0}@supports selector(:dir(rtl)){:host(.fab-list-side-start):dir(rtl){left:unset;right:unset;left:0}}}:host(.fab-list-side-end){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row;flex-direction:row}@supports (inset-inline-start: 0){:host(.fab-list-side-end){inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-end){left:0}:host-context([dir=rtl]):host(.fab-list-side-end),:host-context([dir=rtl]).fab-list-side-end{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.fab-list-side-end):dir(rtl){left:unset;right:unset;right:0}}}";
|
|
150
150
|
|
|
151
151
|
const FabList = class {
|
|
152
152
|
constructor(hostRef) {
|
|
@@ -660,9 +660,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
660
660
|
let originY = contentOriginY;
|
|
661
661
|
let checkSafeAreaLeft = false;
|
|
662
662
|
let checkSafeAreaRight = false;
|
|
663
|
-
const triggerTop = triggerCoordinates
|
|
664
|
-
? triggerCoordinates.top + triggerCoordinates.height
|
|
665
|
-
: bodyHeight / 2 - contentHeight / 2;
|
|
663
|
+
const triggerTop = triggerCoordinates ? triggerCoordinates.top : bodyHeight / 2 - contentHeight / 2;
|
|
666
664
|
const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0;
|
|
667
665
|
let addPopoverBottomClass = false;
|
|
668
666
|
/**
|
|
@@ -702,7 +700,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
702
700
|
* We chose 12 here so that the popover position looks a bit nicer as
|
|
703
701
|
* it is not right up against the edge of the screen.
|
|
704
702
|
*/
|
|
705
|
-
top = Math.max(12, triggerTop - contentHeight -
|
|
703
|
+
top = Math.max(12, triggerTop - contentHeight - (arrowHeight - 1));
|
|
706
704
|
arrowTop = top + contentHeight;
|
|
707
705
|
originY = 'bottom';
|
|
708
706
|
addPopoverBottomClass = true;
|
|
@@ -715,6 +713,7 @@ const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyW
|
|
|
715
713
|
bottom = bodyPadding;
|
|
716
714
|
}
|
|
717
715
|
}
|
|
716
|
+
console.log(top, arrowTop);
|
|
718
717
|
return {
|
|
719
718
|
top,
|
|
720
719
|
left,
|