<ol class="breadcrumb breadcrumb-arrow font-trirong">
  <li><a href="javascript://"> Basicp2</a></li>
</ol>
<section class="ug-hero">
  <div class="ug-hero__content">
    <div class="ug-hero__icon"><clr-icon shape="users"></clr-icon></div>
    <div>
      <h2 class="ug-hero__title">Basicp2</h2>
    </div>
  </div>
  <div class="ug-hero__actions"> 
    <button id="add" class="ug-btn ug-btn-primary" (click)="goToAdd()">
      <clr-icon shape="plus"></clr-icon>
      <span class="ug-btn-text">ADD</span>
    </button>
   
  </div>
</section>


<div class="ug-toolbar">
  <div class="ug-toolbar__left">
    <div class="ug-search">
      <clr-icon shape="search"></clr-icon>
      <input class="ug-search__input" type="text" placeholder="SEARCH" [(ngModel)]="filterText" />
    </div>
  </div>
  <div class="ug-toolbar__right">
    <div class="ug-view-toggle">
      <button class="ug-btn ug-btn-sm" [class.ug-btn-primary]="viewMode==='cards'" (click)="setViewMode('cards')">
        <clr-icon shape="view-cards"></clr-icon>
      </button>
      <button class="ug-btn ug-btn-sm" [class.ug-btn-primary]="viewMode==='table'" (click)="setViewMode('table')">
        <clr-icon shape="table"></clr-icon>
      </button>
    </div>
  </div>
</div> 
<clr-datagrid class="ug-grid" [clrDgLoading]="loading" *ngIf="viewMode==='table'">
  <clr-dg-placeholder>
    <ng-template #loadingSpinner>
      <clr-spinner>LOADING ... </clr-spinner>
    </ng-template>
    <div *ngIf="error;else loadingSpinner">{{error}}</div>
  </clr-dg-placeholder>



 <clr-dg-column [clrDgField]="'about'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      about
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'textarea2'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Textarea2
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'date_field'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Date Field
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'date_field2'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Date Field2
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'datetime_field'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Datetime Field
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'datetime_field2'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Datetime Field2
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'email_field'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Email Field
    </ng-container>
  </clr-dg-column>




 <clr-dg-column [clrDgField]="'email_field2'">
    <ng-container *clrDgHideableColumn="{hidden: false}">
      Email Field2
    </ng-container>
  </clr-dg-column>



 
 <!-- who column -->
      <clr-dg-column> <ng-container *clrDgHideableColumn="{hidden: false}">
        <clr-icon shape="bars"></clr-icon> Action
      </ng-container></clr-dg-column>
      <!-- end --> 
  <clr-dg-row *clrDgItems="let user of filteredGroups;let i = index" [clrDgItem]="user">

<clr-dg-cell (click)="goToReplaceStringabout (user.about)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>


<clr-dg-cell (click)="goToReplaceStringtextarea2 (user.textarea2)" style="cursor: pointer; align-items: center;"><clr-icon shape="details"></clr-icon>
</clr-dg-cell>


<clr-dg-cell>{{user.date_field }}</clr-dg-cell>


<clr-dg-cell>{{user.date_field2 }}</clr-dg-cell>


<clr-dg-cell>{{user.datetime_field }}</clr-dg-cell>


<clr-dg-cell>{{user.datetime_field2 }}</clr-dg-cell>


<clr-dg-cell>{{user.email_field }}</clr-dg-cell>


<clr-dg-cell>{{user.email_field2 }}</clr-dg-cell>



 
  <!-- who column -->
<clr-dg-cell>
  <clr-signpost>
   <span style="cursor: pointer;" clrSignpostTrigger><clr-icon shape="help" class="success" style="color: rgb(0, 130, 236);"></clr-icon></span>
   <clr-signpost-content [clrPosition]="'left-middle'" *clrIfOpen>
     <h5 style="margin-top: 0">Who Column</h5>
           <div>Account ID: <code class="clr-code">{{user.accountId}}</code></div>
           <div>Created At: <code class="clr-code">{{user.createdAt| date}}</code></div>
           <div>Created By: <code class="clr-code">{{user.createdBy}}</code></div>
           <div>Updated At: <code class="clr-code">{{user.updatedAt | date}}</code></div>
           <div>Updated By: <code class="clr-code">{{user.updatedBy}}</code></div>
   </clr-signpost-content>
 </clr-signpost>
 </clr-dg-cell>
 
 <!-- who colmn --> 
 
 
    <clr-dg-action-overflow>
      <!-- <button class="ug-action-item" *ngIf="medit == 'true' || medit == true" (click)="onEdit(user)">
        <clr-icon shape="edit"></clr-icon>
        EDIT
      </button> -->
      <button class="ug-action-item" (click)="onEdit(user)">
        <clr-icon shape="edit"></clr-icon>
        EDIT
      </button>
      <button class="ug-action-item ug-btn-error" (click)="onDelete(user)">
        <clr-icon shape="trash"></clr-icon>
 DELETE
      </button>
    </clr-dg-action-overflow>

</clr-dg-row>

  <clr-dg-footer class="ug-grid-footer">
    <clr-dg-pagination #pagination [clrDgPageSize]="10">
      <clr-dg-page-size [clrPageSizeOptions]="[10,20,50,100]">Record per page</clr-dg-page-size>
      {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}}
      of {{pagination.totalItems}} Records
    </clr-dg-pagination>
  </clr-dg-footer>
</clr-datagrid>

<div class="ug-cards" *ngIf="viewMode==='cards'">
  <div class="ug-card-item" *ngFor="let user of filteredGroups; let i = index">
 <div class="ug-card-item__body"> 
    
      <div class="ug-kv"><span>about</span><strong>{{user.about}}</strong></div>


      <div class="ug-kv"><span>Textarea2</span><strong>{{user.textarea2}}</strong></div>


      <div class="ug-kv"><span>Date Field</span><strong>{{user.date_field}}</strong></div>


      <div class="ug-kv"><span>Date Field2</span><strong>{{user.date_field2}}</strong></div>


      <div class="ug-kv"><span>Datetime Field</span><strong>{{user.datetime_field}}</strong></div>


      <div class="ug-kv"><span>Datetime Field2</span><strong>{{user.datetime_field2}}</strong></div>


      <div class="ug-kv"><span>Email Field</span><strong>{{user.email_field}}</strong></div>


      <div class="ug-kv"><span>Email Field2</span><strong>{{user.email_field2}}</strong></div>


      <div class="ug-kv"><span>UserId Field</span><strong>{{user.userid_field}}</strong></div>


 </div>
    <div class="ug-card-item__footer">
      
      <button class="ug-btn ug-btn-sm ug-btn-outline" (click)="onEdit(user)">
        <clr-icon shape="edit"></clr-icon> Edit
      </button>
      <button class="ug-btn ug-btn-sm ug-btn-error" (click)="onDelete(user)">
        <clr-icon shape="trash"></clr-icon> Delete
      </button>
    </div>
  </div>
</div>
<clr-modal [(clrModalOpen)]="rsModalabout" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
						  <div class="modal-body">
						    <textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
						  </div></clr-modal>


<clr-modal [(clrModalOpen)]="rsModaltextarea2" [clrModalSize]="'xl'" [clrModalStaticBackdrop]="true">
						  <div class="modal-body">
						    <textarea class="form-control" style="width:100%; height: 400px;" readonly>{{rowSelected}}</textarea>
						  </div></clr-modal>















<clr-modal [(clrModalOpen)]="modalAdd" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
  <h3 class="modal-title">Add Basicp2</h3>
  <div class="modal-body">
    <form [formGroup]="entryForm" (ngSubmit)="onSubmit()">

<div class="form-row">
            <div class="form-col">
 <div class="ug-form-group">
              <label for="about" class="ug-form-label">about</label>
              <textarea 
                id="about" 
                class="ug-form-input" 
                formControlName="about" 
                placeholder="Enter text" 
                rows="3"></textarea>
            </div>
</div>
            </div>


<div class="form-row">
            <div class="form-col">
 <div class="ug-form-group">
              <label for="textarea2" class="ug-form-label">Textarea2</label>
              <textarea 
                id="textarea2" 
                class="ug-form-input" 
                formControlName="textarea2" 
                placeholder="Enter text" 
                rows="3"></textarea>
            </div>
</div>
            </div>

 <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="date_field" class="ug-form-label">Date Field</label>
              <input type="date" id="date_field" class="ug-form-input" formControlName="date_field">
            </div>
          </div>
        </div>


 <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="date_field2" class="ug-form-label">Date Field2</label>
              <input type="date" id="date_field2" class="ug-form-input" formControlName="date_field2">
            </div>
          </div>
        </div>


<div class="clr-col-sm-12">
 <label>  Datetime Field</label>
 <input class="clr-input"  type="datetime-local"  formControlName="datetime_field" />       
 </div>

<div class="clr-col-sm-12">
 <label>  Datetime Field2</label>
 <input class="clr-input"  type="datetime-local"  formControlName="datetime_field2" />       
 </div>


 <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="email_field" class="ug-form-label">Email Field</label>
              <input type="email" id="email_field" class="ug-form-input" formControlName="email_field" placeholder="Enter Email Field">
              <div *ngIf="entryForm.controls['email_field'].errors" class="ug-form-error">
                <div *ngIf="entryForm.controls['email_field'].hasError('pattern')" class="error_mess">* Email must be a valid email address</div>
              </div>
            </div>
          </div>
        </div>


 <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="email_field2" class="ug-form-label">Email Field2</label>
              <input type="email" id="email_field2" class="ug-form-input" formControlName="email_field2" placeholder="Enter Email Field2">
              <div *ngIf="entryForm.controls['email_field2'].errors" class="ug-form-error">
                <div *ngIf="entryForm.controls['email_field2'].hasError('pattern')" class="error_mess">* Email must be a valid email address</div>
              </div>
            </div>
          </div>
        </div>




      <div class="modal-footer">
        <button type="button" class="ug-btn ug-btn-outline" (click)="modalAdd = false">Cancel</button>
        <button type="submit" class="ug-btn ug-btn-primary">ADD</button>
      </div>
    </form>
  </div>
</clr-modal>

<clr-modal [(clrModalOpen)]="modalEdit" [clrModalSize]="'md'" [clrModalStaticBackdrop]="true">
  <h3 class="modal-title">Update Basicp2</h3>
  <div class="modal-body" *ngIf="rowSelected.id">
    
            <div class="form-col">
              <div class="ug-form-group">
                <label for="about" class="ug-form-label">about</label>
                <textarea id="about" class="ug-form-input" [(ngModel)]="rowSelected.about"
                  name="about" placeholder="Enter text" rows="3"></textarea>
              </div>
            </div>
           


            <div class="form-col">
              <div class="ug-form-group">
                <label for="textarea2" class="ug-form-label">Textarea2</label>
                <textarea id="textarea2" class="ug-form-input" [(ngModel)]="rowSelected.textarea2"
                  name="textarea2" placeholder="Enter text" rows="3"></textarea>
              </div>
            </div>
           


        <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="date_field" class="ug-form-label">Date Field</label>
              <input type="date" id="date_field" class="ug-form-input" [(ngModel)]="rowSelected.date_field" name="date_field">
            </div>
          </div>
        </div>


        <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="date_field2" class="ug-form-label">Date Field2</label>
              <input type="date" id="date_field2" class="ug-form-input" [(ngModel)]="rowSelected.date_field2" name="date_field2">
            </div>
          </div>
        </div>

<div class="clr-col-sm-12">       
<label>Datetime Field</label>
	        <input  class="clr-input"  type="datetime-local" [(ngModel)]="rowSelected.datetime_field" name="datetime_field" />
	      </div>

<div class="clr-col-sm-12">       
<label>Datetime Field2</label>
	        <input  class="clr-input"  type="datetime-local" [(ngModel)]="rowSelected.datetime_field2" name="datetime_field2" />
	      </div>


 <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="email_field" class="ug-form-label">Email Field</label>
              <input type="email" id="email_field" class="ug-form-input" [(ngModel)]="rowSelected.email_field" name="email_field" placeholder="Enter email address">
              <div *ngIf="rowSelected.email_field && !isValidemail_field(rowSelected.email_field)" class="ug-form-error">
                * Email must be a valid email address.
              </div>
            </div>
          </div>
        </div>


 <div class="form-row">
          <div class="form-col">
            <div class="ug-form-group">
              <label for="email_field2" class="ug-form-label">Email Field2</label>
              <input type="email" id="email_field2" class="ug-form-input" [(ngModel)]="rowSelected.email_field2" name="email_field2" placeholder="Enter email address">
              <div *ngIf="rowSelected.email_field2 && !isValidemail_field2(rowSelected.email_field2)" class="ug-form-error">
                * Email must be a valid email address.
              </div>
            </div>
          </div>
        </div>




    <div class="modal-footer">
      <button type="button" class="ug-btn ug-btn-outline" (click)="modalEdit = false">Cancel</button>
      <button type="submit" (click)="onUpdate(rowSelected.id)" class="ug-btn ug-btn-primary">Update</button>
    </div>

<clr-modal [(clrModalOpen)]="modaldelete" [clrModalSize]="'lg'" [clrModalStaticBackdrop]="true">
  <div class="modal-body" *ngIf="rowSelected.id">
    <div class="ug-delete-header">
      <div class="ug-delete-icon">
        <clr-icon shape="exclamation-triangle" size="48"></clr-icon>
      </div>
      <h1 class="ug-delete-title">Are You Sure Want to Delete?</h1>
      <p class="ug-delete-subtitle">This action cannot be undone</p>
    </div>

<div class="ug-delete-details"><div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">about:</span>
        <span class="ug-delete-detail-value">{{rowSelected.about}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Textarea2:</span>
        <span class="ug-delete-detail-value">{{rowSelected.textarea2}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Date Field:</span>
        <span class="ug-delete-detail-value">{{rowSelected.date_field}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Date Field2:</span>
        <span class="ug-delete-detail-value">{{rowSelected.date_field2}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Datetime Field:</span>
        <span class="ug-delete-detail-value">{{rowSelected.datetime_field}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Datetime Field2:</span>
        <span class="ug-delete-detail-value">{{rowSelected.datetime_field2}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Email Field:</span>
        <span class="ug-delete-detail-value">{{rowSelected.email_field}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">Email Field2:</span>
        <span class="ug-delete-detail-value">{{rowSelected.email_field2}}</span>
      </div>

<div class="ug-delete-detail-item">
        <span class="ug-delete-detail-label">UserId Field:</span>
        <span class="ug-delete-detail-value">{{rowSelected.userid_field}}</span>
      </div>

 
    </div>

    <div class="modal-footer">
      <button type="button" class="ug-btn ug-btn-outline" (click)="modaldelete = false">Cancel</button>
      <button type="submit" (click)="delete(rowSelected.id)" class="ug-btn ug-btn-error">Delete</button>
    </div>
  </div>
</clr-modal>

<clr-modal [(clrModalOpen)]="modalCsv" [clrModalSize]="'sm'" [clrModalStaticBackdrop]="false">
  <h3 class="modal-title">Import File</h3>
  <div class="modal-body">
    <div class="ug-form-group">
      <label class="ug-form-label">Select CSV File</label>
      <input type="file" name="file" class="ug-file-input" (change)="selectFile($event)"
        accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
    </div>
  </div>
  <div class="modal-footer">
    <button class="ug-btn ug-btn-outline" type="button" (click)="modalCsv = false">Cancel</button>
    <button class="ug-btn ug-btn-primary" type="button" [disabled]="!selectedFiles" (click)="saveCsv()">Import</button>
  </div>
</clr-modal>

















  <!-- htmlpopup -->
