@page "/"
@inherits APageComponent
@{try{
<!--=============================================================================================-->
<CascadingValue Value=@this>
   <CascadingValue Value=@CurrentBook>
      @if (DisplayBookInfo) {<BookInfo @ref=@BookInfo />}
      <CascadingValue Value=@BookSelectionCollections>
         @if (DisplayBookCard) {<BookCard @ref=@BookCard />}
      </CascadingValue>
   </CascadingValue>
</CascadingValue>
<div id="pg_home_MainContentDIV" style=@(IsOnMainContent ? null : "display: none")>
<!--=============================================================================================-->
<div id="pg_home_HeaderDIV">
   <span class="page_ImpressiveTitle">BookRegistry client-server WASM-application</span>
   <img src="images/book_registry.png" class="ml-2" style="align-self: flex-start" />
   <div style="flex: 1; height: 100%" />
   <div id="pg_home_SelectionRemDIV">Book selection<br>by requisites</div>
   <div style="flex: 3; height: 100%" />
   @if (IsForCorrection)
   {
   <AButton id="pg_home_AddBookBUTTON" Classes_0="btn btn-secondary"
            Title="Open add-book form (sub-page)"
            Enabled=@HasRequisiteLists Focusable=@false
            ON_Click=@AddNewBookBUTTON_OnClick>Add new book</AButton>
   }
</div><!--pg_home_HeaderDIV-->
<table id="pg_home_ControlsTABLE">
   <tbody>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
      <tr><td /></tr>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
      <tr>
         <td class="pg_home_RequisiteCaptionTD">Author:</td><td>&nbsp;</td>
         <td class="pg_home_RequisiteCaptionTD">Publisher:</td><td>&nbsp;</td>
         <td class="pg_home_RequisiteCaptionTD page_ActiveLabel"><u>N</u>ame part (fragment):</td>
      </tr>
      <tr>
         <td>
            <ADropDownList_IdName @ref=@AuthorDDL SelectClasses="pg_home_RequisiteSELECT"
                                  ResetPresence=@ElementPresence.Available
                                  Enabled=@HasRequisiteLists TabIndex=1
                                  ON_SelectIndex=@RequisiteList_OnSelectIndex />
         </td>
         <td />
         <td>
            <ADropDownList_IdName @ref=@PublisherDDL SelectClasses="pg_home_RequisiteSELECT"
                                  ResetPresence=@ElementPresence.Available
                                  Enabled=@HasRequisiteLists TabIndex=4
                                  ON_SelectIndex=@RequisiteList_OnSelectIndex />
         </td>
         <td />
         <td>
            <AEditBox @ref=@BookNamePartEdit InputClasses="pg_home_RequisiteINPUT"
                      AccessKey=@(IsOnMainContent ? "n" : null)
                      Enabled=@HasRequisiteLists TabIndex=6
                      ON_SetText=@RequisiteEdit_OnSetText
                      ON_KeyDown_A=@((e) => RequisiteEdit_OnKeyDown_A(BookNamePartEdit,e)) />
         </td>
         <td><AResetControl @ref=@BookNamePartReset
                            Enabled=@(BookNamePartEdit?.Enabled ?? false) /></td>
      </tr>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
      <tr>
         <td class="pg_home_RequisiteCaptionTD">Category:</td><td>&nbsp;</td>
         <td class="pg_home_RequisiteCaptionTD">Series:</td><td>&nbsp;</td>
         <td class="pg_home_RequisiteCaptionTD page_ActiveLabel"><u><b>I</b></u>SBN (fragment):</td>
      </tr>
      <tr>
         <td>
            <ADropDownList_IdName @ref=@CategoryDDL SelectClasses="pg_home_RequisiteSELECT"
                                  ResetPresence=@ElementPresence.Available
                                  Enabled=@HasRequisiteLists TabIndex=2
                                  ON_SelectIndex=@RequisiteList_OnSelectIndex />
         </td>
         <td />
         <td>
            <ADropDownList_IdName @ref=@SeriesDDL SelectClasses="pg_home_RequisiteSELECT"
                                  ResetPresence=@ElementPresence.Available
                                  Enabled=@HasRequisiteLists TabIndex=5
                                  ON_SelectIndex=@RequisiteList_OnSelectIndex />
         </td>
         <td />
         <td>
            <AEditBox @ref=@ISBNPartEdit InputClasses="pg_home_RequisiteINPUT"
                      AccessKey=@(IsOnMainContent ? "i" : null)
                      Enabled=@HasRequisiteLists TabIndex=7
                      ON_SetText=@RequisiteEdit_OnSetText
                      @onkeydown=@((e) => RequisiteEdit_OnKeyDown_A(ISBNPartEdit,e)) />
         </td>
         <td><AResetControl @ref=@ISBNPartReset
                            Enabled=@(ISBNPartEdit?.Enabled ?? false) /></td>
      </tr>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
      <tr>
         <td class="pg_home_RequisiteCaptionTD">Genre:</td><td></td><!--<td>&nbsp;</td>
         <td class="pg_home_RequisiteCaptionTD"></td><td></td><td>&nbsp;</td>
         <td class="pg_home_RequisiteCaptionTD"></td>-->
      </tr>
      <tr>
         <td>
            <ADropDownList_IdName @ref=@GenreDDL SelectClasses="pg_home_RequisiteSELECT"
                                  ResetPresence=@ElementPresence.Available
                                  Enabled=@HasRequisiteLists TabIndex=3
                                  ON_SelectIndex=@RequisiteList_OnSelectIndex />
         </td>
         <!--<td />
         <td>
            <ADropDownList_IdName @ref= SelectClasses="pg_home_RequisiteSELECT"
                                  ResetPresence=@ElementPresence.Available TabIndex=
                                  ON_SelectIndex=@RequisiteList_OnSelectIndex />
         </td>
         <td />
         <td>
            <AEditBox @ref= InputClasses="pg_home_RequisiteINPUT" TabIndex=
                      ON_SetText=RequisiteEdit_OnSetText />
         </td>
         <td><AResetControl @ref= /></td>-->
      </tr>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
      <tr>
         <td style="height: 7px"></td>
      </tr>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
      <tr>
         <td>
            <div class="pg_home_SelectionControlsDIV">
               <AButton @ref=@ResetButton ID="pg_home_ResetRequisitesBUTTON"
                        Title="Reset all input (requisites)"
                        AccessKey=@(IsOnMainContent ? "r" : null)
                        Enabled=@ResetSelectEnabled TabIndex=8
                        ON_Click=@ResetRequisitesButton_OnClick><u>R</u>eset requisites</AButton>&nbsp;
               <AButton @ref=@SelectBooksButton ID="pg_home_SelectBooksBUTTON"
                        Classes_0="btn btn-primary btn-sm"
                        Title="Perform selection query"
                        AccessKey=@(IsOnMainContent ? "s" : null)
                        Enabled=@ResetSelectEnabled TabIndex=9
                        ON_Click_A=@SelectBooksButton_OnClick_A><u>S</u>elect books</AButton>
            </div>
         </td>
         <td>&nbsp;</td>
         <td colspan="3">
            <div id="pg_home_BookOrderDIV">
               <span id="pg_home_OrderCaptionSPAN">
                  Book-order (in query sorting)
                  <font color="DimGray">&#x25BA;&nbsp;</font>
               </span>
               <ADropDownList @ref=@BookOrderDDL
                              ContainerId="pg_home_BookOrderListDIV"
                              SelectClasses_0="form-control-sm"
                              SelectClasses="pg_home_BookOrderSELECT"
                              SelectStyle="font-style: italic"
                              OptionStyle="font-style: normal; color: Blue"
                              SelectedOptionStyle="font-style: normal; font-weight: bold; color: SeaGreen"
                              InitialItems=@BookSortingInfo.Items
                              ItemCaptionFieldName="Name"
                              SelectFirstItemOnInit=@true
                              Enabled=@HasRequisiteLists
                              TabIndex=10
                              ON_SelectIndex_A=@BookOrderDDL_OnSelectIndex_A />
            </div>
         </td>
         <td>
            <AUpResetControl @ref=@BookOrderUpReset Enabled=@HasRequisiteLists />
         </td>
      </tr>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
   </tbody>
</table><!--pg_home_ControlsTABLE-->
<!--=============================================================================================-->
<CascadingValue Value=@this>
   <BookList Items=@BookList />
</CascadingValue>
<!--=============================================================================================-->
</div><!--pg_home_MainDIV-->
<!--=============================================================================================-->
}catch(Exception e){ProcessRenderingError(GetType(),e);}}
