95 Commits

Author SHA1 Message Date
4cf948fb47 docs: account for this context (#28720)
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. -->

In https://github.com/ionic-team/ionic-framework/issues/28694 there was
some confusion around how to access `this` inside of a callback function
passed to a property on Ionic components. The root issue was due to how
the `this` context is determined with developers being responsible for
setting the appropriate `this` context.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- While this isn't an Ionic bug, I think it's worth calling out this
behavior so developers are aware of how to account for it.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->


Note: The link in the docs will not work until
https://github.com/ionic-team/ionic-docs/pull/3333 is merged.

---------

Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
2023-12-19 22:33:34 +00:00
52ed2bf637 feat(range): expose label wrapper as shadow part (#28601) 2023-11-30 10:36:21 -05:00
6438e3e919 fix(item): wrap elements and label contents when the font size increases or the elements do not fit (#28146)
1) Wraps the label text and other content in an item when there is not enough room for everything to fit, instead of truncating the label with an ellipsis. Does not apply to items containing legacy inputs.
2) Passes the legacy property up to item from checkbox, input, radio, range, select, textarea and toggle. Item adds classes for all of these and does not wrap its contents if that class exists. If a developer is using a legacy input without the legacy property on it then they will need to add the legacy property to prevent the wrapping.
3) If a developer does not want the text to wrap for labels in modern items, the `ion-text-nowrap` class can be added to the label.
2023-10-17 14:08:35 -04:00
ac2c8e6c22 fix(range): knob positions are correct on initial render with custom elements build (#28257)
Issue number: Resolves #25444

---------

<!-- 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. -->

In the custom elements build, currently used by React and Vue packages,
the range knob can be rendered incorrectly if the value is assigned
after the `connectedCallback` but before the initial render of the
component. This is most apparent with the dual knobs implementation in
React (referenced issue).

This results in the range's value being correct, but the visual
representation of the range to be incorrect.

This also causes issues with the custom elements build in the standalone
implementation of Ionic's components in Angular. If a range is presented
in a modal via a controller, the range will never render with the value
that is initially assigned to it.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Updates the range knob positioning when the range has initially
rendered.

## 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. -->

This change needs to be pulled into the Ionic angular standalone work. 

Dev-build: `7.4.3-dev.11695926109.13b1266a`
2023-09-28 20:15:46 +00:00
0104d89927 fix(range): knob is not cut off in item with modern syntax (#28199)
Issue number: resolves #27199

---------

<!-- 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. -->

When using the modern range in an item, the knob will get cut off by the
item when the value is at either the min or the max.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Range knob is no longer cut off by the item

## 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. -->


This is an extension of
https://github.com/ionic-team/ionic-framework/pull/27188. I decided to
make a separate branch/PR since I added tests and changed the
implementation a bit. Feel free to take all/some/none of this code.

---------

Co-authored-by: Sean Perkins <sean-perkins@users.noreply.github.com>
Co-authored-by: ionitron <hi@ionicframework.com>
2023-09-20 03:01:50 +00:00
e6c7bb60e7 feat(checkbox, radio, toggle, range): stacked labels for form controls (#28075)
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Co-authored-by: ionitron <hi@ionicframework.com>
2023-09-01 09:30:59 -07:00
159bffbb5f chore(): sync with main 2023-05-11 14:57:44 -04:00
368add2a5c 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: https://github.com/ionic-team/ionic-docs/pull/2955
- Dev build: `7.0.6-dev.11683657201.139d03f4`
2023-05-10 10:13:26 -05:00
6e83ba4051 fix(range): round value to same number of decimal places as props to avoid floating point rounding errors (#27375)
Issue number: Resolves #21968

---------

<!-- 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. -->

When using fractional values for `min`, `max`, or `step`, it is possible
for floating point rounding errors to cause unexpected values to be
emitted. For example, `step="0.05" min="0.1" max="1"` emits a value of
`0.150000000004` after moving one step.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

Values are rounded to the max number of decimal places between the three
props. Note that it isn't mathematically possible to arrive at a value
with more decimal places than the props*, since addition (i.e. starting
at `min` and adding multiples of `step`) can't increase the precision of
a number.

\* Unless the `value` is set manually, but in that case, `ion-range`
currently snaps to a multiple of `step` as soon as the slider is moved,
resuming normal behavior.

## 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. -->
2023-05-08 18:10:25 +00:00
0a0345a84a refactor(many): use utils import (#27160) 2023-04-12 13:25:14 -07:00
67578f6246 chore: format string values in comments with double quotes (#26857) 2023-02-28 21:16:15 -05:00
1457ce7be4 refactor(many): clarify deprecation warning (#26834) 2023-02-21 13:58:22 -05:00
edf696cac9 fix(range): allow overflow on range bar container (#26751) 2023-02-13 17:06:42 -05:00
92b06f2eb6 fix(range): assign auto increment id by default (#26740)
BREAKING CHANGE:

The `name` property on `ion-range` defaults to `ion-r-${rangeIds++}` where `rangeIds` is a number that is incremented for every instance of the component.
2023-02-06 16:37:39 -05:00
5e5f1a34fb chore(range): range warning typo (#26738) 2023-02-05 21:42:09 -05:00
1a8bd6d8c6 chore(deps): update to stencil v3 (#26663) 2023-01-31 18:07:22 -05:00
63f8525284 fix(many): legacy form control does not warn when using aria-labelledby (#26699)
resolves #26698
2023-01-30 16:02:00 -05:00
b78b454e08 revert(): revert base components feature (#26692)
The Ionic Framework team would like to re-evaluate our approach to improving customization options when building mobile applications. We are looking at other solutions that a) make customizing an app UI easier and b) are applicable to a broader set of developers.
2023-01-30 11:52:36 -05:00
18f109c7da feat(base-components): add ability to remove ios and md theme (#26669) 2023-01-24 16:18:35 -05:00
e8fb9e7328 chore(): sync with main 2023-01-23 13:38:16 -05:00
c2e1ad385d chore(many): replace any types and add tech debt tickets (#26293)
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-01-06 09:34:55 -06:00
49baad8ee6 feat(range): component can be used outside of ion-item (#26479) 2022-12-15 15:52:56 -05:00
d1fb7b039b feat(range): ionChange will only emit from user committed changes (#26089) 2022-10-24 16:13:48 -04:00
f1cdf18316 chore(): sync with main: 2022-10-11 11:38:27 -04:00
2c815cff13 fix(range): indication when range knob is focused (#25827) 2022-09-26 15:15:44 -04:00
da05ffe462 fix(range): range matches iOS design specification (#25873)
Resolves #25872
2022-09-09 12:25:06 -04:00
ae6aa0cb8e chore(eslint): add strict-boolean-expressions rule (#25768) 2022-08-23 11:50:02 -05:00
c2781cc1c3 feat(range): add reference point for start position of range slider (#25598)
Resolves #24348

Co-authored-by: Sachin Garg <sg@rawzor.com>
2022-07-15 12:00:15 -04:00
0b92dffa92 fix(range): dragging knob no longer scrolls page (#25343)
resolves #19004
2022-05-31 11:35:07 -04:00
611832b0d5 fix(core): inherit aria attributes on host elements (#25156)
Resolves #20127
2022-04-21 10:50:56 -04:00
2ebb94ba01 lint(): run prettier on feature-6.1 2022-04-04 19:38:08 +00:00
083a31acdc chore(): sync feature-6.1 with main 2022-04-04 15:27:16 -04:00
5676bab316 lint(eslint): migrate to eslint and prettier (#25046) 2022-04-04 11:12:53 -04:00
f5cb1f8444 feat(range): add knobMoveStart and knobMoveEnd events (#25011) 2022-04-01 11:16:01 -05:00
19ac2389eb fix(img): draggable attribute is now inherited to inner img element (#24781)
Resolves #21325

Co-authored-by: Celilsemi Sam Erkiner <celilsemi@erkiner.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2022-02-21 11:50:57 -05:00
f295134624 style(): fix shadowed vars (#24609) 2022-01-20 10:56:33 -06:00
5dba4e5ce0 fix(range): setting dir on ion-range to enable rtl mode now supported (#24597)
Resolves #20201
2022-01-19 12:59:19 -05:00
8f2c4f73db feat(range): add support for customizing pin format (#22972) 2021-07-09 10:57:52 -04:00
dc430af906 fix(all): reflect color property as an attribute for vue (#23345)
resolves #23323
2021-05-21 19:26:53 -04:00
881dcff40b fix(range): knob can now have an accessible name (#23338)
resolves #23295
2021-05-21 14:38:18 -04:00
2fea36fc98 fix(range): gesture is now properly re-created on connectedCallback (#22407)
resolves #22335
2020-11-02 10:50:08 -05:00
27191026ef docs(): add note on form bindings with debounce (#22409) 2020-11-02 09:26:42 -05:00
753fd2f910 chore(colorClass): update createColorClasses() for ts4 (#21896)
Change the createColorClasses() fn so the returned type and jsx class property work well with typescript 4
2020-08-10 09:18:41 -05:00
619f67a00b feat(range): add parts support for bar, bar-active, knob, pin, tick, tick-active (#20961) 2020-04-23 12:18:04 -04:00
df1bc1e627 refactor(gesture): update Gesture API to latest (#19671) 2019-10-17 14:18:39 -04:00
3d935978b3 test(): remove initial waitFor (#19217) 2019-08-30 16:45:13 +02:00
48a27636c7 fix(all): component reusage (#18963)
Use new stencil APIs to allow ionic elements to be reused once removed from the DOM.

fixes #18843
fixes #17344
fixes #16453
fixes #15879
fixes #15788
fixes #15484
fixes #17890
fixes #16364
2019-08-27 16:29:37 +02:00
8f7853c5e9 fix(range): participate in <form> (#19008) 2019-08-06 16:51:48 +02:00
03c1d19e07 perf(all): minify better by using arrow functions (#18730) 2019-07-10 10:33:33 -04:00
34dfc3ce98 refactor(all): updating to newest stencil apis (#18578)
* chore(): update ionicons

* refactor(all): updating to newest stencil apis

* fix lint issues

* more changes

* moreee

* fix treeshaking

* fix config

* fix checkbox

* fix stuff

* chore(): update ionicons

* fix linting errors
2019-06-23 11:26:42 +02:00