_actions-multiselect.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. // /**
  2. // * Copyright © Magento, Inc. All rights reserved.
  3. // * See COPYING.txt for license details.
  4. // */
  5. //
  6. // Actions -> Actions multiselect
  7. // _____________________________________________
  8. //
  9. // Variables
  10. // _____________________________________________
  11. @action-multiselect-menu-item__padding: 1rem;
  12. @action-multiselect-menu-item__hover__background-color: @color-gray89;
  13. @action-multiselect-menu-item__selected__background-color: @color-blue-clear-sky;
  14. @action-multiselect-menu-item-path__color: @color-gray65-almost;
  15. // Actions
  16. @action-multiselect-menu-actions__border: 1px solid @border__color;
  17. @action-multiselect-menu-actions__padding: 1rem;
  18. // Crumbs
  19. @action-multiselect-crumb-close-action__size: 2rem;
  20. @action-multiselect-crumb__background-color: @color-white-smoke;
  21. @action-multiselect-crumb__border-color: @color-gray65-almost;
  22. // Search
  23. @action-multiselect-search-count__color: @color-gray65-almost;
  24. // Tree
  25. @action-multiselect-tree-arrow__color: @color-gray65-almost;
  26. @action-multiselect-tree-arrow__size: 2.2rem;
  27. @action-multiselect-tree-level__width: 2rem;
  28. @action-multiselect-tree-lines: @action-multiselect-tree-lines__size @action-multiselect-tree-lines__style @action-multiselect-tree-lines__color;
  29. @action-multiselect-tree-lines__color: @color-gray65-almost;
  30. @action-multiselect-tree-lines__size: 1px;
  31. @action-multiselect-tree-lines__style: dashed;
  32. @action-multiselect-tree-menu-item__margin-left: @action-multiselect-tree-arrow__size + @action-multiselect-tree-level__width;
  33. //
  34. // Multiselect default view
  35. // ---------------------------------------------
  36. .admin__action-multiselect-wrap {
  37. -moz-user-select: none;
  38. -ms-user-select: none;
  39. -webkit-user-select: none;
  40. display: block;
  41. user-select: none;
  42. &.action-select-wrap {
  43. &:focus {
  44. box-shadow: none;
  45. }
  46. .action-menu {
  47. max-height: none;
  48. overflow-y: inherit;
  49. }
  50. }
  51. .action-menu-item {
  52. transition: background-color .1s linear;
  53. &._selected {
  54. background-color: @action-multiselect-menu-item__selected__background-color;
  55. }
  56. &._hover {
  57. background-color: @action-multiselect-menu-item__hover__background-color;
  58. }
  59. &._unclickable {
  60. cursor: default;
  61. }
  62. }
  63. .admin__action-multiselect {
  64. border: 1px solid @action__border-color;
  65. cursor: pointer;
  66. display: block;
  67. min-height: @action__height;
  68. padding-right: @action__height + .4rem;
  69. white-space: normal;
  70. &:after {
  71. bottom: @action__height / 2 - @button-marker-triangle__height / 2 - .1rem;
  72. top: auto;
  73. }
  74. &:before {
  75. height: @action__height + .1rem;
  76. top: auto;
  77. }
  78. }
  79. // Multiselect inside control table
  80. .admin__control-table-wrapper & {
  81. position: static;
  82. .admin__action-multiselect {
  83. position: relative;
  84. &:before {
  85. right: -1px;
  86. top: -1px;
  87. }
  88. }
  89. .action-menu {
  90. left: auto;
  91. min-width: @field-size__m;
  92. right: auto;
  93. top: auto;
  94. z-index: 1;
  95. }
  96. }
  97. .admin__action-multiselect-item-path {
  98. color: @action-multiselect-menu-item-path__color;
  99. font-size: 1.2rem;
  100. font-weight: @font-weight__regular;
  101. padding-left: 1rem;
  102. }
  103. }
  104. .admin__action-multiselect-actions-wrap {
  105. border-top: @action-multiselect-menu-actions__border;
  106. margin: 0 @action-multiselect-menu-item__padding;
  107. padding: @action-multiselect-menu-item__padding 0;
  108. text-align: center;
  109. .action-default {
  110. font-size: 1.3rem;
  111. min-width: 13rem;
  112. }
  113. }
  114. .admin__action-multiselect-text {
  115. padding: .6rem 1rem;
  116. }
  117. .action-menu {
  118. left: 0;
  119. margin-top: 2px;
  120. right: auto;
  121. text-align: left;
  122. }
  123. .admin__action-multiselect-label {
  124. cursor: pointer;
  125. position: relative;
  126. z-index: 1;
  127. &:before {
  128. margin-right: .5rem;
  129. }
  130. ._unclickable & {
  131. cursor: default;
  132. font-weight: @font-weight__bold;
  133. }
  134. }
  135. // Multiselect search
  136. .admin__action-multiselect-search-wrap {
  137. border-bottom: @action-multiselect-menu-actions__border;
  138. margin: 0 @action-multiselect-menu-item__padding;
  139. padding: @action-multiselect-menu-item__padding 0;
  140. position: relative;
  141. }
  142. .admin__action-multiselect-search {
  143. padding-right: 3rem;
  144. width: 100%;
  145. }
  146. .admin__action-multiselect-search-label {
  147. display: block;
  148. font-size: 1.5rem;
  149. height: 1.3em;
  150. overflow: hidden;
  151. position: absolute;
  152. right: 2.2rem;
  153. top: 1.7rem;
  154. width: 1em;
  155. &:before {
  156. &:extend(.abs-icon all);
  157. content: @icon-search__content;
  158. }
  159. }
  160. .admin__action-multiselect-search-count {
  161. color: @action-multiselect-search-count__color;
  162. margin-top: 1rem;
  163. }
  164. .admin__action-multiselect-empty-area {
  165. color: @color-gray65-almost;
  166. padding-bottom: 20px;
  167. padding-top: 20px;
  168. text-align: center;
  169. vertical-align: middle;
  170. }
  171. // Multiselect inner menu
  172. .admin__action-multiselect-menu-inner {
  173. margin-bottom: 0;
  174. max-height: 46rem;
  175. overflow-y: auto;
  176. .admin__action-multiselect-menu-inner {
  177. list-style: none;
  178. max-height: none;
  179. overflow: hidden;
  180. padding-left: @action-multiselect-tree-arrow__size;
  181. }
  182. ._hidden {
  183. display: none;
  184. }
  185. }
  186. // Crumbs
  187. .admin__action-multiselect-crumb {
  188. background-color: @action-multiselect-crumb__background-color;
  189. border: 1px solid @action-multiselect-crumb__border-color;
  190. border-radius: 1px;
  191. display: inline-block;
  192. font-size: 1.2rem;
  193. margin: .3rem -4px .3rem .3rem;
  194. padding: .3rem (@action-multiselect-crumb-close-action__size + .4rem) .4rem 1rem;
  195. position: relative;
  196. transition: border-color .1s linear;
  197. &:hover {
  198. border-color: darken(@color-gray65-almost, 10%);
  199. }
  200. .action-close {
  201. bottom: 0;
  202. font-size: .5em;
  203. position: absolute;
  204. right: 0;
  205. top: 0;
  206. width: @action-multiselect-crumb-close-action__size;
  207. &:hover {
  208. color: darken(@text__color, 20%);
  209. }
  210. &:focus,
  211. &:active {
  212. background-color: transparent;
  213. }
  214. &:active {
  215. transform: scale(.9);
  216. }
  217. }
  218. }
  219. //
  220. // Multiselect tree view
  221. // ---------------------------------------------
  222. .admin__action-multiselect-tree {
  223. .action-menu {
  224. min-width: 34.7rem;
  225. .action-menu-item {
  226. margin-top: .1rem;
  227. }
  228. }
  229. .action-menu-item {
  230. margin-left: @action-multiselect-tree-menu-item__margin-left;
  231. position: relative;
  232. &._expended {
  233. // Vertical line for long titles
  234. &:before {
  235. border-left: @action-multiselect-tree-lines;
  236. bottom: 0;
  237. content: '';
  238. left: -@action-multiselect-menu-item__padding;
  239. position: absolute;
  240. top: @action-multiselect-menu-item__padding;
  241. width: 1px;
  242. }
  243. .admin__action-multiselect-dropdown {
  244. &:before {
  245. content: @icon-expand-close__content;
  246. }
  247. }
  248. }
  249. &._with-checkbox {
  250. .admin__action-multiselect-label {
  251. padding-left: @control-checkbox-radio__size + 1rem;
  252. }
  253. }
  254. }
  255. .admin__action-multiselect-menu-inner {
  256. position: relative;
  257. .admin__action-multiselect-menu-inner {
  258. padding-left: @action-multiselect-tree-menu-item__margin-left - @action-multiselect-menu-item__padding;
  259. &:before {
  260. left: @action-multiselect-menu-item__padding + @action-multiselect-tree-arrow__size + @action-multiselect-tree-arrow__size/2;
  261. }
  262. }
  263. }
  264. .admin__action-multiselect-menu-inner-item {
  265. position: relative;
  266. &:last-child {
  267. &:before {
  268. height: @action-multiselect-menu-item__padding + @action-multiselect-tree-arrow__size/2;
  269. }
  270. }
  271. &:after,
  272. &:before {
  273. content: '';
  274. left: 0;
  275. position: absolute;
  276. }
  277. // Horizontal dotted line
  278. &:after {
  279. border-top: @action-multiselect-tree-lines;
  280. height: 1px;
  281. top: @action-multiselect-menu-item__padding + @action-multiselect-tree-arrow__size/2;
  282. width: @action-multiselect-tree-menu-item__margin-left + @action-multiselect-menu-item__padding;
  283. }
  284. // Vertical dotted line
  285. &:before {
  286. border-left: @action-multiselect-tree-lines;
  287. height: 100%;
  288. top: 0;
  289. width: 1px;
  290. }
  291. &._parent {
  292. &:after {
  293. width: @action-multiselect-tree-menu-item__margin-left;
  294. }
  295. }
  296. // Top level on tree
  297. &._root {
  298. margin-left: -@action-multiselect-menu-item__padding;
  299. &:after {
  300. left: @action-multiselect-tree-arrow__size + @action-multiselect-menu-item__padding;
  301. width: @action-multiselect-tree-arrow__size;
  302. }
  303. &:before {
  304. left: @action-multiselect-tree-arrow__size + @action-multiselect-menu-item__padding;
  305. top: @action-multiselect-menu-item__padding;
  306. }
  307. &._parent {
  308. &:after {
  309. display: none;
  310. }
  311. }
  312. &:first-child {
  313. &:before {
  314. top: @action-multiselect-menu-item__padding + @action-multiselect-tree-arrow__size/2;
  315. }
  316. }
  317. &:last-child {
  318. &:before {
  319. height: @action-multiselect-menu-item__padding;
  320. }
  321. }
  322. }
  323. }
  324. .admin__action-multiselect-label {
  325. line-height: @action-multiselect-tree-arrow__size;
  326. vertical-align: middle;
  327. word-break: break-all;
  328. &:before {
  329. left: 0;
  330. position: absolute;
  331. top: .4rem;
  332. }
  333. }
  334. }
  335. // Toggle arrow
  336. .admin__action-multiselect-dropdown {
  337. border-radius: 50%;
  338. height: @action-multiselect-tree-arrow__size;
  339. left: -@action-multiselect-tree-arrow__size;
  340. position: absolute;
  341. top: @action-multiselect-menu-item__padding;
  342. width: @action-multiselect-tree-arrow__size;
  343. z-index: 1;
  344. &:before {
  345. &:extend(.abs-icon all);
  346. background: @color-white;
  347. color: @action-multiselect-tree-arrow__color;
  348. content: @icon-expand-open__content;
  349. font-size: @action-multiselect-tree-arrow__size;
  350. }
  351. }