@gravitee/ui-components 3.25.3-typescript-8a53edf → 3.25.3-typescript-e7256ca

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 (370) hide show
  1. package/package.json +3 -4
  2. package/src/atoms/gv-autocomplete.d.ts +104 -0
  3. package/src/atoms/gv-autocomplete.js +1 -461
  4. package/src/atoms/gv-button.d.ts +109 -0
  5. package/src/atoms/gv-button.js +1 -410
  6. package/src/atoms/gv-checkbox.d.ts +114 -0
  7. package/src/atoms/gv-checkbox.js +1 -187
  8. package/src/atoms/gv-date-picker-calendar.d.ts +190 -0
  9. package/src/atoms/gv-date-picker-calendar.js +1 -894
  10. package/src/atoms/gv-date-picker-cell.d.ts +80 -0
  11. package/src/atoms/gv-date-picker-cell.js +1 -190
  12. package/src/atoms/gv-date-picker.d.ts +194 -0
  13. package/src/atoms/gv-date-picker.js +1 -671
  14. package/src/atoms/gv-file-upload.d.ts +64 -0
  15. package/src/atoms/gv-file-upload.js +1 -367
  16. package/src/atoms/gv-icon.d.ts +26 -0
  17. package/src/atoms/gv-icon.js +1 -103
  18. package/src/atoms/gv-image.d.ts +45 -0
  19. package/src/atoms/gv-image.js +1 -144
  20. package/src/atoms/gv-input-message.d.ts +20 -0
  21. package/src/atoms/gv-input-message.js +1 -84
  22. package/src/atoms/gv-input.d.ts +246 -0
  23. package/src/atoms/gv-input.js +1 -561
  24. package/src/atoms/gv-link.d.ts +67 -0
  25. package/src/atoms/gv-link.js +1 -210
  26. package/src/atoms/gv-message.d.ts +23 -0
  27. package/src/atoms/gv-message.js +1 -128
  28. package/src/atoms/gv-metric.d.ts +32 -0
  29. package/src/atoms/gv-metric.js +1 -117
  30. package/src/atoms/gv-relative-time.d.ts +45 -0
  31. package/src/atoms/gv-relative-time.js +1 -156
  32. package/src/atoms/gv-select-native.d.ts +174 -0
  33. package/src/atoms/gv-select-native.js +1 -388
  34. package/src/atoms/gv-select.d.ts +71 -0
  35. package/src/atoms/gv-select.js +1 -437
  36. package/src/atoms/gv-spinner.d.ts +10 -0
  37. package/src/atoms/gv-spinner.js +1 -57
  38. package/src/atoms/gv-state.d.ts +50 -0
  39. package/src/atoms/gv-state.js +1 -130
  40. package/src/atoms/gv-switch.d.ts +60 -0
  41. package/src/atoms/gv-switch.js +1 -243
  42. package/src/atoms/gv-tag.d.ts +69 -0
  43. package/src/atoms/gv-tag.js +1 -168
  44. package/src/atoms/gv-text.d.ts +110 -0
  45. package/src/atoms/gv-text.js +1 -168
  46. package/src/charts/gv-chart-bar.d.ts +50 -0
  47. package/src/charts/gv-chart-bar.js +1 -103
  48. package/src/charts/gv-chart-gauge.d.ts +58 -0
  49. package/src/charts/gv-chart-gauge.js +1 -100
  50. package/src/charts/gv-chart-histogram.d.ts +48 -0
  51. package/src/charts/gv-chart-histogram.js +1 -83
  52. package/src/charts/gv-chart-line.d.ts +52 -0
  53. package/src/charts/gv-chart-line.js +1 -224
  54. package/src/charts/gv-chart-map.d.ts +50 -0
  55. package/src/charts/gv-chart-map.js +1 -112
  56. package/src/charts/gv-chart-pie.d.ts +50 -0
  57. package/src/charts/gv-chart-pie.js +1 -91
  58. package/src/index.d.ts +77 -0
  59. package/src/index.js +1 -77
  60. package/src/lib/cron-expression.d.ts +1 -0
  61. package/src/lib/cron-expression.js +1 -205
  62. package/src/lib/date.d.ts +1 -0
  63. package/src/lib/date.js +1 -44
  64. package/src/lib/events.d.ts +1 -0
  65. package/src/lib/events.js +1 -26
  66. package/src/lib/http-client-schema-form.d.ts +68 -0
  67. package/src/lib/http-client-schema-form.js +1 -67
  68. package/src/lib/http.d.ts +222 -0
  69. package/src/lib/http.js +1 -237
  70. package/src/lib/i18n.d.ts +30 -0
  71. package/src/lib/i18n.js +1 -103
  72. package/src/lib/item.d.ts +12 -0
  73. package/src/lib/item.js +1 -118
  74. package/src/lib/properties.d.ts +42 -0
  75. package/src/lib/properties.js +1 -189
  76. package/src/lib/schema-form.d.ts +5 -0
  77. package/src/lib/schema-form.js +1 -44
  78. package/src/lib/studio.d.ts +2 -0
  79. package/src/lib/studio.js +1 -141
  80. package/src/lib/style.d.ts +6 -0
  81. package/src/lib/style.js +1 -41
  82. package/src/lib/text-format.d.ts +6 -0
  83. package/src/lib/text-format.js +1 -69
  84. package/src/lib/theme.d.ts +4 -0
  85. package/src/lib/theme.js +1 -63
  86. package/src/lib/utils.d.ts +9 -0
  87. package/src/lib/utils.js +1 -111
  88. package/src/mixins/chart-element.d.ts +39 -0
  89. package/src/mixins/chart-element.js +1 -165
  90. package/src/mixins/input-element.d.ts +64 -0
  91. package/src/mixins/input-element.js +1 -144
  92. package/src/mixins/item-resource.d.ts +56 -0
  93. package/src/mixins/item-resource.js +1 -120
  94. package/src/mixins/keyboard-element.d.ts +25 -0
  95. package/src/mixins/keyboard-element.js +1 -69
  96. package/src/mixins/update-after-browser.d.ts +11 -0
  97. package/src/mixins/update-after-browser.js +1 -30
  98. package/src/mixins/with-resize-observer.d.ts +12 -0
  99. package/src/mixins/with-resize-observer.js +1 -68
  100. package/src/mixins/with-skeleton-attribute.d.ts +35 -0
  101. package/src/mixins/with-skeleton-attribute.js +1 -112
  102. package/src/molecules/gv-card-full.d.ts +78 -0
  103. package/src/molecules/gv-card-full.js +1 -218
  104. package/src/molecules/gv-card-list.d.ts +33 -0
  105. package/src/molecules/gv-card-list.js +1 -113
  106. package/src/molecules/gv-card.d.ts +65 -0
  107. package/src/molecules/gv-card.js +1 -133
  108. package/src/molecules/gv-category-list.d.ts +17 -0
  109. package/src/molecules/gv-category-list.js +1 -60
  110. package/src/molecules/gv-category.d.ts +64 -0
  111. package/src/molecules/gv-category.js +1 -170
  112. package/src/molecules/gv-code.d.ts +192 -0
  113. package/src/molecules/gv-code.js +1 -359
  114. package/src/molecules/gv-confirm.d.ts +60 -0
  115. package/src/molecules/gv-confirm.js +1 -188
  116. package/src/molecules/gv-cron-editor.d.ts +115 -0
  117. package/src/molecules/gv-cron-editor.js +1 -710
  118. package/src/molecules/gv-dropdown-menu.d.ts +28 -0
  119. package/src/molecules/gv-dropdown-menu.js +1 -116
  120. package/src/molecules/gv-expandable.d.ts +37 -0
  121. package/src/molecules/gv-expandable.js +1 -122
  122. package/src/molecules/gv-expression-language.d.ts +150 -0
  123. package/src/molecules/gv-expression-language.js +1 -270
  124. package/src/molecules/gv-identity-picture.d.ts +44 -0
  125. package/src/molecules/gv-identity-picture.js +1 -148
  126. package/src/molecules/gv-list.d.ts +123 -0
  127. package/src/molecules/gv-list.js +1 -227
  128. package/src/molecules/gv-metrics.d.ts +65 -0
  129. package/src/molecules/gv-metrics.js +1 -162
  130. package/src/molecules/gv-modal.d.ts +64 -0
  131. package/src/molecules/gv-modal.js +1 -213
  132. package/src/molecules/gv-nav.d.ts +41 -0
  133. package/src/molecules/gv-nav.js +1 -196
  134. package/src/molecules/gv-option.d.ts +65 -0
  135. package/src/molecules/gv-option.js +1 -242
  136. package/src/molecules/gv-plans.d.ts +73 -0
  137. package/src/molecules/gv-plans.js +1 -429
  138. package/src/molecules/gv-popover.d.ts +91 -0
  139. package/src/molecules/gv-popover.js +1 -351
  140. package/src/molecules/gv-promote.d.ts +108 -0
  141. package/src/molecules/gv-promote.js +1 -209
  142. package/src/molecules/gv-rating-list.d.ts +77 -0
  143. package/src/molecules/gv-rating-list.js +1 -365
  144. package/src/molecules/gv-rating.d.ts +55 -0
  145. package/src/molecules/gv-rating.js +1 -253
  146. package/src/molecules/gv-row-expandable.d.ts +8 -0
  147. package/src/molecules/gv-row-expandable.js +1 -45
  148. package/src/molecules/gv-row.d.ts +37 -0
  149. package/src/molecules/gv-row.js +1 -210
  150. package/src/molecules/gv-stats.d.ts +53 -0
  151. package/src/molecules/gv-stats.js +1 -121
  152. package/src/molecules/gv-stepper.d.ts +46 -0
  153. package/src/molecules/gv-stepper.js +1 -288
  154. package/src/molecules/gv-table.d.ts +159 -0
  155. package/src/molecules/gv-table.js +1 -685
  156. package/src/molecules/gv-tree.d.ts +44 -0
  157. package/src/molecules/gv-tree.js +1 -250
  158. package/src/organisms/gv-documentation.d.ts +52 -0
  159. package/src/organisms/gv-documentation.js +1 -215
  160. package/src/organisms/gv-header.d.ts +60 -0
  161. package/src/organisms/gv-header.js +1 -288
  162. package/src/organisms/gv-http-client.d.ts +57 -0
  163. package/src/organisms/gv-http-client.js +1 -275
  164. package/src/organisms/gv-menu.d.ts +74 -0
  165. package/src/organisms/gv-menu.js +1 -263
  166. package/src/organisms/gv-newsletter-subscription.d.ts +82 -0
  167. package/src/organisms/gv-newsletter-subscription.js +1 -271
  168. package/src/organisms/gv-pagination.d.ts +63 -0
  169. package/src/organisms/gv-pagination.js +1 -198
  170. package/src/organisms/gv-properties.d.ts +229 -0
  171. package/src/organisms/gv-properties.js +1 -920
  172. package/src/organisms/gv-resizable-views.d.ts +33 -0
  173. package/src/organisms/gv-resizable-views.js +1 -396
  174. package/src/organisms/gv-resources.d.ts +125 -0
  175. package/src/organisms/gv-resources.js +1 -535
  176. package/src/organisms/gv-schema-form-array.d.ts +55 -0
  177. package/src/organisms/gv-schema-form-array.js +1 -250
  178. package/src/organisms/gv-schema-form-control-object.d.ts +64 -0
  179. package/src/organisms/gv-schema-form-control-object.js +1 -154
  180. package/src/organisms/gv-schema-form-control.d.ts +90 -0
  181. package/src/organisms/gv-schema-form-control.js +1 -443
  182. package/src/organisms/gv-schema-form.d.ts +156 -0
  183. package/src/organisms/gv-schema-form.js +1 -751
  184. package/src/organisms/gv-tabs.d.ts +56 -0
  185. package/src/organisms/gv-tabs.js +1 -210
  186. package/src/organisms/gv-user-menu.d.ts +56 -0
  187. package/src/organisms/gv-user-menu.js +1 -314
  188. package/src/organisms/gv-vertical-menu.d.ts +28 -0
  189. package/src/organisms/gv-vertical-menu.js +1 -123
  190. package/src/policy-studio/gv-flow-step.d.ts +142 -0
  191. package/src/policy-studio/gv-flow-step.js +1 -464
  192. package/src/policy-studio/gv-flow.d.ts +89 -0
  193. package/src/policy-studio/gv-flow.js +1 -621
  194. package/src/policy-studio/gv-policy-studio-menu.d.ts +94 -0
  195. package/src/policy-studio/gv-policy-studio-menu.js +1 -750
  196. package/src/policy-studio/gv-policy-studio.d.ts +464 -0
  197. package/src/policy-studio/gv-policy-studio.js +1 -1842
  198. package/src/styles/empty.d.ts +1 -0
  199. package/src/styles/empty.js +1 -36
  200. package/src/styles/input.d.ts +1 -0
  201. package/src/styles/input.js +1 -263
  202. package/src/styles/link.d.ts +1 -0
  203. package/src/styles/link.js +1 -32
  204. package/src/styles/shapes.d.ts +2 -0
  205. package/src/styles/shapes.js +1 -17
  206. package/src/styles/skeleton.d.ts +1 -0
  207. package/src/styles/skeleton.js +1 -53
  208. package/src/styles/zoom.d.ts +1 -0
  209. package/src/styles/zoom.js +1 -40
  210. package/src/theme/gv-theme.d.ts +81 -0
  211. package/src/theme/gv-theme.js +1 -203
  212. package/wc/gv-autocomplete.d.ts +1 -0
  213. package/wc/gv-autocomplete.js +1 -1
  214. package/wc/gv-button.d.ts +1 -0
  215. package/wc/gv-button.js +1 -1
  216. package/wc/gv-card-full.d.ts +1 -0
  217. package/wc/gv-card-full.js +1 -1
  218. package/wc/gv-card-list.d.ts +1 -0
  219. package/wc/gv-card-list.js +1 -1
  220. package/wc/gv-card.d.ts +1 -0
  221. package/wc/gv-card.js +1 -1
  222. package/wc/gv-category-list.d.ts +1 -0
  223. package/wc/gv-category-list.js +1 -1
  224. package/wc/gv-category.d.ts +1 -0
  225. package/wc/gv-category.js +1 -1
  226. package/wc/gv-chart-bar.d.ts +1 -0
  227. package/wc/gv-chart-bar.js +1 -1
  228. package/wc/gv-chart-gauge.d.ts +1 -0
  229. package/wc/gv-chart-gauge.js +1 -1
  230. package/wc/gv-chart-histogram.d.ts +1 -0
  231. package/wc/gv-chart-histogram.js +1 -1
  232. package/wc/gv-chart-line.d.ts +1 -0
  233. package/wc/gv-chart-line.js +1 -1
  234. package/wc/gv-chart-map.d.ts +1 -0
  235. package/wc/gv-chart-map.js +1 -1
  236. package/wc/gv-chart-pie.d.ts +1 -0
  237. package/wc/gv-chart-pie.js +1 -1
  238. package/wc/gv-checkbox.d.ts +1 -0
  239. package/wc/gv-checkbox.js +1 -1
  240. package/wc/gv-code.d.ts +1 -0
  241. package/wc/gv-code.js +1 -1
  242. package/wc/gv-confirm.d.ts +1 -0
  243. package/wc/gv-confirm.js +1 -1
  244. package/wc/gv-cron-editor.d.ts +1 -0
  245. package/wc/gv-cron-editor.js +1 -1
  246. package/wc/gv-date-picker-calendar.d.ts +1 -0
  247. package/wc/gv-date-picker-calendar.js +1 -1
  248. package/wc/gv-date-picker-cell.d.ts +1 -0
  249. package/wc/gv-date-picker-cell.js +1 -1
  250. package/wc/gv-date-picker.d.ts +1 -0
  251. package/wc/gv-date-picker.js +1 -1
  252. package/wc/gv-documentation.d.ts +1 -0
  253. package/wc/gv-documentation.js +1 -1
  254. package/wc/gv-dropdown-menu.d.ts +1 -0
  255. package/wc/gv-dropdown-menu.js +1 -1
  256. package/wc/gv-expandable.d.ts +1 -0
  257. package/wc/gv-expandable.js +1 -1
  258. package/wc/gv-expression-language.d.ts +1 -0
  259. package/wc/gv-expression-language.js +1 -1
  260. package/wc/gv-file-upload.d.ts +1 -0
  261. package/wc/gv-file-upload.js +1 -1
  262. package/wc/gv-flow-step.d.ts +1 -0
  263. package/wc/gv-flow-step.js +1 -1
  264. package/wc/gv-flow.d.ts +1 -0
  265. package/wc/gv-flow.js +1 -1
  266. package/wc/gv-header.d.ts +1 -0
  267. package/wc/gv-header.js +1 -1
  268. package/wc/gv-http-client.d.ts +1 -0
  269. package/wc/gv-http-client.js +1 -1
  270. package/wc/gv-icon.d.ts +1 -0
  271. package/wc/gv-icon.js +1 -1
  272. package/wc/gv-identity-picture.d.ts +1 -0
  273. package/wc/gv-identity-picture.js +1 -1
  274. package/wc/gv-image.d.ts +1 -0
  275. package/wc/gv-image.js +1 -1
  276. package/wc/gv-input-message.d.ts +1 -0
  277. package/wc/gv-input-message.js +1 -1
  278. package/wc/gv-input.d.ts +1 -0
  279. package/wc/gv-input.js +1 -1
  280. package/wc/gv-link.d.ts +1 -0
  281. package/wc/gv-link.js +1 -1
  282. package/wc/gv-list.d.ts +1 -0
  283. package/wc/gv-list.js +1 -1
  284. package/wc/gv-menu.d.ts +1 -0
  285. package/wc/gv-menu.js +1 -1
  286. package/wc/gv-message.d.ts +1 -0
  287. package/wc/gv-message.js +1 -1
  288. package/wc/gv-metric.d.ts +1 -0
  289. package/wc/gv-metric.js +1 -1
  290. package/wc/gv-metrics.d.ts +1 -0
  291. package/wc/gv-metrics.js +1 -1
  292. package/wc/gv-modal.d.ts +1 -0
  293. package/wc/gv-modal.js +1 -1
  294. package/wc/gv-nav.d.ts +1 -0
  295. package/wc/gv-nav.js +1 -1
  296. package/wc/gv-newsletter-subscription.d.ts +1 -0
  297. package/wc/gv-newsletter-subscription.js +1 -1
  298. package/wc/gv-option.d.ts +1 -0
  299. package/wc/gv-option.js +1 -1
  300. package/wc/gv-pagination.d.ts +1 -0
  301. package/wc/gv-pagination.js +1 -1
  302. package/wc/gv-plans.d.ts +1 -0
  303. package/wc/gv-plans.js +1 -1
  304. package/wc/gv-policy-studio-menu.d.ts +1 -0
  305. package/wc/gv-policy-studio-menu.js +1 -1
  306. package/wc/gv-policy-studio.d.ts +1 -0
  307. package/wc/gv-policy-studio.js +1 -1
  308. package/wc/gv-popover.d.ts +1 -0
  309. package/wc/gv-popover.js +1 -1
  310. package/wc/gv-promote.d.ts +1 -0
  311. package/wc/gv-promote.js +1 -1
  312. package/wc/gv-properties.d.ts +1 -0
  313. package/wc/gv-properties.js +1 -1
  314. package/wc/gv-rating-list.d.ts +1 -0
  315. package/wc/gv-rating-list.js +1 -1
  316. package/wc/gv-rating.d.ts +1 -0
  317. package/wc/gv-rating.js +1 -1
  318. package/wc/gv-relative-time.d.ts +1 -0
  319. package/wc/gv-relative-time.js +1 -1
  320. package/wc/gv-resizable-views.d.ts +1 -0
  321. package/wc/gv-resizable-views.js +1 -1
  322. package/wc/gv-resources.d.ts +1 -0
  323. package/wc/gv-resources.js +1 -1
  324. package/wc/gv-row-expandable.d.ts +1 -0
  325. package/wc/gv-row-expandable.js +1 -1
  326. package/wc/gv-row.d.ts +1 -0
  327. package/wc/gv-row.js +1 -1
  328. package/wc/gv-schema-form-array.d.ts +1 -0
  329. package/wc/gv-schema-form-array.js +1 -1
  330. package/wc/gv-schema-form-control-object.d.ts +1 -0
  331. package/wc/gv-schema-form-control-object.js +1 -1
  332. package/wc/gv-schema-form-control.d.ts +1 -0
  333. package/wc/gv-schema-form-control.js +1 -1
  334. package/wc/gv-schema-form.d.ts +1 -0
  335. package/wc/gv-schema-form.js +1 -1
  336. package/wc/gv-select-native.d.ts +1 -0
  337. package/wc/gv-select-native.js +1 -1
  338. package/wc/gv-select.d.ts +1 -0
  339. package/wc/gv-select.js +1 -1
  340. package/wc/gv-spinner.d.ts +1 -0
  341. package/wc/gv-spinner.js +1 -1
  342. package/wc/gv-state.d.ts +1 -0
  343. package/wc/gv-state.js +1 -1
  344. package/wc/gv-stats.d.ts +1 -0
  345. package/wc/gv-stats.js +1 -1
  346. package/wc/gv-stepper.d.ts +1 -0
  347. package/wc/gv-stepper.js +1 -1
  348. package/wc/gv-switch.d.ts +1 -0
  349. package/wc/gv-switch.js +1 -1
  350. package/wc/gv-table.d.ts +1 -0
  351. package/wc/gv-table.js +1 -1
  352. package/wc/gv-tabs.d.ts +1 -0
  353. package/wc/gv-tabs.js +1 -1
  354. package/wc/gv-tag.d.ts +1 -0
  355. package/wc/gv-tag.js +1 -1
  356. package/wc/gv-text.d.ts +1 -0
  357. package/wc/gv-text.js +1 -1
  358. package/wc/gv-theme.d.ts +1 -0
  359. package/wc/gv-theme.js +1 -1
  360. package/wc/gv-tree.d.ts +1 -0
  361. package/wc/gv-tree.js +1 -1
  362. package/wc/gv-user-menu.d.ts +1 -0
  363. package/wc/gv-user-menu.js +1 -1
  364. package/wc/gv-vertical-menu.d.ts +1 -0
  365. package/wc/gv-vertical-menu.js +1 -1
  366. package/CHANGELOG.md +0 -1292
  367. package/LICENSE.txt +0 -202
  368. package/README.md +0 -195
  369. package/src/.eslintrc.js +0 -19
  370. package/src/theme/definition.json +0 -1762
package/src/lib/item.js CHANGED
@@ -1,118 +1 @@
1
- /*
2
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { getApplicationTypeIcon } from './theme';
17
- import { html } from 'lit';
18
-
19
- export function getVersion(item) {
20
- if (item) {
21
- if (item.version) {
22
- return item.version;
23
- } else if (item.applicationType) {
24
- const icon = getApplicationTypeIcon(item.applicationType);
25
- return html`<gv-icon shape="${icon}"></gv-icon>`;
26
- }
27
- }
28
- return null;
29
- }
30
-
31
- export function getTitle(item) {
32
- if (item) {
33
- return item.name;
34
- }
35
- return '';
36
- }
37
-
38
- export function getPicture(item) {
39
- if (item) {
40
- if (item.picture) {
41
- return item.picture;
42
- } else if (item._links && item._links.picture) {
43
- return item._links.picture;
44
- }
45
- }
46
- return null;
47
- }
48
-
49
- export function getBackground(item) {
50
- if (item) {
51
- if (item.background) {
52
- return item.background;
53
- } else if (item._links && item._links.background) {
54
- return item._links.background;
55
- }
56
- }
57
- return null;
58
- }
59
-
60
- export function getStates(item) {
61
- if (item) {
62
- return item.states;
63
- }
64
- return null;
65
- }
66
-
67
- export function getLabels(item) {
68
- if (item) {
69
- return item.labels;
70
- }
71
- return null;
72
- }
73
-
74
- export function getRating(item) {
75
- if (item) {
76
- return item.rating_summary;
77
- }
78
- return null;
79
- }
80
-
81
- export function getEntrypoints(item) {
82
- if (item) {
83
- return item.entrypoints || [];
84
- }
85
- return [];
86
- }
87
-
88
- export function getDescription(item) {
89
- if (item) {
90
- return item.description;
91
- }
92
- return '';
93
- }
94
-
95
- export function getOwner(item) {
96
- if (item && item.owner) {
97
- return item.owner.display_name;
98
- }
99
- return '';
100
- }
101
-
102
- export function getNbApisInView(item) {
103
- if (item && item.total_apis != null) {
104
- return item.total_apis;
105
- }
106
- return null;
107
- }
108
-
109
- export function getPictureDisplayName(item) {
110
- if (item) {
111
- if (item.version) {
112
- return `${getTitle(item)} ${item.version}`;
113
- } else if (item.applicationType) {
114
- return `${getTitle(item)} ${item.applicationType} ${getOwner(item)}`;
115
- }
116
- }
117
- return getTitle(item);
118
- }
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPictureDisplayName=exports.getNbApisInView=exports.getOwner=exports.getDescription=exports.getEntrypoints=exports.getRating=exports.getLabels=exports.getStates=exports.getBackground=exports.getPicture=exports.getTitle=exports.getVersion=void 0;const t=require("./theme"),e=require("lit");function r(t){return t?t.name:""}function n(t){return t&&t.owner?t.owner.display_name:""}exports.getVersion=function(r){if(r){if(r.version)return r.version;if(r.applicationType){const n=(0,t.getApplicationTypeIcon)(r.applicationType);return e.html`<gv-icon shape="${n}"></gv-icon>`}}return null},exports.getTitle=r,exports.getPicture=function(t){if(t){if(t.picture)return t.picture;if(t._links&&t._links.picture)return t._links.picture}return null},exports.getBackground=function(t){if(t){if(t.background)return t.background;if(t._links&&t._links.background)return t._links.background}return null},exports.getStates=function(t){return t?t.states:null},exports.getLabels=function(t){return t?t.labels:null},exports.getRating=function(t){return t?t.rating_summary:null},exports.getEntrypoints=function(t){return t&&t.entrypoints||[]},exports.getDescription=function(t){return t?t.description:""},exports.getOwner=n,exports.getNbApisInView=function(t){return t&&null!=t.total_apis?t.total_apis:null},exports.getPictureDisplayName=function(t){if(t){if(t.version)return`${r(t)} ${t.version}`;if(t.applicationType)return`${r(t)} ${t.applicationType} ${n(t)}`}return r(t)};
@@ -0,0 +1,42 @@
1
+ export function validateName(name: any): boolean;
2
+ export function parseRaw(rawInput?: string): {
3
+ variables: {
4
+ key: string;
5
+ value: any;
6
+ }[];
7
+ errors: ({
8
+ type: number;
9
+ pos: {
10
+ line: any;
11
+ column: any;
12
+ };
13
+ key?: undefined;
14
+ } | {
15
+ type: number;
16
+ key: string;
17
+ pos: {
18
+ line: any;
19
+ column: any;
20
+ };
21
+ })[];
22
+ };
23
+ export function toNameEqualsValueString(variables: any, options?: {}): any;
24
+ export function toNameValueObject(variables: any): {};
25
+ /**
26
+ * Thanks to https://github.com/CleverCloud/clever-client.js
27
+ *
28
+ * https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names
29
+ * Default bash/Linux rules are:
30
+ * letters (upper case only)
31
+ * digits (but not for first char)
32
+ * underscores
33
+ * nothing else
34
+ * /^[a-zA-Z_][a-zA-Z0-9_]*$/
35
+ */
36
+ export const ENV_VAR_NAME_REGEX: RegExp;
37
+ export namespace ERROR_TYPES {
38
+ const INVALID_NAME: number;
39
+ const DUPLICATED_NAME: number;
40
+ const INVALID_LINE: number;
41
+ const INVALID_VALUE: number;
42
+ }
@@ -1,189 +1 @@
1
- /*
2
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Thanks to https://github.com/CleverCloud/clever-client.js
18
- *
19
- * https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names
20
- * Default bash/Linux rules are:
21
- * letters (upper case only)
22
- * digits (but not for first char)
23
- * underscores
24
- * nothing else
25
- * /^[a-zA-Z_][a-zA-Z0-9_]*$/
26
- */
27
- export const ENV_VAR_NAME_REGEX = /^[a-zA-Z0-9-_.]+$/;
28
-
29
- export function validateName(name) {
30
- // return ENV_VAR_NAME_REGEX.test(name);
31
- return true;
32
- }
33
-
34
- export const ERROR_TYPES = {
35
- INVALID_NAME: 0,
36
- DUPLICATED_NAME: 1,
37
- INVALID_LINE: 2,
38
- INVALID_VALUE: 3,
39
- };
40
-
41
- const NEW_LINE = '\n';
42
- const SIMPLE_QUOTE = "'";
43
- const EQUAL = '=';
44
- const SLASH = '\\';
45
- const SIMPLE_QUOTE_REPLACE = /([\\]*)'/g;
46
- const DOUBLE_QUOTE = '"';
47
- const DOUBLE_QUOTE_REPLACE = /([\\]*)"/g;
48
-
49
- function nextIndex(text, char, start = 0) {
50
- let i = start;
51
- let escaped = false;
52
- while (i < text.length) {
53
- if (text[i] === char && !escaped) {
54
- return i;
55
- }
56
- escaped = text[i] === '\\';
57
- i += 1;
58
- }
59
- return i;
60
- }
61
-
62
- function isEmptyLine(line) {
63
- return line.trim() === '';
64
- }
65
-
66
- function isCommentLine(line) {
67
- return line.trim().startsWith('#');
68
- }
69
-
70
- function getPosition(text, index) {
71
- const lines = text.substring(0, index).split(NEW_LINE);
72
- const line = lines.length;
73
- const column = lines.slice(-1)[0].length;
74
- return { line, column };
75
- }
76
-
77
- // Here we surround a string with double quotes,
78
- // it means we need to escape existing double quotes,
79
- // we need to do so in a way that is compatible with shells and environment variables,
80
- // this is why we have (slashes * 2 + 1).
81
- function doubleQuoteString(str) {
82
- const escapedString = str.replace(DOUBLE_QUOTE_REPLACE, (m, slashes) => {
83
- return SLASH.repeat(slashes.length * 2 + 1) + DOUBLE_QUOTE;
84
- });
85
- return DOUBLE_QUOTE + escapedString + DOUBLE_QUOTE;
86
- }
87
-
88
- // Here we must be able to reverse what doubleQuoteString() does,
89
- // with the same logic,
90
- // we also want it to work with simple quotes.
91
- function unquoteString(firstChar, str) {
92
- if (firstChar === SIMPLE_QUOTE) {
93
- return str.replace(SIMPLE_QUOTE_REPLACE, (match, slashes) => {
94
- return SLASH.repeat((slashes.length - 1) / 2) + SIMPLE_QUOTE;
95
- });
96
- }
97
- if (firstChar === DOUBLE_QUOTE) {
98
- return str.replace(DOUBLE_QUOTE_REPLACE, (match, slashes) => {
99
- return SLASH.repeat((slashes.length - 1) / 2) + DOUBLE_QUOTE;
100
- });
101
- }
102
- return str;
103
- }
104
-
105
- export function parseRaw(rawInput = '') {
106
- const parsedVariables = [];
107
- const parsingErrors = [];
108
- const allNames = new Set();
109
-
110
- let startIdx = 0;
111
- while (startIdx < rawInput.length) {
112
- const nextNewLineIdx = nextIndex(rawInput, NEW_LINE, startIdx);
113
- const line = rawInput.substring(startIdx, nextNewLineIdx);
114
-
115
- if (isEmptyLine(line) || isCommentLine(line)) {
116
- startIdx = nextNewLineIdx + 1;
117
- continue;
118
- }
119
-
120
- if (!line.includes(EQUAL)) {
121
- parsingErrors.push({ type: ERROR_TYPES.INVALID_LINE, pos: getPosition(rawInput, startIdx) });
122
- startIdx = nextNewLineIdx + 1;
123
- continue;
124
- }
125
-
126
- const nextEqualIdx = nextIndex(rawInput, EQUAL, startIdx);
127
- const key = rawInput.substring(startIdx, nextEqualIdx);
128
-
129
- if (!validateName(key)) {
130
- parsingErrors.push({ type: ERROR_TYPES.INVALID_NAME, key, pos: getPosition(rawInput, startIdx) });
131
- }
132
-
133
- if (allNames.has(key)) {
134
- parsingErrors.push({ type: ERROR_TYPES.DUPLICATED_NAME, key, pos: getPosition(rawInput, startIdx) });
135
- } else {
136
- allNames.add(key);
137
- }
138
-
139
- const valueFirstChar = rawInput[nextEqualIdx + 1];
140
- if (valueFirstChar === SIMPLE_QUOTE || valueFirstChar === DOUBLE_QUOTE) {
141
- const nextQuoteIdx = nextIndex(rawInput, valueFirstChar, nextEqualIdx + 2);
142
- const rawValue = rawInput.substring(nextEqualIdx + 2, nextQuoteIdx);
143
- const value = unquoteString(valueFirstChar, rawValue);
144
- parsedVariables.push({ key, value });
145
- if (nextNewLineIdx > nextQuoteIdx + 1 || nextQuoteIdx + 1 > rawInput.length) {
146
- parsingErrors.push({ type: ERROR_TYPES.INVALID_VALUE, key, pos: getPosition(rawInput, nextQuoteIdx + 1) });
147
- startIdx = nextNewLineIdx + 1;
148
- } else {
149
- startIdx = nextQuoteIdx + 1;
150
- }
151
- } else {
152
- const value = rawInput.substring(nextEqualIdx + 1, nextNewLineIdx);
153
- parsedVariables.push({ key, value });
154
- startIdx = nextNewLineIdx + 1;
155
- }
156
- }
157
-
158
- // WARN: Array.prototype.sort edits in place
159
- parsedVariables.sort((a, b) => a.key.localeCompare(b.key));
160
-
161
- return { variables: parsedVariables, errors: parsingErrors };
162
- }
163
-
164
- // automatically merges duplicated named (keeps last value)
165
- // automatically removes variables with invalid names
166
- // always double quote values (with proper escaping)
167
- export function toNameEqualsValueString(variables, options = {}) {
168
- const { addExports = false } = options;
169
- return variables
170
- .sort((a, b) => a.key.localeCompare(b.key))
171
- .map(({ key, value }) => {
172
- const quotedValue = doubleQuoteString(value);
173
- const nameValue = `${key}=${quotedValue}`;
174
- return addExports ? `export ${nameValue};` : nameValue;
175
- })
176
- .join('\n');
177
- }
178
-
179
- // automatically merges duplicated named (keeps last value)
180
- // automatically removes variables with invalid names
181
- export function toNameValueObject(variables) {
182
- const keyValueObject = {};
183
- variables
184
- .filter(({ name }) => validateName(name))
185
- .forEach(({ name, value }) => {
186
- keyValueObject[name] = value;
187
- });
188
- return keyValueObject;
189
- }
1
+ function e(e){return!0}Object.defineProperty(exports,"__esModule",{value:!0}),exports.toNameValueObject=exports.toNameEqualsValueString=exports.parseRaw=exports.ERROR_TYPES=exports.validateName=exports.ENV_VAR_NAME_REGEX=void 0,exports.ENV_VAR_NAME_REGEX=/^[a-zA-Z0-9-_.]+$/,exports.validateName=e,exports.ERROR_TYPES={INVALID_NAME:0,DUPLICATED_NAME:1,INVALID_LINE:2,INVALID_VALUE:3};const t=/([\\]*)'/g,r=/([\\]*)"/g;function n(e,t,r=0){let n=r,s=!1;for(;n<e.length;){if(e[n]===t&&!s)return n;s="\\"===e[n],n+=1}return n}function s(e){return""===e.trim()}function o(e){return e.trim().startsWith("#")}function a(e,t){const r=e.substring(0,t).split("\n");return{line:r.length,column:r.slice(-1)[0].length}}exports.parseRaw=function(e=""){const u=[],p=[],l=new Set;let i=0;for(;i<e.length;){const R=n(e,"\n",i),_=e.substring(i,R);if(s(_)||o(_)){i=R+1;continue}if(!_.includes("=")){p.push({type:exports.ERROR_TYPES.INVALID_LINE,pos:a(e,i)}),i=R+1;continue}const N=n(e,"=",i),x=e.substring(i,N);l.has(x)?p.push({type:exports.ERROR_TYPES.DUPLICATED_NAME,key:x,pos:a(e,i)}):l.add(x);const f=e[N+1];if("'"===f||'"'===f){const s=n(e,f,N+2),o=e.substring(N+2,s),l=(E=o,"'"===(c=f)?E.replace(t,((e,t)=>"\\".repeat((t.length-1)/2)+"'")):'"'===c?E.replace(r,((e,t)=>"\\".repeat((t.length-1)/2)+'"')):E);u.push({key:x,value:l}),R>s+1||s+1>e.length?(p.push({type:exports.ERROR_TYPES.INVALID_VALUE,key:x,pos:a(e,s+1)}),i=R+1):i=s+1}else{const t=e.substring(N+1,R);u.push({key:x,value:t}),i=R+1}}var c,E;return u.sort(((e,t)=>e.key.localeCompare(t.key))),{variables:u,errors:p}},exports.toNameEqualsValueString=function(e,t={}){const{addExports:n=!1}=t;return e.sort(((e,t)=>e.key.localeCompare(t.key))).map((({key:e,value:t})=>{const s=`${e}=${'"'+t.replace(r,((e,t)=>"\\".repeat(2*t.length+1)+'"'))+'"'}`;return n?`export ${s};`:s})).join("\n")},exports.toNameValueObject=function(e){const t={};return e.filter((({name:e})=>!0)).forEach((({name:e,value:r})=>{t[e]=r})),t};
@@ -0,0 +1,5 @@
1
+ export function isCodemirror(control: any): any;
2
+ export function isObject(control: any): boolean;
3
+ export function isComplexArray(control: any): boolean;
4
+ export function canInline(schema: any): boolean;
5
+ export function canGrid(schema: any): boolean;
@@ -1,44 +1 @@
1
- /*
2
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export function isCodemirror(control) {
17
- return control['x-schema-form'] && control['x-schema-form'].type === 'codemirror';
18
- }
19
-
20
- export function isObject(control) {
21
- return control.type === 'object';
22
- }
23
-
24
- export function isComplexArray(control) {
25
- return control.type === 'array' && !control.items.enum;
26
- }
27
-
28
- export function canInline(schema) {
29
- if (schema.properties) {
30
- const keys = Object.keys(schema.properties);
31
- return keys.length === 2 && keys.filter((key) => _canInline(schema, key)).length === keys.length;
32
- }
33
- return true;
34
- }
35
-
36
- function _canInline(schema, key) {
37
- const property = schema.properties[key];
38
- return !isCodemirror(property) && !isObject(property) && !isComplexArray(property);
39
- }
40
-
41
- export function canGrid(schema) {
42
- const keys = Object.keys(schema.properties);
43
- return keys.length > 2 && keys.filter((key) => _canInline(schema, key)).length === keys.length;
44
- }
1
+ function e(e){return e["x-schema-form"]&&"codemirror"===e["x-schema-form"].type}function r(e){return"object"===e.type}function t(e){return"array"===e.type&&!e.items.enum}function n(n,o){const s=n.properties[o];return!e(s)&&!r(s)&&!t(s)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.canGrid=exports.canInline=exports.isComplexArray=exports.isObject=exports.isCodemirror=void 0,exports.isCodemirror=e,exports.isObject=r,exports.isComplexArray=t,exports.canInline=function(e){if(e.properties){const r=Object.keys(e.properties);return 2===r.length&&r.filter((r=>n(e,r))).length===r.length}return!0},exports.canGrid=function(e){const r=Object.keys(e.properties);return r.length>2&&r.filter((r=>n(e,r))).length===r.length};
@@ -0,0 +1,2 @@
1
+ export function getFlowName(flow: any, collectionName: any, withMethods?: boolean, draggable?: boolean, compact?: boolean): any[];
2
+ export const methods: import("lit").CSSResult;
package/src/lib/studio.js CHANGED
@@ -1,141 +1 @@
1
- /*
2
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { html, css } from 'lit';
17
- import { classMap } from 'lit/directives/class-map';
18
- import '../atoms/gv-icon';
19
- import '../atoms/gv-tag';
20
-
21
- // language=CSS
22
- export const methods = css`
23
- gv-tag {
24
- font-family: monospace;
25
- }
26
-
27
- gv-tag.ALL {
28
- --gv-tag--bdc: #262626;
29
- --gv-tag--bgc: #262626;
30
- --gv-tag--c: white;
31
- }
32
-
33
- gv-tag.POST {
34
- --gv-tag--bdc: #fb8c00;
35
- --gv-tag--bgc: #fb8c00;
36
- --gv-tag--c: white;
37
- }
38
-
39
- gv-tag.PUT {
40
- --gv-tag--bdc: #039be5;
41
- --gv-tag--bgc: #039be5;
42
- --gv-tag--c: white;
43
- }
44
-
45
- gv-tag.GET {
46
- --gv-tag--bdc: #43a047;
47
- --gv-tag--bgc: #43a047;
48
- --gv-tag--c: white;
49
- }
50
-
51
- gv-tag.DELETE {
52
- --gv-tag--bdc: #e53935;
53
- --gv-tag--bgc: #e53935;
54
- --gv-tag--c: white;
55
- }
56
-
57
- .flow-path,
58
- .plan-name {
59
- margin-left: 0.2rem;
60
- display: flex;
61
- align-items: center;
62
- }
63
-
64
- .collection-name {
65
- margin-right: 0.5rem;
66
- --gv-icon--s: 26px;
67
- --gv-icon--c: #5a7684;
68
- --gv-icon-opacity--c: #5a7684;
69
- }
70
-
71
- .icon-type {
72
- --gv-icon--s: 26px;
73
- --gv-icon--c: #383e3f;
74
- --gv-icon-opacity--c: #5a7684;
75
- }
76
- `;
77
-
78
- export function getFlowName(flow, collectionName, withMethods = true, draggable = false, compact = true) {
79
- let rendering = [];
80
- if (flow) {
81
- if (draggable) {
82
- rendering.push(html`<gv-icon title="Drag for reorder" class="draggable-icon" shape="general:sort"></gv-icon>`);
83
- }
84
- const methods = flow.methods || [];
85
- if (flow.type != null) {
86
- let shape = null;
87
- if (flow.type.toUpperCase() === 'ROOT') {
88
- shape = 'home:earth';
89
- } else if (flow.type.toUpperCase() === 'LOGIN') {
90
- shape = 'general:shield-protected';
91
- } else if (flow.type.toUpperCase() === 'CONSENT') {
92
- shape = 'general:shield-check';
93
- } else if (flow.type.toUpperCase() === 'REGISTER') {
94
- shape = 'communication:shield-user';
95
- }
96
-
97
- if (shape != null) {
98
- rendering = [...rendering, html`<gv-icon title="${flow.type}" shape="${shape}" class="icon-type"></gv-icon>`];
99
- }
100
- } else if (withMethods) {
101
- const renderingMethods = methods.map((method) => html`<gv-tag class="${method.toUpperCase()}">${method.toUpperCase()}</gv-tag>`);
102
- if (compact && (renderingMethods.length === 9 || renderingMethods.length === 0)) {
103
- rendering = [...rendering, html`<gv-tag major title="${methods.join('\n')}">ALL</gv-tag>`];
104
- } else if (compact && renderingMethods.length >= 3) {
105
- const renderingMethodsCompact = renderingMethods.slice(0, 2);
106
- renderingMethodsCompact.push(html`<gv-tag minor title="${methods.join('\n')}">+${renderingMethods.length - 2}</gv-tag>`);
107
- rendering = [...rendering, ...renderingMethodsCompact];
108
- } else {
109
- rendering = [...rendering, ...renderingMethods];
110
- }
111
- }
112
-
113
- const classes = {
114
- 'flow-path': true,
115
- disabled: flow.disabled,
116
- };
117
-
118
- if (flow.name != null && flow.name.trim() !== '') {
119
- if (flow._dirty) {
120
- rendering.push(html`<div class="${classMap(classes)}"><mark>${flow.name}</mark></div>`);
121
- } else {
122
- rendering.push(html`<div class="${classMap(classes)}">${flow.name}</div>`);
123
- }
124
- } else if (flow['path-operator']) {
125
- const path = flow['path-operator'].path || '/';
126
- if (path) {
127
- const pathWithOperator = flow['path-operator'].operator === 'STARTS_WITH' ? `${path.endsWith('/') ? path : `${path}/`}**` : path;
128
- if (flow._dirty) {
129
- rendering.push(html`<div class="${classMap(classes)}"><mark>${pathWithOperator}</mark></div>`);
130
- } else {
131
- rendering.push(html`<div class="${classMap(classes)}">${pathWithOperator}</div>`);
132
- }
133
- }
134
- }
135
-
136
- if (collectionName) {
137
- rendering.push(html`<div class="collection-name">${collectionName}</div>`);
138
- }
139
- }
140
- return rendering;
141
- }
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFlowName=exports.methods=void 0;const t=require("lit"),e=require("lit/directives/class-map");require("../atoms/gv-icon"),require("../atoms/gv-tag"),exports.methods=t.css`gv-tag{font-family:monospace}gv-tag.ALL{--gv-tag--bdc:#262626;--gv-tag--bgc:#262626;--gv-tag--c:white}gv-tag.POST{--gv-tag--bdc:#fb8c00;--gv-tag--bgc:#fb8c00;--gv-tag--c:white}gv-tag.PUT{--gv-tag--bdc:#039be5;--gv-tag--bgc:#039be5;--gv-tag--c:white}gv-tag.GET{--gv-tag--bdc:#43a047;--gv-tag--bgc:#43a047;--gv-tag--c:white}gv-tag.DELETE{--gv-tag--bdc:#e53935;--gv-tag--bgc:#e53935;--gv-tag--c:white}.flow-path,.plan-name{margin-left:.2rem;display:flex;align-items:center}.collection-name{margin-right:.5rem;--gv-icon--s:26px;--gv-icon--c:#5a7684;--gv-icon-opacity--c:#5a7684}.icon-type{--gv-icon--s:26px;--gv-icon--c:#383e3f;--gv-icon-opacity--c:#5a7684}`,exports.getFlowName=function(a,g,s=!0,i=!1,c=!0){let l=[];if(a){i&&l.push(t.html`<gv-icon title="Drag for reorder" class="draggable-icon" shape="general:sort"></gv-icon>`);const o=a.methods||[];if(null!=a.type){let e=null;"ROOT"===a.type.toUpperCase()?e="home:earth":"LOGIN"===a.type.toUpperCase()?e="general:shield-protected":"CONSENT"===a.type.toUpperCase()?e="general:shield-check":"REGISTER"===a.type.toUpperCase()&&(e="communication:shield-user"),null!=e&&(l=[...l,t.html`<gv-icon title="${a.type}" shape="${e}" class="icon-type"></gv-icon>`])}else if(s){const e=o.map((e=>t.html`<gv-tag class="${e.toUpperCase()}">${e.toUpperCase()}</gv-tag>`));if(!c||9!==e.length&&0!==e.length)if(c&&e.length>=3){const a=e.slice(0,2);a.push(t.html`<gv-tag minor title="${o.join("\n")}">+${e.length-2}</gv-tag>`),l=[...l,...a]}else l=[...l,...e];else l=[...l,t.html`<gv-tag major title="${o.join("\n")}">ALL</gv-tag>`]}const n={"flow-path":!0,disabled:a.disabled};if(null!=a.name&&""!==a.name.trim())a._dirty?l.push(t.html`<div class="${(0,e.classMap)(n)}"><mark>${a.name}</mark></div>`):l.push(t.html`<div class="${(0,e.classMap)(n)}">${a.name}</div>`);else if(a["path-operator"]){const g=a["path-operator"].path||"/";if(g){const s="STARTS_WITH"===a["path-operator"].operator?`${g.endsWith("/")?g:`${g}/`}**`:g;a._dirty?l.push(t.html`<div class="${(0,e.classMap)(n)}"><mark>${s}</mark></div>`):l.push(t.html`<div class="${(0,e.classMap)(n)}">${s}</div>`)}}g&&l.push(t.html`<div class="collection-name">${g}</div>`)}return l};
@@ -0,0 +1,6 @@
1
+ export function hexToRGB(hex: any): {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ } | null;
6
+ export function getCssVar(element: any, variableName: any, defaultValue: any): any;
package/src/lib/style.js CHANGED
@@ -1,41 +1 @@
1
- /*
2
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- function getPropertyValue(element, propertyName, defaultValue) {
17
- /* global getComputedStyle */
18
- const value = getComputedStyle(element).getPropertyValue(propertyName);
19
- return value.trim() || defaultValue;
20
- }
21
-
22
- export const getCssVar = function getCssVar(element, variableName, defaultValue) {
23
- if (element) {
24
- if (variableName.startsWith('--')) {
25
- return getPropertyValue(element, variableName, defaultValue);
26
- }
27
- return getPropertyValue(element, `--${variableName}`, defaultValue);
28
- }
29
- return defaultValue;
30
- };
31
-
32
- export function hexToRGB(hex) {
33
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex.trim());
34
- return result
35
- ? {
36
- r: parseInt(result[1], 16),
37
- g: parseInt(result[2], 16),
38
- b: parseInt(result[3], 16),
39
- }
40
- : null;
41
- }
1
+ function e(e,t,r){return getComputedStyle(e).getPropertyValue(t).trim()||r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.hexToRGB=exports.getCssVar=void 0;exports.getCssVar=function(t,r,o){return t?r.startsWith("--")?e(t,r,o):e(t,`--${r}`,o):o},exports.hexToRGB=function(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e.trim());return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null};
@@ -0,0 +1,6 @@
1
+ export function loadAsciiDoctor(): Promise<any>;
2
+ export function setAsciiDoctorAsGlobal(asciidoctor: any, highlightJsExt: any): any;
3
+ export function toDom(text: any, type?: string, small?: boolean): Promise<{
4
+ title: string;
5
+ element: HTMLDivElement;
6
+ } | undefined>;