@anmed/mui-selection 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,15 @@ const handlerClick = () => {
45
45
  dispatcher('action', value);
46
46
  }
47
47
  };
48
+ const isItemSelect = (item, value) => {
49
+ if (item != null && value != null) {
50
+ if (keyCode != null) {
51
+ return item[keyCode] == value[keyCode];
52
+ }
53
+ return item == value;
54
+ }
55
+ return false;
56
+ };
48
57
  </script>
49
58
 
50
59
  <div on:click={handlerClick}>
@@ -53,7 +62,7 @@ const handlerClick = () => {
53
62
  <CommonField {label} {required} bind:focused {above} {error}>
54
63
  <div class="card-select-box">
55
64
  {#each list as item}
56
- <span class="{item === value? 'card-select-item-selected' :'card-select-item-normal'}"
65
+ <span class="{isItemSelect(item,value)? 'card-select-item-selected' :'card-select-item-normal'}"
57
66
  on:click={()=>onCardItemClick(item)}>{getDisplayText(item)}</span>
58
67
  {/each}
59
68
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmed/mui-selection",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.js",