2 <eg-staff-banner bannerText="Sandbox" i18n-bannerText>
6 i18n-prefix i18n-suffix
7 prefix=":) {{dynamicTitleText}}"
10 <eg-help-popover [placement]="'right'" helpText="This page is for random ng stuff!"></eg-help-popover>
11 <div class="row flex pt-2">
12 <div i18n> Modify Page Title: </div>
13 <div class="col-lg-2">
14 <input type="text" [(ngModel)]="dynamicTitleText" class="form-control"/>
18 <!-- FM Editor Experiments ----------------------------- -->
19 <div class="row mb-3">
20 <ng-template #descriptionTemplate
21 let-field="field" let-record="record" let-hello="hello">
22 <!-- example custom template for editing the 'description' field -->
24 placeholder="{{hello}}"
27 [readonly]="field.readOnly"
28 [required]="field.isRequired()"
29 [ngModel]="record[field.name]()"
30 (ngModelChange)="record[field.name]($event)">
33 <!-- note: fieldOptions would be best defined in the .ts file, but
34 want to demostrate it can be set in the template as well -->
35 <eg-fm-record-editor #fmRecordEditor
36 idlClass="cmrcfld" mode="create"
37 [fieldOptions]="{marc_record_type:{customValues:[{id:'biblio'},{id:'serial'},{id:'authority'}]},description:{customTemplate:{template:descriptionTemplate,context:{'hello':'goodbye'}}}}"
38 recordId="1" orgDefaultAllowed="owner">
39 </eg-fm-record-editor>
40 <button class="btn btn-dark" (click)="openEditor()">
44 <!-- / FM Editor Experiments ----------------------------- -->
46 <!-- Progress Dialog Experiments ----------------------------- -->
47 <div class="row mb-3">
48 <div class="col-lg-3">
49 <button class="btn btn-outline-danger" (click)="progress.increment()">Increment Inline</button>
50 <eg-help-popover [placement]="'bottom'" helpText="Exercise your clicking finger by clicking the button above.">
53 <div class="col-lg-3">
54 <eg-progress-inline [max]="100" [value]="1" #progress></eg-progress-inline>
57 <div class="row mb-3">
58 <div class="col-lg-4">
59 <eg-progress-dialog #progressDialog>
61 <button class="btn btn-light" (click)="showProgress()">Test Progress Dialog</button>
63 <div class="col-lg-3">
64 <eg-help-popover helpLink="https://www.youtube.com/watch?v=dQw4w9WgXcQ" helpText="This popover is supposed to help or something...!"></eg-help-popover>
65 <eg-combobox [allowFreeText]="true"
66 placeholder="Combobox with static data"
67 [entries]="cbEntries"></eg-combobox>
69 <div class="col-lg-3">
70 <eg-help-popover helpText="You have to type to see any options in this dropdown."></eg-help-popover>
72 placeholder="Combobox with dynamic data"
73 [asyncDataSource]="cbAsyncSource"></eg-combobox>
76 <div class="row mb-3">
77 <div class="col-lg-4">
78 <eg-help-popover helpText="If you like Toast you must click below!" placement="'auto'"></eg-help-popover>
79 <button class="btn btn-info" (click)="testToast()">Test Toast Message</button>
81 <div class="col-lg-2">
82 Org select with limit perms
84 <div class="col-lg-2">
85 <eg-org-select [limitPerms]="['REGISTER_WORKSTATION']">
89 <!-- /Progress Dialog Experiments ----------------------------- -->
93 <div class="row mb-3">
94 <eg-string #helloString text="Hello, {{name}}" i18n-text></eg-string>
95 <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
99 <div class="row mb-3">
100 <ng-template #helloStrTmpl let-name="name" i18n>Hello, {{name}}</ng-template>
102 <eg-string #helloStr key="helloKey" [template]="helloStrTmpl"></eg-string>
104 <eg-string key="staff.sandbox.test" [template]="helloStrTmpl"></eg-string>
105 <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
109 <div class="form-group">
110 <eg-date-select (onChangeAsDate)="changeDate($event)"
111 initialYmd="2017-03-04">
114 <div>HERE: {{testDate}}</div>
119 <button class="btn btn-secondary" (click)="doPrint()">Test Print</button>
120 <ng-template #printTemplate let-context>Hello, {{context.world}}!</ng-template>
122 <button class="btn btn-secondary" (click)="printWithDialog()">Print with dialog</button>
126 <div class="col-lg-3">
127 <eg-translate #translate [idlObject]="oneBtype" fieldName="name"></eg-translate>
128 <button class="btn btn-info"
129 (click)="translate.open({size:'lg'})">Translate</button>
135 <h4>Cross-tab communications example</h4>
136 <p>To test, open this sandbox in a second browser tab. Enter something in the input box below, then switch to the other tab and click anywhere on the page.
137 You should see the message that you sent to the other browser tab.</p>
140 <div class="col-lg-3">
141 <input type="text" #sendSbMessage placeholder="message to send to another tab" size="40" (change)="sendMessage($event)">
143 <div class="col-lg-3">
144 message received: {{sbChannelText}}
149 <ng-template #cellTmpl let-row="row" let-col="col" let-userContext="userContext">
150 HELLO {{userContext.hello}}
151 <button>{{row.id()}}</button>
153 <eg-grid #cbtGrid idlClass="cbt"
154 [dataSource]="btSource"
155 [rowClassCallback]="btGridRowClassCallback"
156 [rowFlairIsEnabled]="true"
157 [rowFlairCallback]="btGridRowFlairCallback"
158 [cellClassCallback]="btGridCellClassCallback"
160 <eg-grid-toolbar-action label="Action that needs a single row" i18n-label
161 (onClick)="complimentEvergreen($event)" [disableOnRows]="notOneSelectedRow">
162 </eg-grid-toolbar-action>
163 <eg-grid-toolbar-action [isSeparator]="true">
164 </eg-grid-toolbar-action>
165 <eg-grid-toolbar-action label="Another Action" i18n-label
166 (onClick)="complimentEvergreen2($event)">
167 </eg-grid-toolbar-action>
168 <eg-grid-column name="test" [cellTemplate]="cellTmpl"
169 [cellContext]="btGridTestContext" [sortable]="false">
171 <eg-grid-column [sortable]="false" path="owner.name"></eg-grid-column>
172 <eg-grid-column [sortable]="false" path="datetime_test"
173 datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
178 <h4>PCRUD auto flesh and FormatService detection</h4>
179 <div *ngIf="aMetarecord">Fingerprint: {{aMetarecord}}</div>
182 <div class="card col-md-6">
183 <div class="card-body">
184 <h3 class="card-title">Do you like template-driven forms?</h3>
185 <div class="card-text">
186 <eg-org-family-select
187 [ancestorSelectorChecked]="true"
188 [hideDescendantSelector]="true"
190 labelText="Choose the best libraries"
191 ngModel #bestOnes="ngModel">
192 </eg-org-family-select>
193 The best libraries are: {{bestOnes.value | json}}
197 <form class="card col-md-6" [formGroup]="badOrgForm">
198 <div class="card-body">
199 <h3 class="card-title">Or perhaps reactive forms interest you?</h3>
200 <div class="card-text">
201 <eg-org-family-select
202 formControlName="badOrgSelector"
203 labelText="Choose the worst libraries">
204 </eg-org-family-select>
205 <div *ngIf="!badOrgForm.valid" class="alert alert-danger">
206 <span class="material-icons">error</span>
207 <span i18n>Too many bad libraries!</span>