@gravitee/ui-components 3.25.3-typescript-ad6021f → 3.25.3-typescript-bfd8f67

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 (188) hide show
  1. package/package.json +5 -8
  2. package/src/atoms/gv-autocomplete.js +1 -461
  3. package/src/atoms/gv-button.js +1 -410
  4. package/src/atoms/gv-checkbox.js +1 -187
  5. package/src/atoms/gv-date-picker-calendar.js +1 -894
  6. package/src/atoms/gv-date-picker-cell.js +1 -190
  7. package/src/atoms/gv-date-picker.js +1 -671
  8. package/src/atoms/gv-file-upload.js +1 -367
  9. package/src/atoms/gv-icon.js +1 -103
  10. package/src/atoms/gv-image.js +1 -144
  11. package/src/atoms/gv-input-message.js +1 -84
  12. package/src/atoms/gv-input.js +1 -561
  13. package/src/atoms/gv-link.js +1 -210
  14. package/src/atoms/gv-message.js +1 -128
  15. package/src/atoms/gv-metric.js +1 -117
  16. package/src/atoms/gv-relative-time.js +1 -156
  17. package/src/atoms/gv-select-native.js +1 -388
  18. package/src/atoms/gv-select.js +1 -437
  19. package/src/atoms/gv-spinner.js +1 -57
  20. package/src/atoms/gv-state.js +1 -130
  21. package/src/atoms/gv-switch.js +1 -243
  22. package/src/atoms/gv-tag.js +1 -168
  23. package/src/atoms/gv-text.js +1 -168
  24. package/src/charts/gv-chart-bar.js +1 -103
  25. package/src/charts/gv-chart-gauge.js +1 -100
  26. package/src/charts/gv-chart-histogram.js +1 -83
  27. package/src/charts/gv-chart-line.js +1 -224
  28. package/src/charts/gv-chart-map.js +1 -112
  29. package/src/charts/gv-chart-pie.js +1 -91
  30. package/src/index.js +1 -77
  31. package/src/lib/cron-expression.js +1 -205
  32. package/src/lib/date.js +1 -44
  33. package/src/lib/events.js +1 -26
  34. package/src/lib/http-client-schema-form.js +1 -67
  35. package/src/lib/http.js +1 -237
  36. package/src/lib/i18n.js +1 -103
  37. package/src/lib/item.js +1 -118
  38. package/src/lib/properties.js +1 -189
  39. package/src/lib/schema-form.js +1 -44
  40. package/src/lib/studio.js +1 -141
  41. package/src/lib/style.js +1 -41
  42. package/src/lib/text-format.js +1 -69
  43. package/src/lib/theme.js +1 -63
  44. package/src/lib/utils.js +1 -111
  45. package/src/mixins/chart-element.js +1 -165
  46. package/src/mixins/input-element.js +1 -144
  47. package/src/mixins/item-resource.js +1 -120
  48. package/src/mixins/keyboard-element.js +1 -69
  49. package/src/mixins/update-after-browser.js +1 -30
  50. package/src/mixins/with-resize-observer.js +1 -68
  51. package/src/mixins/with-skeleton-attribute.js +1 -112
  52. package/src/molecules/gv-card-full.js +1 -218
  53. package/src/molecules/gv-card-list.js +1 -113
  54. package/src/molecules/gv-card.js +1 -133
  55. package/src/molecules/gv-category-list.js +1 -60
  56. package/src/molecules/gv-category.js +1 -170
  57. package/src/molecules/gv-code.js +1 -359
  58. package/src/molecules/gv-confirm.js +1 -188
  59. package/src/molecules/gv-cron-editor.js +1 -710
  60. package/src/molecules/gv-dropdown-menu.js +1 -116
  61. package/src/molecules/gv-expandable.js +1 -122
  62. package/src/molecules/gv-expression-language.js +1 -270
  63. package/src/molecules/gv-identity-picture.js +1 -148
  64. package/src/molecules/gv-list.js +1 -227
  65. package/src/molecules/gv-metrics.js +1 -162
  66. package/src/molecules/gv-modal.js +1 -213
  67. package/src/molecules/gv-nav.js +1 -196
  68. package/src/molecules/gv-option.js +1 -242
  69. package/src/molecules/gv-plans.js +1 -429
  70. package/src/molecules/gv-popover.js +1 -351
  71. package/src/molecules/gv-promote.js +1 -209
  72. package/src/molecules/gv-rating-list.js +1 -365
  73. package/src/molecules/gv-rating.js +1 -253
  74. package/src/molecules/gv-row-expandable.js +1 -45
  75. package/src/molecules/gv-row.js +1 -210
  76. package/src/molecules/gv-stats.js +1 -121
  77. package/src/molecules/gv-stepper.js +1 -288
  78. package/src/molecules/gv-table.js +1 -685
  79. package/src/molecules/gv-tree.js +1 -250
  80. package/src/organisms/gv-documentation.js +1 -215
  81. package/src/organisms/gv-header.js +1 -288
  82. package/src/organisms/gv-http-client.js +1 -275
  83. package/src/organisms/gv-menu.js +1 -263
  84. package/src/organisms/gv-newsletter-subscription.js +1 -271
  85. package/src/organisms/gv-pagination.js +1 -198
  86. package/src/organisms/gv-properties.js +1 -920
  87. package/src/organisms/gv-resizable-views.js +1 -396
  88. package/src/organisms/gv-resources.js +1 -535
  89. package/src/organisms/gv-schema-form-array.js +1 -250
  90. package/src/organisms/gv-schema-form-control-object.js +1 -154
  91. package/src/organisms/gv-schema-form-control.js +1 -443
  92. package/src/organisms/gv-schema-form.js +1 -751
  93. package/src/organisms/gv-tabs.js +1 -210
  94. package/src/organisms/gv-user-menu.js +1 -314
  95. package/src/organisms/gv-vertical-menu.js +1 -123
  96. package/src/policy-studio/gv-flow-step.js +1 -464
  97. package/src/policy-studio/gv-flow.js +1 -621
  98. package/src/policy-studio/gv-policy-studio-menu.js +1 -750
  99. package/src/policy-studio/gv-policy-studio.js +1 -1842
  100. package/src/styles/empty.js +1 -36
  101. package/src/styles/input.js +1 -263
  102. package/src/styles/link.js +1 -32
  103. package/src/styles/shapes.js +1 -17
  104. package/src/styles/skeleton.js +1 -53
  105. package/src/styles/zoom.js +1 -40
  106. package/src/theme/gv-theme.js +1 -203
  107. package/wc/gv-autocomplete.js +1 -1
  108. package/wc/gv-button.js +1 -1
  109. package/wc/gv-card-full.js +1 -1
  110. package/wc/gv-card-list.js +1 -1
  111. package/wc/gv-card.js +1 -1
  112. package/wc/gv-category-list.js +1 -1
  113. package/wc/gv-category.js +1 -1
  114. package/wc/gv-chart-bar.js +1 -1
  115. package/wc/gv-chart-gauge.js +1 -1
  116. package/wc/gv-chart-histogram.js +1 -1
  117. package/wc/gv-chart-line.js +1 -1
  118. package/wc/gv-chart-map.js +1 -1
  119. package/wc/gv-chart-pie.js +1 -1
  120. package/wc/gv-checkbox.js +1 -1
  121. package/wc/gv-code.js +1 -1
  122. package/wc/gv-confirm.js +1 -1
  123. package/wc/gv-cron-editor.js +1 -1
  124. package/wc/gv-date-picker-calendar.js +1 -1
  125. package/wc/gv-date-picker-cell.js +1 -1
  126. package/wc/gv-date-picker.js +1 -1
  127. package/wc/gv-documentation.js +1 -1
  128. package/wc/gv-dropdown-menu.js +1 -1
  129. package/wc/gv-expandable.js +1 -1
  130. package/wc/gv-expression-language.js +1 -1
  131. package/wc/gv-file-upload.js +1 -1
  132. package/wc/gv-flow-step.js +1 -1
  133. package/wc/gv-flow.js +1 -1
  134. package/wc/gv-header.js +1 -1
  135. package/wc/gv-http-client.js +1 -1
  136. package/wc/gv-icon.js +1 -1
  137. package/wc/gv-identity-picture.js +1 -1
  138. package/wc/gv-image.js +1 -1
  139. package/wc/gv-input-message.js +1 -1
  140. package/wc/gv-input.js +1 -1
  141. package/wc/gv-link.js +1 -1
  142. package/wc/gv-list.js +1 -1
  143. package/wc/gv-menu.js +1 -1
  144. package/wc/gv-message.js +1 -1
  145. package/wc/gv-metric.js +1 -1
  146. package/wc/gv-metrics.js +1 -1
  147. package/wc/gv-modal.js +1 -1
  148. package/wc/gv-nav.js +1 -1
  149. package/wc/gv-newsletter-subscription.js +1 -1
  150. package/wc/gv-option.js +1 -1
  151. package/wc/gv-pagination.js +1 -1
  152. package/wc/gv-plans.js +1 -1
  153. package/wc/gv-policy-studio-menu.js +1 -1
  154. package/wc/gv-policy-studio.js +1 -1
  155. package/wc/gv-popover.js +1 -1
  156. package/wc/gv-promote.js +1 -1
  157. package/wc/gv-properties.js +1 -1
  158. package/wc/gv-rating-list.js +1 -1
  159. package/wc/gv-rating.js +1 -1
  160. package/wc/gv-relative-time.js +1 -1
  161. package/wc/gv-resizable-views.js +1 -1
  162. package/wc/gv-resources.js +1 -1
  163. package/wc/gv-row-expandable.js +1 -1
  164. package/wc/gv-row.js +1 -1
  165. package/wc/gv-schema-form-array.js +1 -1
  166. package/wc/gv-schema-form-control-object.js +1 -1
  167. package/wc/gv-schema-form-control.js +1 -1
  168. package/wc/gv-schema-form.js +1 -1
  169. package/wc/gv-select-native.js +1 -1
  170. package/wc/gv-select.js +1 -1
  171. package/wc/gv-spinner.js +1 -1
  172. package/wc/gv-state.js +1 -1
  173. package/wc/gv-stats.js +1 -1
  174. package/wc/gv-stepper.js +1 -1
  175. package/wc/gv-switch.js +1 -1
  176. package/wc/gv-table.js +1 -1
  177. package/wc/gv-tabs.js +1 -1
  178. package/wc/gv-tag.js +1 -1
  179. package/wc/gv-text.js +1 -1
  180. package/wc/gv-theme.js +1 -1
  181. package/wc/gv-tree.js +1 -1
  182. package/wc/gv-user-menu.js +1 -1
  183. package/wc/gv-vertical-menu.js +1 -1
  184. package/CHANGELOG.md +0 -1292
  185. package/LICENSE.txt +0 -202
  186. package/README.md +0 -195
  187. package/src/.eslintrc.js +0 -19
  188. package/src/theme/definition.json +0 -1762
@@ -1,218 +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 { css, html, LitElement } from 'lit';
17
- import { skeleton } from '../styles/skeleton';
18
- import { classMap } from 'lit/directives/class-map';
19
- import '../atoms/gv-image';
20
- import '../atoms/gv-button';
21
- import '../molecules/gv-metrics';
22
- import '../molecules/gv-rating';
23
- import '../atoms/gv-state';
24
- import '../atoms/gv-tag';
25
- import { truncate } from '../lib/utils';
26
- import { i18n } from '../lib/i18n';
27
- import { ItemResource } from '../mixins/item-resource';
28
- import { dispatchCustomEvent } from '../lib/events';
29
- import { getVersion, getTitle, getDescription, getOwner } from '../lib/item';
30
-
31
- /**
32
- * Full Card component
33
- *
34
- * ## Details
35
- * * has @theme facet
36
- *
37
- * @fires gv-card-full:click - Custom click event
38
- * @fires gv-tag:click - Custom click event on card labels
39
- *
40
- * @attr {Promise<Object>} item - An item.
41
- * @attr {Promise<Metrics>} metrics - A Metrics.
42
- *
43
- * @cssprop {Color} [--gv-card-full--bgc=var(--gv-theme-neutral-color-lightest, #ffffff)] - Background color
44
- * @cssprop {Length} [--gv-card-full-image--h=65px] - Image height
45
- * @cssprop {Length} [--gv-card-full-image--w=110px] - Image width
46
- */
47
- export class GvCardFull extends ItemResource(LitElement) {
48
- static get properties() {
49
- return {
50
- metrics: { type: Object },
51
- };
52
- }
53
-
54
- static get styles() {
55
- return [
56
- ...super.styles,
57
- // language=CSS
58
- css`
59
- :host {
60
- box-sizing: border-box;
61
- display: inline-block;
62
- margin: 0.2rem;
63
-
64
- vertical-align: middle;
65
- width: 100%;
66
- max-height: 281px;
67
- line-height: 22px;
68
- font-size: var(--gv-theme-font-size-m, 14px);
69
- }
70
-
71
- gv-identity-picture {
72
- height: var(--gv-card-full-image--h, 65px);
73
- width: var(--gv-card-full-image--w, 110px);
74
- --gv-image--of: contain;
75
- }
76
-
77
- .card {
78
- display: flex;
79
- flex-direction: column;
80
- height: 250px;
81
- border-radius: 4px;
82
- background-color: var(--gv-card-full--bgc, var(--gv-theme-neutral-color-lightest, #ffffff));
83
- color: var(--gv-theme-font-color-dark, #262626);
84
- padding: 16px;
85
- box-shadow: 0 0 0 1px var(--gv-theme-neutral-color, #f5f5f5), 0 1px 3px var(--gv-theme-neutral-color-dark, #bfbfbf);
86
- transition: transform 0.3s;
87
- }
88
-
89
- .card:hover {
90
- transform: translateY(-4px);
91
- box-shadow: 0 20px 40px -14px var(--gv-theme-neutral-color-dark, #bfbfbf);
92
- cursor: pointer;
93
- }
94
-
95
- .card > div {
96
- display: flex;
97
- }
98
-
99
- .image {
100
- min-height: 65px;
101
- min-width: 0;
102
- position: relative;
103
- padding-top: 0.2rem;
104
- }
105
-
106
- .title {
107
- line-height: 22px;
108
- font-size: var(--gv-theme-font-size-l, 16px);
109
- text-transform: capitalize;
110
- font-weight: bold;
111
- padding-bottom: 5px;
112
- }
113
-
114
- .owner {
115
- --gv-icon--c: var(--gv-theme-neutral-color-dark, #bfbfbf);
116
- --gv-icon--s: 16px;
117
- color: var(--gv-theme-neutral-color-dark, #bfbfbf);
118
- display: flex;
119
- padding-bottom: 2px;
120
- line-height: initial;
121
- }
122
-
123
- .content {
124
- flex: 1;
125
- padding: 0 10px 10px 10px;
126
- }
127
-
128
- .version {
129
- color: var(--gv-theme-neutral-color-dark, #d9d9d9);
130
- padding: 10px 8px;
131
- font-size: var(--gv-theme-font-size-s, 12px);
132
- }
133
-
134
- .description {
135
- padding: 0 16px;
136
- margin: 6px 0;
137
- flex: 1;
138
- flex-grow: 1;
139
- max-height: 150px;
140
- overflow: hidden;
141
- text-overflow: ellipsis;
142
- }
143
-
144
- .infos {
145
- display: flex;
146
- border-bottom: 1px solid var(--gv-theme-neutral-color-dark, #d9d9d9);
147
- padding: 0.5rem 0;
148
- justify-content: flex-end;
149
- }
150
-
151
- gv-metrics {
152
- display: flex;
153
- height: 100%;
154
- justify-content: flex-end;
155
- align-items: stretch;
156
- }
157
-
158
- .skeleton .infos {
159
- border-bottom: none;
160
- }
161
-
162
- .labels {
163
- padding: 0 16px;
164
- }
165
-
166
- .error .labels,
167
- .error .infos,
168
- .error .states {
169
- visibility: hidden;
170
- }
171
- `,
172
- skeleton,
173
- ];
174
- }
175
-
176
- constructor() {
177
- super();
178
- this.limit = 150;
179
- }
180
-
181
- _onClick(e) {
182
- if (!this._empty && !this._error && !this._skeleton && !e.target.tagName.toLowerCase().startsWith('gv-metrics')) {
183
- dispatchCustomEvent(this, 'click', this._item);
184
- }
185
- }
186
-
187
- render() {
188
- const title = getTitle(this._item);
189
- const owner = getOwner(this._item);
190
- const classes = { error: this._error || this._empty, card: true };
191
- return html`<div class="${classMap(classes)}" title="${title}" @click="${this._onClick}">
192
- <div class="${classMap({ skeleton: this._skeleton })}">
193
- <div class="${classMap({ image: true })}">${this._renderImage()}</div>
194
- <div class="content">
195
- <div class="${classMap({ title: true })}">${title}</div>
196
- ${owner != null && owner.trim().length > 0
197
- ? html`<div class="owner"><gv-icon shape="general:user" size="8px"></gv-icon>${owner}</div>`
198
- : ''}
199
- <div class="states">${this._renderStates()}</div>
200
- </div>
201
- <div class="version"><span class="${classMap({ skeleton: this._skeleton })}">${getVersion(this._item)}</span></div>
202
- </div>
203
- <div class="${classMap({ skeleton: this._skeleton, description: true })}">
204
- ${truncate(
205
- this._error ? i18n('gv-card-full.error') : this._empty ? i18n('gv-card-full.empty') : getDescription(this._item),
206
- this.limit,
207
- )}
208
- </div>
209
- <span class="${classMap({ skeleton: this._skeleton })}">
210
- <div class="infos">${this._renderMetricsWithRating()}</div>
211
-
212
- <div class="labels">${this._renderLabels(true)}</div>
213
- </span>
214
- </div>`;
215
- }
216
- }
217
-
218
- window.customElements.define('gv-card-full', GvCardFull);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvCardFull=void 0;const e=require("lit"),t=require("../styles/skeleton"),i=require("lit/directives/class-map");require("../atoms/gv-image"),require("../atoms/gv-button"),require("../molecules/gv-metrics"),require("../molecules/gv-rating"),require("../atoms/gv-state"),require("../atoms/gv-tag");const r=require("../lib/utils"),s=require("../lib/i18n"),l=require("../mixins/item-resource"),a=require("../lib/events"),o=require("../lib/item");class n extends((0,l.ItemResource)(e.LitElement)){static get properties(){return{metrics:{type:Object}}}static get styles(){return[...super.styles,e.css`:host{box-sizing:border-box;display:inline-block;margin:.2rem;vertical-align:middle;width:100%;max-height:281px;line-height:22px;font-size:var(--gv-theme-font-size-m,14px)}gv-identity-picture{height:var(--gv-card-full-image--h,65px);width:var(--gv-card-full-image--w,110px);--gv-image--of:contain}.card{display:flex;flex-direction:column;height:250px;border-radius:4px;background-color:var(--gv-card-full--bgc,var(--gv-theme-neutral-color-lightest,#fff));color:var(--gv-theme-font-color-dark,#262626);padding:16px;box-shadow:0 0 0 1px var(--gv-theme-neutral-color,#f5f5f5),0 1px 3px var(--gv-theme-neutral-color-dark,#bfbfbf);transition:transform .3s}.card:hover{transform:translateY(-4px);box-shadow:0 20px 40px -14px var(--gv-theme-neutral-color-dark,#bfbfbf);cursor:pointer}.card>div{display:flex}.image{min-height:65px;min-width:0;position:relative;padding-top:.2rem}.title{line-height:22px;font-size:var(--gv-theme-font-size-l,16px);text-transform:capitalize;font-weight:700;padding-bottom:5px}.owner{--gv-icon--c:var(--gv-theme-neutral-color-dark, #bfbfbf);--gv-icon--s:16px;color:var(--gv-theme-neutral-color-dark,#bfbfbf);display:flex;padding-bottom:2px;line-height:initial}.content{flex:1;padding:0 10px 10px 10px}.version{color:var(--gv-theme-neutral-color-dark,#d9d9d9);padding:10px 8px;font-size:var(--gv-theme-font-size-s,12px)}.description{padding:0 16px;margin:6px 0;flex:1;flex-grow:1;max-height:150px;overflow:hidden;text-overflow:ellipsis}.infos{display:flex;border-bottom:1px solid var(--gv-theme-neutral-color-dark,#d9d9d9);padding:.5rem 0;justify-content:flex-end}gv-metrics{display:flex;height:100%;justify-content:flex-end;align-items:stretch}.skeleton .infos{border-bottom:none}.labels{padding:0 16px}.error .infos,.error .labels,.error .states{visibility:hidden}`,t.skeleton]}constructor(){super(),this.limit=150}_onClick(e){this._empty||this._error||this._skeleton||e.target.tagName.toLowerCase().startsWith("gv-metrics")||(0,a.dispatchCustomEvent)(this,"click",this._item)}render(){const t=(0,o.getTitle)(this._item),l=(0,o.getOwner)(this._item),a={error:this._error||this._empty,card:!0};return e.html`<div class="${(0,i.classMap)(a)}" title="${t}" @click="${this._onClick}"><div class="${(0,i.classMap)({skeleton:this._skeleton})}"><div class="${(0,i.classMap)({image:!0})}">${this._renderImage()}</div><div class="content"><div class="${(0,i.classMap)({title:!0})}">${t}</div>${null!=l&&l.trim().length>0?e.html`<div class="owner"><gv-icon shape="general:user" size="8px"></gv-icon>${l}</div>`:""}<div class="states">${this._renderStates()}</div></div><div class="version"><span class="${(0,i.classMap)({skeleton:this._skeleton})}">${(0,o.getVersion)(this._item)}</span></div></div><div class="${(0,i.classMap)({skeleton:this._skeleton,description:!0})}">${(0,r.truncate)(this._error?(0,s.i18n)("gv-card-full.error"):this._empty?(0,s.i18n)("gv-card-full.empty"):(0,o.getDescription)(this._item),this.limit)}</div><span class="${(0,i.classMap)({skeleton:this._skeleton})}"><div class="infos">${this._renderMetricsWithRating()}</div><div class="labels">${this._renderLabels(!0)}</div></span></div>`}}exports.GvCardFull=n,window.customElements.define("gv-card-full",n);
@@ -1,113 +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 { css, LitElement, html } from 'lit';
17
- import { repeat } from 'lit/directives/repeat';
18
- import { withResizeObserver } from '../mixins/with-resize-observer';
19
- import { i18n } from '../lib/i18n';
20
- import './gv-card-full';
21
-
22
- /**
23
- * List of cards
24
- *
25
- * ## Details
26
- * * has @theme facet
27
- */
28
- export class GvCardList extends withResizeObserver(LitElement) {
29
- static get properties() {
30
- return {
31
- items: { type: Array },
32
- };
33
- }
34
-
35
- constructor() {
36
- super();
37
- this.breakpoints = {
38
- width: [845, 1270],
39
- };
40
- }
41
-
42
- static get styles() {
43
- return [
44
- // language=CSS
45
- css`
46
- :host {
47
- box-sizing: border-box;
48
- display: grid;
49
- grid-template-columns: repeat(3, 1fr);
50
- grid-gap: 0.5rem;
51
- }
52
-
53
- :host([w-lt-1270]) .container {
54
- grid-template-columns: repeat(2, 1fr);
55
- }
56
-
57
- :host([w-lt-845]) .container {
58
- display: flex;
59
- flex-direction: column;
60
- }
61
-
62
- :host([w-lt-845]) .container > .item {
63
- flex: 0 1 auto;
64
- }
65
-
66
- .item {
67
- opacity: 0;
68
- transition: opacity 100ms ease-in-out;
69
- }
70
-
71
- .item.show {
72
- opacity: 1;
73
- }
74
- `,
75
- ];
76
- }
77
-
78
- renderItem(item, index) {
79
- const _item = item && item.item ? item.item : null;
80
- const _metrics = item && item.metrics ? item.metrics : null;
81
- return html`<gv-card-full class="item" .item="${_item}" .metrics="${_metrics}"> </gv-card-full>`;
82
- }
83
-
84
- render() {
85
- if (this._error) {
86
- return html`<div>${i18n('gv-card-list.error')}</div>`;
87
- }
88
-
89
- if (this.items) {
90
- return html`${repeat(
91
- this.items,
92
- (item) => item,
93
- (item, index) => this.renderItem(item, index),
94
- )}`;
95
- }
96
- return '';
97
- }
98
-
99
- updated(changedProperties) {
100
- if (changedProperties.has('items')) {
101
- if (this.items && this.items.length > 0) {
102
- const items = this.shadowRoot.querySelectorAll('.item');
103
- items.forEach((item, index) => {
104
- setTimeout(() => {
105
- item.classList.add('show');
106
- }, index * 100);
107
- });
108
- }
109
- }
110
- }
111
- }
112
-
113
- window.customElements.define('gv-card-list', GvCardList);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvCardList=void 0;const e=require("lit"),t=require("lit/directives/repeat"),i=require("../mixins/with-resize-observer"),r=require("../lib/i18n");require("./gv-card-full");class s extends((0,i.withResizeObserver)(e.LitElement)){static get properties(){return{items:{type:Array}}}constructor(){super(),this.breakpoints={width:[845,1270]}}static get styles(){return[e.css`:host{box-sizing:border-box;display:grid;grid-template-columns:repeat(3,1fr);grid-gap:.5rem}:host([w-lt-1270]) .container{grid-template-columns:repeat(2,1fr)}:host([w-lt-845]) .container{display:flex;flex-direction:column}:host([w-lt-845]) .container>.item{flex:0 1 auto}.item{opacity:0;transition:opacity .1s ease-in-out}.item.show{opacity:1}`]}renderItem(t,i){const r=t&&t.item?t.item:null,s=t&&t.metrics?t.metrics:null;return e.html`<gv-card-full class="item" .item="${r}" .metrics="${s}"></gv-card-full>`}render(){return this._error?e.html`<div>${(0,r.i18n)("gv-card-list.error")}</div>`:this.items?e.html`${(0,t.repeat)(this.items,(e=>e),((e,t)=>this.renderItem(e,t)))}`:""}updated(e){if(e.has("items")&&this.items&&this.items.length>0){this.shadowRoot.querySelectorAll(".item").forEach(((e,t)=>{setTimeout((()=>{e.classList.add("show")}),100*t)}))}}}exports.GvCardList=s,window.customElements.define("gv-card-list",s);
@@ -1,133 +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 { css, LitElement, html } from 'lit';
17
- import { skeleton } from '../styles/skeleton';
18
- import { classMap } from 'lit/directives/class-map';
19
- import '../atoms/gv-image';
20
- import '../atoms/gv-button';
21
- import { i18n } from '../lib/i18n';
22
- import { ItemResource } from '../mixins/item-resource';
23
- import { getVersion, getTitle } from '../lib/item';
24
-
25
- /**
26
- * Card component
27
- *
28
- * ## Details
29
- * * has @theme facet
30
- *
31
- * @attr {Promise<any>} item - An item.
32
- *
33
- * @cssprop {Color} [--gv-card--bgc=var(--gv-theme-neutral-color-lightest, #ffffff)] - Background color
34
- */
35
- export class GvCard extends ItemResource(LitElement) {
36
- static get styles() {
37
- return [
38
- ...super.styles,
39
- // language=CSS
40
- css`
41
- :host {
42
- box-sizing: border-box;
43
- display: inline-block;
44
- margin: 0.2rem;
45
- vertical-align: middle;
46
- width: 144px;
47
- max-height: 144px;
48
- }
49
-
50
- gv-identity-picture {
51
- width: 65px;
52
- height: 65px;
53
- --gv-image--of: contain;
54
- }
55
-
56
- .card {
57
- position: relative;
58
- display: flex;
59
- flex-direction: column;
60
- max-width: 144px;
61
- min-height: 144px;
62
- border-radius: 2px;
63
- background-color: var(--gv-card--bgc, var(--gv-theme-neutral-color-lightest, #ffffff));
64
- color: var(--gv-theme-font-color-dark, #262626);
65
- box-shadow: 0 0 0 1px var(--gv-theme-neutral-color, #f5f5f5), 0 1px 3px var(--gv-theme-neutral-color-dark, #bfbfbf);
66
- transition: all 0.3s;
67
- }
68
-
69
- .card:hover {
70
- transform: translateY(-4px);
71
- box-shadow: 0 10px 20px -10px var(--gv-theme-neutral-color-dark, #bfbfbf);
72
- cursor: pointer;
73
- }
74
-
75
- .content > div {
76
- display: flex;
77
- justify-content: center;
78
- margin-bottom: 0.2rem;
79
- }
80
-
81
- .image {
82
- display: flex;
83
- flex: 1;
84
- align-items: center;
85
- justify-content: center;
86
- position: relative;
87
- padding-top: 0.2rem;
88
- }
89
-
90
- .title {
91
- line-height: 22px;
92
- font-size: var(--gv-theme-font-size-s, 12px);
93
- text-transform: capitalize;
94
- font-weight: bold;
95
- white-space: nowrap;
96
- overflow: hidden;
97
- }
98
-
99
- .content {
100
- flex: 1;
101
- padding: 6px 16px 12px;
102
- }
103
-
104
- .version {
105
- color: var(--gv-theme-neutral-color-dark, #d9d9d9);
106
- top: 0.4rem;
107
- right: 0.4rem;
108
- position: absolute;
109
- }
110
- `,
111
- skeleton,
112
- ];
113
- }
114
-
115
- render() {
116
- const title = getTitle(this._item);
117
- return html`<div class="card" title="${title}">
118
- <span class="${classMap({ skeleton: this._skeleton, version: true })}">${getVersion(this._item)}</span>
119
- <div class="${classMap({ image: true, skeleton: this._skeleton })}">${this._renderImage()}</div>
120
-
121
- <div class="${classMap({ content: true, empty: this._error || this._empty })}">
122
- ${this._error || this._empty
123
- ? html` <span>${this._error ? i18n('gv-card.error') : i18n('gv-card.empty')}</span> `
124
- : html` <div class="${classMap({ skeleton: this._skeleton })}">
125
- <span class="title">${title}</span>
126
- </div>
127
- <div>${this._renderStates()}</div>`}
128
- </div>
129
- </div>`;
130
- }
131
- }
132
-
133
- window.customElements.define('gv-card', GvCard);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvCard=void 0;const e=require("lit"),t=require("../styles/skeleton"),r=require("lit/directives/class-map");require("../atoms/gv-image"),require("../atoms/gv-button");const i=require("../lib/i18n"),s=require("../mixins/item-resource"),o=require("../lib/item");class a extends((0,s.ItemResource)(e.LitElement)){static get styles(){return[...super.styles,e.css`:host{box-sizing:border-box;display:inline-block;margin:.2rem;vertical-align:middle;width:144px;max-height:144px}gv-identity-picture{width:65px;height:65px;--gv-image--of:contain}.card{position:relative;display:flex;flex-direction:column;max-width:144px;min-height:144px;border-radius:2px;background-color:var(--gv-card--bgc,var(--gv-theme-neutral-color-lightest,#fff));color:var(--gv-theme-font-color-dark,#262626);box-shadow:0 0 0 1px var(--gv-theme-neutral-color,#f5f5f5),0 1px 3px var(--gv-theme-neutral-color-dark,#bfbfbf);transition:all .3s}.card:hover{transform:translateY(-4px);box-shadow:0 10px 20px -10px var(--gv-theme-neutral-color-dark,#bfbfbf);cursor:pointer}.content>div{display:flex;justify-content:center;margin-bottom:.2rem}.image{display:flex;flex:1;align-items:center;justify-content:center;position:relative;padding-top:.2rem}.title{line-height:22px;font-size:var(--gv-theme-font-size-s,12px);text-transform:capitalize;font-weight:700;white-space:nowrap;overflow:hidden}.content{flex:1;padding:6px 16px 12px}.version{color:var(--gv-theme-neutral-color-dark,#d9d9d9);top:.4rem;right:.4rem;position:absolute}`,t.skeleton]}render(){const t=(0,o.getTitle)(this._item);return e.html`<div class="card" title="${t}"><span class="${(0,r.classMap)({skeleton:this._skeleton,version:!0})}">${(0,o.getVersion)(this._item)}</span><div class="${(0,r.classMap)({image:!0,skeleton:this._skeleton})}">${this._renderImage()}</div><div class="${(0,r.classMap)({content:!0,empty:this._error||this._empty})}">${this._error||this._empty?e.html`<span>${this._error?(0,i.i18n)("gv-card.error"):(0,i.i18n)("gv-card.empty")}</span>`:e.html`<div class="${(0,r.classMap)({skeleton:this._skeleton})}"><span class="title">${t}</span></div><div>${this._renderStates()}</div>`}</div></div>`}}exports.GvCard=a,window.customElements.define("gv-card",a);
@@ -1,60 +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 { css, html } from 'lit';
17
- import './gv-category';
18
- import { GvCardList } from './gv-card-list';
19
-
20
- /**
21
- * List of categories
22
- *
23
- * ## Details
24
- * * has @theme facet
25
- *
26
- * @cssprop {Color} [--gv-category-list--bgc-1=#cce6eb] - Category background color 1
27
- * @cssprop {Color} [--gv-category-list--bgc-2=#fcf1a8] - Category background color 2
28
- * @cssprop {Color} [--gv-category-list--bgc-3=#d9d4f1] - Category background color 3
29
- * @cssprop {Color} [--gv-category-list--bgc-4=#f9c15e] - Category background color 4
30
- * @cssprop {Color} [--gv-category-list--bgc-5=#d4fccd] - Category background color 5
31
- * @cssprop {Color} [--gv-category-list--bgc-6=#e0c8b2] - Category background color 6
32
- */
33
- export class GvCategoryList extends GvCardList {
34
- static get styles() {
35
- return [
36
- ...super.styles,
37
- // language=CSS
38
- css`
39
- :host {
40
- --bgc-1: var(--gv-category-list--bgc-1, #cce6eb);
41
- --bgc-2: var(--gv-category-list--bgc-2, #fcf1a8);
42
- --bgc-3: var(--gv-category-list--bgc-3, #d9d4f1);
43
- --bgc-4: var(--gv-category-list--bgc-4, #f9c15e);
44
- --bgc-5: var(--gv-category-list--bgc-5, #d4fccd);
45
- --bgc-6: var(--gv-category-list--bgc-6, #e0c8b2);
46
- }
47
- `,
48
- ];
49
- }
50
-
51
- renderItem(item, index) {
52
- return html`<gv-category class="item" .category="${item || null}" style="${this._getCategoryBackgroundColor(index)}"> </gv-category>`;
53
- }
54
-
55
- _getCategoryBackgroundColor(index) {
56
- return `--gv-category--bgc: var(--bgc-${(index % 6) + 1})`;
57
- }
58
- }
59
-
60
- window.customElements.define('gv-category-list', GvCategoryList);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvCategoryList=void 0;const e=require("lit");require("./gv-category");const t=require("./gv-card-list");class r extends t.GvCardList{static get styles(){return[...super.styles,e.css`:host{--bgc-1:var(--gv-category-list--bgc-1, #cce6eb);--bgc-2:var(--gv-category-list--bgc-2, #fcf1a8);--bgc-3:var(--gv-category-list--bgc-3, #d9d4f1);--bgc-4:var(--gv-category-list--bgc-4, #f9c15e);--bgc-5:var(--gv-category-list--bgc-5, #d4fccd);--bgc-6:var(--gv-category-list--bgc-6, #e0c8b2)}`]}renderItem(t,r){return e.html`<gv-category class="item" .category="${t||null}" style="${this._getCategoryBackgroundColor(r)}"></gv-category>`}_getCategoryBackgroundColor(e){return`--gv-category--bgc: var(--bgc-${e%6+1})`}}exports.GvCategoryList=r,window.customElements.define("gv-category-list",r);