_Attachments.scss 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. $attachment-icon-size: $button-height !default;
  2. $attachment-icon-container-width: $button-width * 2 !default;
  3. $attachment-icon-container-height: $button-height * 2 !default;
  4. $attachment-image-container-width: 100% !default;
  5. $attachment-image-container-height: auto !default;
  6. $attachment-height--loading: 150px !default;
  7. $border: 1px solid $border-color;
  8. @mixin attachments() {
  9. .esri-attachments {
  10. background-color: transparent;
  11. width: 100%;
  12. }
  13. .esri-attachments__loader-container {
  14. height: $attachment-height--loading;
  15. padding: 0;
  16. display: flex;
  17. align-items: center;
  18. justify-content: center;
  19. }
  20. .esri-attachments__loader {
  21. height: 64px;
  22. width: 100%;
  23. background: url(../base/images/loading-throb.gif) no-repeat center center;
  24. }
  25. .esri-attachments__actions {
  26. display: flex;
  27. flex-flow: row wrap;
  28. padding: $cap-spacing--half $side-spacing--half;
  29. }
  30. .esri-attachments__item-add-icon {
  31. padding: 0 $side-spacing--quarter;
  32. }
  33. .esri-attachments__delete-button {
  34. width: auto;
  35. color: $font-color--error;
  36. margin-right: auto; // RTL
  37. }
  38. .esri-attachments .esri-attachments__items {
  39. display: flex;
  40. padding: 0;
  41. margin: 0;
  42. width: 100%;
  43. }
  44. .esri-attachments .esri-attachments__item {
  45. line-height: 1.2em;
  46. list-style-type: none;
  47. margin: 0;
  48. }
  49. .esri-attachments__item-button {
  50. display: flex;
  51. align-items: center;
  52. width: 100%;
  53. background-color: $background-color;
  54. cursor: pointer;
  55. border: $border;
  56. border-color: transparent;
  57. border-radius: $border-radius;
  58. color: $interactive-font-color;
  59. text-align: unset;
  60. text-decoration: none;
  61. padding: $cap-spacing--half $side-spacing--half;
  62. margin: 0 0 $cap-spacing--half;
  63. outline-offset: -4px;
  64. transition: border-color 125ms ease-in-out;
  65. @include cardBoxShadow();
  66. &:focus,
  67. &:hover {
  68. border-color: $border-color--hover;
  69. }
  70. }
  71. .esri-attachments__item-link {
  72. display: block;
  73. position: relative;
  74. text-decoration: none;
  75. &:hover,
  76. &:focus {
  77. .esri-attachments__item-link-overlay {
  78. opacity: 1;
  79. }
  80. }
  81. }
  82. .esri-attachments__item-add {
  83. background-color: transparent;
  84. padding: $cap-spacing--half 0;
  85. }
  86. .esri-attachments__add-attachment-button {
  87. border-radius: $border-radius;
  88. font-size: $font-size--small;
  89. justify-content: flex-start;
  90. padding: $cap-spacing $side-spacing--quarter;
  91. transition: background-color 250ms ease-in-out;
  92. &:hover {
  93. background-color: $background-color;
  94. text-decoration: none;
  95. @include defaultBoxShadow();
  96. }
  97. }
  98. .esri-attachments__item-add-icon {
  99. padding: 0 $side-spacing--half;
  100. }
  101. .esri-attachments__item-link-overlay {
  102. opacity: 0;
  103. position: absolute;
  104. left: 0;
  105. top: 0;
  106. right: 0;
  107. bottom: 0;
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. pointer-events: none;
  112. user-select: none;
  113. transition: opacity 250ms ease-in-out;
  114. &-icon {
  115. background-color: rgba($background-color--inverse, 0.5);
  116. border-radius: 100%;
  117. display: flex;
  118. padding: $cap-spacing--plus-half;
  119. align-items: center;
  120. justify-content: center;
  121. svg {
  122. fill: $interactive-font-color--inverse;
  123. }
  124. }
  125. }
  126. .esri-attachments__item-mask {
  127. display: flex;
  128. overflow: hidden;
  129. position: relative;
  130. justify-content: center;
  131. align-items: center;
  132. width: $attachment-icon-container-width;
  133. height: $attachment-icon-container-height;
  134. box-shadow: 0 0 0 1px $border-color--subtle;
  135. }
  136. .esri-attachments__item-mask--icon {
  137. background-color: $background-color--offset;
  138. padding: $cap-spacing--double 0;
  139. }
  140. .esri-attachments__item-mask--icon .esri-attachments__image {
  141. width: $attachment-icon-size;
  142. height: $attachment-icon-size;
  143. }
  144. .esri-attachments__metadata {
  145. display: flex;
  146. justify-content: space-between;
  147. margin-top: $cap-spacing--quarter;
  148. .esri-attachments__metadata-fieldset {
  149. background-color: $background-color;
  150. border: none;
  151. flex: 0 1 calc(50% - 1px);
  152. font-size: $font-size--small;
  153. margin: 0;
  154. padding: $cap-spacing--half $side-spacing--half;
  155. text-align: center;
  156. }
  157. }
  158. .esri-attachments__file-name {
  159. display: inline-block;
  160. font-size: $font-size--small;
  161. margin-bottom: $cap-spacing--quarter;
  162. }
  163. .esri-attachments__file-fieldset {
  164. border: none;
  165. padding: $cap-spacing $side-spacing--half;
  166. margin: 0;
  167. }
  168. .esri-attachments__file-input {
  169. width: 0.1px;
  170. height: 0.1px;
  171. opacity: 0;
  172. overflow: hidden;
  173. position: absolute;
  174. z-index: -1;
  175. }
  176. .esri-attachments__container--list {
  177. // List
  178. .esri-attachments__items {
  179. flex-direction: column;
  180. flex-wrap: nowrap;
  181. }
  182. .esri-attachments__item-mask {
  183. flex: 0 0 auto;
  184. margin-right: $side-spacing--half;
  185. position: relative;
  186. }
  187. .esri-attachments__image {
  188. max-width: unset;
  189. max-height: unset;
  190. left: 50%;
  191. }
  192. .esri-attachments__label {
  193. display: flex;
  194. flex: 1 1 auto;
  195. justify-content: space-between;
  196. }
  197. .esri-attachments__filename {
  198. flex: 1 0 0%;
  199. cursor: pointer;
  200. @include wordbreak();
  201. }
  202. .esri-attachments__item-chevron-icon {
  203. cursor: pointer;
  204. flex: 0 0 auto;
  205. padding: 0 $side-spacing;
  206. }
  207. }
  208. .esri-attachments__container--preview {
  209. // Preview
  210. .esri-attachments__items {
  211. flex-direction: row;
  212. flex-wrap: wrap;
  213. align-items: center;
  214. }
  215. .esri-attachments__item {
  216. margin-bottom: $cap-spacing;
  217. width: 100%;
  218. }
  219. .esri-attachments__item-mask {
  220. width: $attachment-image-container-width;
  221. height: $attachment-image-container-height;
  222. }
  223. .esri-attachments__item-button {
  224. flex-flow: column nowrap;
  225. box-shadow: none;
  226. }
  227. .esri-attachments__item-button .esri-attachments__label {
  228. margin: $cap-spacing 0;
  229. }
  230. .esri-attachments__image {
  231. max-width: $attachment-image-container-width;
  232. }
  233. .esri-attachments__filename {
  234. margin-top: $cap-spacing;
  235. overflow: hidden;
  236. text-align: center;
  237. text-overflow: ellipsis;
  238. width: calc(#{$attachment-image-container-width} - #{$side-spacing});
  239. }
  240. .esri-attachments__item-mask--icon {
  241. background-color: transparent;
  242. }
  243. }
  244. .esri-attachments__form-node {
  245. // Form
  246. background-color: $background-color;
  247. padding: $cap-spacing--half $side-spacing--half;
  248. @include cardBoxShadow();
  249. .esri-attachments__item-mask {
  250. width: unset;
  251. height: unset;
  252. box-shadow: none;
  253. }
  254. .esri-attachments__image {
  255. max-width: 100%;
  256. }
  257. }
  258. .esri-attachments__error-message {
  259. padding: $cap-spacing $side-spacing;
  260. margin: $cap-spacing--half $side-spacing--half;
  261. background-color: $background-color;
  262. border-top: 3px solid $border-color--error;
  263. animation: esri-fade-in-down 250ms ease-in-out;
  264. @include defaultBoxShadow();
  265. }
  266. .esri-attachments__progress-bar {
  267. position: absolute;
  268. width: 100%;
  269. }
  270. @include loopingProgressBar(".esri-attachments__progress-bar");
  271. [dir="rtl"] {
  272. .esri-attachments__item-mask {
  273. margin-right: 0;
  274. margin-left: $side-spacing--half;
  275. }
  276. }
  277. }
  278. @if $include_Attachments == true {
  279. @include attachments();
  280. }