forked from Neovici/cosmoz-omnitable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcosmoz-omnitable-header-row.html
61 lines (49 loc) · 1.29 KB
/
cosmoz-omnitable-header-row.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="cosmoz-omnitable-repeater-behavior.html">
<dom-module id="cosmoz-omnitable-header-row">
<template>
<style>
:host {
@apply --layout-horizontal;
@apply --layout-end;
}
:host > ::slotted(*) {
@apply --layout-flex;
padding: 0 3px;
white-space: nowrap;
text-overflow: ellipsis;
}
:host > ::slotted([hidden]),:host [hidden] {
display: none !important;
}
</style>
<slot name="header-cell"></slot>
</template>
</dom-module>
<script>
(function () {
'use strict';
Polymer({
is: 'cosmoz-omnitable-header-row',
behaviors: [
Cosmoz.OmnitableRepeaterBehavior
],
_elementType: 'div',
_slotName: 'header-cell',
_getTemplateInstance: function (column) {
return column.headerTemplatizer.getInstance();
},
_detachTemplateInstance: function (instance, column, element) {
column.headerTemplatizer.detachInstance(instance, element);
},
_configureElement: function (element, column) {
this.toggleClass(column.headerCellClass, true, element);
this.toggleClass('header-cell', true, element);
element.setAttribute('title', column.title);
},
_configureTemplateInstance: function (instance) {
this._forwardPropertiesFlush(instance);
}
});
}());
</script>