table-generator.less 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. @table-generator-active-border-color: #666;
  2. @table-generator-inactive-border-color: #dedede;
  3. @table-generator-focus-border-width: 2px;
  4. @table-generator-focus-negative-border-width: -2px;
  5. @table-generator-focus-border-color: #97b6e5;
  6. @table-generator-selector-hover-color: #3265b2;
  7. @table-generator-selector-handle-buffer: 12px;
  8. @table-generator-toolbar-shadow-color: #1e253029;
  9. @table-generator-toolbar-background: #fff;
  10. @table-generator-inactive-border-width: 1px;
  11. @table-generator-active-border-width: 1px;
  12. .table-generator-cell {
  13. border: @table-generator-inactive-border-width dashed
  14. @table-generator-inactive-border-color;
  15. min-width: 40px;
  16. height: 30px;
  17. }
  18. .table-generator-cell-border-left {
  19. border-left-style: solid;
  20. border-left-color: @table-generator-active-border-color;
  21. border-left-width: @table-generator-active-border-width;
  22. }
  23. .table-generator-cell-border-right {
  24. border-right-style: solid;
  25. border-right-color: @table-generator-active-border-color;
  26. border-right-width: @table-generator-active-border-width;
  27. }
  28. .table-generator-row-border-top {
  29. border-top-style: solid;
  30. border-top-color: @table-generator-active-border-color;
  31. border-top-width: @table-generator-active-border-width;
  32. }
  33. .table-generator-row-border-bottom {
  34. border-bottom-style: solid;
  35. border-bottom-color: @table-generator-active-border-color;
  36. border-bottom-width: @table-generator-active-border-width;
  37. }
  38. .table-generator-cell.selected {
  39. background-color: @blue-10;
  40. }
  41. .table-generator-cell:focus-visible {
  42. outline: 2px dotted @table-generator-focus-border-color;
  43. }
  44. .table-generator-cell {
  45. &.selection-edge-top {
  46. --shadow-top: 0 @table-generator-focus-negative-border-width 0
  47. @table-generator-focus-border-color;
  48. }
  49. &.selection-edge-bottom {
  50. --shadow-bottom: 0 @table-generator-focus-border-width 0
  51. @table-generator-focus-border-color;
  52. }
  53. &.selection-edge-left {
  54. --shadow-left: @table-generator-focus-negative-border-width 0 0
  55. @table-generator-focus-border-color;
  56. }
  57. &.selection-edge-right {
  58. --shadow-right: @table-generator-focus-border-width 0 0
  59. @table-generator-focus-border-color;
  60. }
  61. box-shadow: var(--shadow-top, 0 0 0 transparent),
  62. var(--shadow-bottom, 0 0 0 transparent),
  63. var(--shadow-left, 0 0 0 transparent),
  64. var(--shadow-right, 0 0 0 transparent);
  65. }
  66. .table-generator-table {
  67. table-layout: fixed;
  68. max-width: 80%;
  69. margin: 0 auto;
  70. cursor: default;
  71. & td {
  72. padding: 0 0.25em;
  73. max-width: 200px;
  74. &.alignment-left {
  75. text-align: left;
  76. }
  77. &.alignment-right {
  78. text-align: right;
  79. }
  80. &.alignment-center {
  81. text-align: center;
  82. }
  83. &.alignment-paragraph {
  84. text-align: justify;
  85. }
  86. }
  87. .table-generator-selector-cell {
  88. padding: 0;
  89. border: none !important;
  90. position: relative;
  91. cursor: pointer;
  92. &.row-selector {
  93. width: @table-generator-selector-handle-buffer + 8px;
  94. &::after {
  95. width: 4px;
  96. height: calc(100% - 8px);
  97. }
  98. }
  99. &.column-selector {
  100. height: @table-generator-selector-handle-buffer + 8px;
  101. &::after {
  102. width: calc(100% - 8px);
  103. height: 4px;
  104. }
  105. }
  106. &::after {
  107. content: '';
  108. display: block;
  109. position: absolute;
  110. bottom: 4px;
  111. right: 4px;
  112. width: calc(100% - 8px);
  113. height: calc(100% - 8px);
  114. background-color: @neutral-30;
  115. border-radius: 4px;
  116. }
  117. &:hover::after {
  118. background-color: @neutral-40;
  119. }
  120. &.fully-selected::after {
  121. background-color: @table-generator-selector-hover-color;
  122. }
  123. }
  124. }
  125. .table-generator {
  126. position: relative;
  127. }
  128. .table-generator-floating-toolbar {
  129. position: absolute;
  130. top: -36px;
  131. left: 0;
  132. right: 0;
  133. margin: 0 auto;
  134. z-index: 1;
  135. border-radius: 4px;
  136. width: max-content;
  137. background-color: @table-generator-toolbar-background;
  138. box-shadow: 0px 2px 4px 0px @table-generator-toolbar-shadow-color;
  139. padding: 4px;
  140. height: 40px;
  141. display: flex;
  142. }
  143. .table-generator-toolbar-button {
  144. display: inline-flex;
  145. align-items: center;
  146. justify-content: center;
  147. margin: 0;
  148. background-color: transparent;
  149. border: none;
  150. border-radius: 4px;
  151. line-height: 1;
  152. overflow: hidden;
  153. color: @neutral-70;
  154. text-align: center;
  155. padding: 4px;
  156. &:not(:first-child) {
  157. margin-left: 4px;
  158. }
  159. &:not(:last-child) {
  160. margin-right: 4px;
  161. }
  162. & > span {
  163. font-size: 24px;
  164. }
  165. &:hover,
  166. &:focus {
  167. background-color: rgba(47, 58, 76, 0.08);
  168. }
  169. &:active,
  170. &.active {
  171. background-color: rgba(47, 58, 76, 0.16);
  172. }
  173. &:hover,
  174. &:focus,
  175. &:active,
  176. &.active {
  177. color: inherit;
  178. box-shadow: none;
  179. }
  180. &[aria-disabled='true'] {
  181. &:hover,
  182. &:focus,
  183. &:active,
  184. &.active {
  185. background-color: transparent;
  186. }
  187. color: @neutral-40;
  188. }
  189. }
  190. .table-generator-button-group {
  191. display: inline-flex;
  192. align-items: center;
  193. justify-content: center;
  194. line-height: 1;
  195. overflow: hidden;
  196. &:not(:first-child) {
  197. border-left: 1px solid @neutral-20;
  198. padding-left: 8px;
  199. margin-left: 8px;
  200. }
  201. }
  202. .table-generator-button-menu-popover {
  203. .popover-content {
  204. padding: 4px;
  205. }
  206. .list-group {
  207. margin: 0;
  208. padding: 0;
  209. }
  210. & > .arrow {
  211. display: none;
  212. }
  213. }
  214. .table-generator-cell-input {
  215. max-width: calc(200px - 0.5em);
  216. width: 100%;
  217. background-color: transparent;
  218. border: 1px solid @table-generator-toolbar-shadow-color;
  219. border: 0;
  220. padding: 0;
  221. }
  222. .table-generator-border-options-coming-soon {
  223. display: flex;
  224. margin: 4px;
  225. font-size: 12px;
  226. background: @neutral-10;
  227. color: @neutral-70;
  228. padding: 8px;
  229. gap: 6px;
  230. align-items: flex-start;
  231. max-width: 240px;
  232. & .info-icon {
  233. flex: 0 0 24px;
  234. }
  235. }
  236. .table-generator-toolbar-dropdown-toggle {
  237. border: 1px solid @neutral-60;
  238. box-shadow: none;
  239. background: transparent;
  240. white-space: nowrap;
  241. color: inherit;
  242. border-radius: 4px;
  243. padding: 6px 8px;
  244. gap: 8px;
  245. min-width: 120px;
  246. font-size: 14px;
  247. display: flex;
  248. align-items: center;
  249. justify-content: space-between;
  250. font-family: @font-family-sans-serif;
  251. &:not(:first-child) {
  252. margin-left: 8px;
  253. }
  254. &[aria-disabled='true'] {
  255. background-color: #f2f2f2;
  256. color: @neutral-40;
  257. }
  258. }
  259. .table-generator-toolbar-dropdown-popover {
  260. max-width: 300px;
  261. .popover-content {
  262. padding: 0;
  263. }
  264. & > .arrow {
  265. display: none;
  266. }
  267. }
  268. .table-generator-toolbar-dropdown-menu {
  269. display: flex;
  270. flex-direction: column;
  271. min-width: 200px;
  272. & > button {
  273. border: none;
  274. box-shadow: none;
  275. background: transparent;
  276. white-space: nowrap;
  277. color: inherit;
  278. border-radius: 0;
  279. font-size: 14px;
  280. display: flex;
  281. align-items: center;
  282. justify-content: space-between;
  283. column-gap: 8px;
  284. align-self: stretch;
  285. padding: 12px 8px;
  286. font-family: @font-family-sans-serif;
  287. .table-generator-button-label {
  288. align-self: stretch;
  289. flex: 1 0 auto;
  290. text-align: left;
  291. }
  292. &:hover,
  293. &:focus {
  294. background-color: rgba(47, 58, 76, 0.08);
  295. }
  296. &:active,
  297. &.active {
  298. background-color: rgba(47, 58, 76, 0.16);
  299. }
  300. &:hover,
  301. &:focus,
  302. &:active,
  303. &.active {
  304. color: inherit;
  305. box-shadow: none;
  306. }
  307. &[aria-disabled='true'] {
  308. &:hover,
  309. &:focus,
  310. &:active,
  311. &.active {
  312. background-color: transparent;
  313. }
  314. color: @neutral-40;
  315. }
  316. }
  317. & > hr {
  318. background: @neutral-20;
  319. margin: 2px 8px;
  320. display: block;
  321. box-sizing: content-box;
  322. border: 0;
  323. height: 1px;
  324. }
  325. }
  326. .table-generator-error {
  327. background: linear-gradient(0deg, #f9f1f1, #f9f1f1),
  328. linear-gradient(0deg, #f5beba, #f5beba);
  329. display: flex;
  330. justify-content: space-between;
  331. color: black;
  332. border: 1px solid #f5beba;
  333. font-family: @font-family-sans-serif;
  334. margin-bottom: 0;
  335. .table-generator-error-message {
  336. flex: 1 0 auto;
  337. }
  338. .table-generator-error-icon {
  339. color: #b83a33;
  340. margin-right: 12px;
  341. }
  342. }
  343. .table-generator-filler-row {
  344. border: none !important;
  345. td {
  346. min-width: 40px;
  347. }
  348. }