34 Commits

Author SHA1 Message Date
Nobody
fff6a96f73 Add placeholder support to M3CTextView.
PiperOrigin-RevId: 748701838
2025-04-17 09:12:08 -07:00
Nobody
f93b1dcc0f Adds a new property to the M3CTextField that allows setting and preserving the placeholder text color, ensuring it remains consistent even when the placeholder text content changes.
PiperOrigin-RevId: 744850210
2025-04-07 14:27:30 -07:00
Nobody
a33768e631 Adds placeholder support to M3CTextView
PiperOrigin-RevId: 744047752
2025-04-04 13:16:51 -07:00
Nobody
9272490b67 Adds placeholder support to M3CTextView
PiperOrigin-RevId: 744019565
2025-04-04 11:50:39 -07:00
David Collazo
3692400c0f Add unit test for M3CTextField's traitCollectionDidChange.
PiperOrigin-RevId: 692300627
2024-11-01 15:00:50 -07:00
David Collazo
2d71b8ae2c Add unit test for M3CTextField's layoutSubviews.
PiperOrigin-RevId: 691940350
2024-10-31 14:40:57 -07:00
David Collazo
c2b27722ff Add unit tests for M3CTextField's proxy properties and rightViewMode.
PiperOrigin-RevId: 691568689
2024-10-30 15:13:03 -07:00
David Collazo
ac77ff743d Add unit tests for M3CTextField's color setters.
PiperOrigin-RevId: 686161099
2024-10-15 10:49:28 -07:00
David Collazo
6046d06e3c Update M3CTextView to call applyAllColor when setting a color for a state, and add unit tests.
PiperOrigin-RevId: 685772722
2024-10-14 11:21:25 -07:00
David Collazo
17067e817f Add unit tests for M3CTextField.
PiperOrigin-RevId: 683766344
2024-10-08 14:32:14 -07:00
Mila Green
d05054517e Fix issue with setting colors.
PiperOrigin-RevId: 602773657
2024-01-30 10:42:26 -08:00
David Collazo
9da85831c6 Add attributedPlaceholder to M3CTextField.
PiperOrigin-RevId: 598858095
2024-01-16 09:04:44 -08:00
Janette James
fa93c43d0e Ensure text fields have zero padding by default
PiperOrigin-RevId: 588582859
2023-12-06 16:43:42 -08:00
Nobody
9550d68209 This CL adds the ability to inject a custom UITextField/M3CInsetTextField subclass into M3CTextField. This makes it so that integrators are not restricted by the fact that M3CTextField wraps UITextField instead of inheriting from it (unlike MDCTextField). It allows integrators to still use any of the modifications they did by subclassing MDCTextField, while being able to benefit from M3CTextField.
One use-case/blocker we faced on our team was the inability to control cut/copy/paste behavior. This requires subclassing UITextField and overriding `canPerformAction`.

PiperOrigin-RevId: 584138917
2023-11-20 15:08:45 -08:00
David Collazo
eb9145f431 Fix trailingLabel spacing when M3CTextField is used in a UICollectionViewCell.
PiperOrigin-RevId: 575936639
2023-10-23 14:54:32 -07:00
David Collazo
2b78a3fbe5 Move errorIcon configuration into M3CTextField component.
PiperOrigin-RevId: 575896384
2023-10-23 12:32:35 -07:00
David Collazo
cc396d629e Add public rightViewMode, leftViewMode, clearButton, and clearButtonTintColor properties to M3CTextField.
PiperOrigin-RevId: 574166375
2023-10-17 09:01:06 -07:00
David Collazo
05d401933b Add custom clear button to M3CTextField and fix rightView padding for RTL.
PiperOrigin-RevId: 564407621
2023-09-11 09:21:26 -07:00
David Collazo
7bdb76e40e Update M3CTextView's state colors to match spec, and add proxy properties
PiperOrigin-RevId: 548759468
2023-07-17 12:01:30 -07:00
David Collazo
1c526a8418 Set M3CTextInput's trailing label's horizontal content compression resistance priority to required.
PiperOrigin-RevId: 544057602
2023-06-28 07:59:31 -07:00
David Collazo
24e09cbe25 Add proxy properties to M3CTextField, and split label colors.
PiperOrigin-RevId: 537009155
2023-06-01 07:00:03 -07:00
David Collazo
0562095ce6 Separate M3CTextView's textColor into inputColor and labelColor.
PiperOrigin-RevId: 535715635
2023-05-26 14:40:49 -07:00
David Collazo
6aeb3d9028 Separate M3CTextField's textColor into inputColor and labelColor.
PiperOrigin-RevId: 535710054
2023-05-26 14:15:27 -07:00
David Collazo
a9bb4b1952 Add setColorForState API to M3CTextView.
PiperOrigin-RevId: 534931913
2023-05-24 12:13:06 -07:00
David Collazo
0c79f8bf91 Make M3CTextInput custom control state public.
PiperOrigin-RevId: 534262760
2023-05-22 20:01:30 -07:00
David Collazo
1b9adbd3cb Add custom UIControl.State for M3CTextInput, and implement set...Color:forState: for M3CTextField.
PiperOrigin-RevId: 533575552
2023-05-19 16:20:39 -07:00
David Collazo
59718c7cd6 Add objc attributes to public properties in M3CTextField and M3CTextView.
PiperOrigin-RevId: 533461846
2023-05-19 08:41:32 -07:00
David Collazo
3f5a80e035 Add M3CTextInput protocol and M3CTextView component.
PiperOrigin-RevId: 531599407
2023-05-12 14:07:31 -07:00
David Collazo
f949cc1df6 Change M3CTextField minimum version from 14.0 to 13.0.
PiperOrigin-RevId: 529483374
2023-05-04 12:35:25 -07:00
David Collazo
0e392639b6 Enable adjustsFontForContentSizeCategory on M3CTextField's label properties.
PiperOrigin-RevId: 529472599
2023-05-04 11:54:12 -07:00
David Collazo
eb4bc7d093 Rename textField property to textContainer
PiperOrigin-RevId: 526116019
2023-04-21 13:07:20 -07:00
David Collazo
c9ea8a3052 Change caretRect to use averaged diff between font.lineHeight and caret height as a y-offset.
PiperOrigin-RevId: 526046841
2023-04-21 08:45:23 -07:00
David Collazo
82eae0f0f7 Override carectRect to use font's lineHeight.
PiperOrigin-RevId: 525013294
2023-04-17 19:36:19 -07:00
David Collazo
94a060f87d Add M3CTextField component.
PiperOrigin-RevId: 524323656
2023-04-14 10:23:18 -07:00