@maz-ui/mcp 5.0.1-beta.0 → 5.1.0-beta.1
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/README.md +61 -228
- package/bin/maz-ui-mcp.mjs +2 -5
- package/dist/cli.d.mts +7 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.mjs +16 -0
- package/dist/index.d.mts +345 -0
- package/dist/index.d.ts +345 -0
- package/dist/index.mjs +16 -0
- package/dist/shared/mcp.DseFuKdl.mjs +2968 -0
- package/docs/README.md +207 -0
- package/docs/agents/agents-md.md +52 -0
- package/docs/agents/claude-rule.md +52 -0
- package/docs/components/maz-accordion.md +78 -0
- package/docs/{src/components → components}/maz-alert.md +31 -164
- package/docs/components/maz-animated-counter.md +87 -0
- package/docs/components/maz-animated-element.md +46 -0
- package/docs/components/maz-animated-text.md +53 -0
- package/docs/components/maz-avatar.md +193 -0
- package/docs/components/maz-backdrop.md +178 -0
- package/docs/{src/components → components}/maz-badge.md +26 -67
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/{src/components → components}/maz-btn-group.md +27 -189
- package/docs/{src/components → components}/maz-btn.md +62 -245
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/{src/components → components}/maz-card.md +67 -192
- package/docs/components/maz-carousel.md +153 -0
- package/docs/{src/components → components}/maz-chart.md +17 -161
- package/docs/components/maz-checkbox.md +138 -0
- package/docs/components/maz-checklist.md +251 -0
- package/docs/components/maz-circular-progress-bar.md +109 -0
- package/docs/{src/components → components}/maz-code-highlight.md +15 -93
- package/docs/components/maz-container.md +241 -0
- package/docs/{src/components → components}/maz-date-picker.md +85 -454
- package/docs/components/maz-dialog-confirm.md +215 -0
- package/docs/components/maz-dialog.md +143 -0
- package/docs/components/maz-drawer.md +107 -0
- package/docs/components/maz-dropdown.md +419 -0
- package/docs/{src/components → components}/maz-dropzone.md +80 -221
- package/docs/components/maz-expand-animation.md +82 -0
- package/docs/components/maz-fullscreen-loader.md +58 -0
- package/docs/components/maz-gallery.md +79 -0
- package/docs/{src/components → components}/maz-icon.md +32 -83
- package/docs/components/maz-input-code.md +73 -0
- package/docs/components/maz-input-number.md +79 -0
- package/docs/components/maz-input-phone-number.md +536 -0
- package/docs/components/maz-input-price.md +68 -0
- package/docs/components/maz-input-tags.md +112 -0
- package/docs/{src/components → components}/maz-input.md +74 -221
- package/docs/components/maz-lazy-img.md +113 -0
- package/docs/components/maz-link.md +146 -0
- package/docs/components/maz-loading-bar.md +38 -0
- package/docs/{src/components → components}/maz-markdown-editor.md +72 -125
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/{src/components → components}/maz-pull-to-refresh.md +59 -45
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/{src/components → components}/maz-read-more.md +31 -122
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/{src/components → components}/maz-select-country.md +80 -340
- package/docs/{src/components → components}/maz-select.md +76 -206
- package/docs/components/maz-sidebar-content.md +25 -0
- package/docs/components/maz-sidebar-footer.md +25 -0
- package/docs/components/maz-sidebar-group.md +27 -0
- package/docs/components/maz-sidebar-header.md +25 -0
- package/docs/components/maz-sidebar-menu-button.md +41 -0
- package/docs/components/maz-sidebar-menu-item.md +25 -0
- package/docs/components/maz-sidebar-menu-sub.md +32 -0
- package/docs/components/maz-sidebar-menu.md +25 -0
- package/docs/components/maz-sidebar-separator.md +21 -0
- package/docs/components/maz-sidebar-trigger.md +25 -0
- package/docs/{src/components → components}/maz-sidebar.md +117 -329
- package/docs/{src/components → components}/maz-skeleton.md +27 -156
- package/docs/{src/components → components}/maz-slider.md +33 -66
- package/docs/components/maz-spinner.md +84 -0
- package/docs/{src/components → components}/maz-stepper.md +48 -185
- package/docs/components/maz-switch.md +86 -0
- package/docs/components/maz-table-cell.md +27 -0
- package/docs/components/maz-table-row.md +28 -0
- package/docs/components/maz-table-title.md +27 -0
- package/docs/components/maz-table-virtualizer.md +31 -0
- package/docs/components/maz-table.md +426 -0
- package/docs/components/maz-tabs-bar.md +43 -0
- package/docs/components/maz-tabs-content-item.md +27 -0
- package/docs/components/maz-tabs-content.md +27 -0
- package/docs/{src/components → components}/maz-tabs.md +89 -126
- package/docs/components/maz-textarea.md +255 -0
- package/docs/components/maz-ticker.md +427 -0
- package/docs/components/maz-timeline.md +304 -0
- package/docs/components/maz-ui-provider.md +26 -0
- package/docs/{src/components → components}/maz-window-mockup.md +38 -105
- package/docs/composables/use-aos.md +41 -0
- package/docs/composables/use-breakpoints.md +42 -0
- package/docs/composables/use-dialog.md +58 -0
- package/docs/{src/composables → composables}/use-display-names.md +12 -59
- package/docs/{src/composables → composables}/use-drag.md +14 -68
- package/docs/{src/composables → composables}/use-form-validator.md +22 -696
- package/docs/{src/composables → composables}/use-idle-timeout.md +13 -97
- package/docs/{src/composables → composables}/use-pull-to-refresh.md +14 -7
- package/docs/{src/composables → composables}/use-reading-time.md +20 -56
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/{src/composables → composables}/use-swipe.md +14 -81
- package/docs/{src/composables → composables}/use-timer.md +12 -38
- package/docs/composables/use-toast.md +50 -0
- package/docs/{src/composables → composables}/use-user-visibility.md +14 -56
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/{src/directives → directives}/click-outside.md +13 -99
- package/docs/{src/directives → directives}/fullscreen-img.md +10 -28
- package/docs/{src/directives → directives}/lazy-img.md +14 -49
- package/docs/{src/directives → directives}/tooltip.md +12 -217
- package/docs/{src/directives → directives}/zoom-img.md +11 -38
- package/docs/{src/ecosystem → ecosystem}/eslint-config.md +37 -29
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/{src/ecosystem → ecosystem}/icons/index.md +21 -15
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/{src/ecosystem → ecosystem}/node/exec-promise.md +12 -6
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/{src/ecosystem → ecosystem}/node/logger.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/node/print-banner.md +12 -4
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/{src/ecosystem → ecosystem}/nuxt.md +50 -19
- package/docs/{src/ecosystem → ecosystem}/stylelint-config.md +33 -25
- package/docs/{src/ecosystem → ecosystem}/themes.md +72 -235
- package/docs/{src/ecosystem → ecosystem}/translations.md +25 -23
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/check-availability.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/cookie.md +18 -12
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/{src/ecosystem → ecosystem}/utils/currency.md +12 -26
- package/docs/{src/ecosystem → ecosystem}/utils/date.md +10 -24
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/{src/ecosystem → ecosystem}/utils/debounce-id.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/debounce.md +14 -8
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/{src/ecosystem → ecosystem}/utils/format-json.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/format-phone-number.md +12 -6
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/{src/ecosystem → ecosystem}/utils/get-error-message.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/idle-timeout.md +15 -9
- package/docs/{src/ecosystem → ecosystem}/utils/index.md +10 -13
- package/docs/{src/ecosystem → ecosystem}/utils/is-client.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/is-equal.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/is-ios.md +12 -6
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/{src/ecosystem → ecosystem}/utils/kebab-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/normalize-string.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/number.md +10 -24
- package/docs/{src/ecosystem → ecosystem}/utils/pascal-case.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/prevent-ios-input-zoom.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/script-loader.md +16 -8
- package/docs/{src/ecosystem → ecosystem}/utils/sleep.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/snake-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/swipe-handler.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/textarea-autogrow.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/utils/throttle-id.md +13 -7
- package/docs/{src/ecosystem → ecosystem}/utils/throttle.md +14 -8
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-key-of.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-partial.md +10 -4
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/generic-instance-type.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/types/infer-maybe-ref.md +10 -4
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/{src/ecosystem → ecosystem}/utils/user-visibility.md +12 -6
- package/docs/guide/ai-agents.md +239 -0
- package/docs/{src/guide → guide}/browser-support.md +22 -15
- package/docs/{src/guide → guide}/getting-started.md +34 -139
- package/docs/{src/guide → guide}/global-defaults.md +12 -11
- package/docs/{src/guide → guide}/maz-ui-provider.md +17 -16
- package/docs/{src/guide → guide}/migration-v5.md +95 -88
- package/docs/{src/guide → guide}/resolvers.md +33 -100
- package/docs/guide/tailwind.md +507 -0
- package/docs/{src/guide → guide}/vue.md +33 -39
- package/docs/manifest.json +1 -0
- package/docs/{src/plugins → plugins}/aos.md +20 -55
- package/docs/{src/plugins → plugins}/dialog.md +14 -161
- package/docs/plugins/toast.md +221 -0
- package/docs/plugins/wait.md +78 -0
- package/docs/reference/icons.md +46 -0
- package/docs/reference/tailwind-tokens.md +191 -0
- package/docs/rules.md +59 -0
- package/package.json +86 -22
- package/dist/mcp.d.mts +0 -153
- package/dist/mcp.d.ts +0 -153
- package/dist/mcp.mjs +0 -1511
- package/docs/generated-docs/maz-accordion.doc.md +0 -21
- package/docs/generated-docs/maz-alert.doc.md +0 -20
- package/docs/generated-docs/maz-animated-counter.doc.md +0 -17
- package/docs/generated-docs/maz-animated-element.doc.md +0 -14
- package/docs/generated-docs/maz-animated-text.doc.md +0 -17
- package/docs/generated-docs/maz-avatar.doc.md +0 -45
- package/docs/generated-docs/maz-backdrop.doc.md +0 -55
- package/docs/generated-docs/maz-badge.doc.md +0 -16
- package/docs/generated-docs/maz-bottom-sheet.doc.md +0 -24
- package/docs/generated-docs/maz-btn-group.doc.md +0 -20
- package/docs/generated-docs/maz-btn.doc.md +0 -33
- package/docs/generated-docs/maz-card-spotlight.doc.md +0 -16
- package/docs/generated-docs/maz-card.doc.md +0 -39
- package/docs/generated-docs/maz-carousel.doc.md +0 -17
- package/docs/generated-docs/maz-chart.doc.md +0 -10
- package/docs/generated-docs/maz-checkbox.doc.md +0 -33
- package/docs/generated-docs/maz-checklist.doc.md +0 -30
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +0 -27
- package/docs/generated-docs/maz-code-highlight.doc.md +0 -11
- package/docs/generated-docs/maz-container.doc.md +0 -26
- package/docs/generated-docs/maz-date-picker.doc.md +0 -56
- package/docs/generated-docs/maz-dialog-confirm.doc.md +0 -24
- package/docs/generated-docs/maz-dialog.doc.md +0 -22
- package/docs/generated-docs/maz-drawer.doc.md +0 -25
- package/docs/generated-docs/maz-dropdown.doc.md +0 -45
- package/docs/generated-docs/maz-dropzone.doc.md +0 -82
- package/docs/generated-docs/maz-expand-animation.doc.md +0 -12
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +0 -13
- package/docs/generated-docs/maz-gallery.doc.md +0 -17
- package/docs/generated-docs/maz-icon.doc.md +0 -16
- package/docs/generated-docs/maz-input-code.doc.md +0 -25
- package/docs/generated-docs/maz-input-number.doc.md +0 -33
- package/docs/generated-docs/maz-input-phone-number.doc.md +0 -62
- package/docs/generated-docs/maz-input-price.doc.md +0 -26
- package/docs/generated-docs/maz-input-tags.doc.md +0 -24
- package/docs/generated-docs/maz-input.doc.md +0 -54
- package/docs/generated-docs/maz-lazy-img.doc.md +0 -49
- package/docs/generated-docs/maz-link.doc.md +0 -31
- package/docs/generated-docs/maz-loading-bar.doc.md +0 -6
- package/docs/generated-docs/maz-markdown-editor.doc.md +0 -65
- package/docs/generated-docs/maz-pagination.doc.md +0 -21
- package/docs/generated-docs/maz-popover.doc.md +0 -79
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +0 -50
- package/docs/generated-docs/maz-radio-buttons.doc.md +0 -34
- package/docs/generated-docs/maz-radio.doc.md +0 -33
- package/docs/generated-docs/maz-read-more.doc.md +0 -18
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +0 -18
- package/docs/generated-docs/maz-select-country.doc.md +0 -45
- package/docs/generated-docs/maz-select.doc.md +0 -32
- package/docs/generated-docs/maz-sidebar-content.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-footer.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-group.doc.md +0 -11
- package/docs/generated-docs/maz-sidebar-header.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +0 -27
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +0 -16
- package/docs/generated-docs/maz-sidebar-menu.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar.doc.md +0 -36
- package/docs/generated-docs/maz-skeleton.doc.md +0 -12
- package/docs/generated-docs/maz-slider.doc.md +0 -20
- package/docs/generated-docs/maz-spinner.doc.md +0 -6
- package/docs/generated-docs/maz-stepper.doc.md +0 -30
- package/docs/generated-docs/maz-switch.doc.md +0 -31
- package/docs/generated-docs/maz-table-cell.doc.md +0 -5
- package/docs/generated-docs/maz-table-row.doc.md +0 -12
- package/docs/generated-docs/maz-table-title.doc.md +0 -5
- package/docs/generated-docs/maz-table-virtualizer.doc.md +0 -20
- package/docs/generated-docs/maz-table.doc.md +0 -72
- package/docs/generated-docs/maz-tabs-bar.doc.md +0 -29
- package/docs/generated-docs/maz-tabs-content-item.doc.md +0 -11
- package/docs/generated-docs/maz-tabs-content.doc.md +0 -5
- package/docs/generated-docs/maz-tabs.doc.md +0 -20
- package/docs/generated-docs/maz-textarea.doc.md +0 -46
- package/docs/generated-docs/maz-ticker.doc.md +0 -25
- package/docs/generated-docs/maz-timeline.doc.md +0 -32
- package/docs/generated-docs/maz-ui-provider.doc.md +0 -12
- package/docs/generated-docs/maz-window-mockup.doc.md +0 -23
- package/docs/src/blog/v4.md +0 -276
- package/docs/src/blog/v5.md +0 -184
- package/docs/src/changelog.md +0 -7
- package/docs/src/components/index.md +0 -8
- package/docs/src/components/maz-accordion.md +0 -80
- package/docs/src/components/maz-animated-counter.md +0 -124
- package/docs/src/components/maz-animated-element.md +0 -36
- package/docs/src/components/maz-animated-text.md +0 -36
- package/docs/src/components/maz-avatar.md +0 -227
- package/docs/src/components/maz-backdrop.md +0 -250
- package/docs/src/components/maz-bottom-sheet.md +0 -533
- package/docs/src/components/maz-card-spotlight.md +0 -163
- package/docs/src/components/maz-carousel.md +0 -231
- package/docs/src/components/maz-checkbox.md +0 -168
- package/docs/src/components/maz-checklist.md +0 -414
- package/docs/src/components/maz-circular-progress-bar.md +0 -145
- package/docs/src/components/maz-container.md +0 -363
- package/docs/src/components/maz-dialog-confirm.md +0 -240
- package/docs/src/components/maz-dialog.md +0 -164
- package/docs/src/components/maz-drawer.md +0 -181
- package/docs/src/components/maz-dropdown.md +0 -691
- package/docs/src/components/maz-expand-animation.md +0 -99
- package/docs/src/components/maz-fullscreen-loader.md +0 -58
- package/docs/src/components/maz-gallery.md +0 -85
- package/docs/src/components/maz-input-code.md +0 -61
- package/docs/src/components/maz-input-number.md +0 -81
- package/docs/src/components/maz-input-phone-number.md +0 -942
- package/docs/src/components/maz-input-price.md +0 -67
- package/docs/src/components/maz-input-tags.md +0 -114
- package/docs/src/components/maz-lazy-img.md +0 -88
- package/docs/src/components/maz-link.md +0 -178
- package/docs/src/components/maz-loading-bar.md +0 -26
- package/docs/src/components/maz-pagination.md +0 -79
- package/docs/src/components/maz-popover.md +0 -1416
- package/docs/src/components/maz-radio-buttons.md +0 -462
- package/docs/src/components/maz-radio.md +0 -142
- package/docs/src/components/maz-reading-progress-bar.md +0 -74
- package/docs/src/components/maz-spinner.md +0 -93
- package/docs/src/components/maz-switch.md +0 -92
- package/docs/src/components/maz-table.md +0 -732
- package/docs/src/components/maz-textarea.md +0 -400
- package/docs/src/components/maz-ticker.md +0 -692
- package/docs/src/components/maz-timeline.md +0 -478
- package/docs/src/composables/use-aos.md +0 -34
- package/docs/src/composables/use-breakpoints.md +0 -35
- package/docs/src/composables/use-dialog.md +0 -88
- package/docs/src/composables/use-string-matching.md +0 -63
- package/docs/src/composables/use-toast.md +0 -71
- package/docs/src/composables/use-wait.md +0 -62
- package/docs/src/composables/use-window-size.md +0 -18
- package/docs/src/ecosystem/icons/icon-set.md +0 -123
- package/docs/src/ecosystem/mcp.md +0 -210
- package/docs/src/ecosystem/node/index.md +0 -53
- package/docs/src/ecosystem/utils/camel-case.md +0 -31
- package/docs/src/ecosystem/utils/capitalize.md +0 -50
- package/docs/src/ecosystem/utils/country-code-to-unicode-flag.md +0 -213
- package/docs/src/ecosystem/utils/debounce-callback.md +0 -38
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +0 -33
- package/docs/src/ecosystem/utils/get-browser-locale.md +0 -29
- package/docs/src/ecosystem/utils/get-country-flag-url.md +0 -156
- package/docs/src/ecosystem/utils/is-server.md +0 -31
- package/docs/src/ecosystem/utils/is-standalone-mode.md +0 -43
- package/docs/src/ecosystem/utils/truthy-filter.md +0 -31
- package/docs/src/ecosystem/utils/types/deep-required.md +0 -39
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +0 -44
- package/docs/src/ecosystem/utils/upper-first.md +0 -32
- package/docs/src/guide/cli.md +0 -144
- package/docs/src/guide/migration-v4.md +0 -925
- package/docs/src/guide/tailwind.md +0 -158
- package/docs/src/index.md +0 -603
- package/docs/src/made-with-maz-ui.md +0 -58
- package/docs/src/plugins/toast.md +0 -349
- package/docs/src/plugins/wait.md +0 -109
- package/docs/src/theme-editor.md +0 -21
|
@@ -1,732 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: MazTable
|
|
3
|
-
description: MazTable is designed to be a reusable data table with advanced features. Pagination, Search, Column Sorting, Row Selection, UI options, Loading and Slots.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# {{ $frontmatter.title }}
|
|
7
|
-
|
|
8
|
-
{{ $frontmatter.description }}
|
|
9
|
-
|
|
10
|
-
<!--@include: ./../../.vitepress/mixins/getting-started.md-->
|
|
11
|
-
|
|
12
|
-
## Key Features
|
|
13
|
-
|
|
14
|
-
1. Pagination (prop `pagination`)
|
|
15
|
-
* The component supports pagination with buttons to go to the first, previous, next, and last page.
|
|
16
|
-
* You can display only the pagination elements (input and buttons) and make API calls to your server to get elements by using the prop `pagination` with `no-paginate-rows`.
|
|
17
|
-
2. Search (prop `search`): It includes a search feature with a search bar where users can enter a query to filter displayed data. You can choose the column where the search will be activated.
|
|
18
|
-
3. Column Sorting (prop: `sortable`): Columns are sortable, indicated by arrow icons. Sorting can be activated by clicking on the column header.
|
|
19
|
-
4. Row Selection (prop `select-value="key"`): There is a dedicated column for selection with a checkbox for each row. Users can individually or collectively select/deselect rows.
|
|
20
|
-
5. Customizable Page Size: Users can choose the number of items to display per page using a dropdown list.
|
|
21
|
-
6. Loading Indicator (prop `loading`): A loading indicator (MazLoadingBar) is displayed when data is being loaded.
|
|
22
|
-
7. Animated rows (props `animated-rows` + `row-key`): rows slide to their new position when the order changes (FLIP animation). Respects `prefers-reduced-motion`.
|
|
23
|
-
8. Virtualization (prop `virtualized`): render only the rows visible in the viewport (plus an overscan) so the table stays fast with thousands of rows.
|
|
24
|
-
|
|
25
|
-
## Available models
|
|
26
|
-
|
|
27
|
-
* v-model: `(string | boolean | number)[] | undefined` (list of selected key)
|
|
28
|
-
* v-model:search-query: `string | undefined`
|
|
29
|
-
* v-model:page: `number`
|
|
30
|
-
* v-model:page-size: `number`
|
|
31
|
-
|
|
32
|
-
## Basic usage
|
|
33
|
-
|
|
34
|
-
You can use MazTable and his child component to build a simple table and enjoy the style.
|
|
35
|
-
|
|
36
|
-
<ComponentDemo>
|
|
37
|
-
<MazTable class="vp-raw" size="md" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
38
|
-
<MazTableRow>
|
|
39
|
-
<MazTableCell>
|
|
40
|
-
1
|
|
41
|
-
</MazTableCell>
|
|
42
|
-
<MazTableCell>
|
|
43
|
-
John
|
|
44
|
-
</MazTableCell>
|
|
45
|
-
<MazTableCell>
|
|
46
|
-
Doe
|
|
47
|
-
</MazTableCell>
|
|
48
|
-
<MazTableCell>
|
|
49
|
-
99
|
|
50
|
-
</MazTableCell>
|
|
51
|
-
</MazTableRow>
|
|
52
|
-
<MazTableRow>
|
|
53
|
-
<MazTableCell>
|
|
54
|
-
2
|
|
55
|
-
</MazTableCell>
|
|
56
|
-
<MazTableCell>
|
|
57
|
-
Doe
|
|
58
|
-
</MazTableCell>
|
|
59
|
-
<MazTableCell>
|
|
60
|
-
John
|
|
61
|
-
</MazTableCell>
|
|
62
|
-
<MazTableCell>
|
|
63
|
-
30
|
|
64
|
-
</MazTableCell>
|
|
65
|
-
</MazTableRow>
|
|
66
|
-
</MazTable>
|
|
67
|
-
|
|
68
|
-
<template #code>
|
|
69
|
-
|
|
70
|
-
```vue
|
|
71
|
-
<template>
|
|
72
|
-
<MazTable size="sm" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
73
|
-
<MazTableRow>
|
|
74
|
-
<MazTableCell>
|
|
75
|
-
1
|
|
76
|
-
</MazTableCell>
|
|
77
|
-
<MazTableCell>
|
|
78
|
-
John
|
|
79
|
-
</MazTableCell>
|
|
80
|
-
<MazTableCell>
|
|
81
|
-
Doe
|
|
82
|
-
</MazTableCell>
|
|
83
|
-
<MazTableCell>
|
|
84
|
-
99
|
|
85
|
-
</MazTableCell>
|
|
86
|
-
</MazTableRow>
|
|
87
|
-
<MazTableRow>
|
|
88
|
-
<MazTableCell>
|
|
89
|
-
2
|
|
90
|
-
</MazTableCell>
|
|
91
|
-
<MazTableCell>
|
|
92
|
-
Doe
|
|
93
|
-
</MazTableCell>
|
|
94
|
-
<MazTableCell>
|
|
95
|
-
John
|
|
96
|
-
</MazTableCell>
|
|
97
|
-
<MazTableCell>
|
|
98
|
-
30
|
|
99
|
-
</MazTableCell>
|
|
100
|
-
</MazTableRow>
|
|
101
|
-
</MazTable>
|
|
102
|
-
</template>
|
|
103
|
-
|
|
104
|
-
<script lang="ts" setup>
|
|
105
|
-
import { MazTable, MazTableRow, MazTableCell } from 'maz-ui/components'
|
|
106
|
-
</script>
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
</template>
|
|
110
|
-
</ComponentDemo>
|
|
111
|
-
|
|
112
|
-
## Advanced data table
|
|
113
|
-
|
|
114
|
-
You can also provide all your data, the table is auto-generated and you can use the features [listed on top](#key-features)
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
<ComponentDemo>
|
|
119
|
-
<div class="maz:bg-surface-600/50 maz:dark:bg-surface-400 maz:rounded-md maz:p-2">
|
|
120
|
-
|
|
121
|
-
v-model="{{selectedIds ?? 'undefined'}}"
|
|
122
|
-
|
|
123
|
-
v-model:search-query="{{searchQuery ?? 'undefined'}}"
|
|
124
|
-
|
|
125
|
-
v-model:page="{{page ?? 'undefined'}}"
|
|
126
|
-
|
|
127
|
-
v-model:page-size="{{pageSize ?? 'undefined'}}"
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<MazTable
|
|
131
|
-
size="sm"
|
|
132
|
-
v-model="selectedIds"
|
|
133
|
-
v-model:search-query="searchQuery"
|
|
134
|
-
v-model:page="page"
|
|
135
|
-
v-model:page-size="pageSize"
|
|
136
|
-
search
|
|
137
|
-
pagination
|
|
138
|
-
color="secondary"
|
|
139
|
-
sortable
|
|
140
|
-
selectable
|
|
141
|
-
title="Competitions"
|
|
142
|
-
hoverable
|
|
143
|
-
background-even
|
|
144
|
-
selected-key="id"
|
|
145
|
-
class="vp-raw"
|
|
146
|
-
:headers="[
|
|
147
|
-
{ label:'#', key: 'index', align: 'center', width: '2rem', sortable: false },
|
|
148
|
-
{ label:'Name', key: 'name' },
|
|
149
|
-
{ label: 'Code', key: 'code', align: 'center' },
|
|
150
|
-
{ label: 'Type', key: 'type' },
|
|
151
|
-
{ label: 'Area', key: 'areaName', align: 'center', classes: 'maz:font-bold' },
|
|
152
|
-
]"
|
|
153
|
-
:rows="competitions"
|
|
154
|
-
>
|
|
155
|
-
<template #cell-index="{ value }">
|
|
156
|
-
<span class="maz:text-base">{{value}}</span>
|
|
157
|
-
</template>
|
|
158
|
-
<template #cell-name="{ row, value }">
|
|
159
|
-
<div class="maz:flex maz:items-center maz:gap-2">
|
|
160
|
-
<MazAvatar :src="row.logoUrl" size="mini"></MazAvatar>
|
|
161
|
-
<span>{{value}}</span>
|
|
162
|
-
</div>
|
|
163
|
-
</template>
|
|
164
|
-
<template #cell-type="{ value }">
|
|
165
|
-
<MazBadge :color="value === 'CUP' ? 'primary' : 'secondary'">{{value}}</MazBadge>
|
|
166
|
-
</template>
|
|
167
|
-
|
|
168
|
-
<template #actions>
|
|
169
|
-
<MazBtn v-tooltip="{ text: 'Delete', color: 'destructive' }" fab size="xs" color="destructive" icon="/trash.svg" />
|
|
170
|
-
</template>
|
|
171
|
-
</MazTable>
|
|
172
|
-
|
|
173
|
-
<template #code>
|
|
174
|
-
|
|
175
|
-
```vue
|
|
176
|
-
<template>
|
|
177
|
-
<MazTable
|
|
178
|
-
size="sm"
|
|
179
|
-
v-model="selectedIds"
|
|
180
|
-
v-model:search-query="searchQuery"
|
|
181
|
-
v-model:page="page"
|
|
182
|
-
v-model:page-size="pageSize"
|
|
183
|
-
search
|
|
184
|
-
pagination
|
|
185
|
-
color="secondary"
|
|
186
|
-
sortable
|
|
187
|
-
selectable
|
|
188
|
-
hoverable
|
|
189
|
-
background-even
|
|
190
|
-
selected-key="id"
|
|
191
|
-
:headers="[
|
|
192
|
-
{ label:'#', key: 'index', align: 'center', width: '2rem', sortable: false },
|
|
193
|
-
{ label:'Name', key: 'name' },
|
|
194
|
-
{ label: 'Code', key: 'code', align: 'center' },
|
|
195
|
-
{ label: 'Type', key: 'type' },
|
|
196
|
-
{ label: 'Area', key: 'areaName', align: 'center', classes: 'maz:font-bold' },
|
|
197
|
-
]"
|
|
198
|
-
:rows="competitions"
|
|
199
|
-
>
|
|
200
|
-
<template #cell-index="{ value }">
|
|
201
|
-
<span class="maz:text-base">{{value}}</span>
|
|
202
|
-
</template>
|
|
203
|
-
<template #cell-name="{ row, value }">
|
|
204
|
-
<div class="maz:flex maz:items-center maz:gap-2">
|
|
205
|
-
<MazAvatar :src="row.logoUrl" size="0.5rem"></MazAvatar>
|
|
206
|
-
<span>{{value}}</span>
|
|
207
|
-
</div>
|
|
208
|
-
</template>
|
|
209
|
-
<template #cell-type="{ value }">
|
|
210
|
-
<MazBadge :color="value === 'CUP' ? 'primary' : 'secondary'">{{value}}</MazBadge>
|
|
211
|
-
</template>
|
|
212
|
-
|
|
213
|
-
<template #actions>
|
|
214
|
-
<MazBtn fab size="xs" color="destructive" icon="/trash.svg" />
|
|
215
|
-
</template>
|
|
216
|
-
</MazTable>
|
|
217
|
-
</template>
|
|
218
|
-
|
|
219
|
-
<script lang="ts" setup>
|
|
220
|
-
import MazTable from 'maz-ui/components/MazTable'
|
|
221
|
-
|
|
222
|
-
const competitions = [
|
|
223
|
-
{
|
|
224
|
-
id: '0262672d-7c7a-4d30-866e-edb88b5a5336',
|
|
225
|
-
name: 'UEFA Champions League',
|
|
226
|
-
code: 'CL',
|
|
227
|
-
type: 'CUP',
|
|
228
|
-
areaName: 'Europe',
|
|
229
|
-
matchday: 6,
|
|
230
|
-
logoUrl: 'https://crests.football-data.org/CL.png',
|
|
231
|
-
groups: 1,
|
|
232
|
-
index: 1,
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
id: '08d15e97-a319-4772-9b82-f1877369b40f',
|
|
236
|
-
name: 'Premier League',
|
|
237
|
-
code: 'PL',
|
|
238
|
-
type: 'LEAGUE',
|
|
239
|
-
areaName: 'England',
|
|
240
|
-
matchday: 18,
|
|
241
|
-
logoUrl: 'https://crests.football-data.org/PL.png',
|
|
242
|
-
groups: 1,
|
|
243
|
-
index: 2,
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
id: '17e62396-bbcb-42f5-acff-caed11534976',
|
|
247
|
-
name: 'Serie A',
|
|
248
|
-
code: 'SA',
|
|
249
|
-
type: 'LEAGUE',
|
|
250
|
-
areaName: 'Italy',
|
|
251
|
-
matchday: 17,
|
|
252
|
-
logoUrl: 'https://crests.football-data.org/SA.png',
|
|
253
|
-
groups: 0,
|
|
254
|
-
index: 3,
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
id: '3726264e-ba3a-4a9f-b4a4-8fc33e12747c',
|
|
258
|
-
name: 'FIFA World Cup',
|
|
259
|
-
code: 'WC',
|
|
260
|
-
type: 'CUP',
|
|
261
|
-
areaName: 'World',
|
|
262
|
-
matchday: 8,
|
|
263
|
-
logoUrl: 'https://crests.football-data.org/qatar.png',
|
|
264
|
-
groups: 1,
|
|
265
|
-
index: 4,
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
id: '555dc3f4-e592-46af-b634-59f07a201f2e',
|
|
269
|
-
name: 'Primeira Liga',
|
|
270
|
-
code: 'PPL',
|
|
271
|
-
type: 'LEAGUE',
|
|
272
|
-
areaName: 'Portugal',
|
|
273
|
-
matchday: 15,
|
|
274
|
-
logoUrl: 'https://crests.football-data.org/PPL.png',
|
|
275
|
-
groups: 0,
|
|
276
|
-
index: 5,
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
id: '59bbdfa0-86d8-4a74-b701-435747c55a42',
|
|
280
|
-
name: 'Primera Division',
|
|
281
|
-
code: 'PD',
|
|
282
|
-
type: 'LEAGUE',
|
|
283
|
-
areaName: 'Spain',
|
|
284
|
-
matchday: 18,
|
|
285
|
-
logoUrl: 'https://crests.football-data.org/PD.png',
|
|
286
|
-
groups: 1,
|
|
287
|
-
index: 6,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
id: '6ae53332-3d27-4781-912d-d9c4e69657f9',
|
|
291
|
-
name: 'Ligue 1',
|
|
292
|
-
code: 'FL1',
|
|
293
|
-
type: 'LEAGUE',
|
|
294
|
-
areaName: 'France',
|
|
295
|
-
matchday: 17,
|
|
296
|
-
logoUrl: 'https://crests.football-data.org/FL1.png',
|
|
297
|
-
groups: 4,
|
|
298
|
-
index: 7,
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
id: '747c79ee-89c8-436a-b0ea-53f05f180007',
|
|
302
|
-
name: 'European Championship',
|
|
303
|
-
code: 'EC',
|
|
304
|
-
type: 'CUP',
|
|
305
|
-
areaName: 'Europe',
|
|
306
|
-
matchday: 1,
|
|
307
|
-
logoUrl: 'https://crests.football-data.org/EUR.svg',
|
|
308
|
-
groups: 1,
|
|
309
|
-
index: 8,
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: '7a32d897-6b22-4212-8ffe-049ae912c346',
|
|
313
|
-
name: 'Eredivisie',
|
|
314
|
-
code: 'DED',
|
|
315
|
-
type: 'LEAGUE',
|
|
316
|
-
areaName: 'Netherlands',
|
|
317
|
-
matchday: 18,
|
|
318
|
-
logoUrl: 'https://crests.football-data.org/ED.png',
|
|
319
|
-
groups: 0,
|
|
320
|
-
index: 9,
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
id: 'ab57e2dc-272c-45e6-b13e-57617a13b753',
|
|
324
|
-
name: 'Championship',
|
|
325
|
-
code: 'ELC',
|
|
326
|
-
type: 'LEAGUE',
|
|
327
|
-
areaName: 'England',
|
|
328
|
-
matchday: 23,
|
|
329
|
-
logoUrl: 'https://crests.football-data.org/ELC.png',
|
|
330
|
-
groups: 0,
|
|
331
|
-
index: 10,
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
id: 'b84e3295-7315-46c7-b979-6d9d784e5460',
|
|
335
|
-
name: 'Campeonato Brasileiro Série A',
|
|
336
|
-
code: 'BSA',
|
|
337
|
-
type: 'LEAGUE',
|
|
338
|
-
areaName: 'Brazil',
|
|
339
|
-
matchday: 38,
|
|
340
|
-
logoUrl: 'https://crests.football-data.org/764.svg',
|
|
341
|
-
groups: 0,
|
|
342
|
-
index: 11,
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
id: 'cafad3ce-1783-4652-9248-4bcad024dd98',
|
|
346
|
-
name: 'Copa Libertadores',
|
|
347
|
-
code: 'CLI',
|
|
348
|
-
type: 'CUP',
|
|
349
|
-
areaName: 'South America',
|
|
350
|
-
matchday: 11,
|
|
351
|
-
logoUrl: 'https://crests.football-data.org/CLI.svg',
|
|
352
|
-
groups: 0,
|
|
353
|
-
index: 12,
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
id: 'ed945bea-9a58-450a-8d62-7baa7722b5e7',
|
|
357
|
-
name: 'Bundesliga',
|
|
358
|
-
code: 'BL1',
|
|
359
|
-
type: 'LEAGUE',
|
|
360
|
-
areaName: 'Germany',
|
|
361
|
-
matchday: 16,
|
|
362
|
-
logoUrl: 'https://crests.football-data.org/BL1.png',
|
|
363
|
-
groups: 0,
|
|
364
|
-
index: 13,
|
|
365
|
-
},
|
|
366
|
-
]
|
|
367
|
-
</script>
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
</template>
|
|
371
|
-
|
|
372
|
-
</ComponentDemo>
|
|
373
|
-
|
|
374
|
-
## Animated rows
|
|
375
|
-
|
|
376
|
-
Enable `animated-rows` to make rows slide to their new position when the order changes (FLIP animation) - perfect for live leaderboards or sortable lists. Provide a stable `row-key` (a field uniquely identifying each row) so every row keeps its identity across reorders. The animation is automatically disabled when the user prefers reduced motion.
|
|
377
|
-
|
|
378
|
-
<ComponentDemo>
|
|
379
|
-
<MazBtn class="vp-raw" size="sm" @click="shuffleRows">Shuffle</MazBtn>
|
|
380
|
-
<br />
|
|
381
|
-
<br />
|
|
382
|
-
<MazTable
|
|
383
|
-
class="vp-raw"
|
|
384
|
-
size="sm"
|
|
385
|
-
animated-rows
|
|
386
|
-
row-key="id"
|
|
387
|
-
:headers="[
|
|
388
|
-
{ label: '#', key: 'id', align: 'center', width: '3rem' },
|
|
389
|
-
{ label: 'Name', key: 'name' },
|
|
390
|
-
{ label: 'Score', key: 'score', align: 'center' },
|
|
391
|
-
]"
|
|
392
|
-
:rows="players"
|
|
393
|
-
/>
|
|
394
|
-
|
|
395
|
-
<template #code>
|
|
396
|
-
|
|
397
|
-
```vue
|
|
398
|
-
<template>
|
|
399
|
-
<MazBtn @click="shuffleRows">
|
|
400
|
-
Shuffle
|
|
401
|
-
</MazBtn>
|
|
402
|
-
<MazTable
|
|
403
|
-
animated-rows
|
|
404
|
-
row-key="id"
|
|
405
|
-
:headers="[
|
|
406
|
-
{ label: '#', key: 'id', align: 'center', width: '3rem' },
|
|
407
|
-
{ label: 'Name', key: 'name' },
|
|
408
|
-
{ label: 'Score', key: 'score', align: 'center' },
|
|
409
|
-
]"
|
|
410
|
-
:rows="players"
|
|
411
|
-
/>
|
|
412
|
-
</template>
|
|
413
|
-
|
|
414
|
-
<script lang="ts" setup>
|
|
415
|
-
import { MazTable } from 'maz-ui/components'
|
|
416
|
-
import { ref } from 'vue'
|
|
417
|
-
|
|
418
|
-
const players = ref([
|
|
419
|
-
{ id: 1, name: 'John', score: 12 },
|
|
420
|
-
{ id: 2, name: 'Jane', score: 24 },
|
|
421
|
-
{ id: 3, name: 'Alice', score: 8 },
|
|
422
|
-
{ id: 4, name: 'Bob', score: 31 },
|
|
423
|
-
])
|
|
424
|
-
|
|
425
|
-
function shuffleRows() {
|
|
426
|
-
players.value = [...players.value].sort(() => Math.random() - 0.5)
|
|
427
|
-
}
|
|
428
|
-
</script>
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
</template>
|
|
432
|
-
|
|
433
|
-
</ComponentDemo>
|
|
434
|
-
|
|
435
|
-
## Virtualization
|
|
436
|
-
|
|
437
|
-
Enable `virtualized` to render only the rows inside the viewport (plus an overscan) instead of every row. This keeps the table fast and the DOM light even with tens of thousands of rows. It works in `rows` mode (data-driven), and `@tanstack/vue-virtual` is loaded on demand - pages that never virtualize a table never ship it.
|
|
438
|
-
|
|
439
|
-
The example below renders **10 000 rows** but only keeps ~20 `<tr>` in the DOM at any time.
|
|
440
|
-
|
|
441
|
-
<ComponentDemo>
|
|
442
|
-
<MazTable
|
|
443
|
-
class="vp-raw"
|
|
444
|
-
size="sm"
|
|
445
|
-
virtualized
|
|
446
|
-
max-height="300px"
|
|
447
|
-
:estimated-row-height="38"
|
|
448
|
-
:headers="[
|
|
449
|
-
{ label: '#', key: 'id', width: '5rem' },
|
|
450
|
-
{ label: 'Name', key: 'name', width: '12rem' },
|
|
451
|
-
{ label: 'Email', key: 'email' },
|
|
452
|
-
{ label: 'Score', key: 'score', align: 'center', width: '6rem' },
|
|
453
|
-
]"
|
|
454
|
-
:rows="virtualizedRows"
|
|
455
|
-
/>
|
|
456
|
-
|
|
457
|
-
<template #code>
|
|
458
|
-
|
|
459
|
-
```vue
|
|
460
|
-
<template>
|
|
461
|
-
<MazTable
|
|
462
|
-
virtualized
|
|
463
|
-
max-height="400px"
|
|
464
|
-
:estimated-row-height="38"
|
|
465
|
-
:headers="[
|
|
466
|
-
{ label: '#', key: 'id', width: '5rem' },
|
|
467
|
-
{ label: 'Name', key: 'name', width: '12rem' },
|
|
468
|
-
{ label: 'Email', key: 'email' },
|
|
469
|
-
{ label: 'Score', key: 'score', align: 'center', width: '6rem' },
|
|
470
|
-
]"
|
|
471
|
-
:rows="rows"
|
|
472
|
-
/>
|
|
473
|
-
</template>
|
|
474
|
-
|
|
475
|
-
<script lang="ts" setup>
|
|
476
|
-
import { MazTable } from 'maz-ui/components'
|
|
477
|
-
|
|
478
|
-
// 10 000 rows - only the visible window is rendered to the DOM
|
|
479
|
-
const rows = Array.from({ length: 10_000 }, (_, i) => ({
|
|
480
|
-
id: i + 1,
|
|
481
|
-
name: `User ${i + 1}`,
|
|
482
|
-
email: `user${i + 1}@maz-ui.com`,
|
|
483
|
-
score: Math.round(Math.random() * 100),
|
|
484
|
-
}))
|
|
485
|
-
</script>
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
</template>
|
|
489
|
-
|
|
490
|
-
</ComponentDemo>
|
|
491
|
-
|
|
492
|
-
### Options
|
|
493
|
-
|
|
494
|
-
| Prop | Default | Description |
|
|
495
|
-
| --- | --- | --- |
|
|
496
|
-
| `virtualized` | `false` | Turns virtualization on. |
|
|
497
|
-
| `max-height` | - | **Required.** Bounds the scroll viewport (any CSS length, e.g. `'400px'`, `'70vh'`). Scrolling is enabled automatically and the header stays sticky. |
|
|
498
|
-
| `estimated-row-height` | `44` | Fixed row height (in px) used to place rows and size the spacers. Set it to your real row height; virtualized rows should be uniform (single line). |
|
|
499
|
-
| `overscan` | `10` | Rows rendered outside the viewport on each side. |
|
|
500
|
-
|
|
501
|
-
### Good to know
|
|
502
|
-
|
|
503
|
-
* **Set a `width` (or `minWidth`) on your headers.** Virtualization forces `table-layout: fixed` so columns stay aligned across the rendered window; without widths the browser distributes them equally.
|
|
504
|
-
* **Accessibility:** the table exposes `aria-rowcount` and each rendered row an `aria-rowindex`, so screen readers still announce "row X of N".
|
|
505
|
-
* **Ignored** (with a dev warning) when `animated-rows` is enabled or when you provide a custom default slot - those paths render every row.
|
|
506
|
-
* **Rendered client-side:** the virtualized body is empty during SSR and fills in on hydration.
|
|
507
|
-
|
|
508
|
-
## Loading
|
|
509
|
-
|
|
510
|
-
Enable the loading state with the prop `loading`
|
|
511
|
-
|
|
512
|
-
<ComponentDemo>
|
|
513
|
-
<MazTable loading class="vp-raw" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
514
|
-
<MazTableRow>
|
|
515
|
-
<MazTableCell>
|
|
516
|
-
1
|
|
517
|
-
</MazTableCell>
|
|
518
|
-
<MazTableCell>
|
|
519
|
-
John
|
|
520
|
-
</MazTableCell>
|
|
521
|
-
<MazTableCell>
|
|
522
|
-
Doe
|
|
523
|
-
</MazTableCell>
|
|
524
|
-
<MazTableCell>
|
|
525
|
-
99
|
|
526
|
-
</MazTableCell>
|
|
527
|
-
</MazTableRow>
|
|
528
|
-
<MazTableRow>
|
|
529
|
-
<MazTableCell>
|
|
530
|
-
2
|
|
531
|
-
</MazTableCell>
|
|
532
|
-
<MazTableCell>
|
|
533
|
-
Doe
|
|
534
|
-
</MazTableCell>
|
|
535
|
-
<MazTableCell>
|
|
536
|
-
John
|
|
537
|
-
</MazTableCell>
|
|
538
|
-
<MazTableCell>
|
|
539
|
-
33
|
|
540
|
-
</MazTableCell>
|
|
541
|
-
</MazTableRow>
|
|
542
|
-
<MazTableRow>
|
|
543
|
-
<MazTableCell>
|
|
544
|
-
3
|
|
545
|
-
</MazTableCell>
|
|
546
|
-
<MazTableCell>
|
|
547
|
-
Max
|
|
548
|
-
</MazTableCell>
|
|
549
|
-
<MazTableCell>
|
|
550
|
-
Simth
|
|
551
|
-
</MazTableCell>
|
|
552
|
-
<MazTableCell>
|
|
553
|
-
66
|
|
554
|
-
</MazTableCell>
|
|
555
|
-
</MazTableRow>
|
|
556
|
-
</MazTable>
|
|
557
|
-
|
|
558
|
-
<template #code>
|
|
559
|
-
|
|
560
|
-
```html{2}
|
|
561
|
-
<MazTable
|
|
562
|
-
:loading="true"
|
|
563
|
-
:headers="['#', 'Lastname', 'Firstname', 'Age']"
|
|
564
|
-
>
|
|
565
|
-
...
|
|
566
|
-
</MazTable>
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
</template>
|
|
570
|
-
|
|
571
|
-
</ComponentDemo>
|
|
572
|
-
|
|
573
|
-
## Sizing
|
|
574
|
-
|
|
575
|
-
Available sizes: `'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'`
|
|
576
|
-
|
|
577
|
-
<ComponentDemo>
|
|
578
|
-
<MazTable class="vp-raw" size="xs" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
579
|
-
<MazTableRow>
|
|
580
|
-
<MazTableCell>
|
|
581
|
-
1
|
|
582
|
-
</MazTableCell>
|
|
583
|
-
<MazTableCell>
|
|
584
|
-
John
|
|
585
|
-
</MazTableCell>
|
|
586
|
-
<MazTableCell>
|
|
587
|
-
Doe
|
|
588
|
-
</MazTableCell>
|
|
589
|
-
<MazTableCell>
|
|
590
|
-
99
|
|
591
|
-
</MazTableCell>
|
|
592
|
-
</MazTableRow>
|
|
593
|
-
</MazTable>
|
|
594
|
-
<br />
|
|
595
|
-
<MazTable class="vp-raw" size="md" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
596
|
-
<MazTableRow>
|
|
597
|
-
<MazTableCell>
|
|
598
|
-
1
|
|
599
|
-
</MazTableCell>
|
|
600
|
-
<MazTableCell>
|
|
601
|
-
John
|
|
602
|
-
</MazTableCell>
|
|
603
|
-
<MazTableCell>
|
|
604
|
-
Doe
|
|
605
|
-
</MazTableCell>
|
|
606
|
-
<MazTableCell>
|
|
607
|
-
99
|
|
608
|
-
</MazTableCell>
|
|
609
|
-
</MazTableRow>
|
|
610
|
-
</MazTable>
|
|
611
|
-
<br />
|
|
612
|
-
<MazTable class="vp-raw" size="lg" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
613
|
-
<MazTableRow>
|
|
614
|
-
<MazTableCell>
|
|
615
|
-
1
|
|
616
|
-
</MazTableCell>
|
|
617
|
-
<MazTableCell>
|
|
618
|
-
John
|
|
619
|
-
</MazTableCell>
|
|
620
|
-
<MazTableCell>
|
|
621
|
-
Doe
|
|
622
|
-
</MazTableCell>
|
|
623
|
-
<MazTableCell>
|
|
624
|
-
99
|
|
625
|
-
</MazTableCell>
|
|
626
|
-
</MazTableRow>
|
|
627
|
-
</MazTable>
|
|
628
|
-
|
|
629
|
-
<template #code>
|
|
630
|
-
|
|
631
|
-
```html
|
|
632
|
-
<MazTable size="xs" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
633
|
-
...
|
|
634
|
-
</MazTable>
|
|
635
|
-
<MazTable size="md" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
636
|
-
...
|
|
637
|
-
</MazTable>
|
|
638
|
-
<MazTable size="lg" :headers="['#', 'Lastname', 'Firstname', 'Age']">
|
|
639
|
-
...
|
|
640
|
-
</MazTable>
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
</template>
|
|
644
|
-
</ComponentDemo>
|
|
645
|
-
|
|
646
|
-
<script lang="ts" setup>
|
|
647
|
-
import { ref } from 'vue'
|
|
648
|
-
import {competitions} from './competitions.ts'
|
|
649
|
-
import { vTooltip } from 'maz-ui/directives/vTooltip'
|
|
650
|
-
|
|
651
|
-
const selectedIds = ref<string[]>(['0262672d-7c7a-4d30-866e-edb88b5a5336'])
|
|
652
|
-
const searchQuery = ref<string>()
|
|
653
|
-
const pageSize = ref<number>(10)
|
|
654
|
-
const page = ref<number>(1)
|
|
655
|
-
|
|
656
|
-
const players = ref([
|
|
657
|
-
{ id: 1, name: 'John', score: 12 },
|
|
658
|
-
{ id: 2, name: 'Jane', score: 24 },
|
|
659
|
-
{ id: 3, name: 'Alice', score: 8 },
|
|
660
|
-
{ id: 4, name: 'Bob', score: 31 },
|
|
661
|
-
])
|
|
662
|
-
|
|
663
|
-
function shuffleRows() {
|
|
664
|
-
players.value = [...players.value].sort(() => Math.random() - 0.5)
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
const virtualizedRows = Array.from({ length: 10_000 }, (_, i) => ({
|
|
668
|
-
id: i + 1,
|
|
669
|
-
name: `User ${i + 1}`,
|
|
670
|
-
email: `user${i + 1}@maz-ui.com`,
|
|
671
|
-
score: Math.round(Math.random() * 100),
|
|
672
|
-
}))
|
|
673
|
-
</script>
|
|
674
|
-
|
|
675
|
-
## Types
|
|
676
|
-
|
|
677
|
-
### Property `row`
|
|
678
|
-
|
|
679
|
-
The `rows` property is an array of Row: `type Rows = Row[]`
|
|
680
|
-
|
|
681
|
-
```ts
|
|
682
|
-
type Row = Record<string, any> & {
|
|
683
|
-
selected?: boolean
|
|
684
|
-
action?: (row: Row) => unknown
|
|
685
|
-
classes?: HTMLAttributes['class']
|
|
686
|
-
}
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
### Property `headers`
|
|
690
|
-
|
|
691
|
-
The `headers` property has type: `type Headers = string | HeadersEnriched[]`
|
|
692
|
-
|
|
693
|
-
```ts
|
|
694
|
-
export interface MazTableHeadersEnriched {
|
|
695
|
-
label: string
|
|
696
|
-
key?: string
|
|
697
|
-
sortable?: boolean
|
|
698
|
-
hidden?: boolean
|
|
699
|
-
srOnly?: boolean
|
|
700
|
-
width?: string
|
|
701
|
-
maxWidth?: string
|
|
702
|
-
minWidth?: string
|
|
703
|
-
classes?: ThHTMLAttributes['class']
|
|
704
|
-
scope?: ThHTMLAttributes['scope']
|
|
705
|
-
align?: ThHTMLAttributes['align']
|
|
706
|
-
rowspan?: ThHTMLAttributes['rowspan']
|
|
707
|
-
colspan?: ThHTMLAttributes['colspan']
|
|
708
|
-
headers?: ThHTMLAttributes['headers']
|
|
709
|
-
}
|
|
710
|
-
```
|
|
711
|
-
|
|
712
|
-
## Accessibility
|
|
713
|
-
|
|
714
|
-
- The column headers have `scope="col"` by default (override it with the `scope` of the header).
|
|
715
|
-
- A sortable column header exposes its state with `aria-sort` (`ascending`, `descending` or `none`), is focusable and sorted with <kbd>Enter</kbd> or <kbd>Space</kbd>.
|
|
716
|
-
- The selection checkboxes are labelled from `@maz-ui/translations` (`aria.selectAll`, `aria.selectRow`).
|
|
717
|
-
|
|
718
|
-
## Props & Events emitted
|
|
719
|
-
|
|
720
|
-
<!--@include: ./../../.vitepress/generated-docs/maz-table.doc.md-->
|
|
721
|
-
|
|
722
|
-
## MazTableCell
|
|
723
|
-
|
|
724
|
-
<!--@include: ./../../.vitepress/generated-docs/maz-table-cell.doc.md-->
|
|
725
|
-
|
|
726
|
-
## MazTableRow
|
|
727
|
-
|
|
728
|
-
<!--@include: ./../../.vitepress/generated-docs/maz-table-row.doc.md-->
|
|
729
|
-
|
|
730
|
-
## MazTableTitle
|
|
731
|
-
|
|
732
|
-
<!--@include: ./../../.vitepress/generated-docs/maz-table-title.doc.md-->
|