UNPKG

29.9 kBtext/x-handlebars-templateView Raw
1<!--
2 Copyright IBM Corp. 2016, 2018
3
4 This source code is licensed under the Apache-2.0 license found in the
5 LICENSE file in the root directory of this source tree.
6-->
7{{#if (not componentsX)}}
8 {{#if hasToolbar}}
9 <div class="{{@root.prefix}}--data-table-v2-container" data-table-v2>
10 <h4 class="{{@root.prefix}}--data-table-v2-header">{{title}}</h4>
11 <section class="{{@root.prefix}}--table-toolbar">
12 {{#if batchActions}}
13 <div class="{{@root.prefix}}--batch-actions" aria-label="Table Action Bar">
14 <div class="{{@root.prefix}}--action-list">
15 {{#each batchActions}}
16 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--sm {{@root.prefix}}--btn--ghost" type="button">
17 {{label}}
18 {{{icon}}}
19 </button>
20 {{/each}}
21 </div>
22 <div class="{{@root.prefix}}--batch-summary">
23 <p class="{{@root.prefix}}--batch-summary__para">{{{selectedItemsCounterLabel}}}</p>
24 <button data-event="action-bar-cancel" class="{{@root.prefix}}--batch-summary__cancel">{{cancelLabel}}</button>
25 </div>
26 </div>
27 {{/if}}
28
29 <div class="{{@root.prefix}}--toolbar-search-container">
30 <div data-search class="{{@root.prefix}}--search {{@root.prefix}}--search--sm {{@root.prefix}}--search--light" role="search">
31 <svg class="{{@root.prefix}}--search-magnifier" width="16" height="16" viewBox="0 0 16 16">
32 <path d="M6.5 12a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11zm4.936-1.27l4.563 4.557-.707.708-4.563-4.558a6.5 6.5 0 1 1 .707-.707z"
33 fill-rule="nonzero" />
34 </svg>
35 <label id="{{searchLabelId}}" class="{{@root.prefix}}--label" for="{{searchInputId}}">{{searchLabel}}</label>
36 <input class="{{@root.prefix}}--search-input" type="text" id="{{searchInputId}}" role="search" placeholder="{{searchLabel}}" aria-labelledby="{{searchLabelId}}">
37 <button class="{{@root.prefix}}--search-close {{@root.prefix}}--search-close--hidden" title="{{clearSearchLabel}}" aria-label="{{clearSearchLabel}}">
38 <svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
39 <path d="M8 6.586L5.879 4.464 4.464 5.88 6.586 8l-2.122 2.121 1.415 1.415L8 9.414l2.121 2.122 1.415-1.415L9.414 8l2.122-2.121-1.415-1.415L8 6.586zM8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"
40 fill-rule="evenodd" />
41 </svg>
42 </button>
43 </div>
44 </div>
45
46 {{#if toolbarActions}}
47 <div class="{{@root.prefix}}--toolbar-content">
48 {{#each toolbarActions}}
49 <button class="{{@root.prefix}}--toolbar-action">
50 {{{icon}}}
51 </button>
52 {{/each}}
53
54 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--sm {{@root.prefix}}--btn--primary">{{addNewLabel}}</button>
55 </div>
56 {{/if}}
57 </section>
58 {{/if}}
59
60 <table class="{{@root.prefix}}--data-table-v2{{#if zebra}} {{@root.prefix}}--data-table-v2--zebra{{/if}}{{#if small}} {{@root.prefix}}--data-table-v2--compact{{/if}}">
61 <thead>
62 <tr>
63 {{#each columns}}
64 <th>
65 {{#if checkbox}}
66 <input data-event="select-all" id="{{checkboxId}}" class="{{@root.prefix}}--checkbox" type="checkbox" value="{{checkboxValue}}" name="{{checkboxName}}">
67 <label for="{{checkboxId}}" class="{{@root.prefix}}--checkbox-label" aria-label="{{title}}"></label>
68 {{else if (not menu)}}
69 {{#if sortable}}
70 <button class="{{@root.prefix}}--table-sort-v2" data-event="sort">
71 <span class="{{@root.prefix}}--table-header-label">{{title}}</span>
72 <svg class="{{@root.prefix}}--table-sort-v2__icon" width="10" height="5" viewBox="0 0 10 5" aria-label="{{../sortLabel}}" alt="{{../sortLabel}}">
73 <title>{{../sortLabel}}</title>
74 <path d="M0 0l5 4.998L10 0z" fill-rule="evenodd" />
75 </svg>
76 </button>
77 {{else if small}}
78 {{title}}
79 {{else}}
80 <span class="{{@root.prefix}}--table-header-label">{{title}}</span>
81 {{/if}}
82 {{/if}}
83 </th>
84 {{/each}}
85 </tr>
86 </thead>
87 <tbody>
88 {{#each rows as |row|}}
89 <tr{{#if row.sectionContent}} class="{{@root.prefix}}--parent-row-v2" data-parent-row{{/if}}>
90 {{#each ../columns as |column|}}
91 {{#with (lookup row column.name) as |data|}}
92 {{#if column.section}}
93 <td class="{{@root.prefix}}--table-expand-v2" data-event="expand">
94 <button class="{{@root.prefix}}--table-expand-v2__button">
95 <svg class="{{@root.prefix}}--table-expand-v2__svg" width="7" height="12" viewBox="0 0 7 12">
96 <path fill-rule="nonzero" d="M5.569 5.994L0 .726.687 0l6.336 5.994-6.335 6.002L0 11.27z" />
97 </svg>
98 </button>
99 </td>
100 {{else if column.checkbox}}
101 <td>
102 <input data-event="select" id="{{data.id}}" class="{{@root.prefix}}--checkbox" type="checkbox" value="{{data.value}}" name="{{data.name}}">
103 <label for="{{data.id}}" class="{{@root.prefix}}--checkbox-label" aria-label="{{data.label}}"></label>
104 </td>
105 {{else if column.menu}}
106 <td class="{{@root.prefix}}--table-overflow">
107 <div data-overflow-menu tabindex="0" aria-label="{{data.label}}" class="{{@root.prefix}}--overflow-menu">
108 <svg class="{{@root.prefix}}--overflow-menu__icon" width="3" height="15" viewBox="0 0 3 15">
109 <g fill-rule="evenodd">
110 <circle cx="1.5" cy="1.5" r="1.5" />
111 <circle cx="1.5" cy="7.5" r="1.5" />
112 <circle cx="1.5" cy="13.5" r="1.5" />
113 </g>
114 </svg>
115 <ul class="{{@root.prefix}}--overflow-menu-options{{#if data.flip}} {{@root.prefix}}--overflow-menu--flip{{/if}}">
116 {{#each data.items}}
117 <li class="{{@root.prefix}}--overflow-menu-options__option{{#if danger}} {{@root.prefix}}--overflow-menu-options__option--danger{{/if}}">
118 <button class="{{@root.prefix}}--overflow-menu-options__btn" onclick="console.log('keyboard action')">{{label}}</button>
119 </li>
120 {{/each}}
121 </ul>
122 </div>
123 </td>
124 {{else if (and row.editable column.editing)}}
125 <td class="{{@root.prefix}}--data-table-cell--editable {{@root.prefix}}--data-table-cell--editing">
126 <div class="{{@root.prefix}}--data-table__edit-field">
127 <label class="{{@root.prefix}}--label" for="edit-cell:{{row.id}}:{{column.name}}">Edit Name: {{data}}</label>
128 <input type="text" class="{{@root.prefix}}--text-input" id="edit-cell:{{row.id}}:{{column.name}}" value="{{data}}">
129 </div>
130 <div class="{{@root.prefix}}--data-table__edit-actions">
131 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--secondary {{@root.prefix}}--btn--sm">{{../../../cancelLabel}}</button>
132 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary {{@root.prefix}}--btn--sm">{{../../../saveLabel}}</button>
133 </div>
134 </td>
135 {{else if column.editable}}
136 <td class="{{@root.prefix}}--data-table-cell--editable"><span class="{{@root.prefix}}--data-table-cell__content">{{data}}</span></td>
137 {{else}}
138 <td>{{data}}</td>
139 {{/if}}
140 {{/with}}
141 {{/each}}
142 </tr>
143 {{#if row.sectionContent}}
144 <tr class="{{@root.prefix}}--expandable-row-v2 {{@root.prefix}}--expandable-row--hidden-v2" data-child-row>
145 <td colspan="{{../columns.length}}">
146 {{{row.sectionContent}}}
147 </td>
148 </tr>
149 {{/if}}
150 {{/each}}
151 </tbody>
152 </table>
153
154 {{#if (not small)}}</div>{{/if}}
155 {{#if hasPager}}
156 <div class="{{@root.prefix}}--pagination" data-pagination>
157 <div class="{{@root.prefix}}--pagination__left">
158 <span class="{{@root.prefix}}--pagination__text">Items per page:</span>
159 <div class="{{@root.prefix}}--select {{@root.prefix}}--select--inline">
160 <label for="select-id-pagination" class="{{@root.prefix}}--visually-hidden">Number of items per page</label>
161 <select id="select-id-pagination" class="{{@root.prefix}}--select-input" data-items-per-page>
162 <option class="{{@root.prefix}}--select-option" value="10" selected>10</option>
163 <option class="{{@root.prefix}}--select-option" value="20">20</option>
164 <option class="{{@root.prefix}}--select-option" value="30">30</option>
165 <option class="{{@root.prefix}}--select-option" value="40">40</option>
166 <option class="{{@root.prefix}}--select-option" value="50">50</option>
167 </select>
168 <svg class="{{@root.prefix}}--select__arrow" width="10" height="5" viewBox="0 0 10 5">
169 <path d="M0 0l5 4.998L10 0z" fill-rule="evenodd" />
170 </svg>
171 </div>
172 <span class="{{@root.prefix}}--pagination__text">
173 <span>|&nbsp;</span>
174 <span data-displayed-item-range>1-10</span> of
175 <span data-total-items>40</span> items</span>
176 </div>
177 <div class="{{@root.prefix}}--pagination__right {{@root.prefix}}--pagination--inline">
178 <span class="{{@root.prefix}}--pagination__text">
179 <span data-displayed-page-number>1</span> of
180 <span data-total-pages>4</span> pages</span>
181 <button class="{{@root.prefix}}--pagination__button {{@root.prefix}}--pagination__button--backward" data-page-backward aria-label="Backward button">
182 <svg class="{{@root.prefix}}--pagination__button-icon" width="7" height="12" viewBox="0 0 7 12">
183 <path fill-rule="nonzero" d="M1.45 6.002L7 11.27l-.685.726L0 6.003 6.315 0 7 .726z" />
184 </svg>
185 </button>
186 <label for="page-number-input" class="{{@root.prefix}}--visually-hidden">Page number input</label>
187 <div class="{{@root.prefix}}--select {{@root.prefix}}--select--inline">
188 <label for="select-id-pagination" class="{{@root.prefix}}--visually-hidden">Number of items per page</label>
189 <select id="select-id-pagination" class="{{@root.prefix}}--select-input" data-page-number-input>
190 <option class="{{@root.prefix}}--select-option" value="1" selected>1</option>
191 <option class="{{@root.prefix}}--select-option" value="2">2</option>
192 <option class="{{@root.prefix}}--select-option" value="3">3</option>
193 <option class="{{@root.prefix}}--select-option" value="4">4</option>
194 <option class="{{@root.prefix}}--select-option" value="5">5</option>
195 </select>
196 <svg class="{{@root.prefix}}--select__arrow" width="10" height="5" viewBox="0 0 10 5">
197 <path d="M0 0l5 4.998L10 0z" fill-rule="evenodd" />
198 </svg>
199 </div>
200 <button class="{{@root.prefix}}--pagination__button {{@root.prefix}}--pagination__button--forward" data-page-forward aria-label="Forward button">
201 <svg class="{{@root.prefix}}--pagination__button-icon" width="7" height="12" viewBox="0 0 7 12">
202 <path fill-rule="nonzero" d="M5.569 5.994L0 .726.687 0l6.336 5.994-6.335 6.002L0 11.27z" />
203 </svg>
204 </button>
205 </div>
206 </div>
207 {{/if}}
208{{/if}}
209
210<!-- v10 Data Table -->
211{{#if componentsX}}
212 {{#if hasToolbar}}
213 <div class="{{@root.prefix}}--data-table-container {{#if sticky}}{{@root.prefix}}--data-table--max-width{{/if}}" data-table>
214 <div class="{{@root.prefix}}--data-table-header">
215 <h4 class="{{@root.prefix}}--data-table-header__title">{{title}}</h4>
216 <p class="{{@root.prefix}}--data-table-header__description">{{optionalHelper}}</p>
217 </div>
218 <!-- Toolbar Content -->
219 <section class="{{@root.prefix}}--table-toolbar {{#if small}} {{@root.prefix}}--table-toolbar--small {{/if}}">
220 {{#if batchActions}}
221 <!-- Batch actions -->
222 <div class="{{@root.prefix}}--batch-actions" aria-label="Table Action Bar">
223 <div class="{{@root.prefix}}--action-list">
224 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary" type="button">
225 Delete
226 {{ carbon-icon 'Delete16' class=(add @root.prefix '--btn__icon')}}
227 </button>
228 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary" type="button">
229 Save
230 {{ carbon-icon 'Save16' class=(add @root.prefix '--btn__icon')}}
231 </button>
232 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary" type="button">
233 Download
234 {{ carbon-icon 'Download16' class=(add @root.prefix '--btn__icon')}}
235 </button>
236 <button data-event="action-bar-cancel" class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary {{@root.prefix}}--batch-summary__cancel">{{cancelLabel}}</button>
237 </div>
238 <div class="{{@root.prefix}}--batch-summary">
239 <p class="{{@root.prefix}}--batch-summary__para">{{{selectedItemsCounterLabel}}}</p>
240 </div>
241 </div>
242 {{/if}}
243
244 {{#if toolbarActions}}
245 <div class="{{@root.prefix}}--toolbar-content">
246 <!-- Default hidden search -->
247 {{#is state "default"}}
248 <div class="{{@root.prefix}}--toolbar-search-container-expandable">
249 <div data-search class="{{@root.prefix}}--search {{@root.prefix}}--search--sm" role="search">
250 <div class="{{@root.prefix}}--search-magnifier" tabindex="0">
251 {{ carbon-icon 'Search16' class=(add @root.prefix '--toolbar-action__icon')}}
252 </div>
253 <label id="{{searchLabelId}}" class="{{@root.prefix}}--label" for="{{searchInputId}}">{{searchLabel}}</label>
254 <input class="{{@root.prefix}}--search-input" type="text" id="{{searchInputId}}" role="search" placeholder="{{searchLabel}}" aria-labelledby="{{searchLabelId}}">
255 <button class="{{@root.prefix}}--search-close {{@root.prefix}}--search-close--hidden" title="{{clearSearchLabel}}" aria-label="{{clearSearchLabel}}">
256 {{ carbon-icon 'Close16'}}
257 </button>
258 </div>
259 </div>
260 {{/is}}
261
262 <!-- Persistent Search -->
263 {{#is state "persistent-search"}}
264 <div class="{{@root.prefix}}--toolbar-search-container-persistent">
265 <div data-search class="{{@root.prefix}}--search {{@root.prefix}}--search--sm" role="search">
266 <div class="{{@root.prefix}}--search-magnifier">
267 {{ carbon-icon 'Search16'}}
268 </div>
269 <label id="{{searchLabelId}}" class="{{@root.prefix}}--label" for="{{searchInputId}}">{{searchLabel}}</label>
270 <input class="{{@root.prefix}}--search-input" type="text" id="{{searchInputId}}" role="search" placeholder="{{searchLabel}}" aria-labelledby="{{searchLabelId}}">
271 <button class="{{@root.prefix}}--search-close {{@root.prefix}}--search-close--hidden" title="{{clearSearchLabel}}" aria-label="{{clearSearchLabel}}">
272 {{ carbon-icon 'Close16'}}
273 </button>
274 </div>
275 </div>
276 {{/is}}
277
278 <!-- Toolbar Overflow Menu -->
279 {{#each toolbarActionsX as |toolbar|}}
280 <div class="{{@root.prefix}}--overflow-menu {{@root.prefix}}--toolbar-action" data-overflow-menu role="button" tabindex="0" aria-label="Overflow" aria-haspopup="true"
281 aria-expanded="false" {{#if disabled}} disabled {{/if}}>
282 {{ carbon-icon 'Settings16' class=(add @root.prefix '--toolbar-action__icon')}}
283 <ul class="{{@root.prefix}}--overflow-menu-options {{@root.prefix}}--overflow-menu--flip" tabindex="-1" role="menu" aria-label="Overflow" data-floating-menu-direction="bottom">
284 {{#each toolbar.overflowItems}}
285 <li class="{{@root.prefix}}--overflow-menu-options__option {{#if (not ../../small)}} {{@root.prefix}}--overflow-menu--data-table {{/if}}" role="presentation">
286 <button class="{{@root.prefix}}--overflow-menu-options__btn" role="menuitem" {{#if primaryFocus}} data-floating-menu-primary-focus {{/if}}>
287 <div class="{{@root.prefix}}--overflow-menu-options__option-content">
288 {{label}}
289 </div>
290 </button>
291 </li>
292 {{/each}}
293 </ul>
294 </div>
295 {{/each}}
296
297 <!-- Toolbar primary button -->
298 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--sm {{@root.prefix}}--btn--primary">
299 {{#if small }} Primary {{else}} Primary Button {{/if}}
300 {{ carbon-icon 'Add20' class=(add @root.prefix '--btn__icon') }}
301 </button>
302 </div>
303 {{/if}}
304 </section>
305 {{/if}}
306 <!-- End Toolbar Content -->
307
308 {{#if sticky}}
309 <section class="{{@root.prefix}}--data-table_inner-container">
310 {{/if}}
311 <!-- Table -->
312 <table class="{{@root.prefix}}--data-table {{#if truncate}}{{@root.prefix}}--data-table--overflow-truncate{{/if}} {{#if sticky}}{{@root.prefix}}--data-table--sticky-header{{/if}} {{#if zebra}}{{@root.prefix}}--data-table--zebra{{/if}}{{#if small}} {{@root.prefix}}--data-table--compact{{/if}} {{#if tall}}{{@root.prefix}}--data-table--tall {{/if}}{{#if sort}} {{@root.prefix}}--data-table--sort {{/if}}" >
313 <thead>
314 <tr>
315 {{#each columns}}
316 <th {{#if checkbox}} class="{{@root.prefix}}--table-column-checkbox" {{/if}}{{#if section}}class="{{@root.prefix}}--table-expand"{{/if}} {{#if numerical}} class="{{@root.prefix}}--data-table--numerical-cell" {{/if}}>
317 <!-- checkbox th -->
318 {{#if checkbox}}
319 <input data-event="select-all" id="{{checkboxId}}" class="{{@root.prefix}}--checkbox" type="checkbox" value="{{checkboxValue}}" name="{{checkboxName}}">
320 <label for="{{checkboxId}}" class="{{@root.prefix}}--checkbox-label" aria-label="{{title}}"></label>
321 {{else if (not menu)}}
322 <!-- sortable th -->
323 {{#if sortable}}
324 <button class="{{@root.prefix}}--table-sort" data-event="sort" title="{{title}}">
325 <span class="{{@root.prefix}}--table-header-label">{{title}}</span>
326 {{carbon-icon 'ArrowDown16' class=(add @root.prefix '--table-sort__icon')}}
327 {{carbon-icon 'Arrows16' class=(add @root.prefix '--table-sort__icon-unsorted')}}
328 {{#if ../truncate}}
329 <div id="label-tooltip" role="tooltip" data-floating-menu-direction="bottom" class="{{@root.prefix}}--tooltip" data-avoid-focus-on-open>
330 <span class="{{@root.prefix}}--tooltip__caret"></span>
331 <p class="{{@root.prefix}}--tooltip__text">{{title}}</p>
332 </div>
333 {{/if}}
334 </button>
335 <!-- no sort th -->
336 {{else if small}}
337 {{title}}
338 {{else}}
339 <span class="{{@root.prefix}}--table-header-label">{{title}}</span>
340 {{/if}}
341 {{/if}}
342 </th>
343 {{/each}}
344 </tr>
345 </thead>
346 <tbody>
347 {{#each rows as |row|}}
348 <tr{{#if row.sectionContent}} class="{{@root.prefix}}--parent-row" data-parent-row {{/if}} {{#if row.disabled}} class="{{@root.prefix}}--row-disabled" {{/if}}>
349 {{#each ../columns as |column|}}
350 {{#with (lookup row column.name) as |data|}}
351 <!-- expand icon td -->
352 {{#if column.section}}
353 <td class="{{@root.prefix}}--table-expand" data-event="expand">
354 <button class="{{@root.prefix}}--table-expand__button">
355 {{ carbon-icon 'ChevronRight16' class=(add @root.prefix '--table-expand__svg') }}
356 </button>
357 </td>
358 <!-- checkbox td -->
359 {{else if column.checkbox}}
360 <td class="{{@root.prefix}}--table-column-checkbox">
361 <input data-event="select" id="{{data.id}}" class="{{@root.prefix}}--checkbox" type="checkbox" value="{{data.value}}" name="{{data.name}}" {{#if row.disabled}} disabled {{/if}}>
362 <label for="{{data.id}}" class="{{@root.prefix}}--checkbox-label" aria-label="{{data.label}}"></label>
363 </td>
364 <!-- inline action td's -->
365 {{else if column.additionalIcons}}
366 <td class="{{@root.prefix}}--table-column-icon">
367 <button {{#if row.disabled}} disabled {{/if}}>
368 {{{data.svg}}}
369 </button>
370 </td>
371 <!-- overflow menu td -->
372 {{else if column.menu}}
373 <td class="{{@root.prefix}}--table-column-menu">
374 <div data-overflow-menu role="menu" tabindex="0" aria-label="{{data.label}}" class="{{@root.prefix}}--overflow-menu">
375 {{ carbon-icon 'OverflowMenuVertical16' class=(add @root.prefix '--overflow-menu__icon') }}
376 <ul class="{{@root.prefix}}--overflow-menu-options{{#if data.flip}} {{@root.prefix}}--overflow-menu--flip{{/if}}">
377
378 <li class="{{@root.prefix}}--overflow-menu-options__option {{@root.prefix}}--table-row--menu-option">
379 <button class="{{@root.prefix}}--overflow-menu-options__btn" onclick="console.log('keyboard action')">
380 <div class="{{@root.prefix}}--overflow-menu-options__option-content">
381 {{ carbon-icon 'Edit16' }} Edit
382 </div>
383 </button>
384 </li>
385 <li class="{{@root.prefix}}--overflow-menu-options__option {{@root.prefix}}--table-row--menu-option">
386 <button class="{{@root.prefix}}--overflow-menu-options__btn" onclick="console.log('keyboard action')">
387 <div class="{{@root.prefix}}--overflow-menu-options__option-content">
388 {{ carbon-icon 'Download16' }} Download
389 </div>
390 </button>
391 </li>
392 <li class="{{@root.prefix}}--overflow-menu-options__option {{@root.prefix}}--table-row--menu-option">
393 <button class="{{@root.prefix}}--overflow-menu-options__btn" onclick="console.log('keyboard action')">
394 <div class="{{@root.prefix}}--overflow-menu-options__option-content">
395 {{ carbon-icon 'Save16' }} Save
396 </div>
397 </button>
398 </li>
399 <li class="{{@root.prefix}}--overflow-menu-options__option {{@root.prefix}}--table-row--menu-option">
400 <button class="{{@root.prefix}}--overflow-menu-options__btn" onclick="console.log('keyboard action')">
401 <div class="{{@root.prefix}}--overflow-menu-options__option-content">
402 {{ carbon-icon 'Delete16' }} Delete
403 </div>
404 </button>
405 </li>
406
407 </ul>
408 </div>
409 </td>
410 <!-- inline edit tds -->
411 {{else if (and row.editable column.editing)}}
412 <td class="{{@root.prefix}}--data-table-cell--editable {{@root.prefix}}--data-table-cell--editing">
413 <div class="{{@root.prefix}}--data-table__edit-field">
414 <label class="{{@root.prefix}}--label" for="edit-cell:{{row.id}}:{{column.name}}">Edit Name: {{data}}</label>
415 <input type="text" class="{{@root.prefix}}--text-input" id="edit-cell:{{row.id}}:{{column.name}}" value="{{data}}">
416 </div>
417 <div class="{{@root.prefix}}--data-table__edit-actions">
418 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--secondary {{@root.prefix}}--btn--sm">{{../../../cancelLabel}}</button>
419 <button class="{{@root.prefix}}--btn {{@root.prefix}}--btn--primary {{@root.prefix}}--btn--sm">{{../../../saveLabel}}</button>
420 </div>
421 </td>
422 {{else if column.editable}}
423 <td class="{{@root.prefix}}--data-table-cell--editable"><span class="{{@root.prefix}}--data-table-cell__content">{{data}}</span></td>
424 <!-- all other td's -->
425 {{else}}
426 <td {{#if column.numerical}} class="{{@root.prefix}}--data-table--numerical-cell" {{/if}}>
427 <!-- truncated new markup -->
428 {{#if ../../truncate}}
429 <span class="{{@root.prefix}}--table-cell-content" aria-describedby="label-tooltip">{{data}}
430 {{#if ../../../tall }}
431 {{#if (and row.secondaryText column.secondary)}}
432 <div class="{{@root.prefix}}--data-table--cell-secondary-text">
433 {{row.secondaryText}}
434 </div>
435 {{/if}}
436 {{/if}}
437 </span>
438 <div id="label-tooltip" role="tooltip" data-floating-menu-direction="bottom" class="{{@root.prefix}}--tooltip" data-avoid-focus-on-open>
439 <span class="{{@root.prefix}}--tooltip__caret"></span>
440 <p class="{{@root.prefix}}--tooltip__text">{{data}}</p>
441 </div>
442 <!-- default (non truncated) -->
443 {{else}}
444 {{data}}
445 {{/if}}
446 </td>
447 {{/if}}
448 {{/with}}
449 {{/each}}
450 </tr>
451 <!-- Expandable child row -->
452 {{#if row.sectionContent}}
453 <tr class="{{@root.prefix}}--expandable-row {{@root.prefix}}--expandable-row--hidden" data-child-row>
454 <td colspan="{{../columns.length}}">
455 <div class="{{@root.prefix}}--child-row-inner-container">
456 {{{row.sectionContent}}}
457 </div>
458 </td>
459 </tr>
460 {{/if}}
461 {{/each}}
462 </tbody>
463 </table>
464 {{#if sticky}}
465 </section>
466 {{/if}}
467
468 {{#if (not small)}}</div>{{/if}}
469<!-- Pagination -->
470 {{#if hasPager}}
471 <div class="{{@root.prefix}}--pagination" data-pagination>
472 <div class="{{@root.prefix}}--pagination__left">
473 <label
474 id="select-id-pagination-count-label"
475 class="{{@root.prefix}}--pagination__text"
476 for="select-id-pagination-count"
477 >
478 Items per page:
479 </label>
480 <div class="{{@root.prefix}}--select {{@root.prefix}}--select--inline {{@root.prefix}}--select__item-count">
481 <select
482 class="{{@root.prefix}}--select-input"
483 id="select-id-pagination-count"
484 aria-label="select number of items per page"
485 tabindex="0"
486 data-items-per-page
487 >
488 <option class="{{@root.prefix}}--select-option" value="10" selected>10</option>
489 <option class="{{@root.prefix}}--select-option" value="20">20</option>
490 <option class="{{@root.prefix}}--select-option" value="30">30</option>
491 <option class="{{@root.prefix}}--select-option" value="40">40</option>
492 <option class="{{@root.prefix}}--select-option" value="50">50</option>
493 </select>
494 {{ carbon-icon 'ChevronDownGlyph' class=(add @root.prefix '--select__arrow') }}
495 </div>
496 <span class="{{@root.prefix}}--pagination__text">
497 <span data-displayed-item-range>1-10</span> of
498 <span data-total-items>50</span> items
499 </span>
500 </div>
501 <div class="{{@root.prefix}}--pagination__right">
502 <div class="{{@root.prefix}}--select {{@root.prefix}}--select--inline {{@root.prefix}}--select__page-number">
503 <select
504 class="{{@root.prefix}}--select-input"
505 id="select-id-pagination-page"
506 aria-label="select page number to view"
507 tabindex="0"
508 data-page-number-input
509 >
510 <option class="{{@root.prefix}}--select-option" value="1" selected>1</option>
511 <option class="{{@root.prefix}}--select-option" value="2">2</option>
512 <option class="{{@root.prefix}}--select-option" value="3">3</option>
513 <option class="{{@root.prefix}}--select-option" value="4">4</option>
514 <option class="{{@root.prefix}}--select-option" value="5">5</option>
515 </select>
516 {{ carbon-icon 'ChevronDownGlyph' class=(add @root.prefix '--select__arrow')}}
517 </div>
518 <label
519 id="select-id-pagination-page-label"
520 class="{{@root.prefix}}--pagination__text"
521 for="select-id-pagination-page"
522 >
523 of 5 pages
524 </label>
525 <button class="{{@root.prefix}}--pagination__button {{@root.prefix}}--pagination__button--backward" tabindex="0" data-page-backward aria-label="Backward button">
526 {{ carbon-icon 'CaretLeft20' class=(add @root.prefix '--pagination__nav-arrow')}}
527 </button>
528 <button class="{{@root.prefix}}--pagination__button {{@root.prefix}}--pagination__button--forward" tabindex="0" data-page-forward aria-label="Forward button">
529 {{ carbon-icon 'CaretRight20' class=(add @root.prefix '--pagination__nav-arrow')}}
530 </button>
531 </div>
532 </div>
533 {{/if}}
534{{/if}}
535
\No newline at end of file