goblin-gadgets 3.2.2 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/.editorconfig +9 -9
  2. package/.eslintrc.js +28 -28
  3. package/.zou-flow +2 -2
  4. package/builders/builders.js +5 -5
  5. package/builders/gadget.js +85 -85
  6. package/calendar-boards-gadget.js +64 -64
  7. package/demo-gadget.js +17 -17
  8. package/glyphs-dialog.js +13 -13
  9. package/login-dialog.js +13 -13
  10. package/package.json +46 -46
  11. package/pivot-gadget.js +18 -18
  12. package/stack-navigation.js +13 -13
  13. package/table-gadget.js +102 -102
  14. package/test/code-parser.spec.js +61 -61
  15. package/tree-gadget.js +70 -70
  16. package/types/types.js +455 -455
  17. package/widgets/accordion/styles.js +16 -16
  18. package/widgets/accordion/widget.js +90 -90
  19. package/widgets/analog-clock/props.js +102 -102
  20. package/widgets/analog-clock/scenarios.js +43 -43
  21. package/widgets/analog-clock/styles.js +754 -754
  22. package/widgets/analog-clock/widget.js +404 -404
  23. package/widgets/animated-container/animations.js +566 -566
  24. package/widgets/animated-container/styles.js +36 -36
  25. package/widgets/animated-container/widget.js +24 -24
  26. package/widgets/badge/styles.js +107 -107
  27. package/widgets/badge/widget.js +33 -33
  28. package/widgets/button/props.js +377 -377
  29. package/widgets/button/scenarios.js +54 -54
  30. package/widgets/button/styles.js +1082 -1082
  31. package/widgets/button/widget.js +426 -426
  32. package/widgets/button-combo/styles.js +73 -73
  33. package/widgets/button-combo/widget.js +297 -297
  34. package/widgets/calendar/props.js +207 -207
  35. package/widgets/calendar/scenarios.js +50 -50
  36. package/widgets/calendar/styles.js +198 -198
  37. package/widgets/calendar/widget.js +895 -895
  38. package/widgets/calendar-boards/styles.js +29 -29
  39. package/widgets/calendar-boards/widget.js +215 -215
  40. package/widgets/calendar-button/styles.js +273 -273
  41. package/widgets/calendar-button/widget.js +94 -94
  42. package/widgets/calendar-list/styles.js +35 -35
  43. package/widgets/calendar-list/widget.js +223 -223
  44. package/widgets/calendar-recurrence/widget.js +183 -183
  45. package/widgets/carousel/props.js +104 -104
  46. package/widgets/carousel/scenarios.js +163 -163
  47. package/widgets/carousel/styles.js +133 -133
  48. package/widgets/carousel/widget.js +491 -491
  49. package/widgets/carousel-bullet/styles.js +29 -29
  50. package/widgets/carousel-bullet/widget.js +25 -25
  51. package/widgets/carousel-button/styles.js +71 -71
  52. package/widgets/carousel-button/widget.js +33 -33
  53. package/widgets/carousel-item/styles.js +21 -21
  54. package/widgets/carousel-item/widget.js +24 -24
  55. package/widgets/chat-balloon/props.js +65 -65
  56. package/widgets/chat-balloon/scenarios.js +47 -47
  57. package/widgets/chat-balloon/styles.js +193 -193
  58. package/widgets/chat-balloon/widget.js +62 -62
  59. package/widgets/chat-dialog/styles.js +15 -15
  60. package/widgets/chat-dialog/widget.js +62 -62
  61. package/widgets/check-list/styles.js +66 -66
  62. package/widgets/check-list/widget.js +168 -168
  63. package/widgets/checkbox/widget.js +15 -15
  64. package/widgets/checkbox-nc/props.js +191 -191
  65. package/widgets/checkbox-nc/scenarios.js +41 -41
  66. package/widgets/checkbox-nc/styles.js +122 -122
  67. package/widgets/checkbox-nc/widget.js +116 -116
  68. package/widgets/clock-combo/styles.js +174 -174
  69. package/widgets/clock-combo/widget.js +390 -390
  70. package/widgets/color-picker/props.js +145 -145
  71. package/widgets/color-picker/scenarios.js +34 -34
  72. package/widgets/color-picker/styles.js +209 -209
  73. package/widgets/color-picker/widget.js +735 -735
  74. package/widgets/colored-container/props.js +34 -34
  75. package/widgets/colored-container/scenarios.js +54 -54
  76. package/widgets/colored-container/styles.js +100 -100
  77. package/widgets/colored-container/widget.js +27 -27
  78. package/widgets/combo/styles.js +69 -69
  79. package/widgets/combo/widget.js +224 -224
  80. package/widgets/combo-container/styles.js +66 -66
  81. package/widgets/combo-container/widget.js +188 -188
  82. package/widgets/command-button/widget.js +39 -39
  83. package/widgets/container/props.js +295 -295
  84. package/widgets/container/scenarios.js +47 -47
  85. package/widgets/container/styles.js +1439 -1439
  86. package/widgets/container/widget.js +279 -279
  87. package/widgets/demo/widget.js +24 -24
  88. package/widgets/dialog/styles.js +29 -29
  89. package/widgets/dialog/widget.js +26 -26
  90. package/widgets/dialog-modal/props.js +126 -126
  91. package/widgets/dialog-modal/styles.js +234 -234
  92. package/widgets/dialog-modal/widget.js +273 -273
  93. package/widgets/dialog-resizable/props.js +1 -1
  94. package/widgets/dialog-resizable/scenarios.js +18 -18
  95. package/widgets/dialog-resizable/widget.js +367 -367
  96. package/widgets/dialog-resizable-nc/props.js +150 -150
  97. package/widgets/dialog-resizable-nc/scenarios.js +18 -18
  98. package/widgets/dialog-resizable-nc/styles.js +259 -259
  99. package/widgets/dialog-resizable-nc/widget.js +197 -197
  100. package/widgets/directory-input/widget.js +18 -18
  101. package/widgets/directory-input-nc/widget.js +20 -20
  102. package/widgets/document-container/getPath.js +43 -43
  103. package/widgets/document-container/props.js +79 -79
  104. package/widgets/document-container/scenarios.js +39 -39
  105. package/widgets/document-container/styles.js +69 -69
  106. package/widgets/document-container/widget.js +53 -53
  107. package/widgets/drag-cab/styles.js +56 -56
  108. package/widgets/drag-cab/widget.js +285 -285
  109. package/widgets/drag-carrier/styles.js +21 -21
  110. package/widgets/drag-carrier/widget.js +780 -780
  111. package/widgets/dynamic-toolbar/styles.js +110 -110
  112. package/widgets/dynamic-toolbar/widget.js +128 -128
  113. package/widgets/field/readonly/label.js +39 -39
  114. package/widgets/field/widget.js +1743 -1743
  115. package/widgets/file-input/widget.js +18 -18
  116. package/widgets/file-input-nc/styles.js +38 -38
  117. package/widgets/file-input-nc/widget.js +88 -88
  118. package/widgets/flat-combo/styles.js +21 -21
  119. package/widgets/flat-combo/widget.js +61 -61
  120. package/widgets/flat-list/styles.js +30 -30
  121. package/widgets/flat-list/widget.js +219 -219
  122. package/widgets/flying-balloon/styles.js +52 -52
  123. package/widgets/flying-balloon/widget.js +43 -43
  124. package/widgets/fragment/widget.js +26 -26
  125. package/widgets/full-screen/props.js +27 -27
  126. package/widgets/full-screen/styles.js +32 -32
  127. package/widgets/full-screen/widget.js +40 -40
  128. package/widgets/gauge/props.js +71 -71
  129. package/widgets/gauge/scenarios.js +83 -83
  130. package/widgets/gauge/styles.js +183 -183
  131. package/widgets/gauge/widget.js +36 -36
  132. package/widgets/glyph-detail/service.js +9 -9
  133. package/widgets/glyph-detail/widget.js +109 -109
  134. package/widgets/glyphs-dialog/service.js +94 -94
  135. package/widgets/glyphs-dialog/styles.js +37 -37
  136. package/widgets/glyphs-dialog/widget.js +236 -236
  137. package/widgets/goblin-editor/widget.js +146 -146
  138. package/widgets/guild-entry/props.js +53 -53
  139. package/widgets/guild-entry/scenarios.js +26 -26
  140. package/widgets/guild-entry/styles.js +98 -98
  141. package/widgets/guild-entry/widget.js +126 -126
  142. package/widgets/guild-user-logo/guild-helpers.js +77 -77
  143. package/widgets/guild-user-logo/props.js +48 -48
  144. package/widgets/guild-user-logo/scenarios.js +64 -64
  145. package/widgets/guild-user-logo/styles.js +114 -114
  146. package/widgets/guild-user-logo/widget.js +81 -81
  147. package/widgets/guild-user-profile/props.js +73 -73
  148. package/widgets/guild-user-profile/scenarios.js +54 -54
  149. package/widgets/guild-user-profile/styles.js +162 -162
  150. package/widgets/guild-user-profile/widget.js +202 -202
  151. package/widgets/helpers/combo-helpers.js +218 -218
  152. package/widgets/helpers/geom-helpers.js +80 -80
  153. package/widgets/helpers/rect-helpers.js +10 -10
  154. package/widgets/helpers/shortcut-helpers.js +56 -56
  155. package/widgets/helpers/spacing-helpers.js +26 -26
  156. package/widgets/helpers/svg-helpers.js +151 -151
  157. package/widgets/helpers/table-helpers.js +68 -68
  158. package/widgets/hinter/styles.js +79 -79
  159. package/widgets/hinter/widget.js +205 -205
  160. package/widgets/hinter-column/widget.js +49 -49
  161. package/widgets/hinter-field/reducer.js +18 -18
  162. package/widgets/hinter-field/widget.js +176 -176
  163. package/widgets/hinter-field-nc/props.js +114 -114
  164. package/widgets/hinter-field-nc/scenarios.js +47 -47
  165. package/widgets/hinter-field-nc/widget.js +191 -191
  166. package/widgets/input-wrapper/widget.js +157 -157
  167. package/widgets/key-trap.js +96 -96
  168. package/widgets/label/props.js +1 -1
  169. package/widgets/label/scenarios.js +1 -1
  170. package/widgets/label/widget.js +7 -7
  171. package/widgets/label-nc/props.js +308 -308
  172. package/widgets/label-nc/scenarios.js +29 -29
  173. package/widgets/label-nc/styles.js +1218 -1218
  174. package/widgets/label-nc/widget.js +314 -314
  175. package/widgets/label-row/props.js +1 -1
  176. package/widgets/label-row/scenarios.js +1 -1
  177. package/widgets/label-row/widget.js +7 -7
  178. package/widgets/label-row-nc/props.js +94 -94
  179. package/widgets/label-row-nc/scenarios.js +46 -46
  180. package/widgets/label-row-nc/widget.js +81 -81
  181. package/widgets/label-text-field/styles.js +55 -55
  182. package/widgets/label-text-field/widget.js +178 -178
  183. package/widgets/launcher/props.js +177 -177
  184. package/widgets/launcher/scenarios.js +55 -55
  185. package/widgets/launcher/styles.js +46 -46
  186. package/widgets/launcher/widget.js +79 -79
  187. package/widgets/launcher-blob/props.js +25 -25
  188. package/widgets/launcher-blob/scenarios.js +24 -24
  189. package/widgets/launcher-blob/styles.js +62 -62
  190. package/widgets/launcher-blob/widget.js +50 -50
  191. package/widgets/list/widget.js +211 -211
  192. package/widgets/login-dialog/service.js +117 -117
  193. package/widgets/login-dialog/widget.js +117 -117
  194. package/widgets/map/reaflet.js +208 -208
  195. package/widgets/map/widget.js +67 -67
  196. package/widgets/markdown/styles.js +85 -85
  197. package/widgets/markdown/widget.js +31 -31
  198. package/widgets/notification/styles.js +97 -97
  199. package/widgets/notification/widget.js +207 -207
  200. package/widgets/pivot/custom.css +320 -320
  201. package/widgets/pivot/widget.js +42 -42
  202. package/widgets/radio-list/styles.js +48 -48
  203. package/widgets/radio-list/widget.js +111 -111
  204. package/widgets/resizable-container/styles.js +108 -108
  205. package/widgets/resizable-container/widget.js +225 -225
  206. package/widgets/retro-action-button/helpers.js +106 -106
  207. package/widgets/retro-action-button/styles.js +285 -285
  208. package/widgets/retro-action-button/widget.js +364 -364
  209. package/widgets/retro-badge-button/styles.js +87 -87
  210. package/widgets/retro-badge-button/widget.js +251 -251
  211. package/widgets/retro-gear/helpers.js +156 -156
  212. package/widgets/retro-gear/styles.js +130 -130
  213. package/widgets/retro-gear/widget.js +51 -51
  214. package/widgets/retro-illuminated-button/styles.js +274 -274
  215. package/widgets/retro-illuminated-button/widget.js +147 -147
  216. package/widgets/retro-panel/helpers.js +57 -57
  217. package/widgets/retro-panel/styles.js +293 -293
  218. package/widgets/retro-panel/widget.js +239 -239
  219. package/widgets/retro-screw/styles.js +80 -80
  220. package/widgets/retro-screw/widget.js +25 -25
  221. package/widgets/rocket/props.js +124 -124
  222. package/widgets/rocket/scenarios.js +71 -71
  223. package/widgets/rocket/styles.js +306 -306
  224. package/widgets/rocket/widget.js +225 -225
  225. package/widgets/samples-monitor/helpers.js +147 -147
  226. package/widgets/samples-monitor/styles.js +529 -529
  227. package/widgets/samples-monitor/widget.js +516 -516
  228. package/widgets/scrollable-container/styles.js +58 -58
  229. package/widgets/scrollable-container/widget.js +132 -132
  230. package/widgets/scrollable-linkable-container/reducer.js +18 -18
  231. package/widgets/scrollable-linkable-container/styles.js +42 -42
  232. package/widgets/scrollable-linkable-container/widget.js +78 -78
  233. package/widgets/select/styles.js +68 -68
  234. package/widgets/select/widget.js +119 -119
  235. package/widgets/separator/props.js +46 -46
  236. package/widgets/separator/styles.js +116 -116
  237. package/widgets/separator/widget.js +27 -27
  238. package/widgets/slider/props.js +136 -136
  239. package/widgets/slider/scenarios.js +74 -74
  240. package/widgets/slider/styles.js +246 -246
  241. package/widgets/slider/widget.js +404 -404
  242. package/widgets/slider-circle/props.js +72 -72
  243. package/widgets/slider-circle/scenarios.js +16 -16
  244. package/widgets/slider-circle/styles.js +78 -78
  245. package/widgets/slider-circle/widget.js +154 -154
  246. package/widgets/slider-xy/props.js +87 -87
  247. package/widgets/slider-xy/scenarios.js +19 -19
  248. package/widgets/slider-xy/styles.js +102 -102
  249. package/widgets/slider-xy/widget.js +234 -234
  250. package/widgets/smiley/props.js +51 -51
  251. package/widgets/smiley/scenarios.js +58 -58
  252. package/widgets/smiley/styles.js +489 -489
  253. package/widgets/smiley/widget.js +72 -72
  254. package/widgets/spinner/props.js +31 -31
  255. package/widgets/spinner/scenarios.js +31 -31
  256. package/widgets/spinner/styles.js +49 -49
  257. package/widgets/spinner/widget.js +23 -23
  258. package/widgets/splitter/props.js +71 -71
  259. package/widgets/splitter/scenarios.js +182 -182
  260. package/widgets/splitter/styles.js +41 -41
  261. package/widgets/splitter/widget.js +455 -455
  262. package/widgets/stack-navigation/service.js +324 -324
  263. package/widgets/stack-navigation/widget.js +296 -296
  264. package/widgets/state-browser/styles.js +19 -19
  265. package/widgets/state-browser/widget.js +135 -135
  266. package/widgets/state-browser-dialog/styles.js +100 -100
  267. package/widgets/state-browser-dialog/widget.js +253 -253
  268. package/widgets/state-monitor/styles.js +50 -50
  269. package/widgets/state-monitor/widget.js +324 -324
  270. package/widgets/switch-on-off/props.js +30 -30
  271. package/widgets/switch-on-off/scenarios.js +34 -34
  272. package/widgets/switch-on-off/styles.js +63 -63
  273. package/widgets/switch-on-off/widget.js +41 -41
  274. package/widgets/table/helpers.js +160 -160
  275. package/widgets/table/props.js +658 -658
  276. package/widgets/table/reducer.js +196 -196
  277. package/widgets/table/scenarios.js +54 -54
  278. package/widgets/table/widget.js +253 -253
  279. package/widgets/table-cell/props.js +145 -145
  280. package/widgets/table-cell/styles.js +160 -160
  281. package/widgets/table-cell/widget.js +139 -139
  282. package/widgets/table-header-drag-manager/styles.js +184 -184
  283. package/widgets/table-header-drag-manager/widget.js +392 -392
  284. package/widgets/table-nc/styles.js +100 -100
  285. package/widgets/table-nc/widget.js +409 -409
  286. package/widgets/table-row/props.js +73 -73
  287. package/widgets/table-row/styles.js +82 -82
  288. package/widgets/table-row/widget.js +207 -207
  289. package/widgets/text-field/widget.js +18 -18
  290. package/widgets/text-field-combo/widget.js +21 -21
  291. package/widgets/text-field-combo-nc/props.js +300 -300
  292. package/widgets/text-field-combo-nc/scenarios.js +72 -72
  293. package/widgets/text-field-combo-nc/widget.js +339 -339
  294. package/widgets/text-field-date-interval/styles.js +37 -37
  295. package/widgets/text-field-date-interval/widget.js +162 -162
  296. package/widgets/text-field-nc/props.js +40 -40
  297. package/widgets/text-field-nc/scenarios.js +67 -67
  298. package/widgets/text-field-nc/widget.js +14 -14
  299. package/widgets/text-field-time-interval/styles.js +37 -37
  300. package/widgets/text-field-time-interval/widget.js +160 -160
  301. package/widgets/text-field-typed/widget.js +51 -51
  302. package/widgets/text-field-typed-nc/props.js +81 -81
  303. package/widgets/text-field-typed-nc/scenarios.js +105 -105
  304. package/widgets/text-field-typed-nc/styles.js +20 -20
  305. package/widgets/text-field-typed-nc/widget.js +749 -750
  306. package/widgets/text-input-info-nc/props.js +62 -62
  307. package/widgets/text-input-info-nc/widget.js +55 -55
  308. package/widgets/text-input-nc/props.js +143 -143
  309. package/widgets/text-input-nc/scenarios.js +44 -44
  310. package/widgets/text-input-nc/styles.js +242 -242
  311. package/widgets/text-input-nc/widget.js +234 -234
  312. package/widgets/ticket/getPath.js +128 -128
  313. package/widgets/ticket/props.js +181 -181
  314. package/widgets/ticket/scenarios.js +39 -39
  315. package/widgets/ticket/styles.js +332 -332
  316. package/widgets/ticket/ticket-helpers.js +33 -33
  317. package/widgets/ticket/widget.js +348 -348
  318. package/widgets/ticket-hover/styles.js +207 -207
  319. package/widgets/ticket-hover/widget.js +53 -53
  320. package/widgets/time-gauge/widget.js +64 -64
  321. package/widgets/tips/styles.js +48 -48
  322. package/widgets/tips/widget.js +171 -171
  323. package/widgets/translatable-text-field/styles.js +202 -202
  324. package/widgets/translatable-text-field/text-field.js +132 -132
  325. package/widgets/translatable-text-field/widget.js +660 -660
  326. package/widgets/tree/props.js +246 -246
  327. package/widgets/tree/scenarios.js +14 -14
  328. package/widgets/tree/styles.js +142 -142
  329. package/widgets/tree/widget.js +383 -383
  330. package/widgets/tree-cell/styles.js +140 -140
  331. package/widgets/tree-cell/widget.js +100 -100
  332. package/widgets/tree-row/styles.js +77 -77
  333. package/widgets/tree-row/widget.js +135 -135
  334. package/widgets/triangle/props.js +48 -48
  335. package/widgets/triangle/scenarios.js +33 -33
  336. package/widgets/triangle/styles.js +92 -92
  337. package/widgets/triangle/widget.js +36 -36
  338. package/widgets/well-done/widget.js +170 -170
  339. package/widgets/widget-doc/reducer.js +68 -68
  340. package/widgets/widget-doc/styles.js +15 -15
  341. package/widgets/widget-doc/widget-list.js +25 -25
  342. package/widgets/widget-doc/widget.js +89 -89
  343. package/widgets/widget-doc-menu/styles.js +12 -12
  344. package/widgets/widget-doc-menu/widget.js +79 -79
  345. package/widgets/widget-doc-preview/parse-code.js +20 -20
  346. package/widgets/widget-doc-preview/styles.js +77 -77
  347. package/widgets/widget-doc-preview/widget.js +481 -481
  348. package/widgets/widget-doc-preview-container/styles.js +60 -60
  349. package/widgets/widget-doc-preview-container/widget.js +129 -129
  350. package/widgets/widget-doc-properties/styles.js +41 -41
  351. package/widgets/widget-doc-properties/widget.js +307 -307
  352. package/widgets/widget-doc-property/styles.js +75 -75
  353. package/widgets/widget-doc-property/widget.js +108 -108
  354. package/widgets/widget-doc-property-control/styles.js +14 -14
  355. package/widgets/widget-doc-property-control/widget.js +343 -343
  356. package/widgets/wizard/service.js +2132 -2132
  357. package/widgets/wizard/styles.js +21 -21
  358. package/widgets/wizard/widget.js +927 -927
  359. package/widgets/work-dialog/styles.js +31 -31
  360. package/widgets/work-dialog/widget.js +162 -162
  361. package/wizard.js +13 -13
@@ -1,1439 +1,1439 @@
1
- import {Unit} from 'goblin-theme';
2
- import {ColorHelpers} from 'goblin-theme';
3
- import {ColorManipulator} from 'goblin-theme';
4
- import * as SpacingHelpers from 'goblin-gadgets/widgets/helpers/spacing-helpers';
5
-
6
- const isWebkit = 'WebkitAppearance' in document.documentElement.style;
7
-
8
- /******************************************************************************/
9
-
10
- export const propNames = [
11
- 'width',
12
- 'height',
13
- 'minWidth',
14
- 'minHeight',
15
- 'maxWidth',
16
- 'maxHeight',
17
- 'hidden',
18
- 'marginBottom',
19
- 'position',
20
- 'visibility',
21
- 'kind',
22
- 'subkind',
23
- 'floatingHeight',
24
- 'grow',
25
- 'horizontalSpacing',
26
- 'markColor',
27
- 'selected',
28
- 'verticalJustify',
29
- 'verticalSpacing',
30
- 'isDragged',
31
- 'isTransparentWhenDrag',
32
- 'hasHeLeft',
33
- 'border',
34
- 'backgroundColor',
35
- 'cursor',
36
- 'triangleShift',
37
- 'trianglePosition',
38
- 'busyBackgroundColor',
39
- ];
40
-
41
- export default function styles(theme, props) {
42
- let {
43
- width,
44
- height,
45
- minWidth,
46
- minHeight,
47
- maxWidth,
48
- maxHeight,
49
- hidden,
50
- marginBottom,
51
- position,
52
- visibility,
53
- kind,
54
- subkind,
55
- floatingHeight,
56
- grow,
57
- horizontalSpacing,
58
- markColor,
59
- selected,
60
- verticalJustify,
61
- verticalSpacing,
62
- isDragged,
63
- isTransparentWhenDrag,
64
- hasHeLeft,
65
- border,
66
- backgroundColor: backgroundColorProp,
67
- cursor,
68
- triangleShift,
69
- trianglePosition,
70
- busyBackgroundColor,
71
- } = props;
72
-
73
- let display = null;
74
- let overflowX = null;
75
- let overflowY = null;
76
- let flexDirection = null;
77
- let flexWrap = null;
78
- let flexGrow = null;
79
- let flexShrink = null;
80
- let flexBasis = null;
81
- let justifyContent = null;
82
- let alignItems = null;
83
- let alignContent = null;
84
- let alignSelf = null;
85
- let boxSizing = null;
86
- let borderWidth = null;
87
- let borderStyle = 'none';
88
- let borderColor = null;
89
- let borderTopWidth = null;
90
- let borderTopStyle = null;
91
- let borderTopColor = null;
92
- let borderRightWidth = null;
93
- let borderRightStyle = null;
94
- let borderRightColor = null;
95
- let borderBottomWidth = null;
96
- let borderBottomStyle = null;
97
- let borderBottomColor = null;
98
- let borderLeftWidth = null;
99
- let borderLeftStyle = null;
100
- let borderLeftColor = null;
101
- let borderRadius = null;
102
- let boxShadow = null;
103
- let margin = marginBottom ? '0px 0px ' + marginBottom + ' 0px' : '0px';
104
- let marginLeft = null;
105
- let marginRight = null;
106
- let padding = '0px';
107
- let backgroundColor = null;
108
- let color = null;
109
- let fontWeight = null;
110
- let zIndex = null;
111
- position = position || 'relative';
112
- let left = null;
113
- let right = null;
114
- let top = null;
115
- let bottom = null;
116
- let transform = null;
117
- let fontFamily = null;
118
- let transition = null;
119
- let opacity = null;
120
- let hover = null;
121
-
122
- const h = theme.shapes.lineHeight;
123
- const m = theme.shapes.containerMargin;
124
- const s = theme.shapes.lineSpacing;
125
- const d = Unit.multiply(m, 0.5);
126
-
127
- marginRight = SpacingHelpers.getHorizontalSpacingRightMargin(
128
- theme,
129
- horizontalSpacing
130
- );
131
-
132
- if (kind === 'root') {
133
- position = 'relative';
134
- display = 'flex';
135
- flexDirection = 'row';
136
- height = '100vh';
137
- backgroundColor = theme.palette.rootBackground;
138
- color = theme.palette.text;
139
- }
140
-
141
- if (kind === 'root-sample') {
142
- display = 'flex';
143
- flexDirection = 'column';
144
- flexGrow = '1';
145
- backgroundColor = theme.palette.rootBackground;
146
- }
147
-
148
- if (kind === 'configurator-header') {
149
- if (!height) {
150
- throw new Error(
151
- 'Container with kind=configurator-header must have a height'
152
- );
153
- }
154
- // The property floating-height must correspond to the floating Container height !
155
- // The calculate height of floating-header Container fill the space on top of floating Container.
156
- const hh = Unit.add(
157
- Unit.multiply(height, 0.5),
158
- theme.shapes.floatingPadding
159
- );
160
- height = 'calc(50vh - ' + hh + ')';
161
- display = 'flex';
162
- flexDirection = 'row';
163
- margin = '0px auto auto auto';
164
- display = 'flex';
165
- justifyContent = 'center';
166
- alignItems = 'center';
167
- backgroundColor = 'transparent';
168
- zIndex = '2';
169
- }
170
-
171
- if (kind === 'configurator-content') {
172
- display = 'flex';
173
- flexDirection = 'column';
174
- margin = 'auto';
175
- padding = subkind === 'full' ? null : theme.shapes.floatingPadding;
176
- borderRadius = theme.shapes.floatingRadius;
177
- display = 'flex';
178
- flexDirection = 'column';
179
- justifyContent = 'center';
180
- backgroundColor = theme.palette.flyingDialogBackground;
181
- boxShadow = theme.shapes.floatingShadow;
182
- zIndex = '10';
183
- }
184
-
185
- if (kind === 'configurator-footer') {
186
- display = 'flex';
187
- flexDirection = 'column';
188
- margin = 'auto';
189
- display = 'flex';
190
- flexDirection = 'column';
191
- justifyContent = 'flex-end';
192
- alignItems = 'center';
193
- zIndex = '2';
194
- }
195
-
196
- if (kind === 'floating') {
197
- //position = 'fixed';
198
- //left = '50%';
199
- //top = '50%';
200
- maxHeight = '80%';
201
- // transform = 'translate(-50%, -50%)';
202
- display = 'flex';
203
- flexDirection = 'column';
204
- margin = 'auto';
205
- padding = subkind === 'full' ? null : theme.shapes.floatingPadding;
206
- borderRadius = theme.shapes.floatingRadius;
207
- display = 'flex';
208
- flexDirection = 'column';
209
- justifyContent = 'center';
210
- backgroundColor = theme.palette.flyingDialogBackground;
211
- boxShadow = theme.shapes.floatingShadow;
212
- zIndex = '10';
213
- }
214
-
215
- if (kind === 'floating-header') {
216
- if (!floatingHeight) {
217
- throw new Error(
218
- 'Container with kind=floating-header must have a floating-height'
219
- );
220
- }
221
- // The property floating-height must correspond to the floating Container height !
222
- // The calculate height of floating-header Container fill the space on top of floating Container.
223
- const hh = Unit.add(
224
- Unit.multiply(floatingHeight, 0.5),
225
- theme.shapes.floatingPadding
226
- );
227
- height = 'calc(50vh - ' + hh + ')';
228
- position = 'absolute';
229
- left = '0px';
230
- right = '0px';
231
- top = '0px';
232
- bottom = '0px';
233
- display = 'flex';
234
- flexDirection = 'column';
235
- margin = '0px auto auto auto';
236
- display = 'flex';
237
- flexDirection = 'column';
238
- justifyContent = 'flex-end';
239
- alignItems = 'center';
240
- zIndex = '2';
241
- }
242
-
243
- if (kind === 'floating-footer') {
244
- position = 'absolute';
245
- left = '0px';
246
- right = '0px';
247
- top = '0px';
248
- bottom = '0px';
249
- display = 'flex';
250
- flexDirection = 'column';
251
- margin = 'auto auto 0px auto';
252
- display = 'flex';
253
- flexDirection = 'column';
254
- justifyContent = 'center';
255
- alignItems = 'center';
256
- }
257
-
258
- if (kind === 'mandats') {
259
- position = 'absolute';
260
- left = '0px';
261
- right = '0px';
262
- top = '0px';
263
- bottom = '0px';
264
- display = 'flex';
265
- flexDirection = 'column';
266
- margin = 'auto';
267
- padding = theme.shapes.floatingPadding;
268
- borderRadius = theme.shapes.floatingRadius;
269
- display = 'flex';
270
- flexDirection = 'column';
271
- justifyContent = 'center';
272
- backgroundColor = theme.palette.floatingBackground;
273
- boxShadow = theme.shapes.floatingShadow;
274
- zIndex = '1';
275
- }
276
-
277
- if (kind === 'left-bar') {
278
- zIndex = 2;
279
- minWidth = theme.shapes.taskButtonWidth;
280
- display = 'flex';
281
- flexDirection = 'column';
282
- overflowY = 'auto';
283
- backgroundColor =
284
- theme.look.name === 'retro'
285
- ? `linear-gradient(90deg, ${ColorManipulator.darken(
286
- theme.palette.taskBackground,
287
- 0.5
288
- )}, ${theme.palette.taskBackground} 71%)`
289
- : theme.palette.taskBackground;
290
- boxShadow = theme.shapes.taskShadow;
291
-
292
- if (theme.look.name === 'retro') {
293
- minWidth = Unit.add(theme.shapes.taskButtonWidth, '50px');
294
- alignItems = 'center';
295
- }
296
- }
297
-
298
- if (kind === 'task-bar') {
299
- minWidth = theme.shapes.taskButtonWidth;
300
- maxWidth = theme.shapes.taskButtonWidth;
301
- display = 'flex';
302
- flexDirection = 'column';
303
- flexGrow = 1;
304
- overflowY = 'hidden';
305
- hover = {
306
- overflowY: 'auto',
307
- };
308
-
309
- if (theme.look.name === 'retro') {
310
- minWidth = Unit.add(theme.shapes.taskButtonWidth, '50px');
311
- maxWidth = Unit.add(theme.shapes.taskButtonWidth, '50px');
312
- alignItems = 'center';
313
- margin = '-20px 0px 0px 0px';
314
- padding = '20px 0px 0px 0px';
315
- }
316
- }
317
-
318
- if (kind === 'right') {
319
- display = 'flex';
320
- flexDirection = 'column';
321
- flexGrow = 1;
322
- justifyContent = 'flex-end';
323
- overflowX = 'hidden';
324
- overflowY = 'hidden';
325
- }
326
-
327
- if (kind === 'content') {
328
- display = 'flex';
329
- flexDirection = 'column';
330
- flexGrow = 1;
331
- overflowX = 'hidden';
332
- overflowY = 'hidden';
333
- }
334
-
335
- if (kind === 'top-bar') {
336
- display = 'flex';
337
- flexDirection = 'row';
338
- backgroundColor = theme.palette.mainTabBackground;
339
- flexShrink = 0;
340
- }
341
-
342
- if (kind === 'main-tab') {
343
- minHeight = theme.shapes.mainTabHeight;
344
- display = 'flex';
345
- flexDirection = 'row';
346
- flexGrow = 1;
347
- justifyContent = 'flex-start';
348
- alignItems = 'center';
349
- overflowX = 'hidden';
350
- }
351
-
352
- if (kind === 'main-tab-right') {
353
- //- boxShadow = `${theme.palette.mainTabBackground} 0px 0px 30px 12px`;
354
- marginLeft = '7px';
355
- minHeight = theme.shapes.mainTabHeight;
356
- display = 'flex';
357
- flexDirection = 'row';
358
- justifyContent = 'flex-start';
359
- alignItems = 'center';
360
- backgroundColor = theme.palette.mainTabBackground;
361
- }
362
-
363
- if (kind === 'second-bar') {
364
- display = 'flex';
365
- flexDirection = 'row';
366
- justifyContent = 'flex-end';
367
- backgroundColor = theme.palette.viewTabBackground;
368
- }
369
-
370
- if (kind === 'view-tab') {
371
- minHeight = theme.shapes.viewTabHeight;
372
- display = 'flex';
373
- flexDirection = 'row';
374
- flexWrap = 'wrap-reverse;';
375
- flexGrow = 1;
376
- justifyContent = 'flex-start';
377
- alignItems = 'flex-start';
378
- borderStyle = 'none';
379
- }
380
-
381
- if (kind === 'view-tab-right') {
382
- display = 'flex';
383
- flexDirection = 'row';
384
- justifyContent = 'flex-start';
385
- alignItems = 'flex-end';
386
- backgroundColor = theme.palette.viewTabBackground;
387
- }
388
-
389
- if (kind === 'views') {
390
- display = 'flex';
391
- flexDirection = 'row';
392
- flexGrow = 1;
393
- overflowX = 'auto';
394
- }
395
-
396
- if (kind === 'view') {
397
- minWidth = width;
398
- position = 'relative';
399
- display = 'flex';
400
- flexDirection = 'column';
401
- flexGrow = grow;
402
- if (horizontalSpacing === 'large') {
403
- margin = '0px ' + theme.shapes.viewSpacing + ' 0px 0px';
404
- marginRight = null;
405
- } else {
406
- margin = '0px';
407
- }
408
- backgroundColor = theme.palette.viewBackground;
409
- }
410
-
411
- if (kind === 'view-stretch') {
412
- minWidth = width;
413
- position = 'relative';
414
- display = 'flex';
415
- flexDirection = 'column';
416
- flexGrow = 1;
417
- margin = '0px';
418
- backgroundColor = theme.palette.viewBackground;
419
- }
420
-
421
- if (kind === 'view-right') {
422
- minWidth = width;
423
- position = 'relative';
424
- display = 'flex';
425
- flexDirection = 'column';
426
- margin = '0px';
427
- right = theme.shapes.viewSpacing;
428
- borderLeftWidth = theme.shapes.viewSpacing;
429
- borderLeftStyle = 'solid';
430
- borderLeftColor = theme.palette.rootBackground;
431
- backgroundColor = theme.palette.viewBackground;
432
- }
433
-
434
- if (kind === 'view-wedge') {
435
- width = 0;
436
- }
437
-
438
- if (kind === 'full-view') {
439
- width = '10000px';
440
- position = 'relative';
441
- display = 'flex';
442
- flexDirection = 'column';
443
- margin = '0px';
444
- }
445
-
446
- if (kind === 'pane-header') {
447
- minHeight = height;
448
- flexDirection = 'row';
449
- justifyContent = 'space-between';
450
- padding = m;
451
- margin = '0px 0px ' + m + ' 0px';
452
- backgroundColor = theme.palette.paneHeaderBackground;
453
- }
454
-
455
- if (kind === 'pane-header-light') {
456
- minHeight = height;
457
- flexDirection = 'row';
458
- justifyContent = 'space-between';
459
- padding = m;
460
- margin = '0px';
461
- }
462
-
463
- if (kind === 'pane-navigator') {
464
- minHeight = h;
465
- display = 'flex';
466
- flexDirection = 'row';
467
- justifyContent = 'space-between';
468
- alignItems = 'center';
469
- padding = m + ' ' + m + ' 0px ' + m;
470
- margin = '0px 0px ' + m + ' 0px';
471
- borderWidth = '1px';
472
- borderStyle = 'none none solid none';
473
- borderColor = theme.palette.paneNavigatorInactiveBorder;
474
- backgroundColor = theme.palette.paneNavigatorBackground;
475
- }
476
-
477
- if (kind === 'pane-top') {
478
- minHeight = h;
479
- display = 'flex';
480
- flexDirection = 'row';
481
- alignItems = 'center';
482
- padding = m + ' ' + m + ' 0px ' + m;
483
- margin = '0px 0px ' + m + ' 0px';
484
- borderStyle = 'none';
485
- borderColor = theme.palette.paneNavigatorInactiveBorder;
486
- backgroundColor = theme.palette.paneNavigatorBackground;
487
- }
488
-
489
- if (kind === 'pane-hnavigator') {
490
- minHeight = h;
491
- display = 'flex';
492
- flexDirection = 'row';
493
- alignItems = 'center';
494
- padding = m + ' ' + m + ' 0px ' + m;
495
- margin = '0px 0px ' + m + ' 0px';
496
- borderWidth = '1px';
497
- borderStyle = 'none none solid none';
498
- borderColor = theme.palette.paneNavigatorInactiveBorder;
499
- backgroundColor = theme.palette.paneNavigatorBackground;
500
- }
501
-
502
- if (kind === 'pane-vnavigator') {
503
- position = 'absolute';
504
- minHeight = h;
505
- display = 'flex';
506
- flexDirection = 'column';
507
- padding = '0px';
508
- margin =
509
- '0px 0px 0px ' + Unit.multiply(theme.shapes.vnavigatorButtonSize, -1);
510
- backgroundColor = theme.palette.vnavigatorButtonBackground;
511
- zIndex = 4;
512
- }
513
-
514
- if (kind === 'actions') {
515
- minHeight = theme.shapes.actionHeight;
516
- display = 'flex';
517
- flexDirection = 'row';
518
- justifyContent = 'flex-start';
519
- alignItems = 'center';
520
- padding = m;
521
- borderStyle = 'none';
522
- backgroundColor = theme.palette.actionBackground;
523
- borderTopWidth = '1px';
524
- borderTopStyle = 'solid';
525
- borderTopColor = theme.palette.actionBorder;
526
- boxShadow = subkind === 'no-shadow' ? null : theme.shapes.actionShadow;
527
- }
528
-
529
- if (kind === 'panes') {
530
- if (props.subkind !== 'no-overlay') {
531
- overflowY = isWebkit ? 'overlay' : 'auto';
532
- }
533
- flexGrow = grow || 1;
534
- padding = '0px ' + m + ' 0px ' + m;
535
- if (subkind === 'top-margin') {
536
- margin = m + ' 0px 0px 0px';
537
- }
538
- }
539
-
540
- if (kind === 'pane') {
541
- display = 'flex';
542
- flexDirection = 'column';
543
- justifyContent = 'flex-start';
544
- alignItems = 'stretch';
545
- margin = '0px 0px ' + m + ' 0px';
546
- padding = m + ' ' + m + ' ' + d + ' ' + m;
547
- backgroundColor = theme.palette.paneBackground;
548
-
549
- if (theme.look.name === 'retro') {
550
- borderRadius = '20px';
551
- borderWidth = '1px';
552
- borderStyle = 'solid';
553
- borderColor = '#bbb';
554
- (backgroundColor = '#eee'),
555
- (boxShadow = 'rgba(0, 0, 0, 0.2) 2px 6px 50px 0px inset');
556
- }
557
- }
558
-
559
- if (kind === 'pane-wizard') {
560
- display = 'flex';
561
- flexGrow = 1;
562
- flexDirection = 'column';
563
- justifyContent = 'flex-start';
564
- alignItems = 'stretch';
565
- margin = '0px ' + m + ' ' + m + ' ' + m;
566
- padding = m;
567
- backgroundColor = theme.palette.paneBackground;
568
- }
569
-
570
- if (kind === 'pane-top') {
571
- display = 'flex';
572
- flexDirection = 'column';
573
- justifyContent = 'flex-start';
574
- alignItems = 'stretch';
575
- // boxShadow = theme.shapes.paneShadow;
576
- margin = Unit.multiply(m, -0.5) + ' 0px ' + m + ' 0px';
577
- padding = '0px ' + m + ' ' + d + ' ' + m;
578
- backgroundColor = theme.palette.paneBackground;
579
- }
580
-
581
- if (kind === 'row-pane') {
582
- const halfMargin = Unit.multiply(m, 0.5);
583
- display = 'flex';
584
- flexGrow = grow || 1;
585
- flexDirection = 'row';
586
- justifyContent = 'space-between';
587
- alignItems = 'center';
588
- let topMargin = '0px';
589
- let rightMargin = '0px';
590
- let bottomMargin = s;
591
- let leftMargin = '0px';
592
- if (subkind === 'info') {
593
- height = theme.shapes.lineHeight;
594
- backgroundColor = theme.palette.infoBackground;
595
- borderRadius = theme.shapes.smoothRadius;
596
- fontWeight = 'bold';
597
- padding = '0px ' + halfMargin;
598
- } else if (subkind === 'wide-info') {
599
- rightMargin = Unit.multiply(m, -1);
600
- leftMargin = Unit.multiply(m, -1);
601
- padding = '0px ' + m;
602
- backgroundColor = theme.palette.infoBackground;
603
- fontWeight = 'bold';
604
- } else if (subkind === 'box' || subkind === 'box-left') {
605
- if (subkind === 'box-left') {
606
- justifyContent = 'flex-start';
607
- }
608
- rightMargin = Unit.multiply(m, -1);
609
- leftMargin = Unit.multiply(m, -1);
610
- let topPadding = halfMargin;
611
- let rightPadding = m;
612
- let bottomPadding = halfMargin;
613
- let leftPadding = m;
614
- borderTopColor = theme.palette.paneNavigatorInactiveBorder;
615
- borderBottomColor = theme.palette.paneNavigatorInactiveBorder;
616
- borderTopWidth = '1px';
617
- borderBottomWidth = '1px';
618
- borderTopStyle = 'solid';
619
- borderBottomStyle = 'solid';
620
- topMargin = halfMargin;
621
- bottomMargin = Unit.sub(Unit.multiply(halfMargin, -1), '1px');
622
- if (markColor) {
623
- borderLeftWidth = theme.shapes.markWidth;
624
- borderLeftStyle = 'solid';
625
- borderLeftColor = ColorHelpers.getMarkColor(theme, markColor);
626
- leftPadding = Unit.sub(leftPadding, theme.shapes.markWidth);
627
- }
628
- padding =
629
- topPadding +
630
- ' ' +
631
- rightPadding +
632
- ' ' +
633
- bottomPadding +
634
- ' ' +
635
- leftPadding;
636
- } else if (subkind === 'light-box') {
637
- rightMargin = Unit.multiply(m, -1);
638
- leftMargin = Unit.multiply(m, -1);
639
- topMargin = Unit.multiply(halfMargin, -1);
640
- bottomMargin = '0px';
641
- } else if (subkind === 'large-box') {
642
- rightMargin = Unit.multiply(m, -1);
643
- leftMargin = Unit.multiply(m, -1);
644
- let topPadding = '0px';
645
- let rightPadding = '0px';
646
- let bottomPadding = '0px';
647
- let leftPadding = theme.shapes.markWidth;
648
- borderTopColor = theme.palette.paneNavigatorInactiveBorder;
649
- borderBottomColor = theme.palette.paneNavigatorInactiveBorder;
650
- borderTopWidth = '1px';
651
- borderBottomWidth = '1px';
652
- borderTopStyle = 'solid';
653
- borderBottomStyle = 'solid';
654
- topMargin = halfMargin;
655
- bottomMargin = Unit.sub(Unit.multiply(halfMargin, -1), '1px');
656
- if (selected) {
657
- borderLeftWidth = theme.shapes.markWidth;
658
- borderLeftStyle = 'solid';
659
- borderLeftColor = ColorHelpers.getMarkColor(theme, 'base');
660
- leftPadding = '0px';
661
- }
662
- padding =
663
- topPadding +
664
- ' ' +
665
- rightPadding +
666
- ' ' +
667
- bottomPadding +
668
- ' ' +
669
- leftPadding;
670
- } else if (subkind === 'list') {
671
- borderBottomColor = theme.palette.paneNavigatorInactiveBorder;
672
- borderBottomWidth = '1px';
673
- borderBottomStyle = 'solid';
674
- padding = '0px';
675
- bottomMargin = '0px';
676
- } else if (subkind === 'footer') {
677
- rightMargin = Unit.multiply(m, -1);
678
- leftMargin = Unit.multiply(m, -1);
679
- topMargin = halfMargin;
680
- bottomMargin = Unit.sub(Unit.multiply(halfMargin, -1), '1px');
681
- padding = '0px';
682
- } else if (subkind === 'wrap') {
683
- display = 'flex';
684
- flexDirection = 'row';
685
- flexWrap = 'wrap';
686
- justifyContent = 'flex-start';
687
- alignItems = 'center';
688
- leftMargin = Unit.multiply(m, -0.25);
689
- rightMargin = Unit.multiply(m, -0.25);
690
- topMargin = Unit.multiply(m, -0.25);
691
- bottomMargin = Unit.multiply(m, 0.25);
692
- } else if (subkind === 'left') {
693
- justifyContent = 'flex-start';
694
- }
695
- if (selected && subkind !== 'large-box') {
696
- backgroundColor = theme.palette.paneSelectedBackground;
697
- color = theme.palette.paneSelectedText;
698
- }
699
- margin =
700
- topMargin + ' ' + rightMargin + ' ' + bottomMargin + ' ' + leftMargin;
701
- }
702
-
703
- if (kind === 'row-field') {
704
- const halfMargin = Unit.multiply(m, 0.5);
705
- let topMargin = '0px';
706
- let rightMargin = '0px';
707
- let bottomMargin = s;
708
- let leftMargin = '0px';
709
- display = 'flex';
710
- flexDirection = 'row';
711
- flexGrow = grow;
712
- alignItems = verticalJustify === 'top' ? 'flex-start' : 'center';
713
- minHeight = Unit.add(h, '1px');
714
- if (subkind === 'left') {
715
- justifyContent = 'flex-start';
716
- } else if (subkind === 'light-box') {
717
- rightMargin = Unit.multiply(m, -1);
718
- leftMargin = Unit.multiply(m, -1);
719
- topMargin = Unit.multiply(halfMargin, -1);
720
- bottomMargin = '0px';
721
- } else if (subkind === 'border-box') {
722
- padding = Unit.multiply(m, 0.5) + ' ' + m;
723
- borderWidth = '1px';
724
- borderStyle = 'solid';
725
- borderColor = theme.palette.buttonBorder;
726
- }
727
- if (verticalSpacing === 'compact') {
728
- minHeight = '20px';
729
- bottomMargin = '0px';
730
- } else if (verticalSpacing === 'normal') {
731
- bottomMargin = '0px';
732
- } else if (verticalSpacing === 'large') {
733
- bottomMargin = '10px';
734
- } else if (verticalSpacing === 'overlap') {
735
- bottomMargin = '-1px';
736
- }
737
- margin =
738
- topMargin + ' ' + rightMargin + ' ' + bottomMargin + ' ' + leftMargin;
739
- }
740
-
741
- if (kind === 'row-pane-drag') {
742
- display = 'flex';
743
- flexDirection = 'column';
744
- margin =
745
- Unit.multiply(m, 0.5) +
746
- ' ' +
747
- Unit.multiply(m, -1) +
748
- ' ' +
749
- Unit.multiply(m, -0.5) +
750
- ' ' +
751
- Unit.multiply(m, -1);
752
- }
753
-
754
- if (kind === 'row-wrap') {
755
- margin = Unit.multiply(m, 0.25);
756
- }
757
-
758
- if (kind === 'compact-row') {
759
- display = 'flex';
760
- flexDirection = 'row';
761
- justifyContent = 'flex-start';
762
- alignItems = 'flex-start';
763
- margin = '0px';
764
- padding = '0px';
765
- }
766
-
767
- if (kind === 'backlog-row') {
768
- display = 'flex';
769
- flexDirection = 'row';
770
- flexGrow = '1';
771
- justifyContent = 'flex-start';
772
- alignItems = 'flex-start';
773
- margin = Unit.multiply(m, -1);
774
- padding = '0px 0px ' + Unit.multiply(m, 0.5) + ' 0px';
775
- backgroundColor = theme.palette.ticketsBackground;
776
- }
777
-
778
- if (kind === 'roadbook-row') {
779
- display = 'flex';
780
- flexDirection = 'row';
781
- flexGrow = '1';
782
- justifyContent = 'flex-start';
783
- alignItems = 'flex-start';
784
- margin = Unit.multiply(m, -1);
785
- padding = '0px ' + m + ' ' + m + ' ' + m;
786
- backgroundColor = theme.palette.ticketsBackground;
787
- }
788
-
789
- if (kind === 'desk-row') {
790
- display = 'flex';
791
- flexDirection = 'row';
792
- flexGrow = '1';
793
- justifyContent = 'flex-start';
794
- alignItems = 'flex-start';
795
- margin = Unit.multiply(m, -1);
796
- padding = '0px ' + m + ' ' + m + ' ' + m;
797
- backgroundColor = theme.palette.ticketsBackground;
798
- }
799
-
800
- if (kind === 'full-column') {
801
- display = 'flex';
802
- flexDirection = 'column';
803
- flexGrow = '1';
804
- margin = '0px';
805
- padding = '0px';
806
- }
807
-
808
- if (kind === 'scrollable-column') {
809
- display = 'flex';
810
- flexDirection = 'column';
811
- flexGrow = '1';
812
- margin = '0px';
813
- padding = '0px';
814
- if (subkind === 'in-default-panel') {
815
- // In default panel (edit to left or readonly to right), the vertical
816
- // scrolling is globaly managed by parent pannel.
817
- // Width is fix (700px).
818
- width = Unit.sub('700px', '140px'); // 140px include margins, vertical toolbar and vertical scroller
819
- overflowX = 'hidden';
820
- overflowY = 'hidden';
821
- } else if (subkind === 'wrap') {
822
- flexWrap = 'wrap';
823
- alignContent = 'flex-start';
824
- padding = theme.shapes.containerMargin;
825
- overflowX = 'auto';
826
- overflowY = 'hidden';
827
- } else if (subkind === 'padding') {
828
- padding = theme.shapes.containerMargin;
829
- overflowX = 'hidden';
830
- overflowY = 'auto';
831
- } else {
832
- // In dedicated dispatch board-panel, the vertical scrolling is managed
833
- // by this container.
834
- // Width is variable, according to splitter.
835
- overflowX = 'hidden';
836
- overflowY = 'auto';
837
- }
838
- }
839
-
840
- if (kind === 'footer') {
841
- minHeight = theme.shapes.footerHeight;
842
- display = 'flex';
843
- flexDirection = 'row';
844
- flexGrow = 0;
845
- justifyContent = 'flex-start';
846
- alignItems = 'center';
847
- backgroundColor = theme.palette.footerBackground;
848
- }
849
-
850
- if (kind === 'tickets') {
851
- const mm = Unit.multiply(m, 0.5);
852
- overflowY = 'auto';
853
- padding = '0px ' + mm + ' 0px ' + mm;
854
- display = 'flex';
855
- flexDirection = 'column';
856
- flexGrow = '1';
857
- backgroundColor = theme.palette.ticketsBackground;
858
- }
859
-
860
- if (kind === 'tickets-root') {
861
- display = 'flex';
862
- flexDirection = 'column';
863
- flexGrow = 1;
864
- overflowX = 'hidden';
865
- }
866
-
867
- if (kind === 'tickets-backlog') {
868
- display = 'flex';
869
- flexDirection = 'column';
870
- flexGrow = 1;
871
- overflowX = 'hidden';
872
- overflowY = 'hidden';
873
- backgroundColor = theme.palette.viewBackground;
874
- }
875
-
876
- if (kind === 'tickets-messengers') {
877
- display = 'flex';
878
- flexDirection = 'row';
879
- flexGrow = 1;
880
- }
881
-
882
- if (kind === 'ticket-in-codispatch') {
883
- display = 'flex';
884
- flexDirection = 'row';
885
- flexGrow = 1;
886
- padding = theme.shapes.containerMargin;
887
- backgroundColor = theme.palette.viewBackground;
888
- }
889
-
890
- if (kind === 'scrollable-tickets-messengers-top') {
891
- width = 'calc(100vw - ' + theme.shapes.taskButtonWidth + ')';
892
- overflowX = 'auto';
893
- display = 'flex';
894
- flexDirection = 'row';
895
- flexGrow = 1;
896
- }
897
- if (kind === 'scrollable-tickets-messengers-right') {
898
- width = '100%';
899
- overflowX = 'auto';
900
- display = 'flex';
901
- flexDirection = 'row';
902
- flexGrow = 1;
903
- }
904
-
905
- if (kind === 'scrollable-tickets-desks') {
906
- overflowX = 'auto';
907
- display = 'flex';
908
- flexDirection = 'row';
909
- flexGrow = 1;
910
- padding = '0px ' + theme.shapes.containerMargin;
911
- }
912
-
913
- if (kind === 'roadbook-tickets') {
914
- height = '100%';
915
- const mm = Unit.multiply(m, 0.5);
916
- padding = '0px ' + mm + ' 0px ' + mm;
917
- display = 'flex';
918
- flexDirection = 'column';
919
- flexGrow = 1;
920
- borderRightWidth = theme.shapes.viewSpacing;
921
- borderRightStyle = 'solid';
922
- borderRightColor = theme.palette.rootBackground;
923
- backgroundColor = theme.palette.ticketsBackground;
924
- }
925
-
926
- if (kind === 'desk-tickets') {
927
- const mm = Unit.multiply(m, 0.5);
928
- padding = '0px ' + mm + ' 0px ' + mm;
929
- display = 'flex';
930
- flexDirection = 'column';
931
- flexGrow = 1;
932
- margin = '0px ' + theme.shapes.viewSpacing + ' 0px 0px';
933
- backgroundColor = 'transparent';
934
- }
935
-
936
- if (kind === 'tickets-trips') {
937
- display = 'flex';
938
- flexDirection = 'column';
939
- flexGrow = 1;
940
- overflowX = 'hidden';
941
- overflowY = 'auto';
942
- }
943
-
944
- if (kind === 'tickets-desk') {
945
- position = 'relative';
946
- display = 'flex';
947
- flexDirection = 'row';
948
- flexGrow = 1;
949
- backgroundColor = theme.palette.ticketsBackground;
950
- overflowY = 'auto';
951
- }
952
-
953
- if (kind === 'tickets-tray') {
954
- minWidth = width ? width : theme.shapes.dispatchTicketWidth;
955
- maxWidth = width ? width : theme.shapes.dispatchTicketWidth;
956
- minHeight = height ? height : theme.shapes.dispatchTicketsHeight;
957
- }
958
-
959
- if (kind === 'ticket-row') {
960
- display = 'flex';
961
- flexDirection = 'row';
962
- flexGrow = grow;
963
- alignItems = 'baseline';
964
- }
965
-
966
- if (kind === 'ticket-column') {
967
- display = 'flex';
968
- flexDirection = 'column';
969
- flexGrow = grow;
970
- overflowX = 'hidden';
971
- overflowY = 'hidden';
972
- margin = '-5px 0px';
973
- }
974
-
975
- if (kind === 'drag-too-many') {
976
- margin = '5px 0px 0px 0px';
977
- padding = '8px 12px';
978
- borderWidth = '1px';
979
- borderStyle = 'solid';
980
- borderRadius = '50px';
981
- borderColor = theme.palette.buttonBorder;
982
- backgroundColor = theme.palette.ticketsBackground;
983
- boxShadow = theme.palette.dragAndDropShadow;
984
- }
985
-
986
- if (kind === 'drag-to-delete') {
987
- width = '24px';
988
- minHeight = '24px';
989
- display = 'flex';
990
- padding = '10px';
991
- borderWidth = '1px';
992
- borderStyle = 'solid';
993
- borderRadius = '50px';
994
- borderColor = theme.palette.buttonBorder;
995
- backgroundColor = theme.palette.ticketsBackground;
996
- alignItems = 'center';
997
- justifyContent = 'center';
998
- color = theme.palette.text;
999
- }
1000
-
1001
- if (kind === 'chronos-events') {
1002
- display = 'flex';
1003
- flexDirection = 'column';
1004
- flexGrow = 1;
1005
- overflowX = 'hidden';
1006
- overflowY = 'auto';
1007
- backgroundColor = theme.palette.eventBackground;
1008
- }
1009
-
1010
- if (kind === 'column-full') {
1011
- display = 'flex';
1012
- flexDirection = 'column';
1013
- flexGrow = '1';
1014
- overflowX = 'hidden';
1015
- }
1016
-
1017
- if (kind === 'column') {
1018
- display = 'flex';
1019
- flexDirection = 'column';
1020
- flexGrow = grow;
1021
- }
1022
-
1023
- if (kind === 'column-minus-margin') {
1024
- display = 'flex';
1025
- flexDirection = 'column';
1026
- flexGrow = grow;
1027
- margin = Unit.multiply(m, -1);
1028
- padding = m;
1029
- }
1030
-
1031
- if (kind === 'row') {
1032
- display = 'flex';
1033
- flexDirection = 'row';
1034
- flexGrow = grow;
1035
- if (subkind === 'center') {
1036
- alignItems = 'center';
1037
- }
1038
- }
1039
-
1040
- if (kind === 'row-draggable') {
1041
- height = '100%';
1042
- display = 'flex';
1043
- flexDirection = 'row';
1044
- flexGrow = grow;
1045
- if (isDragged) {
1046
- // borderWidth = '1px';
1047
- // borderStyle = 'solid';
1048
- // boxSizing = 'border-box';
1049
- // borderColor = theme.palette.buttonBorder;
1050
- backgroundColor = isTransparentWhenDrag
1051
- ? null
1052
- : theme.palette.dragAndDropBackground;
1053
- boxShadow = isTransparentWhenDrag
1054
- ? null
1055
- : theme.palette.dragAndDropShadow;
1056
- opacity = 0.9;
1057
- } else if (hasHeLeft) {
1058
- visibility = 'hidden';
1059
- opacity = 0;
1060
- }
1061
- }
1062
-
1063
- if (kind === 'wrap') {
1064
- display = 'flex';
1065
- flexDirection = 'row';
1066
- flexWrap = 'wrap';
1067
- flexGrow = grow;
1068
- }
1069
-
1070
- if (kind === 'boxes') {
1071
- display = 'flex';
1072
- flexDirection = 'row';
1073
- flexWrap = 'wrap';
1074
- justifyContent = 'flex-start';
1075
- alignItems = 'center';
1076
- }
1077
-
1078
- if (kind === 'box') {
1079
- width = '100%';
1080
- display = 'flex';
1081
- flexDirection = 'column';
1082
- flexGrow = grow;
1083
- justifyContent = 'center';
1084
- borderWidth = subkind ? '1px' : '0px';
1085
- borderStyle = subkind ? subkind : 'solid';
1086
- borderRadius = theme.shapes.boxRadius;
1087
- padding = s;
1088
- }
1089
-
1090
- if (kind === 'ticket-mode') {
1091
- display = 'flex';
1092
- flexDirection = 'column';
1093
- flexGrow = grow;
1094
- margin = '0px -20px 0px 0px';
1095
- }
1096
-
1097
- if (kind === 'glyph-samples') {
1098
- display = 'flex';
1099
- flexDirection = 'row';
1100
- alignItems = 'center';
1101
- height = '80px';
1102
- overflowX = 'auto';
1103
- overflowY = 'hidden';
1104
- margin = '0px 20px 0px 0px';
1105
- }
1106
-
1107
- if (kind === 'glyph-samples-note') {
1108
- display = 'flex';
1109
- flexDirection = 'row';
1110
- alignItems = 'center';
1111
- overflowX = 'auto';
1112
- overflowY = 'hidden';
1113
- margin = '0px 10px 0px 0px';
1114
- }
1115
-
1116
- if (kind && kind.startsWith('thin-')) {
1117
- if (border) {
1118
- if (border === 'top') {
1119
- borderStyle = 'solid none none none';
1120
- } else if (border === 'right') {
1121
- borderStyle = 'none solid none none';
1122
- } else if (border === 'bottom') {
1123
- borderStyle = 'none none solid none';
1124
- } else if (border === 'left') {
1125
- borderStyle = 'none none none solid';
1126
- }
1127
- borderWidth = '1px';
1128
- borderColor = theme.palette.buttonBorder;
1129
- } else {
1130
- borderStyle = 'none';
1131
- }
1132
- }
1133
-
1134
- if (kind === 'thin-main') {
1135
- position = 'relative';
1136
- display = 'flex';
1137
- flexDirection = 'row';
1138
- flexGrow = grow;
1139
- justifyContent = 'center';
1140
- borderWidth = '1px';
1141
- borderStyle = 'solid';
1142
- borderColor = theme.palette.buttonBorder;
1143
- borderRadius = theme.shapes.thinRadius;
1144
- if (selected) {
1145
- backgroundColor = theme.palette.paneSelectedBackground;
1146
- color = theme.palette.paneSelectedText;
1147
- } else {
1148
- backgroundColor = theme.palette.paneBackground;
1149
- }
1150
- }
1151
-
1152
- if (kind === 'thin-center') {
1153
- display = 'flex';
1154
- flexDirection = 'column';
1155
- flexGrow = grow;
1156
- justifyContent = 'center';
1157
- alignItems = 'center';
1158
- }
1159
-
1160
- if (kind === 'thin-column') {
1161
- display = 'flex';
1162
- flexDirection = 'column';
1163
- flexGrow = grow;
1164
- justifyContent = 'flex-start';
1165
- }
1166
-
1167
- if (kind === 'thin-row') {
1168
- display = 'flex';
1169
- flexDirection = 'row';
1170
- flexGrow = grow;
1171
- justifyContent = 'flex-start';
1172
- alignItems = 'center';
1173
- padding = '0px ' + theme.shapes.thinLeftMargin;
1174
- }
1175
-
1176
- if (kind === 'flying-combo') {
1177
- display = 'flex';
1178
- flexDirection = 'column';
1179
- flexWrap = 'wrap';
1180
- padding = theme.shapes.flyingBalloonPadding;
1181
- backgroundColor = theme.palette.comboItemBackground;
1182
- color = theme.palette.text;
1183
- position = 'relative';
1184
- boxShadow = theme.shapes.comboShadow;
1185
- borderWidth = '1px';
1186
- borderStyle = 'solid';
1187
- borderColor = theme.palette.buttonBorder;
1188
- borderRadius = theme.shapes.flyingBalloonRadius;
1189
- }
1190
-
1191
- if (kind === 'flying-balloon') {
1192
- const fbp = theme.shapes.flyingBalloonPadding;
1193
- display = 'flex';
1194
- flexDirection = 'column';
1195
- flexWrap = 'wrap';
1196
- padding = Unit.add(fbp, '1px') + ' ' + fbp + ' ' + fbp + ' ' + fbp;
1197
- backgroundColor =
1198
- subkind === 'warning'
1199
- ? theme.palette.flyingBalloonWarningBackground
1200
- : theme.palette.flyingBalloonBackground;
1201
- color = theme.palette.text;
1202
- position = 'relative';
1203
- boxShadow = theme.shapes.flyingShadow;
1204
- borderRadius = theme.shapes.flyingBalloonRadius;
1205
- }
1206
-
1207
- if (kind === 'flying-chat') {
1208
- const fbp = theme.shapes.chatPadding;
1209
- display = 'flex';
1210
- flexDirection = 'column';
1211
- margin = '0px 0px ' + theme.shapes.chatVerticalSpacing + ' 0px';
1212
- padding = fbp + ' ' + fbp + ' ' + fbp + ' ' + fbp;
1213
- backgroundColor =
1214
- subkind === 'me'
1215
- ? theme.palette.chatMeBackground
1216
- : theme.palette.chatOtherBackground;
1217
- color = theme.palette.text;
1218
- position = 'relative';
1219
- borderRadius = theme.shapes.flyingBalloonRadius;
1220
- }
1221
-
1222
- if (kind === 'flying-dialog') {
1223
- display = 'flex';
1224
- flexDirection = 'column';
1225
- flexGrow = '1';
1226
- padding = theme.shapes.floatingPadding;
1227
- backgroundColor = theme.palette.flyingDialogBackground;
1228
- color = theme.palette.text;
1229
- position = 'relative';
1230
- boxShadow = theme.shapes.flyingShadow;
1231
- borderRadius = theme.shapes.flyingDialogRadius;
1232
- }
1233
-
1234
- if (kind === 'push-to-edge') {
1235
- if (subkind === 'flex') {
1236
- display = 'flex';
1237
- flexDirection = 'column';
1238
- }
1239
- flexGrow = 1;
1240
- margin = Unit.multiply(m, 0.5) + ' ' + Unit.multiply(m, -1);
1241
- }
1242
-
1243
- if (kind === 'absolute-top-right') {
1244
- position = 'absolute';
1245
- top = '0px';
1246
- right = '0px';
1247
- }
1248
-
1249
- // WIP: This code generate problems of layout with 'row-field'.
1250
- //? if (flexGrow) {
1251
- //? flexShrink = '1';
1252
- //? flexBasis = '0%';
1253
- //? }
1254
-
1255
- // With flex="2 1 0%", set properties:
1256
- // flexGrow = "2"
1257
- // flexShrink = "1"
1258
- // flexBasis = "0%"
1259
- if (
1260
- flexGrow &&
1261
- typeof flexGrow === 'string' &&
1262
- flexGrow.indexOf(' ') !== -1
1263
- ) {
1264
- const parts = flexGrow.split(' ');
1265
- flexGrow = parts[0];
1266
- if (parts.length >= 3) {
1267
- flexShrink = parts[1];
1268
- flexBasis = parts[2];
1269
- }
1270
- }
1271
-
1272
- if (hidden) {
1273
- display = 'none';
1274
- }
1275
-
1276
- if (backgroundColorProp) {
1277
- backgroundColor = ColorHelpers.getMarkColor(theme, backgroundColorProp);
1278
- }
1279
-
1280
- const boxStyle = {
1281
- 'fontFamily': fontFamily,
1282
- 'width': width,
1283
- 'height': height,
1284
- 'minWidth': minWidth,
1285
- 'minHeight': minHeight,
1286
- 'maxWidth': maxWidth,
1287
- 'maxHeight': maxHeight,
1288
- 'display': display,
1289
- 'overflowX': overflowX,
1290
- 'overflowY': overflowY,
1291
- 'flexDirection': flexDirection,
1292
- 'flexWrap': flexWrap,
1293
- 'flexGrow': flexGrow,
1294
- 'flexShrink': flexShrink,
1295
- 'flexBasis': flexBasis,
1296
- 'justifyContent': justifyContent,
1297
- 'alignItems': alignItems,
1298
- 'alignContent': alignContent,
1299
- 'alignSelf': alignSelf,
1300
- 'boxSizing': boxSizing,
1301
- 'borderWidth': borderWidth,
1302
- 'borderStyle': borderStyle,
1303
- 'borderColor': borderColor,
1304
- 'borderTopWidth': borderTopWidth,
1305
- 'borderTopStyle': borderTopStyle,
1306
- 'borderTopColor': borderTopColor,
1307
- 'borderRightWidth': borderRightWidth,
1308
- 'borderRightStyle': borderRightStyle,
1309
- 'borderRightColor': borderRightColor,
1310
- 'borderBottomWidth': borderBottomWidth,
1311
- 'borderBottomStyle': borderBottomStyle,
1312
- 'borderBottomColor': borderBottomColor,
1313
- 'borderLeftWidth': borderLeftWidth,
1314
- 'borderLeftStyle': borderLeftStyle,
1315
- 'borderLeftColor': borderLeftColor,
1316
- 'borderRadius': borderRadius,
1317
- 'boxShadow': boxShadow,
1318
- 'margin': margin,
1319
- 'marginLeft': marginLeft,
1320
- 'marginRight': marginRight,
1321
- 'padding': padding,
1322
- 'background': backgroundColor,
1323
- 'color': color,
1324
- 'fontWeight': fontWeight,
1325
- 'zIndex': zIndex,
1326
- 'position': position,
1327
- 'left': left,
1328
- 'right': right,
1329
- 'top': top,
1330
- 'bottom': bottom,
1331
- 'transform': transform,
1332
- 'transition': transition,
1333
- 'visibility': visibility,
1334
- 'opacity': opacity,
1335
- 'cursor': cursor,
1336
- ':hover': hover,
1337
- };
1338
-
1339
- // A Container with kind='flying-balloon' has a standard behavior. It behaves like
1340
- // a box with a small triangle which overlaps with the upper part (for example).
1341
- let triangleStyle = null;
1342
- if (
1343
- kind === 'flying-combo' ||
1344
- kind === 'flying-balloon' ||
1345
- kind === 'flying-chat' ||
1346
- kind === 'flying-dialog'
1347
- ) {
1348
- let triangleSize, triangleColor;
1349
- if (
1350
- kind === 'flying-combo' ||
1351
- kind === 'flying-balloon' ||
1352
- kind === 'flying-chat'
1353
- ) {
1354
- triangleSize = theme.shapes.flyingBalloonTriangleSize;
1355
- triangleColor = backgroundColor
1356
- ? backgroundColor
1357
- : theme.palette.flyingBalloonBackground;
1358
- } else {
1359
- triangleSize = theme.shapes.flyingDialogTriangleSize;
1360
- triangleColor = backgroundColor
1361
- ? backgroundColor
1362
- : theme.palette.flyingDialogBackground;
1363
- }
1364
- const t = Unit.add(triangleSize, '1px', 0); // round (suppress decimals)
1365
- const tt = triangleShift ? Unit.add(t, triangleShift) : t;
1366
- const p = triangleSize;
1367
- if (trianglePosition === 'left') {
1368
- triangleStyle = {
1369
- position: 'absolute',
1370
- height: '0px',
1371
- bottom: 'calc(50% - ' + tt + ')',
1372
- left: '-' + p,
1373
- borderTop: t + ' solid transparent',
1374
- borderBottom: t + ' solid transparent',
1375
- borderRight: t + ' solid ' + triangleColor,
1376
- pointerEvents: 'none',
1377
- };
1378
- } else if (trianglePosition === 'right') {
1379
- triangleStyle = {
1380
- position: 'absolute',
1381
- height: '0px',
1382
- bottom: 'calc(50% - ' + tt + ')',
1383
- right: '-' + p,
1384
- borderTop: t + ' solid transparent',
1385
- borderBottom: t + ' solid transparent',
1386
- borderLeft: t + ' solid ' + triangleColor,
1387
- pointerEvents: 'none',
1388
- };
1389
- } else if (trianglePosition === 'bottom') {
1390
- triangleStyle = {
1391
- position: 'absolute',
1392
- width: '0px',
1393
- left: 'calc(50% - ' + tt + ')',
1394
- bottom: '-' + p,
1395
- borderLeft: t + ' solid transparent',
1396
- borderRight: t + ' solid transparent',
1397
- borderTop: t + ' solid ' + triangleColor,
1398
- pointerEvents: 'none',
1399
- };
1400
- } else if (trianglePosition === 'top') {
1401
- triangleStyle = {
1402
- position: 'absolute',
1403
- width: '0px',
1404
- left: 'calc(50% - ' + tt + ')',
1405
- top: '-' + p,
1406
- borderLeft: t + ' solid transparent',
1407
- borderRight: t + ' solid transparent',
1408
- borderBottom: t + ' solid ' + triangleColor,
1409
- pointerEvents: 'none',
1410
- };
1411
- } else {
1412
- triangleStyle = {};
1413
- }
1414
- }
1415
-
1416
- const busyBoxStyle = {
1417
- position: 'absolute',
1418
- width: '100%',
1419
- height: '100%',
1420
- display: 'flex',
1421
- top: 0,
1422
- left: 0,
1423
- backgroundColor: busyBackgroundColor || theme.palette.busyBackground,
1424
- };
1425
-
1426
- const busyGlyphStyle = {
1427
- margin: 'auto',
1428
- color: theme.palette.busyForeground,
1429
- };
1430
-
1431
- return {
1432
- box: boxStyle,
1433
- triangle: triangleStyle,
1434
- busyBox: busyBoxStyle,
1435
- busyGlyph: busyGlyphStyle,
1436
- };
1437
- }
1438
-
1439
- /******************************************************************************/
1
+ import {Unit} from 'goblin-theme';
2
+ import {ColorHelpers} from 'goblin-theme';
3
+ import {ColorManipulator} from 'goblin-theme';
4
+ import * as SpacingHelpers from 'goblin-gadgets/widgets/helpers/spacing-helpers';
5
+
6
+ const isWebkit = 'WebkitAppearance' in document.documentElement.style;
7
+
8
+ /******************************************************************************/
9
+
10
+ export const propNames = [
11
+ 'width',
12
+ 'height',
13
+ 'minWidth',
14
+ 'minHeight',
15
+ 'maxWidth',
16
+ 'maxHeight',
17
+ 'hidden',
18
+ 'marginBottom',
19
+ 'position',
20
+ 'visibility',
21
+ 'kind',
22
+ 'subkind',
23
+ 'floatingHeight',
24
+ 'grow',
25
+ 'horizontalSpacing',
26
+ 'markColor',
27
+ 'selected',
28
+ 'verticalJustify',
29
+ 'verticalSpacing',
30
+ 'isDragged',
31
+ 'isTransparentWhenDrag',
32
+ 'hasHeLeft',
33
+ 'border',
34
+ 'backgroundColor',
35
+ 'cursor',
36
+ 'triangleShift',
37
+ 'trianglePosition',
38
+ 'busyBackgroundColor',
39
+ ];
40
+
41
+ export default function styles(theme, props) {
42
+ let {
43
+ width,
44
+ height,
45
+ minWidth,
46
+ minHeight,
47
+ maxWidth,
48
+ maxHeight,
49
+ hidden,
50
+ marginBottom,
51
+ position,
52
+ visibility,
53
+ kind,
54
+ subkind,
55
+ floatingHeight,
56
+ grow,
57
+ horizontalSpacing,
58
+ markColor,
59
+ selected,
60
+ verticalJustify,
61
+ verticalSpacing,
62
+ isDragged,
63
+ isTransparentWhenDrag,
64
+ hasHeLeft,
65
+ border,
66
+ backgroundColor: backgroundColorProp,
67
+ cursor,
68
+ triangleShift,
69
+ trianglePosition,
70
+ busyBackgroundColor,
71
+ } = props;
72
+
73
+ let display = null;
74
+ let overflowX = null;
75
+ let overflowY = null;
76
+ let flexDirection = null;
77
+ let flexWrap = null;
78
+ let flexGrow = null;
79
+ let flexShrink = null;
80
+ let flexBasis = null;
81
+ let justifyContent = null;
82
+ let alignItems = null;
83
+ let alignContent = null;
84
+ let alignSelf = null;
85
+ let boxSizing = null;
86
+ let borderWidth = null;
87
+ let borderStyle = 'none';
88
+ let borderColor = null;
89
+ let borderTopWidth = null;
90
+ let borderTopStyle = null;
91
+ let borderTopColor = null;
92
+ let borderRightWidth = null;
93
+ let borderRightStyle = null;
94
+ let borderRightColor = null;
95
+ let borderBottomWidth = null;
96
+ let borderBottomStyle = null;
97
+ let borderBottomColor = null;
98
+ let borderLeftWidth = null;
99
+ let borderLeftStyle = null;
100
+ let borderLeftColor = null;
101
+ let borderRadius = null;
102
+ let boxShadow = null;
103
+ let margin = marginBottom ? '0px 0px ' + marginBottom + ' 0px' : '0px';
104
+ let marginLeft = null;
105
+ let marginRight = null;
106
+ let padding = '0px';
107
+ let backgroundColor = null;
108
+ let color = null;
109
+ let fontWeight = null;
110
+ let zIndex = null;
111
+ position = position || 'relative';
112
+ let left = null;
113
+ let right = null;
114
+ let top = null;
115
+ let bottom = null;
116
+ let transform = null;
117
+ let fontFamily = null;
118
+ let transition = null;
119
+ let opacity = null;
120
+ let hover = null;
121
+
122
+ const h = theme.shapes.lineHeight;
123
+ const m = theme.shapes.containerMargin;
124
+ const s = theme.shapes.lineSpacing;
125
+ const d = Unit.multiply(m, 0.5);
126
+
127
+ marginRight = SpacingHelpers.getHorizontalSpacingRightMargin(
128
+ theme,
129
+ horizontalSpacing
130
+ );
131
+
132
+ if (kind === 'root') {
133
+ position = 'relative';
134
+ display = 'flex';
135
+ flexDirection = 'row';
136
+ height = '100vh';
137
+ backgroundColor = theme.palette.rootBackground;
138
+ color = theme.palette.text;
139
+ }
140
+
141
+ if (kind === 'root-sample') {
142
+ display = 'flex';
143
+ flexDirection = 'column';
144
+ flexGrow = '1';
145
+ backgroundColor = theme.palette.rootBackground;
146
+ }
147
+
148
+ if (kind === 'configurator-header') {
149
+ if (!height) {
150
+ throw new Error(
151
+ 'Container with kind=configurator-header must have a height'
152
+ );
153
+ }
154
+ // The property floating-height must correspond to the floating Container height !
155
+ // The calculate height of floating-header Container fill the space on top of floating Container.
156
+ const hh = Unit.add(
157
+ Unit.multiply(height, 0.5),
158
+ theme.shapes.floatingPadding
159
+ );
160
+ height = 'calc(50vh - ' + hh + ')';
161
+ display = 'flex';
162
+ flexDirection = 'row';
163
+ margin = '0px auto auto auto';
164
+ display = 'flex';
165
+ justifyContent = 'center';
166
+ alignItems = 'center';
167
+ backgroundColor = 'transparent';
168
+ zIndex = '2';
169
+ }
170
+
171
+ if (kind === 'configurator-content') {
172
+ display = 'flex';
173
+ flexDirection = 'column';
174
+ margin = 'auto';
175
+ padding = subkind === 'full' ? null : theme.shapes.floatingPadding;
176
+ borderRadius = theme.shapes.floatingRadius;
177
+ display = 'flex';
178
+ flexDirection = 'column';
179
+ justifyContent = 'center';
180
+ backgroundColor = theme.palette.flyingDialogBackground;
181
+ boxShadow = theme.shapes.floatingShadow;
182
+ zIndex = '10';
183
+ }
184
+
185
+ if (kind === 'configurator-footer') {
186
+ display = 'flex';
187
+ flexDirection = 'column';
188
+ margin = 'auto';
189
+ display = 'flex';
190
+ flexDirection = 'column';
191
+ justifyContent = 'flex-end';
192
+ alignItems = 'center';
193
+ zIndex = '2';
194
+ }
195
+
196
+ if (kind === 'floating') {
197
+ //position = 'fixed';
198
+ //left = '50%';
199
+ //top = '50%';
200
+ maxHeight = '80%';
201
+ // transform = 'translate(-50%, -50%)';
202
+ display = 'flex';
203
+ flexDirection = 'column';
204
+ margin = 'auto';
205
+ padding = subkind === 'full' ? null : theme.shapes.floatingPadding;
206
+ borderRadius = theme.shapes.floatingRadius;
207
+ display = 'flex';
208
+ flexDirection = 'column';
209
+ justifyContent = 'center';
210
+ backgroundColor = theme.palette.flyingDialogBackground;
211
+ boxShadow = theme.shapes.floatingShadow;
212
+ zIndex = '10';
213
+ }
214
+
215
+ if (kind === 'floating-header') {
216
+ if (!floatingHeight) {
217
+ throw new Error(
218
+ 'Container with kind=floating-header must have a floating-height'
219
+ );
220
+ }
221
+ // The property floating-height must correspond to the floating Container height !
222
+ // The calculate height of floating-header Container fill the space on top of floating Container.
223
+ const hh = Unit.add(
224
+ Unit.multiply(floatingHeight, 0.5),
225
+ theme.shapes.floatingPadding
226
+ );
227
+ height = 'calc(50vh - ' + hh + ')';
228
+ position = 'absolute';
229
+ left = '0px';
230
+ right = '0px';
231
+ top = '0px';
232
+ bottom = '0px';
233
+ display = 'flex';
234
+ flexDirection = 'column';
235
+ margin = '0px auto auto auto';
236
+ display = 'flex';
237
+ flexDirection = 'column';
238
+ justifyContent = 'flex-end';
239
+ alignItems = 'center';
240
+ zIndex = '2';
241
+ }
242
+
243
+ if (kind === 'floating-footer') {
244
+ position = 'absolute';
245
+ left = '0px';
246
+ right = '0px';
247
+ top = '0px';
248
+ bottom = '0px';
249
+ display = 'flex';
250
+ flexDirection = 'column';
251
+ margin = 'auto auto 0px auto';
252
+ display = 'flex';
253
+ flexDirection = 'column';
254
+ justifyContent = 'center';
255
+ alignItems = 'center';
256
+ }
257
+
258
+ if (kind === 'mandats') {
259
+ position = 'absolute';
260
+ left = '0px';
261
+ right = '0px';
262
+ top = '0px';
263
+ bottom = '0px';
264
+ display = 'flex';
265
+ flexDirection = 'column';
266
+ margin = 'auto';
267
+ padding = theme.shapes.floatingPadding;
268
+ borderRadius = theme.shapes.floatingRadius;
269
+ display = 'flex';
270
+ flexDirection = 'column';
271
+ justifyContent = 'center';
272
+ backgroundColor = theme.palette.floatingBackground;
273
+ boxShadow = theme.shapes.floatingShadow;
274
+ zIndex = '1';
275
+ }
276
+
277
+ if (kind === 'left-bar') {
278
+ zIndex = 2;
279
+ minWidth = theme.shapes.taskButtonWidth;
280
+ display = 'flex';
281
+ flexDirection = 'column';
282
+ overflowY = 'auto';
283
+ backgroundColor =
284
+ theme.look.name === 'retro'
285
+ ? `linear-gradient(90deg, ${ColorManipulator.darken(
286
+ theme.palette.taskBackground,
287
+ 0.5
288
+ )}, ${theme.palette.taskBackground} 71%)`
289
+ : theme.palette.taskBackground;
290
+ boxShadow = theme.shapes.taskShadow;
291
+
292
+ if (theme.look.name === 'retro') {
293
+ minWidth = Unit.add(theme.shapes.taskButtonWidth, '50px');
294
+ alignItems = 'center';
295
+ }
296
+ }
297
+
298
+ if (kind === 'task-bar') {
299
+ minWidth = theme.shapes.taskButtonWidth;
300
+ maxWidth = theme.shapes.taskButtonWidth;
301
+ display = 'flex';
302
+ flexDirection = 'column';
303
+ flexGrow = 1;
304
+ overflowY = 'hidden';
305
+ hover = {
306
+ overflowY: 'auto',
307
+ };
308
+
309
+ if (theme.look.name === 'retro') {
310
+ minWidth = Unit.add(theme.shapes.taskButtonWidth, '50px');
311
+ maxWidth = Unit.add(theme.shapes.taskButtonWidth, '50px');
312
+ alignItems = 'center';
313
+ margin = '-20px 0px 0px 0px';
314
+ padding = '20px 0px 0px 0px';
315
+ }
316
+ }
317
+
318
+ if (kind === 'right') {
319
+ display = 'flex';
320
+ flexDirection = 'column';
321
+ flexGrow = 1;
322
+ justifyContent = 'flex-end';
323
+ overflowX = 'hidden';
324
+ overflowY = 'hidden';
325
+ }
326
+
327
+ if (kind === 'content') {
328
+ display = 'flex';
329
+ flexDirection = 'column';
330
+ flexGrow = 1;
331
+ overflowX = 'hidden';
332
+ overflowY = 'hidden';
333
+ }
334
+
335
+ if (kind === 'top-bar') {
336
+ display = 'flex';
337
+ flexDirection = 'row';
338
+ backgroundColor = theme.palette.mainTabBackground;
339
+ flexShrink = 0;
340
+ }
341
+
342
+ if (kind === 'main-tab') {
343
+ minHeight = theme.shapes.mainTabHeight;
344
+ display = 'flex';
345
+ flexDirection = 'row';
346
+ flexGrow = 1;
347
+ justifyContent = 'flex-start';
348
+ alignItems = 'center';
349
+ overflowX = 'hidden';
350
+ }
351
+
352
+ if (kind === 'main-tab-right') {
353
+ //- boxShadow = `${theme.palette.mainTabBackground} 0px 0px 30px 12px`;
354
+ marginLeft = '7px';
355
+ minHeight = theme.shapes.mainTabHeight;
356
+ display = 'flex';
357
+ flexDirection = 'row';
358
+ justifyContent = 'flex-start';
359
+ alignItems = 'center';
360
+ backgroundColor = theme.palette.mainTabBackground;
361
+ }
362
+
363
+ if (kind === 'second-bar') {
364
+ display = 'flex';
365
+ flexDirection = 'row';
366
+ justifyContent = 'flex-end';
367
+ backgroundColor = theme.palette.viewTabBackground;
368
+ }
369
+
370
+ if (kind === 'view-tab') {
371
+ minHeight = theme.shapes.viewTabHeight;
372
+ display = 'flex';
373
+ flexDirection = 'row';
374
+ flexWrap = 'wrap-reverse;';
375
+ flexGrow = 1;
376
+ justifyContent = 'flex-start';
377
+ alignItems = 'flex-start';
378
+ borderStyle = 'none';
379
+ }
380
+
381
+ if (kind === 'view-tab-right') {
382
+ display = 'flex';
383
+ flexDirection = 'row';
384
+ justifyContent = 'flex-start';
385
+ alignItems = 'flex-end';
386
+ backgroundColor = theme.palette.viewTabBackground;
387
+ }
388
+
389
+ if (kind === 'views') {
390
+ display = 'flex';
391
+ flexDirection = 'row';
392
+ flexGrow = 1;
393
+ overflowX = 'auto';
394
+ }
395
+
396
+ if (kind === 'view') {
397
+ minWidth = width;
398
+ position = 'relative';
399
+ display = 'flex';
400
+ flexDirection = 'column';
401
+ flexGrow = grow;
402
+ if (horizontalSpacing === 'large') {
403
+ margin = '0px ' + theme.shapes.viewSpacing + ' 0px 0px';
404
+ marginRight = null;
405
+ } else {
406
+ margin = '0px';
407
+ }
408
+ backgroundColor = theme.palette.viewBackground;
409
+ }
410
+
411
+ if (kind === 'view-stretch') {
412
+ minWidth = width;
413
+ position = 'relative';
414
+ display = 'flex';
415
+ flexDirection = 'column';
416
+ flexGrow = 1;
417
+ margin = '0px';
418
+ backgroundColor = theme.palette.viewBackground;
419
+ }
420
+
421
+ if (kind === 'view-right') {
422
+ minWidth = width;
423
+ position = 'relative';
424
+ display = 'flex';
425
+ flexDirection = 'column';
426
+ margin = '0px';
427
+ right = theme.shapes.viewSpacing;
428
+ borderLeftWidth = theme.shapes.viewSpacing;
429
+ borderLeftStyle = 'solid';
430
+ borderLeftColor = theme.palette.rootBackground;
431
+ backgroundColor = theme.palette.viewBackground;
432
+ }
433
+
434
+ if (kind === 'view-wedge') {
435
+ width = 0;
436
+ }
437
+
438
+ if (kind === 'full-view') {
439
+ width = '10000px';
440
+ position = 'relative';
441
+ display = 'flex';
442
+ flexDirection = 'column';
443
+ margin = '0px';
444
+ }
445
+
446
+ if (kind === 'pane-header') {
447
+ minHeight = height;
448
+ flexDirection = 'row';
449
+ justifyContent = 'space-between';
450
+ padding = m;
451
+ margin = '0px 0px ' + m + ' 0px';
452
+ backgroundColor = theme.palette.paneHeaderBackground;
453
+ }
454
+
455
+ if (kind === 'pane-header-light') {
456
+ minHeight = height;
457
+ flexDirection = 'row';
458
+ justifyContent = 'space-between';
459
+ padding = m;
460
+ margin = '0px';
461
+ }
462
+
463
+ if (kind === 'pane-navigator') {
464
+ minHeight = h;
465
+ display = 'flex';
466
+ flexDirection = 'row';
467
+ justifyContent = 'space-between';
468
+ alignItems = 'center';
469
+ padding = m + ' ' + m + ' 0px ' + m;
470
+ margin = '0px 0px ' + m + ' 0px';
471
+ borderWidth = '1px';
472
+ borderStyle = 'none none solid none';
473
+ borderColor = theme.palette.paneNavigatorInactiveBorder;
474
+ backgroundColor = theme.palette.paneNavigatorBackground;
475
+ }
476
+
477
+ if (kind === 'pane-top') {
478
+ minHeight = h;
479
+ display = 'flex';
480
+ flexDirection = 'row';
481
+ alignItems = 'center';
482
+ padding = m + ' ' + m + ' 0px ' + m;
483
+ margin = '0px 0px ' + m + ' 0px';
484
+ borderStyle = 'none';
485
+ borderColor = theme.palette.paneNavigatorInactiveBorder;
486
+ backgroundColor = theme.palette.paneNavigatorBackground;
487
+ }
488
+
489
+ if (kind === 'pane-hnavigator') {
490
+ minHeight = h;
491
+ display = 'flex';
492
+ flexDirection = 'row';
493
+ alignItems = 'center';
494
+ padding = m + ' ' + m + ' 0px ' + m;
495
+ margin = '0px 0px ' + m + ' 0px';
496
+ borderWidth = '1px';
497
+ borderStyle = 'none none solid none';
498
+ borderColor = theme.palette.paneNavigatorInactiveBorder;
499
+ backgroundColor = theme.palette.paneNavigatorBackground;
500
+ }
501
+
502
+ if (kind === 'pane-vnavigator') {
503
+ position = 'absolute';
504
+ minHeight = h;
505
+ display = 'flex';
506
+ flexDirection = 'column';
507
+ padding = '0px';
508
+ margin =
509
+ '0px 0px 0px ' + Unit.multiply(theme.shapes.vnavigatorButtonSize, -1);
510
+ backgroundColor = theme.palette.vnavigatorButtonBackground;
511
+ zIndex = 4;
512
+ }
513
+
514
+ if (kind === 'actions') {
515
+ minHeight = theme.shapes.actionHeight;
516
+ display = 'flex';
517
+ flexDirection = 'row';
518
+ justifyContent = 'flex-start';
519
+ alignItems = 'center';
520
+ padding = m;
521
+ borderStyle = 'none';
522
+ backgroundColor = theme.palette.actionBackground;
523
+ borderTopWidth = '1px';
524
+ borderTopStyle = 'solid';
525
+ borderTopColor = theme.palette.actionBorder;
526
+ boxShadow = subkind === 'no-shadow' ? null : theme.shapes.actionShadow;
527
+ }
528
+
529
+ if (kind === 'panes') {
530
+ if (props.subkind !== 'no-overlay') {
531
+ overflowY = isWebkit ? 'overlay' : 'auto';
532
+ }
533
+ flexGrow = grow || 1;
534
+ padding = '0px ' + m + ' 0px ' + m;
535
+ if (subkind === 'top-margin') {
536
+ margin = m + ' 0px 0px 0px';
537
+ }
538
+ }
539
+
540
+ if (kind === 'pane') {
541
+ display = 'flex';
542
+ flexDirection = 'column';
543
+ justifyContent = 'flex-start';
544
+ alignItems = 'stretch';
545
+ margin = '0px 0px ' + m + ' 0px';
546
+ padding = m + ' ' + m + ' ' + d + ' ' + m;
547
+ backgroundColor = theme.palette.paneBackground;
548
+
549
+ if (theme.look.name === 'retro') {
550
+ borderRadius = '20px';
551
+ borderWidth = '1px';
552
+ borderStyle = 'solid';
553
+ borderColor = '#bbb';
554
+ (backgroundColor = '#eee'),
555
+ (boxShadow = 'rgba(0, 0, 0, 0.2) 2px 6px 50px 0px inset');
556
+ }
557
+ }
558
+
559
+ if (kind === 'pane-wizard') {
560
+ display = 'flex';
561
+ flexGrow = 1;
562
+ flexDirection = 'column';
563
+ justifyContent = 'flex-start';
564
+ alignItems = 'stretch';
565
+ margin = '0px ' + m + ' ' + m + ' ' + m;
566
+ padding = m;
567
+ backgroundColor = theme.palette.paneBackground;
568
+ }
569
+
570
+ if (kind === 'pane-top') {
571
+ display = 'flex';
572
+ flexDirection = 'column';
573
+ justifyContent = 'flex-start';
574
+ alignItems = 'stretch';
575
+ // boxShadow = theme.shapes.paneShadow;
576
+ margin = Unit.multiply(m, -0.5) + ' 0px ' + m + ' 0px';
577
+ padding = '0px ' + m + ' ' + d + ' ' + m;
578
+ backgroundColor = theme.palette.paneBackground;
579
+ }
580
+
581
+ if (kind === 'row-pane') {
582
+ const halfMargin = Unit.multiply(m, 0.5);
583
+ display = 'flex';
584
+ flexGrow = grow || 1;
585
+ flexDirection = 'row';
586
+ justifyContent = 'space-between';
587
+ alignItems = 'center';
588
+ let topMargin = '0px';
589
+ let rightMargin = '0px';
590
+ let bottomMargin = s;
591
+ let leftMargin = '0px';
592
+ if (subkind === 'info') {
593
+ height = theme.shapes.lineHeight;
594
+ backgroundColor = theme.palette.infoBackground;
595
+ borderRadius = theme.shapes.smoothRadius;
596
+ fontWeight = 'bold';
597
+ padding = '0px ' + halfMargin;
598
+ } else if (subkind === 'wide-info') {
599
+ rightMargin = Unit.multiply(m, -1);
600
+ leftMargin = Unit.multiply(m, -1);
601
+ padding = '0px ' + m;
602
+ backgroundColor = theme.palette.infoBackground;
603
+ fontWeight = 'bold';
604
+ } else if (subkind === 'box' || subkind === 'box-left') {
605
+ if (subkind === 'box-left') {
606
+ justifyContent = 'flex-start';
607
+ }
608
+ rightMargin = Unit.multiply(m, -1);
609
+ leftMargin = Unit.multiply(m, -1);
610
+ let topPadding = halfMargin;
611
+ let rightPadding = m;
612
+ let bottomPadding = halfMargin;
613
+ let leftPadding = m;
614
+ borderTopColor = theme.palette.paneNavigatorInactiveBorder;
615
+ borderBottomColor = theme.palette.paneNavigatorInactiveBorder;
616
+ borderTopWidth = '1px';
617
+ borderBottomWidth = '1px';
618
+ borderTopStyle = 'solid';
619
+ borderBottomStyle = 'solid';
620
+ topMargin = halfMargin;
621
+ bottomMargin = Unit.sub(Unit.multiply(halfMargin, -1), '1px');
622
+ if (markColor) {
623
+ borderLeftWidth = theme.shapes.markWidth;
624
+ borderLeftStyle = 'solid';
625
+ borderLeftColor = ColorHelpers.getMarkColor(theme, markColor);
626
+ leftPadding = Unit.sub(leftPadding, theme.shapes.markWidth);
627
+ }
628
+ padding =
629
+ topPadding +
630
+ ' ' +
631
+ rightPadding +
632
+ ' ' +
633
+ bottomPadding +
634
+ ' ' +
635
+ leftPadding;
636
+ } else if (subkind === 'light-box') {
637
+ rightMargin = Unit.multiply(m, -1);
638
+ leftMargin = Unit.multiply(m, -1);
639
+ topMargin = Unit.multiply(halfMargin, -1);
640
+ bottomMargin = '0px';
641
+ } else if (subkind === 'large-box') {
642
+ rightMargin = Unit.multiply(m, -1);
643
+ leftMargin = Unit.multiply(m, -1);
644
+ let topPadding = '0px';
645
+ let rightPadding = '0px';
646
+ let bottomPadding = '0px';
647
+ let leftPadding = theme.shapes.markWidth;
648
+ borderTopColor = theme.palette.paneNavigatorInactiveBorder;
649
+ borderBottomColor = theme.palette.paneNavigatorInactiveBorder;
650
+ borderTopWidth = '1px';
651
+ borderBottomWidth = '1px';
652
+ borderTopStyle = 'solid';
653
+ borderBottomStyle = 'solid';
654
+ topMargin = halfMargin;
655
+ bottomMargin = Unit.sub(Unit.multiply(halfMargin, -1), '1px');
656
+ if (selected) {
657
+ borderLeftWidth = theme.shapes.markWidth;
658
+ borderLeftStyle = 'solid';
659
+ borderLeftColor = ColorHelpers.getMarkColor(theme, 'base');
660
+ leftPadding = '0px';
661
+ }
662
+ padding =
663
+ topPadding +
664
+ ' ' +
665
+ rightPadding +
666
+ ' ' +
667
+ bottomPadding +
668
+ ' ' +
669
+ leftPadding;
670
+ } else if (subkind === 'list') {
671
+ borderBottomColor = theme.palette.paneNavigatorInactiveBorder;
672
+ borderBottomWidth = '1px';
673
+ borderBottomStyle = 'solid';
674
+ padding = '0px';
675
+ bottomMargin = '0px';
676
+ } else if (subkind === 'footer') {
677
+ rightMargin = Unit.multiply(m, -1);
678
+ leftMargin = Unit.multiply(m, -1);
679
+ topMargin = halfMargin;
680
+ bottomMargin = Unit.sub(Unit.multiply(halfMargin, -1), '1px');
681
+ padding = '0px';
682
+ } else if (subkind === 'wrap') {
683
+ display = 'flex';
684
+ flexDirection = 'row';
685
+ flexWrap = 'wrap';
686
+ justifyContent = 'flex-start';
687
+ alignItems = 'center';
688
+ leftMargin = Unit.multiply(m, -0.25);
689
+ rightMargin = Unit.multiply(m, -0.25);
690
+ topMargin = Unit.multiply(m, -0.25);
691
+ bottomMargin = Unit.multiply(m, 0.25);
692
+ } else if (subkind === 'left') {
693
+ justifyContent = 'flex-start';
694
+ }
695
+ if (selected && subkind !== 'large-box') {
696
+ backgroundColor = theme.palette.paneSelectedBackground;
697
+ color = theme.palette.paneSelectedText;
698
+ }
699
+ margin =
700
+ topMargin + ' ' + rightMargin + ' ' + bottomMargin + ' ' + leftMargin;
701
+ }
702
+
703
+ if (kind === 'row-field') {
704
+ const halfMargin = Unit.multiply(m, 0.5);
705
+ let topMargin = '0px';
706
+ let rightMargin = '0px';
707
+ let bottomMargin = s;
708
+ let leftMargin = '0px';
709
+ display = 'flex';
710
+ flexDirection = 'row';
711
+ flexGrow = grow;
712
+ alignItems = verticalJustify === 'top' ? 'flex-start' : 'center';
713
+ minHeight = Unit.add(h, '1px');
714
+ if (subkind === 'left') {
715
+ justifyContent = 'flex-start';
716
+ } else if (subkind === 'light-box') {
717
+ rightMargin = Unit.multiply(m, -1);
718
+ leftMargin = Unit.multiply(m, -1);
719
+ topMargin = Unit.multiply(halfMargin, -1);
720
+ bottomMargin = '0px';
721
+ } else if (subkind === 'border-box') {
722
+ padding = Unit.multiply(m, 0.5) + ' ' + m;
723
+ borderWidth = '1px';
724
+ borderStyle = 'solid';
725
+ borderColor = theme.palette.buttonBorder;
726
+ }
727
+ if (verticalSpacing === 'compact') {
728
+ minHeight = '20px';
729
+ bottomMargin = '0px';
730
+ } else if (verticalSpacing === 'normal') {
731
+ bottomMargin = '0px';
732
+ } else if (verticalSpacing === 'large') {
733
+ bottomMargin = '10px';
734
+ } else if (verticalSpacing === 'overlap') {
735
+ bottomMargin = '-1px';
736
+ }
737
+ margin =
738
+ topMargin + ' ' + rightMargin + ' ' + bottomMargin + ' ' + leftMargin;
739
+ }
740
+
741
+ if (kind === 'row-pane-drag') {
742
+ display = 'flex';
743
+ flexDirection = 'column';
744
+ margin =
745
+ Unit.multiply(m, 0.5) +
746
+ ' ' +
747
+ Unit.multiply(m, -1) +
748
+ ' ' +
749
+ Unit.multiply(m, -0.5) +
750
+ ' ' +
751
+ Unit.multiply(m, -1);
752
+ }
753
+
754
+ if (kind === 'row-wrap') {
755
+ margin = Unit.multiply(m, 0.25);
756
+ }
757
+
758
+ if (kind === 'compact-row') {
759
+ display = 'flex';
760
+ flexDirection = 'row';
761
+ justifyContent = 'flex-start';
762
+ alignItems = 'flex-start';
763
+ margin = '0px';
764
+ padding = '0px';
765
+ }
766
+
767
+ if (kind === 'backlog-row') {
768
+ display = 'flex';
769
+ flexDirection = 'row';
770
+ flexGrow = '1';
771
+ justifyContent = 'flex-start';
772
+ alignItems = 'flex-start';
773
+ margin = Unit.multiply(m, -1);
774
+ padding = '0px 0px ' + Unit.multiply(m, 0.5) + ' 0px';
775
+ backgroundColor = theme.palette.ticketsBackground;
776
+ }
777
+
778
+ if (kind === 'roadbook-row') {
779
+ display = 'flex';
780
+ flexDirection = 'row';
781
+ flexGrow = '1';
782
+ justifyContent = 'flex-start';
783
+ alignItems = 'flex-start';
784
+ margin = Unit.multiply(m, -1);
785
+ padding = '0px ' + m + ' ' + m + ' ' + m;
786
+ backgroundColor = theme.palette.ticketsBackground;
787
+ }
788
+
789
+ if (kind === 'desk-row') {
790
+ display = 'flex';
791
+ flexDirection = 'row';
792
+ flexGrow = '1';
793
+ justifyContent = 'flex-start';
794
+ alignItems = 'flex-start';
795
+ margin = Unit.multiply(m, -1);
796
+ padding = '0px ' + m + ' ' + m + ' ' + m;
797
+ backgroundColor = theme.palette.ticketsBackground;
798
+ }
799
+
800
+ if (kind === 'full-column') {
801
+ display = 'flex';
802
+ flexDirection = 'column';
803
+ flexGrow = '1';
804
+ margin = '0px';
805
+ padding = '0px';
806
+ }
807
+
808
+ if (kind === 'scrollable-column') {
809
+ display = 'flex';
810
+ flexDirection = 'column';
811
+ flexGrow = '1';
812
+ margin = '0px';
813
+ padding = '0px';
814
+ if (subkind === 'in-default-panel') {
815
+ // In default panel (edit to left or readonly to right), the vertical
816
+ // scrolling is globaly managed by parent pannel.
817
+ // Width is fix (700px).
818
+ width = Unit.sub('700px', '140px'); // 140px include margins, vertical toolbar and vertical scroller
819
+ overflowX = 'hidden';
820
+ overflowY = 'hidden';
821
+ } else if (subkind === 'wrap') {
822
+ flexWrap = 'wrap';
823
+ alignContent = 'flex-start';
824
+ padding = theme.shapes.containerMargin;
825
+ overflowX = 'auto';
826
+ overflowY = 'hidden';
827
+ } else if (subkind === 'padding') {
828
+ padding = theme.shapes.containerMargin;
829
+ overflowX = 'hidden';
830
+ overflowY = 'auto';
831
+ } else {
832
+ // In dedicated dispatch board-panel, the vertical scrolling is managed
833
+ // by this container.
834
+ // Width is variable, according to splitter.
835
+ overflowX = 'hidden';
836
+ overflowY = 'auto';
837
+ }
838
+ }
839
+
840
+ if (kind === 'footer') {
841
+ minHeight = theme.shapes.footerHeight;
842
+ display = 'flex';
843
+ flexDirection = 'row';
844
+ flexGrow = 0;
845
+ justifyContent = 'flex-start';
846
+ alignItems = 'center';
847
+ backgroundColor = theme.palette.footerBackground;
848
+ }
849
+
850
+ if (kind === 'tickets') {
851
+ const mm = Unit.multiply(m, 0.5);
852
+ overflowY = 'auto';
853
+ padding = '0px ' + mm + ' 0px ' + mm;
854
+ display = 'flex';
855
+ flexDirection = 'column';
856
+ flexGrow = '1';
857
+ backgroundColor = theme.palette.ticketsBackground;
858
+ }
859
+
860
+ if (kind === 'tickets-root') {
861
+ display = 'flex';
862
+ flexDirection = 'column';
863
+ flexGrow = 1;
864
+ overflowX = 'hidden';
865
+ }
866
+
867
+ if (kind === 'tickets-backlog') {
868
+ display = 'flex';
869
+ flexDirection = 'column';
870
+ flexGrow = 1;
871
+ overflowX = 'hidden';
872
+ overflowY = 'hidden';
873
+ backgroundColor = theme.palette.viewBackground;
874
+ }
875
+
876
+ if (kind === 'tickets-messengers') {
877
+ display = 'flex';
878
+ flexDirection = 'row';
879
+ flexGrow = 1;
880
+ }
881
+
882
+ if (kind === 'ticket-in-codispatch') {
883
+ display = 'flex';
884
+ flexDirection = 'row';
885
+ flexGrow = 1;
886
+ padding = theme.shapes.containerMargin;
887
+ backgroundColor = theme.palette.viewBackground;
888
+ }
889
+
890
+ if (kind === 'scrollable-tickets-messengers-top') {
891
+ width = 'calc(100vw - ' + theme.shapes.taskButtonWidth + ')';
892
+ overflowX = 'auto';
893
+ display = 'flex';
894
+ flexDirection = 'row';
895
+ flexGrow = 1;
896
+ }
897
+ if (kind === 'scrollable-tickets-messengers-right') {
898
+ width = '100%';
899
+ overflowX = 'auto';
900
+ display = 'flex';
901
+ flexDirection = 'row';
902
+ flexGrow = 1;
903
+ }
904
+
905
+ if (kind === 'scrollable-tickets-desks') {
906
+ overflowX = 'auto';
907
+ display = 'flex';
908
+ flexDirection = 'row';
909
+ flexGrow = 1;
910
+ padding = '0px ' + theme.shapes.containerMargin;
911
+ }
912
+
913
+ if (kind === 'roadbook-tickets') {
914
+ height = '100%';
915
+ const mm = Unit.multiply(m, 0.5);
916
+ padding = '0px ' + mm + ' 0px ' + mm;
917
+ display = 'flex';
918
+ flexDirection = 'column';
919
+ flexGrow = 1;
920
+ borderRightWidth = theme.shapes.viewSpacing;
921
+ borderRightStyle = 'solid';
922
+ borderRightColor = theme.palette.rootBackground;
923
+ backgroundColor = theme.palette.ticketsBackground;
924
+ }
925
+
926
+ if (kind === 'desk-tickets') {
927
+ const mm = Unit.multiply(m, 0.5);
928
+ padding = '0px ' + mm + ' 0px ' + mm;
929
+ display = 'flex';
930
+ flexDirection = 'column';
931
+ flexGrow = 1;
932
+ margin = '0px ' + theme.shapes.viewSpacing + ' 0px 0px';
933
+ backgroundColor = 'transparent';
934
+ }
935
+
936
+ if (kind === 'tickets-trips') {
937
+ display = 'flex';
938
+ flexDirection = 'column';
939
+ flexGrow = 1;
940
+ overflowX = 'hidden';
941
+ overflowY = 'auto';
942
+ }
943
+
944
+ if (kind === 'tickets-desk') {
945
+ position = 'relative';
946
+ display = 'flex';
947
+ flexDirection = 'row';
948
+ flexGrow = 1;
949
+ backgroundColor = theme.palette.ticketsBackground;
950
+ overflowY = 'auto';
951
+ }
952
+
953
+ if (kind === 'tickets-tray') {
954
+ minWidth = width ? width : theme.shapes.dispatchTicketWidth;
955
+ maxWidth = width ? width : theme.shapes.dispatchTicketWidth;
956
+ minHeight = height ? height : theme.shapes.dispatchTicketsHeight;
957
+ }
958
+
959
+ if (kind === 'ticket-row') {
960
+ display = 'flex';
961
+ flexDirection = 'row';
962
+ flexGrow = grow;
963
+ alignItems = 'baseline';
964
+ }
965
+
966
+ if (kind === 'ticket-column') {
967
+ display = 'flex';
968
+ flexDirection = 'column';
969
+ flexGrow = grow;
970
+ overflowX = 'hidden';
971
+ overflowY = 'hidden';
972
+ margin = '-5px 0px';
973
+ }
974
+
975
+ if (kind === 'drag-too-many') {
976
+ margin = '5px 0px 0px 0px';
977
+ padding = '8px 12px';
978
+ borderWidth = '1px';
979
+ borderStyle = 'solid';
980
+ borderRadius = '50px';
981
+ borderColor = theme.palette.buttonBorder;
982
+ backgroundColor = theme.palette.ticketsBackground;
983
+ boxShadow = theme.palette.dragAndDropShadow;
984
+ }
985
+
986
+ if (kind === 'drag-to-delete') {
987
+ width = '24px';
988
+ minHeight = '24px';
989
+ display = 'flex';
990
+ padding = '10px';
991
+ borderWidth = '1px';
992
+ borderStyle = 'solid';
993
+ borderRadius = '50px';
994
+ borderColor = theme.palette.buttonBorder;
995
+ backgroundColor = theme.palette.ticketsBackground;
996
+ alignItems = 'center';
997
+ justifyContent = 'center';
998
+ color = theme.palette.text;
999
+ }
1000
+
1001
+ if (kind === 'chronos-events') {
1002
+ display = 'flex';
1003
+ flexDirection = 'column';
1004
+ flexGrow = 1;
1005
+ overflowX = 'hidden';
1006
+ overflowY = 'auto';
1007
+ backgroundColor = theme.palette.eventBackground;
1008
+ }
1009
+
1010
+ if (kind === 'column-full') {
1011
+ display = 'flex';
1012
+ flexDirection = 'column';
1013
+ flexGrow = '1';
1014
+ overflowX = 'hidden';
1015
+ }
1016
+
1017
+ if (kind === 'column') {
1018
+ display = 'flex';
1019
+ flexDirection = 'column';
1020
+ flexGrow = grow;
1021
+ }
1022
+
1023
+ if (kind === 'column-minus-margin') {
1024
+ display = 'flex';
1025
+ flexDirection = 'column';
1026
+ flexGrow = grow;
1027
+ margin = Unit.multiply(m, -1);
1028
+ padding = m;
1029
+ }
1030
+
1031
+ if (kind === 'row') {
1032
+ display = 'flex';
1033
+ flexDirection = 'row';
1034
+ flexGrow = grow;
1035
+ if (subkind === 'center') {
1036
+ alignItems = 'center';
1037
+ }
1038
+ }
1039
+
1040
+ if (kind === 'row-draggable') {
1041
+ height = '100%';
1042
+ display = 'flex';
1043
+ flexDirection = 'row';
1044
+ flexGrow = grow;
1045
+ if (isDragged) {
1046
+ // borderWidth = '1px';
1047
+ // borderStyle = 'solid';
1048
+ // boxSizing = 'border-box';
1049
+ // borderColor = theme.palette.buttonBorder;
1050
+ backgroundColor = isTransparentWhenDrag
1051
+ ? null
1052
+ : theme.palette.dragAndDropBackground;
1053
+ boxShadow = isTransparentWhenDrag
1054
+ ? null
1055
+ : theme.palette.dragAndDropShadow;
1056
+ opacity = 0.9;
1057
+ } else if (hasHeLeft) {
1058
+ visibility = 'hidden';
1059
+ opacity = 0;
1060
+ }
1061
+ }
1062
+
1063
+ if (kind === 'wrap') {
1064
+ display = 'flex';
1065
+ flexDirection = 'row';
1066
+ flexWrap = 'wrap';
1067
+ flexGrow = grow;
1068
+ }
1069
+
1070
+ if (kind === 'boxes') {
1071
+ display = 'flex';
1072
+ flexDirection = 'row';
1073
+ flexWrap = 'wrap';
1074
+ justifyContent = 'flex-start';
1075
+ alignItems = 'center';
1076
+ }
1077
+
1078
+ if (kind === 'box') {
1079
+ width = '100%';
1080
+ display = 'flex';
1081
+ flexDirection = 'column';
1082
+ flexGrow = grow;
1083
+ justifyContent = 'center';
1084
+ borderWidth = subkind ? '1px' : '0px';
1085
+ borderStyle = subkind ? subkind : 'solid';
1086
+ borderRadius = theme.shapes.boxRadius;
1087
+ padding = s;
1088
+ }
1089
+
1090
+ if (kind === 'ticket-mode') {
1091
+ display = 'flex';
1092
+ flexDirection = 'column';
1093
+ flexGrow = grow;
1094
+ margin = '0px -20px 0px 0px';
1095
+ }
1096
+
1097
+ if (kind === 'glyph-samples') {
1098
+ display = 'flex';
1099
+ flexDirection = 'row';
1100
+ alignItems = 'center';
1101
+ height = '80px';
1102
+ overflowX = 'auto';
1103
+ overflowY = 'hidden';
1104
+ margin = '0px 20px 0px 0px';
1105
+ }
1106
+
1107
+ if (kind === 'glyph-samples-note') {
1108
+ display = 'flex';
1109
+ flexDirection = 'row';
1110
+ alignItems = 'center';
1111
+ overflowX = 'auto';
1112
+ overflowY = 'hidden';
1113
+ margin = '0px 10px 0px 0px';
1114
+ }
1115
+
1116
+ if (kind && kind.startsWith('thin-')) {
1117
+ if (border) {
1118
+ if (border === 'top') {
1119
+ borderStyle = 'solid none none none';
1120
+ } else if (border === 'right') {
1121
+ borderStyle = 'none solid none none';
1122
+ } else if (border === 'bottom') {
1123
+ borderStyle = 'none none solid none';
1124
+ } else if (border === 'left') {
1125
+ borderStyle = 'none none none solid';
1126
+ }
1127
+ borderWidth = '1px';
1128
+ borderColor = theme.palette.buttonBorder;
1129
+ } else {
1130
+ borderStyle = 'none';
1131
+ }
1132
+ }
1133
+
1134
+ if (kind === 'thin-main') {
1135
+ position = 'relative';
1136
+ display = 'flex';
1137
+ flexDirection = 'row';
1138
+ flexGrow = grow;
1139
+ justifyContent = 'center';
1140
+ borderWidth = '1px';
1141
+ borderStyle = 'solid';
1142
+ borderColor = theme.palette.buttonBorder;
1143
+ borderRadius = theme.shapes.thinRadius;
1144
+ if (selected) {
1145
+ backgroundColor = theme.palette.paneSelectedBackground;
1146
+ color = theme.palette.paneSelectedText;
1147
+ } else {
1148
+ backgroundColor = theme.palette.paneBackground;
1149
+ }
1150
+ }
1151
+
1152
+ if (kind === 'thin-center') {
1153
+ display = 'flex';
1154
+ flexDirection = 'column';
1155
+ flexGrow = grow;
1156
+ justifyContent = 'center';
1157
+ alignItems = 'center';
1158
+ }
1159
+
1160
+ if (kind === 'thin-column') {
1161
+ display = 'flex';
1162
+ flexDirection = 'column';
1163
+ flexGrow = grow;
1164
+ justifyContent = 'flex-start';
1165
+ }
1166
+
1167
+ if (kind === 'thin-row') {
1168
+ display = 'flex';
1169
+ flexDirection = 'row';
1170
+ flexGrow = grow;
1171
+ justifyContent = 'flex-start';
1172
+ alignItems = 'center';
1173
+ padding = '0px ' + theme.shapes.thinLeftMargin;
1174
+ }
1175
+
1176
+ if (kind === 'flying-combo') {
1177
+ display = 'flex';
1178
+ flexDirection = 'column';
1179
+ flexWrap = 'wrap';
1180
+ padding = theme.shapes.flyingBalloonPadding;
1181
+ backgroundColor = theme.palette.comboItemBackground;
1182
+ color = theme.palette.text;
1183
+ position = 'relative';
1184
+ boxShadow = theme.shapes.comboShadow;
1185
+ borderWidth = '1px';
1186
+ borderStyle = 'solid';
1187
+ borderColor = theme.palette.buttonBorder;
1188
+ borderRadius = theme.shapes.flyingBalloonRadius;
1189
+ }
1190
+
1191
+ if (kind === 'flying-balloon') {
1192
+ const fbp = theme.shapes.flyingBalloonPadding;
1193
+ display = 'flex';
1194
+ flexDirection = 'column';
1195
+ flexWrap = 'wrap';
1196
+ padding = Unit.add(fbp, '1px') + ' ' + fbp + ' ' + fbp + ' ' + fbp;
1197
+ backgroundColor =
1198
+ subkind === 'warning'
1199
+ ? theme.palette.flyingBalloonWarningBackground
1200
+ : theme.palette.flyingBalloonBackground;
1201
+ color = theme.palette.text;
1202
+ position = 'relative';
1203
+ boxShadow = theme.shapes.flyingShadow;
1204
+ borderRadius = theme.shapes.flyingBalloonRadius;
1205
+ }
1206
+
1207
+ if (kind === 'flying-chat') {
1208
+ const fbp = theme.shapes.chatPadding;
1209
+ display = 'flex';
1210
+ flexDirection = 'column';
1211
+ margin = '0px 0px ' + theme.shapes.chatVerticalSpacing + ' 0px';
1212
+ padding = fbp + ' ' + fbp + ' ' + fbp + ' ' + fbp;
1213
+ backgroundColor =
1214
+ subkind === 'me'
1215
+ ? theme.palette.chatMeBackground
1216
+ : theme.palette.chatOtherBackground;
1217
+ color = theme.palette.text;
1218
+ position = 'relative';
1219
+ borderRadius = theme.shapes.flyingBalloonRadius;
1220
+ }
1221
+
1222
+ if (kind === 'flying-dialog') {
1223
+ display = 'flex';
1224
+ flexDirection = 'column';
1225
+ flexGrow = '1';
1226
+ padding = theme.shapes.floatingPadding;
1227
+ backgroundColor = theme.palette.flyingDialogBackground;
1228
+ color = theme.palette.text;
1229
+ position = 'relative';
1230
+ boxShadow = theme.shapes.flyingShadow;
1231
+ borderRadius = theme.shapes.flyingDialogRadius;
1232
+ }
1233
+
1234
+ if (kind === 'push-to-edge') {
1235
+ if (subkind === 'flex') {
1236
+ display = 'flex';
1237
+ flexDirection = 'column';
1238
+ }
1239
+ flexGrow = 1;
1240
+ margin = Unit.multiply(m, 0.5) + ' ' + Unit.multiply(m, -1);
1241
+ }
1242
+
1243
+ if (kind === 'absolute-top-right') {
1244
+ position = 'absolute';
1245
+ top = '0px';
1246
+ right = '0px';
1247
+ }
1248
+
1249
+ // WIP: This code generate problems of layout with 'row-field'.
1250
+ //? if (flexGrow) {
1251
+ //? flexShrink = '1';
1252
+ //? flexBasis = '0%';
1253
+ //? }
1254
+
1255
+ // With flex="2 1 0%", set properties:
1256
+ // flexGrow = "2"
1257
+ // flexShrink = "1"
1258
+ // flexBasis = "0%"
1259
+ if (
1260
+ flexGrow &&
1261
+ typeof flexGrow === 'string' &&
1262
+ flexGrow.indexOf(' ') !== -1
1263
+ ) {
1264
+ const parts = flexGrow.split(' ');
1265
+ flexGrow = parts[0];
1266
+ if (parts.length >= 3) {
1267
+ flexShrink = parts[1];
1268
+ flexBasis = parts[2];
1269
+ }
1270
+ }
1271
+
1272
+ if (hidden) {
1273
+ display = 'none';
1274
+ }
1275
+
1276
+ if (backgroundColorProp) {
1277
+ backgroundColor = ColorHelpers.getMarkColor(theme, backgroundColorProp);
1278
+ }
1279
+
1280
+ const boxStyle = {
1281
+ 'fontFamily': fontFamily,
1282
+ 'width': width,
1283
+ 'height': height,
1284
+ 'minWidth': minWidth,
1285
+ 'minHeight': minHeight,
1286
+ 'maxWidth': maxWidth,
1287
+ 'maxHeight': maxHeight,
1288
+ 'display': display,
1289
+ 'overflowX': overflowX,
1290
+ 'overflowY': overflowY,
1291
+ 'flexDirection': flexDirection,
1292
+ 'flexWrap': flexWrap,
1293
+ 'flexGrow': flexGrow,
1294
+ 'flexShrink': flexShrink,
1295
+ 'flexBasis': flexBasis,
1296
+ 'justifyContent': justifyContent,
1297
+ 'alignItems': alignItems,
1298
+ 'alignContent': alignContent,
1299
+ 'alignSelf': alignSelf,
1300
+ 'boxSizing': boxSizing,
1301
+ 'borderWidth': borderWidth,
1302
+ 'borderStyle': borderStyle,
1303
+ 'borderColor': borderColor,
1304
+ 'borderTopWidth': borderTopWidth,
1305
+ 'borderTopStyle': borderTopStyle,
1306
+ 'borderTopColor': borderTopColor,
1307
+ 'borderRightWidth': borderRightWidth,
1308
+ 'borderRightStyle': borderRightStyle,
1309
+ 'borderRightColor': borderRightColor,
1310
+ 'borderBottomWidth': borderBottomWidth,
1311
+ 'borderBottomStyle': borderBottomStyle,
1312
+ 'borderBottomColor': borderBottomColor,
1313
+ 'borderLeftWidth': borderLeftWidth,
1314
+ 'borderLeftStyle': borderLeftStyle,
1315
+ 'borderLeftColor': borderLeftColor,
1316
+ 'borderRadius': borderRadius,
1317
+ 'boxShadow': boxShadow,
1318
+ 'margin': margin,
1319
+ 'marginLeft': marginLeft,
1320
+ 'marginRight': marginRight,
1321
+ 'padding': padding,
1322
+ 'background': backgroundColor,
1323
+ 'color': color,
1324
+ 'fontWeight': fontWeight,
1325
+ 'zIndex': zIndex,
1326
+ 'position': position,
1327
+ 'left': left,
1328
+ 'right': right,
1329
+ 'top': top,
1330
+ 'bottom': bottom,
1331
+ 'transform': transform,
1332
+ 'transition': transition,
1333
+ 'visibility': visibility,
1334
+ 'opacity': opacity,
1335
+ 'cursor': cursor,
1336
+ ':hover': hover,
1337
+ };
1338
+
1339
+ // A Container with kind='flying-balloon' has a standard behavior. It behaves like
1340
+ // a box with a small triangle which overlaps with the upper part (for example).
1341
+ let triangleStyle = null;
1342
+ if (
1343
+ kind === 'flying-combo' ||
1344
+ kind === 'flying-balloon' ||
1345
+ kind === 'flying-chat' ||
1346
+ kind === 'flying-dialog'
1347
+ ) {
1348
+ let triangleSize, triangleColor;
1349
+ if (
1350
+ kind === 'flying-combo' ||
1351
+ kind === 'flying-balloon' ||
1352
+ kind === 'flying-chat'
1353
+ ) {
1354
+ triangleSize = theme.shapes.flyingBalloonTriangleSize;
1355
+ triangleColor = backgroundColor
1356
+ ? backgroundColor
1357
+ : theme.palette.flyingBalloonBackground;
1358
+ } else {
1359
+ triangleSize = theme.shapes.flyingDialogTriangleSize;
1360
+ triangleColor = backgroundColor
1361
+ ? backgroundColor
1362
+ : theme.palette.flyingDialogBackground;
1363
+ }
1364
+ const t = Unit.add(triangleSize, '1px', 0); // round (suppress decimals)
1365
+ const tt = triangleShift ? Unit.add(t, triangleShift) : t;
1366
+ const p = triangleSize;
1367
+ if (trianglePosition === 'left') {
1368
+ triangleStyle = {
1369
+ position: 'absolute',
1370
+ height: '0px',
1371
+ bottom: 'calc(50% - ' + tt + ')',
1372
+ left: '-' + p,
1373
+ borderTop: t + ' solid transparent',
1374
+ borderBottom: t + ' solid transparent',
1375
+ borderRight: t + ' solid ' + triangleColor,
1376
+ pointerEvents: 'none',
1377
+ };
1378
+ } else if (trianglePosition === 'right') {
1379
+ triangleStyle = {
1380
+ position: 'absolute',
1381
+ height: '0px',
1382
+ bottom: 'calc(50% - ' + tt + ')',
1383
+ right: '-' + p,
1384
+ borderTop: t + ' solid transparent',
1385
+ borderBottom: t + ' solid transparent',
1386
+ borderLeft: t + ' solid ' + triangleColor,
1387
+ pointerEvents: 'none',
1388
+ };
1389
+ } else if (trianglePosition === 'bottom') {
1390
+ triangleStyle = {
1391
+ position: 'absolute',
1392
+ width: '0px',
1393
+ left: 'calc(50% - ' + tt + ')',
1394
+ bottom: '-' + p,
1395
+ borderLeft: t + ' solid transparent',
1396
+ borderRight: t + ' solid transparent',
1397
+ borderTop: t + ' solid ' + triangleColor,
1398
+ pointerEvents: 'none',
1399
+ };
1400
+ } else if (trianglePosition === 'top') {
1401
+ triangleStyle = {
1402
+ position: 'absolute',
1403
+ width: '0px',
1404
+ left: 'calc(50% - ' + tt + ')',
1405
+ top: '-' + p,
1406
+ borderLeft: t + ' solid transparent',
1407
+ borderRight: t + ' solid transparent',
1408
+ borderBottom: t + ' solid ' + triangleColor,
1409
+ pointerEvents: 'none',
1410
+ };
1411
+ } else {
1412
+ triangleStyle = {};
1413
+ }
1414
+ }
1415
+
1416
+ const busyBoxStyle = {
1417
+ position: 'absolute',
1418
+ width: '100%',
1419
+ height: '100%',
1420
+ display: 'flex',
1421
+ top: 0,
1422
+ left: 0,
1423
+ backgroundColor: busyBackgroundColor || theme.palette.busyBackground,
1424
+ };
1425
+
1426
+ const busyGlyphStyle = {
1427
+ margin: 'auto',
1428
+ color: theme.palette.busyForeground,
1429
+ };
1430
+
1431
+ return {
1432
+ box: boxStyle,
1433
+ triangle: triangleStyle,
1434
+ busyBox: busyBoxStyle,
1435
+ busyGlyph: busyGlyphStyle,
1436
+ };
1437
+ }
1438
+
1439
+ /******************************************************************************/