Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
fix: Pick-list filter now works if props have been modified after fir…
Browse files Browse the repository at this point in the history
…st-render (#400)

* add a console warn and simpler demo file

* 3 new tests for filter. metadata wip

* change filter data from to selected properties.
Prior was using all attributes.

* add event for modified properties filter depends on

* split filter setup so it can called on prop change

* fix bug in tests

* remove .only from test

* filter: add a warning when there is no data.

* fix getTag to work with no attributes

* add tests for filter

* fix accessibility

* change existing demo to advanced demo

* change simple demo to default

* wip demos

* PickList and ValueList: share more code between lists 461 (#484)

* remove .only from test

* fix lint errors

* add temporary backup files to gitignore

* abstract common methods to a shared location

* share selection/deselection tests

* fix shiftClick behavior for valueList

* abstract shared tests between lists

* improve method return type

* normalize render functions

* add this typing to shared logic file
https://stackoverflow.com/questions/54710927/typescript-types-and-bind

* moving compact prop to alpha order

* added typing to items

* add compact property to value list

* fix type error on textHeading

* fix typings

* update lists to use common MO callback
MO: Mutation Observer

* comment touchup

* fix backwards compat and event typing

* add missing typings

* space the tests out

* code review follow up

* abstracted some types

* move comment up

* PickList and ValueList: share render methods between lists 461 (#488)

* fix lint errors

* add temporary backup files to gitignore

* abstract common methods to a shared location

* share selection/deselection tests

* fix shiftClick behavior for valueList

* abstract shared tests between lists

* improve method return type

* normalize render functions

* abstract the render methods to functional comp

* switch value list over to use shared render

* fix calcite-block accessible test.

* update calciteListItemPropsUpdated event docs

* replace attribute logic with properties

* minor demo changes

* clean up demo

* removing redundant warn message

* remove maquette
  • Loading branch information
pr3tori4n authored Nov 6, 2019
1 parent 51fd559 commit 79f8146
Show file tree
Hide file tree
Showing 3 changed files with 558 additions and 398 deletions.
15 changes: 3 additions & 12 deletions src/components/calcite-pick-list/shared-list-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,9 @@ export const sharedListMethods = {
): void {
this.items = Array.from(this.el.querySelectorAll(tagname));
this.items.forEach((item) => {
const iconType = this.getIconType();
if (iconType) {
item.setAttribute("icon", iconType);
} else {
item.removeAttribute("icon");
}
item.icon = this.getIconType();
item.compact = this.compact;
if (item.hasAttribute("selected")) {
if (item.selected) {
updateSelectedValuesMap(this.selectedValues, item);
}
});
Expand Down Expand Up @@ -117,11 +112,7 @@ export const sharedListMethods = {
const filteredData = event.detail;
const values = filteredData.map((item) => item.value);
this.items.forEach((item) => {
if (values.indexOf(item.value) === -1) {
item.setAttribute("hidden", "");
} else {
item.removeAttribute("hidden");
}
item.hidden = values.indexOf(item.value) === -1;
});
},
getItemData(this: CalcitePickList | CalciteValueList): Record<string, string | object>[] {
Expand Down
Loading

0 comments on commit 79f8146

Please sign in to comment.