Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(table): add menu option (#249) #290

Merged
merged 1 commit into from
Jun 6, 2023
Merged

feat(table): add menu option (#249) #290

merged 1 commit into from
Jun 6, 2023

Conversation

kiaking
Copy link
Member

@kiaking kiaking commented May 29, 2023

Adds menu option to the table.

const options = useTable({
  menu: [
    {
      label: 'Option A',
      dropdown: {
        type: 'menu',
        options: [
          { label: 'Option 1', onClick: () => {} },
          { label: 'Option 2', onClick: () => {} },
          { label: 'Option 3', onClick: () => {} }
        ]
      }
    }
  ]
})

User can pass in multiple options. And also, by passing in multiple nested array, it groups the menu with divider like shown in the screenshot.

const options = useTable({
  menu: [
    [
      { label: 'Option A', dropdown: { ... } },
      { label: 'Option B', dropdown: { ... } }
    ],
    [
      { label: 'Option A', dropdown: { ... } }
    ]
  ]
})

User can use state option to control how the menu button would appear.

  • inactive – The default state. The menu button fill look slightly muted.
  • active – The menu button label text will appear with --c-text-1 color.
  • indicate – Adds blue dot indicator on the menu button. Use this to indicate user that the menu is now different than its default state (e.g. user has selected some option).
const options = useTable({
  menu: [
    {
      label: 'Option A',
      state: 'indicate',
      dropdown: { ... }
    }
  ]
})
Screenshot 2023-05-29 at 13 57 03

@netlify
Copy link

netlify bot commented May 29, 2023

Deploy Preview for sefirot-story ready!

Name Link
🔨 Latest commit b2a28be
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-story/deploys/6474380b10e3760008c248e1
😎 Deploy Preview https://deploy-preview-290--sefirot-story.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@kiaking kiaking requested a review from brc-dd May 29, 2023 05:29
@kiaking kiaking self-assigned this May 29, 2023
@kiaking kiaking added the enhancement New feature or request label May 29, 2023
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Patch coverage: 98.51% and project coverage change: +0.32 🎉

Comparison is base (f95e5e6) 82.88% compared to head (b2a28be) 83.21%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
+ Coverage   82.88%   83.21%   +0.32%     
==========================================
  Files         120      122       +2     
  Lines       10098    10288     +190     
  Branches      420      433      +13     
==========================================
+ Hits         8370     8561     +191     
+ Misses       1728     1727       -1     
Impacted Files Coverage Δ
lib/components/STableHeader.vue 96.96% <89.28%> (-3.04%) ⬇️
lib/components/STable.vue 73.76% <100.00%> (+0.50%) ⬆️
lib/components/STableHeaderMenu.vue 100.00% <100.00%> (ø)
lib/components/STableHeaderMenuItem.vue 100.00% <100.00%> (ø)
lib/composables/Table.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@netlify
Copy link

netlify bot commented May 29, 2023

Deploy Preview for sefirot-docs ready!

Name Link
🔨 Latest commit b2a28be
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-docs/deploys/6474380b51ec760008befd2b
😎 Deploy Preview https://deploy-preview-290--sefirot-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@kiaking kiaking merged commit b06e1af into main Jun 6, 2023
15 checks passed
@kiaking kiaking deleted the 249-table-menu-option branch June 6, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Table] Add menu option
1 participant