-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add mods into component panel
#12
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2ae1d15
feat: add `mods` into component panel
4c001ce
feat: select for mods in panel
17f22bf
Merge branch 'main' into itmaga/mods-in-component-panel
0f280b7
chore: resolve todo
a3dc741
refactor: review fixes
4138c96
feat: button wrapper for dropdown trigger
98c8b85
fix: b-dropdown keyboard interaction
d5bd756
fix: b-dropdown keyboard interaction
0dcefa5
fix: review fixes
73029f0
fix(b-dropdown): UI/UX
shining-mind 83ed1bc
chore(b-components-panel-item): remove icon prop from b-dropdown
shining-mind c027834
chore(devtools-backend): create interface directory
shining-mind 6edc238
refactor(devtools-backend): use ComponentQuery to search/highlight co…
shining-mind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,4 @@ | |
| export * from './serialize'; | ||
| export * from './search'; | ||
| export * from './ui'; | ||
| export * from './interface'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /*! | ||
| * V4Fire DevTools | ||
| * https://github.com/V4Fire/DevTools | ||
| * | ||
| * Released under the MIT license | ||
| * https://github.com/V4Fire/DevTools/blob/main/LICENSE | ||
| */ | ||
|
|
||
| /** | ||
| * Parameters to search for a component | ||
| */ | ||
| export interface ComponentQuery { | ||
| /** | ||
| * The unique component identifier. | ||
| * The value is formed based on the passed prop or dynamically. | ||
| */ | ||
| readonly componentId: string; | ||
|
|
||
| /** | ||
| * The component name in dash-style without special postfixes like `-functional` | ||
| */ | ||
| readonly componentName?: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /*! | ||
| * V4Fire DevTools | ||
| * https://github.com/V4Fire/DevTools | ||
| * | ||
| * Released under the MIT license | ||
| * https://github.com/V4Fire/DevTools/blob/main/LICENSE | ||
| */ | ||
|
|
||
| export * from './component'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
packages/devtools-core/src/components/form/b-dropdown/b-dropdown.ss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| - namespace [%fileName%] | ||
|
|
||
| - include 'components/form/b-select'|b as placeholder | ||
|
|
||
| - template index() extends ['b-select'].index | ||
| - block nativeInput() | ||
| < .&__value | ||
| {{ value }} | ||
|
|
||
| - block body | ||
| < button.&__trigger & | ||
| @click = toggle | | ||
| @focus = onFocus | | ||
| @blur = onBlur | ||
| . | ||
| - super |
29 changes: 29 additions & 0 deletions
29
packages/devtools-core/src/components/form/b-dropdown/b-dropdown.styl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| @import "@super/components/form/b-select/b-select.styl" | ||
|
|
||
| b-dropdown extends b-select | ||
| &__dropdown | ||
| absolute left 0 top 100% | ||
| overflow-x hidden | ||
| border 1px solid black | ||
| background-color white | ||
|
|
||
| &__value | ||
| margin-right 4px | ||
|
|
||
| &__trigger | ||
| border none | ||
|
|
||
| &__wrapper | ||
| cursor inherit | ||
|
|
||
| &__icon | ||
| height 1em | ||
| font-size 0.875rem | ||
| transition transform 0.15s | ||
|
|
||
| &_opened_true ^[0]__icon | ||
| transform rotate(-180deg) | ||
|
|
||
| &__item_selected_true | ||
| &__item_marked_true | ||
| background-color rgba(100, 100, 100, 0.1) |
34 changes: 34 additions & 0 deletions
34
packages/devtools-core/src/components/form/b-dropdown/b-dropdown.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /*! | ||
| * V4Fire DevTools | ||
| * https://github.com/V4Fire/DevTools | ||
| * | ||
| * Released under the MIT license | ||
| * https://github.com/V4Fire/DevTools/blob/main/LICENSE | ||
| */ | ||
|
|
||
| import bSelect, { component, field } from 'components/form/b-select/b-select'; | ||
| import iActiveItems from 'components/traits/i-active-items/i-active-items'; | ||
|
|
||
| export * from 'components/form/b-select/b-select'; | ||
|
|
||
| @component({functional: false}) | ||
| export default class bDropdown extends bSelect { | ||
| override readonly icon: string = 'caret-down'; | ||
|
|
||
| @field<bDropdown>({ | ||
| unique: true, | ||
| init: (o) => { | ||
| o.watch('valueProp', (val) => o.setActive(val, true)); | ||
| o.watch('modelValue', (val) => o.setActive(val, true)); | ||
| return iActiveItems.linkActiveStore(o, (val) => o.resolveValue(o.valueProp ?? o.modelValue ?? val)); | ||
| } | ||
| }) | ||
| override activeStore!: iActiveItems['activeStore']; | ||
|
|
||
| /** | ||
| * Overriding the `onFocus` because dropdown shouldn't be opened on focus | ||
| */ | ||
| protected override onFocus(): void { | ||
| this.setMod('focused', 'true'); | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
packages/devtools-core/src/components/form/b-dropdown/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /*! | ||
| * V4Fire DevTools | ||
| * https://github.com/V4Fire/DevTools | ||
| * | ||
| * Released under the MIT license | ||
| * https://github.com/V4Fire/DevTools/blob/main/LICENSE | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| package('b-dropdown') | ||
| .extends('b-select'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.