Tree.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512
  1. /**
  2. * @class Ext.grid.cell.Tree
  3. */
  4. /**
  5. * @var {color}
  6. * Tree Cell text color
  7. */
  8. $treecell-color: dynamic(null);
  9. /**
  10. * @var {color}
  11. * Tree Cell text color when hovered
  12. */
  13. $treecell-hovered-color: dynamic(null);
  14. /**
  15. * @var {color}
  16. * Tree Cell text color when selected
  17. */
  18. $treecell-selected-color: dynamic(null);
  19. /**
  20. * @var {color}
  21. * Tree Cell text color when pressed
  22. */
  23. $treecell-pressed-color: dynamic(null);
  24. /**
  25. * @var {color}
  26. * Tree Cell background-color
  27. */
  28. $treecell-background-color: dynamic(null);
  29. /**
  30. * @var {color}
  31. * Tree Cell background-color when hovered
  32. */
  33. $treecell-hovered-background-color: dynamic(null);
  34. /**
  35. * @var {color}
  36. * Tree Cell background-color when selected
  37. */
  38. $treecell-selected-background-color: dynamic(null);
  39. /**
  40. * @var {color}
  41. * Tree Cell background-color when pressed
  42. */
  43. $treecell-pressed-background-color: dynamic(null);
  44. /**
  45. * @var {number}
  46. * Tree Cell {@link Ext.grid.Grid#columnLines column} border-width
  47. */
  48. $treecell-column-border-width: dynamic(null);
  49. /**
  50. * @var {string}
  51. * Tree Cell {@link Ext.grid.Grid#columnLines column} border-style
  52. */
  53. $treecell-column-border-style: dynamic(null);
  54. /**
  55. * @var {color}
  56. * Tree Cell {@link Ext.grid.Grid#columnLines column} border-color
  57. */
  58. $treecell-column-border-color: dynamic(null);
  59. /**
  60. * @var {number}
  61. * Tree Cell outline-width when focused
  62. */
  63. $treecell-focused-outline-width: dynamic(null);
  64. /**
  65. * @var {string}
  66. * Tree Cell outline-style when focused
  67. */
  68. $treecell-focused-outline-style: dynamic(null);
  69. /**
  70. * @var {color}
  71. * Tree Cell outline-color when focused
  72. */
  73. $treecell-focused-outline-color: dynamic(null);
  74. /**
  75. * @var {number}
  76. * Tree Cell outline-offset when focused
  77. */
  78. $treecell-focused-outline-offset: dynamic(null);
  79. /**
  80. * @var {string/number}
  81. * Tree Cell font-weight
  82. */
  83. $treecell-font-weight: dynamic(null);
  84. /**
  85. * @var {number}
  86. * Tree Cell font-size
  87. */
  88. $treecell-font-size: dynamic(null);
  89. /**
  90. * @var {number}
  91. * Tree Cell font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  92. */
  93. $treecell-font-size-big: dynamic(null);
  94. /**
  95. * @var {number}
  96. * Tree Cell line-height
  97. */
  98. $treecell-line-height: dynamic(null);
  99. /**
  100. * @var {number}
  101. * Tree Cell line-height in the {@link Global_CSS#$enable-big big} sizing scheme
  102. */
  103. $treecell-line-height-big: dynamic(null);
  104. /**
  105. * @var {string}
  106. * Tree Cell font-family
  107. */
  108. $treecell-font-family: dynamic(null);
  109. /**
  110. * @var {number/list}
  111. * Tree Cell padding
  112. */
  113. $treecell-padding: dynamic($gridcell-padding);
  114. /**
  115. * @var {number/list}
  116. * Tree Cell padding in the {@link Global_CSS#$enable-big big} sizing scheme
  117. */
  118. $treecell-padding-big: dynamic($gridcell-padding-big);
  119. /**
  120. * @var {color}
  121. * Tree Cell icon color
  122. */
  123. $treecell-icon-color: dynamic($neutral-dark-color);
  124. /**
  125. * @var {number}
  126. * Tree Cell icon size
  127. */
  128. $treecell-icon-size: dynamic(16px);
  129. /**
  130. * @var {number}
  131. * Tree Cell icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  132. */
  133. $treecell-icon-size-big: dynamic(18px);
  134. /**
  135. * @var {number}
  136. * Tree Cell icon font-size
  137. */
  138. $treecell-icon-font-size: dynamic(null);
  139. /**
  140. * @var {number}
  141. * Tree Cell icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  142. */
  143. $treecell-icon-font-size-big: dynamic(null);
  144. /**
  145. * @var {number}
  146. * Tree Cell icon margin
  147. */
  148. $treecell-icon-margin: dynamic(0 5px);
  149. /**
  150. * @var {number}
  151. * Tree Cell icon margin in the {@link Global_CSS#$enable-big big} sizing scheme
  152. */
  153. $treecell-icon-margin-big: dynamic(0 8px);
  154. /**
  155. * @var {string}
  156. * Tree Cell branch node icon when collapsed
  157. */
  158. $treecell-collapsed-icon: dynamic($fa-var-folder);
  159. /**
  160. * @var {string}
  161. * Tree cell branch node icon when expanded
  162. */
  163. $treecell-expanded-icon: dynamic($fa-var-folder-open);
  164. /**
  165. * @var {string}
  166. * Tree Cell leaf node icon
  167. */
  168. $treecell-leaf-icon: dynamic($fa-var-file);
  169. /**
  170. * @var {string}
  171. * Tree Cell expander icon when collapsed
  172. */
  173. $treecell-expander-icon: dynamic($fa-var-caret-right);
  174. /**
  175. * @var {string}
  176. * Tree Cell expander icon when expanded
  177. */
  178. $treecell-expander-expanded-icon: dynamic($fa-var-caret-down);
  179. /**
  180. * @var {color}
  181. * Tree Cell expander icon color
  182. */
  183. $treecell-expander-color: dynamic($treecell-icon-color);
  184. /**
  185. * @var {number}
  186. * Tree Cell expander icon size
  187. */
  188. $treecell-expander-size: dynamic($treecell-icon-size);
  189. /**
  190. * @var {number}
  191. * Tree Cell expander icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  192. */
  193. $treecell-expander-size-big: dynamic($treecell-icon-size-big);
  194. /**
  195. * @var {number}
  196. * Tree Cell expander icon font-size
  197. */
  198. $treecell-expander-font-size: dynamic(null);
  199. /**
  200. * @var {number}
  201. * Tree Cell expander icon font-size in the {@link Global_CSS#$enable-big big} sizing schem
  202. */
  203. $treecell-expander-font-size-big: dynamic(null);
  204. /**
  205. * Creates a visual theme for a Tree Cell.
  206. *
  207. * @param {string} $ui
  208. * The name of the UI being created. Can not included spaces or special punctuation
  209. * (used in CSS class names).
  210. *
  211. * @param {String} [$xtype=gridcell] (protected) The {@link Ext.Class#xtype} to use
  212. * in CSS selectors. For use by UI mixins of derived classes.
  213. *
  214. * @param {color} $color
  215. * Tree Cell text color
  216. *
  217. * @param {color} $hovered-color
  218. * Tree Cell text color when hovered
  219. *
  220. * @param {color} $selected-color
  221. * Tree Cell text color when selected
  222. *
  223. * @param {color} $pressed-color
  224. * Tree Cell text color when pressed
  225. *
  226. * @param {color} $background-color
  227. * Tree Cell background-color
  228. *
  229. * @param {color} $hovered-background-color
  230. * Tree Cell background-color when hovered
  231. *
  232. * @param {color} $selected-background-color
  233. * Tree Cell background-color when selected
  234. *
  235. * @param {color} $pressed-background-color
  236. * Tree Cell background-color when pressed
  237. *
  238. * @param {number} $column-border-width
  239. * Tree Cell {@link Ext.grid.Grid#columnLines column} border-width
  240. *
  241. * @param {string} $column-border-style
  242. * Tree Cell {@link Ext.grid.Grid#columnLines column} border-style
  243. *
  244. * @param {color} $column-border-color
  245. * Tree Cell {@link Ext.grid.Grid#columnLines column} border-color
  246. *
  247. * @param {number} $focused-outline-width
  248. * Tree Cell outline-width when focused
  249. *
  250. * @param {string} $focused-outline-style
  251. * Tree Cell outline-style when focused
  252. *
  253. * @param {color} $focused-outline-color
  254. * Tree Cell outline-color when focused
  255. *
  256. * @param {number} $focused-outline-offset
  257. * Tree Cell outline-offset when focused
  258. *
  259. * @param {string/number} $font-weight
  260. * Tree Cell font-weight
  261. *
  262. * @param {number} $font-size
  263. * Tree Cell font-size
  264. *
  265. * @param {number} $font-size-big
  266. * Tree Cell font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  267. *
  268. * @param {number} $line-height
  269. * Tree Cell line-height
  270. *
  271. * @param {number} $line-height-big
  272. * Tree Cell line-height in the {@link Global_CSS#$enable-big big} sizing scheme
  273. *
  274. * @param {string} $font-family
  275. * Tree Cell font-family
  276. *
  277. * @param {number/list} $padding
  278. * Tree Cell padding
  279. *
  280. * @param {number/list} $padding-big
  281. * Tree Cell padding in the {@link Global_CSS#$enable-big big} sizing scheme
  282. *
  283. * @param {color} $icon-color
  284. * Tree Cell icon color
  285. *
  286. * @param {number} $icon-size
  287. * Tree Cell icon size
  288. *
  289. * @param {number} $icon-size-big
  290. * Tree Cell icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  291. *
  292. * @param {number} $icon-font-size
  293. * Tree Cell icon font-size
  294. *
  295. * @param {number} $icon-font-size-big
  296. * Tree Cell icon font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  297. *
  298. * @param {number} $icon-margin
  299. * Tree Cell icon margin
  300. *
  301. * @param {number} $icon-margin-big
  302. * Tree Cell icon margin in the {@link Global_CSS#$enable-big big} sizing scheme
  303. *
  304. * @param {string} $collapsed-icon
  305. * Tree Cell branch node icon when collapsed
  306. *
  307. * @param {string} $expanded-icon
  308. * Tree cell branch node icon when expanded
  309. *
  310. * @param {string} $leaf-icon
  311. * Tree Cell leaf node icon
  312. *
  313. * @param {string} $expander-icon
  314. * Tree Cell expander icon when collapsed
  315. *
  316. * @param {string} $expander-expanded-icon
  317. * Tree Cell expander icon when expanded
  318. *
  319. * @param {color} $expander-color
  320. * Tree Cell expander icon color
  321. *
  322. * @param {number} $expander-size
  323. * Tree Cell expander icon size
  324. *
  325. * @param {number} $expander-size-big
  326. * Tree Cell expander icon size in the {@link Global_CSS#$enable-big big} sizing scheme
  327. *
  328. * @param {number} $expander-font-size
  329. * Tree Cell expander icon font-size
  330. *
  331. * @param {number} $expander-font-size-big
  332. * Tree Cell expander icon font-size in the {@link Global_CSS#$enable-big big} sizing schem
  333. */
  334. @mixin treecell-ui(
  335. $ui: null,
  336. $xtype: treecell,
  337. $color: null,
  338. $hovered-color: null,
  339. $selected-color: null,
  340. $pressed-color: null,
  341. $background-color: null,
  342. $hovered-background-color: null,
  343. $selected-background-color: null,
  344. $pressed-background-color: null,
  345. $column-border-width: null,
  346. $column-border-style: null,
  347. $column-border-color: null,
  348. $focused-outline-width: null,
  349. $focused-outline-style: null,
  350. $focused-outline-color: null,
  351. $focused-outline-offset: null,
  352. $font-weight: null,
  353. $font-size: null,
  354. $font-size-big: null,
  355. $line-height: null,
  356. $line-height-big: null,
  357. $font-family: null,
  358. $padding: null,
  359. $padding-big: null,
  360. $icon-color: null,
  361. $icon-size: null,
  362. $icon-size-big: null,
  363. $icon-font-size: null,
  364. $icon-font-size-big: null,
  365. $icon-margin: null,
  366. $icon-margin-big: null,
  367. $collapsed-icon: null,
  368. $expanded-icon: null,
  369. $leaf-icon: null,
  370. $expander-icon: null,
  371. $expander-expanded-icon: null,
  372. $expander-color: null,
  373. $expander-size: null,
  374. $expander-size-big: null,
  375. $expander-font-size: null,
  376. $expander-font-size-big: null
  377. ) {
  378. $ui-suffix: ui-suffix($ui);
  379. $arguments: intersect-arguments(treecell-ui, gridcell-ui);
  380. $arguments: map-merge($arguments, (
  381. // Padding has special handling in the treecell-ui mixin. Null out any padding
  382. // values to prevent gridcell-ui mixin from generating padding styles
  383. padding: null,
  384. padding-big: null
  385. ));
  386. @include gridcell-ui($arguments...);
  387. .#{$prefix}#{$xtype}#{$ui-suffix} {
  388. padding: box(0 right($padding) 0 left($padding));
  389. @if $enable-big {
  390. .#{$prefix}big & {
  391. padding: box(0 right($padding-big) 0 left($padding-big));
  392. }
  393. }
  394. .#{$prefix}expander-el {
  395. @include icon(
  396. $icon: $expander-icon,
  397. $color: $expander-color,
  398. $size: $expander-size,
  399. $size-big: $expander-size-big,
  400. $font-size: $expander-font-size,
  401. $font-size-big: $expander-font-size-big
  402. );
  403. }
  404. &.#{$prefix}expanded .#{$prefix}expander-el {
  405. @include icon($expander-expanded-icon);
  406. }
  407. .#{$prefix}icon-el {
  408. @include icon(
  409. $color: $icon-color,
  410. $size: $icon-size,
  411. $size-big: $icon-size-big,
  412. $font-size: $icon-font-size,
  413. $font-size-big: $icon-font-size-big
  414. );
  415. margin: $icon-margin;
  416. @if $enable-big {
  417. .#{$prefix}big & {
  418. margin: $icon-margin-big;
  419. }
  420. }
  421. }
  422. // When no iconCls present, use folders
  423. &.#{$prefix}no-icon {
  424. .#{$prefix}icon-el {
  425. @include icon($collapsed-icon);
  426. }
  427. &.#{$prefix}expanded .#{$prefix}icon-el {
  428. @include icon($expanded-icon);
  429. }
  430. &.#{$prefix}leaf .#{$prefix}icon-el {
  431. @include icon($leaf-icon);
  432. }
  433. }
  434. // The indentation quantum for tree node levels is passed into a readable style.
  435. // Some browsers (FF, IE) don't support reading background-position-x
  436. background-position: ($expander-size + (left($icon-margin) or 0)) 0%;
  437. @if $enable-big {
  438. .x-big & {
  439. background-position: ($expander-size-big + (left($icon-margin-big) or 0)) 0%;
  440. }
  441. }
  442. }
  443. .#{$prefix}#{$xtype}#{$ui-suffix}-body-el,
  444. .#{$prefix}#{$xtype}#{$ui-suffix}-tool-dock > .#{$prefix}body-el {
  445. padding: box(top($padding) 0 bottom($padding) 0);
  446. @if $enable-big {
  447. .#{$prefix}big & {
  448. padding: box(top($padding-big) 0 bottom($padding-big) 0);
  449. }
  450. }
  451. }
  452. }