Lines Matching refs:item
10 return function (item) { argument
11 return renderValue(item, values)
21 function preType (item) { argument
22 var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1)
26 function postType (item) { argument
27 var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1)
31 function hasPreOrPost (item, values) { argument
32 if (!item.type) return
33 return values[preType(item)] || values[postType(item)]
37 var item = objectAssign({}, baseItem)
40 var pre = preType(item)
41 var post = postType(item)
46 item.minLength = null
47 item.length = null
48 item.maxLength = null
49 template.push(item)
50 values[item.type] = values[item.type]
61 function cloneAndObjectify (item, index, arr) { argument
62 var cloned = new TemplateItem(item, width)
83 var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) argument
95 function finishSizing (item, length) { argument
96 …if (item.finished) throw new error.Internal('Tried to finish template item that was already finish…
98 if (length != null) item.length = length
99 item.minLength = null
100 item.maxLength = null
102 item.finished = true
103 if (item.length == null) item.length = item.getBaseLength()
104 if (item.length == null) throw new error.Internal('Finished template items must have a length')
105 consumeSpace(item.getLength())
108 output.forEach(function (item) { argument
109 if (!item.kerning) return
110 var prevPadRight = item.first ? 0 : output[item.index - 1].padRight
111 if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight
112 if (!item.last) item.padRight = item.kerning
116 output.forEach(function (item) { argument
117 if (item.getBaseLength() == null) return
118 finishSizing(item)
127 output.forEach(function (item) { argument
128 if (item.finished) return
129 if (!item.maxLength) return
130 if (item.getMaxLength() < hunkSize) {
131 finishSizing(item, item.maxLength)
142 output.forEach(function (item) { argument
143 if (item.finished) return
144 if (!item.minLength) return
145 if (item.getMinLength() >= hunkSize) {
146 finishSizing(item, item.minLength)
154 output.forEach(function (item) { argument
155 if (item.finished) return
156 finishSizing(item, hunkSize)
162 function renderFunction (item, values, length) { argument
164 if (item.type) {
165 return item.value(values, values[item.type + 'Theme'] || {}, length)
167 return item.value(values, {}, length)
171 function renderValue (item, values) { argument
172 var length = item.getBaseLength()
173 var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value
175 var alignWith = align[item.align] || align.left
176 var leftPadding = item.padLeft ? align.left('', item.padLeft) : ''
177 var rightPadding = item.padRight ? align.right('', item.padRight) : ''