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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/package.json +3 -4
  2. package/src/atoms/gv-autocomplete.d.ts +104 -0
  3. package/src/atoms/gv-autocomplete.js +1 -461
  4. package/src/atoms/gv-button.d.ts +109 -0
  5. package/src/atoms/gv-button.js +1 -410
  6. package/src/atoms/gv-checkbox.d.ts +114 -0
  7. package/src/atoms/gv-checkbox.js +1 -187
  8. package/src/atoms/gv-date-picker-calendar.d.ts +190 -0
  9. package/src/atoms/gv-date-picker-calendar.js +1 -894
  10. package/src/atoms/gv-date-picker-cell.d.ts +80 -0
  11. package/src/atoms/gv-date-picker-cell.js +1 -190
  12. package/src/atoms/gv-date-picker.d.ts +194 -0
  13. package/src/atoms/gv-date-picker.js +1 -671
  14. package/src/atoms/gv-file-upload.d.ts +64 -0
  15. package/src/atoms/gv-file-upload.js +1 -367
  16. package/src/atoms/gv-icon.d.ts +26 -0
  17. package/src/atoms/gv-icon.js +1 -103
  18. package/src/atoms/gv-image.d.ts +45 -0
  19. package/src/atoms/gv-image.js +1 -144
  20. package/src/atoms/gv-input-message.d.ts +20 -0
  21. package/src/atoms/gv-input-message.js +1 -84
  22. package/src/atoms/gv-input.d.ts +246 -0
  23. package/src/atoms/gv-input.js +1 -561
  24. package/src/atoms/gv-link.d.ts +67 -0
  25. package/src/atoms/gv-link.js +1 -210
  26. package/src/atoms/gv-message.d.ts +23 -0
  27. package/src/atoms/gv-message.js +1 -128
  28. package/src/atoms/gv-metric.d.ts +32 -0
  29. package/src/atoms/gv-metric.js +1 -117
  30. package/src/atoms/gv-relative-time.d.ts +45 -0
  31. package/src/atoms/gv-relative-time.js +1 -156
  32. package/src/atoms/gv-select-native.d.ts +174 -0
  33. package/src/atoms/gv-select-native.js +1 -388
  34. package/src/atoms/gv-select.d.ts +71 -0
  35. package/src/atoms/gv-select.js +1 -437
  36. package/src/atoms/gv-spinner.d.ts +10 -0
  37. package/src/atoms/gv-spinner.js +1 -57
  38. package/src/atoms/gv-state.d.ts +50 -0
  39. package/src/atoms/gv-state.js +1 -130
  40. package/src/atoms/gv-switch.d.ts +60 -0
  41. package/src/atoms/gv-switch.js +1 -243
  42. package/src/atoms/gv-tag.d.ts +69 -0
  43. package/src/atoms/gv-tag.js +1 -168
  44. package/src/atoms/gv-text.d.ts +110 -0
  45. package/src/atoms/gv-text.js +1 -168
  46. package/src/charts/gv-chart-bar.d.ts +50 -0
  47. package/src/charts/gv-chart-bar.js +1 -103
  48. package/src/charts/gv-chart-gauge.d.ts +58 -0
  49. package/src/charts/gv-chart-gauge.js +1 -100
  50. package/src/charts/gv-chart-histogram.d.ts +48 -0
  51. package/src/charts/gv-chart-histogram.js +1 -83
  52. package/src/charts/gv-chart-line.d.ts +52 -0
  53. package/src/charts/gv-chart-line.js +1 -224
  54. package/src/charts/gv-chart-map.d.ts +50 -0
  55. package/src/charts/gv-chart-map.js +1 -112
  56. package/src/charts/gv-chart-pie.d.ts +50 -0
  57. package/src/charts/gv-chart-pie.js +1 -91
  58. package/src/index.d.ts +77 -0
  59. package/src/index.js +1 -77
  60. package/src/lib/cron-expression.d.ts +1 -0
  61. package/src/lib/cron-expression.js +1 -205
  62. package/src/lib/date.d.ts +1 -0
  63. package/src/lib/date.js +1 -44
  64. package/src/lib/events.d.ts +1 -0
  65. package/src/lib/events.js +1 -26
  66. package/src/lib/http-client-schema-form.d.ts +68 -0
  67. package/src/lib/http-client-schema-form.js +1 -67
  68. package/src/lib/http.d.ts +222 -0
  69. package/src/lib/http.js +1 -237
  70. package/src/lib/i18n.d.ts +30 -0
  71. package/src/lib/i18n.js +1 -103
  72. package/src/lib/item.d.ts +12 -0
  73. package/src/lib/item.js +1 -118
  74. package/src/lib/properties.d.ts +42 -0
  75. package/src/lib/properties.js +1 -189
  76. package/src/lib/schema-form.d.ts +5 -0
  77. package/src/lib/schema-form.js +1 -44
  78. package/src/lib/studio.d.ts +2 -0
  79. package/src/lib/studio.js +1 -141
  80. package/src/lib/style.d.ts +6 -0
  81. package/src/lib/style.js +1 -41
  82. package/src/lib/text-format.d.ts +6 -0
  83. package/src/lib/text-format.js +1 -69
  84. package/src/lib/theme.d.ts +4 -0
  85. package/src/lib/theme.js +1 -63
  86. package/src/lib/utils.d.ts +9 -0
  87. package/src/lib/utils.js +1 -111
  88. package/src/mixins/chart-element.d.ts +39 -0
  89. package/src/mixins/chart-element.js +1 -165
  90. package/src/mixins/input-element.d.ts +64 -0
  91. package/src/mixins/input-element.js +1 -144
  92. package/src/mixins/item-resource.d.ts +56 -0
  93. package/src/mixins/item-resource.js +1 -120
  94. package/src/mixins/keyboard-element.d.ts +25 -0
  95. package/src/mixins/keyboard-element.js +1 -69
  96. package/src/mixins/update-after-browser.d.ts +11 -0
  97. package/src/mixins/update-after-browser.js +1 -30
  98. package/src/mixins/with-resize-observer.d.ts +12 -0
  99. package/src/mixins/with-resize-observer.js +1 -68
  100. package/src/mixins/with-skeleton-attribute.d.ts +35 -0
  101. package/src/mixins/with-skeleton-attribute.js +1 -112
  102. package/src/molecules/gv-card-full.d.ts +78 -0
  103. package/src/molecules/gv-card-full.js +1 -218
  104. package/src/molecules/gv-card-list.d.ts +33 -0
  105. package/src/molecules/gv-card-list.js +1 -113
  106. package/src/molecules/gv-card.d.ts +65 -0
  107. package/src/molecules/gv-card.js +1 -133
  108. package/src/molecules/gv-category-list.d.ts +17 -0
  109. package/src/molecules/gv-category-list.js +1 -60
  110. package/src/molecules/gv-category.d.ts +64 -0
  111. package/src/molecules/gv-category.js +1 -170
  112. package/src/molecules/gv-code.d.ts +192 -0
  113. package/src/molecules/gv-code.js +1 -359
  114. package/src/molecules/gv-confirm.d.ts +60 -0
  115. package/src/molecules/gv-confirm.js +1 -188
  116. package/src/molecules/gv-cron-editor.d.ts +115 -0
  117. package/src/molecules/gv-cron-editor.js +1 -710
  118. package/src/molecules/gv-dropdown-menu.d.ts +28 -0
  119. package/src/molecules/gv-dropdown-menu.js +1 -116
  120. package/src/molecules/gv-expandable.d.ts +37 -0
  121. package/src/molecules/gv-expandable.js +1 -122
  122. package/src/molecules/gv-expression-language.d.ts +150 -0
  123. package/src/molecules/gv-expression-language.js +1 -270
  124. package/src/molecules/gv-identity-picture.d.ts +44 -0
  125. package/src/molecules/gv-identity-picture.js +1 -148
  126. package/src/molecules/gv-list.d.ts +123 -0
  127. package/src/molecules/gv-list.js +1 -227
  128. package/src/molecules/gv-metrics.d.ts +65 -0
  129. package/src/molecules/gv-metrics.js +1 -162
  130. package/src/molecules/gv-modal.d.ts +64 -0
  131. package/src/molecules/gv-modal.js +1 -213
  132. package/src/molecules/gv-nav.d.ts +41 -0
  133. package/src/molecules/gv-nav.js +1 -196
  134. package/src/molecules/gv-option.d.ts +65 -0
  135. package/src/molecules/gv-option.js +1 -242
  136. package/src/molecules/gv-plans.d.ts +73 -0
  137. package/src/molecules/gv-plans.js +1 -429
  138. package/src/molecules/gv-popover.d.ts +91 -0
  139. package/src/molecules/gv-popover.js +1 -351
  140. package/src/molecules/gv-promote.d.ts +108 -0
  141. package/src/molecules/gv-promote.js +1 -209
  142. package/src/molecules/gv-rating-list.d.ts +77 -0
  143. package/src/molecules/gv-rating-list.js +1 -365
  144. package/src/molecules/gv-rating.d.ts +55 -0
  145. package/src/molecules/gv-rating.js +1 -253
  146. package/src/molecules/gv-row-expandable.d.ts +8 -0
  147. package/src/molecules/gv-row-expandable.js +1 -45
  148. package/src/molecules/gv-row.d.ts +37 -0
  149. package/src/molecules/gv-row.js +1 -210
  150. package/src/molecules/gv-stats.d.ts +53 -0
  151. package/src/molecules/gv-stats.js +1 -121
  152. package/src/molecules/gv-stepper.d.ts +46 -0
  153. package/src/molecules/gv-stepper.js +1 -288
  154. package/src/molecules/gv-table.d.ts +159 -0
  155. package/src/molecules/gv-table.js +1 -685
  156. package/src/molecules/gv-tree.d.ts +44 -0
  157. package/src/molecules/gv-tree.js +1 -250
  158. package/src/organisms/gv-documentation.d.ts +52 -0
  159. package/src/organisms/gv-documentation.js +1 -215
  160. package/src/organisms/gv-header.d.ts +60 -0
  161. package/src/organisms/gv-header.js +1 -288
  162. package/src/organisms/gv-http-client.d.ts +57 -0
  163. package/src/organisms/gv-http-client.js +1 -275
  164. package/src/organisms/gv-menu.d.ts +74 -0
  165. package/src/organisms/gv-menu.js +1 -263
  166. package/src/organisms/gv-newsletter-subscription.d.ts +82 -0
  167. package/src/organisms/gv-newsletter-subscription.js +1 -271
  168. package/src/organisms/gv-pagination.d.ts +63 -0
  169. package/src/organisms/gv-pagination.js +1 -198
  170. package/src/organisms/gv-properties.d.ts +229 -0
  171. package/src/organisms/gv-properties.js +1 -920
  172. package/src/organisms/gv-resizable-views.d.ts +33 -0
  173. package/src/organisms/gv-resizable-views.js +1 -396
  174. package/src/organisms/gv-resources.d.ts +125 -0
  175. package/src/organisms/gv-resources.js +1 -535
  176. package/src/organisms/gv-schema-form-array.d.ts +55 -0
  177. package/src/organisms/gv-schema-form-array.js +1 -250
  178. package/src/organisms/gv-schema-form-control-object.d.ts +64 -0
  179. package/src/organisms/gv-schema-form-control-object.js +1 -154
  180. package/src/organisms/gv-schema-form-control.d.ts +90 -0
  181. package/src/organisms/gv-schema-form-control.js +1 -443
  182. package/src/organisms/gv-schema-form.d.ts +156 -0
  183. package/src/organisms/gv-schema-form.js +1 -751
  184. package/src/organisms/gv-tabs.d.ts +56 -0
  185. package/src/organisms/gv-tabs.js +1 -210
  186. package/src/organisms/gv-user-menu.d.ts +56 -0
  187. package/src/organisms/gv-user-menu.js +1 -314
  188. package/src/organisms/gv-vertical-menu.d.ts +28 -0
  189. package/src/organisms/gv-vertical-menu.js +1 -123
  190. package/src/policy-studio/gv-flow-step.d.ts +142 -0
  191. package/src/policy-studio/gv-flow-step.js +1 -464
  192. package/src/policy-studio/gv-flow.d.ts +89 -0
  193. package/src/policy-studio/gv-flow.js +1 -621
  194. package/src/policy-studio/gv-policy-studio-menu.d.ts +94 -0
  195. package/src/policy-studio/gv-policy-studio-menu.js +1 -750
  196. package/src/policy-studio/gv-policy-studio.d.ts +464 -0
  197. package/src/policy-studio/gv-policy-studio.js +1 -1842
  198. package/src/styles/empty.d.ts +1 -0
  199. package/src/styles/empty.js +1 -36
  200. package/src/styles/input.d.ts +1 -0
  201. package/src/styles/input.js +1 -263
  202. package/src/styles/link.d.ts +1 -0
  203. package/src/styles/link.js +1 -32
  204. package/src/styles/shapes.d.ts +2 -0
  205. package/src/styles/shapes.js +1 -17
  206. package/src/styles/skeleton.d.ts +1 -0
  207. package/src/styles/skeleton.js +1 -53
  208. package/src/styles/zoom.d.ts +1 -0
  209. package/src/styles/zoom.js +1 -40
  210. package/src/theme/gv-theme.d.ts +81 -0
  211. package/src/theme/gv-theme.js +1 -203
  212. package/wc/gv-autocomplete.d.ts +1 -0
  213. package/wc/gv-autocomplete.js +1 -1
  214. package/wc/gv-button.d.ts +1 -0
  215. package/wc/gv-button.js +1 -1
  216. package/wc/gv-card-full.d.ts +1 -0
  217. package/wc/gv-card-full.js +1 -1
  218. package/wc/gv-card-list.d.ts +1 -0
  219. package/wc/gv-card-list.js +1 -1
  220. package/wc/gv-card.d.ts +1 -0
  221. package/wc/gv-card.js +1 -1
  222. package/wc/gv-category-list.d.ts +1 -0
  223. package/wc/gv-category-list.js +1 -1
  224. package/wc/gv-category.d.ts +1 -0
  225. package/wc/gv-category.js +1 -1
  226. package/wc/gv-chart-bar.d.ts +1 -0
  227. package/wc/gv-chart-bar.js +1 -1
  228. package/wc/gv-chart-gauge.d.ts +1 -0
  229. package/wc/gv-chart-gauge.js +1 -1
  230. package/wc/gv-chart-histogram.d.ts +1 -0
  231. package/wc/gv-chart-histogram.js +1 -1
  232. package/wc/gv-chart-line.d.ts +1 -0
  233. package/wc/gv-chart-line.js +1 -1
  234. package/wc/gv-chart-map.d.ts +1 -0
  235. package/wc/gv-chart-map.js +1 -1
  236. package/wc/gv-chart-pie.d.ts +1 -0
  237. package/wc/gv-chart-pie.js +1 -1
  238. package/wc/gv-checkbox.d.ts +1 -0
  239. package/wc/gv-checkbox.js +1 -1
  240. package/wc/gv-code.d.ts +1 -0
  241. package/wc/gv-code.js +1 -1
  242. package/wc/gv-confirm.d.ts +1 -0
  243. package/wc/gv-confirm.js +1 -1
  244. package/wc/gv-cron-editor.d.ts +1 -0
  245. package/wc/gv-cron-editor.js +1 -1
  246. package/wc/gv-date-picker-calendar.d.ts +1 -0
  247. package/wc/gv-date-picker-calendar.js +1 -1
  248. package/wc/gv-date-picker-cell.d.ts +1 -0
  249. package/wc/gv-date-picker-cell.js +1 -1
  250. package/wc/gv-date-picker.d.ts +1 -0
  251. package/wc/gv-date-picker.js +1 -1
  252. package/wc/gv-documentation.d.ts +1 -0
  253. package/wc/gv-documentation.js +1 -1
  254. package/wc/gv-dropdown-menu.d.ts +1 -0
  255. package/wc/gv-dropdown-menu.js +1 -1
  256. package/wc/gv-expandable.d.ts +1 -0
  257. package/wc/gv-expandable.js +1 -1
  258. package/wc/gv-expression-language.d.ts +1 -0
  259. package/wc/gv-expression-language.js +1 -1
  260. package/wc/gv-file-upload.d.ts +1 -0
  261. package/wc/gv-file-upload.js +1 -1
  262. package/wc/gv-flow-step.d.ts +1 -0
  263. package/wc/gv-flow-step.js +1 -1
  264. package/wc/gv-flow.d.ts +1 -0
  265. package/wc/gv-flow.js +1 -1
  266. package/wc/gv-header.d.ts +1 -0
  267. package/wc/gv-header.js +1 -1
  268. package/wc/gv-http-client.d.ts +1 -0
  269. package/wc/gv-http-client.js +1 -1
  270. package/wc/gv-icon.d.ts +1 -0
  271. package/wc/gv-icon.js +1 -1
  272. package/wc/gv-identity-picture.d.ts +1 -0
  273. package/wc/gv-identity-picture.js +1 -1
  274. package/wc/gv-image.d.ts +1 -0
  275. package/wc/gv-image.js +1 -1
  276. package/wc/gv-input-message.d.ts +1 -0
  277. package/wc/gv-input-message.js +1 -1
  278. package/wc/gv-input.d.ts +1 -0
  279. package/wc/gv-input.js +1 -1
  280. package/wc/gv-link.d.ts +1 -0
  281. package/wc/gv-link.js +1 -1
  282. package/wc/gv-list.d.ts +1 -0
  283. package/wc/gv-list.js +1 -1
  284. package/wc/gv-menu.d.ts +1 -0
  285. package/wc/gv-menu.js +1 -1
  286. package/wc/gv-message.d.ts +1 -0
  287. package/wc/gv-message.js +1 -1
  288. package/wc/gv-metric.d.ts +1 -0
  289. package/wc/gv-metric.js +1 -1
  290. package/wc/gv-metrics.d.ts +1 -0
  291. package/wc/gv-metrics.js +1 -1
  292. package/wc/gv-modal.d.ts +1 -0
  293. package/wc/gv-modal.js +1 -1
  294. package/wc/gv-nav.d.ts +1 -0
  295. package/wc/gv-nav.js +1 -1
  296. package/wc/gv-newsletter-subscription.d.ts +1 -0
  297. package/wc/gv-newsletter-subscription.js +1 -1
  298. package/wc/gv-option.d.ts +1 -0
  299. package/wc/gv-option.js +1 -1
  300. package/wc/gv-pagination.d.ts +1 -0
  301. package/wc/gv-pagination.js +1 -1
  302. package/wc/gv-plans.d.ts +1 -0
  303. package/wc/gv-plans.js +1 -1
  304. package/wc/gv-policy-studio-menu.d.ts +1 -0
  305. package/wc/gv-policy-studio-menu.js +1 -1
  306. package/wc/gv-policy-studio.d.ts +1 -0
  307. package/wc/gv-policy-studio.js +1 -1
  308. package/wc/gv-popover.d.ts +1 -0
  309. package/wc/gv-popover.js +1 -1
  310. package/wc/gv-promote.d.ts +1 -0
  311. package/wc/gv-promote.js +1 -1
  312. package/wc/gv-properties.d.ts +1 -0
  313. package/wc/gv-properties.js +1 -1
  314. package/wc/gv-rating-list.d.ts +1 -0
  315. package/wc/gv-rating-list.js +1 -1
  316. package/wc/gv-rating.d.ts +1 -0
  317. package/wc/gv-rating.js +1 -1
  318. package/wc/gv-relative-time.d.ts +1 -0
  319. package/wc/gv-relative-time.js +1 -1
  320. package/wc/gv-resizable-views.d.ts +1 -0
  321. package/wc/gv-resizable-views.js +1 -1
  322. package/wc/gv-resources.d.ts +1 -0
  323. package/wc/gv-resources.js +1 -1
  324. package/wc/gv-row-expandable.d.ts +1 -0
  325. package/wc/gv-row-expandable.js +1 -1
  326. package/wc/gv-row.d.ts +1 -0
  327. package/wc/gv-row.js +1 -1
  328. package/wc/gv-schema-form-array.d.ts +1 -0
  329. package/wc/gv-schema-form-array.js +1 -1
  330. package/wc/gv-schema-form-control-object.d.ts +1 -0
  331. package/wc/gv-schema-form-control-object.js +1 -1
  332. package/wc/gv-schema-form-control.d.ts +1 -0
  333. package/wc/gv-schema-form-control.js +1 -1
  334. package/wc/gv-schema-form.d.ts +1 -0
  335. package/wc/gv-schema-form.js +1 -1
  336. package/wc/gv-select-native.d.ts +1 -0
  337. package/wc/gv-select-native.js +1 -1
  338. package/wc/gv-select.d.ts +1 -0
  339. package/wc/gv-select.js +1 -1
  340. package/wc/gv-spinner.d.ts +1 -0
  341. package/wc/gv-spinner.js +1 -1
  342. package/wc/gv-state.d.ts +1 -0
  343. package/wc/gv-state.js +1 -1
  344. package/wc/gv-stats.d.ts +1 -0
  345. package/wc/gv-stats.js +1 -1
  346. package/wc/gv-stepper.d.ts +1 -0
  347. package/wc/gv-stepper.js +1 -1
  348. package/wc/gv-switch.d.ts +1 -0
  349. package/wc/gv-switch.js +1 -1
  350. package/wc/gv-table.d.ts +1 -0
  351. package/wc/gv-table.js +1 -1
  352. package/wc/gv-tabs.d.ts +1 -0
  353. package/wc/gv-tabs.js +1 -1
  354. package/wc/gv-tag.d.ts +1 -0
  355. package/wc/gv-tag.js +1 -1
  356. package/wc/gv-text.d.ts +1 -0
  357. package/wc/gv-text.js +1 -1
  358. package/wc/gv-theme.d.ts +1 -0
  359. package/wc/gv-theme.js +1 -1
  360. package/wc/gv-tree.d.ts +1 -0
  361. package/wc/gv-tree.js +1 -1
  362. package/wc/gv-user-menu.d.ts +1 -0
  363. package/wc/gv-user-menu.js +1 -1
  364. package/wc/gv-vertical-menu.d.ts +1 -0
  365. package/wc/gv-vertical-menu.js +1 -1
  366. package/CHANGELOG.md +0 -1292
  367. package/LICENSE.txt +0 -202
  368. package/README.md +0 -195
  369. package/src/.eslintrc.js +0 -19
  370. package/src/theme/definition.json +0 -1762
@@ -1,388 +1 @@
1
- /*
2
- * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { classMap } from 'lit/directives/class-map';
17
- import { ifDefined } from 'lit/directives/if-defined';
18
- import { repeat } from 'lit/directives/repeat';
19
-
20
- import { css, html, LitElement } from 'lit';
21
- import { skeleton } from '../styles/skeleton';
22
- import { link } from '../styles/link';
23
- import { input } from '../styles/input';
24
- import { dispatchCustomEvent } from '../lib/events';
25
- import { InputElement } from '../mixins/input-element';
26
- import { i18n } from '../lib/i18n';
27
-
28
- /**
29
- * A select native component.
30
- *
31
- * @fires gv-select:select - Event when user select a value (deprecated, use gv-select:input)
32
- * @fires gv-select:input - Event when user select a value
33
- *
34
- * @attr {Boolean} disabled - same as native select element `disabled` attribute
35
- * @attr {Boolean} required - same as native select element `required` attribute
36
- * @attr {Boolean} skeleton - enable skeleton screen UI pattern (loading hint)
37
- * @attr {Array} options - the options of the select
38
- * @attr {String | Array} value - the value of the select
39
- * @attr {String} label - label of the select
40
- * @attr {String} title - title of the select
41
- * @attr {String} name - name of the select
42
- * @attr {String} placeholder - an example value to display in the select when empty
43
- * @attr {String} description - a description
44
- * @attr {Boolean} multiple - enable multiple selection
45
- *
46
- * @cssprop {Color} [--gv-select--bgc=var(--gv-theme-neutral-color-lightest, #ffffff)] - Background color
47
- * @cssprop {Color} [--gv-select--bdc=var(--gv-theme-neutral-color-dark, #d9d9d9)] - Border color
48
- * @cssprop {Color} [--gv-select--c=var(--gv-theme-font-color-dark, #262626)] - Color
49
- * @cssprop {Color} [--gv-select-hover--bgc=var(--gv-theme-color-light, #86c3d0)] - Hover background color
50
- * @cssprop {Color} [--gv-select-selected--bgc=var(--gv-theme-neutral-color-light, #efefef)] - Selected background color
51
- */
52
- export class GvSelectNative extends InputElement(LitElement) {
53
- static get properties() {
54
- return {
55
- ...super.properties,
56
- options: { type: Array },
57
- _options: { type: Array, attribute: false },
58
- large: { type: Boolean },
59
- medium: { type: Boolean },
60
- small: { type: Boolean },
61
- value: { type: String | Array },
62
- label: { type: String },
63
- title: { type: String },
64
- name: { type: String },
65
- placeholder: { type: String },
66
- description: { type: String },
67
- multiple: { type: Boolean, reflect: true },
68
- };
69
- }
70
-
71
- static get styles() {
72
- return [
73
- ...super.styles,
74
- skeleton,
75
- input,
76
- link,
77
- // language=CSS
78
- css`
79
- .box {
80
- --bdc: var(--gv-select--bdc, var(--gv-theme-neutral-color-dark, #d9d9d9));
81
- --c: var(--gv-select--c, var(--gv-theme-font-color-dark, #262626));
82
- --bgc: var(--gv-select--bgc, var(--gv-theme-neutral-color-lightest, #ffffff));
83
- --bgc-list: var(--gv-select--list-bgc, var(--gv-select--bgc, var(--gv-theme-neutral-color-lightest, #ffffff)));
84
- --hover-bgc: var(--gv-select-hover--bgc, var(--gv-theme-color-light, #86c3d0));
85
- --selected-bgc: var(--gv-select-selected--bgc, var(--gv-theme-neutral-color-light, #efefef));
86
- position: relative;
87
- color: var(--c);
88
- }
89
-
90
- :host([readonly]) div,
91
- :host([readonly]) input,
92
- :host([readonly]) input:read-only:hover {
93
- user-select: auto;
94
- cursor: text;
95
- }
96
-
97
- input:read-only:hover {
98
- cursor: pointer;
99
- }
100
-
101
- label {
102
- color: var(--c);
103
- }
104
-
105
- select,
106
- .multiple .input {
107
- background-image: linear-gradient(45deg, transparent 50%, var(--c) 50%), linear-gradient(135deg, var(--c) 50%, transparent 50%),
108
- linear-gradient(to right, #ccc, #ccc);
109
- background-position: calc(100% - 17px) calc(1em + 2px), calc(100% - 12px) calc(1em + 2px), calc(100% - 2.5em) 0.5em;
110
- background-size: 5px 5px, 5px 5px, 1px 1.5em;
111
- background-repeat: no-repeat;
112
- -webkit-appearance: none;
113
- appearance: none;
114
- background-color: var(--bgc);
115
- }
116
-
117
- .multiple .input {
118
- padding-right: 35px;
119
- text-overflow: ellipsis;
120
- white-space: nowrap;
121
- overflow: hidden;
122
- }
123
-
124
- .multiple gv-icon {
125
- display: none;
126
- }
127
-
128
- .multiple.not-empty :not(.show) .input {
129
- background-image: none, linear-gradient(155deg, var(--c) 0%, transparent 0%), linear-gradient(to right, #ccc, #ccc);
130
- }
131
- .multiple.not-empty gv-icon {
132
- display: block;
133
- }
134
-
135
- .small .multiple .input {
136
- padding-right: 30px;
137
- }
138
-
139
- .small select,
140
- .small.multiple .input {
141
- background-position: calc(100% - 16px) calc(0.8em), calc(100% - 11px) calc(0.8em), calc(100% - 2.5em) 0.5em;
142
- background-size: 5px 5px, 5px 5px, 1px 1em;
143
- }
144
-
145
- .multiple select {
146
- opacity: 0;
147
- position: absolute;
148
- left: 0;
149
- top: 0;
150
- max-height: var(--input-medium--h);
151
- }
152
-
153
- .multiple .show {
154
- min-height: 75px;
155
- }
156
-
157
- .multiple .show select {
158
- opacity: 1;
159
- z-index: 1000;
160
- max-height: 300px;
161
- }
162
-
163
- gv-icon {
164
- --gv-icon--s: 19px;
165
- }
166
-
167
- .medium gv-icon {
168
- --gv-icon--s: 14px;
169
- }
170
-
171
- .small gv-icon {
172
- --gv-icon--s: 11px;
173
- }
174
- `,
175
- ];
176
- }
177
-
178
- constructor() {
179
- super();
180
- this._options = [{ label: '', value: '', disabled: false, title: null }];
181
- }
182
-
183
- getInputElement() {
184
- return this.shadowRoot.querySelector('select');
185
- }
186
-
187
- async firstUpdated(changedProperties) {
188
- super.firstUpdated(changedProperties);
189
- // Give the browser a chance to paint
190
- await new Promise((resolve) => setTimeout(resolve, 0));
191
- const input = this.getInputElement();
192
- if (input) {
193
- input.addEventListener('input', this._onInput.bind(this));
194
- if (this.multiple) {
195
- input.addEventListener('mousedown', this._onEnter.bind(this));
196
- input.addEventListener('focus', this._onEnter.bind(this));
197
- input.addEventListener('mouseleave', this._onLeave.bind(this));
198
- input.addEventListener('blur', this._onLeave.bind(this));
199
- }
200
- }
201
- }
202
-
203
- willUpdate(changedProperties) {
204
- if (changedProperties.has('value')) {
205
- this.updateState(this.value);
206
- }
207
- }
208
-
209
- updateState(value) {
210
- super.updateState(value);
211
- if (value && this._options && this.valid) {
212
- if (this.multiple) {
213
- if (this.required) {
214
- this.setValidity(value.length === 0, 'field is required');
215
- }
216
- if (value.length > 0 && this.valid) {
217
- const possibleValues = this._options.map((o) => o.value);
218
- this.setValidity(!value.some((v) => possibleValues.includes(v)), 'value is not included in the possible values');
219
- }
220
- } else {
221
- this.setValidity(
222
- this.required && this._options.find((option) => option.value === value) == null,
223
- 'value is not included in the possible values',
224
- );
225
- }
226
- this.invalid = !this.valid;
227
- }
228
- }
229
-
230
- _onEnter(e) {
231
- const input = this.getInputElement();
232
- if (!input.parentNode.classList.contains('show')) {
233
- e.stopPropagation();
234
- e.preventDefault();
235
- input.parentNode.classList.add('show');
236
- }
237
- }
238
-
239
- _onLeave() {
240
- this.getInputElement().parentNode.classList.remove('show');
241
- }
242
-
243
- _onInput(e) {
244
- e.stopPropagation();
245
- if (this.multiple) {
246
- const options = this.getInputElement().querySelectorAll('option:checked');
247
- this.value = Array.from(options).map((o) => o.value);
248
- } else {
249
- this.value = e.target.value;
250
- }
251
- this.updateState(this.value);
252
- dispatchCustomEvent(this, 'select', this.value);
253
- dispatchCustomEvent(this, 'input', this.value);
254
- this.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
255
- }
256
-
257
- _onClear() {
258
- Array.from(this.getInputElement().querySelectorAll('option:checked')).forEach((option) => option.removeAttribute('checked'));
259
- this.value = [];
260
- dispatchCustomEvent(this, 'select', this.value);
261
- dispatchCustomEvent(this, 'input', this.value);
262
- this.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
263
- }
264
-
265
- set options(options) {
266
- if (options) {
267
- this._options = options.map((option) => {
268
- if (typeof option !== 'object') {
269
- return { value: option, label: option };
270
- } else if (!option.label) {
271
- return { value: option.value, label: option.value };
272
- }
273
- return option;
274
- });
275
- }
276
- }
277
-
278
- selectedLabel() {
279
- if (this.value != null) {
280
- const elements = this._options.filter((o) => this.isSelected(o));
281
- if (elements) {
282
- return elements.map((e) => e.label).join(', ');
283
- }
284
- }
285
- return '';
286
- }
287
-
288
- renderSelect() {
289
- const selectedLabel = this.selectedLabel();
290
- if (this.readonly) {
291
- return html`
292
- <input
293
- id=${this._id}
294
- type="text"
295
- .name=${ifDefined(this.name)}
296
- .title=${ifDefined(selectedLabel || this.title || this.label)}
297
- .required=${this.required}
298
- aria-required=${!!this.required}
299
- .placeholder=${ifDefined(this.placeholder)}
300
- .value=${selectedLabel}
301
- readonly="readonly"
302
- />
303
- `;
304
- } else if (this.multiple) {
305
- const height = this._options ? this._options.length * (this.small ? 20 : 25) : 50;
306
- return html`
307
- <input
308
- class="input"
309
- type="text"
310
- .name=${ifDefined(this.name)}
311
- .title=${ifDefined(selectedLabel || this.title || this.label)}
312
- .required=${this.required}
313
- aria-required=${!!this.required}
314
- .placeholder=${ifDefined(this.placeholder)}
315
- .value=${selectedLabel}
316
- readonly="readonly"
317
- />
318
- <select
319
- class="input"
320
- id=${this._id}
321
- .name=${ifDefined(this.name)}
322
- .title=${ifDefined(selectedLabel || this.title || this.label)}
323
- .required=${this.required}
324
- aria-required=${!!this.required}
325
- ?disabled=${this.disabled || this.skeleton}
326
- .placeholder=${ifDefined(this.placeholder)}
327
- multiple
328
- .size="${this._options.length}"
329
- style="height: ${height}px"
330
- >
331
- ${this._options &&
332
- repeat(
333
- this._options,
334
- (option) => option,
335
- (option) => html` <option value="${option.value || ''}" ?selected="${this.isSelected(option)}">${option.label}</option> `,
336
- )}
337
- </select>
338
- <div class="box-icon box-icon-clear">
339
- <gv-icon class="link" shape="code:error" title="${i18n('gv-input.clear')}" @click="${this._onClear}"></gv-icon>
340
- </div>
341
- `;
342
- } else {
343
- return html`<select
344
- class="input"
345
- id=${this._id}
346
- .name=${ifDefined(this.name)}
347
- .title=${ifDefined(selectedLabel || this.title || this.label)}
348
- .required=${this.required}
349
- aria-required=${!!this.required}
350
- ?disabled=${this.disabled || this.skeleton}
351
- .placeholder=${ifDefined(this.placeholder)}
352
- >
353
- ${this._options &&
354
- repeat(
355
- this._options,
356
- (option) => option,
357
- (option) => html` <option value="${option.value || ''}" ?selected="${this.isSelected(option)}">${option.label}</option>`,
358
- )}
359
- </select>`;
360
- }
361
- }
362
-
363
- render() {
364
- const classes = {
365
- box: true,
366
- large: this.large,
367
- medium: this.medium || (!this.large && !this.small),
368
- small: this.small,
369
- skeleton: this.skeleton,
370
- required: this.required,
371
- multiple: this.multiple,
372
- 'not-empty': this._options && this.multiple && this.value && this.value.length > 0,
373
- };
374
-
375
- return html`
376
- <div class="${classMap(classes)}">
377
- <div class="box-input">${this.renderLabel()} ${this.renderSelect()}</div>
378
- </div>
379
- ${this.description != null ? html`<div class="description" .innerHTML="${this.description}"></div>` : ''}
380
- `;
381
- }
382
-
383
- isSelected(option) {
384
- return this.multiple ? this.value && this.value.includes(option.value) : '' + this.value === '' + option.value;
385
- }
386
- }
387
-
388
- window.customElements.define('gv-select-native', GvSelectNative);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvSelectNative=void 0;const e=require("lit/directives/class-map"),t=require("lit/directives/if-defined"),i=require("lit/directives/repeat"),l=require("lit"),s=require("../styles/skeleton"),n=require("../styles/link"),a=require("../styles/input"),r=require("../lib/events"),o=require("../mixins/input-element"),c=require("../lib/i18n");class p extends((0,o.InputElement)(l.LitElement)){static get properties(){return{...super.properties,options:{type:Array},_options:{type:Array,attribute:!1},large:{type:Boolean},medium:{type:Boolean},small:{type:Boolean},value:{type:String|Array},label:{type:String},title:{type:String},name:{type:String},placeholder:{type:String},description:{type:String},multiple:{type:Boolean,reflect:!0}}}static get styles(){return[...super.styles,s.skeleton,a.input,n.link,l.css`.box{--bdc:var(--gv-select--bdc, var(--gv-theme-neutral-color-dark, #d9d9d9));--c:var(--gv-select--c, var(--gv-theme-font-color-dark, #262626));--bgc:var(--gv-select--bgc, var(--gv-theme-neutral-color-lightest, #ffffff));--bgc-list:var(--gv-select--list-bgc, var(--gv-select--bgc, var(--gv-theme-neutral-color-lightest, #ffffff)));--hover-bgc:var(--gv-select-hover--bgc, var(--gv-theme-color-light, #86c3d0));--selected-bgc:var(--gv-select-selected--bgc, var(--gv-theme-neutral-color-light, #efefef));position:relative;color:var(--c)}:host([readonly]) div,:host([readonly]) input,:host([readonly]) input:read-only:hover{user-select:auto;cursor:text}input:read-only:hover{cursor:pointer}label{color:var(--c)}.multiple .input,select{background-image:linear-gradient(45deg,transparent 50%,var(--c) 50%),linear-gradient(135deg,var(--c) 50%,transparent 50%),linear-gradient(to right,#ccc,#ccc);background-position:calc(100% - 17px) calc(1em + 2px),calc(100% - 12px) calc(1em + 2px),calc(100% - 2.5em) .5em;background-size:5px 5px,5px 5px,1px 1.5em;background-repeat:no-repeat;-webkit-appearance:none;appearance:none;background-color:var(--bgc)}.multiple .input{padding-right:35px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.multiple gv-icon{display:none}.multiple.not-empty :not(.show) .input{background-image:none,linear-gradient(155deg,var(--c) 0,transparent 0),linear-gradient(to right,#ccc,#ccc)}.multiple.not-empty gv-icon{display:block}.small .multiple .input{padding-right:30px}.small select,.small.multiple .input{background-position:calc(100% - 16px) calc(.8em),calc(100% - 11px) calc(.8em),calc(100% - 2.5em) .5em;background-size:5px 5px,5px 5px,1px 1em}.multiple select{opacity:0;position:absolute;left:0;top:0;max-height:var(--input-medium--h)}.multiple .show{min-height:75px}.multiple .show select{opacity:1;z-index:1000;max-height:300px}gv-icon{--gv-icon--s:19px}.medium gv-icon{--gv-icon--s:14px}.small gv-icon{--gv-icon--s:11px}`]}constructor(){super(),this._options=[{label:"",value:"",disabled:!1,title:null}]}getInputElement(){return this.shadowRoot.querySelector("select")}async firstUpdated(e){super.firstUpdated(e),await new Promise((e=>setTimeout(e,0)));const t=this.getInputElement();t&&(t.addEventListener("input",this._onInput.bind(this)),this.multiple&&(t.addEventListener("mousedown",this._onEnter.bind(this)),t.addEventListener("focus",this._onEnter.bind(this)),t.addEventListener("mouseleave",this._onLeave.bind(this)),t.addEventListener("blur",this._onLeave.bind(this))))}willUpdate(e){e.has("value")&&this.updateState(this.value)}updateState(e){if(super.updateState(e),e&&this._options&&this.valid){if(this.multiple){if(this.required&&this.setValidity(0===e.length,"field is required"),e.length>0&&this.valid){const t=this._options.map((e=>e.value));this.setValidity(!e.some((e=>t.includes(e))),"value is not included in the possible values")}}else this.setValidity(this.required&&null==this._options.find((t=>t.value===e)),"value is not included in the possible values");this.invalid=!this.valid}}_onEnter(e){const t=this.getInputElement();t.parentNode.classList.contains("show")||(e.stopPropagation(),e.preventDefault(),t.parentNode.classList.add("show"))}_onLeave(){this.getInputElement().parentNode.classList.remove("show")}_onInput(e){if(e.stopPropagation(),this.multiple){const e=this.getInputElement().querySelectorAll("option:checked");this.value=Array.from(e).map((e=>e.value))}else this.value=e.target.value;this.updateState(this.value),(0,r.dispatchCustomEvent)(this,"select",this.value),(0,r.dispatchCustomEvent)(this,"input",this.value),this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}_onClear(){Array.from(this.getInputElement().querySelectorAll("option:checked")).forEach((e=>e.removeAttribute("checked"))),this.value=[],(0,r.dispatchCustomEvent)(this,"select",this.value),(0,r.dispatchCustomEvent)(this,"input",this.value),this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0}))}set options(e){e&&(this._options=e.map((e=>"object"!=typeof e?{value:e,label:e}:e.label?e:{value:e.value,label:e.value})))}selectedLabel(){if(null!=this.value){const e=this._options.filter((e=>this.isSelected(e)));if(e)return e.map((e=>e.label)).join(", ")}return""}renderSelect(){const e=this.selectedLabel();if(this.readonly)return l.html`<input id="${this._id}" type="text" .name="${(0,t.ifDefined)(this.name)}" .title="${(0,t.ifDefined)(e||this.title||this.label)}" .required="${this.required}" aria-required="${!!this.required}" .placeholder="${(0,t.ifDefined)(this.placeholder)}" .value="${e}" readonly="readonly">`;if(this.multiple){const s=this._options?this._options.length*(this.small?20:25):50;return l.html`<input class="input" type="text" .name="${(0,t.ifDefined)(this.name)}" .title="${(0,t.ifDefined)(e||this.title||this.label)}" .required="${this.required}" aria-required="${!!this.required}" .placeholder="${(0,t.ifDefined)(this.placeholder)}" .value="${e}" readonly="readonly"> <select class="input" id="${this._id}" .name="${(0,t.ifDefined)(this.name)}" .title="${(0,t.ifDefined)(e||this.title||this.label)}" .required="${this.required}" aria-required="${!!this.required}" ?disabled="${this.disabled||this.skeleton}" .placeholder="${(0,t.ifDefined)(this.placeholder)}" multiple="multiple" .size="${this._options.length}" style="height:${s}">${this._options&&(0,i.repeat)(this._options,(e=>e),(e=>l.html`<option value="${e.value||""}" ?selected="${this.isSelected(e)}">${e.label}</option>`))}</select><div class="box-icon box-icon-clear"><gv-icon class="link" shape="code:error" title="${(0,c.i18n)("gv-input.clear")}" @click="${this._onClear}"></gv-icon></div>`}return l.html`<select class="input" id="${this._id}" .name="${(0,t.ifDefined)(this.name)}" .title="${(0,t.ifDefined)(e||this.title||this.label)}" .required="${this.required}" aria-required="${!!this.required}" ?disabled="${this.disabled||this.skeleton}" .placeholder="${(0,t.ifDefined)(this.placeholder)}">${this._options&&(0,i.repeat)(this._options,(e=>e),(e=>l.html`<option value="${e.value||""}" ?selected="${this.isSelected(e)}">${e.label}</option>`))}</select>`}render(){const t={box:!0,large:this.large,medium:this.medium||!this.large&&!this.small,small:this.small,skeleton:this.skeleton,required:this.required,multiple:this.multiple,"not-empty":this._options&&this.multiple&&this.value&&this.value.length>0};return l.html`<div class="${(0,e.classMap)(t)}"><div class="box-input">${this.renderLabel()} ${this.renderSelect()}</div></div>${null!=this.description?l.html`<div class="description" .innerHTML="${this.description}"></div>`:""}`}isSelected(e){return this.multiple?this.value&&this.value.includes(e.value):""+this.value==""+e.value}}exports.GvSelectNative=p,window.customElements.define("gv-select-native",p);
@@ -0,0 +1,71 @@
1
+ declare const GvSelect_base: {
2
+ new (): {
3
+ [x: string]: any;
4
+ _onResize({ width }: {
5
+ width: any;
6
+ }): void;
7
+ connectedCallback(): Promise<void>;
8
+ _unobserveResize: (() => any) | undefined;
9
+ disconnectedCallback(): void;
10
+ };
11
+ [x: string]: any;
12
+ };
13
+ /**
14
+ * A select component, is more like a list box...
15
+ * ⚠️ Please use `<gv-select-native>` component if you don't need strong customization.
16
+ * ⚠️ DO NO USE IT inside a `<gv-table>` component to avoid any scroll or overlapping issue.
17
+ *
18
+ * ## Details
19
+ * * has @theme facet
20
+ *
21
+ * @fires gv-select:select - Event when user select a value (deprecated, use gv-select:input)
22
+ * @fires gv-select:input - Event when user select a value
23
+ *
24
+ * @attr {Boolean} disabled - same as native select element `disabled` attribute
25
+ * @attr {Boolean} required - same as native select element `required` attribute
26
+ * @attr {Boolean} skeleton - enable skeleton screen UI pattern (loading hint)
27
+ * @attr {Array} options - the options of the select
28
+ * @attr {String | Array} value - the value of the select
29
+ * @attr {String} label - label of the select
30
+ * @attr {String} title - title of the select
31
+ * @attr {String} name - name of the select
32
+ * @attr {String} placeholder - an example value to display in the select when empty
33
+ * @attr {String} description - a description
34
+ * @attr {Boolean} multiple - enable multiple selection
35
+ *
36
+ * @cssprop {Color} [--gv-select--bgc=var(--gv-theme-neutral-color-lightest, #ffffff)] - Background color
37
+ * @cssprop {Color} [--gv-select--list-bgc=var(--gv-select--bgc, var(--gv-theme-neutral-color-lightest, #ffffff))] - List items background color
38
+ * @cssprop {Color} [--gv-select--bdc=var(--gv-theme-neutral-color-dark, #d9d9d9)] - Border color
39
+ * @cssprop {Color} [--gv-select--c=var(--gv-theme-font-color-dark, #262626)] - Color
40
+ * @cssprop {Color} [--gv-select-hover--bgc=var(--gv-theme-color-light, #86c3d0)] - Hover background color
41
+ * @cssprop {Color} [--gv-select-selected--bgc=var(--gv-theme-neutral-color-light, #efefef)] - Selected background color
42
+ */
43
+ export class GvSelect extends GvSelect_base {
44
+ static get properties(): any;
45
+ static get styles(): any[];
46
+ _type: string;
47
+ _isClosed: boolean;
48
+ _options: {
49
+ label: string;
50
+ value: string;
51
+ disabled: boolean;
52
+ title: null;
53
+ }[];
54
+ _handleDocumentClick: () => void;
55
+ willUpdate(changedProperties: any): void;
56
+ updateState(value: any): void;
57
+ invalid: boolean | undefined;
58
+ close(): void;
59
+ _onDocumentClick(): void;
60
+ _onClick(e: any): void;
61
+ _onSelect(option: any, e: any): void;
62
+ value: any;
63
+ _onClear(): void;
64
+ _renderIcon(): "" | import("lit-html").TemplateResult<1>;
65
+ set options(arg: any);
66
+ selectedLabel(): string;
67
+ onResize(): void;
68
+ render(): import("lit-html").TemplateResult<1>;
69
+ isSelected(option: any): any;
70
+ }
71
+ export {};