-
Notifications
You must be signed in to change notification settings - Fork 470
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(kit): default options configuration for select, multi-select, combo-box #1352
Conversation
Pull request was closed ✔️All saved screenshots (for current PR) were deleted 🗑️ |
projects/kit/components/data-list-wrapper/data-list-wrapper.component.ts
Outdated
Show resolved
Hide resolved
projects/kit/components/data-list-wrapper/data-list-wrapper-options.ts
Outdated
Show resolved
Hide resolved
projects/kit/components/data-list-wrapper/data-list-wrapper-options.ts
Outdated
Show resolved
Hide resolved
projects/kit/components/data-list-wrapper/data-list-wrapper-options.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! Please also add options to ComboBox
. I also wonder if we can have some master token for those things so they are overridable in one place - because they are all about the same thing.
projects/kit/components/data-list-wrapper/data-list-wrapper.component.ts
Outdated
Show resolved
Hide resolved
projects/kit/components/data-list-wrapper/data-list-wrapper-options.ts
Outdated
Show resolved
Hide resolved
projects/kit/components/data-list-wrapper/data-list-wrapper-options.ts
Outdated
Show resolved
Hide resolved
projects/demo/src/modules/components/combo-box/examples/6/index.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #1352 +/- ##
==========================================
+ Coverage 64.67% 64.77% +0.09%
==========================================
Files 766 770 +4
Lines 8754 8778 +24
Branches 1742 1742
==========================================
+ Hits 5662 5686 +24
Misses 2674 2674
Partials 418 418
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vladimirpotekhin @splincode @mullinsmikey
stringify
repeats itself in every token. Also identityMatcher
and disabledItemHandler
appear in multiple places. Maybe we can create TUI_ITEMS_HANDLERS
token with those three and reuse it across relevant components? I think if we do that, we can drop options for DataListWrapper
(it will only have size
which tends to change from one use to another so changing the default is not that helpful) and Select
(it will only have valueContent
and with added stringify
it might also be useless to change the default on valueContent
). We can keep options for MultiSelect
(expandable
and valueContent
) and ComboBox
(strictMatcher
, valueContent
and strict
). What do you think? @mullinsmikey sorry to keep adding more work and refactor to this task, just want to make sure we get the best and most flexible solution here 🙂
Don't worry, I totally get it |
@waterplea do you mean? {
provide: TUI_ITEMS_HANDLERS,
useFactory: myCustomHandler,
multi: true
},
{
provide: TUI_ITEMS_HANDLERS,
useFactory: identityMatcher,
multi: true
},
{
provide: TUI_ITEMS_HANDLERS,
useFactory: stringify,
multi: true
}, |
No, I just meant a separate token with this interface: export interface TuiItemHandlers<T> {
readonly stringify: TuiStringHandler<T>;
readonly identityMatcher: TuiIdentityMatcher<T>;
readonly disabledItemHandler: TuiBooleanHandler<T>;
} |
Separate token |
Ok, @mullinsmikey please go ahead and implement it when you got time. |
Strange how Cypress job is failing with |
b4c3c0f
to
ff1647f
Compare
@splincode thanks for your help! |
ff1647f
to
20b4f2a
Compare
@splincode yeah, I completely forgot that rebase is applied to each commit. Had to squash the whole branch |
@mullinsmikey thank you very much for your patience |
@splincode is it OK that there are 2 instances of cypress being launched simultaneously and one of them is failing? |
…`, `Select` and `DataListWrapper` (#1352)
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue #133 is not fully implemented.
What is the new behavior?
Partial implementation of #133 for
data-list-wrapper
,select
,multi-select
, andcombo-box
components.Does this PR introduce a breaking change?