-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(range): add label prop (#27408)
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Labels on `ion-range` can only be set via the `label` slot. When only plain text is needed, this is cumbersome because you need to add an entire new element to wrap the label. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> Label prop added. If both the prop and slot are used, the prop will take priority. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> - Docs PR: ionic-team/ionic-docs#2955 - Dev build: `7.0.6-dev.11683657201.139d03f4`
- Loading branch information
1 parent
1c71bfb
commit 368add2
Showing
47 changed files
with
98 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+6.41 KB
...bel/range.e2e.ts-snapshots/range-label-prop-end-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.32 KB
...el/range.e2e.ts-snapshots/range-label-prop-end-ios-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.42 KB
...bel/range.e2e.ts-snapshots/range-label-prop-end-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.4 KB
...bel/range.e2e.ts-snapshots/range-label-prop-end-ios-rtl-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.29 KB
...el/range.e2e.ts-snapshots/range-label-prop-end-ios-rtl-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.42 KB
...bel/range.e2e.ts-snapshots/range-label-prop-end-ios-rtl-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.93 KB
...abel/range.e2e.ts-snapshots/range-label-prop-end-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.7 KB
...bel/range.e2e.ts-snapshots/range-label-prop-end-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.65 KB
...abel/range.e2e.ts-snapshots/range-label-prop-end-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.77 KB
...abel/range.e2e.ts-snapshots/range-label-prop-end-md-rtl-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.68 KB
...bel/range.e2e.ts-snapshots/range-label-prop-end-md-rtl-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.68 KB
...abel/range.e2e.ts-snapshots/range-label-prop-end-md-rtl-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.09 KB
...l/range.e2e.ts-snapshots/range-label-prop-fixed-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.85 KB
.../range.e2e.ts-snapshots/range-label-prop-fixed-ios-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.16 KB
...l/range.e2e.ts-snapshots/range-label-prop-fixed-ios-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8 KB
...l/range.e2e.ts-snapshots/range-label-prop-fixed-ios-rtl-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.83 KB
.../range.e2e.ts-snapshots/range-label-prop-fixed-ios-rtl-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.15 KB
...l/range.e2e.ts-snapshots/range-label-prop-fixed-ios-rtl-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.05 KB
...el/range.e2e.ts-snapshots/range-label-prop-fixed-md-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.77 KB
...l/range.e2e.ts-snapshots/range-label-prop-fixed-md-ltr-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.03 KB
...el/range.e2e.ts-snapshots/range-label-prop-fixed-md-ltr-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.04 KB
...el/range.e2e.ts-snapshots/range-label-prop-fixed-md-rtl-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.78 KB
...l/range.e2e.ts-snapshots/range-label-prop-fixed-md-rtl-Mobile-Firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.98 KB
...el/range.e2e.ts-snapshots/range-label-prop-fixed-md-rtl-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.96 KB
...l/range.e2e.ts-snapshots/range-label-prop-start-ios-ltr-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.76 KB
.../range.e2e.ts-snapshots/range-label-prop-start-ios-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+8.12 KB
...l/range.e2e.ts-snapshots/range-label-prop-start-ios-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file added
BIN
+7.94 KB
...l/range.e2e.ts-snapshots/range-label-prop-start-ios-rtl-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+2.75 KB
.../range.e2e.ts-snapshots/range-label-prop-start-ios-rtl-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+8.11 KB
...l/range.e2e.ts-snapshots/range-label-prop-start-ios-rtl-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.03 KB
...el/range.e2e.ts-snapshots/range-label-prop-start-md-ltr-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+1.77 KB
...l/range.e2e.ts-snapshots/range-label-prop-start-md-ltr-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.02 KB
...el/range.e2e.ts-snapshots/range-label-prop-start-md-ltr-Mobile-Safari-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.02 KB
...el/range.e2e.ts-snapshots/range-label-prop-start-md-rtl-Mobile-Chrome-linux.png
Oops, something went wrong.
Binary file added
BIN
+1.77 KB
...l/range.e2e.ts-snapshots/range-label-prop-start-md-rtl-Mobile-Firefox-linux.png
Oops, something went wrong.
Binary file added
BIN
+4.97 KB
...el/range.e2e.ts-snapshots/range-label-prop-start-md-rtl-Mobile-Safari-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { newSpecPage } from '@stencil/core/testing'; | ||
|
||
import { Range } from '../../range'; | ||
|
||
describe('range: label', () => { | ||
it('should prioritize the label prop over the slot', async () => { | ||
const page = await newSpecPage({ | ||
components: [Range], | ||
html: ` | ||
<ion-range label="Label prop"> | ||
<div slot="label">Label slot</div> | ||
</ion-range> | ||
`, | ||
}); | ||
|
||
const range = page.body.querySelector('ion-range'); | ||
const propEl = range?.shadowRoot?.querySelector('.label-text'); | ||
const slotEl = range?.shadowRoot?.querySelector('slot[name="label"]'); | ||
|
||
expect(propEl).not.toBeNull(); | ||
expect(slotEl).toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters