chore: discovery

This commit is contained in:
Sean Perkins
2023-04-25 17:17:44 -04:00
parent e501ac001c
commit c631973e83
3 changed files with 36 additions and 37 deletions

View File

@ -80,6 +80,8 @@
height: inherit; height: inherit;
cursor: inherit; cursor: inherit;
@include padding(null, var(--item-inner-padding-end), null, var(--item-inner-padding-start));
} }
.label-text-wrapper { .label-text-wrapper {
@ -154,7 +156,6 @@ input {
opacity: 0; opacity: 0;
} }
// Justify Content // Justify Content
// --------------------------------------------- // ---------------------------------------------
@ -170,7 +171,6 @@ input {
justify-content: end; justify-content: end;
} }
// Label Placement - Start // Label Placement - Start
// ---------------------------------------------------------------- // ----------------------------------------------------------------
@ -191,7 +191,6 @@ input {
@include margin(0, 8px, 0, 0); @include margin(0, 8px, 0, 0);
} }
// Label Placement - End // Label Placement - End
// ---------------------------------------------------------------- // ----------------------------------------------------------------
@ -212,7 +211,6 @@ input {
@include margin(0, 0, 0, 8px); @include margin(0, 0, 0, 8px);
} }
// Label Placement - Fixed // Label Placement - Fixed
// ---------------------------------------------------------------- // ----------------------------------------------------------------
@ -237,7 +235,6 @@ input {
max-width: 200px; max-width: 200px;
} }
// Checked / Indeterminate Checkbox // Checked / Indeterminate Checkbox
// --------------------------------------------- // ---------------------------------------------
@ -253,7 +250,6 @@ input {
opacity: 1; opacity: 1;
} }
// Disabled Checkbox // Disabled Checkbox
// --------------------------------------------- // ---------------------------------------------

View File

@ -147,6 +147,14 @@ export class Checkbox implements ComponentInterface {
...inheritAriaAttributes(this.el), ...inheritAriaAttributes(this.el),
}; };
} }
// Get the nearest `ion-item`.
const item = this.el.closest('ion-item');
if (item) {
if (!item.classList.contains('item-has-modern-control') && !this.legacyFormController.hasLegacyControl()) {
item.classList.add('item-has-modern-control');
}
}
} }
@Watch('checked') @Watch('checked')

View File

@ -108,6 +108,12 @@
border-color: current-color(shade); border-color: current-color(shade);
} }
// Testing
:host(.item-has-modern-control) {
--item-inner-padding-end: calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));
--item-inner-padding-start: calc(var(--padding-start) + var(--ion-safe-area-left, 0px));
}
// Item: Activated // Item: Activated
// -------------------------------------------------- // --------------------------------------------------
@ -126,7 +132,6 @@
color: current-color(contrast); color: current-color(contrast);
} }
// Item: Focused // Item: Focused
// -------------------------------------------------- // --------------------------------------------------
@ -148,7 +153,6 @@
} }
} }
// Item: Hover // Item: Hover
// -------------------------------------------------- // --------------------------------------------------
@ -172,7 +176,6 @@
} }
} }
// Item: Disabled // Item: Disabled
// -------------------------------------------------- // --------------------------------------------------
@ -183,23 +186,27 @@
:host(.item-disabled) { :host(.item-disabled) {
cursor: default; cursor: default;
opacity: .3; opacity: 0.3;
pointer-events: none; pointer-events: none;
} }
// Native Item // Native Item
// -------------------------------------------------- // --------------------------------------------------
:host:not(.item-has-modern-control) {
.item-native {
@include padding(
var(--padding-top),
var(--padding-end),
var(--padding-bottom),
calc(var(--padding-start) + var(--ion-safe-area-left, 0px))
);
}
}
.item-native { .item-native {
@include border-radius(var(--border-radius)); @include border-radius(var(--border-radius));
@include margin(0); @include margin(0);
@include padding(
var(--padding-top),
var(--padding-end),
var(--padding-bottom),
calc(var(--padding-start) + var(--ion-safe-area-left, 0px))
);
@include text-inherit(); @include text-inherit();
display: flex; display: flex;
@ -239,25 +246,28 @@
z-index: -1; z-index: -1;
} }
button, a { button,
a {
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
-webkit-user-drag: none; -webkit-user-drag: none;
} }
// Inner Item // Inner Item
// -------------------------------------------------- // --------------------------------------------------
.item-inner { :host:not(.item-has-modern-control) {
@include margin(0);
@include padding( @include padding(
var(--inner-padding-top), var(--inner-padding-top),
calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end)), calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end)),
var(--inner-padding-bottom), var(--inner-padding-bottom),
var(--inner-padding-start) var(--inner-padding-start)
); );
}
.item-inner {
@include margin(0);
display: flex; display: flex;
@ -280,26 +290,18 @@ button, a {
box-sizing: border-box; box-sizing: border-box;
} }
// Item Bottom // Item Bottom
// -------------------------------------------------- // --------------------------------------------------
.item-bottom { .item-bottom {
@include margin(0); @include margin(0);
@include padding( @include padding(0, var(--inner-padding-end), 0, calc(var(--padding-start) + var(--ion-safe-area-left, 0px)));
0,
var(--inner-padding-end),
0,
calc(var(--padding-start) + var(--ion-safe-area-left, 0px))
);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
// Item Detail Icon // Item Detail Icon
// -------------------------------------------------- // --------------------------------------------------
@ -321,7 +323,6 @@ button, a {
opacity: var(--detail-icon-opacity); opacity: var(--detail-icon-opacity);
} }
// Item Slots // Item Slots
// -------------------------------------------------- // --------------------------------------------------
@ -375,7 +376,6 @@ button, a {
flex-direction: column; flex-direction: column;
} }
// Item Input Highlight // Item Input Highlight
// -------------------------------------------------- // --------------------------------------------------
@ -450,7 +450,6 @@ button, a {
border-left: none; border-left: none;
} }
// Item Input Focus // Item Input Focus
// -------------------------------------------------- // --------------------------------------------------
@ -509,7 +508,6 @@ button, a {
max-width: 100%; max-width: 100%;
} }
// Item Datetime // Item Datetime
// -------------------------------------------------- // --------------------------------------------------
@ -524,7 +522,6 @@ button, a {
width: 100%; width: 100%;
} }
// Item w/ Multiple Inputs // Item w/ Multiple Inputs
// -------------------------------------------------- // --------------------------------------------------
// Multiple inputs in an item should have the input // Multiple inputs in an item should have the input
@ -544,7 +541,6 @@ button, a {
align-items: stretch; align-items: stretch;
} }
// Item Reorder // Item Reorder
// -------------------------------------------------- // --------------------------------------------------
@ -552,7 +548,6 @@ button, a {
@include margin(0, null); @include margin(0, null);
} }
// Item Button Ripple effect // Item Button Ripple effect
// -------------------------------------------------- // --------------------------------------------------