Compare commits

...

59 Commits

Author SHA1 Message Date
Pfeil, Scott Robert
8212d7146c Merge branch 'bugfix/CXTDT-626224' into 'develop'
CXTDT-626224

### Summary
CXTDT-626224
MVA/iOS: Progress section has visual defects that need to be corrected.
Change :-  Number size should be: (font-size: 32px / line-height: 36px and “%” symbol size should be: font-size: 11px / line-height: 16px

### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-626224![Screenshot_2024-10-17_at_7.15.02_PM](/uploads/e89f367a09b23c230ab4f461320fc669/Screenshot_2024-10-17_at_7.15.02_PM.png)

![Screenshot_2024-10-17_at_7.15.33_PM](/uploads/a5055585223f4ab2697d1ce79f52d43b/Screenshot_2024-10-17_at_7.15.33_PM.png)

Co-authored-by: rajani kumari  Gupta <rajani.kumari.gupta@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1204
2024-10-21 13:10:53 +00:00
rajani kumari Gupta
5c280b7922 Fix comment 2024-10-21 14:28:34 +05:30
Pfeil, Scott Robert
1eed9ebb76 Merge branch 'feature/safe_area_insets' into 'develop'
Digital ACT192 story ONEAPP-11297 - Updating insets to allow for more...

### Summary
Updating insets to allow flexibility with the safe area

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-6673

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1203
2024-10-17 15:30:33 +00:00
Scott Pfeil
a210b8da9b Remove Spacer 2024-10-17 09:34:50 -04:00
Scott Pfeil
44adc76dcb Digital ACT192 story ONEAPP-11297 - Updating insets to allow for more flexibility and edge using. Removing the status bar view because it is no longer used. 2024-10-17 09:04:31 -04:00
rajani kumari Gupta
eb4f741f1a CXTDT-626224
MVA/iOS: Progress section has visual defects that need to be corrected.
issue fixed :- Number size should be: (font-size: 32px / line-height: 36px and “%” symbol size should be: font-size: 11px / line-height: 16px
2024-10-17 17:47:24 +05:30
Bruce, Matt R
928c8c5b54 Merge branch 'bugfix/CXTDT-626309' into 'develop'
Digital ACT191 defect CXTDT-626309 - Updating fonts and spacing

### Summary
Fixes to the header component defaults.
https://docs.google.com/spreadsheets/d/1DqG_ZDxIseuVsEtRaQTVRC5mHME79Ksmhdj067jLNr4/edit?pli=1&gid=0#gid=0

### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-626309
https://onejira.verizon.com/browse/CXTDT-628092

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1202
2024-10-16 16:34:13 +00:00
Scott Pfeil
2dd3a7dca8 Merge branch 'develop' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into bugfix/CXTDT-626309 2024-10-16 12:31:28 -04:00
Scott Pfeil
7bed914dca Digital ACT191 defect CXTDT-626309 - Updating fonts and spacing
Digital ACT191 defect CXTDT-628092 - Fixing accessibility trait header default.
2024-10-16 10:53:16 -04:00
Pfeil, Scott Robert
fe5bd4a9ac Merge branch 'feature/CXTDT-624895-Badge-Color-Updates' into 'develop'
refactored badge text/fill color

### Summary
Fixed bug in how fillColor is set.

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1200
2024-10-16 01:25:12 +00:00
Matt Bruce
7eb1a4ff4b redid the values
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-15 16:57:37 -05:00
Matt Bruce
76b58ec88a using type now and not the old way.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-14 15:57:25 -05:00
Matt Bruce
4487f9b03b refactored badge text/fill color
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-14 15:53:31 -05:00
Scott Pfeil
3a06f7b43e Digital ACT191 defect CXTDT-626309 - Update to default header h2 padding 2024-10-14 11:03:24 -04:00
Hedden, Kyle Matthew
f3e97ecfd4 Merge branch 'feature/CXTDT-624895-Badge-Color-Updates' into 'develop'
VDS - iOS Badge - Include ability to select custom color for Label and Background

### Summary
CXT - Defect TrackerCXTDT-624895
VDS - iOS Badge - Include ability to select custom color for Label and Background
### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-624895

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1199
2024-10-09 13:04:36 +00:00
Matt Bruce
f66dc66818 undid comment
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-08 09:18:23 -05:00
Matt Bruce
bf2a3e7e5b removed isDark
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-08 09:10:04 -05:00
Matt Bruce
54b50bffd3 added fillColor codable
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-08 09:08:30 -05:00
Matt Bruce
3b2dc2d447 updated to use badgeModel
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-08 09:08:20 -05:00
Matt Bruce
c737ca1344 added textColor
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-08 09:08:05 -05:00
Pfeil, Scott Robert
d2e841c533 Merge branch 'bugfix/FontLabelAttribute-conversion' into 'develop'
added in model conversion to textStyle

### Summary
The size was not being used in the conversion along with the name. 

So now you either pass in a Style or a Name & Size.

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1197
2024-10-04 17:57:09 +00:00
Matt Bruce
69d057c45a added in model conversion to textStyle
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-10-04 12:03:18 -05:00
Pfeil, Scott Robert
0510cded89 Merge branch 'feature/ONEAPP-11359' into 'develop'
Digital ACT192 story ONEAPP-11359: Lift the minimum supported iOS version number to 15.

### Summary
Lift the minimum supported iOS version number to 15.

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-11359

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1196
2024-10-03 21:07:26 +00:00
Hedden, Kyle Matthew
03a8a2d925 Merge branch 'bugfix/missing_accessibility_identifiers' into 'develop'
Added missing accessibility identifier

### Summary
Added missing accessibilityIdentifiers

### JIRA Ticket
Awaiting

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1195
2024-10-02 21:38:41 +00:00
Hedden, Kyle Matthew
65bf81830e Digital ACT192 story ONEAPP-11359: Lift the minimum supported iOS version number to 15. 2024-10-01 20:24:32 -04:00
Scott Pfeil
bb2fbe4bdd Added missing accessibility identifier 2024-09-27 12:13:09 -04:00
Pfeil, Scott Robert
ce038458dc Merge branch 'bugfix/atomic-vds-titleLockup-model-issue' into 'develop'
TitleLockup Model issue

### Summary
removed duplicate alignment property and updated the confluence to reference the correct textAlignment.

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1194
2024-09-27 14:40:34 +00:00
Matt Bruce
de33f8ffa1 fixed migration issue in checkboxLabel to integrate the VDS.CheckboxItem
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-09-27 09:38:36 -05:00
Matt Bruce
4d4765ccec removed duplicate alignment property and updated the confluence to reference the correct textAlignment.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-09-27 09:03:12 -05:00
Bruce, Matt R
464e36606e Merge branch 'bugfix/MVAPCT-271' into 'develop'
Digital PCT265 defect MVAPCT-271 - Ensure the app doesn't crash on invalid color hex.

### Summary
Ensure the app doesn't crash on invalid color hex. 

### JIRA Ticket
https://onejira.verizon.com/browse/MVAPCT-271

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1192
2024-09-20 18:05:55 +00:00
Scott Pfeil
8a7c07ecf2 Digital PCT265 defect MVAPCT-271 - greater than or equal to length fix 2024-09-20 14:04:44 -04:00
Scott Pfeil
740c3eeb31 Digital PCT265 defect MVAPCT-271 - Ensure the app doesn't crash on invalid color hex. 2024-09-20 12:45:11 -04:00
Hedden, Kyle Matthew
00a11cd5dc Merge branch 'feature/atomic-vds-sept2024' into 'develop'
September Atomic/VDS Release

### Summary
Added Breadcrumbs and Pagination 

### JIRA Ticket
- https://onejira.verizon.com/browse/ONEAPP-6827
- https://onejira.verizon.com/browse/ONEAPP-6978

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1185
2024-09-20 16:29:11 +00:00
Matt Bruce
03a1bd0920 made parentalmodelmolecule
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-09-20 08:30:51 -05:00
Matt Bruce
4f6b848e72 removed inits
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-09-20 08:30:37 -05:00
Matt Bruce
5043ff35a0 removed inits
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-09-20 08:30:27 -05:00
Bruce, Matt R
806ac9821a Merge branch 'bugfix/featured_products_defects' into 'develop'
Bugfix/featured products defects

### Summary
Fix for bold when the font isn't supported, and for bg image forcing full image size.

Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1191
2024-09-19 18:41:29 +00:00
Scott Pfeil
47e63e0c8b Digital ACT191 defect FeaturedProducts - Fix for bold when the font isn't supported, and for bg image forcing full image size. 2024-09-19 14:35:33 -04:00
Hedden, Kyle Matthew
2d7f8ae2ca Merge branch 'feature/MVAPCT-273' into 'develop'
MVAPCT-273

### Summary
Template Decoding Failed Error logs

### MVAPCT-273
https://onejira.verizon.com/browse/MVAPCT-273

Co-authored-by: Danish Phiroz <danish.phiroz@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1188
2024-09-19 12:27:47 +00:00
Phiroz, Danish
e708b97581 MVAPCT-273 2024-09-19 12:27:47 +00:00
Hedden, Kyle Matthew
1b5ca94988 Merge branch 'release/20_2_0' into 'develop'
release/20_2_0 hotfix merge

Co-authored-by: Pfeil, Scott Robert <scott.pfeil3@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1182
2024-09-06 19:59:31 +00:00
Pfeil, Scott Robert
d7756b66b0 Merge branch 'bugfix/CXTDT-608227-2' into 'release/20_2_0'
Digital PCT032 defect CXTDT-608227: Set content compression resistance for RadioButton.

### Summary
Prevent the radio button from being crushed.

### JIRA Ticket
https://onejira.verizon.com/browse/CXTDT-608227

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1187
2024-08-29 17:59:42 +00:00
Hedden, Kyle Matthew
89842ee443 Digital PCT032 defect CXTDT-608227: Set content compression resistance for RadioButton. 2024-08-29 13:39:41 -04:00
Matt Bruce
61f9fb9946 enforce an action
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-08-27 16:38:17 -05:00
Matt Bruce
484b578568 added Pagination
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-08-27 14:30:39 -05:00
Matt Bruce
1c723c31de registered in core
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-08-26 16:13:16 -05:00
Matt Bruce
e79c1d7637 added breadcrumbs/model
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-08-26 16:13:05 -05:00
Bruce, Matt R
02a2da7f0a Merge branch 'bugfix/CXTDT-601365' into 'develop'
Fix for CXTDT-601365, enabling option for Icon to be accessible from JSON.

### Summary
Enabling option for Icon to be accessible from JSON.

### JIRA Ticket
[CXTDT-601365](https://onejira.verizon.com/browse/CXTDT-601365)

Co-authored-by: Sumanth Nadigadda <sumanth.nadigadda@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1183
2024-08-26 18:49:05 +00:00
Sumanth Nadigadda
22c30de62f Fix for CXTDT-601365, enabling option for Icon to be accessible from JSON. 2024-08-26 23:40:29 +05:30
Hedden, Kyle Matthew
f6f3cd53fe Merge branch 'feature/atomic-vds-new-forms-atoms' into 'develop'
Revert code

### Summary
Removed code since this was a fix in VDS

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1180
2024-08-23 17:29:19 +00:00
Hedden, Kyle Matthew
c2e10582f8 Merge branch 'feature/atomic-vds-new-forms-atoms' into 'develop'
Last of the VDS FormFields

### Summary
Added in 
1. Checkboxes (VDS CheckboxGroup)
2. RadioButtons (VDS RadioButtonGroup)
3. CalendarView (VDS CalendarBase)
4. DatePickerEntryField (VDS DatePicker)

### JIRA Ticket
https://onejira.verizon.com/browse/ONEAPP-7001
https://onejira.verizon.com/browse/ONEAPP-7004
https://onejira.verizon.com/browse/ONEAPP-7016
https://onejira.verizon.com/browse/ONEAPP-7958

Co-authored-by: Matt Bruce <matt.bruce@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1176
2024-08-22 21:46:28 +00:00
Bruce, Matt R
7f9ee10c5e Merge branch 'feature/tile_cont_upd_view' into 'develop'
added updateView for molecule in tile container

Added this change as updateView for the molecule was not getting called resulting in the molecule and its children always pinned to their respective superviews.

Co-authored-by: Arun Kumar Chintakrinda <arun.kumar.chintakrinda@verizon.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1179
2024-08-22 14:25:37 +00:00
Arun Kumar Chintakrinda
6354174857 Merge remote-tracking branch 'refs/remotes/origin/develop' 2024-08-22 19:46:40 +05:30
Arun Kumar Chintakrinda
3be3b11e39 added updateView for molecule in tile container 2024-08-22 19:41:43 +05:30
Bruce, Matt R
de30c5d286 Merge branch 'bugfix/molecule_replacement_module_id_validation' into 'develop'
Digital PCT265 defect: Missing moecule.id to moduleName validation for the replacement behavior.

### Summary
Data validation bug on notification_count_fios module return.

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1178
2024-08-22 12:56:13 +00:00
Hedden, Kyle Matthew
472323f303 Digital PCT265 defect: Missing moecule.id to moduleName validation for the replacement behavior. 2024-08-21 19:59:46 -04:00
Bruce, Matt R
6c841c078a Merge branch 'release/20_1_1' into 'develop'
Digital PCT265 defect: VDS TabsTableViewCell delegate reset issue. Impacts UAD...

Co-authored-by: Subramaniam, Ramya <ramya.subramaniam@one.verizon.com>
Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1177
2024-08-21 13:17:32 +00:00
Subramaniam, Ramya
8c5a8776ab Merge branch 'bugfix/tabstableviewcell' into 'release/20_1_1'
Digital PCT265 defect: VDS TabsTableViewCell delegate reset issue. Impacts UAD.

### Summary
This issue is due to a change in the VDS tabs reset handling. The onTabSelect and onTabShouldSelect gets reset to nil. In the case of table cell reuse this reset gets called and our setup connection in the initializer is lost. Adding the delegate back in the model setter seems to resolve this immediate issue but we should expand out and see if there are other cases.

### JIRA Ticket
[CXTDT-601399](https://onejira.verizon.com/browse/CXTDT-601399)

Co-authored-by: Hedden, Kyle Matthew <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/1174
2024-08-14 05:34:05 +00:00
Hedden, Kyle Matthew
3867384307 Digital PCT265 defect: VDS TabsTableViewCell delegate reset issue. Impacts UAD account tab switcher. 2024-08-13 23:25:18 -04:00
126 changed files with 954 additions and 227 deletions

View File

@ -602,6 +602,10 @@
EA7AE5512C74EB4500107C74 /* CalendarViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE5502C74EB4500107C74 /* CalendarViewModel.swift */; };
EA7AE5532C74F1F600107C74 /* DatePickerEntryField.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE5522C74F1F600107C74 /* DatePickerEntryField.swift */; };
EA7AE5552C74F20600107C74 /* DatePickerEntryFieldModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE5542C74F20600107C74 /* DatePickerEntryFieldModel.swift */; };
EA7AE55C2C7D18A100107C74 /* BreadcrumbsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE55B2C7D18A100107C74 /* BreadcrumbsModel.swift */; };
EA7AE55E2C7D234500107C74 /* Breadcrumbs.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE55D2C7D234500107C74 /* Breadcrumbs.swift */; };
EA7AE5602C7E554700107C74 /* PaginationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE55F2C7E554700107C74 /* PaginationModel.swift */; };
EA7AE5622C7E555D00107C74 /* Pagination.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7AE5612C7E555D00107C74 /* Pagination.swift */; };
EA7D81602B2B6E6800D29F9E /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7D815F2B2B6E6800D29F9E /* Icon.swift */; };
EA7D81622B2B6E7F00D29F9E /* IconModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7D81612B2B6E7F00D29F9E /* IconModel.swift */; };
EA7D81642B2BABCB00D29F9E /* TooltipModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA7D81632B2BABCB00D29F9E /* TooltipModel.swift */; };
@ -1239,6 +1243,10 @@
EA7AE5502C74EB4500107C74 /* CalendarViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarViewModel.swift; sourceTree = "<group>"; };
EA7AE5522C74F1F600107C74 /* DatePickerEntryField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerEntryField.swift; sourceTree = "<group>"; };
EA7AE5542C74F20600107C74 /* DatePickerEntryFieldModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerEntryFieldModel.swift; sourceTree = "<group>"; };
EA7AE55B2C7D18A100107C74 /* BreadcrumbsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BreadcrumbsModel.swift; sourceTree = "<group>"; };
EA7AE55D2C7D234500107C74 /* Breadcrumbs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Breadcrumbs.swift; sourceTree = "<group>"; };
EA7AE55F2C7E554700107C74 /* PaginationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaginationModel.swift; sourceTree = "<group>"; };
EA7AE5612C7E555D00107C74 /* Pagination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pagination.swift; sourceTree = "<group>"; };
EA7D815F2B2B6E6800D29F9E /* Icon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Icon.swift; sourceTree = "<group>"; };
EA7D81612B2B6E7F00D29F9E /* IconModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconModel.swift; sourceTree = "<group>"; };
EA7D81632B2BABCB00D29F9E /* TooltipModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TooltipModel.swift; sourceTree = "<group>"; };
@ -2203,6 +2211,7 @@
D29DF10E21E67A77003B2FB9 /* Molecules */ = {
isa = PBXGroup;
children = (
EA7AE55A2C7D188900107C74 /* Breadcrumbs */,
D2EC7BD22527A1E400F540AF /* HeadersAndFooters */,
D2CAC7C9251104CB00C75681 /* TopNotification */,
D2509ED42472EE0B001BFB9D /* NavigationBar */,
@ -2364,6 +2373,8 @@
D20492A524329CE200A5EED6 /* LoadImageView.swift */,
0A51F3E02475CB73002E08B6 /* LoadingSpinnerModel.swift */,
0A51F3E12475CB73002E08B6 /* LoadingSpinner.swift */,
EA7AE55F2C7E554700107C74 /* PaginationModel.swift */,
EA7AE5612C7E555D00107C74 /* Pagination.swift */,
AA37CBD2251907200027344C /* StarsModel.swift */,
AA37CBD42519072F0027344C /* Stars.swift */,
AA07EA902510A442009A2AE3 /* StarModel.swift */,
@ -2641,6 +2652,15 @@
path = Alerts;
sourceTree = "<group>";
};
EA7AE55A2C7D188900107C74 /* Breadcrumbs */ = {
isa = PBXGroup;
children = (
EA7AE55B2C7D18A100107C74 /* BreadcrumbsModel.swift */,
EA7AE55D2C7D234500107C74 /* Breadcrumbs.swift */,
);
path = Breadcrumbs;
sourceTree = "<group>";
};
EAA0CFAD275E7D5A00D65EB0 /* FormFieldEffect */ = {
isa = PBXGroup;
children = (
@ -2943,6 +2963,7 @@
D29DF2CF21E7C104003B2FB9 /* MFLoadingViewController.m in Sources */,
D28A837B23C928DA00DFE4FC /* MoleculeListCellProtocol.swift in Sources */,
D28BA74D248589C800B75CB8 /* TabPageModelProtocol.swift in Sources */,
EA7AE5602C7E554700107C74 /* PaginationModel.swift in Sources */,
608211282AC6B57E00C3FC39 /* MVMCoreUILoggingHandler.swift in Sources */,
014AA72F23C5059B006F3E93 /* ThreeLayerPageTemplateModel.swift in Sources */,
0A21DB91235E0EDB00C160A2 /* DigitBox.swift in Sources */,
@ -2968,8 +2989,10 @@
525239C02407BCFF00454969 /* ListTwoColumnPriceDetailsModel.swift in Sources */,
D2E2A99A23D8D6B4000B42E6 /* HeadlineBodyButtonModel.swift in Sources */,
D202AFE6242A6A9C00E5BEDF /* UICollectionViewScrollPosition+Extension.swift in Sources */,
EA7AE55C2C7D18A100107C74 /* BreadcrumbsModel.swift in Sources */,
D20F3B44252E00E4004B3F56 /* PageProtocol.swift in Sources */,
AA37CBD3251907200027344C /* StarsModel.swift in Sources */,
EA7AE5622C7E555D00107C74 /* Pagination.swift in Sources */,
8D084AD22410BF7600951227 /* ListOneColumnFullWidthTextBodyText.swift in Sources */,
94C0150C2421564A005811A9 /* ActionCollapseNotificationModel.swift in Sources */,
D2CAC7CB251104E100C75681 /* NotificationXButtonModel.swift in Sources */,
@ -2996,6 +3019,7 @@
AAE96FA525341F7D0037A989 /* ListStoreLocator.swift in Sources */,
D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */,
944589232385DA9600DE9FD4 /* ImageViewModel.swift in Sources */,
EA7AE55E2C7D234500107C74 /* Breadcrumbs.swift in Sources */,
D213347723843825008E41B3 /* Line.swift in Sources */,
D2E2A99C23D8D975000B42E6 /* ImageHeadlineBodyModel.swift in Sources */,
BB3BC1302550094500297977 /* ListLeftVariableIconWithRightCaretAllTextLinksModel.swift in Sources */,
@ -3601,7 +3625,7 @@
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../SharedFrameworks";
INFOPLIST_FILE = MVMCoreUI/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -3631,7 +3655,7 @@
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../SharedFrameworks";
INFOPLIST_FILE = MVMCoreUI/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View File

@ -38,7 +38,10 @@ open class ButtonGroup: VDS.ButtonGroup, VDSMoleculeViewProtocol {
return PillButton.estimatedHeight(with: buttonModel, delegateObject)
}
public func viewModelDidUpdate() {
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
isEnabled = viewModel.enabled
alignment = viewModel.alignment

View File

@ -7,6 +7,7 @@
//
import Foundation
import MVMCore
import VDS
public class ButtonGroupModel: ParentMoleculeModelProtocol {
@ -17,6 +18,7 @@ public class ButtonGroupModel: ParentMoleculeModelProtocol {
public static var identifier: String = "buttonGroup"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var children: [MoleculeModelProtocol] { buttons }
@ -38,6 +40,7 @@ public class ButtonGroupModel: ParentMoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case buttons
case alignment
@ -56,6 +59,7 @@ public class ButtonGroupModel: ParentMoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
surface = try typeContainer.decodeIfPresent(Surface.self, forKey: .surface) ?? .light
enabled = try typeContainer.decodeIfPresent(Bool.self, forKey: .enabled) ?? true
buttons = try typeContainer.decodeModels(codingKey: .buttons)
@ -70,6 +74,7 @@ public class ButtonGroupModel: ParentMoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(surface, forKey: .surface)
try container.encode(enabled, forKey: .enabled)
try container.encodeModels(buttons, forKey: .buttons)

View File

@ -15,7 +15,8 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
public static var identifier: String = "imageButton"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var image: ImageViewModel?
@ -45,6 +46,7 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case image
case backgroundColor
case accessibilityText
@ -64,6 +66,7 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
image = try typeContainer.decodeIfPresent(ImageViewModel.self, forKey: .image)
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
@ -91,6 +94,7 @@ open class ImageButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGro
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(image, forKey: .image)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)

View File

@ -12,13 +12,15 @@ import MVMCore
@objcMembers public class TagModel: MoleculeModelProtocol {
public static var identifier: String = "tag"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var label: LabelModel
public var action: ActionModelProtocol?
public var backgroundColor: Color?
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case label
case action
@ -42,6 +44,7 @@ import MVMCore
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
label = try typeContainer.decode(LabelModel.self, forKey: .label)
action = try typeContainer.decodeModelIfPresent(codingKey: .action)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
@ -50,6 +53,7 @@ import MVMCore
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(label, forKey: .label)
try container.encodeModelIfPresent(action, forKey: .action)

View File

@ -12,12 +12,14 @@ import MVMCore
@objcMembers public class TagsModel: MoleculeModelProtocol {
public static var identifier: String = "tags"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var tags: [TagModel]
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case tags
@ -34,6 +36,7 @@ import MVMCore
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
tags = try typeContainer.decode([TagModel].self, forKey: .tags)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
}
@ -41,6 +44,7 @@ import MVMCore
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(tags, forKey: .tags)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -123,6 +123,9 @@ import VDS
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
//forms
FormValidator.setupValidation(for: viewModel, delegate: delegateObject?.formHolderDelegate)
groupName = viewModel.groupName

View File

@ -28,6 +28,9 @@ open class Checkboxes: VDS.CheckboxGroup, VDSMoleculeViewProtocol {
// MARK: - MoleculeViewProtocol
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
showError = viewModel.showError
isEnabled = viewModel.enabled && !viewModel.readOnly

View File

@ -28,7 +28,9 @@ import VDS
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
text = viewModel.text
subText = viewModel.subText
subTextRight = viewModel.subTextRight

View File

@ -28,6 +28,9 @@ open class RadioBoxes: VDS.RadioBoxGroup, VDSMoleculeViewProtocol {
// MARK: - MoleculeViewProtocol
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
boxes = viewModel.boxes
surface = viewModel.surface
selectorModels = viewModel.boxes.convertToVDSRadioBoxModel(surface: surface)

View File

@ -79,6 +79,11 @@ import VDS
//--------------------------------------------------
open override func setup() {
super.setup()
// Radio button should never be smaller that its content size.
setContentCompressionResistancePriority(.required, for: .vertical)
setContentCompressionResistancePriority(.required, for: .horizontal)
publisher(for: .valueChanged)
.sink { [weak self] control in
guard let self, isEnabled else { return }
@ -88,7 +93,9 @@ import VDS
}
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
//events
viewModel.updateUI = {
MVMCoreDispatchUtility.performBlock(onMainThread: { [weak self] in

View File

@ -28,6 +28,9 @@ open class RadioButtons: VDS.RadioButtonGroup, VDSMoleculeViewProtocol {
// MARK: - MoleculeViewProtocol
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
showError = viewModel.showError
isEnabled = viewModel.isEnabled
surface = viewModel.surface

View File

@ -103,6 +103,9 @@ public typealias ActionBlockConfirmation = () -> (Bool)
}
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
FormValidator.setupValidation(for: viewModel, delegate: delegateObject?.formHolderDelegate)
isOn = viewModel.selected

View File

@ -19,7 +19,8 @@ open class ArrowModel: MoleculeModelProtocol, EnableableModelProtocol {
}
public var moleculeName: String?
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var disabledColor: Color = Color(uiColor: .mvmCoolGray3)
public var color: Color = Color(uiColor: .mvmBlack)
@ -59,6 +60,7 @@ open class ArrowModel: MoleculeModelProtocol, EnableableModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case disabledColor
@ -79,7 +81,8 @@ open class ArrowModel: MoleculeModelProtocol, EnableableModelProtocol {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let disabledColor = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledColor) {
self.disabledColor = disabledColor
}
@ -116,6 +119,7 @@ open class ArrowModel: MoleculeModelProtocol, EnableableModelProtocol {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(disabledColor, forKey: .disabledColor)

View File

@ -27,10 +27,14 @@ open class Badge: VDS.Badge, VDSMoleculeViewProtocol {
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
text = viewModel.text
textColor = viewModel.textColorStyle
maxWidth = viewModel.maxWidth
numberOfLines = viewModel.numberOfLines
fillColor = viewModel.fillColor
fillColor = viewModel.fillColorStyle
surface = viewModel.surface
}

View File

@ -25,6 +25,9 @@ open class BadgeIndicator: VDS.BadgeIndicator, VDSMoleculeViewProtocol {
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
number = viewModel.number
fillColor = viewModel.fillColor

View File

@ -17,7 +17,8 @@ open class BadgeIndicatorModel: MoleculeModelProtocol {
public static var identifier: String { "badgeIndicator" }
public var id: String = UUID().uuidString
public var backgroundColor: Color?
public var accessibilityIdentifier: String?
//--------------------------------------------------
// MARK: - VDS Properties
//--------------------------------------------------
@ -43,6 +44,7 @@ open class BadgeIndicatorModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case inverted
case accessibilityText
case number
@ -67,6 +69,7 @@ open class BadgeIndicatorModel: MoleculeModelProtocol {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.init()
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText)
number = try container.decodeIfPresent(Int.self, forKey: .number)
@ -91,6 +94,7 @@ open class BadgeIndicatorModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(inverted, forKey: .inverted)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
try container.encodeIfPresent(number, forKey: .number)
try container.encodeIfPresent(fillColor, forKey: .fillColor)

View File

@ -16,28 +16,46 @@ open class BadgeModel: MoleculeModelProtocol {
public static var identifier: String = "badge"
public var id: String = UUID().uuidString
public var backgroundColor: Color?
public var accessibilityIdentifier: String?
//--------------------------------------------------
// MARK: - VDS Properties
//--------------------------------------------------
public var text: String = ""
public var textColorStyle: Badge.TextColor? = nil
public var accessibilityText: String?
public var maxWidth: CGFloat?
public var numberOfLines: Int = 1
public var fillColor = Badge.FillColor.red
public var fillColorStyle = Badge.FillColor.red
public var surface: Surface = .light
private enum CodingKeys: String, CodingKey {
case id, text, accessibilityText, fillColor, surface, numberOfLines, maxWidth
case id, accessibilityIdentifier, accessibilityText
case surface, numberOfLines, maxWidth
case text, textColor
case fillColor, fillColorStyle
}
required public convenience init(from decoder: Decoder) throws {
self.init()
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
text = try container.decode(String.self, forKey: .text)
accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText)
fillColor = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColor) ?? .red
//look for a textColor
if let textColor = try container.decodeIfPresent(Color.self, forKey: .textColor) {
textColorStyle = .custom(textColor.uiColor)
}
//look for a style
fillColorStyle = try container.decodeIfPresent(Badge.FillColor.self, forKey: .fillColorStyle) ?? .red
//look for a color and set the style
if let fillColor = try container.decodeIfPresent(Color.self, forKey: .fillColor) {
fillColorStyle = .custom(fillColor.uiColor)
}
surface = try container.decodeIfPresent(Surface.self, forKey: .surface) ?? .light
numberOfLines = try container.decodeIfPresent(Int.self, forKey: .numberOfLines) ?? 1
maxWidth = try container.decodeIfPresent(CGFloat.self, forKey: .maxWidth)
@ -48,16 +66,24 @@ open class BadgeModel: MoleculeModelProtocol {
try container.encode(id, forKey: .id)
try container.encode(text, forKey: .text)
try container.encode(accessibilityText, forKey: .accessibilityText)
try container.encode(fillColor, forKey: .fillColor)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(surface, forKey: .surface)
try container.encode(numberOfLines, forKey: .numberOfLines)
try container.encodeIfPresent(maxWidth, forKey: .maxWidth)
try container.encode(fillColorStyle, forKey: .fillColorStyle)
switch textColorStyle {
case .custom(let color):
try container.encode(Color(uiColor: color), forKey: .textColor)
default:
break
}
}
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
guard let model = model as? BadgeModel else { return false }
return self.backgroundColor == model.backgroundColor
&& self.fillColor == model.fillColor
&& self.fillColorStyle == model.fillColorStyle
&& self.textColorStyle == model.textColorStyle
&& self.numberOfLines == model.numberOfLines
&& self.text == model.text
&& self.surface == model.surface

View File

@ -25,6 +25,9 @@ open class ButtonIcon: VDS.ButtonIcon, VDSMoleculeViewProtocol {
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
onClick = { [weak self] control in

View File

@ -16,7 +16,8 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol {
public static var identifier: String = "buttonIcon"
public var id: String = UUID().uuidString
public var backgroundColor: Color?
public var accessibilityIdentifier: String?
//--------------------------------------------------
// MARK: - VDS Properties
//--------------------------------------------------
@ -77,6 +78,7 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol {
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case inverted
case accessibilityText
case action
@ -105,6 +107,7 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol {
let container = try decoder.container(keyedBy: CodingKeys.self)
action = try container.decodeModel(codingKey: .action)
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
accessibilityText = try container.decodeIfPresent(String.self, forKey: .accessibilityText)
badgeIndicator = try container.decodeIfPresent(BadgeIndicatorModel.self, forKey: .badgeIndicator)
@ -128,6 +131,7 @@ open class ButtonIconModel: ButtonModelProtocol, MoleculeModelProtocol {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(inverted, forKey: .inverted)
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
try container.encodeIfPresent(badgeIndicator, forKey: .badgeIndicator)

View File

@ -22,6 +22,9 @@ open class CalendarView: VDS.CalendarBase, VDSMoleculeViewProtocol {
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
if let _selectedDate = viewModel.selectedDate {
selectedDate = _selectedDate
}

View File

@ -16,6 +16,7 @@ open class CalendarViewModel: MoleculeModelProtocol {
public static var identifier: String = "calendar"
public var id: String = UUID().uuidString
public var backgroundColor: Color?
public var accessibilityIdentifier: String?
public var dateFormatter: DateFormatter = {
let formatter = DateFormatter()
@ -51,6 +52,8 @@ open class CalendarViewModel: MoleculeModelProtocol {
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case inverted
case dateFormat
case hideContainerBorder
@ -76,7 +79,8 @@ open class CalendarViewModel: MoleculeModelProtocol {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
hideContainerBorder = try container.decodeIfPresent(Bool.self, forKey: .hideContainerBorder)
hideCurrentDateIndicator = try container.decodeIfPresent(Bool.self, forKey: .hideCurrentDateIndicator)
@ -111,7 +115,9 @@ open class CalendarViewModel: MoleculeModelProtocol {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(inverted, forKey: .inverted)
try container.encode(dateFormat, forKey: .dateFormat)
try container.encode(hideContainerBorder, forKey: .hideContainerBorder)

View File

@ -16,6 +16,7 @@ import MVMCore
public static var identifier: String = "caretView"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var strokeColor: Color = Color(uiColor: .mvmBlack)
public var strokeColor_inverted: Color = Color(uiColor: .mvmWhite)
@ -30,6 +31,7 @@ import MVMCore
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case strokeColor
@ -54,7 +56,8 @@ import MVMCore
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let strokeColor = try typeContainer.decodeIfPresent(Color.self, forKey: .strokeColor) {
self.strokeColor = strokeColor
}
@ -84,6 +87,7 @@ import MVMCore
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(strokeColor, forKey: .strokeColor)
try container.encode(strokeColor_inverted, forKey: .strokeColor_inverted)
try container.encode(inverted, forKey: .inverted)

View File

@ -19,6 +19,7 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
}
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var moleculeName: String?
@ -48,6 +49,7 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case currentIndex
@ -70,6 +72,7 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
moleculeName = try typeContainer.decodeIfPresent(String.self, forKey: .moleculeName)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
@ -118,6 +121,7 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(currentIndex, forKey: .currentIndex)
try container.encode(alwaysSendAction, forKey: .alwaysSendAction)

View File

@ -31,23 +31,20 @@ import VDS
// MARK: - Atomic
//--------------------------------------------------
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
updateCheckbox()
//primary label
labelText = viewModel.label.text
if let attributes = viewModel.label.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
labelTextAttributes = attributes
}
labelText = viewModel.label?.text
labelTextAttributes = viewModel.label?.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
//secondary label
if let subTitleModel = viewModel.subTitle {
childText = subTitleModel.text
if let attributes = subTitleModel.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
childTextAttributes = attributes
}
}
childText = viewModel.subTitle?.text
childTextAttributes = viewModel.subTitle?.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
}
private func performCheckboxAction(with actionModel: ActionModelProtocol, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {

View File

@ -14,17 +14,20 @@ import VDS
open class var identifier: String { "checkboxLabel" }
public var moleculeName: String = CheckboxLabelModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var checkbox: CheckboxModel
public var label: LabelModel
public var label: LabelModel?
public var subTitle: LabelModel?
public var inverted: Bool? = false
public var surface: Surface { inverted ?? false ? .dark : .light }
public var children: [MoleculeModelProtocol] {
guard let subTitle else { return [checkbox, label] }
return [checkbox, label, subTitle]
var values: [MoleculeModelProtocol] = [checkbox]
if let label { values.append(label) }
if let subTitle { values.append(subTitle) }
return values
}
//--------------------------------------------------
@ -54,8 +57,8 @@ extension Array where Element == CheckboxLabelModel {
return compactMap({ model in
var item = CheckboxGroup.CheckboxItemModel()
item.inputId = model.checkbox.fieldKey
item.labelText = model.label.text
if let attributes = model.label.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
item.labelText = model.label?.text
if let attributes = model.label?.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData) {
item.labelTextAttributes = attributes
}
item.childText = model.subTitle?.text

View File

@ -107,15 +107,15 @@ import UIKit
// configure attributed string for progress percentage.
let attributedString = NSMutableAttributedString(string: String(percent) + "%")
// percent value
attributedString.setAttributes([NSAttributedString.Key.font: MFStyler.fontBoldTitleLarge()], range: NSMakeRange(0, percentLen))
attributedString.setAttributes([NSAttributedString.Key.font: Styler.Font.BoldTitleXLarge], range: NSMakeRange(0, percentLen))
// % symbol
attributedString.setAttributes([NSAttributedString.Key.font: MFStyler.fontBoldBodyLarge()], range: NSMakeRange(percentLen, 1))
attributedString.setAttributes([NSAttributedString.Key.font: Styler.Font.RegularMicro], range: NSMakeRange(percentLen, 1))
// show progress percentage in a text layer
let width = viewWidth
let height = width
labelLayer.string = attributedString
labelLayer.frame = CGRectMake((width - CGFloat(percentLen * 20))/2, (height - 30)/2, 60, 30)
labelLayer.frame = CGRectMake((width - CGFloat(percentLen * 20))/2, (height - 40)/2, 80, 40)
self.layer.addSublayer(labelLayer)
}

View File

@ -14,7 +14,8 @@ public class CircularProgressBarModel: GraphSizeBase, MoleculeModelProtocol {
public static var identifier: String = "circularProgress"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var percent: Int = 0
public var diameter: CGFloat? = 64
public var lineWidth: CGFloat? = 4
@ -31,6 +32,7 @@ public class CircularProgressBarModel: GraphSizeBase, MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case percent
case size
@ -48,7 +50,8 @@ public class CircularProgressBarModel: GraphSizeBase, MoleculeModelProtocol {
super.init()
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
percent = try typeContainer.decode(Int.self, forKey: .percent)
if let size = try typeContainer.decodeIfPresent(GraphSize.self, forKey: .size) {
@ -89,6 +92,7 @@ public class CircularProgressBarModel: GraphSizeBase, MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(percent, forKey: .percent)
try container.encodeIfPresent(size, forKey: .size)
try container.encodeIfPresent(diameter, forKey: .diameter)

View File

@ -31,11 +31,15 @@ open class Icon: VDS.Icon, VDSMoleculeViewProtocol{
// MARK: - Public
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
color = viewModel.color.uiColor
size = viewModel.size
customSize = viewModel.customSize
name = viewModel.name
isAccessibilityElement = viewModel.isAccessibilityElement ?? true
}
//--------------------------------------------------

View File

@ -21,6 +21,8 @@ open class IconModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public var accessibilityIdentifier: String?
/// A representation that will be used to render the icon with corresponding name.
public var name: Icon.Name
@ -35,4 +37,6 @@ open class IconModel: MoleculeModelProtocol {
/// A custom size of the icon.
public var customSize: Int?
public var isAccessibilityElement: Bool?
}

View File

@ -18,6 +18,7 @@
public var backgroundColor: Color?
public var moleculeName: String = ImageViewModel.identifier
public var image: String
public var accessibilityIdentifier: String?
public var accessibilityText: String?
public var fallbackImage: String?
public var imageFormat: String?
@ -47,6 +48,7 @@
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case image

View File

@ -182,6 +182,9 @@ public typealias ActionBlock = () -> ()
}
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
shouldMaskWhileRecording = viewModel.shouldMaskRecordedView ?? false
text = viewModel.text
hero = viewModel.hero

View File

@ -14,7 +14,8 @@ import VDS
open class var identifier: String { "label" }
public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var text: String
public var accessibilityText: String?
@ -38,6 +39,7 @@ import VDS
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case text
case accessibilityText
@ -88,6 +90,7 @@ import VDS
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
text = try typeContainer.decode(String.self, forKey: .text)
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
textColor = try typeContainer.decodeIfPresent(Color.self, forKey: .textColor)
@ -115,6 +118,7 @@ import VDS
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(moleculeName, forKey: .moleculeName)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(text, forKey: .text)
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
try container.encodeIfPresent(textColor, forKey: .textColor)

View File

@ -16,7 +16,8 @@ import UIKit
public static var identifier: String = "leftRightLabelView"
public var moleculeName: String = LeftRightLabelModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var leftText: LabelModel
public var rightText: LabelModel?

View File

@ -93,6 +93,9 @@ import VDS
// MARK: - VDSMoleculeViewProtocol
//--------------------------------------------------
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
style = VDS.Line.Style(rawValue: viewModel.type.rawValue) ?? .primary
orientation = viewModel.orientation

View File

@ -55,6 +55,7 @@ public class LineModel: MoleculeModelProtocol, Invertable {
public static var identifier: String = "line"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var type: Style = .secondary
@ -83,6 +84,7 @@ public class LineModel: MoleculeModelProtocol, Invertable {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case type
case frequency
@ -99,7 +101,8 @@ public class LineModel: MoleculeModelProtocol, Invertable {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let type = try typeContainer.decodeIfPresent(Style.self, forKey: .type) {
self.type = type
}
@ -124,6 +127,7 @@ public class LineModel: MoleculeModelProtocol, Invertable {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(type, forKey: .type)
try container.encode(inverted, forKey: .inverted)
try container.encodeIfPresent(frequency, forKey: .frequency)

View File

@ -22,6 +22,9 @@ open class LoadingSpinner: VDS.Loader, VDSMoleculeViewProtocol {
// MARK: - Public Functions
//--------------------------------------------------
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
size = Int(viewModel.diameter)
surface = viewModel.surface
}

View File

@ -16,7 +16,8 @@ open class LoadingSpinnerModel: MoleculeModelProtocol {
//--------------------------------------------------
public static var identifier: String = "loadingSpinner"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var inverted: Bool = false
public var diameter: CGFloat = 40
@ -27,6 +28,7 @@ open class LoadingSpinnerModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case strokeColor
case diameter
@ -47,7 +49,8 @@ open class LoadingSpinnerModel: MoleculeModelProtocol {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let diameter = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .diameter) {
self.diameter = diameter
}
@ -65,6 +68,7 @@ open class LoadingSpinnerModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(diameter, forKey: .diameter)
try container.encodeIfPresent(inverted, forKey: .inverted)
}

View File

@ -22,7 +22,8 @@ import Foundation
public static var identifier: String = "multiProgressBar"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var progressList: [SingleProgressBarModel]
public var backgroundColor: Color?
public var thickness: CGFloat?
@ -30,6 +31,7 @@ import Foundation
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case progressList
case thickness
@ -44,6 +46,7 @@ import Foundation
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
progressList = try typeContainer.decode([SingleProgressBarModel].self, forKey: .progressList)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
thickness = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .thickness)
@ -54,6 +57,7 @@ import Foundation
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(progressList, forKey: .progressList)
try container.encodeIfPresent(thickness, forKey: .thickness)
try container.encodeIfPresent(roundedCorners, forKey: .roundedCorners)

View File

@ -0,0 +1,60 @@
//
// Pagination.swift
// MVMCoreUI
//
// Created by Matt Bruce on 8/27/24.
// Copyright © 2024 Verizon Wireless. All rights reserved.
//
import Foundation
import VDS
@objcMembers open class Pagination: VDS.Pagination, VDSMoleculeViewProtocol {
//------------------------------------------------------
// MARK: - Properties
//------------------------------------------------------
open var viewModel: PaginationModel!
open var delegateObject: MVMCoreUIDelegateObject?
open var additionalData: [AnyHashable : Any]?
// Form Validation
open var fieldKey: String?
open var fieldValue: JSONValue?
open var groupName: String?
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public convenience required init() {
self.init(frame:.zero)
}
open override func setup() {
super.setup()
pageChangedPublisher
.sink { [weak self] control in
guard let self else { return }
viewModel?.selectedPage = control.selectedPage
}.store(in: &subscribers)
}
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
isEnabled = viewModel.enabled
surface = viewModel.surface
total = viewModel.totalPages
selectedPage = viewModel.selectedPage
}
//--------------------------------------------------
// MARK: - Actions
//--------------------------------------------------
//--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
public func updateView(_ size: CGFloat) {}
}

View File

@ -0,0 +1,76 @@
//
// PaginationModel.swift
// MVMCoreUI
//
// Created by Matt Bruce on 8/27/24.
// Copyright © 2024 Verizon Wireless. All rights reserved.
//
import Foundation
import VDS
import MVMCore
open class PaginationModel: MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
open class var identifier: String { "pagination" }
open var moleculeName: String { Self.identifier }
open var backgroundColor: Color?
open var id: String = UUID().uuidString
open var accessibilityIdentifier: String?
open var totalPages: Int = 0
open var selectedPage: Int = 0
open var enabled: Bool = true
open var inverted: Bool = false
open var surface: Surface { inverted ? .dark : .light }
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case totalPages
case selectedPage
case enabled
case inverted
}
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decode(String.self, forKey: .id)
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
totalPages = try container.decode(Int.self, forKey: .totalPages)
selectedPage = try container.decodeIfPresent(Int.self, forKey: .selectedPage) ?? 0
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled) ?? false
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(totalPages, forKey: .totalPages)
try container.encode(selectedPage, forKey: .selectedPage)
try container.encode(enabled, forKey: .enabled)
try container.encode(inverted, forKey: .inverted)
}
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
guard let model = model as? Self else { return false }
return inverted == model.inverted
&& enabled == model.enabled
&& totalPages == model.totalPages
&& selectedPage == model.selectedPage
}
}

View File

@ -75,6 +75,9 @@ import Foundation
guard let progressBarModel = model as? ProgressBarModel else { return }
self.progressBarModel = progressBarModel
if let accessibilityIdentifier = model.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
thickness = progressBarModel.thickness ?? 8
progress = Float((progressBarModel.percent) / 100.0)
progressTintColor = progressBarModel.color.uiColor

View File

@ -11,7 +11,8 @@ import Foundation
@objcMembers open class ProgressBarModel: MoleculeModelProtocol {
open class var identifier: String { "progressBar" }
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
@Percent public var percent: CGFloat
public var color: Color = Color(uiColor: .mfCerulean())
public var backgroundColor: Color? = Color(uiColor: .mfLightSilver())
@ -20,6 +21,7 @@ import Foundation
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case roundedCorners
case thickness
@ -35,6 +37,7 @@ import Foundation
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
percent = try typeContainer.decode(CGFloat.self, forKey: .percent)
if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .color) {
self.color = color
@ -50,6 +53,7 @@ import Foundation
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(percent, forKey: .percent)
try container.encode(color, forKey: .color)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -14,7 +14,8 @@ open class StarModel: MoleculeModelProtocol {
//--------------------------------------------------
public static var identifier: String = "star"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
@Percent public var percent: CGFloat = 0
public var borderColor: Color?
@ -26,6 +27,7 @@ open class StarModel: MoleculeModelProtocol {
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case percent
@ -47,6 +49,7 @@ open class StarModel: MoleculeModelProtocol {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let percent = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .percent) {
self.percent = percent
}
@ -63,6 +66,7 @@ open class StarModel: MoleculeModelProtocol {
try container.encode(id, forKey: .id)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(percent, forKey: .percent)
try container.encodeIfPresent(borderColor, forKey: .borderColor)
try container.encodeIfPresent(fillColor, forKey: .fillColor)

View File

@ -14,7 +14,8 @@ import MVMCore
//--------------------------------------------------
public static var identifier: String = "stars"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var starBackgroundColor: Color?
public var stars: [StarModel]
@ -28,6 +29,7 @@ import MVMCore
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case starBackgroundColor
@ -53,6 +55,7 @@ import MVMCore
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
stars = try typeContainer.decode([StarModel].self, forKey: .stars)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
starBackgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .starBackgroundColor)
@ -70,6 +73,7 @@ import MVMCore
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(stars, forKey: .stars)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(starBackgroundColor, forKey: .starBackgroundColor)

View File

@ -40,7 +40,9 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{
// MARK: - Public
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
if let moleculeModel = viewModel.molecule {
if let molecule,
moleculeModel.moleculeName == molecule.model?.moleculeName {
@ -99,7 +101,9 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{
//--------------------------------------------------
// MARK: - MVMCoreViewProtocol
//--------------------------------------------------
open func updateView(_ size: CGFloat) {}
open func updateView(_ size: CGFloat) {
(molecule as? MVMCoreViewProtocol)?.updateView(size)
}
//--------------------------------------------------
// MARK: - MoleculeViewProtocol

View File

@ -70,8 +70,10 @@ open class TileContainerBaseModel<PaddingType: DefaultValuing & Codable, TileCon
public var aspectRatio: TileContainerType.AspectRatio = .none
public var backgroundEffect: TileContainerType.BackgroundEffect = .none
public var surface: Surface { inverted ? .dark : .light }
public var accessibilityIdentifier: String?
private enum CodingKeys: String, CodingKey {
case accessibilityIdentifier
case inverted
case backgroundImage
case action
@ -88,6 +90,7 @@ open class TileContainerBaseModel<PaddingType: DefaultValuing & Codable, TileCon
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
backgroundImage = try container.decodeIfPresent(String.self, forKey: .backgroundImage)
action = try container.decodeModelIfPresent(codingKey: .action)
@ -104,6 +107,7 @@ open class TileContainerBaseModel<PaddingType: DefaultValuing & Codable, TileCon
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundImage, forKey: .backgroundImage)
try container.encodeModelIfPresent(action, forKey: .action)
try container.encodeIfPresent(imageFallbackColor, forKey: .imageFallbackColor)

View File

@ -39,6 +39,9 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol{
// MARK: - Public
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
//tilelet specific properties
if let value = viewModel.textWidth {
textWidth = .value(value)
@ -48,7 +51,7 @@ open class Tilelet: VDS.Tilelet, VDSMoleculeViewProtocol{
eyebrowModel = viewModel.eyebrowModel(delegateObject: delegateObject, additionalData: additionalData)
titleModel = viewModel.titleModel(delegateObject: delegateObject, additionalData: additionalData)
subTitleModel = viewModel.subTitleModel(delegateObject: delegateObject, additionalData: additionalData)
badgeModel = viewModel.badge
badgeModel = viewModel.badgeModel()
descriptiveIconModel = viewModel.descriptiveIcon
directionalIconModel = viewModel.directionalIcon
//setup action

View File

@ -18,7 +18,7 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
public var id: String = UUID().uuidString
public var backgroundColor: Color?
public var badge: Tilelet.BadgeModel?
public var badge: BadgeModel?
public var eyebrow: LabelModel?
public var eyebrowColor: TitleLockup.TextColor = .primary
public var title: LabelModel?
@ -49,7 +49,7 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
badge = try container.decodeIfPresent(Tilelet.BadgeModel.self, forKey: .badge)
badge = try container.decodeIfPresent(BadgeModel.self, forKey: .badge)
eyebrow = try container.decodeIfPresent(LabelModel.self, forKey: .eyebrow)
title = try container.decodeIfPresent(LabelModel.self, forKey: .title)
subTitle = try container.decodeIfPresent(LabelModel.self, forKey: .subTitle)
@ -91,32 +91,48 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
try super.init(from: decoder)
}
public func badgeModel() -> Tilelet.BadgeModel? {
guard let badge else { return nil }
return .init(text: badge.text,
textColor: badge.textColorStyle,
fillColor: badge.fillColorStyle,
surface: badge.surface,
numberOfLines: badge.numberOfLines,
maxWidth: badge.maxWidth
)
}
public func eyebrowModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.EyebrowModel? {
guard let eyebrow else { return nil }
let attrs = eyebrow.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
var isBold: Bool = true
do {
if let style = eyebrow.fontStyle {
isBold = style.isBold()
return .init(text: eyebrow.text,
textColor: eyebrowColor,
textAttributes: attrs, isBold: style.isBold(),
textAttributes: attrs,
isBold: isBold,
standardStyle: try style.vdsSubsetStyle())
}
} catch MVMCoreError.errorObject(let object) {
MVMCoreLoggingHandler.shared()?.addError(toLog: object)
} catch { }
return .init(text: eyebrow.text, textColor: eyebrowColor, textAttributes: attrs)
return .init(text: eyebrow.text, textColor: eyebrowColor, textAttributes: attrs, isBold: isBold)
}
public func titleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.TitleModel? {
guard let title else { return nil }
let attrs = title.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
var isBold: Bool = true
do {
if let style = title.fontStyle {
isBold = style.isBold()
return .init(text: title.text,
textColor: titleColor,
textAttributes: attrs,
isBold: isBold,
standardStyle: try style.vdsSubsetStyle())
}
@ -124,7 +140,7 @@ open class TileletModel: TileContainerBaseModel<Tilelet.Padding, Tilelet>, Molec
MVMCoreLoggingHandler.shared()?.addError(toLog: object)
} catch { }
return .init(text: title.text, textColor: titleColor, textAttributes: attrs)
return .init(text: title.text, textColor: titleColor, textAttributes: attrs, isBold: isBold)
}
public func subTitleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.SubTitleModel? {

View File

@ -28,6 +28,9 @@ open class Tooltip: VDS.Tooltip, VDSMoleculeViewProtocol{
// MARK: - Public
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
fillColor = viewModel.fillColor
size = viewModel.size

View File

@ -22,6 +22,8 @@ open class TooltipModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public var accessibilityIdentifier: String?
public var size: VDS.Tooltip.Size = .medium
public var fillColor: VDS.Tooltip.FillColor = .primary
@ -39,6 +41,7 @@ open class TooltipModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case closeButtonText
@ -52,13 +55,14 @@ open class TooltipModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
self.backgroundColor = try container.decodeIfPresent(Color.self, forKey: .backgroundColor)
id = try container.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
backgroundColor = try container.decodeIfPresent(Color.self, forKey: .backgroundColor)
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
self.title = try container.decodeIfPresent(String.self, forKey: .title)
self.content = try container.decodeIfPresent(String.self, forKey: .content)
title = try container.decodeIfPresent(String.self, forKey: .title)
content = try container.decodeIfPresent(String.self, forKey: .content)
self.molecule = try container.decodeModelIfPresent(codingKey: .contentView)
molecule = try container.decodeModelIfPresent(codingKey: .contentView)
if let closeButtonText = try container.decodeIfPresent(String.self, forKey: .closeButtonText) {
self.closeButtonText = closeButtonText
@ -81,6 +85,7 @@ open class TooltipModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(surface, forKey: .surface)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -11,6 +11,7 @@ import Foundation
open class VideoModel: MoleculeModelProtocol, PageBehaviorProtocolRequirer {
public static var identifier = "video"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var video: String
public var showControls = false
@ -45,6 +46,7 @@ open class VideoModel: MoleculeModelProtocol, PageBehaviorProtocolRequirer {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case moleculeName
case video
case showControls
@ -60,6 +62,7 @@ open class VideoModel: MoleculeModelProtocol, PageBehaviorProtocolRequirer {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
video = try typeContainer.decode(String.self, forKey:.video)
if let showControls = try typeContainer.decodeIfPresent(Bool.self, forKey: .showControls) {
self.showControls = showControls
@ -76,6 +79,7 @@ open class VideoModel: MoleculeModelProtocol, PageBehaviorProtocolRequirer {
open func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(video, forKey: .video)
try container.encode(showControls, forKey: .showControls)

View File

@ -13,7 +13,8 @@ import MVMCore
public static var identifier: String = "webview"
public var moleculeName: String = WebViewModel.identifier
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var url: URL?
public var htmlString: String?
@ -26,6 +27,7 @@ import MVMCore
private enum CodingKeys: String, CodingKey{
case id
case accessibilityIdentifier
case moleculeName
case backgroundColor
case url
@ -43,6 +45,7 @@ import MVMCore
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
url = try typeContainer.decodeIfPresent(URL.self, forKey: .url)
htmlString = try typeContainer.decodeIfPresent(String.self, forKey: .htmlString)
@ -57,6 +60,7 @@ import MVMCore
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(url, forKey: .url)
try container.encodeIfPresent(htmlString, forKey: .htmlString)

View File

@ -16,7 +16,8 @@ public class WheelModel: GraphSizeBase, MoleculeModelProtocol {
public static var identifier: String = "wheel"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var style: GraphStyle = .unlimited {
didSet {
updateStyle()
@ -38,6 +39,7 @@ public class WheelModel: GraphSizeBase, MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case style
case size
case diameter
@ -53,7 +55,8 @@ public class WheelModel: GraphSizeBase, MoleculeModelProtocol {
super.init()
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let style = try typeContainer.decodeIfPresent(GraphStyle.self, forKey: .style) {
self.style = style
}
@ -84,6 +87,7 @@ public class WheelModel: GraphSizeBase, MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(style, forKey: .style)
try container.encode(size, forKey: .size)
try container.encode(diameter, forKey: .diameter)

View File

@ -16,7 +16,6 @@ import MVMCore
//--------------------------------------------------
extension VDS.Surface: Codable {}
extension VDS.Badge.FillColor: Codable {}
extension VDS.BadgeIndicator.FillColor: Codable {}
extension VDS.BadgeIndicator.Kind: Codable {}
extension VDS.BadgeIndicator.MaximumDigits: Codable {}
@ -294,6 +293,45 @@ extension VDS.TitleLockup.TextColor: Codable {
}
}
extension VDS.Badge.FillColor: Codable {
public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
let type = try container.decode(String.self)
switch type {
case "red":
self = .red
case "yellow":
self = .yellow
case "green":
self = .green
case "orange":
self = .orange
case "blue":
self = .blue
case "black":
self = .black
case "white":
self = .white
default:
if let color = try? Color(from: decoder) {
self = .custom(color.uiColor)
} else {
self = .custom(UIColor(hexString: type))
}
}
}
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
switch self {
case .custom(let value):
try container.encode(Color(uiColor: value))
default:
try container.encode(String(reflecting: self))
}
}
}
extension VDS.TitleLockup.TitleTextColor: Codable {
enum CodingKeys: String, CodingKey {

View File

@ -69,6 +69,8 @@ extension LabelAttributeFontModel: VDSLabelAttributeConvertable {
var textStyle: TextStyle?
if let found = style?.vdsTextStyle() {
textStyle = found
} else if let name, let size, let font = UIFont(name: name, size: size) {
textStyle = TextStyle.convert(font: font)
} else if let name, let found = TextStyle(rawValue: name) {
textStyle = found
}

View File

@ -0,0 +1,59 @@
//
// Breadcrumbs.swift
// MVMCoreUI
//
// Created by Matt Bruce on 8/26/24.
// Copyright © 2024 Verizon Wireless. All rights reserved.
//
import Foundation
import VDS
@objcMembers open class Breadcrumbs: VDS.Breadcrumbs, VDSMoleculeViewProtocol {
//------------------------------------------------------
// MARK: - Properties
//------------------------------------------------------
open var viewModel: BreadcrumbsModel!
open var delegateObject: MVMCoreUIDelegateObject?
open var additionalData: [AnyHashable : Any]?
// Form Validation
open var fieldKey: String?
open var fieldValue: JSONValue?
open var groupName: String?
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public convenience required init() {
self.init(frame:.zero)
}
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
isEnabled = viewModel.enabled
surface = viewModel.surface
breadcrumbModels = viewModel.breadcrumbs.compactMap { [unowned self] breadcrumb in
return .init(text: breadcrumb.text,
selected: breadcrumb.selected,
onClick: { _ in
MVMCoreUIActionHandler.performActionUnstructured(with: breadcrumb.action,
sourceModel: breadcrumb,
additionalData: self.additionalData,
delegateObject: self.delegateObject)
})
}
}
//--------------------------------------------------
// MARK: - Actions
//--------------------------------------------------
//--------------------------------------------------
// MARK: - MoleculeViewProtocol
//--------------------------------------------------
public func updateView(_ size: CGFloat) {}
}

View File

@ -0,0 +1,124 @@
//
// BreadCrumbs.swift
// MVMCoreUI
//
// Created by Matt Bruce on 8/26/24.
// Copyright © 2024 Verizon Wireless. All rights reserved.
//
import Foundation
import VDS
import MVMCore
open class BreadcrumbsModel: MoleculeModelProtocol, ParentMoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
open class var identifier: String { "breadcrumbs" }
open var moleculeName: String { Self.identifier }
open var backgroundColor: Color?
open var id: String = UUID().uuidString
open var accessibilityIdentifier: String?
open var children: [any MoleculeModelProtocol] { breadcrumbs }
open var breadcrumbs: [BreadcrumbModel] = []
open var enabled: Bool = true
open var inverted: Bool = false
open var surface: Surface { inverted ? .dark : .light }
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case accessibilityIdentifier
case moleculeName
case breadcrumbs
case enabled
case inverted
}
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
breadcrumbs = try container.decode([BreadcrumbModel].self, forKey: .breadcrumbs)
enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled) ?? false
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(breadcrumbs, forKey: .breadcrumbs)
try container.encode(enabled, forKey: .enabled)
try container.encode(inverted, forKey: .inverted)
}
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
guard let model = model as? Self else { return false }
return inverted == model.inverted
&& enabled == model.enabled
}
}
open class BreadcrumbModel: MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
open class var identifier: String { "breadcrumb" }
open var moleculeName: String { Self.identifier }
open var backgroundColor: Color?
open var id: String = UUID().uuidString
open var accessibilityIdentifier: String?
open var text: String = ""
open var selected: Bool = false
open var action: ActionModelProtocol
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case accessibilityIdentifier
case text
case selected
case action
}
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
accessibilityIdentifier = try container.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
text = try container.decode(String.self, forKey: .text)
selected = try container.decodeIfPresent(Bool.self, forKey: .selected) ?? false
action = try container.decodeModel(codingKey: .action)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(text, forKey: .text)
try container.encode(selected, forKey: .selected)
try container.encodeModelIfPresent(action, forKey: .action)
}
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
guard let model = model as? Self else { return false }
return text == model.text
&& selected == model.selected
&& action.isEqual(to: model.action)
}
}

View File

@ -52,6 +52,9 @@ public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol, ParentMol
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
}
//--------------------------------------------------

View File

@ -31,6 +31,9 @@ public class HeadersH1NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
}
//--------------------------------------------------

View File

@ -47,18 +47,15 @@ public class HeadersH2ButtonsModel: HeaderModel, MoleculeModelProtocol, ParentMo
//--------------------------------------------------
public override func setDefaults() {
if topPadding == nil {
topPadding = Padding.Component.VerticalMarginSpacing
}
if bottomPadding == nil {
bottomPadding = Padding.Component.VerticalMarginSpacing
}
if titleLockup.title.fontStyle == nil {
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
}
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
super.setDefaults()
}

View File

@ -42,18 +42,15 @@ public class HeadersH2CaretLinkModel: HeaderModel, MoleculeModelProtocol, Parent
// MARK: - Methods
//--------------------------------------------------
public override func setDefaults() {
if topPadding == nil {
topPadding = Padding.Component.VerticalMarginSpacing
}
if bottomPadding == nil {
bottomPadding = Padding.Component.VerticalMarginSpacing
}
if titleLockup.title.fontStyle == nil {
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
}
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
super.setDefaults()
}

View File

@ -46,18 +46,15 @@ public class HeadersH2LinkModel: HeaderModel, ParentMoleculeModelProtocol {
//--------------------------------------------------
public override func setDefaults() {
if topPadding == nil {
topPadding = Padding.Component.VerticalMarginSpacing
}
if bottomPadding == nil {
bottomPadding = Padding.Component.VerticalMarginSpacing
}
if titleLockup.title.fontStyle == nil {
if titleLockup.title.fontStyle == nil {
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
}
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
super.setDefaults()
}

View File

@ -36,18 +36,15 @@ public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol
}
public override func setDefaults() {
if topPadding == nil {
topPadding = Padding.Component.VerticalMarginSpacing
}
if bottomPadding == nil {
bottomPadding = Padding.Component.VerticalMarginSpacing
}
if titleLockup.title.fontStyle == nil {
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
}
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
super.setDefaults()
}

View File

@ -57,12 +57,6 @@ public class HeadersH2PricingTwoRowsModel: HeaderModel, MoleculeModelProtocol, P
// MARK: - Methods
//--------------------------------------------------
public override func setDefaults() {
if topPadding == nil {
topPadding = Padding.Component.VerticalMarginSpacing
}
if bottomPadding == nil {
bottomPadding = Padding.Component.VerticalMarginSpacing
}
if headline.accessibilityTraits == nil {
headline.accessibilityTraits = .header
}

View File

@ -47,18 +47,15 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol, Paren
//--------------------------------------------------
public override func setDefaults() {
if topPadding == nil {
topPadding = Padding.Component.VerticalMarginSpacing
}
if bottomPadding == nil {
bottomPadding = Padding.Component.VerticalMarginSpacing
}
if titleLockup.title.fontStyle == nil {
titleLockup.title.fontStyle = Styler.Font.RegularTitleXLarge
}
if titleLockup.subTitle?.fontStyle == nil {
titleLockup.subTitle?.fontStyle = Styler.Font.RegularTitleMedium
}
if titleLockup.title.accessibilityTraits == nil {
titleLockup.title.accessibilityTraits = [.header]
}
super.setDefaults()
button.style = .secondary
button.size = .small

View File

@ -14,7 +14,8 @@ public class LockUpsPlanNamesModel: MoleculeModelProtocol {
//--------------------------------------------------
public static var identifier: String = "planNamesLockup"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var headline: LabelModel
public var subHeadline: LabelModel
@ -35,6 +36,7 @@ public class LockUpsPlanNamesModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case headline
case subHeadline
@ -47,6 +49,7 @@ public class LockUpsPlanNamesModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
headline = try typeContainer.decode(LabelModel.self, forKey: .headline)
subHeadline = try typeContainer.decode(LabelModel.self, forKey: .subHeadline)
@ -57,6 +60,7 @@ public class LockUpsPlanNamesModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(headline, forKey: .headline)
try container.encode(subHeadline, forKey: .subHeadline)

View File

@ -15,7 +15,8 @@ public class LockupsPlanSMLXLModel: MoleculeModelProtocol {
public static var identifier: String = "planLockup"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var planLabel : LabelModel
public var headline : LabelModel
@ -47,6 +48,7 @@ public class LockupsPlanSMLXLModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case planLabel
case headline
@ -61,6 +63,7 @@ public class LockupsPlanSMLXLModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
planLabel = try typeContainer.decode(LabelModel.self, forKey: .planLabel)
headline = try typeContainer.decode(LabelModel.self, forKey: .headline)
@ -73,6 +76,7 @@ public class LockupsPlanSMLXLModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(planLabel, forKey: .planLabel)
try container.encode(headline, forKey: .headline)

View File

@ -20,6 +20,9 @@ import VDS
// MARK: - Public Functions
//--------------------------------------------------
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
textAlignment = viewModel.textAlignment
eyebrowModel = viewModel.eyebrowModel(delegateObject: delegateObject, additionalData: additionalData)

View File

@ -18,7 +18,8 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
public static var identifier: String = "titleLockup"
public var moleculeName: String = TitleLockupModel.identifier
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var textAlignment: TitleLockup.TextAlignment = .left
public var eyebrow: LabelModel?
public var eyebrowColor: TitleLockup.TextColor = .primary
@ -26,8 +27,6 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
public var titleColor: TitleLockup.TitleTextColor = .primary
public var subTitle: LabelModel?
public var subTitleColor: TitleLockup.TextColor = .primary
public var alignment: VDS.TitleLockup.TextAlignment = .left
public var inverted: Bool = false
public var backgroundColor: Color?
@ -49,7 +48,6 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
public func isEqual(to model: any ModelComparisonProtocol) -> Bool {
guard let model = model as? Self else { return false }
return textAlignment == model.textAlignment
&& alignment == model.alignment
&& titleColor == model.titleColor
&& subTitleColor == model.subTitleColor
&& inverted == model.inverted
@ -75,6 +73,7 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case textAlignment
case eyebrow
case eyebrowColor
@ -83,7 +82,6 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
case subTitle
case subTitleColor
case inverted
case alignment
}
//--------------------------------------------------
@ -93,6 +91,7 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
textAlignment = try typeContainer.decodeIfPresent(TitleLockup.TextAlignment.self, forKey: .textAlignment) ?? .left
title = try typeContainer.decodeMolecule(codingKey: .title)
eyebrow = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .eyebrow)
@ -128,10 +127,6 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
subTitleColor = .primary
}
if let newAlignment = try typeContainer.decodeIfPresent(VDS.TitleLockup.TextAlignment.self, forKey: .alignment) {
alignment = newAlignment
}
if let inverted = try typeContainer.decodeIfPresent(Bool.self, forKey: .inverted) {
self.inverted = inverted
} else {
@ -144,6 +139,7 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(textAlignment, forKey: .textAlignment)
try container.encodeIfPresent(eyebrow, forKey: .eyebrow)
try container.encode(eyebrowColor, forKey: .eyebrowColor)
@ -151,7 +147,6 @@ public class TitleLockupModel: ParentMoleculeModelProtocol {
try container.encode(titleColor, forKey: .titleColor)
try container.encodeIfPresent(subTitle, forKey: .subTitle)
try container.encode(subTitleColor, forKey: .subTitleColor)
try container.encode(alignment, forKey: .alignment)
try container.encode(inverted, forKey: .inverted)
}

View File

@ -15,7 +15,7 @@ import Foundation
//-----------------------------------------------------
public var stack: Stack<StackModel>
public let headline = Label(fontStyle: .BoldTitleMedium)
public let headline = Label(fontStyle: .BoldTitleLarge)
public let body = Label(fontStyle: .RegularBodySmall)
//--------------------------------------------------
@ -24,7 +24,7 @@ import Foundation
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
(view: body, model: StackItemModel(spacing: 8, horizontalAlignment: .leading))],
axis: .vertical)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
@ -63,7 +63,7 @@ import Foundation
open override func reset() {
super.reset()
headline.setFontStyle(.BoldTitleMedium)
headline.setFontStyle(.BoldTitleLarge)
body.setFontStyle(.RegularBodySmall)
}

View File

@ -47,6 +47,9 @@ public class ListOneColumnTextWithWhitespaceDividerShortModel: ListItemModel, Mo
override public func setDefaults() {
style = .shortDivider
if headline.accessibilityTraits == nil {
headline.accessibilityTraits = [.header]
}
super.setDefaults()
}

View File

@ -15,7 +15,7 @@ import Foundation
//-----------------------------------------------------
public var stack: Stack<StackModel>
public let headline = Label(fontStyle: .BoldTitleMedium)
public let headline = Label(fontStyle: .BoldTitleLarge)
public let body = Label(fontStyle: .RegularBodySmall)
//--------------------------------------------------
@ -24,7 +24,7 @@ import Foundation
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
stack = Stack<StackModel>.createStack(with: [(view: headline, model: StackItemModel(horizontalAlignment: .leading)),
(view: body, model: StackItemModel(spacing: 0, horizontalAlignment: .leading))],
(view: body, model: StackItemModel(spacing: 8, horizontalAlignment: .leading))],
axis: .vertical)
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
@ -62,7 +62,7 @@ import Foundation
open override func reset() {
super.reset()
headline.setFontStyle(.BoldTitleMedium)
headline.setFontStyle(.BoldTitleLarge)
body.setFontStyle(.RegularBodySmall)
accessibilityLabel = nil
}

View File

@ -47,6 +47,9 @@ public class ListOneColumnTextWithWhitespaceDividerTallModel: ListItemModel, Mol
override public func setDefaults() {
style = .tallDivider
if headline.accessibilityTraits == nil {
headline.accessibilityTraits = [.header]
}
super.setDefaults()
}

View File

@ -17,7 +17,8 @@ import Foundation
public static var identifier: String = "doughnutChartItem"
public var moleculeName: String = DoughnutChartItemModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var label: LabelModel
@Percent public var percent: CGFloat
@ -28,6 +29,8 @@ import Foundation
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case backgroundColor
case label
case percent

View File

@ -17,7 +17,8 @@ import Foundation
public static var identifier: String = "doughnutChart"
public var moleculeName: String = DoughnutChartModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var title: LabelModel?
public var subtitle: LabelModel?

View File

@ -16,7 +16,8 @@ public class ImageHeadlineBodyModel: MoleculeModelProtocol {
public static var identifier: String = "imageHeadlineBody"
public var moleculeName: String = ImageHeadlineBodyModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var image: ImageViewModel
public var headlineBody: HeadlineBodyModel

View File

@ -80,6 +80,10 @@ import VDS
// MARK: - Atomic
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
surface = viewModel.surface
updateRadioButton()

View File

@ -10,14 +10,15 @@ import Foundation
import MVMCore
import VDS
@objcMembers public class RadioButtonLabelModel: MoleculeModelProtocol, ParentMoleculeModelProtocol {
public class RadioButtonLabelModel: MoleculeModelProtocol, ParentMoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "radioButtonLabel"
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var moleculeName: String = RadioButtonLabelModel.identifier
public var radioButton: RadioButtonModel

View File

@ -38,6 +38,10 @@ import VDSCoreTokens
guard let model = model as? TabBarModel else { return }
self.model = model
if let accessibilityIdentifier = model.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
// Set appearance
let appearance = UITabBarAppearance()
appearance.backgroundColor = model.backgroundColor?.uiColor
@ -51,6 +55,9 @@ import VDSCoreTokens
for (index, tab) in model.tabs.enumerated() {
let tabBarItem = UITabBarItem(title: tab.title, image: MVMCoreCache.shared()?.getImageFromRegisteredBundles(tab.image), tag: index)
tabBarItem.accessibilityLabel = tab.accessibilityText
if let accessibilityIdentifier = tab.accessibilityIdentifier {
tabBarItem.accessibilityIdentifier = accessibilityIdentifier
}
tabs.append(tabBarItem)
}
setItems(tabs, animated: false)

View File

@ -12,7 +12,8 @@ import VDSCoreTokens
open class TabBarModel: MoleculeModelProtocol {
public static var identifier: String = "tabBar"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
open var tabs: [TabBarItemModel]
private var _backgroundColor: Color?
@ -62,6 +63,7 @@ open class TabBarModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case tabs
case selectedColor
@ -77,6 +79,7 @@ open class TabBarModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
tabs = try typeContainer.decode([TabBarItemModel].self, forKey: .tabs)
if let color = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) {
backgroundColor = color
@ -99,6 +102,7 @@ open class TabBarModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(tabs, forKey: .tabs)
try container.encodeIfPresent(_backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(_selectedColor, forKey: .selectedColor)
@ -134,12 +138,14 @@ open class TabBarItemModel: Codable, Equatable, MoleculeModelComparisonProtocol
open var image: String
open var action: ActionModelProtocol
open var accessibilityText: String?
open var accessibilityIdentifier: String?
private enum CodingKeys: String, CodingKey {
case title
case image
case action
case accessibilityText
case accessibilityIdentifier
}
public init(with title: String?, image: String, action: ActionModelProtocol) {
@ -154,6 +160,7 @@ open class TabBarItemModel: Codable, Equatable, MoleculeModelComparisonProtocol
image = try typeContainer.decode(String.self, forKey: .image)
action = try typeContainer.decodeModel(codingKey: .action)
accessibilityText = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityText)
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
}
open func encode(to encoder: Encoder) throws {
@ -162,6 +169,7 @@ open class TabBarItemModel: Codable, Equatable, MoleculeModelComparisonProtocol
try container.encode(image, forKey: .image)
try container.encodeModel(action, forKey: .action)
try container.encodeIfPresent(accessibilityText, forKey: .accessibilityText)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
}
public static func == (lhs: TabBarItemModel, rhs: TabBarItemModel) -> Bool {

View File

@ -63,6 +63,9 @@ import VDS
//-------------------------------------------------
open func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
borderLine = viewModel.borderLine
if let minWidth = viewModel.minWidth {
self.minWidth = minWidth

View File

@ -13,7 +13,8 @@ open class TabsModel: MoleculeModelProtocol {
public static var identifier: String = "tabs"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
open var tabs: [TabItemModel]
open var style: Surface?
@ -33,6 +34,7 @@ open class TabsModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case tabs
case backgroundColor
case selectedIndex
@ -53,6 +55,7 @@ open class TabsModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
tabs = try typeContainer.decode([TabItemModel].self, forKey: .tabs)
style = try typeContainer.decodeIfPresent(Surface.self, forKey: .style)
@ -94,6 +97,7 @@ open class TabsModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encode(tabs, forKey: .tabs)
try container.encode(selectedIndex, forKey: .selectedIndex)
try container.encode(fillContainer, forKey: .fillContainer)

View File

@ -64,6 +64,10 @@ import VDS
// MARK: - VDSMoleculeViewProtocol
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
var buttons = [PillButton]()
if let secondaryModel = viewModel.secondaryButton {
secondaryButton.set(with: secondaryModel, delegateObject, additionalData)

View File

@ -16,6 +16,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
public static var identifier: String = "twoButtonView"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var primaryButton: ButtonModel?
public var secondaryButton: ButtonModel?
@ -39,6 +40,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case primaryButton
case secondaryButton
@ -62,7 +64,8 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
//set context value for 'primary' style to be set for the primaryButton in case the
//property is not returned in the JSON and once decoded, this value is removed from the context
try decoder.setContext(value: Use.primary, for: "style") {
@ -81,6 +84,7 @@ public class TwoButtonViewModel: ParentMoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(primaryButton, forKey: .primaryButton)
try container.encodeIfPresent(secondaryButton, forKey: .secondaryButton)

View File

@ -105,6 +105,10 @@ import VDS
// MARK: - VDSMoleculeViewProtocol
//--------------------------------------------------
public func viewModelDidUpdate() {
if let accessibilityIdentifier = viewModel.accessibilityIdentifier {
self.accessibilityIdentifier = accessibilityIdentifier
}
buttons.removeAll()
if let model = viewModel.leftLink {

View File

@ -11,7 +11,8 @@ import Foundation
public class TwoLinkViewModel: ParentMoleculeModelProtocol {
public static var identifier: String = "twoLinkView"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var rightLink: LinkModel?
public var leftLink: LinkModel?
@ -21,6 +22,7 @@ public class TwoLinkViewModel: ParentMoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case rightLink
case leftLink
@ -34,6 +36,7 @@ public class TwoLinkViewModel: ParentMoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
rightLink = try typeContainer.decodeIfPresent(LinkModel.self, forKey: .rightLink)
leftLink = try typeContainer.decodeIfPresent(LinkModel.self, forKey: .leftLink)
@ -43,6 +46,7 @@ public class TwoLinkViewModel: ParentMoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(rightLink, forKey: .rightLink)
try container.encodeIfPresent(leftLink, forKey: .leftLink)

View File

@ -72,9 +72,9 @@ import MVMCore
case .standard:
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: Padding.Component.VerticalMarginSpacing)
case .shortDivider:
set(topPadding: Padding.Component.LargeVerticalMarginSpacing, bottomPadding: Padding.Four)
set(topPadding: Padding.Component.LargeVerticalMarginSpacing, bottomPadding: Padding.Five)
case .tallDivider:
set(topPadding: Padding.Twelve, bottomPadding: Padding.Four)
set(topPadding: Padding.Twelve, bottomPadding: Padding.Five)
case .sectionFooter:
set(topPadding: Padding.Component.VerticalMarginSpacing, bottomPadding: 0)
case ListItemStyle.none:

View File

@ -40,6 +40,7 @@ import UIKit
if let tabsModel = tabsListItemModel?.tabs {
tabs.set(with: tabsModel, delegateObject, additionalData)
}
tabs.delegate = self
}
public override func reset() {

View File

@ -12,7 +12,8 @@ public class ActionDetailWithImageModel: MoleculeModelProtocol {
public static var identifier: String = "actionDetailWithImage"
public var moleculeName: String = ActionDetailWithImageModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var headlineBodyButton: HeadlineBodyButtonModel
public var image: ImageViewModel

View File

@ -12,6 +12,7 @@ import MVMCore
public class CornerLabelsModel: ParentMoleculeModelProtocol {
public static var identifier: String = "cornerLabels"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var topLeftLabel: LabelModel?
public var topRightLabel: LabelModel?
@ -41,6 +42,7 @@ public class CornerLabelsModel: ParentMoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case accessibilityIdentifier
case backgroundColor
case topLeftLabel
case topRightLabel
@ -53,6 +55,7 @@ public class CornerLabelsModel: ParentMoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
molecule = try typeContainer.decodeModelIfPresent(codingKey: .molecule)
topLeftLabel = try typeContainer.decodeMoleculeIfPresent(codingKey: .topLeftLabel)
@ -64,6 +67,7 @@ public class CornerLabelsModel: ParentMoleculeModelProtocol {
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeModelIfPresent(molecule, forKey: .molecule)
try container.encodeModelIfPresent(topLeftLabel, forKey: .topLeftLabel)

View File

@ -11,6 +11,7 @@ public class HeadlineBodyLinkToggleModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyLinkToggle"
public var moleculeName: String = HeadlineBodyLinkToggleModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var headlineBodyLink: HeadlineBodyLinkModel
public var toggle: ToggleModel

View File

@ -13,6 +13,7 @@ open class HeadlineBodyToggleModel: MoleculeModelProtocol, ParentMoleculeModelPr
public static var identifier: String = "headlineBodyToggle"
public var moleculeName: String = HeadlineBodyToggleModel.identifier
@DecodableDefault.UUIDString public var id: String
public var accessibilityIdentifier: String?
open var backgroundColor: Color?
open var headlineBody: HeadlineBodyModel
open var toggle: ToggleModel

View File

@ -13,7 +13,8 @@ public class LabelToggleModel: MoleculeModelProtocol {
public static var identifier: String = "labelToggle"
public var moleculeName: String = LabelToggleModel.identifier
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var label: LabelModel
public var toggle: ToggleModel
@ -26,6 +27,7 @@ public class LabelToggleModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case label
case toggle
@ -34,6 +36,7 @@ public class LabelToggleModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey:.backgroundColor)
label = try typeContainer.decode(LabelModel.self, forKey:.label)
toggle = try typeContainer.decode(ToggleModel.self, forKey:.toggle)
@ -43,6 +46,7 @@ public class LabelToggleModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(id, forKey: .id)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(label, forKey: .label)
try container.encode(toggle, forKey: .toggle)

View File

@ -20,7 +20,8 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
open class var identifier: String { "navigationBar" }
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
open var title: String?
open var hidden: Bool?
open var hidesSystemBackButton: Bool?
@ -85,6 +86,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case title
case hidden
case backgroundColor
@ -107,6 +109,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
title = try typeContainer.decodeIfPresent(String.self, forKey: .title)
hidden = try typeContainer.decodeIfPresent(Bool.self, forKey: .hidden)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
@ -126,6 +129,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(title, forKey: .title)
try container.encodeIfPresent(hidden, forKey: .hidden)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -16,6 +16,8 @@ open class BGImageMolecule: MoleculeContainer {
super.setupView()
insertSubview(image, at: 0)
NSLayoutConstraint.constraintPinSubview(toSuperview: image)
image.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
image.imageView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
}
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {

View File

@ -37,7 +37,8 @@ import VDSCoreTokens
verticalStack.alignment = .fill
verticalStack.distribution = .fill
addSubview(verticalStack)
NSLayoutConstraint.constraintPinSubview(verticalStack, pinTop: true, topConstant: 0, pinBottom: true, bottomConstant: 0, pinLeft: true, leftConstant: 0, pinRight: true, rightConstant: 0)
verticalStack.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor).isActive = true
NSLayoutConstraint.constraintPinSubview(verticalStack, pinTop: false, topConstant: 0, pinBottom: true, bottomConstant: 0, pinLeft: true, leftConstant: 0, pinRight: true, rightConstant: 0)
reset()
subscribeForNotifications()
@ -223,6 +224,10 @@ extension CollapsableNotification: StatusBarUI {
topView.label.textColor.getWhite(&greyScale, alpha: nil)
return (color, greyScale > 0.5 ? .lightContent : .default)
}
public func shouldUseSafeAreaLayoutGuide() -> Bool {
return false
}
}
extension CollapsableNotification: AccessibilityProtocol {

View File

@ -13,13 +13,15 @@ public class NotificationXButtonModel: ButtonModelProtocol, MoleculeModelProtoco
public static var identifier: String = "notificationXButton"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var action: ActionModelProtocol = ActionNoopModel()
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case action
}
@ -30,6 +32,7 @@ public class NotificationXButtonModel: ButtonModelProtocol, MoleculeModelProtoco
public required init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
if let action: ActionModelProtocol = try typeContainer.decodeModelIfPresent(codingKey: .action) {
self.action = action
}
@ -39,6 +42,7 @@ public class NotificationXButtonModel: ButtonModelProtocol, MoleculeModelProtoco
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encode(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeModel(action, forKey: .action)
}
}

View File

@ -14,6 +14,7 @@ public class EyebrowHeadlineBodyLinkModel: ParentMoleculeModelProtocol {
public static var identifier: String = "eyebrowHeadlineBodyLink"
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var moleculeName: String = EyebrowHeadlineBodyLinkModel.identifier
public var backgroundColor: Color?
public var eyebrow: LabelModel?
@ -70,6 +71,7 @@ public class EyebrowHeadlineBodyLinkModel: ParentMoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case eyebrow
case headline
@ -84,6 +86,7 @@ public class EyebrowHeadlineBodyLinkModel: ParentMoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
eyebrow = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .eyebrow)
headline = try typeContainer.decodeMoleculeIfPresent(codingKey: .headline)
@ -100,6 +103,7 @@ public class EyebrowHeadlineBodyLinkModel: ParentMoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(eyebrow, forKey: .eyebrow)
try container.encodeModelIfPresent(headline, forKey: .headline)

View File

@ -15,7 +15,8 @@ public class HeadlineBodyButtonModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyButton"
public var moleculeName: String = HeadlineBodyButtonModel.identifier
public var id: String = UUID().uuidString
public var accessibilityIdentifier: String?
public var backgroundColor: Color?
public var headlineBody: HeadlineBodyModel
@ -49,6 +50,7 @@ public class HeadlineBodyButtonModel: MoleculeModelProtocol {
private enum CodingKeys: String, CodingKey {
case id
case moleculeName
case accessibilityIdentifier
case backgroundColor
case headlineBody
case button
@ -62,6 +64,7 @@ public class HeadlineBodyButtonModel: MoleculeModelProtocol {
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
accessibilityIdentifier = try typeContainer.decodeIfPresent(String.self, forKey: .accessibilityIdentifier)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody)
button = try typeContainer.decode(ButtonModel.self, forKey: .button)
@ -73,6 +76,7 @@ public class HeadlineBodyButtonModel: MoleculeModelProtocol {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(id, forKey: .id)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(accessibilityIdentifier, forKey: .accessibilityIdentifier)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(headlineBody, forKey: .headlineBody)
try container.encode(button, forKey: .button)

Some files were not shown because too many files have changed in this diff Show More