_search.scss 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. .search-page-nav {
  2. background-color: #f7f7f7;
  3. }
  4. .search-group-submit-button {
  5. position: absolute;
  6. top: 0;
  7. right: 0;
  8. z-index: 3;
  9. display: flex;
  10. align-items: center;
  11. justify-content: center;
  12. width: 32px;
  13. height: 32px;
  14. }
  15. .search-listpage-clear {
  16. position: absolute;
  17. right: 8px;
  18. display: none;
  19. width: 22px;
  20. height: 22px;
  21. padding: 8px;
  22. font-size: 0.6em;
  23. color: $gray-300;
  24. }
  25. .search-typeahead {
  26. position: relative;
  27. width: 100%;
  28. .search-clear {
  29. position: absolute;
  30. top: 5px;
  31. right: 4px;
  32. z-index: 3;
  33. width: 24px;
  34. height: 24px;
  35. padding: 0;
  36. color: $gray-400;
  37. }
  38. .rbt-menu {
  39. max-height: none !important;
  40. margin-top: 3px;
  41. li a span {
  42. .page-path {
  43. display: inline;
  44. padding: 0 4px;
  45. color: inherit;
  46. }
  47. .page-list-meta {
  48. font-size: 0.9em;
  49. color: $gray-400;
  50. > span {
  51. margin-right: 0.3rem;
  52. }
  53. }
  54. }
  55. }
  56. }
  57. // input styles
  58. .grw-global-search {
  59. .search-clear {
  60. top: 3px;
  61. right: 26px;
  62. }
  63. .dropdown-toggle {
  64. min-width: 95px;
  65. padding-left: 1.5rem;
  66. }
  67. .search-typeahead {
  68. // corner radius
  69. border-top-right-radius: $border-radius;
  70. border-bottom-right-radius: $border-radius;
  71. .rbt-input-main {
  72. padding-right: 58px;
  73. // corner radius
  74. border-top-right-radius: $border-radius;
  75. border-bottom-right-radius: $border-radius;
  76. }
  77. .rbt-menu {
  78. @extend .dropdown-menu-right;
  79. @extend .dropdown-menu-md-left;
  80. @include media-breakpoint-down(sm) {
  81. left: auto !important;
  82. width: 90vw;
  83. }
  84. }
  85. }
  86. // using react-bootstrap-typeahead
  87. // see: https://github.com/ericgio/react-bootstrap-typeahead
  88. .rbt-input.form-control {
  89. height: 30px;
  90. .rbt-input-wrapper {
  91. margin-left: 8px;
  92. }
  93. }
  94. .form-group:not(.has-error) {
  95. .rbt-input.form-control {
  96. border: none;
  97. }
  98. }
  99. .btn-group-submit-search {
  100. @extend .search-group-submit-button;
  101. }
  102. }
  103. .grw-search-form-in-search-result-page {
  104. .btn-group-submit-search {
  105. @extend .search-group-submit-button;
  106. }
  107. button {
  108. &:focus {
  109. box-shadow: none !important;
  110. }
  111. }
  112. }
  113. // layout
  114. .grw-global-search-top {
  115. // centering on navbar
  116. top: $grw-navbar-height / 2;
  117. left: 50vw;
  118. z-index: $zindex-fixed + 1;
  119. transform: translate(-50%, -50%);
  120. .rbt-input.form-control {
  121. width: 200px;
  122. transition: 0.3s ease-out;
  123. // focus
  124. &.focus {
  125. width: 300px;
  126. }
  127. @include media-breakpoint-up(md) {
  128. width: 300px;
  129. }
  130. @include media-breakpoint-up(lg) {
  131. // focus
  132. &.focus {
  133. width: 400px;
  134. }
  135. }
  136. @include media-breakpoint-up(xl) {
  137. width: 350px;
  138. // focus
  139. &.focus {
  140. width: 450px;
  141. }
  142. }
  143. }
  144. }
  145. // TODO : keep the selected list in the same positino as other lists
  146. // TASK : https://redmine.weseek.co.jp/issues/82470
  147. .search-result {
  148. .search-result-list {
  149. position: sticky;
  150. top: 0px;
  151. .search-result-list-scroll {
  152. // subtract the height of SearchControl component + a gap made above #page-wrapper and below #main
  153. height: calc(100vh - 117px);
  154. overflow-y: scroll;
  155. }
  156. .nav.nav-pills {
  157. > .page-list-li {
  158. &.active {
  159. border-left: solid 3px transparent;
  160. .search-item-checkbox {
  161. // subtract 3px from padding left applied by .search-item-checkbox
  162. // as 3px of border-left is added above
  163. padding-left: 4px !important;
  164. }
  165. }
  166. > a {
  167. word-break: break-all;
  168. &:hover {
  169. color: inherit;
  170. text-decoration: none;
  171. }
  172. > * {
  173. margin-right: 3px;
  174. }
  175. }
  176. .page-list-meta {
  177. .meta-icon {
  178. width: 14px;
  179. height: 14px;
  180. margin-right: 14px;
  181. }
  182. .footstamp-icon {
  183. margin-right: 2px;
  184. }
  185. }
  186. }
  187. }
  188. .search-result-item {
  189. min-height: 136px;
  190. }
  191. .search-result-meta {
  192. font-weight: bold;
  193. }
  194. .search-result-select-group {
  195. > select {
  196. max-width: 8rem;
  197. }
  198. }
  199. .search-result-list-delete-checkbox {
  200. margin: 0 10px 0 0;
  201. vertical-align: middle;
  202. }
  203. }
  204. .search-item-text {
  205. .picture-sm {
  206. width: 20px;
  207. height: 20px;
  208. }
  209. .item-meta {
  210. .top-label {
  211. display: none; // not show top label
  212. }
  213. }
  214. }
  215. .search-result-content {
  216. padding-bottom: 36px;
  217. .search-result-page {
  218. padding-top: 64px;
  219. // adjust for anchor links by the height of fixed .search-page-input
  220. margin-top: -64px;
  221. > h2 {
  222. margin-right: 10px;
  223. font-size: 22px;
  224. line-height: 1em;
  225. }
  226. &:first-child > h2 {
  227. margin-top: 0;
  228. }
  229. .wiki {
  230. padding: 16px;
  231. font-size: 13px;
  232. border: solid 1px $gray-300;
  233. }
  234. }
  235. }
  236. }
  237. // class to add to .grw-navbar to hide its navbar above the displaying page
  238. body.on-search {
  239. .grw-navbar {
  240. position: fixed !important;
  241. width: 100vw;
  242. }
  243. .page-wrapper {
  244. position: relative;
  245. top: $grw-navbar-border-width;
  246. }
  247. }
  248. // 2021/9/22 TODO: Remove after moving to SearchResult
  249. .search-page-input {
  250. position: sticky;
  251. top: 15px;
  252. // placed at front-most
  253. z-index: 15;
  254. margin-bottom: 15px;
  255. .input-group-btn .btn {
  256. height: 34px;
  257. padding: 0px 10px;
  258. }
  259. }
  260. // support for your search
  261. .grw-search-table {
  262. caption {
  263. display: table-header-group;
  264. }
  265. }
  266. @include media-breakpoint-down(sm) {
  267. .grw-search-table {
  268. th {
  269. text-align: right;
  270. }
  271. td {
  272. overflow-wrap: anywhere;
  273. white-space: normal !important;
  274. }
  275. @include media-breakpoint-down(xs) {
  276. th,
  277. td {
  278. display: block;
  279. }
  280. th {
  281. text-align: left;
  282. }
  283. td {
  284. padding-top: 0 !important;
  285. border-top: none !important;
  286. }
  287. }
  288. }
  289. }