@pocketprep/ui-kit 3.2.2 → 3.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,15 +4,16 @@
4
4
  class="uikit-toggle-switch"
5
5
  :class="{
6
6
  'uikit-toggle-switch--enabled': modelValue,
7
+ 'uikit-toggle-switch--disabled': disabled,
7
8
  [`uikit-toggle-switch--${size}`]: true
8
9
  }"
9
10
  tabindex="0"
10
11
  role="checkbox"
11
12
  :aria-checked="modelValue"
12
- @keydown.enter="toggleOption"
13
- @keydown.prevent.space="toggleOption"
13
+ @keydown.enter="!disabled && toggleOption()"
14
+ @keydown.prevent.space="!disabled && toggleOption()"
14
15
  @mousedown.prevent
15
- @click="toggleOption"
16
+ @click="!disabled && toggleOption()"
16
17
  >
17
18
  <div
18
19
  v-dark="isDarkMode"
@@ -38,6 +39,7 @@ import { dark } from '../../directives'
38
39
  export default class ToggleSwitch extends Vue {
39
40
  @Prop({ default: false }) modelValue!: boolean
40
41
  @Prop({ default: false }) isDarkMode!: boolean
42
+ @Prop({ default: false }) disabled!: boolean
41
43
  @Prop({ default: 'small' }) size!: 'small' | 'large'
42
44
 
43
45
  @Emit('update:modelValue')
@@ -118,6 +120,11 @@ export default class ToggleSwitch extends Vue {
118
120
  }
119
121
  }
120
122
 
123
+ &--disabled {
124
+ opacity: 0.5;
125
+ cursor: default;
126
+ }
127
+
121
128
  &__handle {
122
129
  background-color: $white;
123
130
  border: 0.5px solid rgba(0, 0, 0, 0.04);
@@ -157,4 +164,4 @@ export default class ToggleSwitch extends Vue {
157
164
  }
158
165
  }
159
166
  }
160
- </style>
167
+ </style>
@@ -96,31 +96,35 @@
96
96
  'uikit-select__list--subtext': subtext,
97
97
  }"
98
98
  >
99
- <li
100
- v-for="item in filteredData"
101
- :key="JSON.stringify(item)"
102
- ref="uikit-select__items"
103
- v-dark="isDarkMode"
104
- class="uikit-select__item"
105
- :class="{
106
- 'uikit-select__item--link': item.type === 'link',
107
- 'uikit-select__item--subtext': item.subtext
108
- }"
109
- :data-value="item.value || undefined"
110
- tabindex="0"
111
- @click="selectItem(item)"
112
- @keydown="keyPressedItem"
113
- @mousedown.prevent
114
- >
115
- {{ item.label }}
116
- <div
117
- v-if="item.subtext"
99
+ <slot name="dropdownList">
100
+ <li
101
+ v-for="item in filteredData"
102
+ :key="JSON.stringify(item)"
103
+ ref="uikit-select__items"
118
104
  v-dark="isDarkMode"
119
- class="uikit-select__item-subtext"
105
+ class="uikit-select__item"
106
+ :class="{
107
+ 'uikit-select__item--link': item.type === 'link',
108
+ 'uikit-select__item--subtext': item.subtext
109
+ }"
110
+ :data-value="item.value || undefined"
111
+ tabindex="0"
112
+ @click="selectItem(item)"
113
+ @keydown="keyPressedItem"
114
+ @mousedown.prevent
120
115
  >
121
- {{ item.subtext }}
122
- </div>
123
- </li>
116
+ <slot name="dropdownListItem">
117
+ {{ item.label }}
118
+ <div
119
+ v-if="item.subtext"
120
+ v-dark="isDarkMode"
121
+ class="uikit-select__item-subtext"
122
+ >
123
+ {{ item.subtext }}
124
+ </div>
125
+ </slot>
126
+ </li>
127
+ </slot>
124
128
  </ul>
125
129
  </div>
126
130
  </div>
@@ -28,7 +28,7 @@ export type TTableRow = {
28
28
  id: string | number
29
29
  styles?: Record<string, string>
30
30
  } & {
31
- [key: string]: string | number
31
+ [key: string]: unknown
32
32
  }
33
33
 
34
34
  export interface ITableSortSettings {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.2.2",
3
+ "version": "3.2.4",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {