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 that does not enable click if no search term is supplied"
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 <div class="row mb-3">
90 <div class="col-lg-4">
92 <div class="col-lg-3">
93 <eg-combobox placeholder="Combobox with @idlClass = 'aou' @idlField='shortname'" idlClass="aou" idlField="shortname" [asyncSupportsEmptyTermClick]="true">
96 <div class="col-lg-3">
97 <eg-combobox placeholder="Combobox with @idlClass = 'csp'" idlClass="csp" [asyncSupportsEmptyTermClick]="true">
101 <div class="row mb-3">
102 <div class="col-lg-4">
104 <div class="col-lg-3">
105 <eg-combobox placeholder="Combobox with @idlClass = 'aou'" idlClass="aou" [asyncSupportsEmptyTermClick]="true">
108 <div class="col-lg-3">
111 <!-- /Progress Dialog Experiments ----------------------------- -->
115 <div class="row mb-3">
116 <eg-string #helloString text="Hello, {{name}}" i18n-text></eg-string>
117 <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
121 <div class="row mb-3">
122 <ng-template #helloStrTmpl let-name="name" i18n>Hello, {{name}}</ng-template>
124 <eg-string #helloStr key="helloKey" [template]="helloStrTmpl"></eg-string>
126 <eg-string key="staff.sandbox.test" [template]="helloStrTmpl"></eg-string>
127 <button class="btn btn-success" (click)="testStrings()">Test Strings</button>
131 <div class="form-group">
132 <eg-date-select (onChangeAsDate)="changeDate($event)"
133 initialYmd="2017-03-04">
136 <div>HERE: {{testDate}}</div>
141 <button class="btn btn-secondary" (click)="doPrint()">Test Print</button>
142 <ng-template #printTemplate let-context>Hello, {{context.world}}!</ng-template>
144 <button class="btn btn-secondary" (click)="printWithDialog()">Print with dialog</button>
148 <div class="col-lg-3">
149 <eg-translate #translate [idlObject]="oneBtype" fieldName="name"></eg-translate>
150 <button class="btn btn-info"
151 (click)="translate.open({size:'lg'})">Translate</button>
157 <h4>Cross-tab communications example</h4>
158 <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.
159 You should see the message that you sent to the other browser tab.</p>
162 <div class="col-lg-3">
163 <input type="text" #sendSbMessage placeholder="message to send to another tab" size="40" (change)="sendMessage($event)">
165 <div class="col-lg-3">
166 message received: {{sbChannelText}}
171 <ng-template #cellTmpl let-row="row" let-col="col" let-userContext="userContext">
172 HELLO {{userContext.hello}}
173 <button>{{row.id()}}</button>
175 <eg-grid #cbtGrid idlClass="cbt"
176 [dataSource]="btSource"
177 [rowClassCallback]="btGridRowClassCallback"
178 [rowFlairIsEnabled]="true"
179 [rowFlairCallback]="btGridRowFlairCallback"
180 [cellClassCallback]="btGridCellClassCallback"
182 <eg-grid-toolbar-action label="Action that needs a single row" i18n-label
183 (onClick)="complimentEvergreen($event)" [disableOnRows]="notOneSelectedRow">
184 </eg-grid-toolbar-action>
185 <eg-grid-toolbar-action [isSeparator]="true">
186 </eg-grid-toolbar-action>
187 <eg-grid-toolbar-action label="Another Action" i18n-label
188 (onClick)="complimentEvergreen2($event)">
189 </eg-grid-toolbar-action>
190 <eg-grid-column name="test" [cellTemplate]="cellTmpl"
191 [cellContext]="btGridTestContext" [sortable]="false">
193 <eg-grid-column [sortable]="false" path="owner.name"></eg-grid-column>
194 <eg-grid-column [sortable]="false" path="datetime_test"
195 datatype="timestamp" [datePlusTime]="true"></eg-grid-column>
200 <h4>PCRUD auto flesh and FormatService detection</h4>
201 <div *ngIf="aMetarecord">Fingerprint: {{aMetarecord}}</div>
204 <div class="card col-md-6">
205 <div class="card-body">
206 <h3 class="card-title">Do you like template-driven forms?</h3>
207 <div class="card-text">
208 <eg-org-family-select
209 [ancestorSelectorChecked]="true"
210 [hideDescendantSelector]="true"
212 labelText="Choose the best libraries"
213 ngModel #bestOnes="ngModel">
214 </eg-org-family-select>
215 The best libraries are: {{bestOnes.value | json}}
219 <form class="card col-md-6" [formGroup]="badOrgForm">
220 <div class="card-body">
221 <h3 class="card-title">Or perhaps reactive forms interest you?</h3>
222 <div class="card-text">
223 <eg-org-family-select
224 formControlName="badOrgSelector"
225 labelText="Choose the fanciest libraries">
226 </eg-org-family-select>
227 <div *ngIf="!badOrgForm.valid" class="alert alert-danger">
228 <span class="material-icons">error</span>
229 <span i18n>Too many fancy libraries!</span>