<mvc:View
	controllerName="com.example.fiori.bp2.controller.Studio"
	xmlns:mvc="sap.ui.core.mvc"
	xmlns="sap.m"
	xmlns:core="sap.ui.core"
	xmlns:l="sap.ui.layout"
	xmlns:form="sap.ui.layout.form"
	height="100%"
	displayBlock="true">
	<Page id="studioPage" showHeader="false" class="bp2Page" enableScrolling="true">
		<content>
			<VBox class="bp2Scene" renderType="Bare">
				<HBox class="bp2TopNav" justifyContent="SpaceBetween" alignItems="Center" wrap="Wrap" renderType="Bare">
					<HBox alignItems="Center" class="bp2Brand" renderType="Bare">
						<core:HTML content='&lt;div class="bp2Mark" aria-hidden="true"&gt;&lt;/div&gt;' />
						<VBox renderType="Bare">
							<Text text="{i18n>brand}" class="bp2BrandName" />
							<Text text="{i18n>brandTag}" class="bp2BrandTag" />
						</VBox>
					</HBox>
					<HBox class="bp2TopActions" wrap="Wrap" renderType="Bare">
						<Link text="{i18n>navV1}" href="business_partner.html" class="bp2GhostLink" />
						<Button text="{i18n>navHome}" type="Transparent" press=".onNavHome" class="bp2GhostBtn" />
					</HBox>
				</HBox>

				<HBox class="bp2Stage" wrap="Wrap" renderType="Bare" alignItems="Stretch">
					<VBox class="bp2Rail" renderType="Bare">
						<Text text="{i18n>railTitle}" class="bp2RailKicker" />
						<Title text="{ui>/currentTitle}" level="H1" class="bp2RailTitle" />
						<Text text="{ui>/currentText}" class="bp2RailCopy" />

						<VBox class="bp2Stepper" renderType="Bare">
							<HBox id="stepRow1" class="bp2StepRow is-on is-current" alignItems="Center" renderType="Bare">
								<core:HTML content='&lt;div class="bp2Dot"&gt;1&lt;/div&gt;' />
								<VBox renderType="Bare" class="bp2StepLabels">
									<Text text="Registro" class="bp2StepLabel" />
									<Text text="Camera di Commercio" class="bp2StepCaption" />
								</VBox>
							</HBox>
							<core:HTML content='&lt;div class="bp2Stem"&gt;&lt;/div&gt;' />
							<HBox id="stepRow2" class="bp2StepRow" alignItems="Center" renderType="Bare">
								<core:HTML content='&lt;div class="bp2Dot"&gt;2&lt;/div&gt;' />
								<VBox renderType="Bare" class="bp2StepLabels">
									<Text text="Identità" class="bp2StepLabel" />
									<Text text="Anagrafica BP" class="bp2StepCaption" />
								</VBox>
							</HBox>
							<core:HTML content='&lt;div class="bp2Stem"&gt;&lt;/div&gt;' />
							<HBox id="stepRow3" class="bp2StepRow" alignItems="Center" renderType="Bare">
								<core:HTML content='&lt;div class="bp2Dot"&gt;3&lt;/div&gt;' />
								<VBox renderType="Bare" class="bp2StepLabels">
									<Text text="Presenza" class="bp2StepLabel" />
									<Text text="Sede e canali" class="bp2StepCaption" />
								</VBox>
							</HBox>
							<core:HTML content='&lt;div class="bp2Stem"&gt;&lt;/div&gt;' />
							<HBox id="stepRow4" class="bp2StepRow" alignItems="Center" renderType="Bare">
								<core:HTML content='&lt;div class="bp2Dot"&gt;4&lt;/div&gt;' />
								<VBox renderType="Bare" class="bp2StepLabels">
									<Text text="Lancio" class="bp2StepLabel" />
									<Text text="Conferma" class="bp2StepCaption" />
								</VBox>
							</HBox>
						</VBox>

						<ProgressIndicator
							percentValue="{ui>/progress}"
							displayValue="{= 'Step ' + ${ui>/step} + ' / ' + ${ui>/stepCount} }"
							showValue="true"
							state="Information"
							class="bp2Progress" />
					</VBox>

					<VBox class="bp2Canvas" renderType="Bare">
						<!-- STEP 1 -->
						<VBox class="bp2Panel" renderType="Bare" visible="{= ${ui>/step} === 1 }">
							<Text text="{i18n>step1Title}" class="bp2PanelTitle" />
							<Text text="{i18n>step1Text}" class="bp2PanelLead" />
							<HBox class="bp2SearchGrid" wrap="Wrap" renderType="Bare">
								<VBox class="bp2Field" renderType="Bare">
									<Label text="{i18n>vat}" />
									<Input value="{draft>/search/vatNumber}" placeholder="11 cifre" submit=".onSearch" />
								</VBox>
								<VBox class="bp2Field" renderType="Bare">
									<Label text="{i18n>cf}" />
									<Input value="{draft>/search/fiscalCode}" submit=".onSearch" />
								</VBox>
								<VBox class="bp2Field bp2FieldWide" renderType="Bare">
									<Label text="{i18n>name}" />
									<Input value="{draft>/search/companyName}" placeholder="es. Nord Meccanica" submit=".onSearch" />
								</VBox>
							</HBox>
							<HBox justifyContent="SpaceBetween" alignItems="Center" wrap="Wrap" class="bp2Toolbar">
								<Text text="{i18n>searchHint}" class="bp2Hint" />
								<Button text="{i18n>search}" type="Emphasized" class="bp2Primary" icon="sap-icon://connected" press=".onSearch" busy="{draft>/cciaa/busy}" />
							</HBox>
							<VBox visible="{draft>/cciaa/searched}" class="bp2ResultsWrap" renderType="Bare">
								<HBox justifyContent="SpaceBetween" alignItems="Center">
									<Text text="{i18n>results}" class="bp2SectionLabel" />
									<ObjectStatus text="{= ${draft>/cciaa/results}.length + ' hit' }" state="Indication05" inverted="true" />
								</HBox>
								<List
									id="resultList"
									mode="SingleSelectMaster"
									selectionChange=".onSelectCompany"
									items="{draft>/cciaa/results}"
									noDataText="{i18n>empty}"
									busy="{draft>/cciaa/busy}"
									busyIndicatorDelay="0"
									class="bp2CardList">
									<CustomListItem type="Active" class="bp2CompanyCard">
										<VBox class="bp2CompanyInner" renderType="Bare">
											<HBox justifyContent="SpaceBetween" alignItems="Start" wrap="Wrap">
												<Title text="{draft>CompanyName}" level="H4" class="bp2CompanyName" />
												<ObjectStatus text="{draft>Status}" state="{= ${draft>Status} === 'Attiva' ? 'Success' : 'Warning' }" inverted="true" />
											</HBox>
											<Text text="{draft>VatNumber} · REA {draft>ReaNumber} · CCIAA {draft>CciaaCode}" class="bp2CompanyMeta" />
											<Text text="{draft>Street} {draft>HouseNumber}, {draft>PostalCode} {draft>City}" class="bp2CompanyAddr" />
											<Text text="{draft>AtecoCode} — {draft>AtecoText}" class="bp2CompanyAteco" />
										</VBox>
									</CustomListItem>
								</List>
							</VBox>
							<MessageStrip text="{i18n>selected}: {draft>/general/name1}" type="Success" showIcon="true" visible="{= !!${draft>/cciaa/selectedKey} }" class="sapUiSmallMarginTop" />
						</VBox>

						<!-- STEP 2 -->
						<VBox class="bp2Panel" renderType="Bare" visible="{= ${ui>/step} === 2 }">
							<Text text="{i18n>step2Title}" class="bp2PanelTitle" />
							<Text text="{i18n>step2Text}" class="bp2PanelLead" />
							<Label text="{i18n>cat}" />
							<SegmentedButton selectedKey="{draft>/general/bpCategory}" class="bp2Seg sapUiSmallMarginBottom">
								<items>
									<SegmentedButtonItem key="2" text="{i18n>org}" />
									<SegmentedButtonItem key="1" text="{i18n>person}" />
								</items>
							</SegmentedButton>
							<form:SimpleForm editable="true" layout="ColumnLayout" columnsM="2" columnsL="2" columnsXL="2" class="bp2Form">
								<form:content>
									<Label text="{i18n>name1}" required="true" />
									<Input value="{draft>/general/name1}" />
									<Label text="{i18n>name2}" />
									<Input value="{draft>/general/name2}" />
									<Label text="{i18n>legal}" />
									<Select selectedKey="{draft>/general/legalForm}">
										<items>
											<core:Item key="SRL" text="{i18n>legalSRL}" />
											<core:Item key="SPA" text="{i18n>legalSPA}" />
											<core:Item key="SAPA" text="{i18n>legalSAPA}" />
											<core:Item key="DI" text="{i18n>legalDI}" />
										</items>
									</Select>
									<Label text="{i18n>vat}" required="true" />
									<Input value="{draft>/general/vatNumber}" />
									<Label text="{i18n>cf}" />
									<Input value="{draft>/general/fiscalCode}" />
									<Label text="{i18n>rea}" />
									<Input value="{draft>/general/reaNumber}" />
									<Label text="{i18n>cciaa}" />
									<Input value="{draft>/general/cciaaCode}" />
									<Label text="{i18n>industry}" />
									<Select selectedKey="{draft>/general/industry}">
										<items>
											<core:Item key="MANU" text="{i18n>indMANU}" />
											<core:Item key="TRAD" text="{i18n>indTRAD}" />
											<core:Item key="SERV" text="{i18n>indSERV}" />
											<core:Item key="TECH" text="{i18n>indTECH}" />
											<core:Item key="LOGI" text="{i18n>indLOGI}" />
										</items>
									</Select>
								</form:content>
							</form:SimpleForm>
							<VBox class="bp2RoleDeck" renderType="Bare">
								<Text text="{i18n>roles}" class="bp2SectionLabel" />
								<HBox wrap="Wrap" class="bp2RoleChips">
									<CheckBox text="{i18n>customer}" selected="{draft>/general/customerRole}" class="bp2RoleChip" />
									<CheckBox text="{i18n>supplier}" selected="{draft>/general/supplierRole}" class="bp2RoleChip" />
								</HBox>
							</VBox>
						</VBox>

						<!-- STEP 3 -->
						<VBox class="bp2Panel" renderType="Bare" visible="{= ${ui>/step} === 3 }">
							<Text text="{i18n>step3Title}" class="bp2PanelTitle" />
							<Text text="{i18n>step3Text}" class="bp2PanelLead" />
							<form:SimpleForm editable="true" layout="ColumnLayout" columnsM="2" columnsL="2" columnsXL="2" class="bp2Form">
								<form:content>
									<Label text="{i18n>street}" />
									<Input value="{draft>/address/street}" />
									<Label text="{i18n>num}" />
									<Input value="{draft>/address/houseNumber}" width="7rem" />
									<Label text="{i18n>cap}" required="true" />
									<Input value="{draft>/address/postalCode}" width="7rem" />
									<Label text="{i18n>city}" required="true" />
									<Input value="{draft>/address/city}" />
									<Label text="{i18n>region}" />
									<Input value="{draft>/address/region}" width="5rem" maxLength="3" />
									<Label text="{i18n>country}" />
									<Select selectedKey="{draft>/address/country}">
										<items>
											<core:Item key="IT" text="Italia" />
											<core:Item key="DE" text="Germania" />
											<core:Item key="FR" text="Francia" />
											<core:Item key="CH" text="Svizzera" />
										</items>
									</Select>
									<Label text="{i18n>email}" />
									<Input value="{draft>/address/email}" type="Email" />
									<Label text="{i18n>phone}" />
									<Input value="{draft>/address/phone}" type="Tel" />
									<Label text="{i18n>pec}" />
									<Input value="{draft>/address/pec}" type="Email" />
									<Label text="{i18n>web}" />
									<Input value="{draft>/address/website}" />
								</form:content>
							</form:SimpleForm>
						</VBox>

						<!-- STEP 4 -->
						<VBox class="bp2Panel" renderType="Bare" visible="{= ${ui>/step} === 4 }">
							<Text text="{i18n>step4Title}" class="bp2PanelTitle" />
							<Text text="{i18n>step4Text}" class="bp2PanelLead" />
							<l:Grid defaultSpan="L6 M12 S12" class="bp2ReviewGrid">
								<VBox class="bp2ReviewCard" renderType="Bare">
									<Text text="{i18n>reviewLeft}" class="bp2SectionLabel" />
									<Title text="{draft>/general/name1}" level="H3" class="bp2ReviewName" />
									<ObjectAttribute title="{i18n>vat}" text="{draft>/general/vatNumber}" />
									<ObjectAttribute title="{i18n>cf}" text="{draft>/general/fiscalCode}" />
									<ObjectAttribute title="{i18n>legal}" text="{draft>/general/legalForm}" />
									<ObjectAttribute title="{i18n>industry}" text="{draft>/general/industry}" />
									<ObjectAttribute title="{i18n>rea}" text="{draft>/general/reaNumber}" />
								</VBox>
								<VBox class="bp2ReviewCard" renderType="Bare">
									<Text text="{i18n>reviewRight}" class="bp2SectionLabel" />
									<Title text="{draft>/address/city}" level="H3" class="bp2ReviewName" />
									<ObjectAttribute title="{i18n>street}" text="{draft>/address/street} {draft>/address/houseNumber}" />
									<ObjectAttribute title="{i18n>cap}" text="{draft>/address/postalCode} ({draft>/address/region})" />
									<ObjectAttribute title="{i18n>email}" text="{draft>/address/email}" />
									<ObjectAttribute title="{i18n>phone}" text="{draft>/address/phone}" />
									<ObjectAttribute title="{i18n>pec}" text="{draft>/address/pec}" />
								</VBox>
							</l:Grid>
							<HBox class="bp2LaunchBar" justifyContent="End" wrap="Wrap">
								<Button text="{i18n>create}" type="Emphasized" icon="sap-icon://paper-plane" class="bp2Primary bp2Launch" press=".onCreate" busy="{draft>/create/busy}" />
							</HBox>
						</VBox>

						<HBox class="bp2Footer" justifyContent="SpaceBetween" alignItems="Center" wrap="Wrap" renderType="Bare">
							<Button text="{i18n>back}" type="Transparent" icon="sap-icon://navigation-left-arrow" press=".onBack" enabled="{= ${ui>/step} &gt; 1 &amp;&amp; !${draft>/create/busy} }" class="bp2GhostBtn" />
							<Button text="{i18n>next}" type="Emphasized" icon="sap-icon://navigation-right-arrow" iconFirst="false" press=".onNext" visible="{= ${ui>/step} &lt; 4 }" class="bp2Primary" />
						</HBox>
					</VBox>
				</HBox>
			</VBox>
		</content>
	</Page>
</mvc:View>
