@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.
- package/package.json +3 -4
- package/src/atoms/gv-autocomplete.d.ts +104 -0
- package/src/atoms/gv-autocomplete.js +1 -461
- package/src/atoms/gv-button.d.ts +109 -0
- package/src/atoms/gv-button.js +1 -410
- package/src/atoms/gv-checkbox.d.ts +114 -0
- package/src/atoms/gv-checkbox.js +1 -187
- package/src/atoms/gv-date-picker-calendar.d.ts +190 -0
- package/src/atoms/gv-date-picker-calendar.js +1 -894
- package/src/atoms/gv-date-picker-cell.d.ts +80 -0
- package/src/atoms/gv-date-picker-cell.js +1 -190
- package/src/atoms/gv-date-picker.d.ts +194 -0
- package/src/atoms/gv-date-picker.js +1 -671
- package/src/atoms/gv-file-upload.d.ts +64 -0
- package/src/atoms/gv-file-upload.js +1 -367
- package/src/atoms/gv-icon.d.ts +26 -0
- package/src/atoms/gv-icon.js +1 -103
- package/src/atoms/gv-image.d.ts +45 -0
- package/src/atoms/gv-image.js +1 -144
- package/src/atoms/gv-input-message.d.ts +20 -0
- package/src/atoms/gv-input-message.js +1 -84
- package/src/atoms/gv-input.d.ts +246 -0
- package/src/atoms/gv-input.js +1 -561
- package/src/atoms/gv-link.d.ts +67 -0
- package/src/atoms/gv-link.js +1 -210
- package/src/atoms/gv-message.d.ts +23 -0
- package/src/atoms/gv-message.js +1 -128
- package/src/atoms/gv-metric.d.ts +32 -0
- package/src/atoms/gv-metric.js +1 -117
- package/src/atoms/gv-relative-time.d.ts +45 -0
- package/src/atoms/gv-relative-time.js +1 -156
- package/src/atoms/gv-select-native.d.ts +174 -0
- package/src/atoms/gv-select-native.js +1 -388
- package/src/atoms/gv-select.d.ts +71 -0
- package/src/atoms/gv-select.js +1 -437
- package/src/atoms/gv-spinner.d.ts +10 -0
- package/src/atoms/gv-spinner.js +1 -57
- package/src/atoms/gv-state.d.ts +50 -0
- package/src/atoms/gv-state.js +1 -130
- package/src/atoms/gv-switch.d.ts +60 -0
- package/src/atoms/gv-switch.js +1 -243
- package/src/atoms/gv-tag.d.ts +69 -0
- package/src/atoms/gv-tag.js +1 -168
- package/src/atoms/gv-text.d.ts +110 -0
- package/src/atoms/gv-text.js +1 -168
- package/src/charts/gv-chart-bar.d.ts +50 -0
- package/src/charts/gv-chart-bar.js +1 -103
- package/src/charts/gv-chart-gauge.d.ts +58 -0
- package/src/charts/gv-chart-gauge.js +1 -100
- package/src/charts/gv-chart-histogram.d.ts +48 -0
- package/src/charts/gv-chart-histogram.js +1 -83
- package/src/charts/gv-chart-line.d.ts +52 -0
- package/src/charts/gv-chart-line.js +1 -224
- package/src/charts/gv-chart-map.d.ts +50 -0
- package/src/charts/gv-chart-map.js +1 -112
- package/src/charts/gv-chart-pie.d.ts +50 -0
- package/src/charts/gv-chart-pie.js +1 -91
- package/src/index.d.ts +77 -0
- package/src/index.js +1 -77
- package/src/lib/cron-expression.d.ts +1 -0
- package/src/lib/cron-expression.js +1 -205
- package/src/lib/date.d.ts +1 -0
- package/src/lib/date.js +1 -44
- package/src/lib/events.d.ts +1 -0
- package/src/lib/events.js +1 -26
- package/src/lib/http-client-schema-form.d.ts +68 -0
- package/src/lib/http-client-schema-form.js +1 -67
- package/src/lib/http.d.ts +222 -0
- package/src/lib/http.js +1 -237
- package/src/lib/i18n.d.ts +30 -0
- package/src/lib/i18n.js +1 -103
- package/src/lib/item.d.ts +12 -0
- package/src/lib/item.js +1 -118
- package/src/lib/properties.d.ts +42 -0
- package/src/lib/properties.js +1 -189
- package/src/lib/schema-form.d.ts +5 -0
- package/src/lib/schema-form.js +1 -44
- package/src/lib/studio.d.ts +2 -0
- package/src/lib/studio.js +1 -141
- package/src/lib/style.d.ts +6 -0
- package/src/lib/style.js +1 -41
- package/src/lib/text-format.d.ts +6 -0
- package/src/lib/text-format.js +1 -69
- package/src/lib/theme.d.ts +4 -0
- package/src/lib/theme.js +1 -63
- package/src/lib/utils.d.ts +9 -0
- package/src/lib/utils.js +1 -111
- package/src/mixins/chart-element.d.ts +39 -0
- package/src/mixins/chart-element.js +1 -165
- package/src/mixins/input-element.d.ts +64 -0
- package/src/mixins/input-element.js +1 -144
- package/src/mixins/item-resource.d.ts +56 -0
- package/src/mixins/item-resource.js +1 -120
- package/src/mixins/keyboard-element.d.ts +25 -0
- package/src/mixins/keyboard-element.js +1 -69
- package/src/mixins/update-after-browser.d.ts +11 -0
- package/src/mixins/update-after-browser.js +1 -30
- package/src/mixins/with-resize-observer.d.ts +12 -0
- package/src/mixins/with-resize-observer.js +1 -68
- package/src/mixins/with-skeleton-attribute.d.ts +35 -0
- package/src/mixins/with-skeleton-attribute.js +1 -112
- package/src/molecules/gv-card-full.d.ts +78 -0
- package/src/molecules/gv-card-full.js +1 -218
- package/src/molecules/gv-card-list.d.ts +33 -0
- package/src/molecules/gv-card-list.js +1 -113
- package/src/molecules/gv-card.d.ts +65 -0
- package/src/molecules/gv-card.js +1 -133
- package/src/molecules/gv-category-list.d.ts +17 -0
- package/src/molecules/gv-category-list.js +1 -60
- package/src/molecules/gv-category.d.ts +64 -0
- package/src/molecules/gv-category.js +1 -170
- package/src/molecules/gv-code.d.ts +192 -0
- package/src/molecules/gv-code.js +1 -359
- package/src/molecules/gv-confirm.d.ts +60 -0
- package/src/molecules/gv-confirm.js +1 -188
- package/src/molecules/gv-cron-editor.d.ts +115 -0
- package/src/molecules/gv-cron-editor.js +1 -710
- package/src/molecules/gv-dropdown-menu.d.ts +28 -0
- package/src/molecules/gv-dropdown-menu.js +1 -116
- package/src/molecules/gv-expandable.d.ts +37 -0
- package/src/molecules/gv-expandable.js +1 -122
- package/src/molecules/gv-expression-language.d.ts +150 -0
- package/src/molecules/gv-expression-language.js +1 -270
- package/src/molecules/gv-identity-picture.d.ts +44 -0
- package/src/molecules/gv-identity-picture.js +1 -148
- package/src/molecules/gv-list.d.ts +123 -0
- package/src/molecules/gv-list.js +1 -227
- package/src/molecules/gv-metrics.d.ts +65 -0
- package/src/molecules/gv-metrics.js +1 -162
- package/src/molecules/gv-modal.d.ts +64 -0
- package/src/molecules/gv-modal.js +1 -213
- package/src/molecules/gv-nav.d.ts +41 -0
- package/src/molecules/gv-nav.js +1 -196
- package/src/molecules/gv-option.d.ts +65 -0
- package/src/molecules/gv-option.js +1 -242
- package/src/molecules/gv-plans.d.ts +73 -0
- package/src/molecules/gv-plans.js +1 -429
- package/src/molecules/gv-popover.d.ts +91 -0
- package/src/molecules/gv-popover.js +1 -351
- package/src/molecules/gv-promote.d.ts +108 -0
- package/src/molecules/gv-promote.js +1 -209
- package/src/molecules/gv-rating-list.d.ts +77 -0
- package/src/molecules/gv-rating-list.js +1 -365
- package/src/molecules/gv-rating.d.ts +55 -0
- package/src/molecules/gv-rating.js +1 -253
- package/src/molecules/gv-row-expandable.d.ts +8 -0
- package/src/molecules/gv-row-expandable.js +1 -45
- package/src/molecules/gv-row.d.ts +37 -0
- package/src/molecules/gv-row.js +1 -210
- package/src/molecules/gv-stats.d.ts +53 -0
- package/src/molecules/gv-stats.js +1 -121
- package/src/molecules/gv-stepper.d.ts +46 -0
- package/src/molecules/gv-stepper.js +1 -288
- package/src/molecules/gv-table.d.ts +159 -0
- package/src/molecules/gv-table.js +1 -685
- package/src/molecules/gv-tree.d.ts +44 -0
- package/src/molecules/gv-tree.js +1 -250
- package/src/organisms/gv-documentation.d.ts +52 -0
- package/src/organisms/gv-documentation.js +1 -215
- package/src/organisms/gv-header.d.ts +60 -0
- package/src/organisms/gv-header.js +1 -288
- package/src/organisms/gv-http-client.d.ts +57 -0
- package/src/organisms/gv-http-client.js +1 -275
- package/src/organisms/gv-menu.d.ts +74 -0
- package/src/organisms/gv-menu.js +1 -263
- package/src/organisms/gv-newsletter-subscription.d.ts +82 -0
- package/src/organisms/gv-newsletter-subscription.js +1 -271
- package/src/organisms/gv-pagination.d.ts +63 -0
- package/src/organisms/gv-pagination.js +1 -198
- package/src/organisms/gv-properties.d.ts +229 -0
- package/src/organisms/gv-properties.js +1 -920
- package/src/organisms/gv-resizable-views.d.ts +33 -0
- package/src/organisms/gv-resizable-views.js +1 -396
- package/src/organisms/gv-resources.d.ts +125 -0
- package/src/organisms/gv-resources.js +1 -535
- package/src/organisms/gv-schema-form-array.d.ts +55 -0
- package/src/organisms/gv-schema-form-array.js +1 -250
- package/src/organisms/gv-schema-form-control-object.d.ts +64 -0
- package/src/organisms/gv-schema-form-control-object.js +1 -154
- package/src/organisms/gv-schema-form-control.d.ts +90 -0
- package/src/organisms/gv-schema-form-control.js +1 -443
- package/src/organisms/gv-schema-form.d.ts +156 -0
- package/src/organisms/gv-schema-form.js +1 -751
- package/src/organisms/gv-tabs.d.ts +56 -0
- package/src/organisms/gv-tabs.js +1 -210
- package/src/organisms/gv-user-menu.d.ts +56 -0
- package/src/organisms/gv-user-menu.js +1 -314
- package/src/organisms/gv-vertical-menu.d.ts +28 -0
- package/src/organisms/gv-vertical-menu.js +1 -123
- package/src/policy-studio/gv-flow-step.d.ts +142 -0
- package/src/policy-studio/gv-flow-step.js +1 -464
- package/src/policy-studio/gv-flow.d.ts +89 -0
- package/src/policy-studio/gv-flow.js +1 -621
- package/src/policy-studio/gv-policy-studio-menu.d.ts +94 -0
- package/src/policy-studio/gv-policy-studio-menu.js +1 -750
- package/src/policy-studio/gv-policy-studio.d.ts +464 -0
- package/src/policy-studio/gv-policy-studio.js +1 -1842
- package/src/styles/empty.d.ts +1 -0
- package/src/styles/empty.js +1 -36
- package/src/styles/input.d.ts +1 -0
- package/src/styles/input.js +1 -263
- package/src/styles/link.d.ts +1 -0
- package/src/styles/link.js +1 -32
- package/src/styles/shapes.d.ts +2 -0
- package/src/styles/shapes.js +1 -17
- package/src/styles/skeleton.d.ts +1 -0
- package/src/styles/skeleton.js +1 -53
- package/src/styles/zoom.d.ts +1 -0
- package/src/styles/zoom.js +1 -40
- package/src/theme/gv-theme.d.ts +81 -0
- package/src/theme/gv-theme.js +1 -203
- package/wc/gv-autocomplete.d.ts +1 -0
- package/wc/gv-autocomplete.js +1 -1
- package/wc/gv-button.d.ts +1 -0
- package/wc/gv-button.js +1 -1
- package/wc/gv-card-full.d.ts +1 -0
- package/wc/gv-card-full.js +1 -1
- package/wc/gv-card-list.d.ts +1 -0
- package/wc/gv-card-list.js +1 -1
- package/wc/gv-card.d.ts +1 -0
- package/wc/gv-card.js +1 -1
- package/wc/gv-category-list.d.ts +1 -0
- package/wc/gv-category-list.js +1 -1
- package/wc/gv-category.d.ts +1 -0
- package/wc/gv-category.js +1 -1
- package/wc/gv-chart-bar.d.ts +1 -0
- package/wc/gv-chart-bar.js +1 -1
- package/wc/gv-chart-gauge.d.ts +1 -0
- package/wc/gv-chart-gauge.js +1 -1
- package/wc/gv-chart-histogram.d.ts +1 -0
- package/wc/gv-chart-histogram.js +1 -1
- package/wc/gv-chart-line.d.ts +1 -0
- package/wc/gv-chart-line.js +1 -1
- package/wc/gv-chart-map.d.ts +1 -0
- package/wc/gv-chart-map.js +1 -1
- package/wc/gv-chart-pie.d.ts +1 -0
- package/wc/gv-chart-pie.js +1 -1
- package/wc/gv-checkbox.d.ts +1 -0
- package/wc/gv-checkbox.js +1 -1
- package/wc/gv-code.d.ts +1 -0
- package/wc/gv-code.js +1 -1
- package/wc/gv-confirm.d.ts +1 -0
- package/wc/gv-confirm.js +1 -1
- package/wc/gv-cron-editor.d.ts +1 -0
- package/wc/gv-cron-editor.js +1 -1
- package/wc/gv-date-picker-calendar.d.ts +1 -0
- package/wc/gv-date-picker-calendar.js +1 -1
- package/wc/gv-date-picker-cell.d.ts +1 -0
- package/wc/gv-date-picker-cell.js +1 -1
- package/wc/gv-date-picker.d.ts +1 -0
- package/wc/gv-date-picker.js +1 -1
- package/wc/gv-documentation.d.ts +1 -0
- package/wc/gv-documentation.js +1 -1
- package/wc/gv-dropdown-menu.d.ts +1 -0
- package/wc/gv-dropdown-menu.js +1 -1
- package/wc/gv-expandable.d.ts +1 -0
- package/wc/gv-expandable.js +1 -1
- package/wc/gv-expression-language.d.ts +1 -0
- package/wc/gv-expression-language.js +1 -1
- package/wc/gv-file-upload.d.ts +1 -0
- package/wc/gv-file-upload.js +1 -1
- package/wc/gv-flow-step.d.ts +1 -0
- package/wc/gv-flow-step.js +1 -1
- package/wc/gv-flow.d.ts +1 -0
- package/wc/gv-flow.js +1 -1
- package/wc/gv-header.d.ts +1 -0
- package/wc/gv-header.js +1 -1
- package/wc/gv-http-client.d.ts +1 -0
- package/wc/gv-http-client.js +1 -1
- package/wc/gv-icon.d.ts +1 -0
- package/wc/gv-icon.js +1 -1
- package/wc/gv-identity-picture.d.ts +1 -0
- package/wc/gv-identity-picture.js +1 -1
- package/wc/gv-image.d.ts +1 -0
- package/wc/gv-image.js +1 -1
- package/wc/gv-input-message.d.ts +1 -0
- package/wc/gv-input-message.js +1 -1
- package/wc/gv-input.d.ts +1 -0
- package/wc/gv-input.js +1 -1
- package/wc/gv-link.d.ts +1 -0
- package/wc/gv-link.js +1 -1
- package/wc/gv-list.d.ts +1 -0
- package/wc/gv-list.js +1 -1
- package/wc/gv-menu.d.ts +1 -0
- package/wc/gv-menu.js +1 -1
- package/wc/gv-message.d.ts +1 -0
- package/wc/gv-message.js +1 -1
- package/wc/gv-metric.d.ts +1 -0
- package/wc/gv-metric.js +1 -1
- package/wc/gv-metrics.d.ts +1 -0
- package/wc/gv-metrics.js +1 -1
- package/wc/gv-modal.d.ts +1 -0
- package/wc/gv-modal.js +1 -1
- package/wc/gv-nav.d.ts +1 -0
- package/wc/gv-nav.js +1 -1
- package/wc/gv-newsletter-subscription.d.ts +1 -0
- package/wc/gv-newsletter-subscription.js +1 -1
- package/wc/gv-option.d.ts +1 -0
- package/wc/gv-option.js +1 -1
- package/wc/gv-pagination.d.ts +1 -0
- package/wc/gv-pagination.js +1 -1
- package/wc/gv-plans.d.ts +1 -0
- package/wc/gv-plans.js +1 -1
- package/wc/gv-policy-studio-menu.d.ts +1 -0
- package/wc/gv-policy-studio-menu.js +1 -1
- package/wc/gv-policy-studio.d.ts +1 -0
- package/wc/gv-policy-studio.js +1 -1
- package/wc/gv-popover.d.ts +1 -0
- package/wc/gv-popover.js +1 -1
- package/wc/gv-promote.d.ts +1 -0
- package/wc/gv-promote.js +1 -1
- package/wc/gv-properties.d.ts +1 -0
- package/wc/gv-properties.js +1 -1
- package/wc/gv-rating-list.d.ts +1 -0
- package/wc/gv-rating-list.js +1 -1
- package/wc/gv-rating.d.ts +1 -0
- package/wc/gv-rating.js +1 -1
- package/wc/gv-relative-time.d.ts +1 -0
- package/wc/gv-relative-time.js +1 -1
- package/wc/gv-resizable-views.d.ts +1 -0
- package/wc/gv-resizable-views.js +1 -1
- package/wc/gv-resources.d.ts +1 -0
- package/wc/gv-resources.js +1 -1
- package/wc/gv-row-expandable.d.ts +1 -0
- package/wc/gv-row-expandable.js +1 -1
- package/wc/gv-row.d.ts +1 -0
- package/wc/gv-row.js +1 -1
- package/wc/gv-schema-form-array.d.ts +1 -0
- package/wc/gv-schema-form-array.js +1 -1
- package/wc/gv-schema-form-control-object.d.ts +1 -0
- package/wc/gv-schema-form-control-object.js +1 -1
- package/wc/gv-schema-form-control.d.ts +1 -0
- package/wc/gv-schema-form-control.js +1 -1
- package/wc/gv-schema-form.d.ts +1 -0
- package/wc/gv-schema-form.js +1 -1
- package/wc/gv-select-native.d.ts +1 -0
- package/wc/gv-select-native.js +1 -1
- package/wc/gv-select.d.ts +1 -0
- package/wc/gv-select.js +1 -1
- package/wc/gv-spinner.d.ts +1 -0
- package/wc/gv-spinner.js +1 -1
- package/wc/gv-state.d.ts +1 -0
- package/wc/gv-state.js +1 -1
- package/wc/gv-stats.d.ts +1 -0
- package/wc/gv-stats.js +1 -1
- package/wc/gv-stepper.d.ts +1 -0
- package/wc/gv-stepper.js +1 -1
- package/wc/gv-switch.d.ts +1 -0
- package/wc/gv-switch.js +1 -1
- package/wc/gv-table.d.ts +1 -0
- package/wc/gv-table.js +1 -1
- package/wc/gv-tabs.d.ts +1 -0
- package/wc/gv-tabs.js +1 -1
- package/wc/gv-tag.d.ts +1 -0
- package/wc/gv-tag.js +1 -1
- package/wc/gv-text.d.ts +1 -0
- package/wc/gv-text.js +1 -1
- package/wc/gv-theme.d.ts +1 -0
- package/wc/gv-theme.js +1 -1
- package/wc/gv-tree.d.ts +1 -0
- package/wc/gv-tree.js +1 -1
- package/wc/gv-user-menu.d.ts +1 -0
- package/wc/gv-user-menu.js +1 -1
- package/wc/gv-vertical-menu.d.ts +1 -0
- package/wc/gv-vertical-menu.js +1 -1
- package/CHANGELOG.md +0 -1292
- package/LICENSE.txt +0 -202
- package/README.md +0 -195
- package/src/.eslintrc.js +0 -19
- package/src/theme/definition.json +0 -1762
|
@@ -1,242 +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 '../atoms/gv-button';
|
|
18
|
-
import { repeat } from 'lit/directives/repeat';
|
|
19
|
-
import { classMap } from 'lit/directives/class-map';
|
|
20
|
-
import { dispatchCustomEvent } from '../lib/events';
|
|
21
|
-
import { ifDefined } from 'lit/directives/if-defined';
|
|
22
|
-
import { styleMap } from 'lit/directives/style-map';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Option component
|
|
26
|
-
*
|
|
27
|
-
* ## Details
|
|
28
|
-
* * has @theme facet
|
|
29
|
-
*
|
|
30
|
-
* @attr {Array<{id, title, icon?, active?, description?, label?}>} options - An array of options.
|
|
31
|
-
* @attr {String|Array} value - Selected value id, array with multiple option ids.
|
|
32
|
-
* @attr {Boolean} multiple - If true, can choose several option
|
|
33
|
-
* @attr {Boolean} reverse - If true, title and description are reversed.
|
|
34
|
-
* @attr {Boolean} small - If true, use small button for options
|
|
35
|
-
* @attr {Boolean} outlined - If true, use outlined button for options
|
|
36
|
-
*
|
|
37
|
-
* @cssprop {Color} [--gv-option--bgc=var(--gv-theme-neutral-color-dark, #bfbfbf)] - Background color
|
|
38
|
-
* @cssprop {Length} [--gv-option--bdrs=0.15rem] - Border radius
|
|
39
|
-
* @cssprop {Length} [--gv-option-button--maw=200px] - Button max width
|
|
40
|
-
* @cssprop {Length} [--gv-option-icon--s=64px] - Icon size
|
|
41
|
-
*/
|
|
42
|
-
export class GvOption extends LitElement {
|
|
43
|
-
static get properties() {
|
|
44
|
-
return {
|
|
45
|
-
options: { type: Array },
|
|
46
|
-
_options: { type: Array, attribute: false },
|
|
47
|
-
_hasDescription: { type: Array, attribute: false },
|
|
48
|
-
value: { type: String, reflect: true },
|
|
49
|
-
multiple: { type: Boolean },
|
|
50
|
-
reverse: { type: Boolean },
|
|
51
|
-
small: { type: Boolean },
|
|
52
|
-
outlined: { type: Boolean },
|
|
53
|
-
disabled: { type: Boolean, reflect: true },
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
static get styles() {
|
|
58
|
-
return [
|
|
59
|
-
// language=CSS
|
|
60
|
-
css`
|
|
61
|
-
:host {
|
|
62
|
-
box-sizing: border-box;
|
|
63
|
-
display: inline-block;
|
|
64
|
-
--gv-button--p: 5px;
|
|
65
|
-
margin: 0.2rem;
|
|
66
|
-
--bdrs: var(--gv-option--bdrs, 0.15rem);
|
|
67
|
-
--maw: var(--gv-option-button--maw, 200px);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.box.description {
|
|
71
|
-
display: grid;
|
|
72
|
-
grid-gap: 0.5rem;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
gv-button {
|
|
76
|
-
margin: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
gv-button.description {
|
|
80
|
-
flex: 1 1 var(--maw);
|
|
81
|
-
max-width: var(--maw);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
gv-button:not(.description) {
|
|
85
|
-
margin: 0;
|
|
86
|
-
--gv-button--bdrs: 0;
|
|
87
|
-
--gv-button--bgc: var(--gv-option--bgc, var(--gv-theme-neutral-color-dark, #bfbfbf));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
gv-button:not(.description).entry {
|
|
91
|
-
--gv-button--bdrs: var(--bdrs) 0 0 var(--bdrs);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
gv-button:not(.description).exit {
|
|
95
|
-
--gv-button--bdrs: 0 var(--bdrs) var(--bdrs) 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.content {
|
|
99
|
-
white-space: pre-line;
|
|
100
|
-
--gv-icon--s: var(--gv-option-icon--s, 64px);
|
|
101
|
-
display: flex;
|
|
102
|
-
flex-direction: column;
|
|
103
|
-
align-items: center;
|
|
104
|
-
height: 100%;
|
|
105
|
-
text-transform: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
gv-image {
|
|
109
|
-
height: 64px;
|
|
110
|
-
width: 64px;
|
|
111
|
-
--gv-image--of: fill;
|
|
112
|
-
display: inline-flex;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.reverse .content {
|
|
116
|
-
flex-direction: column-reverse;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.title {
|
|
120
|
-
font-size: var(--gv-theme-font-size-l, 18px);
|
|
121
|
-
font-weight: bold;
|
|
122
|
-
margin: 0.5rem 0;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
gv-button.description {
|
|
126
|
-
margin: 0.5rem;
|
|
127
|
-
}
|
|
128
|
-
`,
|
|
129
|
-
];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
constructor() {
|
|
133
|
-
super();
|
|
134
|
-
this.multiple = false;
|
|
135
|
-
this.reverse = false;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
_onClick(option) {
|
|
139
|
-
this.setValue(option);
|
|
140
|
-
dispatchCustomEvent(this, 'select', option);
|
|
141
|
-
this.dispatchEvent(new Event('input'), { bubbles: true, cancelable: true });
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
async performUpdate() {
|
|
145
|
-
this.shadowRoot.querySelectorAll('gv-button').forEach((btn) => btn.performUpdate());
|
|
146
|
-
return super.performUpdate();
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
setValue(option) {
|
|
150
|
-
if (option) {
|
|
151
|
-
if (this.multiple) {
|
|
152
|
-
if (this.value.includes(option.id)) {
|
|
153
|
-
this.value = this.value.filter((optId) => {
|
|
154
|
-
return optId !== option.id;
|
|
155
|
-
});
|
|
156
|
-
} else {
|
|
157
|
-
this.value = [...this.value, option.id];
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
this.value = option.id;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
set options(options) {
|
|
166
|
-
if (options) {
|
|
167
|
-
Promise.all(options).then((_options) => {
|
|
168
|
-
this._options = _options;
|
|
169
|
-
this._hasDescription = this._options.find((opt) => opt.description != null) != null;
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
isActive(option) {
|
|
175
|
-
if (this.value) {
|
|
176
|
-
if (this.multiple) {
|
|
177
|
-
return this.value.includes(option.id);
|
|
178
|
-
} else {
|
|
179
|
-
return this.value === option.id;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
_renderOption(option, index) {
|
|
186
|
-
const isActive = this.isActive(option);
|
|
187
|
-
const outlined = this.outlined || (!isActive && this._hasDescription);
|
|
188
|
-
return html`<gv-button
|
|
189
|
-
.icon=${ifDefined(!this._hasDescription ? option.icon : null)}
|
|
190
|
-
.iconRight=${ifDefined(!option.icon && option.iconRight ? option.iconRight : null)}
|
|
191
|
-
.title="${ifDefined(option.title)}"
|
|
192
|
-
.primary="${isActive}"
|
|
193
|
-
.small="${this.small}"
|
|
194
|
-
.disabled="${option.disabled || this.disabled}"
|
|
195
|
-
@click="${this._onClick.bind(this, option)}"
|
|
196
|
-
.outlined="${outlined}"
|
|
197
|
-
class="${classMap({
|
|
198
|
-
active: isActive,
|
|
199
|
-
entry: index === 0,
|
|
200
|
-
exit: index === this._options.length - 1,
|
|
201
|
-
description: option.description != null,
|
|
202
|
-
})}"
|
|
203
|
-
>
|
|
204
|
-
${!this._hasDescription
|
|
205
|
-
? option.title != null
|
|
206
|
-
? option.label || option.title
|
|
207
|
-
: ''
|
|
208
|
-
: html`<div class="content">
|
|
209
|
-
${option.icon
|
|
210
|
-
? html`<gv-icon shape="${option.icon}"></gv-icon>`
|
|
211
|
-
: option.image
|
|
212
|
-
? html`<gv-image src="${option.image}"></gv-image>`
|
|
213
|
-
: ''}
|
|
214
|
-
<div class="title">${option.title}</div>
|
|
215
|
-
<div class="description-content" .innerHTML="${option.description}"></div>
|
|
216
|
-
</div>`}
|
|
217
|
-
</gv-button>`;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
render() {
|
|
221
|
-
if (this._options) {
|
|
222
|
-
const classes = {
|
|
223
|
-
box: true,
|
|
224
|
-
description: this._hasDescription,
|
|
225
|
-
reverse: this.reverse,
|
|
226
|
-
};
|
|
227
|
-
return html`<div
|
|
228
|
-
class="${classMap(classes)}"
|
|
229
|
-
style="${styleMap({ 'grid-template-columns': `repeat(${this._options.length}, auto)` })}"
|
|
230
|
-
>
|
|
231
|
-
${repeat(
|
|
232
|
-
this._options,
|
|
233
|
-
(option) => option,
|
|
234
|
-
(option, index) => html`${this._renderOption(option, index)}`,
|
|
235
|
-
)}
|
|
236
|
-
</div>`;
|
|
237
|
-
}
|
|
238
|
-
return html``;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
window.customElements.define('gv-option', GvOption);
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvOption=void 0;const t=require("lit");require("../atoms/gv-button");const e=require("lit/directives/repeat"),i=require("lit/directives/class-map"),s=require("../lib/events"),n=require("lit/directives/if-defined"),r=require("lit/directives/style-map");class o extends t.LitElement{static get properties(){return{options:{type:Array},_options:{type:Array,attribute:!1},_hasDescription:{type:Array,attribute:!1},value:{type:String,reflect:!0},multiple:{type:Boolean},reverse:{type:Boolean},small:{type:Boolean},outlined:{type:Boolean},disabled:{type:Boolean,reflect:!0}}}static get styles(){return[t.css`:host{box-sizing:border-box;display:inline-block;--gv-button--p:5px;margin:.2rem;--bdrs:var(--gv-option--bdrs, 0.15rem);--maw:var(--gv-option-button--maw, 200px)}.box.description{display:grid;grid-gap:.5rem}gv-button{margin:0}gv-button.description{flex:1 1 var(--maw);max-width:var(--maw)}gv-button:not(.description){margin:0;--gv-button--bdrs:0;--gv-button--bgc:var(--gv-option--bgc, var(--gv-theme-neutral-color-dark, #bfbfbf))}gv-button:not(.description).entry{--gv-button--bdrs:var(--bdrs) 0 0 var(--bdrs)}gv-button:not(.description).exit{--gv-button--bdrs:0 var(--bdrs) var(--bdrs) 0}.content{white-space:pre-line;--gv-icon--s:var(--gv-option-icon--s, 64px);display:flex;flex-direction:column;align-items:center;height:100%;text-transform:none}gv-image{height:64px;width:64px;--gv-image--of:fill;display:inline-flex}.reverse .content{flex-direction:column-reverse}.title{font-size:var(--gv-theme-font-size-l,18px);font-weight:700;margin:.5rem 0}gv-button.description{margin:.5rem}`]}constructor(){super(),this.multiple=!1,this.reverse=!1}_onClick(t){this.setValue(t),(0,s.dispatchCustomEvent)(this,"select",t),this.dispatchEvent(new Event("input"),{bubbles:!0,cancelable:!0})}async performUpdate(){return this.shadowRoot.querySelectorAll("gv-button").forEach((t=>t.performUpdate())),super.performUpdate()}setValue(t){t&&(this.multiple?this.value.includes(t.id)?this.value=this.value.filter((e=>e!==t.id)):this.value=[...this.value,t.id]:this.value=t.id)}set options(t){t&&Promise.all(t).then((t=>{this._options=t,this._hasDescription=null!=this._options.find((t=>null!=t.description))}))}isActive(t){return!!this.value&&(this.multiple?this.value.includes(t.id):this.value===t.id)}_renderOption(e,s){const r=this.isActive(e),o=this.outlined||!r&&this._hasDescription;return t.html`<gv-button .icon="${(0,n.ifDefined)(this._hasDescription?null:e.icon)}" .iconRight="${(0,n.ifDefined)(!e.icon&&e.iconRight?e.iconRight:null)}" .title="${(0,n.ifDefined)(e.title)}" .primary="${r}" .small="${this.small}" .disabled="${e.disabled||this.disabled}" @click="${this._onClick.bind(this,e)}" .outlined="${o}" class="${(0,i.classMap)({active:r,entry:0===s,exit:s===this._options.length-1,description:null!=e.description})}">${this._hasDescription?t.html`<div class="content">${e.icon?t.html`<gv-icon shape="${e.icon}"></gv-icon>`:e.image?t.html`<gv-image src="${e.image}"></gv-image>`:""}<div class="title">${e.title}</div><div class="description-content" .innerHTML="${e.description}"></div></div>`:null!=e.title?e.label||e.title:""}</gv-button>`}render(){if(this._options){const s={box:!0,description:this._hasDescription,reverse:this.reverse};return t.html`<div class="${(0,i.classMap)(s)}" style="${(0,r.styleMap)({"grid-template-columns":`repeat(${this._options.length}, auto)`})}">${(0,e.repeat)(this._options,(t=>t),((e,i)=>t.html`${this._renderOption(e,i)}`))}</div>`}return t.html``}}exports.GvOption=o,window.customElements.define("gv-option",o);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans
|
|
3
|
+
*
|
|
4
|
+
* ## Details
|
|
5
|
+
* * has @theme facet
|
|
6
|
+
*
|
|
7
|
+
* @fires input - Native input event when plan change
|
|
8
|
+
* @fires gv-plans:redirect - Event when user click to redirect link when plans are empty
|
|
9
|
+
*
|
|
10
|
+
* @attr {Array} plans - Plans list
|
|
11
|
+
* @attr {Number} current - The current plan index
|
|
12
|
+
* @attr {String} value - The current plan id
|
|
13
|
+
* @attr {Boolean} skeleton - enable skeleton screen UI pattern (loading hint)
|
|
14
|
+
*
|
|
15
|
+
* @cssprop {Color} [--gv-plans--bgc=var(--gv-theme-color, #5a7684)] - Background color
|
|
16
|
+
* @cssprop {Color} [--gv-plans-font--c=var(--gv-theme-font-color-light, #ffffff)] - Font color
|
|
17
|
+
* @cssprop {Color} [--gv-plans-characteristic--bgc=var(--gv-theme-color-light, #86c3d0)] - Characteristic background color
|
|
18
|
+
* @cssprop {Color} [--gv-plans-characteristics--bdc=var(--gv-theme-neutral-color, #f5f5f5)] - Characteristics border color
|
|
19
|
+
* @cssprop {Length} [--gv-plans-icon--s=24px] - Height and icon width
|
|
20
|
+
*/
|
|
21
|
+
export class GvPlans extends LitElement {
|
|
22
|
+
static get properties(): {
|
|
23
|
+
/**
|
|
24
|
+
* This List of Plan
|
|
25
|
+
* @type Object https://github.com/gravitee-io/gravitee-clients-sdk/blob/master/model/plan.ts
|
|
26
|
+
* @attr
|
|
27
|
+
* @required
|
|
28
|
+
*/
|
|
29
|
+
plans: Object;
|
|
30
|
+
current: {
|
|
31
|
+
type: NumberConstructor;
|
|
32
|
+
};
|
|
33
|
+
value: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
reflect: boolean;
|
|
36
|
+
};
|
|
37
|
+
skeleton: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
};
|
|
40
|
+
size: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
};
|
|
43
|
+
_empty: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
};
|
|
46
|
+
_plans: {
|
|
47
|
+
type: ArrayConstructor;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
static get styles(): import("lit").CSSResult[];
|
|
51
|
+
current: number;
|
|
52
|
+
size: number;
|
|
53
|
+
_plans: any[];
|
|
54
|
+
_empty: boolean;
|
|
55
|
+
get _characteristics(): any;
|
|
56
|
+
set plans(arg: any[]);
|
|
57
|
+
get plans(): any[];
|
|
58
|
+
skeleton: boolean | undefined;
|
|
59
|
+
value: any;
|
|
60
|
+
_error: boolean | undefined;
|
|
61
|
+
to(plan: any): void;
|
|
62
|
+
_getPlanTitle(plan: any): any;
|
|
63
|
+
_onRedirect(): void;
|
|
64
|
+
get hasPagination(): boolean;
|
|
65
|
+
get hasLeft(): boolean;
|
|
66
|
+
get hasRight(): boolean;
|
|
67
|
+
_renderHeader(plans: any): any;
|
|
68
|
+
_renderTriangles(plans: any): any;
|
|
69
|
+
_renderPagination(): "" | import("lit-html").TemplateResult<1>;
|
|
70
|
+
toLeft(): void;
|
|
71
|
+
toRight(): void;
|
|
72
|
+
}
|
|
73
|
+
import { LitElement } from "lit-element/lit-element";
|