@pocketprep/ui-kit 3.4.47 → 3.4.49
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.
- package/dist/@pocketprep/ui-kit.js +1046 -1033
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +3 -3
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Forms/CheckboxOption.vue +26 -6
- package/lib/components/Tables/Table.vue +9 -1
- package/package.json +1 -1
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
v-if="checkboxId"
|
|
4
4
|
v-dark="isDarkMode"
|
|
5
5
|
class="uikit-checkbox-option"
|
|
6
|
-
:class="{
|
|
7
|
-
|
|
6
|
+
:class="{
|
|
7
|
+
'uikit-checkbox-option--selected': modelValue,
|
|
8
|
+
'uikit-checkbox-option--disabled': disabled,
|
|
9
|
+
}"
|
|
10
|
+
:tabindex="disabled ? -1 : 0"
|
|
8
11
|
:aria-labelledby="checkboxId"
|
|
9
12
|
role="checkbox"
|
|
10
13
|
:aria-checked="modelValue === true ? true : modelValue === null ? 'mixed' : false"
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
<Checkbox
|
|
16
19
|
:modelValue="modelValue"
|
|
17
20
|
tabindex="-1"
|
|
18
|
-
:disabled="
|
|
21
|
+
:disabled="disabled"
|
|
19
22
|
class="uikit-checkbox-option__checkbox"
|
|
20
23
|
:is-dark-mode="isDarkMode"
|
|
21
24
|
:has-label="true"
|
|
@@ -43,6 +46,7 @@ export default class CheckboxOption extends Vue {
|
|
|
43
46
|
@Prop({ default: false }) modelValue!: boolean | null
|
|
44
47
|
@Prop({ default: false }) isDarkMode!: boolean
|
|
45
48
|
@Prop() label!: string
|
|
49
|
+
@Prop({ default: false }) disabled!: boolean
|
|
46
50
|
|
|
47
51
|
checkboxId: null | string = null
|
|
48
52
|
|
|
@@ -52,7 +56,11 @@ export default class CheckboxOption extends Vue {
|
|
|
52
56
|
|
|
53
57
|
@Emit('update:modelValue')
|
|
54
58
|
emitUpdateModelValue (val: boolean) {
|
|
55
|
-
|
|
59
|
+
if (this.disabled) {
|
|
60
|
+
return this.modelValue
|
|
61
|
+
} else {
|
|
62
|
+
return val
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
66
|
</script>
|
|
@@ -75,7 +83,7 @@ export default class CheckboxOption extends Vue {
|
|
|
75
83
|
position: relative;
|
|
76
84
|
z-index: 1;
|
|
77
85
|
|
|
78
|
-
&:hover {
|
|
86
|
+
&:not(&--disabled):hover {
|
|
79
87
|
label {
|
|
80
88
|
color: $slate-03;
|
|
81
89
|
}
|
|
@@ -98,7 +106,7 @@ export default class CheckboxOption extends Vue {
|
|
|
98
106
|
&--dark {
|
|
99
107
|
color: rgba($white, 0.72);
|
|
100
108
|
|
|
101
|
-
&:hover {
|
|
109
|
+
&:not(&--disabled):hover {
|
|
102
110
|
label {
|
|
103
111
|
color: rgba($white, 0.72);
|
|
104
112
|
}
|
|
@@ -160,6 +168,18 @@ export default class CheckboxOption extends Vue {
|
|
|
160
168
|
}
|
|
161
169
|
}
|
|
162
170
|
|
|
171
|
+
&--disabled {
|
|
172
|
+
color: $slate;
|
|
173
|
+
|
|
174
|
+
&--dark {
|
|
175
|
+
color: rgba($white, 0.7);
|
|
176
|
+
|
|
177
|
+
label {
|
|
178
|
+
color: rgba($white, 0.7) !important;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
163
183
|
&__label {
|
|
164
184
|
margin-left: 12px;
|
|
165
185
|
width: calc(100% - 27px);
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
</template>
|
|
239
239
|
|
|
240
240
|
<script lang="ts">
|
|
241
|
-
import { Component, Emit, Prop, Vue } from 'vue-facing-decorator'
|
|
241
|
+
import { Component, Emit, Prop, Vue, Watch } from 'vue-facing-decorator'
|
|
242
242
|
import Icon from '../Icons/Icon.vue'
|
|
243
243
|
import OverflowTooltip from '../Tooltips/OverflowTooltip.vue'
|
|
244
244
|
import { dark } from '../../directives'
|
|
@@ -334,6 +334,14 @@ export default class Table extends Vue {
|
|
|
334
334
|
this.emitSort()
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
@Watch('defaultSort')
|
|
338
|
+
defaultSortChanged () {
|
|
339
|
+
if (this.defaultSort) {
|
|
340
|
+
this.currentSort = JSON.parse(JSON.stringify(this.defaultSort))
|
|
341
|
+
this.emitSort()
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
337
345
|
@Emit('sort')
|
|
338
346
|
emitSort (): ITableSortSettings {
|
|
339
347
|
return this.currentSort
|