@gravitee/ui-components 3.25.3-typescript-bfd8f67 → 3.25.3-typescript-94e8113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1292 -0
- package/LICENSE.txt +202 -0
- package/README.md +195 -0
- package/dist/src/atoms/gv-autocomplete.d.ts +104 -0
- package/dist/src/atoms/gv-autocomplete.js +422 -0
- package/dist/src/atoms/gv-button.d.ts +109 -0
- package/dist/src/atoms/gv-button.js +397 -0
- package/dist/src/atoms/gv-checkbox.d.ts +114 -0
- package/dist/src/atoms/gv-checkbox.js +178 -0
- package/dist/src/atoms/gv-date-picker-calendar.d.ts +190 -0
- package/dist/src/atoms/gv-date-picker-calendar.js +812 -0
- package/dist/src/atoms/gv-date-picker-cell.d.ts +80 -0
- package/dist/src/atoms/gv-date-picker-cell.js +174 -0
- package/dist/src/atoms/gv-date-picker.d.ts +194 -0
- package/dist/src/atoms/gv-date-picker.js +638 -0
- package/dist/src/atoms/gv-file-upload.d.ts +64 -0
- package/dist/src/atoms/gv-file-upload.js +348 -0
- package/dist/src/atoms/gv-icon.d.ts +26 -0
- package/dist/src/atoms/gv-icon.js +93 -0
- package/dist/src/atoms/gv-image.d.ts +45 -0
- package/dist/src/atoms/gv-image.js +135 -0
- package/dist/src/atoms/gv-input-message.d.ts +20 -0
- package/dist/src/atoms/gv-input-message.js +78 -0
- package/dist/src/atoms/gv-input.d.ts +246 -0
- package/dist/src/atoms/gv-input.js +508 -0
- package/dist/src/atoms/gv-link.d.ts +67 -0
- package/dist/src/atoms/gv-link.js +204 -0
- package/dist/src/atoms/gv-message.d.ts +23 -0
- package/dist/src/atoms/gv-message.js +133 -0
- package/dist/src/atoms/gv-metric.d.ts +32 -0
- package/dist/src/atoms/gv-metric.js +112 -0
- package/dist/src/atoms/gv-relative-time.d.ts +45 -0
- package/dist/src/atoms/gv-relative-time.js +143 -0
- package/dist/src/atoms/gv-select-native.d.ts +174 -0
- package/dist/src/atoms/gv-select-native.js +363 -0
- package/dist/src/atoms/gv-select.d.ts +71 -0
- package/dist/src/atoms/gv-select.js +413 -0
- package/dist/src/atoms/gv-spinner.d.ts +10 -0
- package/dist/src/atoms/gv-spinner.js +54 -0
- package/dist/src/atoms/gv-state.d.ts +50 -0
- package/dist/src/atoms/gv-state.js +125 -0
- package/dist/src/atoms/gv-switch.d.ts +60 -0
- package/dist/src/atoms/gv-switch.js +235 -0
- package/dist/src/atoms/gv-tag.d.ts +69 -0
- package/dist/src/atoms/gv-tag.js +162 -0
- package/dist/src/atoms/gv-text.d.ts +110 -0
- package/dist/src/atoms/gv-text.js +160 -0
- package/dist/src/charts/gv-chart-bar.d.ts +50 -0
- package/dist/src/charts/gv-chart-bar.js +101 -0
- package/dist/src/charts/gv-chart-gauge.d.ts +58 -0
- package/dist/src/charts/gv-chart-gauge.js +92 -0
- package/dist/src/charts/gv-chart-histogram.d.ts +48 -0
- package/dist/src/charts/gv-chart-histogram.js +78 -0
- package/dist/src/charts/gv-chart-line.d.ts +52 -0
- package/dist/src/charts/gv-chart-line.js +218 -0
- package/dist/src/charts/gv-chart-map.d.ts +50 -0
- package/dist/src/charts/gv-chart-map.js +111 -0
- package/dist/src/charts/gv-chart-pie.d.ts +50 -0
- package/dist/src/charts/gv-chart-pie.js +89 -0
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.js +77 -0
- package/dist/src/lib/cron-expression.d.ts +1 -0
- package/dist/src/lib/cron-expression.js +176 -0
- package/dist/src/lib/date.d.ts +1 -0
- package/dist/src/lib/date.js +43 -0
- package/dist/src/lib/events.d.ts +1 -0
- package/dist/src/lib/events.js +26 -0
- package/dist/src/lib/http-client-schema-form.d.ts +68 -0
- package/dist/src/lib/http-client-schema-form.js +67 -0
- package/dist/src/lib/http.d.ts +222 -0
- package/dist/src/lib/http.js +237 -0
- package/dist/src/lib/i18n.d.ts +30 -0
- package/dist/src/lib/i18n.js +93 -0
- package/dist/src/lib/item.d.ts +12 -0
- package/dist/src/lib/item.js +110 -0
- package/dist/src/lib/properties.d.ts +42 -0
- package/dist/src/lib/properties.js +171 -0
- package/dist/src/lib/schema-form.d.ts +5 -0
- package/dist/src/lib/schema-form.js +39 -0
- package/dist/src/lib/studio.d.ts +2 -0
- package/dist/src/lib/studio.js +144 -0
- package/dist/src/lib/style.d.ts +6 -0
- package/dist/src/lib/style.js +39 -0
- package/dist/src/lib/text-format.d.ts +6 -0
- package/dist/src/lib/text-format.js +65 -0
- package/dist/src/lib/theme.d.ts +4 -0
- package/dist/src/lib/theme.js +60 -0
- package/dist/src/lib/utils.d.ts +9 -0
- package/dist/src/lib/utils.js +106 -0
- package/dist/src/mixins/chart-element.d.ts +39 -0
- package/dist/src/mixins/chart-element.js +153 -0
- package/dist/src/mixins/input-element.d.ts +64 -0
- package/dist/src/mixins/input-element.js +136 -0
- package/dist/src/mixins/item-resource.d.ts +56 -0
- package/dist/src/mixins/item-resource.js +102 -0
- package/dist/src/mixins/keyboard-element.d.ts +25 -0
- package/dist/src/mixins/keyboard-element.js +62 -0
- package/dist/src/mixins/update-after-browser.d.ts +11 -0
- package/dist/src/mixins/update-after-browser.js +30 -0
- package/dist/src/mixins/with-resize-observer.d.ts +12 -0
- package/dist/src/mixins/with-resize-observer.js +62 -0
- package/dist/src/mixins/with-skeleton-attribute.d.ts +35 -0
- package/dist/src/mixins/with-skeleton-attribute.js +109 -0
- package/dist/src/molecules/gv-card-full.d.ts +78 -0
- package/dist/src/molecules/gv-card-full.js +209 -0
- package/dist/src/molecules/gv-card-list.d.ts +33 -0
- package/dist/src/molecules/gv-card-list.js +101 -0
- package/dist/src/molecules/gv-card.d.ts +65 -0
- package/dist/src/molecules/gv-card.js +130 -0
- package/dist/src/molecules/gv-category-list.d.ts +17 -0
- package/dist/src/molecules/gv-category-list.js +56 -0
- package/dist/src/molecules/gv-category.d.ts +64 -0
- package/dist/src/molecules/gv-category.js +163 -0
- package/dist/src/molecules/gv-code.d.ts +192 -0
- package/dist/src/molecules/gv-code.js +334 -0
- package/dist/src/molecules/gv-confirm.d.ts +60 -0
- package/dist/src/molecules/gv-confirm.js +175 -0
- package/dist/src/molecules/gv-cron-editor.d.ts +115 -0
- package/dist/src/molecules/gv-cron-editor.js +685 -0
- package/dist/src/molecules/gv-dropdown-menu.d.ts +28 -0
- package/dist/src/molecules/gv-dropdown-menu.js +108 -0
- package/dist/src/molecules/gv-expandable.d.ts +37 -0
- package/dist/src/molecules/gv-expandable.js +116 -0
- package/dist/src/molecules/gv-expression-language.d.ts +150 -0
- package/dist/src/molecules/gv-expression-language.js +263 -0
- package/dist/src/molecules/gv-identity-picture.d.ts +44 -0
- package/dist/src/molecules/gv-identity-picture.js +139 -0
- package/dist/src/molecules/gv-list.d.ts +123 -0
- package/dist/src/molecules/gv-list.js +214 -0
- package/dist/src/molecules/gv-metrics.d.ts +65 -0
- package/dist/src/molecules/gv-metrics.js +147 -0
- package/dist/src/molecules/gv-modal.d.ts +64 -0
- package/dist/src/molecules/gv-modal.js +203 -0
- package/dist/src/molecules/gv-nav.d.ts +41 -0
- package/dist/src/molecules/gv-nav.js +180 -0
- package/dist/src/molecules/gv-option.d.ts +65 -0
- package/dist/src/molecules/gv-option.js +230 -0
- package/dist/src/molecules/gv-plans.d.ts +73 -0
- package/dist/src/molecules/gv-plans.js +400 -0
- package/dist/src/molecules/gv-popover.d.ts +91 -0
- package/dist/src/molecules/gv-popover.js +323 -0
- package/dist/src/molecules/gv-promote.d.ts +108 -0
- package/dist/src/molecules/gv-promote.js +203 -0
- package/dist/src/molecules/gv-rating-list.d.ts +77 -0
- package/dist/src/molecules/gv-rating-list.js +341 -0
- package/dist/src/molecules/gv-rating.d.ts +55 -0
- package/dist/src/molecules/gv-rating.js +234 -0
- package/dist/src/molecules/gv-row-expandable.d.ts +8 -0
- package/dist/src/molecules/gv-row-expandable.js +42 -0
- package/dist/src/molecules/gv-row.d.ts +37 -0
- package/dist/src/molecules/gv-row.js +205 -0
- package/dist/src/molecules/gv-stats.d.ts +53 -0
- package/dist/src/molecules/gv-stats.js +110 -0
- package/dist/src/molecules/gv-stepper.d.ts +46 -0
- package/dist/src/molecules/gv-stepper.js +274 -0
- package/dist/src/molecules/gv-table.d.ts +159 -0
- package/dist/src/molecules/gv-table.js +644 -0
- package/dist/src/molecules/gv-tree.d.ts +44 -0
- package/dist/src/molecules/gv-tree.js +238 -0
- package/dist/src/organisms/gv-documentation.d.ts +52 -0
- package/dist/src/organisms/gv-documentation.js +205 -0
- package/dist/src/organisms/gv-header.d.ts +60 -0
- package/dist/src/organisms/gv-header.js +276 -0
- package/dist/src/organisms/gv-http-client.d.ts +57 -0
- package/dist/src/organisms/gv-http-client.js +258 -0
- package/dist/src/organisms/gv-menu.d.ts +74 -0
- package/dist/src/organisms/gv-menu.js +258 -0
- package/dist/src/organisms/gv-newsletter-subscription.d.ts +82 -0
- package/dist/src/organisms/gv-newsletter-subscription.js +258 -0
- package/dist/src/organisms/gv-pagination.d.ts +63 -0
- package/dist/src/organisms/gv-pagination.js +179 -0
- package/dist/src/organisms/gv-properties.d.ts +229 -0
- package/dist/src/organisms/gv-properties.js +860 -0
- package/dist/src/organisms/gv-resizable-views.d.ts +33 -0
- package/dist/src/organisms/gv-resizable-views.js +371 -0
- package/dist/src/organisms/gv-resources.d.ts +125 -0
- package/dist/src/organisms/gv-resources.js +496 -0
- package/dist/src/organisms/gv-schema-form-array.d.ts +55 -0
- package/dist/src/organisms/gv-schema-form-array.js +237 -0
- package/dist/src/organisms/gv-schema-form-control-object.d.ts +64 -0
- package/dist/src/organisms/gv-schema-form-control-object.js +141 -0
- package/dist/src/organisms/gv-schema-form-control.d.ts +90 -0
- package/dist/src/organisms/gv-schema-form-control.js +419 -0
- package/dist/src/organisms/gv-schema-form.d.ts +156 -0
- package/dist/src/organisms/gv-schema-form.js +700 -0
- package/dist/src/organisms/gv-tabs.d.ts +56 -0
- package/dist/src/organisms/gv-tabs.js +201 -0
- package/dist/src/organisms/gv-user-menu.d.ts +56 -0
- package/dist/src/organisms/gv-user-menu.js +298 -0
- package/dist/src/organisms/gv-vertical-menu.d.ts +28 -0
- package/dist/src/organisms/gv-vertical-menu.js +119 -0
- package/dist/src/policy-studio/gv-flow-step.d.ts +142 -0
- package/dist/src/policy-studio/gv-flow-step.js +443 -0
- package/dist/src/policy-studio/gv-flow.d.ts +89 -0
- package/dist/src/policy-studio/gv-flow.js +595 -0
- package/dist/src/policy-studio/gv-policy-studio-menu.d.ts +94 -0
- package/dist/src/policy-studio/gv-policy-studio-menu.js +689 -0
- package/dist/src/policy-studio/gv-policy-studio.d.ts +464 -0
- package/dist/src/policy-studio/gv-policy-studio.js +1712 -0
- package/dist/src/styles/empty.d.ts +1 -0
- package/dist/src/styles/empty.js +35 -0
- package/dist/src/styles/input.d.ts +1 -0
- package/dist/src/styles/input.js +262 -0
- package/dist/src/styles/link.d.ts +1 -0
- package/dist/src/styles/link.js +31 -0
- package/dist/src/styles/shapes.d.ts +2 -0
- package/dist/src/styles/shapes.js +17 -0
- package/dist/src/styles/skeleton.d.ts +1 -0
- package/dist/src/styles/skeleton.js +52 -0
- package/dist/src/styles/zoom.d.ts +1 -0
- package/dist/src/styles/zoom.js +39 -0
- package/dist/src/theme/gv-theme.d.ts +81 -0
- package/dist/src/theme/gv-theme.js +197 -0
- package/dist/wc/gv-autocomplete.d.ts +1 -0
- package/dist/wc/gv-autocomplete.js +1 -0
- package/dist/wc/gv-button.d.ts +1 -0
- package/dist/wc/gv-button.js +1 -0
- package/dist/wc/gv-card-full.d.ts +1 -0
- package/dist/wc/gv-card-full.js +1 -0
- package/dist/wc/gv-card-list.d.ts +1 -0
- package/dist/wc/gv-card-list.js +1 -0
- package/dist/wc/gv-card.d.ts +1 -0
- package/dist/wc/gv-card.js +1 -0
- package/dist/wc/gv-category-list.d.ts +1 -0
- package/dist/wc/gv-category-list.js +1 -0
- package/dist/wc/gv-category.d.ts +1 -0
- package/dist/wc/gv-category.js +1 -0
- package/dist/wc/gv-chart-bar.d.ts +1 -0
- package/dist/wc/gv-chart-bar.js +1 -0
- package/dist/wc/gv-chart-gauge.d.ts +1 -0
- package/dist/wc/gv-chart-gauge.js +1 -0
- package/dist/wc/gv-chart-histogram.d.ts +1 -0
- package/dist/wc/gv-chart-histogram.js +1 -0
- package/dist/wc/gv-chart-line.d.ts +1 -0
- package/dist/wc/gv-chart-line.js +1 -0
- package/dist/wc/gv-chart-map.d.ts +1 -0
- package/dist/wc/gv-chart-map.js +1 -0
- package/dist/wc/gv-chart-pie.d.ts +1 -0
- package/dist/wc/gv-chart-pie.js +1 -0
- package/dist/wc/gv-checkbox.d.ts +1 -0
- package/dist/wc/gv-checkbox.js +1 -0
- package/dist/wc/gv-code.d.ts +1 -0
- package/dist/wc/gv-code.js +1 -0
- package/dist/wc/gv-confirm.d.ts +1 -0
- package/dist/wc/gv-confirm.js +1 -0
- package/dist/wc/gv-cron-editor.d.ts +1 -0
- package/dist/wc/gv-cron-editor.js +1 -0
- package/dist/wc/gv-date-picker-calendar.d.ts +1 -0
- package/dist/wc/gv-date-picker-calendar.js +1 -0
- package/dist/wc/gv-date-picker-cell.d.ts +1 -0
- package/dist/wc/gv-date-picker-cell.js +1 -0
- package/dist/wc/gv-date-picker.d.ts +1 -0
- package/dist/wc/gv-date-picker.js +1 -0
- package/dist/wc/gv-documentation.d.ts +1 -0
- package/dist/wc/gv-documentation.js +1 -0
- package/dist/wc/gv-dropdown-menu.d.ts +1 -0
- package/dist/wc/gv-dropdown-menu.js +1 -0
- package/dist/wc/gv-expandable.d.ts +1 -0
- package/dist/wc/gv-expandable.js +1 -0
- package/dist/wc/gv-expression-language.d.ts +1 -0
- package/dist/wc/gv-expression-language.js +1 -0
- package/dist/wc/gv-file-upload.d.ts +1 -0
- package/dist/wc/gv-file-upload.js +1 -0
- package/dist/wc/gv-flow-step.d.ts +1 -0
- package/dist/wc/gv-flow-step.js +1 -0
- package/dist/wc/gv-flow.d.ts +1 -0
- package/dist/wc/gv-flow.js +1 -0
- package/dist/wc/gv-header.d.ts +1 -0
- package/dist/wc/gv-header.js +1 -0
- package/dist/wc/gv-http-client.d.ts +1 -0
- package/dist/wc/gv-http-client.js +1 -0
- package/dist/wc/gv-icon.d.ts +1 -0
- package/dist/wc/gv-icon.js +1 -0
- package/dist/wc/gv-identity-picture.d.ts +1 -0
- package/dist/wc/gv-identity-picture.js +1 -0
- package/dist/wc/gv-image.d.ts +1 -0
- package/dist/wc/gv-image.js +1 -0
- package/dist/wc/gv-input-message.d.ts +1 -0
- package/dist/wc/gv-input-message.js +1 -0
- package/dist/wc/gv-input.d.ts +1 -0
- package/dist/wc/gv-input.js +1 -0
- package/dist/wc/gv-link.d.ts +1 -0
- package/dist/wc/gv-link.js +1 -0
- package/dist/wc/gv-list.d.ts +1 -0
- package/dist/wc/gv-list.js +1 -0
- package/dist/wc/gv-menu.d.ts +1 -0
- package/dist/wc/gv-menu.js +1 -0
- package/dist/wc/gv-message.d.ts +1 -0
- package/dist/wc/gv-message.js +1 -0
- package/dist/wc/gv-metric.d.ts +1 -0
- package/dist/wc/gv-metric.js +1 -0
- package/dist/wc/gv-metrics.d.ts +1 -0
- package/dist/wc/gv-metrics.js +1 -0
- package/dist/wc/gv-modal.d.ts +1 -0
- package/dist/wc/gv-modal.js +1 -0
- package/dist/wc/gv-nav.d.ts +1 -0
- package/dist/wc/gv-nav.js +1 -0
- package/dist/wc/gv-newsletter-subscription.d.ts +1 -0
- package/dist/wc/gv-newsletter-subscription.js +1 -0
- package/dist/wc/gv-option.d.ts +1 -0
- package/dist/wc/gv-option.js +1 -0
- package/dist/wc/gv-pagination.d.ts +1 -0
- package/dist/wc/gv-pagination.js +1 -0
- package/dist/wc/gv-plans.d.ts +1 -0
- package/dist/wc/gv-plans.js +1 -0
- package/dist/wc/gv-policy-studio-menu.d.ts +1 -0
- package/dist/wc/gv-policy-studio-menu.js +1 -0
- package/dist/wc/gv-policy-studio.d.ts +1 -0
- package/dist/wc/gv-policy-studio.js +1 -0
- package/dist/wc/gv-popover.d.ts +1 -0
- package/dist/wc/gv-popover.js +1 -0
- package/dist/wc/gv-promote.d.ts +1 -0
- package/dist/wc/gv-promote.js +1 -0
- package/dist/wc/gv-properties.d.ts +1 -0
- package/dist/wc/gv-properties.js +1 -0
- package/dist/wc/gv-rating-list.d.ts +1 -0
- package/dist/wc/gv-rating-list.js +1 -0
- package/dist/wc/gv-rating.d.ts +1 -0
- package/dist/wc/gv-rating.js +1 -0
- package/dist/wc/gv-relative-time.d.ts +1 -0
- package/dist/wc/gv-relative-time.js +1 -0
- package/dist/wc/gv-resizable-views.d.ts +1 -0
- package/dist/wc/gv-resizable-views.js +1 -0
- package/dist/wc/gv-resources.d.ts +1 -0
- package/dist/wc/gv-resources.js +1 -0
- package/dist/wc/gv-row-expandable.d.ts +1 -0
- package/dist/wc/gv-row-expandable.js +1 -0
- package/dist/wc/gv-row.d.ts +1 -0
- package/dist/wc/gv-row.js +1 -0
- package/dist/wc/gv-schema-form-array.d.ts +1 -0
- package/dist/wc/gv-schema-form-array.js +1 -0
- package/dist/wc/gv-schema-form-control-object.d.ts +1 -0
- package/dist/wc/gv-schema-form-control-object.js +1 -0
- package/dist/wc/gv-schema-form-control.d.ts +1 -0
- package/dist/wc/gv-schema-form-control.js +1 -0
- package/dist/wc/gv-schema-form.d.ts +1 -0
- package/dist/wc/gv-schema-form.js +1 -0
- package/dist/wc/gv-select-native.d.ts +1 -0
- package/dist/wc/gv-select-native.js +1 -0
- package/dist/wc/gv-select.d.ts +1 -0
- package/dist/wc/gv-select.js +1 -0
- package/dist/wc/gv-spinner.d.ts +1 -0
- package/dist/wc/gv-spinner.js +1 -0
- package/dist/wc/gv-state.d.ts +1 -0
- package/dist/wc/gv-state.js +1 -0
- package/dist/wc/gv-stats.d.ts +1 -0
- package/dist/wc/gv-stats.js +1 -0
- package/dist/wc/gv-stepper.d.ts +1 -0
- package/dist/wc/gv-stepper.js +1 -0
- package/dist/wc/gv-switch.d.ts +1 -0
- package/dist/wc/gv-switch.js +1 -0
- package/dist/wc/gv-table.d.ts +1 -0
- package/dist/wc/gv-table.js +1 -0
- package/dist/wc/gv-tabs.d.ts +1 -0
- package/dist/wc/gv-tabs.js +1 -0
- package/dist/wc/gv-tag.d.ts +1 -0
- package/dist/wc/gv-tag.js +1 -0
- package/dist/wc/gv-text.d.ts +1 -0
- package/dist/wc/gv-text.js +1 -0
- package/dist/wc/gv-theme.d.ts +1 -0
- package/dist/wc/gv-theme.js +1 -0
- package/dist/wc/gv-tree.d.ts +1 -0
- package/dist/wc/gv-tree.js +1 -0
- package/dist/wc/gv-user-menu.d.ts +1 -0
- package/dist/wc/gv-user-menu.js +1 -0
- package/dist/wc/gv-vertical-menu.d.ts +1 -0
- package/dist/wc/gv-vertical-menu.js +1 -0
- package/package.json +8 -16
- package/src/atoms/gv-autocomplete.js +0 -1
- package/src/atoms/gv-button.js +0 -1
- package/src/atoms/gv-checkbox.js +0 -1
- package/src/atoms/gv-date-picker-calendar.js +0 -1
- package/src/atoms/gv-date-picker-cell.js +0 -1
- package/src/atoms/gv-date-picker.js +0 -1
- package/src/atoms/gv-file-upload.js +0 -1
- package/src/atoms/gv-icon.js +0 -1
- package/src/atoms/gv-image.js +0 -1
- package/src/atoms/gv-input-message.js +0 -1
- package/src/atoms/gv-input.js +0 -1
- package/src/atoms/gv-link.js +0 -1
- package/src/atoms/gv-message.js +0 -1
- package/src/atoms/gv-metric.js +0 -1
- package/src/atoms/gv-relative-time.js +0 -1
- package/src/atoms/gv-select-native.js +0 -1
- package/src/atoms/gv-select.js +0 -1
- package/src/atoms/gv-spinner.js +0 -1
- package/src/atoms/gv-state.js +0 -1
- package/src/atoms/gv-switch.js +0 -1
- package/src/atoms/gv-tag.js +0 -1
- package/src/atoms/gv-text.js +0 -1
- package/src/charts/gv-chart-bar.js +0 -1
- package/src/charts/gv-chart-gauge.js +0 -1
- package/src/charts/gv-chart-histogram.js +0 -1
- package/src/charts/gv-chart-line.js +0 -1
- package/src/charts/gv-chart-map.js +0 -1
- package/src/charts/gv-chart-pie.js +0 -1
- package/src/index.js +0 -1
- package/src/lib/cron-expression.js +0 -1
- package/src/lib/date.js +0 -1
- package/src/lib/events.js +0 -1
- package/src/lib/http-client-schema-form.js +0 -1
- package/src/lib/http.js +0 -1
- package/src/lib/i18n.js +0 -1
- package/src/lib/item.js +0 -1
- package/src/lib/properties.js +0 -1
- package/src/lib/schema-form.js +0 -1
- package/src/lib/studio.js +0 -1
- package/src/lib/style.js +0 -1
- package/src/lib/text-format.js +0 -1
- package/src/lib/theme.js +0 -1
- package/src/lib/utils.js +0 -1
- package/src/mixins/chart-element.js +0 -1
- package/src/mixins/input-element.js +0 -1
- package/src/mixins/item-resource.js +0 -1
- package/src/mixins/keyboard-element.js +0 -1
- package/src/mixins/update-after-browser.js +0 -1
- package/src/mixins/with-resize-observer.js +0 -1
- package/src/mixins/with-skeleton-attribute.js +0 -1
- package/src/molecules/gv-card-full.js +0 -1
- package/src/molecules/gv-card-list.js +0 -1
- package/src/molecules/gv-card.js +0 -1
- package/src/molecules/gv-category-list.js +0 -1
- package/src/molecules/gv-category.js +0 -1
- package/src/molecules/gv-code.js +0 -1
- package/src/molecules/gv-confirm.js +0 -1
- package/src/molecules/gv-cron-editor.js +0 -1
- package/src/molecules/gv-dropdown-menu.js +0 -1
- package/src/molecules/gv-expandable.js +0 -1
- package/src/molecules/gv-expression-language.js +0 -1
- package/src/molecules/gv-identity-picture.js +0 -1
- package/src/molecules/gv-list.js +0 -1
- package/src/molecules/gv-metrics.js +0 -1
- package/src/molecules/gv-modal.js +0 -1
- package/src/molecules/gv-nav.js +0 -1
- package/src/molecules/gv-option.js +0 -1
- package/src/molecules/gv-plans.js +0 -1
- package/src/molecules/gv-popover.js +0 -1
- package/src/molecules/gv-promote.js +0 -1
- package/src/molecules/gv-rating-list.js +0 -1
- package/src/molecules/gv-rating.js +0 -1
- package/src/molecules/gv-row-expandable.js +0 -1
- package/src/molecules/gv-row.js +0 -1
- package/src/molecules/gv-stats.js +0 -1
- package/src/molecules/gv-stepper.js +0 -1
- package/src/molecules/gv-table.js +0 -1
- package/src/molecules/gv-tree.js +0 -1
- package/src/organisms/gv-documentation.js +0 -1
- package/src/organisms/gv-header.js +0 -1
- package/src/organisms/gv-http-client.js +0 -1
- package/src/organisms/gv-menu.js +0 -1
- package/src/organisms/gv-newsletter-subscription.js +0 -1
- package/src/organisms/gv-pagination.js +0 -1
- package/src/organisms/gv-properties.js +0 -1
- package/src/organisms/gv-resizable-views.js +0 -1
- package/src/organisms/gv-resources.js +0 -1
- package/src/organisms/gv-schema-form-array.js +0 -1
- package/src/organisms/gv-schema-form-control-object.js +0 -1
- package/src/organisms/gv-schema-form-control.js +0 -1
- package/src/organisms/gv-schema-form.js +0 -1
- package/src/organisms/gv-tabs.js +0 -1
- package/src/organisms/gv-user-menu.js +0 -1
- package/src/organisms/gv-vertical-menu.js +0 -1
- package/src/policy-studio/gv-flow-step.js +0 -1
- package/src/policy-studio/gv-flow.js +0 -1
- package/src/policy-studio/gv-policy-studio-menu.js +0 -1
- package/src/policy-studio/gv-policy-studio.js +0 -1
- package/src/styles/empty.js +0 -1
- package/src/styles/input.js +0 -1
- package/src/styles/link.js +0 -1
- package/src/styles/shapes.js +0 -1
- package/src/styles/skeleton.js +0 -1
- package/src/styles/zoom.js +0 -1
- package/src/theme/gv-theme.js +0 -1
- package/wc/gv-autocomplete.js +0 -1
- package/wc/gv-button.js +0 -1
- package/wc/gv-card-full.js +0 -1
- package/wc/gv-card-list.js +0 -1
- package/wc/gv-card.js +0 -1
- package/wc/gv-category-list.js +0 -1
- package/wc/gv-category.js +0 -1
- package/wc/gv-chart-bar.js +0 -1
- package/wc/gv-chart-gauge.js +0 -1
- package/wc/gv-chart-histogram.js +0 -1
- package/wc/gv-chart-line.js +0 -1
- package/wc/gv-chart-map.js +0 -1
- package/wc/gv-chart-pie.js +0 -1
- package/wc/gv-checkbox.js +0 -1
- package/wc/gv-code.js +0 -1
- package/wc/gv-confirm.js +0 -1
- package/wc/gv-cron-editor.js +0 -1
- package/wc/gv-date-picker-calendar.js +0 -1
- package/wc/gv-date-picker-cell.js +0 -1
- package/wc/gv-date-picker.js +0 -1
- package/wc/gv-documentation.js +0 -1
- package/wc/gv-dropdown-menu.js +0 -1
- package/wc/gv-expandable.js +0 -1
- package/wc/gv-expression-language.js +0 -1
- package/wc/gv-file-upload.js +0 -1
- package/wc/gv-flow-step.js +0 -1
- package/wc/gv-flow.js +0 -1
- package/wc/gv-header.js +0 -1
- package/wc/gv-http-client.js +0 -1
- package/wc/gv-icon.js +0 -1
- package/wc/gv-identity-picture.js +0 -1
- package/wc/gv-image.js +0 -1
- package/wc/gv-input-message.js +0 -1
- package/wc/gv-input.js +0 -1
- package/wc/gv-link.js +0 -1
- package/wc/gv-list.js +0 -1
- package/wc/gv-menu.js +0 -1
- package/wc/gv-message.js +0 -1
- package/wc/gv-metric.js +0 -1
- package/wc/gv-metrics.js +0 -1
- package/wc/gv-modal.js +0 -1
- package/wc/gv-nav.js +0 -1
- package/wc/gv-newsletter-subscription.js +0 -1
- package/wc/gv-option.js +0 -1
- package/wc/gv-pagination.js +0 -1
- package/wc/gv-plans.js +0 -1
- package/wc/gv-policy-studio-menu.js +0 -1
- package/wc/gv-policy-studio.js +0 -1
- package/wc/gv-popover.js +0 -1
- package/wc/gv-promote.js +0 -1
- package/wc/gv-properties.js +0 -1
- package/wc/gv-rating-list.js +0 -1
- package/wc/gv-rating.js +0 -1
- package/wc/gv-relative-time.js +0 -1
- package/wc/gv-resizable-views.js +0 -1
- package/wc/gv-resources.js +0 -1
- package/wc/gv-row-expandable.js +0 -1
- package/wc/gv-row.js +0 -1
- package/wc/gv-schema-form-array.js +0 -1
- package/wc/gv-schema-form-control-object.js +0 -1
- package/wc/gv-schema-form-control.js +0 -1
- package/wc/gv-schema-form.js +0 -1
- package/wc/gv-select-native.js +0 -1
- package/wc/gv-select.js +0 -1
- package/wc/gv-spinner.js +0 -1
- package/wc/gv-state.js +0 -1
- package/wc/gv-stats.js +0 -1
- package/wc/gv-stepper.js +0 -1
- package/wc/gv-switch.js +0 -1
- package/wc/gv-table.js +0 -1
- package/wc/gv-tabs.js +0 -1
- package/wc/gv-tag.js +0 -1
- package/wc/gv-text.js +0 -1
- package/wc/gv-theme.js +0 -1
- package/wc/gv-tree.js +0 -1
- package/wc/gv-user-menu.js +0 -1
- package/wc/gv-vertical-menu.js +0 -1
|
@@ -0,0 +1,644 @@
|
|
|
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 { empty } from '../styles/empty';
|
|
19
|
+
import { link } from '../styles/link';
|
|
20
|
+
import { classMap } from 'lit/directives/class-map';
|
|
21
|
+
import { repeat } from 'lit/directives/repeat';
|
|
22
|
+
import { dispatchCustomEvent } from '../lib/events';
|
|
23
|
+
import { getLanguage, i18n } from '../lib/i18n';
|
|
24
|
+
import { until } from 'lit/directives/until';
|
|
25
|
+
import { styleMap } from 'lit/directives/style-map';
|
|
26
|
+
import { withResizeObserver } from '../mixins/with-resize-observer';
|
|
27
|
+
import { ifDefined } from 'lit/directives/if-defined';
|
|
28
|
+
import '../atoms/gv-image';
|
|
29
|
+
import '../organisms/gv-pagination';
|
|
30
|
+
import { getCssVar } from '../lib/style';
|
|
31
|
+
/**
|
|
32
|
+
* Table component
|
|
33
|
+
*
|
|
34
|
+
* ## Details
|
|
35
|
+
* * has @theme facet
|
|
36
|
+
*
|
|
37
|
+
* @fires gv-table:select - when table row is selected
|
|
38
|
+
* @fires gv-table:mouseenter - when the pointer is entering on a table row
|
|
39
|
+
* @fires gv-table:mouseleave - when the pointer is leaving a table row
|
|
40
|
+
* @fires gv-table:sort - when the order is changed
|
|
41
|
+
*
|
|
42
|
+
* @attr {Array<any>} items - A list of items to display
|
|
43
|
+
* @attr {String} title - A title to display
|
|
44
|
+
* @attr {String} order - If defined, the table will be ordered by the field. Start with '-' to sort in desc
|
|
45
|
+
* @attr {Array<any>} options - The list of options to display
|
|
46
|
+
* @attr {Boolean} noheader - Used to hide the table header
|
|
47
|
+
* @attr {Boolean} nosort - Used to disable the click on header to sort
|
|
48
|
+
* @attr {String} rowsheight - The height of the table rows
|
|
49
|
+
* @attr {String} rowheight - The height of the table single row
|
|
50
|
+
* @attr {String} emptymessage - The empty message to display
|
|
51
|
+
* @attr {Function} format - A function to format table headers and string cells
|
|
52
|
+
* @attr {Function} compareFn - A function to define how to sort. Default function will sort selected field ignoring case
|
|
53
|
+
* @attr {Array<any>} selected - A list of selected ids of the items displayed
|
|
54
|
+
* @attr {String} total - Total of data displayed on the table (useful with in case of pagination)
|
|
55
|
+
* @attr {Boolean} skeleton - Force gv-table to be in skeleton mode
|
|
56
|
+
*
|
|
57
|
+
* @cssprop {Color} [--gv-table-selected--bgc=var(--gv-theme-color, #5a7684)] - Selected background color
|
|
58
|
+
* @cssprop {Color} [--gv-table-hover--bgc=var(--gv-theme-neutral-color-lighter, #fafafa)] - Row background color on hover
|
|
59
|
+
* @cssprop {Color} [--gv-table--bgc=var(--gv-theme-neutral-color-lightest, #ffffff)] - Background color
|
|
60
|
+
* @cssprop {Color} [--gv-table--bdc=var(--gv-theme-neutral-color-dark, #d9d9d9)] - Border color
|
|
61
|
+
* @cssprop {String} [--gv-table-header--fz=var(--gv-theme-font-size-l, 20px)] - Title font size
|
|
62
|
+
* @cssprop {Length} [--gv-table-header--p=2rem 4rem] - Title padding
|
|
63
|
+
* @cssprop {String} [--gv-table-rows--ov=auto] - Overflow on table
|
|
64
|
+
* @cssprop {Length} [--gv-table--colmg=0.2rem] - Column gap
|
|
65
|
+
* @cssprop {String} [--gv-table-row--ai=center] - Row align-items
|
|
66
|
+
* @cssprop {String} [--gv-table-row--ac=center] - Row align-content
|
|
67
|
+
* @cssprop {String} [--gv-table-cell--d=flex] - Cell display
|
|
68
|
+
*/
|
|
69
|
+
export class GvTable extends withResizeObserver(LitElement) {
|
|
70
|
+
static get properties() {
|
|
71
|
+
return {
|
|
72
|
+
items: { type: Array },
|
|
73
|
+
title: { type: String },
|
|
74
|
+
order: { type: String },
|
|
75
|
+
options: { type: Array },
|
|
76
|
+
noheader: { type: Boolean },
|
|
77
|
+
nosort: { type: Boolean },
|
|
78
|
+
rowsheight: { type: String },
|
|
79
|
+
rowheight: { type: String },
|
|
80
|
+
emptymessage: { type: String },
|
|
81
|
+
format: { type: Function },
|
|
82
|
+
compareFn: { type: Function },
|
|
83
|
+
selected: { type: Array, reflect: true },
|
|
84
|
+
total: { type: String },
|
|
85
|
+
skeleton: { type: Boolean },
|
|
86
|
+
_items: { type: Array, attribute: false },
|
|
87
|
+
_skeleton: { type: Boolean, attribute: false },
|
|
88
|
+
_error: { type: Boolean, attribute: false },
|
|
89
|
+
_empty: { type: Boolean, attribute: false },
|
|
90
|
+
_itemsProvider: { type: Array, attribute: false },
|
|
91
|
+
_page: { type: Number, attribute: false },
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get styles() {
|
|
95
|
+
return [
|
|
96
|
+
link,
|
|
97
|
+
skeleton,
|
|
98
|
+
empty,
|
|
99
|
+
// language=CSS
|
|
100
|
+
css `
|
|
101
|
+
:host {
|
|
102
|
+
--selected--bgc: var(--gv-table-selected--bgc, var(--gv-theme-color, #5a7684));
|
|
103
|
+
--hover-bgc: var(--gv-table-hover--bgc, var(--gv-theme-neutral-color-lighter, #fafafa));
|
|
104
|
+
--bgc: var(--gv-table--bgc, var(--gv-theme-neutral-color-lightest, #ffffff));
|
|
105
|
+
--bdc: var(--gv-table--bdc, var(--gv-theme-neutral-color-dark, #d9d9d9));
|
|
106
|
+
display: block;
|
|
107
|
+
height: 100%;
|
|
108
|
+
margin: 0.2rem;
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.table {
|
|
113
|
+
background-color: var(--bgc);
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
height: 100%;
|
|
116
|
+
display: flex;
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.rows {
|
|
121
|
+
-ms-overflow-style: none;
|
|
122
|
+
scrollbar-width: none;
|
|
123
|
+
overflow: var(--gv-table-rows--ov, auto);
|
|
124
|
+
flex: 1;
|
|
125
|
+
height: 100%;
|
|
126
|
+
transition: height 250ms ease-in-out;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.rows::-webkit-scrollbar {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([w-lt-768]) .row {
|
|
134
|
+
height: 70px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([w-lt-580]) .row {
|
|
138
|
+
height: 60px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:host([w-lt-400]) .row {
|
|
142
|
+
height: 50px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.theader {
|
|
146
|
+
background-color: var(--gv-theme-neutral-color-lighter);
|
|
147
|
+
font-weight: bold;
|
|
148
|
+
padding: 0 0.2rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.row,
|
|
152
|
+
.theader {
|
|
153
|
+
align-items: var(--gv-table-row--ai, center);
|
|
154
|
+
align-content: var(--gv-table-row--ac, center);
|
|
155
|
+
border-right: solid thick transparent;
|
|
156
|
+
display: grid;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
div {
|
|
160
|
+
box-sizing: border-box;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.cell {
|
|
164
|
+
height: 100%;
|
|
165
|
+
display: var(--gv-table-cell--d, flex);
|
|
166
|
+
align-items: center;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.row:not(:last-child) {
|
|
170
|
+
box-shadow: 0 5px 3px -6px var(--bdc);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.row:hover,
|
|
174
|
+
.row.selected {
|
|
175
|
+
background-color: var(--hover-bgc);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.row.selected {
|
|
179
|
+
border-color: var(--selected--bgc);
|
|
180
|
+
box-sizing: border-box;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.header {
|
|
184
|
+
border-bottom: 1px solid var(--bdc);
|
|
185
|
+
padding: var(--gv-table-header--p, 2rem 4rem);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.title {
|
|
189
|
+
margin: 0;
|
|
190
|
+
text-transform: uppercase;
|
|
191
|
+
font-size: var(--gv-table-header--fz, var(--gv-theme-font-size-l, 20px));
|
|
192
|
+
line-height: var(--gv-table-header--fz, var(--gv-theme-font-size-l, 20px));
|
|
193
|
+
opacity: 0.6;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.title span {
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
font-size: var(--gv-theme-font-size-s);
|
|
199
|
+
line-height: var(--gv-theme-font-size-s);
|
|
200
|
+
margin-left: 8px;
|
|
201
|
+
opacity: 0.7;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
gv-identity-picture {
|
|
205
|
+
height: 35px;
|
|
206
|
+
width: 35px;
|
|
207
|
+
--gv-image--of: contain;
|
|
208
|
+
margin-left: 20px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
gv-icon {
|
|
212
|
+
transform: rotate(0deg);
|
|
213
|
+
--gv-icon--s: 18px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
gv-icon.desc {
|
|
217
|
+
transform: rotate(180deg);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
gv-pagination {
|
|
221
|
+
align-self: flex-end;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.cell > *:not(gv-tag) {
|
|
225
|
+
margin: auto;
|
|
226
|
+
width: 100%;
|
|
227
|
+
}
|
|
228
|
+
`,
|
|
229
|
+
];
|
|
230
|
+
}
|
|
231
|
+
constructor() {
|
|
232
|
+
super();
|
|
233
|
+
this._id = new Date().getTime();
|
|
234
|
+
this.breakpoints = {
|
|
235
|
+
width: [400, 580, 768],
|
|
236
|
+
};
|
|
237
|
+
this._empty = false;
|
|
238
|
+
this.order = '';
|
|
239
|
+
this._page = 1;
|
|
240
|
+
this._itemsProvider = [];
|
|
241
|
+
this.selected = [];
|
|
242
|
+
this.compareFn = (item, item2, value) => {
|
|
243
|
+
const itemData = this._getDataFromField(item, value) && this._getDataFromField(item, value).toLowerCase
|
|
244
|
+
? this._getDataFromField(item, value).toLowerCase()
|
|
245
|
+
: '';
|
|
246
|
+
const itemData2 = this._getDataFromField(item2, value) && this._getDataFromField(item2, value).toLowerCase
|
|
247
|
+
? this._getDataFromField(item2, value).toLowerCase()
|
|
248
|
+
: '';
|
|
249
|
+
if (this.order.startsWith('-')) {
|
|
250
|
+
return itemData2.localeCompare(itemData);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
return itemData.localeCompare(itemData2);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
this.addEventListener('gv-pagination:paginate', (e) => {
|
|
257
|
+
this._page = e.detail.page;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
set items(items) {
|
|
261
|
+
this._skeleton = true;
|
|
262
|
+
Promise.resolve(items)
|
|
263
|
+
.then((items) => {
|
|
264
|
+
if (items) {
|
|
265
|
+
this._itemsProvider = items.map((item, index) => {
|
|
266
|
+
item._id = item.id == null ? index : item.id;
|
|
267
|
+
return item;
|
|
268
|
+
});
|
|
269
|
+
this._onSortChanged();
|
|
270
|
+
this._empty = this._itemsProvider.length === 0;
|
|
271
|
+
this._skeleton = false;
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
.catch((e) => {
|
|
275
|
+
console.error(e);
|
|
276
|
+
this._error = true;
|
|
277
|
+
this._skeleton = false;
|
|
278
|
+
this._itemsProvider = [];
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
get items() {
|
|
282
|
+
return this._itemsProvider;
|
|
283
|
+
}
|
|
284
|
+
_onSortChanged(field, e) {
|
|
285
|
+
if (e) {
|
|
286
|
+
e.preventDefault();
|
|
287
|
+
}
|
|
288
|
+
if (this._itemsProvider && this.order) {
|
|
289
|
+
const desc = this.order.startsWith('-');
|
|
290
|
+
const previousOrder = desc ? this.order.substring(1) : this.order;
|
|
291
|
+
const value = field || previousOrder;
|
|
292
|
+
if (field) {
|
|
293
|
+
this.order = previousOrder === value ? (desc ? value : '-' + value) : value;
|
|
294
|
+
}
|
|
295
|
+
this._itemsProvider = this._itemsProvider.sort((item, item2) => this.compareFn(item, item2, value));
|
|
296
|
+
if (field) {
|
|
297
|
+
dispatchCustomEvent(this, 'sort', { order: this.order });
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
get _items() {
|
|
302
|
+
if (this._itemsProvider) {
|
|
303
|
+
if (this.options && this.options.paging && this.options.paging < this._itemsProvider.length) {
|
|
304
|
+
const index = (this._page - 1) * this.options.paging;
|
|
305
|
+
return [...this._itemsProvider].splice(index, this.options.paging);
|
|
306
|
+
}
|
|
307
|
+
return this._itemsProvider;
|
|
308
|
+
}
|
|
309
|
+
return [];
|
|
310
|
+
}
|
|
311
|
+
_getItemId(item) {
|
|
312
|
+
return item.id == null ? item._id : item.id;
|
|
313
|
+
}
|
|
314
|
+
_onSelect(item, event) {
|
|
315
|
+
if (!this._skeleton && !event.target.dataset.preventSelect) {
|
|
316
|
+
if (this.options.selectable) {
|
|
317
|
+
const itemId = this._getItemId(item);
|
|
318
|
+
if (this._isSelected(item)) {
|
|
319
|
+
this.selected = this.selected.filter((id) => itemId !== id);
|
|
320
|
+
}
|
|
321
|
+
else if (this.options.selectable === 'multi') {
|
|
322
|
+
this.selected = [...this.selected, itemId];
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
this.selected = [itemId];
|
|
326
|
+
}
|
|
327
|
+
dispatchCustomEvent(this, 'select', { items: this.selectedItems, options: this.options });
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
dispatchCustomEvent(this, 'select', { items: [item] });
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
get selectedItems() {
|
|
335
|
+
if (this.selected && this._itemsProvider) {
|
|
336
|
+
return this._itemsProvider.filter((item) => this.selected && this.selected.includes(this._getItemId(item)));
|
|
337
|
+
}
|
|
338
|
+
return [];
|
|
339
|
+
}
|
|
340
|
+
_onMouseEnter(item) {
|
|
341
|
+
if (!(this.selected && this.selected.length > 0) && !this._skeleton) {
|
|
342
|
+
dispatchCustomEvent(this, 'mouseenter', { item });
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
_onMouseLeave() {
|
|
346
|
+
if (!(this.selected && this.selected.length > 0) && !this._skeleton) {
|
|
347
|
+
dispatchCustomEvent(this, 'mouseleave');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
_renderHeader(styleGridColumns) {
|
|
351
|
+
if (this.noheader) {
|
|
352
|
+
return '';
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
const style = {
|
|
356
|
+
...styleGridColumns,
|
|
357
|
+
...{
|
|
358
|
+
height: this.rowheight,
|
|
359
|
+
'grid-auto-rows': this.rowheight ? null : 'minmax(80px, auto)',
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
return html ` <div class=${classMap({ theader: true })} style=${styleMap(style)}>
|
|
363
|
+
${this.options && this.options.data && this._items && this._items.length
|
|
364
|
+
? repeat(this.options.data, (option) => option, (option) => {
|
|
365
|
+
const orderValue = this.order && this.order.startsWith('-') ? this.order.substring(1) : this.order;
|
|
366
|
+
const label = this.format && option.label ? this.format(option.label) : option.label;
|
|
367
|
+
const style = typeof option.headerStyle === 'function' ? option.headerStyle(label) : option.headerStyle;
|
|
368
|
+
return html ` <div style="${style || ''}">
|
|
369
|
+
${this.order && !this.nosort
|
|
370
|
+
? html `
|
|
371
|
+
<gv-button link @click="${this._onSortChanged.bind(this, option.field || option.tag)}">${until(label)}</gv-button>
|
|
372
|
+
${orderValue === option.tag || (orderValue === option.field && option.type !== 'image')
|
|
373
|
+
? html ` <gv-icon class=${classMap({ desc: this.order.startsWith('-') })} shape="design:triangle"></gv-icon>`
|
|
374
|
+
: ''}
|
|
375
|
+
</a>`
|
|
376
|
+
: until(label)}
|
|
377
|
+
</div>`;
|
|
378
|
+
})
|
|
379
|
+
: ''}
|
|
380
|
+
</div>`;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
_renderIcon(item, itemIndex, option) {
|
|
384
|
+
const icon = typeof option.icon === 'function' ? option.icon(item) : option.icon;
|
|
385
|
+
const iconTitle = typeof option.iconTitle === 'function' ? option.iconTitle(item) : option.iconTitle;
|
|
386
|
+
if (icon) {
|
|
387
|
+
return html ` <gv-icon shape="${icon}" title="${iconTitle}"></gv-icon>`;
|
|
388
|
+
}
|
|
389
|
+
return '';
|
|
390
|
+
}
|
|
391
|
+
_renderComponent(item, itemIndex, option, value, type) {
|
|
392
|
+
if (option.condition && !option.condition(item)) {
|
|
393
|
+
return '';
|
|
394
|
+
}
|
|
395
|
+
const element = document.createElement(type);
|
|
396
|
+
element.value = value;
|
|
397
|
+
if (option.attributes) {
|
|
398
|
+
Object.keys(option.attributes).forEach((attribute) => {
|
|
399
|
+
if (attribute.startsWith('on')) {
|
|
400
|
+
const event = attribute.replace('on', '').toLowerCase();
|
|
401
|
+
if (event === 'click') {
|
|
402
|
+
element.classList.add('link');
|
|
403
|
+
}
|
|
404
|
+
element.dataset.preventSelect = true;
|
|
405
|
+
element.addEventListener(event, (e) => {
|
|
406
|
+
e.stopPropagation();
|
|
407
|
+
const optionConfirm = typeof option.confirm === 'function' ? option.confirm(item) : option.confirm;
|
|
408
|
+
if (optionConfirm == null) {
|
|
409
|
+
setTimeout(() => {
|
|
410
|
+
option.attributes[attribute](item, e, element, this);
|
|
411
|
+
}, 0);
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
else if (typeof option.attributes[attribute] === 'function') {
|
|
416
|
+
const value = option.attributes[attribute](item);
|
|
417
|
+
if (value != null) {
|
|
418
|
+
element[attribute] = value;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
if (this.format && typeof option.attributes[attribute] === 'string') {
|
|
423
|
+
this.format(option.attributes[attribute]).then((t) => {
|
|
424
|
+
element[attribute] = t;
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
element[attribute] = option.attributes[attribute];
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
element.addEventListener('input', (event) => {
|
|
434
|
+
this._items[itemIndex][option.field] = event.target.value;
|
|
435
|
+
});
|
|
436
|
+
const optionConfirm = typeof option.confirm === 'function' ? option.confirm(item) : option.confirm;
|
|
437
|
+
if (optionConfirm) {
|
|
438
|
+
const confirm = document.createElement('gv-confirm');
|
|
439
|
+
if (this.format) {
|
|
440
|
+
this.format(optionConfirm.msg).then((t) => (confirm.message = t));
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
confirm.message = optionConfirm.msg;
|
|
444
|
+
}
|
|
445
|
+
if (optionConfirm.danger) {
|
|
446
|
+
confirm.danger = true;
|
|
447
|
+
}
|
|
448
|
+
confirm.addEventListener('click', (e) => e.stopPropagation());
|
|
449
|
+
confirm.addEventListener('gv-confirm:ok', (e) => {
|
|
450
|
+
e.stopPropagation();
|
|
451
|
+
option.attributes.onClick(item, e, element);
|
|
452
|
+
});
|
|
453
|
+
confirm.appendChild(element);
|
|
454
|
+
return confirm;
|
|
455
|
+
}
|
|
456
|
+
return element;
|
|
457
|
+
}
|
|
458
|
+
_renderCell(formattedValue, option, item, itemIndex) {
|
|
459
|
+
if (option.type) {
|
|
460
|
+
if (option.type === 'image') {
|
|
461
|
+
let alt = '';
|
|
462
|
+
if (option.alt) {
|
|
463
|
+
if (typeof option.alt === 'function') {
|
|
464
|
+
alt = option.alt(item);
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
alt = this._getDataFromField(item, option.alt);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return this._renderImage(formattedValue, alt);
|
|
471
|
+
}
|
|
472
|
+
else if (typeof option.type === 'function') {
|
|
473
|
+
return this._renderComponent(item, itemIndex, option, formattedValue, option.type(item));
|
|
474
|
+
}
|
|
475
|
+
else if (option.type.startsWith('gv-')) {
|
|
476
|
+
return this._renderComponent(item, itemIndex, option, formattedValue, option.type);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return until(formattedValue);
|
|
480
|
+
}
|
|
481
|
+
_getFormattedCellValue(option, item) {
|
|
482
|
+
let value = option.field ? this._getDataFromField(item, option.field) : '';
|
|
483
|
+
if (value) {
|
|
484
|
+
if (option.type === 'date') {
|
|
485
|
+
value = new Date(value).toLocaleDateString(getLanguage());
|
|
486
|
+
}
|
|
487
|
+
else if (option.type === 'datetime') {
|
|
488
|
+
value = new Date(value).toLocaleString(getLanguage());
|
|
489
|
+
}
|
|
490
|
+
else if (option.type === 'time') {
|
|
491
|
+
value = new Date(value).toLocaleTimeString(getLanguage());
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (option.format) {
|
|
495
|
+
value = option.format(value);
|
|
496
|
+
}
|
|
497
|
+
return value;
|
|
498
|
+
}
|
|
499
|
+
_isSelected(item) {
|
|
500
|
+
return this.selected && this.selected.includes(this._getItemId(item));
|
|
501
|
+
}
|
|
502
|
+
_renderRows(styleGridColumns) {
|
|
503
|
+
return html ` <div
|
|
504
|
+
class="rows"
|
|
505
|
+
style=${styleMap({ height: this.rowsheight, 'user-select': this.options.selectable ? 'none' : '' })}
|
|
506
|
+
@mouseleave="${this._onMouseLeave.bind(this)}"
|
|
507
|
+
>
|
|
508
|
+
${this._items && this._items.length
|
|
509
|
+
? repeat(this._items, (item) => item, (item, itemIndex) => {
|
|
510
|
+
return html `
|
|
511
|
+
<div class=${classMap({
|
|
512
|
+
row: true,
|
|
513
|
+
skeleton: this._skeleton,
|
|
514
|
+
selected: this._isSelected(item),
|
|
515
|
+
})} style=${styleMap({
|
|
516
|
+
...styleGridColumns,
|
|
517
|
+
...{
|
|
518
|
+
height: this.rowheight,
|
|
519
|
+
'grid-auto-rows': this.rowheight ? null : 'minmax(80px, auto)',
|
|
520
|
+
cursor: this.options.selectable ? 'pointer' : '',
|
|
521
|
+
'border-color': this.options.selectable && this._isSelected(item) ? 'var(--selected--bgc)' : '',
|
|
522
|
+
'column-gap': 'var(--gv-table--colmg, 0.2rem)',
|
|
523
|
+
},
|
|
524
|
+
})}
|
|
525
|
+
@click="${this._onSelect.bind(this, item)}"
|
|
526
|
+
@mouseenter="${this._onMouseEnter.bind(this, item)}">
|
|
527
|
+
${this.options && this.options.data
|
|
528
|
+
? repeat(this.options.data, (option) => option, (option) => {
|
|
529
|
+
const style = typeof option.style === 'function' ? option.style(item) : option.style;
|
|
530
|
+
const formattedValue = this._getFormattedCellValue(option, item);
|
|
531
|
+
return html `<div class="cell" style="${ifDefined(style)}" title="${formattedValue}">
|
|
532
|
+
${this._renderCell(formattedValue, option, item, itemIndex)}${this._renderTag(option, item)}${option.icon
|
|
533
|
+
? this._renderIcon(item, itemIndex, option)
|
|
534
|
+
: ''}
|
|
535
|
+
</div> `;
|
|
536
|
+
})
|
|
537
|
+
: ''}
|
|
538
|
+
</div>
|
|
539
|
+
</div>`;
|
|
540
|
+
})
|
|
541
|
+
: ''}
|
|
542
|
+
</div>`;
|
|
543
|
+
}
|
|
544
|
+
_renderItems() {
|
|
545
|
+
let widthTemplate = this.options.data.map((o) => {
|
|
546
|
+
if (o.width) {
|
|
547
|
+
return o.width;
|
|
548
|
+
}
|
|
549
|
+
else if (o.type === 'image') {
|
|
550
|
+
return '80px';
|
|
551
|
+
}
|
|
552
|
+
else if (o.type === 'icon') {
|
|
553
|
+
return '40px';
|
|
554
|
+
}
|
|
555
|
+
return null;
|
|
556
|
+
});
|
|
557
|
+
const fixedData = widthTemplate.filter((width) => width !== null);
|
|
558
|
+
const fixedWidth = fixedData.reduce((acc, width) => {
|
|
559
|
+
return acc + parseInt(width.replace('px', ''), 10);
|
|
560
|
+
}, 0);
|
|
561
|
+
widthTemplate = widthTemplate.map((width) => {
|
|
562
|
+
if (width == null) {
|
|
563
|
+
const columnGap = getCssVar(this, '--gv-table--colmg', '0.2rem');
|
|
564
|
+
return `calc((100% - ( ${fixedWidth}px + ${this.options.data.length - 1} * ${columnGap} ) ) / ${this.options.data.length - fixedData.length})`;
|
|
565
|
+
}
|
|
566
|
+
return width;
|
|
567
|
+
});
|
|
568
|
+
const styleGridColumns = { 'grid-template-columns': widthTemplate.join(' ') };
|
|
569
|
+
return html ` ${this._renderHeader(styleGridColumns)} ${this._renderRows(styleGridColumns)} ${this._renderPagination()} `;
|
|
570
|
+
}
|
|
571
|
+
_renderPagination() {
|
|
572
|
+
if (this.options && this.options.paging && this._itemsProvider) {
|
|
573
|
+
const paginationData = {
|
|
574
|
+
first: 1,
|
|
575
|
+
last: this._itemsProvider.length / this.options.paging,
|
|
576
|
+
total: this._itemsProvider.length,
|
|
577
|
+
current_page: this._page,
|
|
578
|
+
total_pages: this._itemsProvider.length / this.options.paging,
|
|
579
|
+
};
|
|
580
|
+
return html `<gv-pagination .data="${paginationData}" widget="true"></gv-pagination>`;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
_getDataFromField(item, field) {
|
|
584
|
+
if (typeof field === 'function') {
|
|
585
|
+
return field(item);
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
return field.split('.').reduce((p, c) => p && p[c], item);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
_renderTag(option, item) {
|
|
592
|
+
if (option.tag) {
|
|
593
|
+
let tag;
|
|
594
|
+
if (typeof option.tag === 'function') {
|
|
595
|
+
tag = option.tag(item);
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
tag = option.format ? option.format(this._getDataFromField(item, option.tag)) : this._getDataFromField(item, option.tag);
|
|
599
|
+
}
|
|
600
|
+
if (tag) {
|
|
601
|
+
return html ` <gv-tag ?skeleton="${this._skeleton}">${tag}</gv-tag>`;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return '';
|
|
605
|
+
}
|
|
606
|
+
_onImageLoaded() {
|
|
607
|
+
this._skeleton = false;
|
|
608
|
+
}
|
|
609
|
+
_renderImage(picture, alt) {
|
|
610
|
+
return html `<gv-identity-picture .picture="${picture}" .display_name="${alt}"></gv-identity-picture>`;
|
|
611
|
+
}
|
|
612
|
+
updated(props) {
|
|
613
|
+
this._onSortChanged();
|
|
614
|
+
}
|
|
615
|
+
render() {
|
|
616
|
+
if (this._error) {
|
|
617
|
+
return html `<div class="error">${i18n('gv-table.error')}</div>`;
|
|
618
|
+
}
|
|
619
|
+
const classes = {
|
|
620
|
+
table: true,
|
|
621
|
+
skeleton: this._skeleton || this.skeleton,
|
|
622
|
+
};
|
|
623
|
+
const emptyStyle = {
|
|
624
|
+
height: this.rowsheight ? this.rowsheight : '',
|
|
625
|
+
};
|
|
626
|
+
return html `
|
|
627
|
+
<div class=${classMap(classes)} style="${styleMap({ display: this.rowsheight ? 'block' : 'flex' })}">
|
|
628
|
+
${this.title
|
|
629
|
+
? html ` <div class="header">
|
|
630
|
+
<h3 class="title">
|
|
631
|
+
${this.title} ${!this._empty ? html `<span>(${this.total || (this._items && this._items.length)})</span>` : ''}
|
|
632
|
+
</h3>
|
|
633
|
+
</div>`
|
|
634
|
+
: ''}
|
|
635
|
+
${!this._empty && this.options && this.options.data
|
|
636
|
+
? this._renderItems()
|
|
637
|
+
: html ` <div class="empty" style="${styleMap(emptyStyle)}">
|
|
638
|
+
${this.emptymessage ? this.emptymessage : i18n('gv-table.empty')}
|
|
639
|
+
</div>`}
|
|
640
|
+
</div>
|
|
641
|
+
`;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
window.customElements.define('gv-table', GvTable);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tree menu
|
|
3
|
+
*
|
|
4
|
+
* ## Details
|
|
5
|
+
* * has @theme facet
|
|
6
|
+
*
|
|
7
|
+
* @fires gv-tree:select - Custom event from child components
|
|
8
|
+
* @fires gv-tree:toggle - Custom event from child components
|
|
9
|
+
*
|
|
10
|
+
* @attr {Array} items - list of items and subitems to be displayed in the menu MenuItem: {name: String, value: any, children: Array<MenuItem>}
|
|
11
|
+
* @attr {Boolean} closed - allows to close the menu
|
|
12
|
+
* @attr {Object} selectedItem - the item selected
|
|
13
|
+
*
|
|
14
|
+
* @cssprop {Color} [--gv-tree--bgc=var(--gv-theme-neutral-color-lightest, #ffffff)] - Background color
|
|
15
|
+
* @cssprop {Color} [--gv-tree--c=var(--gv-theme-font-color-dark, #262626)] - Color
|
|
16
|
+
* @cssprop {Color} [--gv-tree-active--bdc=var(--gv-theme-color, #5a7684)] - Active border
|
|
17
|
+
* @cssprop {Color} [--gv-tree-active--bgc=var(--gv-theme-neutral-color-dark, #d9d9d9)] - Active background color
|
|
18
|
+
* @cssprop {Length} [--gv-tree-icon--s=20px] - Height and icon width
|
|
19
|
+
*/
|
|
20
|
+
export class GvTree extends LitElement {
|
|
21
|
+
static get properties(): {
|
|
22
|
+
items: {
|
|
23
|
+
type: ArrayConstructor;
|
|
24
|
+
};
|
|
25
|
+
closed: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
reflect: boolean;
|
|
28
|
+
};
|
|
29
|
+
selectedItem: {
|
|
30
|
+
type: ObjectConstructor;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
static get styles(): import("lit").CSSResult[];
|
|
34
|
+
closed: boolean;
|
|
35
|
+
_onSelect(menuItem: any, e: any): void;
|
|
36
|
+
selectedItem: any;
|
|
37
|
+
_onClick(menuItem: any, e: any): void;
|
|
38
|
+
_getMenuItemPage(menuItem: any): import("lit-html").TemplateResult<1>;
|
|
39
|
+
_getMenuItemFolder(menuItem: any): any;
|
|
40
|
+
_getMenu(menuItems: any): any;
|
|
41
|
+
_getMenuItem(menuItem: any): any;
|
|
42
|
+
_toggleMenu(): void;
|
|
43
|
+
}
|
|
44
|
+
import { LitElement } from "lit-element/lit-element";
|