@gravitee/ui-components 3.25.3-typescript-bfd8f67 → 3.25.3-typescript-94e8113

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 (550) hide show
  1. package/CHANGELOG.md +1292 -0
  2. package/LICENSE.txt +202 -0
  3. package/README.md +195 -0
  4. package/dist/src/atoms/gv-autocomplete.d.ts +104 -0
  5. package/dist/src/atoms/gv-autocomplete.js +422 -0
  6. package/dist/src/atoms/gv-button.d.ts +109 -0
  7. package/dist/src/atoms/gv-button.js +397 -0
  8. package/dist/src/atoms/gv-checkbox.d.ts +114 -0
  9. package/dist/src/atoms/gv-checkbox.js +178 -0
  10. package/dist/src/atoms/gv-date-picker-calendar.d.ts +190 -0
  11. package/dist/src/atoms/gv-date-picker-calendar.js +812 -0
  12. package/dist/src/atoms/gv-date-picker-cell.d.ts +80 -0
  13. package/dist/src/atoms/gv-date-picker-cell.js +174 -0
  14. package/dist/src/atoms/gv-date-picker.d.ts +194 -0
  15. package/dist/src/atoms/gv-date-picker.js +638 -0
  16. package/dist/src/atoms/gv-file-upload.d.ts +64 -0
  17. package/dist/src/atoms/gv-file-upload.js +348 -0
  18. package/dist/src/atoms/gv-icon.d.ts +26 -0
  19. package/dist/src/atoms/gv-icon.js +93 -0
  20. package/dist/src/atoms/gv-image.d.ts +45 -0
  21. package/dist/src/atoms/gv-image.js +135 -0
  22. package/dist/src/atoms/gv-input-message.d.ts +20 -0
  23. package/dist/src/atoms/gv-input-message.js +78 -0
  24. package/dist/src/atoms/gv-input.d.ts +246 -0
  25. package/dist/src/atoms/gv-input.js +508 -0
  26. package/dist/src/atoms/gv-link.d.ts +67 -0
  27. package/dist/src/atoms/gv-link.js +204 -0
  28. package/dist/src/atoms/gv-message.d.ts +23 -0
  29. package/dist/src/atoms/gv-message.js +133 -0
  30. package/dist/src/atoms/gv-metric.d.ts +32 -0
  31. package/dist/src/atoms/gv-metric.js +112 -0
  32. package/dist/src/atoms/gv-relative-time.d.ts +45 -0
  33. package/dist/src/atoms/gv-relative-time.js +143 -0
  34. package/dist/src/atoms/gv-select-native.d.ts +174 -0
  35. package/dist/src/atoms/gv-select-native.js +363 -0
  36. package/dist/src/atoms/gv-select.d.ts +71 -0
  37. package/dist/src/atoms/gv-select.js +413 -0
  38. package/dist/src/atoms/gv-spinner.d.ts +10 -0
  39. package/dist/src/atoms/gv-spinner.js +54 -0
  40. package/dist/src/atoms/gv-state.d.ts +50 -0
  41. package/dist/src/atoms/gv-state.js +125 -0
  42. package/dist/src/atoms/gv-switch.d.ts +60 -0
  43. package/dist/src/atoms/gv-switch.js +235 -0
  44. package/dist/src/atoms/gv-tag.d.ts +69 -0
  45. package/dist/src/atoms/gv-tag.js +162 -0
  46. package/dist/src/atoms/gv-text.d.ts +110 -0
  47. package/dist/src/atoms/gv-text.js +160 -0
  48. package/dist/src/charts/gv-chart-bar.d.ts +50 -0
  49. package/dist/src/charts/gv-chart-bar.js +101 -0
  50. package/dist/src/charts/gv-chart-gauge.d.ts +58 -0
  51. package/dist/src/charts/gv-chart-gauge.js +92 -0
  52. package/dist/src/charts/gv-chart-histogram.d.ts +48 -0
  53. package/dist/src/charts/gv-chart-histogram.js +78 -0
  54. package/dist/src/charts/gv-chart-line.d.ts +52 -0
  55. package/dist/src/charts/gv-chart-line.js +218 -0
  56. package/dist/src/charts/gv-chart-map.d.ts +50 -0
  57. package/dist/src/charts/gv-chart-map.js +111 -0
  58. package/dist/src/charts/gv-chart-pie.d.ts +50 -0
  59. package/dist/src/charts/gv-chart-pie.js +89 -0
  60. package/dist/src/index.d.ts +77 -0
  61. package/dist/src/index.js +77 -0
  62. package/dist/src/lib/cron-expression.d.ts +1 -0
  63. package/dist/src/lib/cron-expression.js +176 -0
  64. package/dist/src/lib/date.d.ts +1 -0
  65. package/dist/src/lib/date.js +43 -0
  66. package/dist/src/lib/events.d.ts +1 -0
  67. package/dist/src/lib/events.js +26 -0
  68. package/dist/src/lib/http-client-schema-form.d.ts +68 -0
  69. package/dist/src/lib/http-client-schema-form.js +67 -0
  70. package/dist/src/lib/http.d.ts +222 -0
  71. package/dist/src/lib/http.js +237 -0
  72. package/dist/src/lib/i18n.d.ts +30 -0
  73. package/dist/src/lib/i18n.js +93 -0
  74. package/dist/src/lib/item.d.ts +12 -0
  75. package/dist/src/lib/item.js +110 -0
  76. package/dist/src/lib/properties.d.ts +42 -0
  77. package/dist/src/lib/properties.js +171 -0
  78. package/dist/src/lib/schema-form.d.ts +5 -0
  79. package/dist/src/lib/schema-form.js +39 -0
  80. package/dist/src/lib/studio.d.ts +2 -0
  81. package/dist/src/lib/studio.js +144 -0
  82. package/dist/src/lib/style.d.ts +6 -0
  83. package/dist/src/lib/style.js +39 -0
  84. package/dist/src/lib/text-format.d.ts +6 -0
  85. package/dist/src/lib/text-format.js +65 -0
  86. package/dist/src/lib/theme.d.ts +4 -0
  87. package/dist/src/lib/theme.js +60 -0
  88. package/dist/src/lib/utils.d.ts +9 -0
  89. package/dist/src/lib/utils.js +106 -0
  90. package/dist/src/mixins/chart-element.d.ts +39 -0
  91. package/dist/src/mixins/chart-element.js +153 -0
  92. package/dist/src/mixins/input-element.d.ts +64 -0
  93. package/dist/src/mixins/input-element.js +136 -0
  94. package/dist/src/mixins/item-resource.d.ts +56 -0
  95. package/dist/src/mixins/item-resource.js +102 -0
  96. package/dist/src/mixins/keyboard-element.d.ts +25 -0
  97. package/dist/src/mixins/keyboard-element.js +62 -0
  98. package/dist/src/mixins/update-after-browser.d.ts +11 -0
  99. package/dist/src/mixins/update-after-browser.js +30 -0
  100. package/dist/src/mixins/with-resize-observer.d.ts +12 -0
  101. package/dist/src/mixins/with-resize-observer.js +62 -0
  102. package/dist/src/mixins/with-skeleton-attribute.d.ts +35 -0
  103. package/dist/src/mixins/with-skeleton-attribute.js +109 -0
  104. package/dist/src/molecules/gv-card-full.d.ts +78 -0
  105. package/dist/src/molecules/gv-card-full.js +209 -0
  106. package/dist/src/molecules/gv-card-list.d.ts +33 -0
  107. package/dist/src/molecules/gv-card-list.js +101 -0
  108. package/dist/src/molecules/gv-card.d.ts +65 -0
  109. package/dist/src/molecules/gv-card.js +130 -0
  110. package/dist/src/molecules/gv-category-list.d.ts +17 -0
  111. package/dist/src/molecules/gv-category-list.js +56 -0
  112. package/dist/src/molecules/gv-category.d.ts +64 -0
  113. package/dist/src/molecules/gv-category.js +163 -0
  114. package/dist/src/molecules/gv-code.d.ts +192 -0
  115. package/dist/src/molecules/gv-code.js +334 -0
  116. package/dist/src/molecules/gv-confirm.d.ts +60 -0
  117. package/dist/src/molecules/gv-confirm.js +175 -0
  118. package/dist/src/molecules/gv-cron-editor.d.ts +115 -0
  119. package/dist/src/molecules/gv-cron-editor.js +685 -0
  120. package/dist/src/molecules/gv-dropdown-menu.d.ts +28 -0
  121. package/dist/src/molecules/gv-dropdown-menu.js +108 -0
  122. package/dist/src/molecules/gv-expandable.d.ts +37 -0
  123. package/dist/src/molecules/gv-expandable.js +116 -0
  124. package/dist/src/molecules/gv-expression-language.d.ts +150 -0
  125. package/dist/src/molecules/gv-expression-language.js +263 -0
  126. package/dist/src/molecules/gv-identity-picture.d.ts +44 -0
  127. package/dist/src/molecules/gv-identity-picture.js +139 -0
  128. package/dist/src/molecules/gv-list.d.ts +123 -0
  129. package/dist/src/molecules/gv-list.js +214 -0
  130. package/dist/src/molecules/gv-metrics.d.ts +65 -0
  131. package/dist/src/molecules/gv-metrics.js +147 -0
  132. package/dist/src/molecules/gv-modal.d.ts +64 -0
  133. package/dist/src/molecules/gv-modal.js +203 -0
  134. package/dist/src/molecules/gv-nav.d.ts +41 -0
  135. package/dist/src/molecules/gv-nav.js +180 -0
  136. package/dist/src/molecules/gv-option.d.ts +65 -0
  137. package/dist/src/molecules/gv-option.js +230 -0
  138. package/dist/src/molecules/gv-plans.d.ts +73 -0
  139. package/dist/src/molecules/gv-plans.js +400 -0
  140. package/dist/src/molecules/gv-popover.d.ts +91 -0
  141. package/dist/src/molecules/gv-popover.js +323 -0
  142. package/dist/src/molecules/gv-promote.d.ts +108 -0
  143. package/dist/src/molecules/gv-promote.js +203 -0
  144. package/dist/src/molecules/gv-rating-list.d.ts +77 -0
  145. package/dist/src/molecules/gv-rating-list.js +341 -0
  146. package/dist/src/molecules/gv-rating.d.ts +55 -0
  147. package/dist/src/molecules/gv-rating.js +234 -0
  148. package/dist/src/molecules/gv-row-expandable.d.ts +8 -0
  149. package/dist/src/molecules/gv-row-expandable.js +42 -0
  150. package/dist/src/molecules/gv-row.d.ts +37 -0
  151. package/dist/src/molecules/gv-row.js +205 -0
  152. package/dist/src/molecules/gv-stats.d.ts +53 -0
  153. package/dist/src/molecules/gv-stats.js +110 -0
  154. package/dist/src/molecules/gv-stepper.d.ts +46 -0
  155. package/dist/src/molecules/gv-stepper.js +274 -0
  156. package/dist/src/molecules/gv-table.d.ts +159 -0
  157. package/dist/src/molecules/gv-table.js +644 -0
  158. package/dist/src/molecules/gv-tree.d.ts +44 -0
  159. package/dist/src/molecules/gv-tree.js +238 -0
  160. package/dist/src/organisms/gv-documentation.d.ts +52 -0
  161. package/dist/src/organisms/gv-documentation.js +205 -0
  162. package/dist/src/organisms/gv-header.d.ts +60 -0
  163. package/dist/src/organisms/gv-header.js +276 -0
  164. package/dist/src/organisms/gv-http-client.d.ts +57 -0
  165. package/dist/src/organisms/gv-http-client.js +258 -0
  166. package/dist/src/organisms/gv-menu.d.ts +74 -0
  167. package/dist/src/organisms/gv-menu.js +258 -0
  168. package/dist/src/organisms/gv-newsletter-subscription.d.ts +82 -0
  169. package/dist/src/organisms/gv-newsletter-subscription.js +258 -0
  170. package/dist/src/organisms/gv-pagination.d.ts +63 -0
  171. package/dist/src/organisms/gv-pagination.js +179 -0
  172. package/dist/src/organisms/gv-properties.d.ts +229 -0
  173. package/dist/src/organisms/gv-properties.js +860 -0
  174. package/dist/src/organisms/gv-resizable-views.d.ts +33 -0
  175. package/dist/src/organisms/gv-resizable-views.js +371 -0
  176. package/dist/src/organisms/gv-resources.d.ts +125 -0
  177. package/dist/src/organisms/gv-resources.js +496 -0
  178. package/dist/src/organisms/gv-schema-form-array.d.ts +55 -0
  179. package/dist/src/organisms/gv-schema-form-array.js +237 -0
  180. package/dist/src/organisms/gv-schema-form-control-object.d.ts +64 -0
  181. package/dist/src/organisms/gv-schema-form-control-object.js +141 -0
  182. package/dist/src/organisms/gv-schema-form-control.d.ts +90 -0
  183. package/dist/src/organisms/gv-schema-form-control.js +419 -0
  184. package/dist/src/organisms/gv-schema-form.d.ts +156 -0
  185. package/dist/src/organisms/gv-schema-form.js +700 -0
  186. package/dist/src/organisms/gv-tabs.d.ts +56 -0
  187. package/dist/src/organisms/gv-tabs.js +201 -0
  188. package/dist/src/organisms/gv-user-menu.d.ts +56 -0
  189. package/dist/src/organisms/gv-user-menu.js +298 -0
  190. package/dist/src/organisms/gv-vertical-menu.d.ts +28 -0
  191. package/dist/src/organisms/gv-vertical-menu.js +119 -0
  192. package/dist/src/policy-studio/gv-flow-step.d.ts +142 -0
  193. package/dist/src/policy-studio/gv-flow-step.js +443 -0
  194. package/dist/src/policy-studio/gv-flow.d.ts +89 -0
  195. package/dist/src/policy-studio/gv-flow.js +595 -0
  196. package/dist/src/policy-studio/gv-policy-studio-menu.d.ts +94 -0
  197. package/dist/src/policy-studio/gv-policy-studio-menu.js +689 -0
  198. package/dist/src/policy-studio/gv-policy-studio.d.ts +464 -0
  199. package/dist/src/policy-studio/gv-policy-studio.js +1712 -0
  200. package/dist/src/styles/empty.d.ts +1 -0
  201. package/dist/src/styles/empty.js +35 -0
  202. package/dist/src/styles/input.d.ts +1 -0
  203. package/dist/src/styles/input.js +262 -0
  204. package/dist/src/styles/link.d.ts +1 -0
  205. package/dist/src/styles/link.js +31 -0
  206. package/dist/src/styles/shapes.d.ts +2 -0
  207. package/dist/src/styles/shapes.js +17 -0
  208. package/dist/src/styles/skeleton.d.ts +1 -0
  209. package/dist/src/styles/skeleton.js +52 -0
  210. package/dist/src/styles/zoom.d.ts +1 -0
  211. package/dist/src/styles/zoom.js +39 -0
  212. package/dist/src/theme/gv-theme.d.ts +81 -0
  213. package/dist/src/theme/gv-theme.js +197 -0
  214. package/dist/wc/gv-autocomplete.d.ts +1 -0
  215. package/dist/wc/gv-autocomplete.js +1 -0
  216. package/dist/wc/gv-button.d.ts +1 -0
  217. package/dist/wc/gv-button.js +1 -0
  218. package/dist/wc/gv-card-full.d.ts +1 -0
  219. package/dist/wc/gv-card-full.js +1 -0
  220. package/dist/wc/gv-card-list.d.ts +1 -0
  221. package/dist/wc/gv-card-list.js +1 -0
  222. package/dist/wc/gv-card.d.ts +1 -0
  223. package/dist/wc/gv-card.js +1 -0
  224. package/dist/wc/gv-category-list.d.ts +1 -0
  225. package/dist/wc/gv-category-list.js +1 -0
  226. package/dist/wc/gv-category.d.ts +1 -0
  227. package/dist/wc/gv-category.js +1 -0
  228. package/dist/wc/gv-chart-bar.d.ts +1 -0
  229. package/dist/wc/gv-chart-bar.js +1 -0
  230. package/dist/wc/gv-chart-gauge.d.ts +1 -0
  231. package/dist/wc/gv-chart-gauge.js +1 -0
  232. package/dist/wc/gv-chart-histogram.d.ts +1 -0
  233. package/dist/wc/gv-chart-histogram.js +1 -0
  234. package/dist/wc/gv-chart-line.d.ts +1 -0
  235. package/dist/wc/gv-chart-line.js +1 -0
  236. package/dist/wc/gv-chart-map.d.ts +1 -0
  237. package/dist/wc/gv-chart-map.js +1 -0
  238. package/dist/wc/gv-chart-pie.d.ts +1 -0
  239. package/dist/wc/gv-chart-pie.js +1 -0
  240. package/dist/wc/gv-checkbox.d.ts +1 -0
  241. package/dist/wc/gv-checkbox.js +1 -0
  242. package/dist/wc/gv-code.d.ts +1 -0
  243. package/dist/wc/gv-code.js +1 -0
  244. package/dist/wc/gv-confirm.d.ts +1 -0
  245. package/dist/wc/gv-confirm.js +1 -0
  246. package/dist/wc/gv-cron-editor.d.ts +1 -0
  247. package/dist/wc/gv-cron-editor.js +1 -0
  248. package/dist/wc/gv-date-picker-calendar.d.ts +1 -0
  249. package/dist/wc/gv-date-picker-calendar.js +1 -0
  250. package/dist/wc/gv-date-picker-cell.d.ts +1 -0
  251. package/dist/wc/gv-date-picker-cell.js +1 -0
  252. package/dist/wc/gv-date-picker.d.ts +1 -0
  253. package/dist/wc/gv-date-picker.js +1 -0
  254. package/dist/wc/gv-documentation.d.ts +1 -0
  255. package/dist/wc/gv-documentation.js +1 -0
  256. package/dist/wc/gv-dropdown-menu.d.ts +1 -0
  257. package/dist/wc/gv-dropdown-menu.js +1 -0
  258. package/dist/wc/gv-expandable.d.ts +1 -0
  259. package/dist/wc/gv-expandable.js +1 -0
  260. package/dist/wc/gv-expression-language.d.ts +1 -0
  261. package/dist/wc/gv-expression-language.js +1 -0
  262. package/dist/wc/gv-file-upload.d.ts +1 -0
  263. package/dist/wc/gv-file-upload.js +1 -0
  264. package/dist/wc/gv-flow-step.d.ts +1 -0
  265. package/dist/wc/gv-flow-step.js +1 -0
  266. package/dist/wc/gv-flow.d.ts +1 -0
  267. package/dist/wc/gv-flow.js +1 -0
  268. package/dist/wc/gv-header.d.ts +1 -0
  269. package/dist/wc/gv-header.js +1 -0
  270. package/dist/wc/gv-http-client.d.ts +1 -0
  271. package/dist/wc/gv-http-client.js +1 -0
  272. package/dist/wc/gv-icon.d.ts +1 -0
  273. package/dist/wc/gv-icon.js +1 -0
  274. package/dist/wc/gv-identity-picture.d.ts +1 -0
  275. package/dist/wc/gv-identity-picture.js +1 -0
  276. package/dist/wc/gv-image.d.ts +1 -0
  277. package/dist/wc/gv-image.js +1 -0
  278. package/dist/wc/gv-input-message.d.ts +1 -0
  279. package/dist/wc/gv-input-message.js +1 -0
  280. package/dist/wc/gv-input.d.ts +1 -0
  281. package/dist/wc/gv-input.js +1 -0
  282. package/dist/wc/gv-link.d.ts +1 -0
  283. package/dist/wc/gv-link.js +1 -0
  284. package/dist/wc/gv-list.d.ts +1 -0
  285. package/dist/wc/gv-list.js +1 -0
  286. package/dist/wc/gv-menu.d.ts +1 -0
  287. package/dist/wc/gv-menu.js +1 -0
  288. package/dist/wc/gv-message.d.ts +1 -0
  289. package/dist/wc/gv-message.js +1 -0
  290. package/dist/wc/gv-metric.d.ts +1 -0
  291. package/dist/wc/gv-metric.js +1 -0
  292. package/dist/wc/gv-metrics.d.ts +1 -0
  293. package/dist/wc/gv-metrics.js +1 -0
  294. package/dist/wc/gv-modal.d.ts +1 -0
  295. package/dist/wc/gv-modal.js +1 -0
  296. package/dist/wc/gv-nav.d.ts +1 -0
  297. package/dist/wc/gv-nav.js +1 -0
  298. package/dist/wc/gv-newsletter-subscription.d.ts +1 -0
  299. package/dist/wc/gv-newsletter-subscription.js +1 -0
  300. package/dist/wc/gv-option.d.ts +1 -0
  301. package/dist/wc/gv-option.js +1 -0
  302. package/dist/wc/gv-pagination.d.ts +1 -0
  303. package/dist/wc/gv-pagination.js +1 -0
  304. package/dist/wc/gv-plans.d.ts +1 -0
  305. package/dist/wc/gv-plans.js +1 -0
  306. package/dist/wc/gv-policy-studio-menu.d.ts +1 -0
  307. package/dist/wc/gv-policy-studio-menu.js +1 -0
  308. package/dist/wc/gv-policy-studio.d.ts +1 -0
  309. package/dist/wc/gv-policy-studio.js +1 -0
  310. package/dist/wc/gv-popover.d.ts +1 -0
  311. package/dist/wc/gv-popover.js +1 -0
  312. package/dist/wc/gv-promote.d.ts +1 -0
  313. package/dist/wc/gv-promote.js +1 -0
  314. package/dist/wc/gv-properties.d.ts +1 -0
  315. package/dist/wc/gv-properties.js +1 -0
  316. package/dist/wc/gv-rating-list.d.ts +1 -0
  317. package/dist/wc/gv-rating-list.js +1 -0
  318. package/dist/wc/gv-rating.d.ts +1 -0
  319. package/dist/wc/gv-rating.js +1 -0
  320. package/dist/wc/gv-relative-time.d.ts +1 -0
  321. package/dist/wc/gv-relative-time.js +1 -0
  322. package/dist/wc/gv-resizable-views.d.ts +1 -0
  323. package/dist/wc/gv-resizable-views.js +1 -0
  324. package/dist/wc/gv-resources.d.ts +1 -0
  325. package/dist/wc/gv-resources.js +1 -0
  326. package/dist/wc/gv-row-expandable.d.ts +1 -0
  327. package/dist/wc/gv-row-expandable.js +1 -0
  328. package/dist/wc/gv-row.d.ts +1 -0
  329. package/dist/wc/gv-row.js +1 -0
  330. package/dist/wc/gv-schema-form-array.d.ts +1 -0
  331. package/dist/wc/gv-schema-form-array.js +1 -0
  332. package/dist/wc/gv-schema-form-control-object.d.ts +1 -0
  333. package/dist/wc/gv-schema-form-control-object.js +1 -0
  334. package/dist/wc/gv-schema-form-control.d.ts +1 -0
  335. package/dist/wc/gv-schema-form-control.js +1 -0
  336. package/dist/wc/gv-schema-form.d.ts +1 -0
  337. package/dist/wc/gv-schema-form.js +1 -0
  338. package/dist/wc/gv-select-native.d.ts +1 -0
  339. package/dist/wc/gv-select-native.js +1 -0
  340. package/dist/wc/gv-select.d.ts +1 -0
  341. package/dist/wc/gv-select.js +1 -0
  342. package/dist/wc/gv-spinner.d.ts +1 -0
  343. package/dist/wc/gv-spinner.js +1 -0
  344. package/dist/wc/gv-state.d.ts +1 -0
  345. package/dist/wc/gv-state.js +1 -0
  346. package/dist/wc/gv-stats.d.ts +1 -0
  347. package/dist/wc/gv-stats.js +1 -0
  348. package/dist/wc/gv-stepper.d.ts +1 -0
  349. package/dist/wc/gv-stepper.js +1 -0
  350. package/dist/wc/gv-switch.d.ts +1 -0
  351. package/dist/wc/gv-switch.js +1 -0
  352. package/dist/wc/gv-table.d.ts +1 -0
  353. package/dist/wc/gv-table.js +1 -0
  354. package/dist/wc/gv-tabs.d.ts +1 -0
  355. package/dist/wc/gv-tabs.js +1 -0
  356. package/dist/wc/gv-tag.d.ts +1 -0
  357. package/dist/wc/gv-tag.js +1 -0
  358. package/dist/wc/gv-text.d.ts +1 -0
  359. package/dist/wc/gv-text.js +1 -0
  360. package/dist/wc/gv-theme.d.ts +1 -0
  361. package/dist/wc/gv-theme.js +1 -0
  362. package/dist/wc/gv-tree.d.ts +1 -0
  363. package/dist/wc/gv-tree.js +1 -0
  364. package/dist/wc/gv-user-menu.d.ts +1 -0
  365. package/dist/wc/gv-user-menu.js +1 -0
  366. package/dist/wc/gv-vertical-menu.d.ts +1 -0
  367. package/dist/wc/gv-vertical-menu.js +1 -0
  368. package/package.json +8 -16
  369. package/src/atoms/gv-autocomplete.js +0 -1
  370. package/src/atoms/gv-button.js +0 -1
  371. package/src/atoms/gv-checkbox.js +0 -1
  372. package/src/atoms/gv-date-picker-calendar.js +0 -1
  373. package/src/atoms/gv-date-picker-cell.js +0 -1
  374. package/src/atoms/gv-date-picker.js +0 -1
  375. package/src/atoms/gv-file-upload.js +0 -1
  376. package/src/atoms/gv-icon.js +0 -1
  377. package/src/atoms/gv-image.js +0 -1
  378. package/src/atoms/gv-input-message.js +0 -1
  379. package/src/atoms/gv-input.js +0 -1
  380. package/src/atoms/gv-link.js +0 -1
  381. package/src/atoms/gv-message.js +0 -1
  382. package/src/atoms/gv-metric.js +0 -1
  383. package/src/atoms/gv-relative-time.js +0 -1
  384. package/src/atoms/gv-select-native.js +0 -1
  385. package/src/atoms/gv-select.js +0 -1
  386. package/src/atoms/gv-spinner.js +0 -1
  387. package/src/atoms/gv-state.js +0 -1
  388. package/src/atoms/gv-switch.js +0 -1
  389. package/src/atoms/gv-tag.js +0 -1
  390. package/src/atoms/gv-text.js +0 -1
  391. package/src/charts/gv-chart-bar.js +0 -1
  392. package/src/charts/gv-chart-gauge.js +0 -1
  393. package/src/charts/gv-chart-histogram.js +0 -1
  394. package/src/charts/gv-chart-line.js +0 -1
  395. package/src/charts/gv-chart-map.js +0 -1
  396. package/src/charts/gv-chart-pie.js +0 -1
  397. package/src/index.js +0 -1
  398. package/src/lib/cron-expression.js +0 -1
  399. package/src/lib/date.js +0 -1
  400. package/src/lib/events.js +0 -1
  401. package/src/lib/http-client-schema-form.js +0 -1
  402. package/src/lib/http.js +0 -1
  403. package/src/lib/i18n.js +0 -1
  404. package/src/lib/item.js +0 -1
  405. package/src/lib/properties.js +0 -1
  406. package/src/lib/schema-form.js +0 -1
  407. package/src/lib/studio.js +0 -1
  408. package/src/lib/style.js +0 -1
  409. package/src/lib/text-format.js +0 -1
  410. package/src/lib/theme.js +0 -1
  411. package/src/lib/utils.js +0 -1
  412. package/src/mixins/chart-element.js +0 -1
  413. package/src/mixins/input-element.js +0 -1
  414. package/src/mixins/item-resource.js +0 -1
  415. package/src/mixins/keyboard-element.js +0 -1
  416. package/src/mixins/update-after-browser.js +0 -1
  417. package/src/mixins/with-resize-observer.js +0 -1
  418. package/src/mixins/with-skeleton-attribute.js +0 -1
  419. package/src/molecules/gv-card-full.js +0 -1
  420. package/src/molecules/gv-card-list.js +0 -1
  421. package/src/molecules/gv-card.js +0 -1
  422. package/src/molecules/gv-category-list.js +0 -1
  423. package/src/molecules/gv-category.js +0 -1
  424. package/src/molecules/gv-code.js +0 -1
  425. package/src/molecules/gv-confirm.js +0 -1
  426. package/src/molecules/gv-cron-editor.js +0 -1
  427. package/src/molecules/gv-dropdown-menu.js +0 -1
  428. package/src/molecules/gv-expandable.js +0 -1
  429. package/src/molecules/gv-expression-language.js +0 -1
  430. package/src/molecules/gv-identity-picture.js +0 -1
  431. package/src/molecules/gv-list.js +0 -1
  432. package/src/molecules/gv-metrics.js +0 -1
  433. package/src/molecules/gv-modal.js +0 -1
  434. package/src/molecules/gv-nav.js +0 -1
  435. package/src/molecules/gv-option.js +0 -1
  436. package/src/molecules/gv-plans.js +0 -1
  437. package/src/molecules/gv-popover.js +0 -1
  438. package/src/molecules/gv-promote.js +0 -1
  439. package/src/molecules/gv-rating-list.js +0 -1
  440. package/src/molecules/gv-rating.js +0 -1
  441. package/src/molecules/gv-row-expandable.js +0 -1
  442. package/src/molecules/gv-row.js +0 -1
  443. package/src/molecules/gv-stats.js +0 -1
  444. package/src/molecules/gv-stepper.js +0 -1
  445. package/src/molecules/gv-table.js +0 -1
  446. package/src/molecules/gv-tree.js +0 -1
  447. package/src/organisms/gv-documentation.js +0 -1
  448. package/src/organisms/gv-header.js +0 -1
  449. package/src/organisms/gv-http-client.js +0 -1
  450. package/src/organisms/gv-menu.js +0 -1
  451. package/src/organisms/gv-newsletter-subscription.js +0 -1
  452. package/src/organisms/gv-pagination.js +0 -1
  453. package/src/organisms/gv-properties.js +0 -1
  454. package/src/organisms/gv-resizable-views.js +0 -1
  455. package/src/organisms/gv-resources.js +0 -1
  456. package/src/organisms/gv-schema-form-array.js +0 -1
  457. package/src/organisms/gv-schema-form-control-object.js +0 -1
  458. package/src/organisms/gv-schema-form-control.js +0 -1
  459. package/src/organisms/gv-schema-form.js +0 -1
  460. package/src/organisms/gv-tabs.js +0 -1
  461. package/src/organisms/gv-user-menu.js +0 -1
  462. package/src/organisms/gv-vertical-menu.js +0 -1
  463. package/src/policy-studio/gv-flow-step.js +0 -1
  464. package/src/policy-studio/gv-flow.js +0 -1
  465. package/src/policy-studio/gv-policy-studio-menu.js +0 -1
  466. package/src/policy-studio/gv-policy-studio.js +0 -1
  467. package/src/styles/empty.js +0 -1
  468. package/src/styles/input.js +0 -1
  469. package/src/styles/link.js +0 -1
  470. package/src/styles/shapes.js +0 -1
  471. package/src/styles/skeleton.js +0 -1
  472. package/src/styles/zoom.js +0 -1
  473. package/src/theme/gv-theme.js +0 -1
  474. package/wc/gv-autocomplete.js +0 -1
  475. package/wc/gv-button.js +0 -1
  476. package/wc/gv-card-full.js +0 -1
  477. package/wc/gv-card-list.js +0 -1
  478. package/wc/gv-card.js +0 -1
  479. package/wc/gv-category-list.js +0 -1
  480. package/wc/gv-category.js +0 -1
  481. package/wc/gv-chart-bar.js +0 -1
  482. package/wc/gv-chart-gauge.js +0 -1
  483. package/wc/gv-chart-histogram.js +0 -1
  484. package/wc/gv-chart-line.js +0 -1
  485. package/wc/gv-chart-map.js +0 -1
  486. package/wc/gv-chart-pie.js +0 -1
  487. package/wc/gv-checkbox.js +0 -1
  488. package/wc/gv-code.js +0 -1
  489. package/wc/gv-confirm.js +0 -1
  490. package/wc/gv-cron-editor.js +0 -1
  491. package/wc/gv-date-picker-calendar.js +0 -1
  492. package/wc/gv-date-picker-cell.js +0 -1
  493. package/wc/gv-date-picker.js +0 -1
  494. package/wc/gv-documentation.js +0 -1
  495. package/wc/gv-dropdown-menu.js +0 -1
  496. package/wc/gv-expandable.js +0 -1
  497. package/wc/gv-expression-language.js +0 -1
  498. package/wc/gv-file-upload.js +0 -1
  499. package/wc/gv-flow-step.js +0 -1
  500. package/wc/gv-flow.js +0 -1
  501. package/wc/gv-header.js +0 -1
  502. package/wc/gv-http-client.js +0 -1
  503. package/wc/gv-icon.js +0 -1
  504. package/wc/gv-identity-picture.js +0 -1
  505. package/wc/gv-image.js +0 -1
  506. package/wc/gv-input-message.js +0 -1
  507. package/wc/gv-input.js +0 -1
  508. package/wc/gv-link.js +0 -1
  509. package/wc/gv-list.js +0 -1
  510. package/wc/gv-menu.js +0 -1
  511. package/wc/gv-message.js +0 -1
  512. package/wc/gv-metric.js +0 -1
  513. package/wc/gv-metrics.js +0 -1
  514. package/wc/gv-modal.js +0 -1
  515. package/wc/gv-nav.js +0 -1
  516. package/wc/gv-newsletter-subscription.js +0 -1
  517. package/wc/gv-option.js +0 -1
  518. package/wc/gv-pagination.js +0 -1
  519. package/wc/gv-plans.js +0 -1
  520. package/wc/gv-policy-studio-menu.js +0 -1
  521. package/wc/gv-policy-studio.js +0 -1
  522. package/wc/gv-popover.js +0 -1
  523. package/wc/gv-promote.js +0 -1
  524. package/wc/gv-properties.js +0 -1
  525. package/wc/gv-rating-list.js +0 -1
  526. package/wc/gv-rating.js +0 -1
  527. package/wc/gv-relative-time.js +0 -1
  528. package/wc/gv-resizable-views.js +0 -1
  529. package/wc/gv-resources.js +0 -1
  530. package/wc/gv-row-expandable.js +0 -1
  531. package/wc/gv-row.js +0 -1
  532. package/wc/gv-schema-form-array.js +0 -1
  533. package/wc/gv-schema-form-control-object.js +0 -1
  534. package/wc/gv-schema-form-control.js +0 -1
  535. package/wc/gv-schema-form.js +0 -1
  536. package/wc/gv-select-native.js +0 -1
  537. package/wc/gv-select.js +0 -1
  538. package/wc/gv-spinner.js +0 -1
  539. package/wc/gv-state.js +0 -1
  540. package/wc/gv-stats.js +0 -1
  541. package/wc/gv-stepper.js +0 -1
  542. package/wc/gv-switch.js +0 -1
  543. package/wc/gv-table.js +0 -1
  544. package/wc/gv-tabs.js +0 -1
  545. package/wc/gv-tag.js +0 -1
  546. package/wc/gv-text.js +0 -1
  547. package/wc/gv-theme.js +0 -1
  548. package/wc/gv-tree.js +0 -1
  549. package/wc/gv-user-menu.js +0 -1
  550. package/wc/gv-vertical-menu.js +0 -1
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvHeader=void 0;const e=require("lit");require("../atoms/gv-button"),require("../atoms/gv-tag");const t=require("../lib/i18n"),i=require("../lib/utils"),r=require("lit/directives/repeat"),s=require("lit/directives/until"),n=require("../lib/events"),a=require("lit/directives/class-map"),l=require("../mixins/with-resize-observer"),o=require("../mixins/item-resource"),c=require("../lib/item"),h=require("lit/directives/style-map");class v extends((0,l.withResizeObserver)((0,o.ItemResource)(e.LitElement))){static get properties(){return{breadcrumbs:{type:Array},sticky:{type:Boolean,reflect:!0},_breadcrumbs:{type:Array,attribute:!1},canSubscribe:{type:Boolean,attribute:"can-subscribe"}}}static get styles(){return[...super.styles,e.css`:host{--img-w:120px;--img-h:120px;--gv-button--fz:var(--gv-header-button--fz, var(--gv-theme-font-size-l, 16px));--gv-button--p:var(--gv-header-button--p, 10px 24px);--gv-link--bgc:transparent;--gv-link-active-bgc:transparent;--c:var(--gv-header--c, var(--gv-theme-font-color-dark, #262626));--gv-link--c:var(--c);--gv-link-active--c:var(--c);--gv-link-a--ph:5px;--gv-link--td:underline;--bgc:var(--gv-header--bgc, var(--gv-theme-color-light, #86c3d0));box-sizing:border-box;display:block}:host([w-lt-768]){--img--w:calc(var(--img-w) / 2);--img--h:calc(var(--img-h) / 2);--gv-button--fz:var(--gv-theme-font-size-s, 12px);font-size:var(--gv-theme-font-size-s,12px)}:host([w-lt-580]){--gv-button--p:3px 9px;--gv-link-a--ph:0px}:host([w-lt-580]) .actions{display:flex;flex-direction:column}:host([w-lt-580]) .version{font-size:var(--gv-theme-font-size-s,12px);line-height:var(--gv-theme-font-size-s,12px)}:host([w-lt-580]) .image gv-image{top:-5px}:host([w-lt-580]) h1{font-size:calc(var(--gv-theme-font-size-xl,26px) - 4px);line-height:calc(var(--gv-theme-font-size-xl,26px) - 4px)}:host([w-lt-400]) h1{font-size:calc(var(--gv-theme-font-size-xl,26px) - 8px)}.header{display:flex;background-color:var(--bgc);flex-direction:row;color:var(--c);transition:all 350ms ease-in-out;padding:.5rem var(--gv-theme-layout--pr,4rem) .5rem var(--gv-theme-layout--pl,4rem);position:relative}.title{flex:1;margin:.5rem 0 .5rem var(--img-w);padding-left:2rem}:host([sticky]) .title{margin-left:calc(var(--img-w)/ 2);transition:all 250ms ease-in-out}.actions,.title{align-self:flex-end}gv-link:last-child{--gv-link--td:none}gv-link::after{content:'>';color:var(--gv-theme-font-color-dark,#262626);align-self:center}gv-link:last-child::after{content:''}.error{text-align:center;margin-right:125px}.version{letter-spacing:.05em;opacity:.5;font-size:var(--gv-theme-font-size-l,16px);line-height:var(--gv-theme-font-size-l,16px);font-weight:500}gv-identity-picture{height:var(--img-h);width:var(--img-w);position:absolute;--gv-image--of:contain;transition:all 150ms ease-in-out}:host([sticky]) gv-identity-picture{height:calc(var(--img-h)/ 2);width:calc(var(--img-w)/ 2);transition:all 150ms ease;top:20%}h1{margin:0;font-size:var(--gv-theme-font-size-xl,26px);font-weight:500;line-height:var(--gv-theme-font-size-xl,26px);letter-spacing:.05em}h1 span{opacity:.5;font-size:var(--gv-theme-font-size-l,16px)}.skeleton .error,.skeleton gv-button{visibility:hidden}`]}constructor(){super(),this.breakpoints={width:[400,580,768]},this._breadcrumbs=[],this.canSubscribe=!1}set breadcrumbs(e){e?Promise.resolve(e).then((e=>{e?Promise.all(e).then((e=>{(0,i.isSameRoutes)(this._breadcrumbs,e)||(this._breadcrumbs=e.filter((e=>null!=e)))})):this._breadcrumbs=null})):this._breadcrumbs=null}_getLink(t,i){return Promise.resolve(t).then((t=>{const r=i===this._breadcrumbs.length-1?(0,c.getTitle)(this._item):t.title;return e.html`<gv-link @gv-link:click="${this._onClick}" .active="${t.active}" .icon="${t.icon}" .path="${t.path}" .title="${r}" .help="${(0,s.until)(t.help,null)}"></gv-link>`})).catch((()=>{delete this._routes[i]}))}_renderBreadcrumbs(){return e.html`<nav>${(0,r.repeat)(this._breadcrumbs,(e=>e),((t,i)=>(0,s.until)(this._getLink(t,i),e.html`<gv-link skeleton></gv-link>`)))}</nav>`}_onSubscribe(e){e.stopPropagation(),(0,n.dispatchCustomEvent)(this,"subscribe",this._item)}render(){const i=(0,c.getNbApisInView)(this._item);return e.html`<div class="${(0,a.classMap)({header:!0,skeleton:this._skeleton})}" style="${(0,h.styleMap)({background:'url("'+(0,c.getBackground)(this._item)+'") var(--bgc) center center no-repeat'})}">${this._renderImage()}<div class="title">${this._error||this._empty||this.sticky?"":e.html`<div class="version">${(0,c.getVersion)(this._item)}</div>`} ${this._error||this._empty?e.html`<div class="error">${this._error?(0,t.i18n)("gv-header.error"):(0,t.i18n)("gv-header.empty")}</div>`:e.html`<h1>${(0,c.getTitle)(this._item)} ${null!==i?e.html`<span>(${i})</span>`:""}</h1>`}</div>${this._error||this._empty||!this.canSubscribe?"":e.html`<div class="actions"><gv-button primary @click="${this._onSubscribe}">${(0,t.i18n)("gv-header.subscribe")}</gv-button></div>`}</div>`}}exports.GvHeader=v,window.customElements.define("gv-header",v);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvHttpClient=void 0;const e=require("lit");require("./gv-schema-form"),require("./gv-resizable-views"),require("./gv-documentation"),require("../molecules/gv-table"),require("../atoms/gv-button"),require("../molecules/gv-option"),require("../atoms/gv-switch"),require("../atoms/gv-icon");const s=require("../mixins/keyboard-element"),t=require("../styles/empty"),i=require("../lib/http-client-schema-form"),o=require("../lib/events"),r=require("../lib/http"),n=require("lit-html/directives/repeat");class d extends((0,s.KeyboardElement)(e.LitElement)){static get properties(){return{response:{type:Object},path:{type:String},method:{type:String},loading:{type:Boolean}}}constructor(){super(),this.response=void 0,this.loading=!1,this.path=void 0,this.method=void 0,this.request={method:"GET",path:"/"}}_sendRequest(){(0,o.dispatchCustomEvent)(this,"send",{request:this.request})}_updateRequest(e){this.isFormValid=e.detail.validation.valid,this.request=e.detail.values,this.requestUpdate()}render(){return e.html`<div class="container"><div class="request"><div class="top-bar">Request</div><div class="request-form"><gv-schema-form .schema="${i.httpClientSchemaForm}" id="request-form" @gv-schema-form:change="${this._updateRequest}"></gv-schema-form><gv-button class="request-form-button" icon-right="content:send" .disabled="${!1===this.isFormValid||!0===this.loading}" @gv-button:click="${this._sendRequest}">Send</gv-button></div></div><div class="response">${this.loading||this.response?"":this._renderEmptyResponse()} ${this.loading?this._renderLoading():""} ${this.response?this._renderDebugResponse():""}</div></div>`}_renderEmptyResponse(){return e.html`<div class="empty-response"><gv-icon class="empty-response-icon" shape="editor:format_align_left"></gv-icon><div>Define and run the request you want to test!</div></div>`}_renderLoading(){return e.html`<div class="loading"><gv-icon class="loading-icon" shape="communication:sending"></gv-icon><div>Request in progress!</div></div>`}_renderDebugResponse(){let s=this.response.body,t="text";if(this.response.headers){const e=Object.entries(this.response.headers).find((([e,s])=>"content-type"===e.toLowerCase())),i=e?e[1].split(";")[0]:void 0;"text/html"===i?(t="htmlmixed",s=this.response.body):"application/json"===i&&(t="application/json",s=JSON.stringify(JSON.parse(this.response.body),null,2))}const i={lineNumbers:!0,mode:t};return e.html`${this._renderResponseHeader()}<div class="response-headers">Headers</div><div class="response-headers-content">${(0,n.repeat)(Object.keys(this.response.headers),(s=>e.html`<div><code>${s}: ${this.response.headers[s]}</code></div>`))}</div><div class="response-body">Body</div><div class="code-container"><gv-code .value="${s}" .options="${i}" readonly="readonly"></gv-code></div>`}_renderResponseHeader(){const s=200<=this.response.statusCode&&this.response.statusCode<300,t=400<=this.response.statusCode&&this.response.statusCode<600;return e.html`<div class="top-bar"><div class="response-row-item">Response</div>${this.method?e.html`<div class="response-row-item-method">${this.method}</div>`:""} ${this.path?e.html`<div class="response-row-item">${this.path}</div>`:""} ${this.response.statusCode?e.html`<div class="response-row-item"><gv-state ?success="${s}" ?error="${t}">${this.response.statusCode} - ${r.statusCode[this.response.statusCode].description}</gv-state></div>`:""}</div>`}static get styles(){return[t.empty,e.css`:host{box-sizing:border-box;height:100%;width:100%;display:block}.container{display:flex;flex-direction:row;height:100%}.request{width:40%;height:100%}.request-form{padding:8px;display:flex;flex-direction:column}.request-form-button{margin-top:16px}.response{border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;height:100%;width:60%;overflow:hidden}.top-bar{background-color:#f5f5f5}.response-row-item{margin-right:16px}.response-row-item-method{margin-right:4px;font-weight:700}.response-body,.response-headers,.status-code,.top-bar{font-size:16px;height:40px;display:flex;flex-direction:row;align-items:center;padding:0 16px;border-bottom:1px solid #d9d9d9}.response-headers-content{padding:16px;border-bottom:1px solid #d9d9d9;max-height:40%}.empty-response,.loading{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;font-size:16px}.empty-response-icon,.loading-icon{--gv-icon--s:128px;--gv-icon--c:var(--gv-theme-color-dark)}.code-container{height:100%;overflow:auto}`]}}exports.GvHttpClient=d,window.customElements.define("gv-http-client",d);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvMenu=void 0;const t=require("lit");require("../molecules/gv-nav");const e=require("../lib/utils"),i=require("lit/directives/class-map"),s=require("../mixins/with-resize-observer");class r extends((0,s.withResizeObserver)(t.LitElement)){static get properties(){return{routes:{type:Array},sticky:{type:Boolean,reflect:!0},_small:{type:Boolean,attribute:!1},_routes:{type:Array,attribute:!1},_hasHeader:{type:Boolean,attribute:!1}}}static get styles(){return[t.css`:host{--gv-link--c:var(--gv-menu--c, var(--gv-theme-font-color-light, #ffffff));--gv-link-active--c:var(--gv-menu--c, var(--gv-theme-font-color-light, #ffffff));--gv-link--bgc:var(--gv-menu-link--bgc, transparent);--gv-link-active--bgc:var(--gv-menu-link-active--bgc, transparent);--gv-link-active--bdc:var(--gv-menu-link-active--bdc, var(--gv-theme-color-light, #86c3d0));--gv-link-active--bds:var(--gv-menu-link-active--bds, solid);--gv-link-active--bdw:var(--gv-menu-link-active--bdw, 0 0 3px 0);--pr:var(--gv-theme-layout--pr, 4rem);--pl:var(--gv-theme-layout--pl, 4rem);box-sizing:border-box;display:block;font-size:var(--gv-theme-font-size-s,12px)}:host([sticky]) gv-nav{line-height:14px;--gv-link-icon--s:20px}:host([sticky]) .has-header gv-nav{line-height:34px}:host([sticky]) ::slotted([slot=top]){transition:height 250ms ease-in-out}:host([w-lt-1024]){--pr:5px;--pl:5px}:host([w-lt-768]) .nav-container{width:100%;padding-left:var(--pl);--gv-link-a--pv:var(--gv-menu-link-a--pv, 0px)}:host([w-lt-580]) .nav-container{flex:auto;padding-left:0}:host([w-lt-580]) gv-nav{flex:auto}:host([w-lt-580]) .right{flex:auto}:host([w-lt-380]) .nav-container{display:flex;flex-direction:column-reverse}:host([w-lt-380]) gv-nav{align-self:flex-start;flex:1}:host([w-lt-380]) .right{align-self:flex-end;flex:1;width:100%;padding-right:0}gv-nav{display:table-cell;line-height:50px;vertical-align:middle}.nav-container{display:grid;grid-template-columns:auto auto;background-color:var(--gv-menu--bgc,var(--gv-theme-color-dark,#28444f));color:var(--gv-menu--c,var(--gv-theme-font-color-light,#fff))}.has-header .nav-container{width:calc(100% - 10rem);padding-left:10rem;--gv-link-a--pv:0}:host([sticky]) .has-header .nav-container{width:calc(100% - 5rem);padding-left:5rem;transition:all 250ms ease-in-out}.right{display:flex;padding-right:var(--pr);justify-content:center;flex-direction:column}gv-nav{padding-left:var(--pl);transition:width 250ms ease-in-out}slot[name=right-transition],slot[name=right]{display:flex;justify-content:flex-end;width:100%}.right ::slotted([slot=right-transition]),.right ::slotted([slot=right]){align-self:center}.right ::slotted([slot=right-transition]){transition:width 250ms ease 250ms;width:70%}.right:focus-within ::slotted([slot=right-transition]){animation:slide 250ms 250ms;transition:width 250ms ease-in-out 250ms;width:100%}.right ::slotted([slot=right]){--gv-button--p:7px 16px;--gv-button--fz:15px}`]}constructor(){super(),this._routes=[],this.sticky=!1,this.breakpoints={width:[380,580,768,1024]}}set routes(t){t?Promise.resolve(t).then((t=>{t?Promise.all(t).then((t=>{(0,e.isSameRoutes)(this._routes,t)||(this._routes=t)})):this._routes=[]})):this._routes=[]}onResize({width:t}){this._small=t<=1024}render(){return t.html`<div class="${(0,i.classMap)({"has-header":this._hasHeader})}"><slot name="top"></slot><div class="nav-container"><gv-nav .routes="${this._routes}" ?small="${this._small}"></gv-nav><div class="right"><slot name="right-transition"></slot><slot name="right"></slot></div></div></div>`}updated(t){super.updated(t);let e=!1;for(const t of this.childNodes)if(1===t.nodeType){const i="gv-header"===t.nodeName.toLowerCase()?t:t.querySelector("gv-header");if(i){i.sticky=this.sticky,e=!0;break}}this._hasHeader=e}}exports.GvMenu=r,window.customElements.define("gv-menu",r);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvNewsletterSubscription=void 0;const t=require("lit"),e=require("../lib/events");class i extends t.LitElement{static get properties(){return{title:{type:String},header:{type:String},placeholder:{type:String},subscribeLabel:{type:String,attribute:"subscribe-label"},skipLabel:{type:String,attribute:"skip-label"},taglines:{type:Array},email:{type:String},disabled:{type:Boolean},githubUrl:{type:String,attribute:"github-url"},twitterUrl:{type:String,attribute:"twitter-url"},linkedinUrl:{type:String,attribute:"linkedin-url"},_invalid:{type:Boolean,attribute:!1}}}static get styles(){return[t.css`:host{box-sizing:border-box;margin:.2rem}.newsletter-container{display:flex;flex-direction:column;align-items:center;justify-content:space-between;max-width:680px;box-shadow:0 0 20px 0 rgba(0,0,0,.2),0 5px 5px 0 rgba(0,0,0,.24);padding:25px 20px 5px 20px}.newsletter__header{text-transform:uppercase;font-style:oblique;text-align:center;font-size:16px;font-weight:700;padding:5px 35px;color:var(--gv-theme-neutral-color-lightest,#fff);background-color:var(--gv-theme-color-light,#86c3d0)}.newsletter__title{display:flex;flex-direction:column;align-items:center;font-size:20px;text-transform:uppercase;padding:20px;color:var(--gv-theme-color-light,#86c3d0)}.newsletter__title-highlight{font-size:30px}.newsletter__email{display:flex;flex-direction:column;width:50%}.newsletter__taglines{display:flex;flex-direction:row;justify-content:space-between;align-items:center;text-align:center;text-transform:uppercase;font-size:14px;height:20%;margin-top:20px;padding:10px 0;color:var(--gv-theme-color-darker,#383e3f);border-bottom:solid 1px var(--gv-theme-color-darker,#383e3f)}.newsletter__tagline{display:flex;flex-basis:100%;flex-direction:column;justify-content:center;align-items:center;height:100%;font-weight:700;padding:0 15px;border-right:solid 1px var(--gv-theme-color-darker,#383e3f)}.newsletter__tagline.last{border-right:none}.newsletter__tagline-text{width:100%}.newsletter__skip{margin-top:20px}.social{width:100%;display:flex;flex-direction:row;justify-content:flex-end}.social-link{--gv-icon--c:var(--gv-theme-color-light, #86c3d0);--gv-icon--s:32px}`]}constructor(){super(),this.header="Customers process over 1 billion requests through the gravitee.io gateway in just one week",this.title="Community of api masters",this.placeholder="Enter your email",this.subscribeLabel="Become an API master now",this.taglines=["New release monthly updates","Free trial of Gravitee.IO enterprise","Share your experiences with other members"],this.skipLabel="Skip",this.email="",this.disabled=!1,this._invalid=!0,this.githubUrl="https://github.com/gravitee-io",this.twitterUrl="https://twitter.com/GraviteeIO",this.linkedinUrl="https://www.linkedin.com/company/gravitee-io/"}render(){return t.html`<div class="newsletter-container"><div class="newsletter__header">${this.header}</div><div class="newsletter__title"><span>Join the</span> <span class="newsletter__title-highlight">${this.title}</span> <span>Today</span></div><div class="newsletter__email"><gv-input id="email" name="email" @gv-input:submit="${this._onSubscribe}" @gv-input:input="${this._onInputChange}" type="email" required .value="${this.email}" .disabled="${this.disabled}" placeholder="${this.placeholder}"></gv-input><gv-button @click="${this._onSubscribe}" id="email-submit" provider="graviteeio_am" icon-right="navigation:angle-right" .disabled="${!this.disabled&&this._invalid}">${this.subscribeLabel}</gv-button></div>${this.taglines.length>0?t.html`<div class="newsletter__taglines">${this.taglines.map(((e,i,s)=>t.html`<div class="newsletter__tagline ${i===s.length-1?"last":""}"><div class="newsletter__tagline-text">${e}</div></div>`))}</div>`:""}<div class="newsletter__skip"><gv-button @click="${this._onSkip}" provider="graviteeio_am" icon-right="navigation:angle-right" small outlined>${this.skipLabel}</gv-button></div><div class="social"><gv-button class="social-link" link icon="thirdparty:github" .href="${this.githubUrl}" @gv-button:click="${this._navigateSocial.bind(this,this.githubUrl)}"></gv-button><gv-button class="social-link" link icon="thirdparty:twitter" .href="${this.twitterUrl}" @gv-button:click="${this._navigateSocial.bind(this,this.twitterUrl)}"></gv-button><gv-button class="social-link" link icon="thirdparty:linkedin" .href="${this.linkedinUrl}" @gv-button:click="${this._navigateSocial.bind(this,this.linkedinUrl)}"></gv-button></div></div>`}_onSubscribe(){(0,e.dispatchCustomEvent)(this,"subscribe",this.email)}_onSkip(){(0,e.dispatchCustomEvent)(this,"skip")}_navigateSocial(t){window.open(t,"_blank")}_onInputChange(t){this._invalid=t.target.invalid,this.email=t.detail}}exports.GvNewsletterSubscription=i,window.customElements.define("gv-newsletter-subscription",i);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvPagination=void 0;const t=require("lit"),i=require("../lib/events");require("../atoms/gv-button");const e=require("../lib/i18n");class s extends t.LitElement{static get properties(){return{data:{type:Object},hideEmpty:{type:Boolean,attribute:"hide-empty"},widget:{type:Boolean},disabled:{type:Boolean},_first:{type:Number},_last:{type:Number},_current:{type:Number},_total:{type:Number}}}static get styles(){return[t.css`.pagination{--font-size:var(--gv-pagination--fz, var(--gv-theme-font-size-s, 12px));font-size:var(--fz);--gv-button--fz:var(--fz);display:flex;align-items:center}gv-button{--gv-icon--s:var(--gv-pagination-icon--s, 18px);min-width:29px}gv-input{width:50px}`]}constructor(){super(),this.hideEmpty=!1,this.hasInput=!1,this.max=10,this.center=this.max/2-1,this.sizes=[],this.links={}}set data(t){t&&(this._last=t.last,this._current=parseInt(t.current_page),this._pages=t.total_pages,this._pages<this.max&&(this.max=this._pages))}_goToPage(t){this._current=parseInt(t),(0,i.dispatchCustomEvent)(this,"paginate",{page:t})}_onSubmit(t){const i=t.target.value;this._goToPage(i)}_onClickToSearch(){const t=this.shadowRoot.querySelector("gv-input").value;t&&this._goToPage(t)}_renderPagination(){const i=[];for(let t=0;t<this._pages;t++)i.push(t+1);let s=i.slice(0,this._current-1),n=i.slice(this._current);if(i.length>this.max){let t=s.length-this.center-1,i=this.max-this._current>this.center?this.max-this._current:this.center;if(t>0){i=this.center;const e=this._last-this._current-i;e<0&&(t+=e),s=s.slice(t)}n=n.slice(0,i)}const a=s.map((i=>t.html`<gv-button small outlined @click="${this._goToPage.bind(this,i)}">${i}</gv-button>`)),h=n.map((i=>t.html`<gv-button small outlined @click="${this._goToPage.bind(this,i)}">${i}</gv-button>`));return a.unshift(t.html`<gv-button small .disabled="${this.disabled||0===a.length}" .icon="${this.widget?"navigation:angle-left":null}" .title="${(0,e.i18n)("gv-pagination.previous")}" outlined @click="${0===a.length?()=>{}:this._goToPage.bind(this,this._current-1)}">${this.widget?"":(0,e.i18n)("gv-pagination.previous")}</gv-button>`),h.push(t.html`<gv-button small .disabled="${this.disabled||0===h.length}" .icon="${this.widget?"navigation:angle-right":null}" .title="${(0,e.i18n)("gv-pagination.next")}" outlined @click="${0===h.length?()=>{}:this._goToPage.bind(this,this._current+1)}">${this.widget?"":(0,e.i18n)("gv-pagination.next")}</gv-button>`),t.html`${this.widget?a.slice(0,1):a} ${t.html`<gv-button .disabled="${this.disabled}" small primary>${this.widget?this._current+" / "+i.length:this._current}</gv-button>`} ${this.widget?h.slice(h.length-1,h.length):h}`}_hasData(){return this._pages&&this._last&&this._current}_hideEmpty(){return this._hasData()&&this.hideEmpty&&this._pages<2}render(){return this._hasData()&&!this._hideEmpty()?t.html`<div class="pagination">${this.hasInput?t.html`<gv-input class="goto" @gv-input:submit="${this._onSubmit}" type="number" min="1" max="${this._pages}" placeholder="Page" small></gv-input><gv-button small outlined @click="${this._onClickToSearch}" icon="general:search"></gv-button>`:""} ${this._renderPagination()}</div>`:t.html``}}exports.GvPagination=s,window.customElements.define("gv-pagination",s);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvProperties=void 0;const e=require("lit");require("./gv-schema-form"),require("./gv-resizable-views"),require("../molecules/gv-table"),require("../atoms/gv-button"),require("../atoms/gv-input"),require("../atoms/gv-icon"),require("../atoms/gv-text"),require("../atoms/gv-input-message"),require("../atoms/gv-select");const t=require("../lib/events"),i=require("../lib/properties"),r=require("../lib/i18n"),o=require("lit/directives/class-map"),s=require("../mixins/keyboard-element"),n=require("../styles/empty");class a extends((0,s.KeyboardElement)(e.LitElement)){static get properties(){return{dynamicPropertySchema:{type:Object},properties:{type:Array},_properties:{type:Array,attribute:!1},provider:{type:Object},providers:{type:Array},_propertySchemaForm:{type:Object,attribute:!1},expert:{type:Boolean},_formattedErrors:{type:Array,attributes:!1},_filter:{type:String},_paginationData:{type:Object,attribute:!1},_pageSize:{type:Number,attribute:!1},_newItem:{type:Object,attribute:!1},_providerDocumentation:{type:Boolean,attribute:!1},_showDocumentation:{type:Boolean,attribute:!1},_textRows:{type:Number,attribute:!1},readonly:{type:Boolean,reflect:!0},encryptable:{type:Boolean,reflect:!0}}}constructor(){super(),this.properties=[],this.types=[],this.provider={},this._currentResource=null,this._formattedErrors=[],this._showDocumentation=!0,this._newItem={key:"",value:"",_new:!0},this._pageSize=10,this._textRows=10,this._pageSizes=[5,10,25,50,100],this._errors=[]}onKeyboard(){if(this.isPressed(s.KEYS.Esc)&&this._onClosePropertySchemaForm(),this.isPressed(s.KEYS.Shift,s.KEYS.Ctrl,s.KEYS.Space)){const e=this.shadowRoot.querySelector("#search-property");e&&e.focus()}}set properties(e){this._properties=e.sort(((e,t)=>e.key.localeCompare(t.key))).map((e=>(e.encrypted&&(e.encryptable=!0),e)))}get properties(){return this._properties}_getResizableViews(){return this.shadowRoot.querySelector("gv-resizable-views")}_maximizeTopView(){const e=this._getResizableViews();e&&e.maximizeTop(95,5)}_maximizeBottomView(){const e=this._getResizableViews();e&&e.resize(30,70)}_splitMainViews(){const e=this._getResizableViews();e&&e.split()}_isNewLineTable(e){return!0===e._new}_onInputNew(e,t){const r=t.target;this._newItem[e]=t.detail;const{errors:o}=(0,i.parseRaw)((0,i.toNameEqualsValueString)([...this.properties,this._newItem]));this._errors=o,setTimeout((()=>{const t=this.shadowRoot.querySelector("gv-button#add-property");o.length>0||this._disabledNewLine(this._newItem)?t.setAttribute("disabled",!0):t.removeAttribute("disabled"),"key"===e&&(0===o.length?(r.removeAttribute("invalid"),r.setAttribute("valid",!0)):(r.removeAttribute("valid"),r.setAttribute("invalid",!0)))}),0)}_onInput(){(0,t.dispatchCustomEvent)(this,"change",{properties:this.properties})}_onSwitchEncrypted(e){!0===e.encrypted&&(e.value="",e.encrypted=!1,e.encryptionWarning=(0,r.i18n)("gv-properties.infos.overwrite-encryption"),this.requestUpdate()),(0,t.dispatchCustomEvent)(this,"switch-encrypted",{properties:this.properties})}_addProperty(e){delete e._new,this.properties=[e,...this._properties],this._newItem={key:"",value:"",_new:!0,encryptable:!1,encrypted:!1},(0,t.dispatchCustomEvent)(this,"change",{properties:this.properties})}_removeProperty(e){this._properties=this._properties.filter((t=>t.key!==e.key)),(0,t.dispatchCustomEvent)(this,"change",{properties:this.properties})}_disabledNewLine(e){return null==e.key||null==e.value||""===e.key.trim()||""===e.value.trim()}_submitExpertMode(){this.expert&&(this.properties=this._handleExpertModeInput(this.shadowRoot.querySelector("#expert-input").value))}_onExpertModeTextInput({detail:e}){this._handleExpertModeInput(e)}_handleExpertModeInput(e){let r=this._properties;const o=this.provider&&this.provider.enabled,s=r.filter((e=>o&&e.dynamic)),n=r.filter((e=>e.encrypted)),a=`${e}\n${(0,i.toNameEqualsValueString)(s)}\n${(0,i.toNameEqualsValueString)(n)}`,{errors:p}=(0,i.parseRaw)(a);if(this._errors=p,0===p.length){const{variables:o}=(0,i.parseRaw)(e);r=[...o,...s,...n],(0,t.dispatchCustomEvent)(this,"change",{properties:r})}return r}_onSubmitPropertyForm({detail:e}){const i=e.values;(0,t.dispatchCustomEvent)(this,"save-provider",{provider:i}),this.requestUpdate()}submit(){this.expert?this._submitExpertMode():this._onSubmit()}_onSubmit(){null==[...this.shadowRoot.querySelectorAll("form .control")].find((e=>e.invalid))&&this._addProperty(this._newItem)}_onConfigureDynamicProperties(){if(null==this.dynamicPropertySchema){const e=this.providers.reduce(((e,t)=>(e[t.id]=t.key,e)),{}),t=Object.keys(e);this.dynamicPropertySchema={properties:{enabled:{type:"boolean",title:"Enabled",description:" This service is requiring an API deployment. Do not forget to deploy API to start dynamic-properties service."},schedule:{type:"string",title:"Schedule","x-schema-form":{"cron-expression":!0}},provider:{type:"string",title:"Provider type",enum:t,default:t[0],"x-schema-form":{titleMap:e}}},required:["schedule","provider"]}}const e=this.providers[0];this._propertySchemaForm={properties:{...this.dynamicPropertySchema.properties,configuration:e.schema},required:this.dynamicPropertySchema.required},this._providerDocumentation=e.documentation,this._maximizeBottomView()}_onClosePropertySchemaForm(){this._propertySchemaForm=null,this._maximizeTopView()}_onSearchProperty({detail:e}){this._filter=e,this._onClosePropertySchemaForm()}_onClearProperty(){this._filter=null,this._onClosePropertySchemaForm()}get _errors(){return this._formattedErrors}set _errors(e){this._formattedErrors=e.map((({type:e,key:t,pos:o})=>e===i.ERROR_TYPES.INVALID_NAME?{line:o.line,msg:(0,r.i18n)("gv-properties.errors.invalid-key",{key:t})}:e===i.ERROR_TYPES.DUPLICATED_NAME?{line:o.line,msg:(0,r.i18n)("gv-properties.errors.duplicated-key",{key:t})}:e===i.ERROR_TYPES.INVALID_LINE?{line:o.line,msg:(0,r.i18n)("gv-properties.errors.invalid-line")}:e===i.ERROR_TYPES.INVALID_VALUE?{line:o.line,msg:(0,r.i18n)("gv-properties.errors.invalid-value")}:{line:"?",msg:(0,r.i18n)("gv-properties.errors.unknown")}))}_renderErrors(t=!1){return this._formattedErrors.length>0?e.html`<div class="${(0,o.classMap)({"add-form-error":!0,"add-form-error_expert":this.expert})}"><div></div><div class="error-list">${this._formattedErrors.map((({line:i,msg:o})=>e.html`<gv-input-message>${t?e.html`<strong .innerHTML="${(0,r.i18n)("gv-properties.errors.line")} ${i}: "></strong>`:""} <span .innerHTML="${o}"></span></gv-input-message>`))}</div></div>`:e.html``}_renderTable(){const t=this.provider&&this.provider.enabled;if(this.expert){this._computeTextRows();const i=(t?this._properties.filter((e=>!(t&&e.dynamic))):this._properties).filter((e=>!e.encrypted)).map((e=>`${e.key}="${e.value}"`)).join("\n");return e.html`<gv-text id="expert-input" placeholder="${(0,r.i18n)("gv-properties.placeholder.input")}" @gv-text:input="${this._onExpertModeTextInput}" .value="${i}" ?readonly="${this.readonly}" .rows="${this._textRows}"></gv-text>${this._renderErrors(!0)}`}{const i={data:[{field:"dynamic",label:"Dynamic",width:"40px",type:e=>e.dynamic&&t?"gv-icon":"div",attributes:{shape:e=>e.dynamic&&t?"code:time-schedule":"",title:e=>e.dynamic&&t?"Dynamic properties service is actually in running":"",style:"justify-content: center; align-items: center; height: 100%;"}},{field:"key",label:"Key",type:"gv-input",attributes:{clipboard:!0,placeholder:(0,r.i18n)("gv-properties.placeholder.key"),name:"key",required:!0,readonly:this.readonly}},{field:"value",label:"Value",type:"gv-input",attributes:{name:"value",placeholder:"Property value",required:!0,readonly:this.readonly,disabled:e=>e.dynamic&&t||e.encrypted,type:e=>e.encrypted?"password":"text",title:e=>e.encrypted?(0,r.i18n)("gv-properties.infos.encrypted-value"):"",description:e=>e.encryptionWarning,icon:null,"ongv-input:input":this._onInput.bind(this)}}]};!0===this.encryptable&&i.data.push({field:"encryptable",type:"gv-switch",style:"--gv-switch--ta: right;",width:"105px",attributes:{description:(0,r.i18n)("gv-properties.encrypted-toggle"),required:!0,readonly:this.readonly,disabled:e=>e.dynamic&&t,"ongv-switch:input":this._onSwitchEncrypted.bind(this),style:"display: inline-flex; font-size: 12px; height: 40px;"}}),!0!==this.readonly&&i.data.push({type:"gv-button",width:"40px",attributes:{"ongv-button:click":(e,t,i)=>this._removeProperty(e,i),title:"Remove",disabled:e=>e.dynamic&&t,danger:!0,outlined:!0,icon:"home:trash"}});const o=null!=this._filter?this._properties.filter((e=>(e.key.toLowerCase()+e.value.toLowerCase()).includes(this._filter))):this._properties;let s=[...o];if(this._paginationData){this._paginationData.last=Math.ceil(o.length/this._pageSize),this._paginationData.total=o.length,this._paginationData.total_pages=Math.ceil(o.length/this._pageSize);const e=(this._paginationData.current_page-1)*this._pageSize;s=[...o].splice(e,this._pageSize)}const n=this.encryptable?"add-form-grid-with-encrypted-toggle":"add-form-grid",a=!0!==this.readonly?e.html`<form id="add-property-form" class="add-form ${n}" @submit="${this._onSubmit}"><div></div><gv-input class="control" placeholder="${(0,r.i18n)("gv-properties.placeholder.key")}" required @gv-input:input="${this._onInputNew.bind(this,"key")}" value="${this._newItem.key}"></gv-input><gv-input class="control" placeholder="${(0,r.i18n)("gv-properties.placeholder.value")}" required @gv-input:input="${this._onInputNew.bind(this,"value")}" .value="${this._newItem.value}"></gv-input>${this.encryptable?e.html`<gv-switch class="control" required description="${(0,r.i18n)("gv-properties.encrypted-toggle")}" @gv-switch:input="${this._onInputNew.bind(this,"encryptable")}" .value="${this._newItem.encryptable}"></gv-switch>`:""}<gv-button id="add-property" icon="code:plus" outlined disabled="disabled" @gv-button:click="${this._addProperty.bind(this,this._newItem)}" title="${(0,r.i18n)("gv-properties.add")}"></gv-button></form>${this._renderErrors()}<hr>`:"";return e.html`${a}<gv-table .options="${i}" .items="${s}" noheader nosort order="key" rowheight="57px"></gv-table>`}}_onChangeMode({detail:e}){this._submitExpertMode(),this.expert=e,this._errors=[],this._newItem={key:"",value:"",_new:!0},this._onClosePropertySchemaForm()}_onPaginate({detail:e}){this._paginationData.current_page=e.page,this._onClosePropertySchemaForm(),this.requestUpdate()}updated(e){(e.has("_properties")||e.has("_pageSize"))&&(this._paginationData={first:1,last:Math.ceil(this._properties.length/this._pageSize),total:this._properties.length,current_page:1,total_pages:Math.ceil(this._properties.length/this._pageSize)})}_onChangePageSize({detail:e}){this._pageSize=Number(e).valueOf(),this._onClosePropertySchemaForm()}_renderTableForm(){return e.html`<div class="container"><div class="header"><div class="title">Manage global properties <span>(${this._properties?this._properties.length:0})</span></div><gv-switch small .description="${this.expert?"Expert":"Simple"}" .value="${this.expert}" @gv-switch:input="${this._onChangeMode}"></gv-switch><gv-input id="search-property" placeholder="Filter properties (Shift + Ctrl + Space)" type="search" small class="search-input" .disabled="${this.expert}" @gv-input:input="${this._onSearchProperty}" @gv-input:clear="${this._onClearProperty}"></gv-input><gv-select class="page-size__select" @gv-select:input="${this._onChangePageSize}" small .options="${this._pageSizes}" .value="${this._pageSize}" .disabled="${this.expert||null==this._paginationData}"></gv-select><gv-pagination @gv-pagination:paginate="${this._onPaginate}" .disabled="${this.expert||null==this._paginationData}" .data="${this._paginationData}" widget></gv-pagination></div><div class="content"><div class="form-content">${this._renderTable()}</div></div></div>`}_fetchDocumentation(){this._showDocumentation=!0}_hideDocumentation(){this._showDocumentation=!1}get dirty(){const e=this.shadowRoot.querySelector("gv-schema-form");return e&&e.dirty}confirm(){const e=this.shadowRoot.querySelector("gv-schema-form");return e?e.confirm().then((()=>this._onClosePropertySchemaForm())):Promise.resolve()}_renderForm(){return e.html`<gv-schema-form slot="top" scrollable .schema="${this._propertySchemaForm}" .values="${this.provider}" .icon="design:edit" has-header ?readonly="${this.readonly}" @gv-schema-form:submit="${this._onSubmitPropertyForm}"><div slot="title" class="properties-title">Configure dynamic properties</div><gv-button slot="header-left" icon="general:close" outlined small @gv-button:click="${this._onClosePropertySchemaForm}" title="Close (esc)"></gv-button><gv-button slot="header-left" icon="home:book" ?disabled="${this._showDocumentation}" outlined small @gv-button:click="${this._fetchDocumentation}" title="Open documentation"></gv-button></gv-schema-form>`}_renderBottom(){return this._propertySchemaForm&&this._showDocumentation?e.html`<gv-resizable-views no-overflow direction="horizontal">${this._renderForm()}<gv-documentation slot="bottom" .text="${this._providerDocumentation}" @gv-documentation:close="${this._hideDocumentation}"></gv-documentation></gv-resizable-views>`:this._propertySchemaForm?this._renderForm():e.html`<div class="properties-bottom-container">${this._renderDynamicConfiguration()}</div>`}_renderDynamicConfiguration(){const t=this.provider&&this.provider.enabled;let i="";return(t||!0!==this.readonly)&&(i=e.html`<gv-button icon="tools:tools" @gv-button:click="${this._onConfigureDynamicProperties}" outlined .disabled="${this.expert}">Configure dynamic properties</gv-button>`),t?e.html`<div class="properties-message">Dynamic properties service is actually in <code>running</code> state and run with cron expression <code>${this.provider.schedule}</code> using <code>${this.provider.provider}</code> provider.</div>${i}`:this.readonly?e.html`<div class="empty">No dynamic properties service configured</div>`:i}_onMove(){this._computeTextRows()}_computeTextRows(){const e=this.shadowRoot.querySelector(".content");if(e){const{height:t}=e.getBoundingClientRect();this._textRows=Math.round(Math.round(t-20)/30)-2}}render(){return this.providers&&this.providers.length>0?e.html`<div class="properties"><gv-resizable-views no-overflow @gv-resizable-views:move="${this._onMove}" @gv-resizable-views:resize="${this._onMove}"><div slot="top" class="box">${this._renderTableForm()}</div><div slot="bottom">${this._renderBottom()}</div></gv-resizable-views></div>`:e.html`<div class="properties"><div class="table-box">${this._renderTableForm()}</div></div>`}static get styles(){return[n.empty,e.css`:host{box-sizing:border-box;height:100%;width:100%;display:block}.properties{display:flex;height:100%;width:100%}gv-resizable-views{height:100%;width:100%}gv-schema-form{margin:0}.table-box{width:100%;border-left:1px solid #bfbfbf;display:flex}gv-table{height:auto;flex:1;margin-top:10px;margin-right:50px;--gv-table-rows--ov:none;--gv-table--colmg:var(--gv-properties-table--colmg, 0.2rem);--gv-table-cell--d:inline;--gv-table-row--ai:flex-start;--gv-table-row--ac:flex-start;--gv-table-hover--bgc:var(--gv-theme-neutral-color-lightest)}.properties-title{text-transform:uppercase;letter-spacing:.2rem}.properties-bottom-container{display:flex;justify-content:center;align-items:center;height:100%;flex-direction:column}.header{border-bottom:1px solid #d9d9d9;display:flex;min-height:45px;align-items:center;margin-bottom:.5rem;padding:0 .5rem}.header .title{color:#28444f;font-size:18px;display:flex;align-items:flex-end;flex:1}.header .title span{font-size:12px;margin-left:8px;opacity:.7}.box{position:absolute;display:flex;flex-direction:column;width:100%;top:0;bottom:0;left:0}.container{flex-grow:1;display:flex;flex-direction:column;min-height:0;height:100%}.content{background:#fff;flex-grow:1;overflow:auto;min-height:0;padding:.5rem;display:flex;flex-direction:column;align-items:center}gv-text{--gv-text--fz:20px;--gv-text--lh:25px}gv-switch{--gv-switch--ta:right}.header gv-input{margin:0 1rem}.add-form,.add-form-error{display:grid;margin:auto 50px auto 0;box-sizing:border-box}.add-form{column-gap:var(--gv-properties-table--colmg,.2rem);border-right:solid thick transparent;height:50px}.add-form gv-input,gv-button,gv-switch{margin:auto 0}.add-form gv-switch{font-size:12px}.add-form-grid{grid-template-columns:40px auto auto 40px}.add-form-grid-with-encrypted-toggle{grid-template-columns:40px auto auto 105px 40px}.add-form-error_expert{display:flex}.add-form-error{grid-template-columns:40px 1fr}code{color:var(--gv-theme-color-warning-dark,#f57c00)}.form-content{display:flex;flex-direction:column;width:100%}.properties-message{margin-bottom:.5rem;font-size:14px}.page-size__select{max-width:50px}.search-input{width:300px}hr{background-color:var(--gv-theme-neutral-color);border:0;width:100%;height:2px}`]}}exports.GvProperties=a,window.customElements.define("gv-properties",a);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvResizableViews=void 0;const t=require("lit"),e=require("lit/directives/class-map"),o=require("../lib/events");class i extends t.LitElement{static get properties(){return{direction:{type:String,reflect:!0},noOverflow:{type:Boolean,attribute:"no-overflow"}}}constructor(){super(),this.direction="vertical"}split(){this.resize()}maximizeTop(){this.resize(85,15)}maximizeBottom(){this.resize(20,80)}resize(t=50,e=50){this.shadowRoot.querySelector(".top").style.height=`${t}%`,this.shadowRoot.querySelector(".bottom").style.height=`${e}%`,setTimeout((()=>{(0,o.dispatchCustomEvent)(this,"resize",{top:t,bottom:e})}),350)}resizable(t){const e=t.getAttribute("data-direction")||"horizontal",i=t.previousElementSibling,r=t.nextElementSibling;let s=0,n=0,l=0,a=0;const c=this.shadowRoot,d=this,h=function(c){const h=c.clientX-s,v=c.clientY-n;if((0,o.dispatchCustomEvent)(d,"move",{direction:e}),"vertical"===e)i.style.height=100*(l+v)/t.parentNode.getBoundingClientRect().height+"%",r.style.height=100-100*(l+v)/t.parentNode.getBoundingClientRect().height+"%";else i.style.width=100*(a+h)/t.parentNode.getBoundingClientRect().width+"%";const u="horizontal"===e?"col-resize":"row-resize";t.style.cursor=u,t.classList.add("drag"),document.body.style.cursor=u,i.style.userSelect="none",i.style.pointerEvents="none",r.style.userSelect="none",r.style.pointerEvents="none"},v=function(){t.style.removeProperty("cursor"),t.classList.remove("drag"),document.body.style.removeProperty("cursor"),i.style.removeProperty("user-select"),i.style.removeProperty("pointer-events"),r.style.removeProperty("user-select"),r.style.removeProperty("pointer-events"),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",v),c.querySelector(".box").classList.add("transition")};t.addEventListener("mousedown",(function(t){if(!t.target.classList.contains("action")){c.querySelector(".box").classList.remove("transition"),s=t.clientX,n=t.clientY;const e=i.getBoundingClientRect();l=e.height,a=e.width,document.addEventListener("mousemove",h),document.addEventListener("mouseup",v)}}))}firstUpdated(){this.shadowRoot.querySelectorAll(".resizer").forEach((t=>this.resizable(t)))}get shape(){return"horizontal"===this.direction?"design:vertical":"design:horizontal"}render(){return t.html`<div class="${(0,e.classMap)({box:!0,transition:!0,"no-overflow":this.noOverflow})}"><div class="top"><slot name="top"></slot></div><div class="resizer" data-direction="${this.direction}"><gv-icon shape="${this.shape}"></gv-icon><div class="actions"><gv-icon class="layout-icon" shape="layout:layout-right-panel-2"></gv-icon><gv-button small link class="action" icon="layout:layout-bottom-panel" title="Maximize top" @gv-button:click="${this.maximizeTop}"></gv-button><gv-button small link class="action" icon="layout:layout-horizontal-2" title="Split screen" @gv-button:click="${this.split}"></gv-button><gv-button small link class="action" icon="layout:layout-top-panel-6" title="Maximize bottom" @gv-button:click="${this.maximizeBottom}"></gv-button></div></div><div class="bottom"><slot name="bottom"></slot></div></div>`}static get styles(){return[t.css`.box{display:flex;height:100%;flex:1 1 0;flex-direction:column}:host([direction=horizontal]) .box{flex-direction:row}:host([direction=horizontal]) .layout-icon{display:none}*{box-sizing:border-box}::slotted(*){display:inline-block;width:100%}.no-overflow ::slotted(*){height:100%;position:relative}.bottom,.top{position:relative}.no-overflow .bottom,.no-overflow .top{overflow:hidden}.bottom{display:flex;flex-grow:1}.left{width:70%}.left,.right{padding:.2rem;overflow:auto}.bottom,.top{border-left:1px solid #bfbfbf;border-right:1px solid #bfbfbf;height:100%}:host([direction=horizontal]) .top{border-right:0}:host([direction=horizontal]) .bottom{border-left:0}.transition .bottom,.transition .top{transition:height 350ms ease-in-out}.top{overflow-y:auto;overflow-x:hidden;height:50%}.bottom{overflow-y:auto;overflow-x:hidden;height:50%}:host([direction=horizontal]) .bottom,:host([direction=horizontal]) .top{height:100%;width:50%}.resizer{z-index:10;background-color:#d9d9d9;--gv-icon--s:20px;display:flex;align-items:center;justify-content:flex-end;--gv-icon--c:#28444f;transition:all .2s ease-in-out;position:relative}.resizer.drag{border-width:4px 0;border-style:double;border-color:#d9d9d9;background-color:#fff}.resizer .actions,.resizer gv-icon{transition:all .2s ease-in-out}.resizer.drag .actions,.resizer.drag gv-icon{visibility:hidden;opacity:0}:host([direction=horizontal]) .resizer.drag{border-width:0 4px}.resizer>gv-icon{position:absolute}:host([direction=horizontal]) .resizer{align-items:flex-start}:host([direction=vertical]) .resizer gv-icon{right:45px}:host([direction=horizontal]) .resizer gv-icon{left:-9px;top:45px}.resizer[data-direction=vertical]{cursor:ns-resize;height:2px;width:100%}.resizer[data-direction=horizontal]{cursor:ew-resize;height:100%;width:2px}.actions{margin-top:-22px;margin-right:15px;padding:0 .2rem;border-radius:4px 4px 0 0;background-color:#d9d9d9}.actions gv-button{margin:.2rem .1rem;visibility:hidden;opacity:0;display:none;transition:all 250ms ease-in-out}.actions:focus-within,.actions:hover{padding:.2rem;margin-top:-66px}.actions:focus-within gv-button,.actions:hover gv-button{display:block;opacity:1;visibility:visible}.actions:focus-within gv-icon,.actions:hover gv-icon{display:none;opacity:0;visibility:hidden}`]}}exports.GvResizableViews=i,window.customElements.define("gv-resizable-views",i);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvResources=void 0;const e=require("lit");require("./gv-schema-form"),require("./gv-resizable-views"),require("./gv-documentation"),require("../molecules/gv-table"),require("../atoms/gv-button"),require("../molecules/gv-option"),require("../atoms/gv-switch"),require("../atoms/gv-icon");const t=require("../lib/events"),s=require("../lib/utils"),i=require("../mixins/keyboard-element"),r=require("../styles/empty");class o extends((0,i.KeyboardElement)(e.LitElement)){static get properties(){return{resources:{type:Array},_resources:{type:Array,attribute:!1},types:{type:Array},documentation:{type:Object},_currentResource:{type:Object,attribute:!1},_currentResourceLoading:{type:Boolean,attribute:!1},_filter:{type:String},readonly:{type:Boolean,reflect:!0}}}constructor(){super(),this.resources=[],this.types=[],this._currentResource=null,this._emptymessage="No resource"}onKeyboard(){if(this.isPressed(i.KEYS.Esc)&&this._onCancelResourceForm(),this.isPressed(i.KEYS.Shift,i.KEYS.Ctrl,i.KEYS.Space)){const e=this.shadowRoot.querySelector("#search-resource");e&&e.focus()}}firstUpdated(){const e=this.shadowRoot.querySelector("gv-resizable-views");null!=e&&e.updateComplete.then((()=>{this._maximizeTopView()}))}set resources(e){this._resources=this._generateId(e)}get resources(){return this._resources}_generateId(e){return e?e.map((e=>(null==e._id&&(e._id=(0,s.uuid)()),e))):e}_getResizableViews(){return this.shadowRoot.querySelector("gv-resizable-views")}_maximizeTopView(){this._getResizableViews().resize(60,40)}_maximizeBottomView(){this._getResizableViews().maximizeBottom()}_splitMainViews(){this._getResizableViews().split()}_onCancelResourceForm(){this._currentResource=null,this.documentation=null,this._maximizeTopView()}_removeResource(e){this.resources=this.resources.filter((t=>t._id!==e._id)),this._onCancelResourceForm(),(0,t.dispatchCustomEvent)(this,"change",{resources:this.resources})}_buildResourceSchema(e){const t={properties:{name:{type:"string",title:"Resource name"}},required:["name"]},s="string"==typeof e.schema?JSON.parse(e.schema):e.schema;return{properties:{...t.properties,...s.properties},required:[...t.required,...s.required]}}_onCreateResource({detail:e}){this._currentResourceLoading=!0;const t=this.types.find((t=>t.id===e.id)),s=this._buildResourceSchema(t);this._currentResource={type:t.id,title:"Create resource",icon:"code:plus",schema:s,values:{},submitLabel:"Add",dirty:!0},this._maximizeBottomView(),this._onFetchDocumentation(),setTimeout((()=>this._currentResourceLoading=!1),600)}_onSubmitResourceForm({detail:e}){delete this._currentResource._values;const{type:i}=this._currentResource,{_id:r,name:o,...n}=e.values,c={_id:r,type:i,name:o,configuration:n};if(null!=e.values._id){const e=this.resources.findIndex((e=>e._id===c._id));this.resources[e]={...this.resources[e],...c}}else null==this.resources&&(this.resources=[]),c._id=(0,s.uuid)(),c.enabled=!0,this.resources.push(c);this._onCancelResourceForm(),(0,t.dispatchCustomEvent)(this,"change",{resources:this.resources})}_onChangeResourceForm({detail:e}){this._currentResource._values=e.values}_onResetResourceForm(){delete this._currentResource._values}_findResourceById(e){return this.types.find((t=>t.id===e))}_onSelectResource({detail:{items:e}}){e.length>0?this._onEditResource(e[0]):this._onCancelResourceForm()}_onEditResource(e){const t={...e,...e.configuration};delete t.configuration;const s=this._findResourceById(e.type);this._currentResource={_id:e._id,title:"Resource configuration",type:e.type,icon:"design:edit",schema:this._buildResourceSchema(s),values:t,submitLabel:"Update"},this._splitMainViews(),this._onFetchDocumentation()}_onCloseDocumentation(){this.documentation=null}_getCurrentResourceType(){return this._currentResource?this._findResourceById(this._currentResource.type):null}_onFetchDocumentation(){(0,t.dispatchCustomEvent)(this,"fetch-documentation",{target:this,resourceType:this._getCurrentResourceType()})}get dirty(){const e=this.shadowRoot.querySelector("gv-schema-form");return e&&e.dirty}confirm(){const e=this.shadowRoot.querySelector("gv-schema-form");return e?e.confirm().then((()=>this._onCancelResourceForm())):Promise.resolve()}_onChangeResourceState(e,s){const i=this.resources.find((t=>t._id===e._id));this.resources[i]={...this.resources[i],enabled:e.enabled},(0,t.dispatchCustomEvent)(this,"change",{resources:this.resources})}_renderForm(){const t={...this._currentResource.values,...this._currentResource._values};return e.html`<gv-schema-form scrollable .schema="${this._currentResource.schema}" .values="${t}" submitLabel="${this._currentResource.submitLabel}" has-header .icon="${this._currentResource.icon}" validate-on-render .dirty="${this._currentResource.dirty||null!=this._currentResource._values}" ?readonly="${this.readonly}" @gv-schema-form:change="${this._onChangeResourceForm}" @gv-schema-form:reset="${this._onResetResourceForm}" @gv-schema-form:submit="${this._onSubmitResourceForm}"><div slot="title" class="form-title">${this._currentResource.title}</div><gv-button slot="header-left" icon="general:close" outlined small @gv-button:click="${this._onCancelResourceForm}" title="Close (esc)"></gv-button><gv-button slot="header-left" icon="home:book" ?disabled="${null!=this.documentation}" outlined small @gv-button:click="${this._onFetchDocumentation}" title="Open documentation"></gv-button></gv-schema-form>`}_renderDoc(){return e.html`<gv-documentation .text="${this.documentation.content}" .image="${this.documentation.image}" @gv-documentation:close="${this._onCloseDocumentation}"></gv-documentation>`}_renderBottom(){if(this.documentation&&this._currentResource)return e.html`<gv-resizable-views direction="horizontal" no-overflow><div slot="top">${this._renderForm()}</div><div slot="bottom">${this._renderDoc()}</div></gv-resizable-views>`;if(this._currentResource)return this._renderForm();if(this.documentation)return this._renderDoc();if(!0!==this.readonly){const t=this.types.map((e=>({id:e.id,title:e.name,description:e.description,image:e.icon})));return e.html`<div class="resources-bottom-container"><gv-option class="resource__option" .options="${t}" @gv-option:select="${this._onCreateResource}"></gv-option></div>`}return this.readonly&&this.resources.length>0?e.html`<div class="resources-bottom-container empty">You can see the resource configuration by clicking on it</div>`:void 0}_onSearchResource({detail:e}){this._filter=e}_onClearResource(){this._filter=null}render(){const t={selectable:!0,data:[{field:"name",label:"Name"},{field:"type",width:"50px",type:"gv-image",attributes:{src:e=>{const t=this._findResourceById(e.type);return t?t.icon:null},style:"width:40px;height:40px;"}},{field:"type",label:"Type"},{field:"enabled",type:"gv-switch",title:e=>e.enabled?"Click to disable":"Click to enable",width:"50px",attributes:{readonly:this.readonly,"ongv-switch:input":(e,t)=>this._onChangeResourceState(e,t)}}]};!0!==this.readonly&&t.data.push({type:"gv-button",width:"50px",attributes:{onClick:e=>this._removeResource(e),title:"remove",danger:!0,outlined:!0,icon:"home:trash"}});const s=null!=this._filter?this.resources.filter((e=>(e.name.toLowerCase()+e.type.toLowerCase()).includes(this._filter))):this.resources;return e.html`<div class="resources"><gv-resizable-views no-overflow><div slot="top" class="box"><div class="container"><div class="header"><div class="title">Manage global resources <span>(${this.resources.length})</span></div><gv-input id="search-resource" class="search-input" placeholder="Filter resources (Shift + Ctrl + Space)" type="search" small @gv-input:input="${this._onSearchResource}" @gv-input:clear="${this._onClearResource}"></gv-input></div><div class="content"><div class="table-container"><gv-table .options="${t}" .items="${s}" emptymessage="${this._emptymessage}" @gv-table:select="${this._onSelectResource}" order="name" rowheight="50px"></gv-table></div></div></div></div><div slot="bottom">${this._renderBottom()}</div></gv-resizable-views></div>`}static get styles(){return[r.empty,e.css`:host{box-sizing:border-box;height:100%;width:100%;display:block}.resources{display:flex;height:100%;width:100%}gv-resizable-views{height:100%;width:100%}gv-table{--gv-table-rows--ov:none}.header{border-bottom:1px solid #d9d9d9;display:flex;min-height:45px;align-items:center;margin-bottom:.5rem;padding:0 .5rem}.header .title{color:#28444f;font-size:18px;display:flex;align-items:flex-end;flex:1}.header .title span{font-size:12px;margin-left:8px;opacity:.7}.box{position:absolute;display:flex;flex-direction:column;width:100%;top:0;bottom:0;left:0}.container{flex-grow:1;display:flex;flex-direction:column;min-height:0;height:100%}.content{background:#fff;flex-grow:1;overflow:auto;min-height:0;padding:.5rem;display:flex;flex-direction:column;align-items:center}.form-title{text-transform:uppercase;letter-spacing:.2rem}.resources-bottom-container{display:flex;justify-content:center;align-items:center;height:100%}.table-container{max-width:1200px;display:flex;flex-direction:column;width:100%}.search-input{width:300px}.resource__option{--gv-option-button--maw:175px}`]}}exports.GvResources=o,window.customElements.define("gv-resources",o);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvSchemaFormArray=void 0;const e=require("lit"),t=require("../lib/schema-form"),r=require("../lib/events"),o=require("lit/directives/class-map"),s=require("../styles/skeleton"),i=require("../mixins/update-after-browser");class l extends((0,i.UpdateAfterBrowser)(e.LitElement)){static get properties(){return{schema:{type:Object},value:{type:Array},id:{type:String,reflect:!0},title:{type:String,reflect:!0},description:{type:String},skeleton:{type:Boolean,reflect:!0},errors:{type:Array},readonly:{type:Boolean,reflect:!0}}}constructor(){super(),this.value=[]}_onNew(){const e="object"===this.schema.type?{}:"";this.value=[...this.value,e],(0,r.dispatchCustomEvent)(this,"input",this.value)}_onRemove(e){this.value.splice(e,1,null),this.value=this.value.filter((e=>null!=e)),(0,r.dispatchCustomEvent)(this,"input",this.value)}_renderValue(r,s){const i=this.schema.required,l=this.schema.disabled,a=`${this.id}.${s}`,n={...this.schema,title:null},m=(0,t.canInline)(this.schema),c={form__item:!0,form__item_cards:!m};return e.html`<div class="${(0,o.classMap)(c)}" @mouseleave="${this._onMouseLeave}">${m?"":e.html`<div class="${(0,o.classMap)({"form__item-label":!0,skeleton:this.skeleton})}"><label>${this.schema.title}</label> ${!0!==this.readonly?e.html`<gv-button link small @gv-button:click="${this._onRemove.bind(this,s)}" icon="general:close" title="Remove"></gv-button>`:""}</div>`}<div class="form__item_entry"><gv-schema-form-control .id="${a}" .skeleton="${this.skeleton}" .control="${n}" .value="${r}" ?required="${i}" ?disabled="${l}" ?readonly="${this.readonly}" compact="compact"></gv-schema-form-control>${m?e.html`<gv-button link small @gv-button:click="${this._onRemove.bind(this,s)}" icon="general:close" title="Remove"></gv-button>`:""}</div></div>`}_onMouseLeave(){this.shadowRoot.querySelectorAll("gv-select").forEach((e=>e.close()))}getControls(){return[...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control")),...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control-array")),...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control-object"))]}getControl(e){return this.shadowRoot.querySelector(`[id="${e}"]`)}async getUpdateComplete(){await super.getUpdateComplete(),await Promise.all(this.getControls().map((e=>e.updateComplete)))}shouldUpdate(e){return e.has("errors")&&this.getControls().forEach((e=>{e.errors=this.errors})),super.shouldUpdate(e)}render(){if(null==this.schema)return e.html``;const t=null==this.schema["x-schema-form"]||!1!==this.schema["x-schema-form"].open;return e.html`<gv-expandable class="form__control-array" ?open="${t}"><div slot="summary" class="form__item-group-header"><div class="form__item-group-title"><label><span>${this.title||this.id}</span><span class="form__item-length">(${this.value.length})</span></label> ${this.description?e.html`<div class="description">${this.description}</div>`:""}</div>${!0!==this.readonly?e.html`<gv-button outlined small icon="code:plus" @gv-button:click="${this._onNew}">New ${this.schema.title}</gv-button>`:""}</div><div class="form__item-group" id="${this.id}" slot="details">${null!=this.value&&Array.isArray(this.value)?this.value.map(((e,t)=>this._renderValue(e,t))):""}</div></gv-expandable>`}static get styles(){return[s.skeleton,e.css`.form__item-length{font-size:12px;color:#bfbfbf;margin:0 .2rem}.form__item-group{position:relative;transition:all .3s ease-in-out}.form__item_cards form__item-group:hover{background-color:#efefef}.form__item-group-header{display:flex;flex:1;align-items:center;transition:all .3s ease-in-out;background-color:var(--gv-schema-form--bgc,#fff)}.form__item-group-header label{flex:1;margin:0}.form__item-group-title{display:flex;flex-direction:column;flex:1}.description{opacity:.6;font-size:var(--gv-theme-font-size-s,12px)}.form__item_cards{border:1px solid #d9d9d9;border-radius:4px;margin:.5rem;background-color:#fff;transition:all .3s ease-in-out;z-index:50}.form__item_cards:hover{transform:translateY(-2px);box-shadow:0 10px 20px -10px #bfbfbf;z-index:60}.form__item_entry{display:flex}.form__item_entry gv-schema-form-control{flex:1}.form__item-label{font-style:italic;display:flex;flex-direction:row;border-bottom:1px solid #d9d9d9;padding:.5rem}.form__item-label>label{flex:1}.form__item .form_control-inline>*{margin-left:0}.form__item .form_control-inline>:first-child{margin-left:.5rem}`]}}exports.GvSchemaFormArray=l,window.customElements.define("gv-schema-form-array",l);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvSchemaFormControlObject=void 0;const e=require("lit"),t=require("../lib/schema-form"),r=require("lit/directives/class-map"),o=require("../styles/skeleton");require("../molecules/gv-expandable");const s=require("../mixins/update-after-browser");class l extends((0,s.UpdateAfterBrowser)(e.LitElement)){static get properties(){return{schema:{type:Object},value:{type:Object,reflect:!0},id:{type:String,reflect:!0},title:{type:String,reflect:!0},errors:{type:Array},skeleton:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},hidden:{type:Boolean,reflect:!0},compact:{type:Boolean}}}constructor(){super(),this.value=[]}_renderPart(t){const r=this.required||this.schema.required&&this.schema.required.includes(t),o=this.disabled||this.schema.disabled&&this.schema.disabled.includes(t),s=null!=this.id?`${this.id}.${t}`:t,l={...this.schema.properties[t]},i=null!=this.value?this.value[t]:null;return e.html`<gv-schema-form-control .id="${s}" .control="${l}" .value="${i}" .skeleton="${this.skeleton}" ?required="${r}" ?disabled="${o}" ?readonly="${this.readonly}" ?hidden="${this.hidden}" class="control" ?compact="${this.compact}"></gv-schema-form-control>`}getControls(){return[...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control")),...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control-array")),...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control-object"))]}getControl(e){return this.shadowRoot.querySelector(`[id="${e}"]`)}async getUpdateComplete(){await super.getUpdateComplete(),await Promise.all(this.getControls().map((e=>e.updateComplete)))}shouldUpdate(e){return e.has("errors")&&this.getControls().forEach((e=>{e.errors=this.errors})),super.shouldUpdate(e)}render(){const o=Object.keys(this.schema.properties),s=(0,t.canGrid)(this.schema),l={"form_control-inline":(0,t.canInline)(this.schema),"form_control-grid":s,"form_control-grid-odd":s&&o.length%2!=0},i={"form__control-group-title":!0,skeleton:this.skeleton},a=o.map((e=>this._renderPart(e)));if(this.title){const t=null==this.schema["x-schema-form"]||!1!==this.schema["x-schema-form"].open;return e.html`<gv-expandable ?open="${t}"><div slot="summary" class="${(0,r.classMap)(i)}" title="${this.title}">${this.title}</div><div slot="details" class="${(0,r.classMap)(l)}">${a}</div></gv-expandable>`}return e.html`<div class="${(0,r.classMap)(l)}">${a}</div>`}static get styles(){return[o.skeleton,e.css`.form__control-group-title{padding:.5rem 0}.form_control-grid,.form_control-inline{display:grid;grid-template-columns:repeat(2,1fr)}.form_control-grid-odd :first-child{grid-column:1/3}.form_control-inline>*{--gv-schema-form-control--m:0 0.2rem 0 0;overflow:auto}.form_control-inline>:last-child{--gv-schema-form-control--m:0 0 0 0.2rem}`]}}exports.GvSchemaFormControlObject=l,window.customElements.define("gv-schema-form-control-object",l);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvSchemaFormControl=void 0;const e=require("lit"),t=require("../lib/events");require("../atoms/gv-input"),require("../atoms/gv-input-message"),require("../atoms/gv-text"),require("../atoms/gv-select"),require("../atoms/gv-select-native"),require("../atoms/gv-switch"),require("../molecules/gv-code"),require("../molecules/gv-expression-language"),require("../molecules/gv-cron-editor"),require("../atoms/gv-autocomplete"),require("../organisms/gv-schema-form-array"),require("../organisms/gv-schema-form-control-object");const r=require("../lib/schema-form"),o=require("../mixins/update-after-browser");class s extends((0,o.UpdateAfterBrowser)(e.LitElement)){static get properties(){return{type:{type:String},id:{type:String,reflect:!0},name:{type:String,reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},title:{type:String,reflect:!0},pattern:{type:String},control:{type:Object},errors:{type:Array},value:{type:Object,reflect:!0},skeleton:{type:Boolean,reflect:!0},hidden:{type:Boolean,reflect:!0},writeOnly:{type:Boolean,reflect:!0},compact:{type:Boolean}}}constructor(){super(),this._observedProperties=["disabled","readonly","required"]}isExpressionLanguage(){return this.control["x-schema-form"]&&null!=this.control["x-schema-form"]["expression-language"]}isCronExpression(){return this.control["x-schema-form"]&&!0===this.control["x-schema-form"]["cron-expression"]}isPassword(){return!0===this.control.writeOnly||this.control["x-schema-form"]&&null!=this.control["x-schema-form"].type&&"password"===this.control["x-schema-form"].type}getPlaceholder(){return this.control["x-schema-form"]&&this.control["x-schema-form"].placeholder?this.control["x-schema-form"].placeholder:null}isCodemirror(){return(0,r.isCodemirror)(this.control)}isObject(){return(0,r.isObject)(this.control)}isAutocomplete(){return this.control["x-schema-form"]&&null!=this.control["x-schema-form"].event&&"string"===this.control.type}isText(){return this.control["x-schema-form"]&&"text"===this.control["x-schema-form"].type&&"string"===this.control.type}getElementName(){return this.isObject()?"gv-schema-form-control-object":(this.control.enum||this.control.items&&this.control.items.enum)&&!this.isAutocomplete()?"array"===this.control.type?"gv-select":"gv-select-native":(0,r.isComplexArray)(this.control)?"gv-schema-form-array":"array"===this.control.type?"gv-button":"boolean"===this.control.type?"gv-switch":this.isExpressionLanguage()?"gv-expression-language":this.isCodemirror()?"gv-code":this.isCronExpression()?"gv-cron-editor":this.isText()?"gv-text":"gv-input"}_updateProperties(e){null!=e&&this._observedProperties.forEach((t=>{null!=this[t]&&(e[t]=this[t])}))}_renderControl(){const e=this.getElementName(),o=document.createElement(e);if(o.id=this.id,o.name=this.id,o.skeleton=this.skeleton,o.classList.add("form__control"),null==this.value&&null!=this.control.default&&(this.value=this.control.default,(0,t.dispatchCustomEvent)(this,"default-value",{value:this.value,currentTarget:o,control:this.control})),null!=this.value&&this._setValue(o),"object"===this.control.type?o.schema=this.control:(0,r.isComplexArray)(this.control)&&(o.schema=this.control.items),this._updateProperties(o),this.control.title)o.label=this.control.title,o.title=this.control.title;else{const e=this.id.split("."),t=e[e.length-1];isNaN(parseInt(t,10))&&(o.label=t,o.title=t)}this.control.pattern&&(o.pattern=this.control.pattern),"integer"===this.control.type&&(o.type="number"),this.isText()&&(o.rows=3,o.autosize=!0,o.placeholder=this.control.description);const s=this.getPlaceholder();if(this.control.enum||this.control.items&&this.control.items.enum){const e=this.control.enum||this.control.items.enum;this.control["x-schema-form"]&&this.control["x-schema-form"].titleMap?o.options=e.map((e=>({value:e,label:this.control["x-schema-form"].titleMap[e]||e}))):o.options=e,"array"===this.control.type&&(o.multiple=!0)}else this.isCodemirror()?(o.options=this.control["x-schema-form"].codemirrorOptions,null!=this.control.default&&null==o.options.value&&(o.options.value=this.control.default)):this.isExpressionLanguage()?(o.options={},o.rows=1):this.isPassword()&&(o.type="password");let i;if(this.control.description&&(o.description=this.control.description),this.compact&&(o.placeholder=o.description||o.label,o.label=null,o.description=null,o.compact=this.compact),null!=s&&(this.isExpressionLanguage()||this.isCodemirror()?o.options.placeholder=s:o.placeholder=s),o.addEventListener(`${e}:input`,this._onInput.bind(this)),this.isAutocomplete()){const e=document.createElement("gv-autocomplete");e.minChars=0,e.filter=!0,o.clearable=!0,e.id=this.id,e.appendChild(o),e.addEventListener("gv-autocomplete:select",this._onInput.bind(this)),o.addEventListener("gv-input:clear",this._onInput.bind(this)),i=e}else i=o;return null!=this.control["x-schema-form"]&&(0,t.dispatchCustomEvent)(this,"control-ready",{currentTarget:i,control:this}),i}_onInput(e){e.preventDefault(),e.stopPropagation();let r=null;r="GV-AUTOCOMPLETE"===e.target.tagName?e.detail.value:e.detail,(0,t.dispatchCustomEvent)(this,"change",{value:r,currentTarget:e.target,control:this.control})}getControls(){return[...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control")),...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control-array")),...Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control-object"))]}getControl(e){return null==e&&(e=this.id),this.shadowRoot.querySelector(`[id="${e}"]`)}_setValue(e){return null!=this.value&&null!=e&&("boolean"===this.control.type||"array"===this.control.type||"object"===this.control.type?e.value=this.value:e.value=this.value.toString?this.value.toString():this.value),e}async updated(e){e.has("value")&&Promise.all(this.getControls().map((e=>e.updateComplete))).then((()=>{this._setValue(this.getControl())}))}async getUpdateComplete(){await super.getUpdateComplete(),await Promise.all(this.getControls().map((e=>e.updateComplete)))}formatErrorMessage(e){let t;return t=null!=this.control.properties&&null!=this.control.properties[e.argument]?this.control.properties[e.argument].title:this.control.title,t?`<span>${e.message.replace(e.argument,t)}</span>`:`<span>${e.message}</span>`}shouldUpdate(e){if(null!=this._observedProperties.find((t=>e.has(t)))&&this._updateProperties(this.getControl()),e.has("errors")&&null!=this.errors){this.getControls().forEach((e=>{e.errors=this.errors}));return this.shadowRoot.querySelectorAll(".form__control-error").forEach((e=>e.innerHTML="")),this.errors.forEach((e=>{const t="instance"===e.property?e.argument:e.property.replace("instance.",""),r=this.shadowRoot.querySelector(`[id="${t}-error"]`);if(r){const t=document.createElement("gv-input-message");t.innerHTML=this.formatErrorMessage(e),t.level="warn",r.appendChild(t)}})),!1}return super.shouldUpdate(e)}render(){return e.html`${this._renderControl()}<div class="form__control-error" id="${this.id+"-error"}"></div>`}static get styles(){return[e.css`:host{box-sizing:border-box;margin:var(--gv-schema-form-control--m,.4rem);display:block}:host([hidden]){visibility:hidden;height:0;margin:0;padding:0;overflow:hidden}.form__control-description,.form__control-error{font-size:12px}.form__control-description{opacity:.8}.form__control-label{display:flex;flex-direction:row;border-bottom:1px solid #d9d9d9}label{margin:.2rem}.form__control-label label{flex:1;text-transform:capitalize}.form__control-array,.form__control-object{display:flex;flex-direction:column}.form__control-enum{display:flex}.form__control-array gv-button{align-self:flex-end}.form__control{position:relative}gv-code,gv-expression-language,gv-input,gv-select,gv-select-native,gv-switch{width:100%;margin:.2rem 0}gv-autocomplete:hover,gv-select-native:hover,gv-select:hover{z-index:70}.error{color:var(--gv-theme-color-error,#f44336)}.warning{color:var(--gv-theme-color-warning,#ff9800)}`]}}exports.GvSchemaFormControl=s,window.customElements.define("gv-schema-form-control",s);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvSchemaForm=void 0;const t=require("lit"),e=require("object-path"),i=require("../lib/events"),s=require("../lib/utils"),o=require("lit/directives/class-map"),r=require("lit/directives/repeat"),a=require("jsonschema"),n=require("../styles/empty");require("./gv-schema-form-control");class l extends t.LitElement{static get properties(){return{schema:{type:Object},errors:{type:Object},values:{type:Object},submitLabel:{type:String},hasFooter:{type:Boolean,attribute:"has-footer"},hasHeader:{type:Boolean,attribute:"has-header"},_confirm:{type:Object},_values:{type:Object,attribute:!1},dirty:{type:Boolean,reflect:!0},hideDeprecated:{type:Boolean,attribute:"hide-deprecated"},validateOnRender:{type:Boolean,attribute:"validate-on-render"},_validatorResults:{type:Object},skeleton:{type:Boolean,reflect:!0},_touch:{type:Boolean},readonly:{type:Boolean,reflect:!0},scrollable:{type:Boolean,reflect:!0},groups:{type:Array}}}constructor(){super(),this.hideDeprecated=!1,this._values={},this.submitLabel="Ok",this.hasHeader=!1,this.hasFooter=!1,this._touch=!1,this._validator=new a.Validator,this._validatorResults={},this._ignoreProperties=[],this._dynamicControls=[],this._dynamicAttributes=["disabled","required","hidden"],this.groups=null,this.addEventListener("gv-schema-form-control:default-value",this._onDefaultValue.bind(this)),this.addEventListener("gv-schema-form-control:change",this._onChange.bind(this)),this.addEventListener("gv-schema-form-control:control-ready",this._onControlReady.bind(this))}set values(t){(0,s.deepEqual)(this._values,t)||(this._initialValues=t?{...t}:{},this._values=(0,s.deepClone)(this._initialValues))}get values(){return this._values}reset(t=null){this._values=(0,s.deepClone)(t||this._initialValues),this._touch=!1,this._setDirty(!1),this.getControls().forEach((t=>{t.requestUpdate()}))}_onReset(){this.reset(),(0,i.dispatchCustomEvent)(this,"reset")}requestValidation(){clearTimeout(this._validateTimeout),this._validateTimeout=setTimeout((()=>{this.validate(),this._updateActions()}),350)}submit(){this._onSubmit()}_onSubmit(){const t=this.validate();this.isValid()?(this._initialValues=(0,s.deepClone)(this._values),this.dirty=!1,this._touch=!1,(0,i.dispatchCustomEvent)(this,"submit",{values:this._values,validatorResults:t})):(0,i.dispatchCustomEvent)(this,"error",{values:this._values,validatorResults:t})}_setDirty(t=!0){this.dirty=!!t}_setTouch(t=!0){this._touch=!!t}confirm(){if(this.isTouch()){if(this._confirm&&this._confirm.promise)return this._confirm.promise;const t=new Promise(((t,e)=>this._confirm={resolve:t,reject:e}));return this._confirm.promise=t,t}return Promise.resolve()}_onConfirmReset(){const{resolve:t}=this._confirm;this._confirm=null,this._onReset(),this.requestUpdate(),this.updateComplete.then((()=>{t(this)}))}_onConfirmEdit(){this._confirm.reject(this),this._confirm=null,this._updateChildren(this.validateOnRender)}_getSubmitBtn(){return this.shadowRoot.querySelector("#submit")}_getResetBtn(){return this.shadowRoot.querySelector("#reset")}_dispatchChange(){clearTimeout(this._changeTimeout),this._changeTimeout=setTimeout((()=>{(0,i.dispatchCustomEvent)(this,"change",{target:this,values:this._values,validation:this._validatorResults})}),50)}_onDefaultValue({detail:{currentTarget:t,value:i,control:s}}){"integer"===s.type&&null!=i&&(i.trim&&i.length>0||i.length>0)&&(i=parseInt(i,10)),(0,e.set)(this._values,t.id,i)}_onChange({detail:{currentTarget:t,value:i,control:s}}){if(this._setTouch(!0),"integer"===s.type)if("string"==typeof i&&0===i.trim().length)i=null;else{const t=Number(i).valueOf();i=isNaN(t)?null:t}else"array"===s.type&&0===i.length?i=null:"string"!==s.type||0!==i.trim().length||s.enum?"object"===s.type&&0===Object.keys(i).length&&(i=null):i=null;null==i?(0,e.del)(this._values,t.id):(0,e.set)(this._values,t.id,i),this._updateDynamicControls(),this._validatorResults=this.validate(),this.dirty=!0,this._updateActions(),this._dispatchChange()}_onControlReady(t){t.stopPropagation(),t.preventDefault();const e=t.detail.control,s=e.control;if(s["x-schema-form"])if(s["x-schema-form"].event){const e=s["x-schema-form"].event;(0,i.dispatchCustomEvent)(this,e.name,{...e,...t.detail})}else this._hasCondition(s)&&(this._dynamicControls.push(e),this._updateDynamicControl(e))}_updateDynamicControls(){this._ignoreProperties=[],this._dynamicControls.forEach((t=>{this._updateDynamicControl(t)}))}_updateDynamicControl(t){const e=t.control;return e["x-schema-form"]&&this._dynamicAttributes.forEach((i=>{this._evaluateCondition(e,i)?(t.setAttribute(i,""),"hidden"===i&&this._ignoreProperties.push(t.id)):t.removeAttribute(i)})),null}async performUpdate(){await Promise.all(this.getControls().map((t=>t.updateComplete))),this.getControls().forEach((t=>{t.requestUpdate()})),super.performUpdate()}_renderControl(i){const s={...this.schema.properties[i]},o=this.schema.required&&this.schema.required.includes(i)||this._evaluateCondition(s,"required"),r=this.schema.disabled&&this.schema.disabled.includes(i)||this._evaluateCondition(s,"disabled"),a=this._evaluateCondition(s,"hidden");a&&this._ignoreProperties.push(i);const n=this.readonly||!0===s.readOnly,l=!0===s.writeOnly,h=(0,e.get)(this._values,i);return t.html`<gv-schema-form-control .id="${i}" .errors="${this.errors}" .control="${s}" .skeleton="${this.skeleton}" .value="${h}" ?readonly="${n}" ?writeonly="${l}" ?required="${o}" ?disabled="${r}" ?hidden="${a}"></gv-schema-form-control>`}_hasCondition(t){return!!t["x-schema-form"]&&null!=this._dynamicAttributes.find((e=>null!=t["x-schema-form"][e]))}_evaluateCondition(t,e){if(null==t["x-schema-form"]||null==t["x-schema-form"][e])return!1;const i=t["x-schema-form"][e];if("boolean"==typeof i)return i;if(!Array.isArray(i))return console.warn(`'${e}' attribute of 'x-schema-form' should be an array`),!1;let s=!0;for(const e of i){const i=Object.keys(e)[0];switch(i){case"$neq":s=s&&this._evaluateNotEqualsCondition(t,e);break;case"$eq":s=s&&this._evaluateEqualsCondition(t,e);break;case"$nodef":s=s&&this._evaluateNotDefCondition(t,e);break;case"$def":s=s&&this._evaluateDefCondition(t,e);break;default:console.warn(`Unsupported operator '${i}' on disable condition`),s=!1}}return s}_evaluateNotEqualsCondition(t,e){return!this._evaluateEqualsCondition(t,e)}_evaluateEqualsCondition(t,i){const s=i[Object.keys(i)[0]];return Object.keys(s).map((i=>{const o=s[i];let r=(0,e.get)(this._values,i);return null==r&&"string"===t.type&&(r=""),Array.isArray(o)?o.includes(r):r===o})).reduce(((t,e)=>t||e))}_evaluateNotDefCondition(t,i){const s=i[Object.keys(i)[0]];return void 0===(0,e.get)(this._values,s)||null===(0,e.get)(this._values,s)}_evaluateDefCondition(t,e){return!this._evaluateNotDefCondition(t,e)}_renderPart(){if(this._confirm)return t.html`<div class="confirm-box"><div class="error">The configuration is not valid and cannot be saved.</div><div class="confirm-box_actions"><gv-button @gv-button:click="${this._onConfirmReset}" outlined icon="general:update" danger>Lose changes</gv-button><gv-button @gv-button:click="${this._onConfirmEdit}" icon="design:edit">Edit</gv-button></div></div>`;const e=this.schema.properties?Object.keys(this.schema.properties):[];if(this._ignoreProperties=[],this.groups){const i=this.groups.reduce(((t,i)=>{const s=e.filter((t=>[...i.items||[]].includes(t)));return t.push({...i,items:s||[]}),t}),[]),s=i.find((t=>t.default))||{default:!0,items:[]},o=i.reduce(((t,e)=>[...t,...e.items]),[]);return s.items=e.filter((t=>!o.includes(t))),(0,r.repeat)(i,(e=>t.html`${e.name?t.html`<h2 class="group-title">${e.name}</h2>${(0,r.repeat)(e.items,(t=>this._renderControl(t)))}`:(0,r.repeat)(e.items,(t=>this._renderControl(t)))}`))}return t.html`${(0,r.repeat)([1],(()=>(0,r.repeat)(e,(t=>t),(t=>this._renderControl(t)))))}`}getControls(){return Array.from(this.shadowRoot.querySelectorAll("gv-schema-form-control"))}getControl(t){return this.shadowRoot.querySelector(`[id="${t}"]`)}_getErrors(){return(this._validatorResults.errors||[]).filter((t=>{let i=`${t.property.replace("instance.","")}`;Array.isArray(t.argument)||(i=`${i}.${t.argument}`);const s=`x-schema-form.errors.${i}.${t.name}`,o=(0,e.get)(this.schema,s);return o&&(t.message=o),!this._ignoreProperties.includes(i)}))}validate(){return this.schema&&(this._validatorResults=this._validator.validate(this._values,{...this.schema,additionalProperties:{}}),this.errors=this._getErrors()),this._validatorResults}isValid(){return!!this._validatorResults.valid||0===this._getErrors()}isTouch(){return this._touch||this.dirty&&this.validateOnRender}canSubmit(){return this.isTouch()&&this.isValid()}_updateActions(){null!=this._getSubmitBtn()&&(this.canSubmit()?this._getSubmitBtn().removeAttribute("disabled"):this._getSubmitBtn().setAttribute("disabled",!0));const t=this._getResetBtn();null!=t&&(this.dirty?t.removeAttribute("disabled"):t.setAttribute("disabled",!0))}_updateChildren(t){t?(this._validatorResults={},this.errors=null,this.requestValidation()):this._updateActionsTimeout=setTimeout((()=>this._updateActions()),0)}async updated(t){clearTimeout(this._updateActionsTimeout),t.has("_values")&&this.getControls().forEach((t=>{t.value=(0,e.get)(this._values,t.id)})),this._updateChildren(this.validateOnRender&&(t.has("_values")||t.has("schema")))}async getUpdateComplete(){const t=await super.getUpdateComplete();return await Promise.all(this.getControls().map((t=>t.updateComplete))),t}render(){return t.html`<form class="${(0,o.classMap)({scrollable:this.scrollable})}"><div class="${(0,o.classMap)({container:!0,confirm:this._confirm})}">${!0===this.hasHeader?t.html`<div class="header"><div class="${(0,o.classMap)({title:!0,center:this.hasHeader&&!this.hasFooter})}"><slot name="title"></slot></div><div class="left"><slot name="header-left"></slot></div>${!0===this.readonly||!0===this.hasFooter?"":t.html`<div class="right"><gv-button id="reset" outlined small @gv-button:click="${this._onReset}" icon="general:update" title="Reset"></gv-button><gv-button id="submit" small @gv-button:click="${this._onSubmit}" icon="code:check" .title="${this.submitLabel}"></gv-button></div>`}</div>`:""}<div class="content">${null!=this.schema?this._renderPart():t.html``}</div>${!0===this.hasFooter&&!0!==this.readonly?t.html`<div class="footer"><div class="left"></div><div class="right"><gv-button id="reset" outlined @gv-button:click="${this._onReset}" icon="general:update" title="Reset">Reset</gv-button><gv-button id="submit" @gv-button:click="${this._onSubmit}" icon="code:check" .title="${this.submitLabel}">${this.submitLabel}</gv-button></div></div>`:""}</div></form>`}static get styles(){return[n.empty,t.css`:host{box-sizing:border-box;margin:.2rem;--bgc:var(--gv-schema-form--bgc, #ffffff)}form{display:flex;flex-direction:column}form.scrollable{position:absolute;width:100%;top:0;bottom:0;left:0}.container{flex-grow:1;background-color:var(--bgc);display:flex;flex-direction:column;min-height:0}.content,.footer,.header{background-color:var(--bgc)}.content{flex-grow:1;display:flex;flex-direction:column;align-self:center;width:100%;min-height:0}.content>gv-schema-form-control{align-self:center;width:100%}form.scrollable .content{overflow:auto}form.scrollable .content>.group-title,form.scrollable .content>gv-schema-form-control{max-width:775px;width:95%}.footer,.header{display:flex;box-sizing:border-box;min-height:45px;--gv-icon--s:26px;--gv-icon--c:#bfbfbf;align-items:center;padding:0 .5rem;position:relative}.header{border-bottom:1px solid #d9d9d9}.footer{display:flex;justify-content:space-between;padding:1rem;border-top:1px solid #d9d9d9}form.scrollable .footer{justify-content:center}.footer .left,.footer .right{max-width:400px}.footer .left,.footer .right,.header .left,.header .right{display:flex;flex:1;z-index:10;align-items:center}.footer .right,.header .right{justify-content:flex-end}.header .title{color:#28444f;font-size:18px;display:flex;width:100%;align-items:center}.header .title.center{position:absolute;top:0;left:0;bottom:0;justify-content:center}.confirm-box{height:100%;padding:1rem;font-style:italic;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.confirm-box_actions{padding:1rem 0}.confirm .footer .left,.confirm .footer .right,.confirm .header .left,.confirm .header .right{display:none}.group-title{align-self:center;width:100%;color:var(--gv-theme-font-color-dark);font-size:21px;font-weight:600;padding-bottom:.3em;border-bottom:1px solid var(--gv-theme-font-color-dark);margin-top:24px;margin-bottom:16px}`]}}exports.GvSchemaForm=l,window.customElements.define("gv-schema-form",l);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvTabs=void 0;const t=require("lit");require("../molecules/gv-option");const e=require("../lib/events");class i extends t.LitElement{static get properties(){return{options:{type:Array},_options:{type:Array,attribute:!1},value:{type:String,reflect:!0},validator:{type:Function},disabled:{type:Boolean},small:{type:Boolean},truncate:{type:Boolean}}}static get styles(){return[t.css`:host{box-sizing:border-box}::slotted([slot=content]){opacity:0;box-sizing:border-box;transition:opacity 350ms ease-in-out;visibility:hidden;position:absolute;left:-9999px;top:-9999px}::slotted([slot=content].current){opacity:1;visibility:visible;position:relative;left:auto;top:auto}.header{display:flex;border-bottom:1px solid #d9d9d9;box-sizing:border-box}.title{flex:1;display:flex;align-items:center}.actions{display:flex;align-items:center}.tabs{flex:1;display:flex;justify-content:flex-end;--gv-option--bdrs:0}:host([small]) .tabs{flex-direction:column}:host([small]) gv-option{align-self:flex-end}gv-option{margin:var(--gv-tabs-options--m,0)}::slotted(gv-button){padding-bottom:2px}`]}_getContent(){return this.shadowRoot.querySelector('slot[name="content"]').assignedNodes()}firstUpdated(){null==this.value&&null!=this.options&&this.options.length>0&&(this.value=this.options[0].id)}set options(t){t&&Array.isArray(t)&&(this._options=t.map((t=>"string"==typeof t?{id:t,title:t}:"object"==typeof t&&null==t.title?{id:t.id,title:t.id}:t)))}get options(){return this._options}updated(){const t=this._getContent();if(t.forEach((t=>t.classList.remove("current"))),this.value){const t=this.querySelector(`#${this.value}`);t&&t.classList.add("current")}else t[0].classList.add("current")}_changeTab(t,i,s){t.classList.remove("current"),i.classList.add("current"),this.value=s,(0,e.dispatchCustomEvent)(this,"change",{value:s,from:t.id,to:i.id})}_onClick({detail:t}){if(!this.disabled){const e=this._getContent().find((t=>t.classList.contains("current"))),i=this.querySelector(`#${t.id}`);this.shadowRoot.querySelector("gv-option").value=e.id,this.validator?this.validator({from:e.id,to:i.id}).then((()=>{this._changeTab(e,i,t.id)})).catch((()=>{})):this._changeTab(e,i,t.id)}}get _contextualOptions(){return this.truncate?this.options.map((t=>{if(this.value!==t.id){const e=t.label||t.title;return{...t,label:e.substring(0,1)}}return t})):this.options}render(){return t.html`<div><div class="header"><div class="tabs"><slot name="title" class="title"></slot><gv-option small .options="${this._contextualOptions}" @gv-option:select="${this._onClick}" .value="${this.value}"></gv-option></div></div><slot name="content"></slot></div>`}}exports.GvTabs=i,window.customElements.define("gv-tabs",i);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvUserMenu=void 0;const e=require("lit");require("../molecules/gv-nav");const t=require("lit/directives/repeat"),s=require("lit/directives/class-map"),r=require("../lib/utils");class i extends e.LitElement{static get properties(){return{avatar:{type:String},routes:{type:Array},_routes:{type:Array,attribute:!1},_isClosed:{type:Boolean,attribute:!1},username:{type:String}}}static get styles(){return[e.css`:host{--bdc:var(--gv-user-menu--bdc, lightgrey);--c:var(--gv-user-menu--c, var(--gv-theme-font-color-dark, #262626));--bgc:var(--gv-user-menu--bgc, transparent);--list-bgc:var(--gv-user-menu-list--bgc, var(--gv-theme-neutral-color-lightest, #ffffff));--hover-bgc:var(--gv-user-menu-hover--bgc, var(--gv-theme-color-light, #86c3d0));--gv-link-active--c:var(--gv-user-menu-hover--c, var(--gv-theme-color-dark, #28444f));--gv-icon--c:var(--gv-user-menu-icon--c, var(--gv-theme-neutral-color-darkest, #000000));--gv-icon--s:var(--gv-user-menu-icon--s, 16px);--gv-link-a--ph:var(--gv-user-menu-link-a--ph, 0px);--gv-link--ta:var(--gv-user-menu-link--ta, right);user-select:none}.user-menu{list-style:none;margin:0;padding:0;display:inline-block;position:relative}.user-menu__title{background-color:var(--bgc);border-left:1px solid var(--bdc);color:var(--c);cursor:pointer;line-height:40px;padding:8px 24px;display:inline-flex;align-items:center;justify-content:space-between;min-width:175px;text-shadow:var(--gv-user-menu--tsh,none)}::slotted(*){height:40px;width:40px}.user-menu__title.no-user{padding:5px 24px}.user-menu__title gv-link{--gv-link-a--ph:0;--gv-link-a--pv:0}.user-menu__title span{flex:1;text-align:center;margin:0 .4rem}.user-menu__title>gv-icon{transition:all .3s ease 0s}.user-menu__list{position:absolute;background-color:var(--list-bgc);list-style:none;padding:0;transition:all .3s ease 0s;width:100%}.user-menu__list__item{border-left:1px solid var(--bdc);display:flex;align-items:center;transition:all .5s ease;padding:2px 30px}.user-menu__list__item:last-child{border-bottom:1px solid var(--bdc)}.user-menu__list__item:hover{background-color:var(--hover-bgc);border-left:1px dotted var(--bdc);font-weight:500}gv-link{margin:0;display:flex;width:100%}.separator{border-top:1px solid var(--bdc)}.active{background-color:var(--gv-theme-neutral-color-dark,#d9d9d9);font-weight:700}.user-menu__list{visibility:visible;opacity:1;transform:translateY(0);z-index:100;transition-delay:0s,0s,.2s}.user-menu__list__group{border-top:1px solid var(--bdc);background-color:var(--gv-theme-neutral-color-light,#efefef);padding-left:0}.user-menu__list__group__title{font-size:small;color:var(--gv-theme-color-darker,#383e3f);border-left:1px solid var(--bdc);padding-left:10px}.closed .user-menu__list{visibility:hidden;opacity:0;transform:translateY(-2em);z-index:-1}gv-icon{transform:rotate(0)}.closed gv-icon{transform:rotate(-180deg)}`]}constructor(){super(),this._isClosed=!0}_onClick(e){e.preventDefault(),this._isClosed=!this._isClosed}_onMouseLeave(){this._isClosed=!0}_onSelect(){this._isClosed=!0}_hasOneItem(){return null==this.username&&this._routes&&1===this._routes.length}set routes(e){e?Promise.resolve(e).then((e=>{e?Promise.all(e).then((e=>{(0,r.isSameRoutes)(this._routes,e)||(this._routes=e.filter((e=>null!=e)))})):this._routes=null})):this._routes=null}_renderFirstItem(){if(this._routes){if(this.username)return e.html`<li class="user-menu__title" @click="${this._onClick}"><div><slot></slot></div><span>${this.username}</span><gv-icon shape="design:triangle"></gv-icon></li>`;if(this._hasOneItem()){const t=this._routes[0];return e.html`<li class="user-menu__title no-user" @click="${this._onClick}"><gv-link .icon="${t.icon}" .path="${t.path}" .title="${t.title}" @click="${this._onSelect}"></gv-link></li>`}}return e.html``}render(){const r={closed:this._isClosed};return this._routes?e.html`<nav class="${(0,s.classMap)(r)}"><ul class="user-menu" @mouseleave="${this._onMouseLeave}">${this._renderFirstItem()}<li class="user-menu__content"><ul class="user-menu__list">${(0,t.repeat)(this._routes,(e=>e),((t,s)=>e.html`${this._hasOneItem()?e.html``:this._renderItem(t)}`))}</ul></li></ul></nav>`:e.html``}_renderItem(s){return s.routes?e.html`<ul class="user-menu__list__group"><span class="user-menu__list__group__title">${s.title}</span> ${(0,t.repeat)(s.routes,(e=>e),((t,s)=>e.html`${this._renderItem(t)}`))}</ul>`:e.html`<li class="user-menu__list__item ${s.separator?"separator":""} ${s.active?"active":""}" style="${s.style}"><gv-link .icon="${s.icon}" .path="${s.path}" .title="${s.title}" .target="${s.target}" @click="${this._onSelect}"></gv-link></li>`}}exports.GvUserMenu=i,window.customElements.define("gv-user-menu",i);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvVerticalMenu=void 0;const e=require("lit");require("../molecules/gv-nav"),require("../atoms/gv-image");const t=require("../lib/utils");class i extends e.LitElement{static get properties(){return{routes:{type:Array},_routes:{type:Array,attribute:!1},logo:{type:String}}}static get styles(){return[e.css`:host{--gv-link--c:var(--gv-menu--c, var(--gv-theme-font-color-light, #ffffff));--gv-link-active--c:var(--gv-menu--c, var(--gv-theme-font-color-light, #ffffff));--gv-link--bgc:var(--gv-menu-link--bgc, transparent);--gv-link-active--bgc:var(--gv-menu-link-active--bgc, transparent);--gv-link-active--bdw:var(--gv-menu-link-active--bdw, 0 0 0 4px);--gv-link-active--bdc:var(--gv-menu-link-active--bdc, var(--gv-theme-color-light, #86c3d0));--gv-link-active--bds:var(--gv-menu-link-active--bds, solid);--pr:var(--gv-theme-layout--pr, 4rem);--pl:var(--gv-theme-layout--pl, 4rem);box-sizing:border-box;display:block;font-size:var(--gv-theme-font-size-s,16px);width:var(--gv-theme-layout-menu-w,200px)}.menu-container{display:flex;flex-direction:column;justify-content:space-between;background-color:var(--gv-menu--bgc,var(--gv-theme-color-dark,#28444f));color:var(--gv-menu--c,var(--gv-theme-font-color-light,#fff))}gv-image{height:200px;width:200px}gv-nav{transition:width 250ms ease-in-out;display:flex;flex-direction:column;justify-content:space-between;line-height:20px;vertical-align:middle;width:100%;font-size:16px}`]}constructor(){super(),this._routes=[]}set routes(e){e?Promise.resolve(e).then((e=>{e?Promise.all(e).then((e=>{(0,t.isSameRoutes)(this._routes,e)||(this._routes=e.filter((e=>null!=e)))})):this._routes=null})):this._routes=null}render(){return e.html`<div class="menu-container">${this.logo?e.html`<gv-image .src="${this.logo}"></gv-image>`:""}<div class="nav-container"><gv-nav .routes="${this._routes}" vertical></gv-nav></div></div>`}}exports.GvVerticalMenu=i,window.customElements.define("gv-vertical-menu",i);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.PolicyDraggable=exports.GvFlowStep=void 0;const t=require("lit"),e=require("../mixins/with-resize-observer"),o=require("lit/directives/class-map"),i=require("../lib/events");require("../atoms/gv-image"),require("../molecules/gv-dropdown-menu"),require("../atoms/gv-switch");class n extends((0,e.withResizeObserver)(t.LitElement)){static get properties(){return{id:{type:String,reflect:!0},group:{type:String,reflect:!0},parent:{type:String,reflect:!0},step:{type:Object},policy:{type:Object},editing:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0},hover:{type:Boolean,reflect:!0},title:{type:String,reflect:!0},empty:{type:Boolean,reflect:!0},confirm:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},_small:{type:Boolean,attribute:!1},_confirmDelete:{type:Boolean,reflect:!0},_confirmDuplicate:{type:Boolean,reflect:!0}}}constructor(){super(),this.empty=!0,this.breakpoints={width:[100,200]}}onResize({width:t}){this._small=t<=200}_onDuplicate(){this._confirmDuplicate=!0}_onConfirmDuplicate(){this._confirmDuplicate=!1,(0,i.dispatchCustomEvent)(this,"duplicate",{step:this.step,policy:this.policy,target:this})}_onCancelDuplicate(){this._confirmDuplicate=!1}_onClick(t){t.target.classList.contains("action")||this.editing||(t.preventDefault(),this._edit())}_edit(){this.policy&&!this.disabled&&(0,i.dispatchCustomEvent)(this,"edit",{step:this.step,policy:this.policy,group:this.group})}_onMouseEnter(){if(!this.disabled&&(this.hover=!0,!this.readonly)){this.shadowRoot.querySelector("gv-dropdown-menu").setAttribute("open",!0)}}_onMouseLeave(){if(!this.disabled&&(this.hover=!1,!this.readonly)){this.shadowRoot.querySelector("gv-dropdown-menu").removeAttribute("open")}}_onDelete(){this._confirmDelete=!0}_onConfirmDelete(){this._confirmDelete=!1,(0,i.dispatchCustomEvent)(this,"delete",{step:this.step})}_onCancelDelete(){this._confirmDelete=!1}updated(t){if(t.has("dragging")&&!0===this.dragging){this.shadowRoot.querySelector("gv-dropdown-menu").removeAttribute("open")}t.has("step")&&null!=this.step&&(this.empty=!1)}_onCancel(){this.remove()}_onCopy(){(0,i.dispatchCustomEvent)(this,"copy")}_onMove(){(0,i.dispatchCustomEvent)(this,"move")}_onChangeState({detail:t}){(0,i.dispatchCustomEvent)(this,"change-state",{step:this.step,enabled:t})}_renderDropdownMenu(){if(this.disabled||this.readonly)return t.html``;const e=!1!==this.step.enabled;return t.html`<gv-dropdown-menu right><gv-switch slot="action" class="action" small label="${e?"Enabled":"Disabled"}" title="${e?"Disable policy ?":"Enable policy ?"}" @gv-switch:input="${this._onChangeState}" .value="${e}"></gv-switch><gv-button slot="action" class="action" link small icon="general:duplicate" @gv-button:click="${this._onDuplicate}">Duplicate</gv-button><gv-button slot="action" class="action" link small icon="home:trash" @gv-button:click="${this._onDelete}">Delete</gv-button></gv-dropdown-menu>`}resetConfirm(){this.confirm=!1,this._confirmDelete=!1,this._confirmDuplicate=!1}render(){if(this.confirm)return t.html`<div class="drop-area drop-area-confirm"><gv-button small @gv-button:click="${this._onCopy}">Copy</gv-button><gv-button small @gv-button:click="${this._onMove}">Move</gv-button><gv-button link small @gv-button:click="${this._onCancel}">Cancel</gv-button></div>`;if(this._confirmDelete)return t.html`<div class="drop-area drop-area-confirm"><gv-button small danger @gv-button:click="${this._onConfirmDelete}">Delete</gv-button><gv-button link small @gv-button:click="${this._onCancelDelete}">Cancel</gv-button></div>`;if(this._confirmDuplicate)return t.html`<div class="drop-area drop-area-confirm"><gv-button small @gv-button:click="${this._onConfirmDuplicate}">Duplicate</gv-button><gv-button link small @gv-button:click="${this._onCancelDuplicate}">Cancel</gv-button></div>`;if(this.empty)return t.html`<div class="drop-area"></div>`;{const e=this.step?this.step.name:"",i=this.step&&this.step.description?this.step.description:"",n=this.step&&!!this.step.condition,s=this.step?this.policy&&this.policy.icon:null,r=this.step&&!1!==this.step.enabled,a=null==this.policy;this.title=a?"Warning: policy not found in plugins folder":i;const l={"drop-area":!0,"is-assigned":""!==e,"has-icon":null!=s,disabled:!r,"not-found":a};return t.html`<div class="${(0,o.classMap)(l)}" @click="${this._onClick}" @mouseenter="${this._onMouseEnter}" @mouseleave="${this._onMouseLeave}">${this._renderDropdownMenu()}<div class="content"><div class="content-icon">${n?t.html`<gv-icon class="content-icon-conditional" shape="design:conditional"></gv-icon>`:t.html``} ${s?t.html`<gv-image src="${s}"></gv-image>`:t.html``}</div>${null==s&&a?t.html`<gv-icon class="not-found__icon" shape="finance:folder-error"></gv-icon>`:""}<div><div class="name">${e}</div><div class="description">${i}</div></div></div></div>`}}static get styles(){return[t.css`:host{box-sizing:border-box;margin:.2rem;display:block}:host(:active){outline:0}:host([dragging]){opacity:.5}gv-dropdown-menu{position:absolute;right:0;display:flex;flex-wrap:wrap;justify-content:right;top:-1px;bottom:-1px;z-index:10;--gv-dropdown-menu--bdw:0 0 0 1px;--gv-dropdown-menu--p:0.1rem 0.3rem;--gv-dropdown-menu--gg:0}gv-switch{margin:.2rem 0}:host([hover]) .drop-area{transform:translateY(-4px);box-shadow:0 0 0 1px #5a7684,0 1px 3px #5a7684;border-color:transparent}:host([dragging]) .drop-area{transform:translateY(-4px)}:host([editing]) .drop-area{border-color:#5a7684;transform:translateY(-4px);box-shadow:0 0 0 1px #5a7684,0 1px 3px #5a7684;transition:all .2s}:host([w-lt-200]) gv-image{position:absolute;opacity:.1;width:100%}:host([w-lt-200]) .drop-area:hover gv-image{opacity:1}:host([w-lt-200]) .content-icon{position:absolute;width:100%;height:100%}:host([w-lt-100]) .description{display:none}:host([empty]) .drop-area{position:relative;background-color:transparent;border:2px dashed #bfbfbf;font-size:14px}.description{line-height:14px;font-size:12px;max-height:42px;overflow:hidden}.drop-area{position:relative;border:2px dashed #bfbfbf;border-radius:4px;height:80px;min-width:80px;margin:4px;padding:4px;word-break:break-word;display:flex;align-items:center;text-align:center;justify-content:center;flex-direction:column;--gv-button--fz:11px;flex:1;transition:color 150ms ease-in-out,transform .3s ease-in-out,box-shadow .3s ease-in-out,border .3s ease-in-out;background-color:#fff}.drop-area.disabled{text-decoration:line-through;font-style:italic}.drop-area.not-found{border-color:var(--gv-theme-color-warning-light,#ffb74d)}.drop-area.has-icon{padding-left:0;text-align:left}.drop-area.has-icon .content{justify-content:left}.drop-area.is-assigned{border-style:solid}:host([hover]) .drop-area.is-assigned:not(.not-found){cursor:grab}:host([hover]) .drop-area.is-assigned:not(.not-found):active{cursor:grabbing}:host([readonly]) .drop-area.is-assigned:not(.not-found),:host([readonly]) .drop-area.is-assigned:not(.not-found):active{cursor:pointer}.content{display:flex;align-items:center;justify-content:center;text-align:center;width:100%}.content>div,.content>mark{width:100%}.content-icon{flex:0 1 0%;display:flex;margin:.2rem}.content-icon-conditional{position:absolute;z-index:10;margin:.2rem}gv-image{height:80px;width:80px}.not-found__icon{--gv-icon--c:var(--gv-theme-color-warning-light, #ffb74d);height:60px;width:60px;margin:.2rem;justify-content:center;align-items:center}.drop-area-confirm{flex-direction:row;align-items:center;justify-content:center;background-color:#fff}`]}}exports.GvFlowStep=n;class s{static parse(t){const e=JSON.parse(t);return new s(e.policy,e.sourcePosition,e.sourceFlowKey,e.sourceFlowId,e.flowStep)}constructor(t,e,o,i,n){this.policy=t,this.sourcePosition=e,this.sourceFlowKey=o,this.sourceFlowId=i,this.flowStep=n}toString(){return JSON.stringify(this)}}exports.PolicyDraggable=s,window.customElements.define("gv-flow-step",n);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvFlow=void 0;const t=require("lit"),e=require("lit/directives/class-map"),i=require("../lib/events");require("../atoms/gv-image");const o=require("../lib/utils"),r=require("./gv-flow-step"),s=require("../lib/studio");class l extends t.LitElement{static get properties(){return{flow:{type:Object},plan:{type:Object},policies:{type:Object},selectedStepId:{type:String},dragPolicy:{type:Object},dropPolicy:{type:Object},disabled:{type:Boolean,reflect:!0},hasPolicyFilter:{type:Boolean,attribute:"has-policy-filter"},flowsTitle:{type:String,attribute:"flows-title"},readonly:{type:Boolean,reflect:!0}}}constructor(){super(),this.flowsTitle="Flows",this.addEventListener("mouseleave",this._onMouseLeave)}_onMouseLeave(){this.dragPolicy=null,this.dropPolicy=null}getCandidate(){return this.shadowRoot.querySelector("gv-flow-step[empty]")}getFlowSteps(){return Array.from(this.shadowRoot.querySelectorAll("gv-flow-step"))}getOrCreateCandidate(){let t=this.getCandidate();return t||(t=document.createElement("gv-flow-step"),t.setAttribute("empty",!0)),t}removeCandidate(){const t=this.getCandidate();t&&t.remove()}_canDropPolicy(t,e){if(this.disabled||this.readonly)return!1;if(null!=e){if("pre"===t)return!0!==this.hasPolicyFilter||!0===e.onRequest;if("post"===t)return!0!==this.hasPolicyFilter||!0===e.onResponse;throw new Error(`The flowkey [${t}] parameter must be "pre" or "post"`)}return!1}_onDragOver(t,e){if(!this.disabled&&!this.readonly&&e.dataTransfer.items.length>0&&(e.preventDefault(),e.stopPropagation(),null==this.dropPolicy?this.dropPolicy=this.dragPolicy:this.dragPolicy=this.dropPolicy,null!=this.dropPolicy&&this._canDropPolicy(t,this.dropPolicy.policy)&&!e.target.classList.contains("candidate")&&!e.target.hasAttribute("dragging")))if("gv-flow-step"===e.target.tagName.toLowerCase()){const{x:i,width:o}=e.target.getBoundingClientRect();!("post"===t?e.clientX-i<=o/2:e.clientX-i>=o/2)||e.target.nextElementSibling&&e.target.nextElementSibling.hasAttribute("dragging")?e.target.previousElementSibling&&e.target.previousElementSibling.hasAttribute("dragging")||e.target.insertAdjacentElement("beforebegin",this.getOrCreateCandidate()):e.target.insertAdjacentElement("afterend",this.getOrCreateCandidate())}else if(e.target.classList&&e.target.classList.contains("drop-area-grid")){0===e.target.querySelectorAll("gv-flow-step").length&&e.target.prepend(this.getOrCreateCandidate())}else this.removeCandidate()}_onDragEnd(){this.disabled||this.readonly||(this._draggablePolicyImage&&(this._draggablePolicyImage.remove(),this._draggablePolicyImage=null),this.dragPolicy=null,this.dropPolicy=null)}_onDragStart(t,e,s,l){if(!this.disabled&&!this.readonly){const a=this.findPolicy(e.policy);if(null!=a){const d=document.createEvent("Events");if(d.initEvent("click",!0,!1),window.dispatchEvent(d),l.target.setAttribute("dragging",!0),this.shadowRoot.querySelector(".drop-area-grid").classList.add("dragging"),this.dropPolicy=new r.PolicyDraggable(a,s,t,this.flow._id,e),l.dataTransfer.setData("text/plain",this.dropPolicy.toString()),a){const t=100;this._draggablePolicyImage=(0,o.appendDraggableImage)(a.icon,t),l.dataTransfer.setDragImage(this._draggablePolicyImage,t/2,t/2)}(0,i.dispatchCustomEvent)(this,"drag-start",this.dropPolicy)}}}async performUpdate(){this.getFlowSteps().forEach((t=>{t.requestUpdate()})),super.performUpdate()}get draggingArea(){return this.shadowRoot.querySelector("gv-flow-step[dragging]")}_onDrop(t,e){this.shadowRoot.querySelectorAll("gv-flow-step").forEach((t=>t.resetConfirm())),e.preventDefault(),e.stopPropagation();const o=e.target.closest(".drop-area-grid"),r=this.getCandidate(),s=this.draggingArea;if(r){let e=0;[...o.querySelectorAll("gv-flow-step")].some((t=>(t.hasAttribute("empty")||e++,t.hasAttribute("empty"))));const{policy:l,sourceFlowKey:a,sourceFlowId:d,sourcePosition:n,flowStep:p}=this.dropPolicy,g=()=>{s&&s.removeAttribute("dragging"),r.remove(),(0,i.dispatchCustomEvent)(this,"drop",{flowId:this.flow._id,flowKey:t,position:e,flowStep:p,policy:l,sourcePosition:n,sourceFlowKey:a,sourceFlowId:d}),this.dragPolicy=null,this.dropPolicy=null};null!=d&&this.flow._id!==d?(r.setAttribute("confirm",!0),r.addEventListener("gv-flow-step:copy",(()=>{r.remove(),this.dragPolicy=null,this.dropPolicy=null,(0,i.dispatchCustomEvent)(this,"drop",{flowId:this.flow._id,flowKey:t,position:e,policy:l,flowStep:p,cancelEdit:!0})})),r.addEventListener("gv-flow-step:move",(()=>{r.remove(),g()}))):g()}else s&&(s.removeAttribute("dragging"),this.dragPolicy=null,this.dropPolicy=null)}getFlowStep(t,e){return this.flow[t][e]}_onEditStep({detail:{step:t,policy:e,group:o}}){(0,i.dispatchCustomEvent)(this,"edit",{flow:this.flow,step:t,policy:e,group:o})}_onDuplicateStep(t,e){const r=this.getFlowStep(t,e),s=e+1,l=this.findPolicy(r.policy),a={...r,_id:(0,o.uuid)()};(0,i.dispatchCustomEvent)(this,"drop",{flowId:this.flow._id,flowKey:t,position:s,flowStep:a,policy:l})}_isEditable(t){return this.selectedStepId&&this.selectedStepId===t._id}_onDeleteStep(t,e,o){(0,i.dispatchCustomEvent)(this,"delete",{flowKey:t,position:e,flowId:this.flow._id,target:o.target})}_onChangeStepState(t,e,{detail:o}){(0,i.dispatchCustomEvent)(this,"change-state",{flowKey:t,position:e,flowId:this.flow._id,...o})}_renderDropStep(e,i,o){return i?t.html`<gv-flow-step .step="${i}" .policy="${this.findPolicy(i.policy)}" .id="${i._id}" .group="${e}" .parent="${this.flow._id}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" .draggable="${!this.disabled&&!this.readonly}" ?editing="${this._isEditable(i)}" @dragstart="${this._onDragStart.bind(this,e,i,o)}" @dragend="${this._onDragEnd}" @gv-flow-step:edit="${this._onEditStep}" @gv-flow-step:change-state="${this._onChangeStepState.bind(this,e,o)}" @gv-flow-step:delete="${this._onDeleteStep.bind(this,e,o)}" @gv-flow-step:duplicate="${this._onDuplicateStep.bind(this,e,o)}"></gv-flow-step>`:t.html``}async getUpdateComplete(){await super.getUpdateComplete(),await Promise.all(this.getFlowSteps().map((t=>t.updateComplete)))}updated(t){t.has("data")&&this.onDragEnd(),(t.has("dropPolicy")||t.has("dragPolicy"))&&null==this.dropPolicy&&null==this.dragPolicy&&this.removeCandidate()}onDragEnd(){setTimeout((()=>{this.shadowRoot.querySelector(".drop-area-grid").classList.remove("dragging"),this.removeCandidate();const t=this.draggingArea;t&&t.removeAttribute("dragging")}),0)}_getLabel(e){return this.flow.type?t.html`<div class="drop-box-type">${e}</div><div>${"ROOT"===this.flow.type.toUpperCase()?"flow":this.flow.type}</div>`:"pre"===e?"request":"post"===e?"response":""}get collectionName(){return null!=this.plan?this.plan.name:this.flowsTitle}render(){const i=this.dragPolicy&&(!0!==this.hasPolicyFilter||this.dragPolicy.policy.onRequest),o=this.dragPolicy&&(!0!==this.hasPolicyFilter||this.dragPolicy.policy.onResponse),r=this.dragPolicy&&!0===this.hasPolicyFilter&&!this.dragPolicy.policy.onRequest,l=this.dragPolicy&&!0===this.hasPolicyFilter&&!this.dragPolicy.policy.onResponse,a=null==this.flow.type||this.flow.type&&"root"!==this.flow.type.toLowerCase();return t.html`<div class="box"><div class="container"><div class="header"><div class="title">${(0,s.getFlowName)(this.flow,this.collectionName)}</div></div><div class="content"><div class="flow"><div class="${(0,e.classMap)({pre:!0,targeted:i,forbidden:r})}"><div class="arrow arrow-right"></div><div class="drop-box" @drop="${this._onDrop.bind(this,"pre")}" @dragend="${this.onDragEnd}" @dragover="${this._onDragOver.bind(this,"pre")}"><div class="drop-box-title">${i?"drop here":this._getLabel("pre")}</div><div class="drop-area-grid">${this.flow.pre.map(((t,e)=>this._renderDropStep("pre",t,e)))}</div></div></div>${a?t.html`<div class="${(0,e.classMap)({post:!0,targeted:o,forbidden:l})}"><div class="arrow arrow-left"></div><div class="drop-box" @drop="${this._onDrop.bind(this,"post")}" @dragend="${this.onDragEnd}" @dragover="${this._onDragOver.bind(this,"post")}"><div class="drop-area-grid drop-area-grid-reverse">${this.flow.post.map(((t,e)=>this._renderDropStep("post",t,e)))}</div><div class="drop-box-title">${o?"drop here":this._getLabel("post")}</div></div></div>`:""}</div></div></div></div>`}findPolicy(t){return this.policies.find((e=>e.id===t))}static get styles(){return[s.methods,t.css`:host{box-sizing:border-box;position:relative;display:block;height:100%}.flow{padding-left:20px;display:flex;height:100%;flex-direction:column}.drop-area-grid{flex:1;border:1px dashed transparent;transition:all 350ms ease-in-out;position:relative;display:flex;flex-wrap:wrap;max-width:calc(100% - 40px);align-items:center;min-height:150px;box-sizing:border-box;padding:0 30px}.targeted .drop-area-grid{border:1px dashed #d9d9d9}.forbidden .drop-area-grid{background-color:#efefef;opacity:.2}gv-flow-step{flex:1}.message{text-transform:uppercase;color:#d9d9d9;opacity:0;transition:opacity 350ms ease-in-out;font-size:18px;text-align:center;align-self:center}.message{width:100%}.targeted .message{opacity:1}.targeted .drop-area-empty{opacity:0;transition:all 350ms ease-in-out}.post,.pre{position:relative;flex:1;display:flex}.arrow{background-color:#d9d9d9;width:calc(100% - 50px * 2 - 1px);text-align:center;position:absolute;margin:0 30px;color:#262626;top:calc(50% - 20px);height:40px}.arrow-right::after{width:0;height:0;border-top:40px solid transparent;border-bottom:40px solid transparent;border-left:40px solid #d9d9d9;content:' ';position:absolute;right:-20px;top:-20px}.drop-box-type{position:relative;writing-mode:horizontal-tb;margin-bottom:10px}.drop-box-title{position:relative;writing-mode:vertical-lr;text-orientation:upright;text-transform:uppercase;color:#bfbfbf;font-size:13px;font-weight:500;text-align:center;max-height:145px;line-height:13px;display:flex;align-items:center;min-width:30px}.pre .drop-box-title{position:absolute;left:-30px}.arrow-left::after{width:0;height:0;border-top:40px solid transparent;border-bottom:40px solid transparent;border-right:40px solid #d9d9d9;content:' ';position:absolute;left:-20px;top:-20px}.drop-box{display:flex;border:1px solid transparent;margin:0 30px;align-items:center;position:relative;width:100%}.drop-area-grid-reverse{flex-direction:row-reverse}.header{border-bottom:1px solid #d9d9d9;display:flex;min-height:45px;margin-bottom:.5rem}.header .title{color:#28444f;font-size:18px;display:flex;align-items:center;margin:0 .5rem;width:100%}.header .title .flow-path{flex:1}.box{position:absolute;display:flex;flex-direction:column;width:100%;top:0;bottom:0;left:0}.container{flex-grow:1;display:flex;flex-direction:column;min-height:0;height:100%}.content{background:#fff;flex-grow:1;overflow:auto;min-height:0;padding:.5rem}`]}}exports.GvFlow=l,window.customElements.define("gv-flow",l);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvPolicyStudioMenu=void 0;const e=require("lit"),t=require("../styles/link"),i=require("../lib/events"),o=require("lit/directives/class-map");require("../atoms/gv-image"),require("../atoms/gv-state"),require("../molecules/gv-popover"),require("./gv-flow-step");const l=require("../lib/studio"),s=require("lit/directives/repeat"),n=require("../lib/utils");class a extends e.LitElement{static get properties(){return{policies:{type:Array},flows:{type:Object},plans:{type:Object},selectedIds:{type:Array},sortable:{type:Boolean},disabled:{type:Boolean,reflect:!0},query:{type:String},flowsTitle:{type:String,attribute:"flows-title"},hasPolicyFilter:{type:Boolean,attribute:"has-policy-filter"},canAdd:{type:Boolean,attribute:"can-add"},readonly:{type:Boolean},readonlyPlans:{type:Boolean}}}constructor(){super(),this.selectedIds=[],this.flowsTitle="Flows"}static get styles(){return[t.link,l.methods,e.css`:host{box-sizing:border-box;min-width:250px;display:flex;flex-direction:column}:host([disabled]){opacity:.5}:host([disabled]) *{cursor:not-allowed}.box{flex:1;overflow:auto}.type{background-color:#f5f5f5;text-transform:capitalize;text-decoration:none;padding:.2rem;color:#262626;border-width:1px 0 1px 0;border-style:solid;border-color:#bfbfbf;font-size:15px;display:flex;align-items:center;box-sizing:border-box;height:42px}.type .type-name{flex:1}.entry .entry-name,.type .type-name{display:flex;align-items:center;white-space:nowrap;overflow:hidden;min-width:150px;height:100%}.expandable{background:#fff;overflow:hidden;transition:height,opacity,width,padding,color .25s ease-in-out;line-height:0;color:transparent;box-sizing:border-box;font-size:14px;--gv-icon--s:0;visibility:hidden}.expandable.open{line-height:1.5;padding-top:.5rem;padding-bottom:.5rem;color:#262626;overflow:auto;visibility:visible}.entry{display:flex;align-items:center;user-select:none;position:relative}.entry.disabled{text-decoration:line-through;font-style:italic}.entry gv-image{height:0;width:0;transition:height 75ms ease-in-out;visibility:hidden}.entry gv-tag{display:none}.expandable-icon{margin-right:2px;--gv-icon--s:22px;--gv-icon--c:#5a7684;--gv-icon-opacity--c:#5a7684}.policy-icon{--gv-icon--s:40px;margin-right:2px;--gv-icon--c:#5a7684;--gv-icon-opacity--c:#5a7684}.expandable.open .entry gv-tag{display:block}.expandable.open .entry gv-image{height:40px;width:40px;margin-right:5px;visibility:visible}.expandable.open .entry:focus-within{--gv-icon--c:#28444f;color:#28444f}.expandable.open .entry:focus-within .actions{visibility:visible;opacity:1;height:25px}.flow-path{max-width:200px}.entry .actions{background-color:#fff;transition:all 250ms ease-in-out;align-items:center;display:flex;position:absolute;right:0;padding:.1rem}gv-button{--gv-icon--c:#28444f}.entry .actions>*{margin:1px;opacity:0;visibility:hidden;display:none}.entry:focus-within .actions>*{opacity:1;visibility:visible;display:block}.flow-path{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.expandable.open .entry{border:1px dotted transparent;padding:.2rem;line-height:25px;min-height:32px}.expandable.open .entry{--gv-icon--s:16px}.expandable.open .entry.selected,.expandable.open .entry.selected .actions{background-color:#f5f5f5}.expandable.open .entry.selected{border-top:1px dotted #bfbfbf;border-bottom:1px dotted #bfbfbf;border-right:1px dotted #bfbfbf}.dragging{cursor:grabbing;opacity:1;background-color:#f5f5f5;box-shadow:0 0 5px rgba(0,0,0,.1);transform:none}.flow{margin-left:.2rem}.flow.sortable{margin:0}.policy.draggable gv-icon,.policy.draggable gv-image,.sortable,.sortable gv-icon{cursor:grab}.policy.draggable:active,.sortable gv-icon:active,.sortable:active{cursor:grabbing}.policy-name{flex:1;display:flex;align-items:center}.policy .draggable-icon{opacity:0;visibility:hidden;transition:all 350ms ease-in-out}.policy:hover .draggable-icon{opacity:1;visibility:visible}gv-state,gv-tag{--gv-tag--p:1px 3px;--gv-state--p:4px 6px;--gv-state--fz:10px;--gv-state--c:#28444f;--gv-state--bgc:#ffffff;margin:0 1px}.error-icon{--gv-icon--c:var(--gv-theme-color-warning, #ff9800)}`]}_onExpand(e,t){this.disabled||(t.preventDefault(),t.stopPropagation(),this.shadowRoot.querySelector(e).classList.toggle("open"))}_onDragStartPolicy(e,t){t.dataTransfer.setData("text/plain",JSON.stringify({policy:e}));this._draggablePolicyImage=(0,n.appendDraggableImage)(e.icon,100),t.dataTransfer.setDragImage(this._draggablePolicyImage,50,50),(0,i.dispatchCustomEvent)(this,"dragstart-policy",{dataTransfer:t.dataTransfer})}_onDragEndPolicy(){this._draggablePolicyImage&&(this._draggablePolicyImage.remove(),this._draggablePolicyImage=null),(0,i.dispatchCustomEvent)(this,"dragend-policy")}_onClickFlow(e,t){this.disabled||(t.shiftKey?this._compareFlow(e):this._selectFlow(e))}_selectFlow(e){this.selectedIds=[e._id],(0,i.dispatchCustomEvent)(this,"select-flows",{flows:this.selectedIds})}_compareFlow(e){this.selectedIds.length>0?(this.selectedIds=[...new Set([this.selectedIds[0],e._id])],(0,i.dispatchCustomEvent)(this,"select-flows",{flows:this.selectedIds})):this._selectFlow(e)}_onMouseEnterPolicy(e){(0,i.dispatchCustomEvent)(this,"target-policy",{policy:e})}_onMouseLeavePolicy(){(0,i.dispatchCustomEvent)(this,"target-policy",null)}_onMouseEnterFlow(e){null==this._draggingFlow&&e.target.focus()}_onMouseLeaveFlow(e){null==this._draggingFlow&&e.target.blur()}_filter(e){return!this.query||e.name.toLowerCase().includes(this.query.toLowerCase())}hasCompare(){return this.selectedIds.length>1}_onChangeFlowState(e,{detail:t}){(0,i.dispatchCustomEvent)(this,"change-flow-state",{content:e,enabled:t})}_onDuplicateFlow(e){(0,i.dispatchCustomEvent)(this,"duplicate-flow",{content:e})}_onDeleteFlow(e){(0,i.dispatchCustomEvent)(this,"delete-flow",{content:e})}_renderFlowActions(t,i){if(this.disabled)return e.html``;const o=!1!==t.enabled,l=o?"Disable flow ?":"Enable flow ?";return e.html`<div class="actions">${this.hasCompare()||this.selectedIds.includes(t._id)?"":e.html`<gv-button tabindex="0" link small icon="navigation:route" @gv-button:click="${this._compareFlow.bind(this,t)}" title="Compare"></gv-button>`} ${this.canAdd&&!0!==i?e.html`<gv-button tabindex="0" link small icon="general:duplicate" @gv-button:click="${this._onDuplicateFlow.bind(this,t)}" title="Duplicate"></gv-button><gv-button tabindex="0" link small icon="home:trash" @gv-button:click="${this._onDeleteFlow.bind(this,t)}" title="Delete"></gv-button>`:""} ${!0!==i?e.html`<gv-switch tabindex="0" small title="${l}" .value="${o}" @gv-switch:input="${this._onChangeFlowState.bind(this,t)}"></gv-switch>`:""}</div>`}_onDragStartFlow(e,t,i){const o=i.target.classList;o&&o.contains("flow")&&(o.remove("hover"),o.add("dragging"),this._draggingFlow={target:i.target,flow:e,index:t})}_onDragEnterFlow(e){e.target.classList&&e.target.classList.contains("flow")&&this._draggingFlow.target.parentElement===e.target.parentElement&&(e.target.previousSibling!==this._draggingFlow.target?e.target.parentElement.insertBefore(this._draggingFlow.target,e.target):e.target.nextSibling?e.target.parentElement.insertBefore(this._draggingFlow.target,e.target.nextSibling):e.target.parentElement.appendChild(this._draggingFlow.target),this._draggingFlow.target.classList.remove("dragging"))}_findFlowCollection(e){const t=this.plans.find((t=>null!=t.flows.find((t=>t._id===e))));return{plan:t,flows:null!=t?t.flows:this.flows}}_onDragEndFlow(){this._draggingFlow.target.classList.remove("dragging");const e=[...this._draggingFlow.target.parentElement.querySelectorAll('.flow[draggable="true"]')].indexOf(this._draggingFlow.target);if(e!==this._draggingFlow.index){const{plan:t,flows:o}=this._findFlowCollection(this._draggingFlow.flow._id),l=o.splice(this._draggingFlow.index,1)[0];o.splice(e,0,l);const s=Math.min(this._draggingFlow.index,e),n=Math.max(this._draggingFlow.index,e);o.forEach(((e,t)=>{t>=s&&t<=n&&(e._dirty=!0)})),(0,i.dispatchCustomEvent)(this,"reorder-flows",{plan:t}),setTimeout((()=>{this._draggingFlow=null}),0),this._draggingFlow.target.focus()}}_onDragOverFlow(e){e.preventDefault()}_onKeyDownFlow(e,t){t.target.classList.contains("flow")&&32===t.keyCode&&(t.preventDefault(),this._selectFlow(e))}_onClickPolicy(e){this.disabled||(this.selectedIds=[e.id],(0,i.dispatchCustomEvent)(this,"fetch-documentation",{policy:e}))}_isSelected(e){return null!=this.selectedIds&&this.selectedIds.includes(e)}_renderFlows(t,i,a,r,d){const c=a&&this.readonlyPlans;return e.html`<div class="${(0,o.classMap)({content:!0,expandable:!0,open:d})}" id="${r}">${(0,s.repeat)(t,(()=>(0,n.uuid)()),((t,i)=>e.html`<div draggable="${this.sortable&&!this.disabled&&!c}" tabindex="0" @dragstart="${this._onDragStartFlow.bind(this,t,i)}" @dragenter="${this._onDragEnterFlow}" @dragend="${this._onDragEndFlow}" @dragover="${this._onDragOverFlow}" @keydown="${this._onKeyDownFlow.bind(this,i)}" @mouseenter="${this._onMouseEnterFlow}" @mouseleave="${this._onMouseLeaveFlow}" class="${(0,o.classMap)({entry:!0,flow:!0,sortable:this.sortable&&!this.disabled&&!c,selected:this.selectedIds.includes(t._id),child:a,disabled:!1===t.enabled})}"><div title="${t.name} | Compare with current selection (Shift + click)" @click="${this._onClickFlow.bind(this,t)}" class="entry-name link">${(0,l.getFlowName)(t,null,!0,this.sortable&&!c,!0)}</div>${this._renderFlowActions(t,this.readonly||c)}</div>`))}</div>`}_isDraggable(e){return!this.disabled&&(!0!==this.hasPolicyFilter||!0===e.onRequest||!0===e.onResponse)}_renderPolicies(t,i,l,s,n){return e.html`<div id="${s}" class="${(0,o.classMap)({content:!0,expandable:!0,open:!0,child:l})}">${t.map((t=>{const i=this._isDraggable(t);return e.html`<div class="${(0,o.classMap)({entry:!0,link:!0,policy:!0,selected:this._isSelected(t.id),draggable:i})}" draggable="${i}" @mouseenter="${this._onMouseEnterPolicy.bind(this,t)}" @mouseleave="${this._onMouseLeavePolicy.bind(this,t)}" @dragstart="${this._onDragStartPolicy.bind(this,t)}" @dragend="${this._onDragEndPolicy}" @click="${this._onClickPolicy.bind(this,t)}" title="Show documentation of ${t.name}">${null==t.icon&&null!=n?e.html`<gv-icon class="policy-icon" shape="${this._getGroupShape(n)}"></gv-icon>`:e.html`<gv-image src="${t.icon}"></gv-image>`}<div class="policy-name">${t.name}</div>${i?e.html`<gv-icon class="draggable-icon" shape="design:arrows"></gv-icon>`:e.html``}</div>`}))}</div>`}_getGroupShape(e){return"security"===e?"general:shield-protected":"transformation"===e?"tools:roller":"performance"===e?"general:thunder-move":"communication:shield-thunder"}_renderPart(t,i,o,l=[],s,n,a=null,r=!0,d=!1,c){let g;const h=l.filter((e=>this._filter(e)));if(s&&l.length>0||!s){if(a&&!d){const i=[...new Set(h.map((e=>e[a])))];return e.html`${i.map(((i,l)=>{let d=h.filter((e=>e[a]===i));const c=i?i.replace(/\s+/g,"-").toLowerCase():`group-${l}`,g=`#${c}`;let p=e.html`<gv-state>${d.length}</gv-state>`;return n&&(p=e.html`<gv-button small outlined icon="code:plus" title="Add new flow" @click="${n.bind(this,l,c)}"></gv-button>`),"flows"===t&&(d=d[0].flows),e.html`<div class="type" @click="${this._onExpand.bind(this,g)}"><gv-icon class="expandable-icon" shape="${this._getGroupShape(i)}"></gv-icon><div class="link type-name">${i||"No category"}</div>${p}</div>${this._renderPart(t,i,o,d,s,n,a,r,!0,c)}`}))}`}if(null==c&&(c=t.replace(/\s+/g,"-").toLowerCase()),g="flows"===t?this._renderFlows(h,t,d,c,r):this._renderPolicies(h,t,d,c,i),d)return e.html`${g}`;{const t=`#${c}`;let l="";return n&&(l=e.html`<gv-button small outlined icon="code:plus" title="Add new flow" @click="${n.bind(this,c)}"></gv-button>`),e.html`<div class="type" draggable="false">${o?e.html`<gv-icon class="expandable-icon" shape="${o}"></gv-icon>`:""}<div class="type-name link" @click="${this._onExpand.bind(this,t)}">${i}</div>${l}</div>${g}`}}return e.html``}_getListElement(e){return this.shadowRoot.querySelector(`#${e}`)}_onAddFlowToPlan(e,t,o){this._getListElement(t).classList.add("open"),o.preventDefault(),o.stopPropagation(),(0,i.dispatchCustomEvent)(this,"add-flow-plan",{planIndex:e})}_onAddFlow(e,t){this._getListElement(e).classList.add("open"),t.preventDefault(),t.stopPropagation(),(0,i.dispatchCustomEvent)(this,"add-flow")}render(){return e.html`<slot name="header"></slot><div class="box">${null!=this.plans?this._renderPart("flows","","shopping:sale#2",this.plans,!1,!this.canAdd||this.disabled||this.readonlyPlans?null:this._onAddFlowToPlan,"name"):""} ${null!=this.flows?this._renderPart("flows",this.flowsTitle,"shopping:box#3",this.flows,!1,this.canAdd&&!this.disabled?this._onAddFlow:null):""} ${null!=this.policies?this._renderPart("policies","Policies","communication:shield-thunder",this.policies,!0,null,this.policies.length>0&&null!=this.policies[0].category?"category":null):""}</div><slot name="footer"></slot>`}}exports.GvPolicyStudioMenu=a,window.customElements.define("gv-policy-studio-menu",a);
@@ -1 +0,0 @@
1
- var e=Object.create?function(e,t,i,o){void 0===o&&(o=i),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,o){void 0===o&&(o=i),e[o]=t[i]},t=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(i){if(i&&i.__esModule)return i;var o={};if(null!=i)for(var s in i)"default"!==s&&Object.prototype.hasOwnProperty.call(i,s)&&e(o,i,s);return t(o,i),o};Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvPolicyStudio=void 0;const o=require("lit"),s=require("../lib/studio"),n=require("../lib/events"),r=require("../lib/i18n");require("../atoms/gv-button"),require("../atoms/gv-icon"),require("../molecules/gv-option"),require("../organisms/gv-documentation"),require("../organisms/gv-resizable-views"),require("../organisms/gv-schema-form"),require("../organisms/gv-http-client"),require("../organisms/gv-tabs"),require("../molecules/gv-row"),require("./gv-flow"),require("./gv-flow-step"),require("./gv-policy-studio-menu");const l=require("../styles/empty"),a=require("lit/directives/cache"),d=require("../lib/utils"),c=require("../mixins/keyboard-element");class h extends((0,c.KeyboardElement)(o.LitElement)){static get properties(){return{policies:{type:Array},services:{type:Object},resourceTypes:{type:Array,attribute:"resource-types"},propertyProviders:{type:Array,attribute:"property-providers"},dynamicPropertySchema:{type:Object,attribute:"dynamic-property-schema"},tabId:{type:String,attribute:"tab-id"},_tabId:{type:String,attribute:!1},definition:{type:Object},_definition:{type:Object,attribute:!1},documentation:{type:Object},flowSchema:{type:Object,attribute:"flow-schema"},configurationSchema:{type:Object,attribute:"configuration-schema"},_configurationSchema:{type:Object,attribute:!1},configurationInformation:{type:String,attribute:"configuration-information"},isDirty:{type:Boolean,attribute:"dirty",reflect:!0},_dragPolicy:{type:Object,attribute:!1},_dropPolicy:{type:Object,attribute:!1},selectedFlowsId:{type:Array,attribute:"selected-flows-id"},_selectedFlowsId:{type:Array,attribute:!1},_currentPolicyId:{type:String,attribute:!1},_searchPolicyQuery:{type:String,attribute:!1},_searchFlowQuery:{type:String,attribute:!1},_flowStepSchema:{type:Object,attribute:!1},_currentFlowStep:{type:Object,attribute:!1},_policyFilter:{type:Array,attribute:!1},_flowFilter:{type:Array,attribute:!1},_currentAskConfirmation:{type:Boolean,attribute:!1},hasProperties:{type:Boolean,attribute:"has-properties"},_hasProperties:{type:Boolean,attribute:!1},hasResources:{type:Boolean,attribute:"has-resources"},hasPolicyFilter:{type:Boolean,attribute:"has-policy-filter"},flowsTitle:{type:String,attribute:"flows-title"},sortable:{type:Boolean},canAdd:{type:Boolean,attribute:"can-add"},readonly:{type:Boolean},readonlyPlans:{type:Boolean,attribute:"readonly-plans"},canDebug:{type:Boolean,attribute:"can-debug"},_canDebug:{type:Boolean,attribute:!1},debugResponse:{type:Object,attribute:"debug-response"},hasConditionalSteps:{type:Boolean,attribute:"has-conditional-steps"}}}static get styles(){return[l.empty,s.methods,o.css`:host{box-sizing:border-box;--height:var(--gv-policy-studio--h, calc(100vh - 32px));height:var(--height);--height-in-tabs:calc(var(--height) - 25px)}.box{height:var(--height);display:flex}.design,.properties{display:flex}gv-resizable-views{width:100%}.editable-name{padding:.5rem 1rem;font-size:16px}.editable-name span{color:#bfbfbf;font-size:12px}.form__control{margin:.5rem}gv-input{width:100%}.flow-name{display:flex;align-items:center}.flow-name.dirty{font-style:italic;opacity:.8}.flow-name gv-icon{--gv-icon--s:24px;margin-right:.2rem}.flow-path{margin-left:.2rem}.title_methods{margin-left:.5rem}.two-cols{display:flex;width:100%;height:100%}.two-cols>*{flex:1}.left-menu{border-left:1px solid #d9d9d9;height:var(--height-in-tabs)}.right-menu{border-right:1px solid #d9d9d9;height:var(--height-in-tabs)}.two-cols>:first-child{border-right:1px solid #d9d9d9}.flow-step__container{overflow:hidden;position:relative;overflow:hidden;height:99%}.flow-step__form{padding:0 .5rem;overflow:auto}.flow-step__form-title{text-transform:uppercase;letter-spacing:.2rem}gv-tabs{width:100%;height:100%;display:inline-block}gv-properties,gv-resizable-views,gv-resources{height:var(--height-in-tabs)}gv-properties,gv-resources{width:100%}gv-properties.properties{--gv-properties-table--colmg:10px}.api-settings{display:flex;flex-direction:column;border-left:1px solid #bfbfbf;height:var(--height-in-tabs)}.debug{display:flex;flex-direction:column;border-left:1px solid #bfbfbf;height:var(--height-in-tabs)}.api-settings-information{display:flex;align-items:center}.api-settings-information__icon{--gv-icon--c:var(--gv-theme-color, #5a7684);--gv-icon-opacity--c:var(--gv-theme-color-info-light, #64b5f6)}.api-settings-information__blockquote,.debug-information__blockquote{border-left:1px solid var(--gv-theme-color,#5a7684);margin:15px;padding-left:15px;font-size:14px}.flow-settings gv-schema-form{flex:1;padding:.5rem}.search{display:flex;justify-content:stretch}gv-input{margin:.2rem 0;width:100%}.header-actions,.search-policies{display:flex;flex-direction:column;align-items:center;margin:.5rem}.search-policies{margin:1.5rem .5rem .5rem}.footer-actions>gv-button.btn-large,.footer-actions>gv-option{width:100%}.footer-actions{display:flex;flex-direction:column;align-items:center;padding:.5rem 0;margin:.5rem 15px;border-top:1px solid #bfbfbf}.header-actions .title{text-transform:uppercase;text-align:center;letter-spacing:.3rem;color:#bfbfbf;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:240px;min-height:25px}.header-actions>*,.search-policies>*{margin-bottom:1rem}`]}constructor(){super(),this.isDirty=!1,this.policies=[],this.resourceTypes=[],this.tabId="design",this.selectedFlowsId=[],this.flowsTitle="Flows",this.sortable=!1,this.services={},this._definition={flows:[]},this._tabs=[{id:"design",title:"Design",icon:"navigation:exchange"}],this._policyFilter=[],this._flowFilter=[]}set hasProperties(e){e&&Promise.resolve().then((()=>i(require("../organisms/gv-properties")))).then((()=>{this._tabs=[...this._tabs,{id:"properties",title:"Properties",icon:"general:settings#1"}],this.requestUpdate()})),this._hasProperties=e}get hasProperties(){return this._hasProperties}set hasResources(e){e&&Promise.resolve().then((()=>i(require("../organisms/gv-resources")))).then((()=>{this._tabs=[...this._tabs,{id:"resources",title:"Resources",icon:"general:settings#5"}],this.requestUpdate()}))}set canDebug(e){e&&(this._tabs=[...this._tabs,{id:"debug",title:"Try it",icon:"content:send"}])}get _flowFilterOptions(){if(this.definedPlans.length>0)return[{id:"api",title:"Api",icon:"shopping:box#3"},{id:"plan",title:"Plans",icon:"shopping:sale#2"}]}set hasPolicyFilter(e){e&&(this._policyFilterOptions=[{id:"onRequest",title:"Request",icon:"navigation:arrow-from-left"},{id:"onResponse",title:"Response",icon:"navigation:arrow-from-right"}])}set configurationSchema(e){e&&this._tabs.splice(1,0,{id:"settings",title:"Configuration",icon:"general:settings#2"}),this._configurationSchema=e}get configurationSchema(){return this._configurationSchema}onKeyboard(){if(null==this._currentAskConfirmation)if(this.isPressed(c.KEYS.Shift,c.KEYS.Ctrl,c.KEYS.Space)){const e=this.shadowRoot.querySelector("#search-policy");e&&e.focus()}else if(this.isPressed(c.KEYS.Ctrl,c.KEYS.Space)){const e=this.shadowRoot.querySelector("#search-flow");e&&e.focus()}}set tabId(e){null!=e&&["design","settings","properties","resources","debug"].includes(e)?this._tabId=e:this._tabId="design"}get tabId(){return this._tabId}set definition(e){if(e){const t=this._generateFlowsId(e.flows),i=this._generateId("resource-",e.resources),o=null==e.plans?[]:e.plans.map((e=>({...e,flows:this._generatePlanFlowsId(e)})));this._initialDefinition={...e,flows:t,resources:i,plans:o},this._definition=(0,d.deepClone)(this._initialDefinition),this.isDirty=!1,this._selectFirstFlow()}}get definition(){return this._definition}set selectedFlowsId(e){null!=e&&Array.isArray(e)&&(this._selectedFlowsId=e.filter((e=>null!=this._findFlowById(e))),e.length!==this._selectedFlowsId.length&&this._selectFirstFlow(!0))}get selectedFlowsId(){return this._selectedFlowsId.filter((e=>null!=this._findFlowById(e)))}_updateSelectedFlows(e){this.selectedFlowsId=e,(0,n.dispatchCustomEvent)(this,"select-flows",{flows:this.selectedFlowsId})}_selectFirstFlow(e=!1){if(0===this.selectedFlowsId.length){let t=null;if(this.definedFlows.length>0&&null!=this.definedFlows[0]._id)t=this.definedFlows[0];else if(this.definedPlans.length>0){const e=this.definedPlans.find((e=>null!=e.flows&&e.flows.length>0&&null!=e.flows[0]._id));e&&(t=e.flows[0])}null!=t&&(e?this._updateSelectedFlows([t._id]):this.selectedFlowsId=[t._id])}}_getFlowElement(e){return this.shadowRoot.querySelector(`[id="${e}"]`)}_onDragEndPolicy(){this.shadowRoot.querySelectorAll("gv-flow").forEach((e=>e.onDragEnd()))}async _onDropPolicy({detail:e}){try{await this._askToValidateForms();const t=e.policy,i=this._findFlowById(e.flowId);let o,s=t.name,n="",r="",l={},a=!1;e.flowStep?(o=e.flowStep._id,s=e.flowStep.name,n=e.flowStep.description||"",r=e.flowStep.condition||"",l=e.flowStep.configuration):(o=this._generateFlowStepId(i._id,e.flowKey,e.position),a=!0);const d={_id:o,_new:a,name:s,policy:t.id,description:n,condition:r,enabled:!0,configuration:l},c=null!=e.sourceFlowId?this._findFlowById(e.sourceFlowId):i;if(null!=e.sourcePosition){if(e.sourceFlowKey&&e.sourceFlowKey!==e.flowKey){if(c[e.sourceFlowKey].splice(e.sourcePosition,1),i[e.flowKey].splice(e.position,0,d),null!=this._currentFlowStep&&this._currentFlowStep.step._id===o){this._currentFlowStep.group=e.flowKey;const t=this.buildSchema(this._currentFlowStep.policy);await this._setCurrentFlowStep(this._currentFlowStep,t,!0),this._getFlowElement(i._id).requestUpdate()}}else e.position>e.sourcePosition?(i[e.flowKey].splice(e.position,0,d),c[e.flowKey].splice(e.sourcePosition,1)):(c[e.flowKey].splice(e.sourcePosition,1),i[e.flowKey].splice(e.position,0,d));i._id!==c._id&&this._getFlowElement(i._id).requestUpdate()}else{i[e.flowKey].splice(e.position,0,d);const o=this._getFlowStepForm();if(null==o||!0!==o.dirty){let o=i[e.flowKey][e.position];null==o&&(o=i[e.flowKey][e.position-1]),!0!==e.cancelEdit&&setTimeout((async()=>{await this._editFlowStep({step:o,policy:t,flow:i,group:e.flowKey}),this.updateComplete.then((()=>{const e=this._getFlowElement(i._id);e.selectedStepId=o._id,e.requestUpdate()}))}))}}i._dirty=!0,c._dirty=!0,this.isDirty=!0,this.shadowRoot.querySelectorAll("gv-flow").forEach((e=>e.removeCandidate())),setTimeout((()=>{this._dragPolicy=null,this._dropPolicy=null}),0)}catch(e){this._currentAskConfirmation=null}}_onDeletePolicy({detail:e}){const t=this._findFlowById(e.flowId);t[e.flowKey].splice(e.position,1),t._dirty=!0,this.isDirty=!0,e.target.editing&&this._closeFlowStepForm(!0),this._getFlowElement(e.flowId).requestUpdate()}_onDesign(){this._changeTab("design"),this._splitMainViews()}buildSchema({schema:e}){const t={title:"Description",description:"Description of flow step",type:"string"},i={title:"Condition",description:"Condition the execution of the flow step (support EL)",type:"string","x-schema-form":{"expression-language":!0}};if(e){const o="string"==typeof e?JSON.parse(e):e,s={commonDescription:t,...this.hasConditionalSteps?{commonCondition:i}:{},...o.properties};return{...o,properties:s}}return{properties:{commonDescription:t,...this.hasConditionalSteps?{commonCondition:i}:{}}}}async _editFlowStep({step:e,flow:t,policy:i,group:o}){if(e){this._currentPolicyId=i.id;const s={flow:t,step:e,policy:i,group:o},n=this.buildSchema(i);try{await this._setCurrentFlowStep(s,n),this._updateSelectedFlows([t._id]),this._splitMainViews(),null==localStorage.getItem("gv-policy-studio:keep-documentation-close")&&this._onOpenDocumentation()}catch(e){this._currentAskConfirmation=null}}else await this._closeFlowStepForm(),this._maximizeTopView()}async _onEditFlowStep({detail:{step:e,flow:t,policy:i,group:o}}){return this._editFlowStep({step:e,flow:t,policy:i,group:o})}_getResizableViews(){return this.shadowRoot.querySelector("gv-resizable-views")}_maximizeTopView(){this.selectedFlowsId.length<=1&&this._getResizableViews().maximizeTop()}_maximizeBottomView(){this._getResizableViews().maximizeBottom()}_splitMainViews(){this._getResizableViews().split()}_onChangeFlowStepState({detail:e}){const t=this._findFlowById(e.flowId);t[e.flowKey][e.position].enabled=e.enabled,t._dirty=!0,this.isDirty=!0}async _onCloseFlowStepForm(){try{await this._closeFlowStepForm()}catch(e){this._currentAskConfirmation=null}}async _closeFlowStepForm(e=!1){await this._setCurrentFlowStep(null,null,e)}async _askToValidateForms(){if(null==this._currentAskConfirmation)return this._currentAskConfirmation=!0,Promise.all(this._submitOrConfirmForms()).then((e=>e.filter((e=>null!=e)).length>0?(this._definition=this._buildDefinitionToSave(),this.getChildren().forEach((e=>e.requestUpdate())),this._checkCurrentFlowStep().then((()=>(this.getChildren().forEach((e=>e.requestUpdate())),this.updateComplete.then((()=>(this._currentAskConfirmation=null,e))))))):(this._currentAskConfirmation=null,e)));throw new Error("ask already waiting")}async _setCurrentFlowStep(e,t,i=!1){i||await this._askToValidateForms();const o=(0,d.deepClone)(t);if(null!=e){const i="string"==typeof e.step.configuration?JSON.parse(e.step.configuration):e.step.configuration,s={...e.step,configuration:i},n={...s.configuration,commonDescription:s.description,commonCondition:s.condition};if(this._currentFlowStep={...e,step:s,_initialValues:n},t&&t.properties.scope){const e=o.properties.scope.enum;if(null!=e.find((e=>["REQUEST","REQUEST_CONTENT","RESPONSE","RESPONSE_CONTENT"].includes(e)))){const t="pre"===this._currentFlowStep.group?["REQUEST","REQUEST_CONTENT"]:["RESPONSE","RESPONSE_CONTENT"];o.properties.scope.enum=e.filter((e=>t.includes(e)));const i=this._currentFlowStep.step.configuration.scope;null!=i&&o.properties.scope.enum.includes(i)||(o.properties.scope.default=o.properties.scope.enum[0],this._currentFlowStep.step.configuration.scope=o.properties.scope.enum[0],this._currentFlowStep._initialValues.scope=o.properties.scope.enum[0],this._currentFlowStep._values&&(this._currentFlowStep._values.scope=o.properties.scope.enum[0]))}}}else this._currentFlowStep=null;this._flowStepSchema=o}_refresh(e=!0){e&&this._closeFlowStepForm(!0),this._definition=(0,d.deepClone)(this._definition)}async _onSelectFlows({detail:e}){try{await this._closeFlowStepForm(),this._onCloseDocumentation(),this._updateSelectedFlows(e.flows),this._onDesign()}catch(e){this._currentAskConfirmation=null}}async _onOpenDocumentationFromMenu({detail:{policy:e}}){try{null!=this.documentation&&this.documentation.id===e.id||(await this._closeFlowStepForm(),this._currentPolicyId=e.id,this.getSelectedFlow()?this._splitMainViews():this._maximizeBottomView(),(0,n.dispatchCustomEvent)(this,"fetch-documentation",{policy:e}))}catch(e){}}_fetchDocumentation(e){null!=this.documentation&&this.documentation.id===e.id||(0,n.dispatchCustomEvent)(this,"fetch-documentation",{policy:e})}_onOpenDocumentation(){this._currentFlowStep&&this._currentFlowStep.policy&&this._fetchDocumentation(this._currentFlowStep.policy)}_onOpenDocumentationFromForm(){localStorage.removeItem("gv-policy-studio:keep-documentation-close"),this._onOpenDocumentation()}_findFlowCollection(e){const t=this.definedPlans.find((t=>null!=t.flows.find((t=>t._id===e))));return{plan:t,flows:null!=t?t.flows:this.definedFlows}}_findFlowById(e){let t=this.definedFlows.find((t=>t._id===e));if(null==t){t=this.definedPlans.map((e=>e.flows)).reduce(((e,t)=>e.concat(t)),[]).find((t=>t._id===e))}return t}getSelectedFlow(e=0){const t=this.selectedFlowsId[e];return this._findFlowById(t)}_onTargetPolicy({detail:e}){null==this._currentAskConfirmation&&(this._dragPolicy=e)}_onChangeFlowStep({detail:e}){this._currentFlowStep._values=e.values}_writeFlowStep(e){const{commonDescription:t,commonCondition:i,...o}=e;if(this._currentFlowStep.step._new||this._currentFlowStep.step.description!==t||this._currentFlowStep.step.condition!==i||!(0,d.deepEqual)(this._currentFlowStep.step.configuration,o)){const e=this._findFlowById(this._currentFlowStep.flow._id),s=e[this._currentFlowStep.group].findIndex((e=>e._id===this._currentFlowStep.step._id));e[this._currentFlowStep.group][s].description=t,e[this._currentFlowStep.group][s].condition=i,e[this._currentFlowStep.group][s].configuration=(0,d.deepClone)(o),delete e[this._currentFlowStep.group][s]._new,e[this._currentFlowStep.group][s]._dirty=!0,e._dirty=!0,this.isDirty=!0,this._currentFlowStep.flow=e,this._currentFlowStep.step=e[this._currentFlowStep.group][s]}}async _onSubmitFlowStep({detail:e}){this._writeFlowStep(e.values),await this.requestUpdate("_definition"),this.getChildren().forEach((e=>e.requestUpdate()))}_onCancelFlow(){this._onDesign()}_onSubmitFlow({detail:{values:e}}){const t=this.getSelectedFlow(),i=Object.assign({},this._createFlowFromSchema(),e),o=Object.assign({},t,i);(0,d.deepEqual)(t,o)||(Object.assign(t,o,{_dirty:!0}),this.isDirty=!0,this._refresh())}_onCancelFlowMode(){this._onDesign()}_onSubmitFlowMode({detail:{values:e}}){this._definition["flow-mode"]=e["flow-mode"]||"DEFAULT",this.isDirty=!0,this._refresh()}_onChangeTab({detail:e}){this._changeTab(e.value)}async _changeTabValidator({from:e,to:t}){if("properties"===e){const e=this.shadowRoot.querySelector("gv-properties");if(e.dirty)return e.confirm()}else if("resources"===e){const e=this.shadowRoot.querySelector("gv-resources");if(e.dirty)return e.confirm()}else try{return await this._askToValidateForms()}catch(e){throw this._currentAskConfirmation=null,e}return Promise.resolve()}_changeTab(e){null==this._currentAskConfirmation&&(this.tabId=e,(0,n.dispatchCustomEvent)(this,"change-tab",this.tabId))}_onDragStartFlowStep(e,{detail:t}){null==this._currentAskConfirmation&&(this._dropPolicy=t,this._dragPolicy=t)}_renderFlowEmptyState(e){return o.html`<div slot="content" class="empty"><div>Select a flow ${!0!==e?o.html`or<gv-button @gv-button:click="${this._onAddFlow}" outlined icon="code:plus" large>design new one</gv-button>`:""}</div></div>`}_renderFlow(e=0,t=!0,i){const s=this.getSelectedFlow(e);if(s){const{plan:e}=this._findFlowCollection(s._id),t=this._currentFlowStep?this._currentFlowStep.step._id:null;return o.html`<gv-flow style="height:100%" .id="${s._id}" .flow="${s}" .plan="${e}" .policies="${this.policies}" slot="content" ?disabled="${this._currentAskConfirmation}" .dragPolicy="${this._dragPolicy}" .dropPolicy="${this._dropPolicy}" .selectedStepId="${t}" ?readonly="${i}" ?has-policy-filter="${null!=this._policyFilterOptions}" flows-title="${this.flowsTitle}" @gv-flow:drag-start="${this._onDragStartFlowStep.bind(this,s)}" @gv-flow:edit="${this._onEditFlowStep}" @gv-flow:change-state="${this._onChangeFlowStepState}" @gv-flow:drop="${this._onDropPolicy}" @gv-flow:delete="${this._onDeletePolicy}"></gv-flow>`}return t?this._renderFlowEmptyState(i):o.html``}_onFetchResources(e){const{currentTarget:t,regexTypes:i}=e.detail,o=this.definedResources.filter((e=>null==i||new RegExp(i).test(e.type))).map(((e,t)=>{const i=this.resourceTypes.find((t=>t.id===e.type)),o=document.createElement("gv-row"),s=i.icon?i.icon:null;return o.item={picture:s,name:e.name},{element:o,value:e.name,id:e.type}}));t.options=o}_renderPolicy(e){return this._flowStepSchema&&this.documentation?o.html`<gv-resizable-views direction="horizontal" no-overflow><div slot="top">${this._renderFlowStepForm(e)}</div><div slot="bottom"><gv-documentation .text="${this.documentation.content}" .image="${this.documentation.image}" ?disabled="${this._currentAskConfirmation}" @gv-documentation:close="${this._onCloseDocumentation}"></gv-documentation></div></gv-resizable-views>`:this.documentation?o.html`<gv-documentation .text="${this.documentation.content}" .image="${this.documentation.image}" ?disabled="${this._currentAskConfirmation}" @gv-documentation:close="${this._onCloseDocumentation}"></gv-documentation>`:this._flowStepSchema?this._renderFlowStepForm(e):o.html``}_getFlowStepForm(){return this.shadowRoot.querySelector("#flow-step-form")}_onResetFlowStep(){this._currentFlowStep&&(delete this._currentFlowStep._values,this._getFlowStepForm().reset())}_generateFlowsId(e,t=!1){return this._generateId("f",e,t,!0)}_generatePlanFlowsId(e,t=!1){return this._generateId(e.id,e.flows,t,!0)}_generateFlowStepId(e,t,i){return`${e}_${t}_${i}`}_generateId(e,t,i=!1,o=!1){return t?t.map(((t,s)=>{const n=`${e}_${s}`;return o&&(t.pre&&t.pre.forEach(((e,t)=>e._id=this._generateFlowStepId(n,"pre",t))),t.post&&t.post.forEach(((e,t)=>e._id=this._generateFlowStepId(n,"post",t)))),i||null==t._id?{...t,_id:n}:t})):t}getChildren(){return[...Array.from(this.shadowRoot.querySelectorAll("gv-flow")),...Array.from(this.shadowRoot.querySelectorAll("gv-resizable-views"))]}async getUpdateComplete(){await super.getUpdateComplete(),await Promise.all(this.getChildren().map((e=>e.updateComplete)))}shouldUpdate(e){return e.has("_dragPolicy")?(this.shadowRoot.querySelectorAll("gv-flow").forEach((e=>e.dragPolicy=this._dragPolicy)),!1):e.has("_dropPolicy")?(this.shadowRoot.querySelectorAll("gv-flow").forEach((e=>e.dropPolicy=this._dropPolicy)),!1):super.shouldUpdate(e)}updated(e){e.has("documentation")&&null!=this.documentation&&this.selectedFlowsId.length>1&&this._updateSelectedFlows([this.selectedFlowsId[0]])}_renderFlowStepForm(e){const t=this._currentFlowStep._values||this._currentFlowStep._initialValues,i=[{items:["commonDescription","commonCondition"]},{name:(0,r.i18n)("gv-policy-studio.policy-settings"),default:!0}];return o.html`${(0,a.cache)(this._flowStepSchema&&this._currentFlowStep?o.html`<div class="flow-step__container"><div class="flow-step__form"><gv-schema-form .id="${"flow-step-form"}" .schema="${this._flowStepSchema}" .icon="design:edit" has-header validate-on-render .values="${t}" .dirty="${null!=this._currentFlowStep._values}" ?readonly="${e}" scrollable .groups="${i}" @gv-schema-form:change="${this._onChangeFlowStep}" @gv-schema-form:reset="${this._onResetFlowStep}" @gv-schema-form:fetch-resources="${this._onFetchResources}" @gv-schema-form:submit="${this._onSubmitFlowStep}"><div slot="title" class="flow-step__form-title">${this._currentFlowStep.step.name}</div><gv-button slot="header-left" icon="general:close" outlined small @gv-button:click="${this._onCloseFlowStepForm}" title="Close"></gv-button><gv-button slot="header-left" icon="home:book" ?disabled="${null!=this.documentation}" outlined small @gv-button:click="${this._onOpenDocumentationFromForm}" title="Open documentation"></gv-button></gv-schema-form></div></div>`:"")}`}_onCloseDocumentation(){this.documentation=null,null==this._currentFlowStep?this._maximizeTopView():localStorage.setItem("gv-policy-studio:keep-documentation-close",!0)}_onDeleteFlow({detail:e}){const t=e.content._id,{flows:i}=this._findFlowCollection(t),o=i.find((e=>e._id===t));this._deleteFlow(i,o)}get definedFlows(){return this._definition&&this._definition.flows?this._definition.flows:[]}get definedPlans(){return this._definition&&this._definition.plans?this._definition.plans:[]}get definedResources(){return this._definition&&this._definition.resources?this._definition.resources:[]}get definedProperties(){return this._definition&&this._definition.properties?this._definition.properties:[]}async _onDuplicateFlow({detail:e}){try{await this._askToValidateForms();const t=e.content._id,{plan:i,flows:o}=this._findFlowCollection(t);if(this._addFlow(o,this._findFlowById(t)),null!=i){let e=null;this.definedPlans.find(((t,o)=>t.id===i.id&&(e=o,!0))),i.flows=o,this.definedPlans[e].flows=this._generatePlanFlowsId(i,!0),this._updateSelectedFlows([this.definedPlans[e].flows[o.length-1]._id])}else this._definition.flows=this._generateFlowsId(this._definition.flows),this._updateSelectedFlows([this._definition.flows[this._definition.flows.length-1]._id])}catch(e){this._currentAskConfirmation=null}}_onChangeFlowState({detail:e}){const t=this._findFlowById(e.content._id);t.enabled=e.enabled,t._dirty=!0,this.isDirty=!0}async _onAddFlowPlan({detail:e}){try{await this._askToValidateForms(),this._addFlow(this.definedPlans[e.planIndex].flows),this.definedPlans[e.planIndex].flows=this._generatePlanFlowsId(this.definedPlans[e.planIndex]),this._updateSelectedFlows([this.definedPlans[e.planIndex].flows[this.definedPlans[e.planIndex].flows.length-1]._id])}catch(e){this._currentAskConfirmation=null}}async _onAddFlow(){try{await this._askToValidateForms(),this._addFlow(this._definition.flows),this._definition.flows=this._generateFlowsId(this._definition.flows),this._updateSelectedFlows([this._definition.flows[this._definition.flows.length-1]._id])}catch(e){this._currentAskConfirmation=null}}_addFlow(e,t=null){const i=null==t?this._createFlowFromSchema():{...t,_id:null,id:null,_dirty:!0};return e.push(i),this.isDirty=!0,e}_createFlowFromSchema(){return this._instantiate(this.flowSchema.properties,{name:"",pre:[],post:[],_dirty:!0})}_instantiate(e,t={}){const i={...t};if(e)for(const o of Object.keys(e)){const s=e[o];"object"===s.type&&(i[o]=this._instantiate(s.properties,t={})),void 0!==s.default?i[o]=s.default:"string"===s.type&&(i[o]="")}return i}_deleteFlow(e,t){const i=e.indexOf(t);e.splice(i,1);const o=this.selectedFlowsId.filter((e=>e!==t._id));1===o.length?this._updateSelectedFlows(o):this._selectFirstFlow(!0),this._changeTab("design"),this._refresh(),this.isDirty=!0}_findFlowIndex(e,t){let i=null;return e.find(((e,o)=>e._id===t&&(i=o,!0))),i}async _onReorderFlows({detail:{plan:e}}){try{if(await this._askToValidateForms(),this.isDirty=!0,null!=e){const t=this._generatePlanFlowsId(e,!0);this.selectedFlowsId&&this._updateSelectedFlows(this.selectedFlowsId.map((i=>{const o=this._findFlowIndex(e.flows,i);return null!=o?t[o]._id:i}))),e.flows=t}else{const e=this._generateFlowsId(this._definition.flows,!0);this.selectedFlowsId&&this._updateSelectedFlows(this.selectedFlowsId.map((t=>{const i=this._findFlowIndex(this._definition.flows,t);return null!=i?e[i]._id:t}))),this._definition.flows=e}}catch(e){this._currentAskConfirmation=!1}}_onSearchPolicy({detail:e}){this._searchPolicyQuery=e}_onClearPolicy(){this._searchPolicyQuery=null}_onSearchFlows({detail:e}){this._searchFlowQuery=e}_onClearFlows(){this._searchFlowQuery=null}async _onResetAll(){try{await this._closeFlowStepForm(),this.definition=(0,d.deepClone)(this._initialDefinition)}catch(e){this._currentAskConfirmation=null}}_filterNotValidStep(e){return!0!==e._new}_removePrivateProperties(e){const t={...e};return Object.keys(e).filter((e=>e.startsWith("_"))).forEach((e=>{delete t[e]})),t}_submitOrConfirmForms(){return[...this.shadowRoot.querySelectorAll("gv-schema-form")].filter((e=>{const t=e.isValid();return t?e.submit():e.dirty=!0,!t})).map((e=>e.confirm()))}getPropertiesElement(){return this.shadowRoot.querySelector("gv-properties")}async _checkCurrentFlowStep(){if(this._currentFlowStep&&this.selectedFlowsId){const e=this.selectedFlowsId.map((e=>{const t=this._findFlowById(e);return null==[...t.pre,...t.post].find((e=>e._id===this._currentFlowStep.step._id))?this._closeFlowStepForm(!0):null})).filter((e=>null!==e));return Promise.all(e)}return Promise.resolve()}saved(){this.isDirty&&(this._initialDefinition=(0,d.deepClone)(this._definitionSaved),this._definition=(0,d.deepClone)(this._definitionSaved),this._definitionSaved=null,this.isDirty=!1,this._checkCurrentFlowStep(),this.definedPlans.forEach((e=>{e.flows.forEach((e=>e._dirty=!1))})),this.definedFlows.forEach((e=>e._dirty=!1)),this.getChildren().forEach((e=>e.requestUpdate())))}_buildDefinitionToSave(){const e=this._definition.flows.map((e=>(e.pre=e.pre.filter(this._filterNotValidStep),e.post=e.post.filter(this._filterNotValidStep),e)));let t={...this._definition,flows:e};if(null!=this._definition.plans){const e=this._definition.plans.map((e=>{const t=e.flows.map((e=>(e.pre=e.pre.filter(this._filterNotValidStep),e.post=e.post.filter(this._filterNotValidStep),e)));return{...e,flows:t}}));t={...t,plans:e}}return t}_buildDefinitionToSend(e){const t=e.flows.map((e=>{const t=this._removePrivateProperties(e);return t.pre=t.pre.map(this._removePrivateProperties),t.post=t.post.map(this._removePrivateProperties),t}));let i={...this._definition,flows:t};if(null!=this._definition.plans){const t=e.plans.map((e=>{const t=e.flows.map((e=>{const t=this._removePrivateProperties(e);return t.pre=t.pre.map(this._removePrivateProperties),t.post=t.post.map(this._removePrivateProperties),t}));return{...e,flows:t}}));i={...i,plans:t}}if(null!=this._definition.properties){const e=this._definition.properties.map(this._removePrivateProperties);i={...i,properties:e}}if(null!=this._definition.resources){const e=this._definition.resources.map(this._removePrivateProperties);i={...i,resources:e}}return i}_onSaveAll(){this.hasProperties&&this.getPropertiesElement().submit(),Promise.all(this._submitOrConfirmForms()).then((()=>{this._definitionSaved=this._buildDefinitionToSave();const e=this._buildDefinitionToSend(this._definitionSaved);(0,n.dispatchCustomEvent)(this,"save",{definition:e,services:this.services})})).catch((e=>{console.error("[policy-studio] Error on save",e)}))}_onDebug(e){this.hasProperties&&this.getPropertiesElement().submit(),Promise.all(this._submitOrConfirmForms()).then((()=>{const t=this._buildDefinitionToSend(this._buildDefinitionToSave());(0,n.dispatchCustomEvent)(this,"debug",{definition:t,services:this.services,request:e.detail.request})})).catch((e=>{console.error("[policy-studio] Error on debug",e)}))}get filteredFlows(){return 0===this._flowFilter.length||this._flowFilter.includes("api")?this.definedFlows:null}get filteredPlans(){return 0===this._flowFilter.length||this._flowFilter.includes("plan")?this.definedPlans:null}_onFilterFlows({detail:e}){this._flowFilter.includes(e.id)?this._flowFilter=[]:this._flowFilter=[e.id]}_getFilteredPolicies(){return this._policyFilter.length>0?this.policies.filter((e=>e.onRequest&&this._policyFilter.includes("onRequest")||e.onResponse&&this._policyFilter.includes("onResponse"))):this.policies}_onFilterPolicies({detail:e}){this._policyFilter.includes(e.id)?this._policyFilter=[]:this._policyFilter=[e.id]}_renderDesign(e){return o.html`<div id="design" slot="content" class="design"><gv-resizable-views no-overflow><div slot="top">${this._renderFlow(0,!0,e)}</div><div slot="bottom">${this._renderFlow(1,!1,e)} ${this._renderPolicy(e)} ${this._renderFlowForm(e)}</div></gv-resizable-views>${!0!==e?o.html`<gv-policy-studio-menu class="right-menu" ?disabled="${this._currentAskConfirmation}" .policies="${this._getFilteredPolicies()}" .selectedIds="${[this._currentPolicyId]}" .query="${this._searchPolicyQuery}" ?has-policy-filter="${null!=this._policyFilterOptions}" ?readonly="${e}" @gv-policy-studio-menu:target-policy="${this._onTargetPolicy}" @gv-policy-studio-menu:fetch-documentation="${this._onOpenDocumentationFromMenu}" @gv-policy-studio-menu:dragend-policy="${this._onDragEndPolicy}"><div slot="header" class="search-policies">${null!=this._policyFilterOptions?o.html`<gv-option ?disabled="${this._currentAskConfirmation}" .options="${this._policyFilterOptions}" multiple="multiple" outlined .value="${this._policyFilter}" small @gv-option:select="${this._onFilterPolicies}"></gv-option>`:""}<gv-input id="search-policy" ?disabled="${this._currentAskConfirmation}" placeholder="Filter policies (Shift + Ctrl + Space)" type="search" small @gv-input:input="${this._onSearchPolicy}" @gv-input:clear="${this._onClearPolicy}"></gv-input></div></gv-policy-studio-menu>`:""}</div>`}_renderDebug(){const e=this.debugResponse?this.debugResponse.response:void 0,t=this.debugResponse?this.debugResponse.isLoading:void 0,i=this.debugResponse&&this.debugResponse.request?this.debugResponse.request.path:void 0,s=this.debugResponse&&this.debugResponse.request?this.debugResponse.request.method:void 0;return o.html`<gv-http-client id="debug" slot="content" class="debug" @gv-http-client:send="${this._onDebug}" .response="${e}" .path="${i}" .method="${s}" ?loading="${t}"></gv-http-client>`}_renderConfigurationForm(e){if(this.configurationSchema){const t=(0,d.deepClone)(this._definition);return o.html`<div id="settings" slot="content" class="api-settings" @dragover="${this._onDesign}"><gv-schema-form .schema="${this.configurationSchema}" id="api-settings-form" .values="${t}" has-header has-footer scrollable ?readonly="${e}" @gv-schema-form:cancel="${this._onCancelFlowMode}" @gv-schema-form:submit="${this._onSubmitFlowMode}">${this.configurationInformation?o.html`<div class="api-settings-information" slot="title"><gv-icon class="api-settings-information__icon" title="Info" shape="code:info"></gv-icon><blockquote class="api-settings-information__blockquote">${this.configurationInformation}</blockquote></div>`:""}</gv-schema-form></div>`}return o.html``}_renderFlowForm(e){if(this.flowSchema&&null==this._flowStepSchema&&null==this.documentation&&1===this.selectedFlowsId.length){const t=this.getSelectedFlow();if(t){const i=(0,d.deepClone)(t);return o.html`<div slot="content" class="flow-settings"><gv-schema-form .schema="${this.flowSchema}" id="settings-form" .values="${i}" has-header scrollable ?readonly="${e}" @gv-schema-form:cancel="${this._onCancelFlow}" @gv-schema-form:submit="${this._onSubmitFlow}"><div slot="title" class="flow-step__form-title">Flow configuration</div></gv-schema-form></div>`}}}_onResourcesChange({detail:e}){this.definition.resources=e.resources,this.isDirty=!0}_onPropertiesChange({detail:e}){this.definition.properties=e.properties,this.isDirty=!0}_onSaveProvider({detail:e}){this.services["dynamic-property"]=e.provider,this.isDirty=!0}_onSwitchEncryptedProperty({detail:e}){this.isDirty=!0}render(){const e=this._getReadonlyModeForDesign();return o.html`<div class="box"><gv-policy-studio-menu class="left-menu" .api-name="${this._definition.name}" .flows="${this.filteredFlows}" .plans="${this.filteredPlans}" .selectedIds="${this.selectedFlowsId}" ?disabled="${this._currentAskConfirmation}" ?sortable="${this.sortable&&!0!==this.readonly}" ?readonly="${this.readonly}" ?readonlyPlans="${this.readonlyPlans}" flows-title="${this.flowsTitle}" .query="${this._searchFlowQuery}" ?can-add="${this.canAdd&&!this.readonly}" @gv-policy-studio-menu:reorder-flows="${this._onReorderFlows}" @gv-policy-studio-menu:change-flow-state="${this._onChangeFlowState}" @gv-policy-studio-menu:add-flow="${this._onAddFlow}" @gv-policy-studio-menu:add-flow-plan="${this._onAddFlowPlan}" @gv-policy-studio-menu:delete-flow="${this._onDeleteFlow}" @gv-policy-studio-menu:duplicate-flow="${this._onDuplicateFlow}" @gv-policy-studio-menu:select-flows="${this._onSelectFlows}"><div slot="header" class="header-actions"><div class="title">${this._definition.name}</div>${null!=this._flowFilterOptions?o.html`<gv-option ?disabled="${this._currentAskConfirmation}" .options="${this._flowFilterOptions}" multiple="multiple" outlined .value="${this._flowFilter}" small @gv-option:select="${this._onFilterFlows}"></gv-option>`:""}<gv-input ?disabled="${this._currentAskConfirmation}" id="search-flow" placeholder="Filter flows (Ctrl + Space)" type="search" small @gv-input:input="${this._onSearchFlows}" @gv-input:clear="${this._onClearFlows}"></gv-input></div>${!0!==this.readonly?o.html`<div slot="footer" class="footer-actions"><gv-button class="btn-large" .disabled="${!this.isDirty||this._currentAskConfirmation}" @gv-button:click="${this._onSaveAll}">Save</gv-button><gv-button link .disabled="${!this.isDirty||this._currentAskConfirmation}" @gv-button:click="${this._onResetAll}">Reset</gv-button></div>`:""}</gv-policy-studio-menu><gv-tabs .value="${this.tabId}" .options="${this._tabs}" .disabled="${this._currentAskConfirmation}" @gv-tabs:change="${this._onChangeTab}" .validator="${this._changeTabValidator.bind(this)}">${this._renderDesign(e)} ${this._renderConfigurationForm(e)} ${this._renderDebug()}<gv-properties id="properties" slot="content" class="properties" .provider="${this.services["dynamic-property"]}" @gv-properties:change="${this._onPropertiesChange}" @gv-properties:save-provider="${this._onSaveProvider}" @gv-properties:switch-encrypted="${this._onSwitchEncryptedProperty}" ?readonly="${e}" encryptable="true" .properties="${this.definedProperties}" .providers="${this.propertyProviders}" .dynamicPropertySchema="${this.dynamicPropertySchema}"></gv-properties><gv-resources id="resources" slot="content" class="resources" @gv-resources:change="${this._onResourcesChange}" ?readonly="${e}" .resources="${this.definedResources}" .types="${this.resourceTypes}"></gv-resources></gv-tabs></div>`}_getReadonlyModeForDesign(){if(this.readonly)return!0;const e=this.getSelectedFlow(0);if(!e)return!1;const{plan:t}=this._findFlowCollection(e._id);if(t&&this.readonlyPlans)return!0;const i=this.getSelectedFlow(1);if(!i)return!1;const{plan:o}=this._findFlowCollection(i._id);return o&&this.readonlyPlans}}exports.GvPolicyStudio=h,window.customElements.define("gv-policy-studio",h);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.empty=void 0;const e=require("lit");exports.empty=e.css`.empty,.error{align-items:center;box-sizing:border-box;color:var(--gv-theme-font-color-dark);font-size:var(--gv-theme-font-size-l,20px);font-weight:700;height:100%;opacity:.5;padding:3rem;text-align:center;width:100%;justify-content:center;display:flex;flex-direction:column}`;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.input=void 0;const i=require("lit");exports.input=i.css`:host{box-sizing:border-box;display:inline-block;margin:.2rem;vertical-align:middle;background-color:transparent;--bdw:var(--gv-input--bdw, 1px);--2xbdw:calc(var(--gv-input--bdw, 1px) * 2);--input-small--p:4px 4px;--input-small--fz:12px;--input-small--lh:15px;--icon-small--w:calc(15px + 4px + 4px);--input-small--h:calc(var(--icon-small--w) + var(--2xbdw));--input-medium--p:10px 5px;--input-medium--fz:14px;--input-medium--lh:17px;--icon-medium--w:calc(17px + 10px + 10px);--input-medium--h:calc(var(--icon-medium--w) + var(--2xbdw));--input-large--p:12px 8px;--input-large--fz:16px;--input-large--lh:18px;--icon-large--w:calc(18px + 12px + 12px);--input-large--h:calc(var(--icon-large--w) + var(--2xbdw))}.box-icon{box-sizing:border-box;height:var(--input-medium--h);width:calc(var(--input-medium--h) - 4px);display:flex;align-items:center;justify-content:center;position:absolute;bottom:0;right:0;left:initial;border-radius:0 3px 3px 0}.small .box-icon{height:var(--input-small--h);width:calc(var(--input-small--h) - 4px)}.box-icon-left{right:initial;left:0;border-radius:3px 0 0 3px}.box-icon gv-icon{--gv-icon--s:22px;--gv-icon--c:var(--gv-theme-font-color-dark)}.small .box-icon gv-icon{--gv-icon--s:16px}.box-icon.box-icon-clear gv-icon,:host([large]) .box-icon.box-icon-clear gv-icon{width:16px}.box-icon.box-icon-bgc{background-color:var(--gv-input-icon--bgc,var(--gv-theme-neutral-color,#f5f5f5));border:var(--gv-input--bdw,1px) var(--gv-input--bds,solid) var(--gv-input--bdc,var(--gv-theme-neutral-color-dark,#d9d9d9))}:host([large]) .box-icon{height:var(--input-large--h);width:var(--input-large--h)}:host([large]) .box-icon gv-icon{width:24px;--gv-icon--s:24px}:host([small]) .box-icon{height:var(--input-small--h);width:var(--input-small--h)}:host([small]) .box-icon gv-icon{width:18px}:host([small]) .box-icon-clear gv-icon{width:14px}.box-input{position:relative;line-height:0}.input,::slotted(.input),::slotted(input),input{border:var(--gv-input--bdw,1px) var(--gv-input--bds,solid) var(--gv-input--bdc,var(--gv-theme-neutral-color-dark,#d9d9d9));transition:border 10ms ease-in-out;box-sizing:border-box;border-radius:4px;font-style:normal;font-weight:400;outline:0;width:100%;height:100%;-webkit-appearance:none}::slotted(input::-webkit-search-decoration),input::-webkit-search-decoration{-webkit-appearance:none}.large .input,.large ::slotted(.input),.large ::slotted(input),.large input{padding:var(--input-large--p);font-size:var(--input-large--fz);line-height:var(--input-large--lh);height:var(--input-large--h)}.medium .input,.medium ::slotted(.input),.medium ::slotted(input),.medium input{padding:var(--input-medium--p);font-size:var(--input-medium--fz);line-height:var(--input-medium--lh);height:var(--input-medium--h)}.small .input,.small ::slotted(.input),.small ::slotted(input),.small input{padding:var(--input-small--p);font-size:var(--input-small--fz);line-height:var(--input-small--lh);height:var(--input-small--h)}.large.icon ::slotted(input),.large.icon input{padding-right:45px}.large.clearable ::slotted(input),.large.clearable input{padding-right:50px}.medium.icon ::slotted(input),.medium.icon input{padding-right:36px}.medium.clearable ::slotted(input),.medium.clearable input{padding-right:32px}.small ::slotted(input),.small.icon input{padding-right:26px}.small.clearable ::slotted(input),.small.clearable inpu{padding-right:22px}.large.icon-left ::slotted(input),.large.icon-left input{padding-left:45px}.large.clearable ::slotted(input),.large.clearable input{padding-right:40px}.medium.icon-left ::slotted(input),.medium.icon-left input{padding-left:36px}.small.icon-left ::slotted(input),.small.icon-left input{padding-left:26px}::-webkit-search-cancel-button{-webkit-appearance:none}:host([disabled]){--gv-icon--c:var(--gv-theme-neutral-color-darker, #d9d9d9)}:host([disabled]) .box-icon-bgc{background-color:transparent}:host([disabled]) .input,:host([disabled]) ::slotted(input),:host([disabled]) input{cursor:default;opacity:.5}.input:invalid,.input:required,::slotted(.input:invalid),::slotted(.input:required),::slotted(input:invalid),::slotted(input:required),input:invalid,input:required{box-shadow:none}label{display:block;line-height:15px;padding:0 0 .2rem 0}.description{opacity:.6;font-size:var(--gv-theme-font-size-s,12px)}`;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.link=void 0;const i=require("lit");exports.link=i.css`.link,.link:visited{cursor:pointer;opacity:1;transition:opacity .15s ease-in;text-decoration:none}.link:hover{opacity:.7;transition:opacity .15s ease-in}`;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.shapeCopied=exports.shapeClipboard=void 0,exports.shapeClipboard="general:clipboard",exports.shapeCopied="communication:clipboard-check";
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.skeleton=void 0;const e=require("lit");exports.skeleton=e.css`@keyframes skeleton-pulse{from{opacity:.85}to{opacity:.45}}.skeleton,:host([skeleton]){animation-direction:alternate;animation-duration:.5s;animation-iteration-count:infinite;animation-name:skeleton-pulse;color:transparent;cursor:progress!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--gv-theme-skeleton-color,#bfbfbf)!important;border-color:var(--gv-theme-skeleton-color,#bfbfbf)}.skeleton ::slotted(*),.skeleton gv-icon,.skeleton svg,.skeleton>*,:host([skeleton]) ::slotted(*),:host([skeleton]) gv-icon,:host([skeleton]) svg{visibility:hidden}`;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.zoom=void 0;const o=require("lit");exports.zoom=o.css`@keyframes zoomIn{0%{transform:scale(.8);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes zoomOut{0%{transform:scale(1)}100%{transform:scale(.8);opacity:0}}`;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvTheme=void 0;const e=require("lit"),t=require("../lib/events"),r=require("../lib/theme");class o extends e.LitElement{static get properties(){return{_theme:{type:Object,attribute:!1},_lastDate:{type:Number,attribute:!1}}}static get styles(){return[e.css`:host{--gv-theme-color-darker:var(--gv-theme-color-darker, #383e3f);--gv-theme-color-dark:var(--gv-theme-color-dark, #28444f);--gv-theme-color:var(--gv-theme-color, #5a7684);--gv-theme-color-light:var(--gv-theme-color-light, #86c3d0);--gv-theme-color-danger:var(--gv-theme-color-danger, #ff5722);--gv-theme-color-error-dark:var(--gv-theme-color-error-dark, #d32f2f);--gv-theme-color-error:var(--gv-theme-color-error, #f44336);--gv-theme-color-error-light:var(--gv-theme-color-error-light, #e57373);--gv-theme-color-info-dark:var(--gv-theme-color-info-dark, #1976d2);--gv-theme-color-info:var(--gv-theme-color-info, #2196f3);--gv-theme-color-info-light:var(--gv-theme-color-info-light, #64b5f6);--gv-theme-color-success-dark:var(--gv-theme-color-success-dark, #388e3c);--gv-theme-color-success:var(--gv-theme-color-success, #4caf50);--gv-theme-color-success-light:var(--gv-theme-color-success-light, #81c784);--gv-theme-color-warning-dark:var(--gv-theme-color-warning-dark, #f57c00);--gv-theme-color-warning:var(--gv-theme-color-warning, #ff9800);--gv-theme-color-warning-light:var(--gv-theme-color-warning-light, #ffb74d);--gv-theme-neutral-color-darkest:var(--gv-theme-neutral-color-darkest, #000000);--gv-theme-neutral-color-darker:var(--gv-theme-neutral-color-darker, #bfbfbf);--gv-theme-neutral-color-dark:var(--gv-theme-neutral-color-dark, #d9d9d9);--gv-theme-neutral-color:var(--gv-theme-neutral-color, #f5f5f5);--gv-theme-neutral-color-light:var(--gv-theme-neutral-color-light, #efefef);--gv-theme-neutral-color-lighter:var(--gv-theme-neutral-color-lighter, #fafafa);--gv-theme-neutral-color-lightest:var(--gv-theme-neutral-color-lightest, #ffffff);--gv-theme-font-color-dark:var(--gv-theme-font-color-dark, #262626);--gv-theme-font-color-light:var(--gv-theme-font-color-light, #ffffff);--gv-theme-font-size-xs:var(--gv-theme-font-size-xs, 10px);--gv-theme-font-size-s:var(--gv-theme-font-size-s, 12px);--gv-theme-font-size-m:var(--gv-theme-font-size-m, 14px);--gv-theme-font-size-l:var(--gv-theme-font-size-l, 16px);--gv-theme-font-size-xl:var(--gv-theme-font-size-xl, 26px);--gv-theme-font-size-xxl:var(--gv-theme-font-size-xxl, 30px);--gv-theme-skeleton-color:var(--gv-theme-skeleton-color, #bfbfbf);--gv-theme-font-family:var(--gv-theme-font-family, 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif);--gv-theme-homepage-background-image:var(--gv-theme-homepage-background-image, none);--gv-theme-homepage-background-color:var(--gv-theme-homepage-background-color, #5a7684);--gv-theme-homepage-background-height:var(--gv-theme-homepage-background-height, 400px);--gv-theme-logo:var(--gv-theme-logo, url('/images/gravitee-logo-cyan.svg'));--gv-theme-optional-logo:var(--gv-theme-optional-logo, url('/images/gravitee-logo-white.svg'));--gv-theme-favicon:var(--gv-theme-favicon, '/images/gravitee-favicon.png')}`]}constructor(){super(),this._lastDate=0}handleEvent(e){"gravitee"===e.data.type?(this.source=e.source,this.origin=e.origin,this.isDetached=e.data.isDetached,this._lastDate=e.data.date,e.data.requestAnswer&&this.sendMessage(),e.data.theme?this._theme=e.data.theme:console.warn("Theme not found",e.data)):console.warn("Unknown message",e.data)}getData(){return{type:"gravitee",href:window.location.href,date:Date.now()}}sendMessage(e={},t=0){if(this.source&&this.origin){const t=Object.assign({},this.getData(),e);this.source.postMessage(t,this.origin)}else console.warn("Unknown source & origin for send message")}render(){(0,r.applyTheme)(this._theme)}firstUpdated(){window.addEventListener("message",this.handleEvent.bind(this),!1),window.addEventListener("unload",(e=>{this.isDetached?this.sendMessage({unload:!0}):this.sendMessage(),clearInterval(this.intervalID)})),this.intervalID=setInterval((()=>{this._lastDate-Date.now()<-3e4&&(0,t.dispatchCustomEvent)(this,"error",{message:"Connection for preview has been lost, please close this tab and refresh your browser."})}),3e4)}}exports.GvTheme=o,window.customElements.define("gv-theme",o);
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/atoms/gv-autocomplete");
package/wc/gv-button.js DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/atoms/gv-button");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/molecules/gv-card-full");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/molecules/gv-card-list");
package/wc/gv-card.js DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/molecules/gv-card");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/molecules/gv-category-list");
package/wc/gv-category.js DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/molecules/gv-category");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/charts/gv-chart-bar");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/charts/gv-chart-gauge");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/charts/gv-chart-histogram");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/charts/gv-chart-line");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/charts/gv-chart-map");
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/charts/gv-chart-pie");
package/wc/gv-checkbox.js DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/atoms/gv-checkbox");
package/wc/gv-code.js DELETED
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),require("../src/molecules/gv-code");