@pocketprep/ui-kit 3.2.3 → 3.3.0
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 +3705 -3604
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +8 -8
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Calendar/Calendar.vue +118 -43
- package/lib/components/Controls/ToggleSwitch.vue +11 -4
- package/lib/components/Forms/Input.vue +44 -42
- package/lib/components/Forms/Select.vue +50 -43
- package/lib/components/Icons/Icon.vue +3 -0
- package/lib/components/Icons/IconCalendarPicker.vue +17 -0
- package/lib/components/Icons/icon.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,50 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="uikit-calendar"
|
|
4
|
+
>
|
|
5
|
+
<PocketInput
|
|
6
|
+
ref="calendarInput"
|
|
4
7
|
v-model="dateString"
|
|
5
8
|
:label="label"
|
|
6
9
|
class="uikit-calendar__input"
|
|
7
10
|
:placeholder="placeholder"
|
|
8
11
|
:is-dark-mode="isDarkMode"
|
|
9
|
-
|
|
12
|
+
:force-hover-style="hover"
|
|
13
|
+
:force-focus-style="isShowingCalendar"
|
|
14
|
+
:hideInputCaret="true"
|
|
15
|
+
:disabled="disabled"
|
|
10
16
|
@update:modelValue="processDateString"
|
|
11
|
-
@click="
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
v-dark="isDarkMode"
|
|
16
|
-
class="uikit-calendar__icon"
|
|
17
|
-
:class="{ 'uikit-calendar__icon--hover': hover, 'uikit-calendar__icon--focus': focus }"
|
|
18
|
-
tabindex="0"
|
|
19
|
-
@keydown.stop.prevent.enter="calendar && calendar.show()"
|
|
20
|
-
@click="calendar && calendar.show()"
|
|
17
|
+
@click="showCalendar"
|
|
18
|
+
@keydown="handleInputKeydown"
|
|
19
|
+
@mouseover="hover = true"
|
|
20
|
+
@mouseout="hover = false"
|
|
21
21
|
>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
<div
|
|
23
|
+
v-if="isShowingCalendar"
|
|
24
|
+
v-dark="isDarkMode"
|
|
25
|
+
class="uikit-calendar__clear-date-icon"
|
|
26
|
+
@click.stop.prevent="clearCalendar"
|
|
27
|
+
>
|
|
28
|
+
<Icon type="close" />
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
v-dark="isDarkMode"
|
|
32
|
+
class="uikit-calendar__calendar-icon"
|
|
33
|
+
:class="{
|
|
34
|
+
'uikit-calendar__calendar-icon--active': !disabled && (hover || isShowingCalendar),
|
|
35
|
+
}"
|
|
36
|
+
>
|
|
37
|
+
<Icon type="calendarPicker" />
|
|
38
|
+
</div>
|
|
39
|
+
<div
|
|
40
|
+
ref="calendar"
|
|
41
|
+
class="uikit-calendar__trigger"
|
|
42
|
+
:tabindex="-1"
|
|
43
|
+
/>
|
|
44
|
+
</PocketInput>
|
|
29
45
|
</div>
|
|
30
46
|
</template>
|
|
31
47
|
|
|
32
48
|
<script lang="ts">
|
|
33
|
-
import type { ComponentPublicInstance } from 'vue'
|
|
34
49
|
import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
|
|
35
|
-
import
|
|
50
|
+
import PocketInput from '../Forms/Input.vue'
|
|
36
51
|
import Icon from '../Icons/Icon.vue'
|
|
37
52
|
import Litepicker from 'litepicker'
|
|
38
53
|
import 'litepicker/dist/plugins/keyboardnav'
|
|
39
54
|
import type { DateTime } from 'litepicker/dist/types/datetime'
|
|
40
55
|
import { dark } from '../../directives'
|
|
56
|
+
import type { ComponentPublicInstance } from 'vue'
|
|
41
57
|
|
|
42
58
|
@Component({
|
|
43
59
|
directives: {
|
|
44
60
|
dark,
|
|
45
61
|
},
|
|
46
62
|
components: {
|
|
47
|
-
|
|
63
|
+
PocketInput,
|
|
48
64
|
Icon,
|
|
49
65
|
},
|
|
50
66
|
})
|
|
@@ -53,12 +69,13 @@ export default class Calendar extends Vue {
|
|
|
53
69
|
@Prop({ default: '' }) placeholder!: string
|
|
54
70
|
@Prop() modelValue!: Date | null
|
|
55
71
|
@Prop({ default: false }) isDarkMode!: boolean
|
|
72
|
+
@Prop({ default: false }) disabled!: boolean
|
|
56
73
|
|
|
57
74
|
calendar: null | Litepicker = null
|
|
58
75
|
calendarInput: Date | null = null
|
|
59
76
|
dateString = ''
|
|
60
77
|
hover = false
|
|
61
|
-
|
|
78
|
+
isShowingCalendar = false
|
|
62
79
|
afterCalendarTab = -1
|
|
63
80
|
|
|
64
81
|
beforeUnmount () {
|
|
@@ -78,6 +95,12 @@ export default class Calendar extends Vue {
|
|
|
78
95
|
this.dateString = this.calendarInput.toLocaleDateString()
|
|
79
96
|
this.emitUpdateModelValue(this.calendarInput)
|
|
80
97
|
})
|
|
98
|
+
picker.on('clear:selection', () => {
|
|
99
|
+
this.calendarInput = null
|
|
100
|
+
this.dateString = ''
|
|
101
|
+
this.emitUpdateModelValue(this.calendarInput)
|
|
102
|
+
picker.hide()
|
|
103
|
+
})
|
|
81
104
|
picker.on('show', () => {
|
|
82
105
|
this.$nextTick(() => {
|
|
83
106
|
const calendarEls = Array.from<HTMLElement>(document.querySelectorAll('.litepicker'))
|
|
@@ -86,19 +109,48 @@ export default class Calendar extends Vue {
|
|
|
86
109
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
87
110
|
) as HTMLElement
|
|
88
111
|
focusableEl.focus()
|
|
112
|
+
this.isShowingCalendar = true
|
|
89
113
|
})
|
|
90
114
|
})
|
|
91
115
|
picker.on('hide', () => {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
const calendarInputContainer = this.$refs['calendarInput'] as ComponentPublicInstance | undefined
|
|
117
|
+
const calendarInputContainerEl = calendarInputContainer?.$el as HTMLDivElement | undefined
|
|
118
|
+
const calendarInputEl = calendarInputContainerEl?.querySelector('input')
|
|
119
|
+
calendarInputEl?.focus()
|
|
120
|
+
calendarInputEl?.blur()
|
|
121
|
+
this.isShowingCalendar = false
|
|
97
122
|
})
|
|
98
123
|
},
|
|
99
124
|
})
|
|
100
125
|
}
|
|
101
126
|
|
|
127
|
+
clearCalendar () {
|
|
128
|
+
if (this.disabled) {
|
|
129
|
+
return
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
this.calendar?.clearSelection()
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
showCalendar () {
|
|
136
|
+
if (this.disabled) {
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this.calendar && this.calendar.show()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
handleInputKeydown (event: KeyboardEvent) {
|
|
144
|
+
if (![ 'Shift', 'Tab' ].includes(event.key)) {
|
|
145
|
+
if (!this.isShowingCalendar) {
|
|
146
|
+
this.showCalendar()
|
|
147
|
+
}
|
|
148
|
+
event.stopPropagation()
|
|
149
|
+
event.preventDefault()
|
|
150
|
+
return false
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
102
154
|
processDateString () {
|
|
103
155
|
const inputDate = new Date(this.dateString)
|
|
104
156
|
if (inputDate && inputDate.toLocaleDateString() !== this.calendarInput?.toLocaleDateString()) {
|
|
@@ -108,7 +160,7 @@ export default class Calendar extends Vue {
|
|
|
108
160
|
}
|
|
109
161
|
|
|
110
162
|
@Emit('update:modelValue')
|
|
111
|
-
emitUpdateModelValue (calendarInput: Date) {
|
|
163
|
+
emitUpdateModelValue (calendarInput: Date | null) {
|
|
112
164
|
return calendarInput
|
|
113
165
|
}
|
|
114
166
|
}
|
|
@@ -126,32 +178,55 @@ export default class Calendar extends Vue {
|
|
|
126
178
|
height: 1px;
|
|
127
179
|
}
|
|
128
180
|
|
|
129
|
-
&
|
|
181
|
+
&__clear-date-icon {
|
|
130
182
|
position: absolute;
|
|
131
|
-
|
|
183
|
+
top: 30px;
|
|
184
|
+
right: 34px;
|
|
132
185
|
bottom: 8px;
|
|
133
186
|
width: 20px;
|
|
134
187
|
height: 20px;
|
|
135
188
|
cursor: pointer;
|
|
136
|
-
color: $
|
|
189
|
+
color: $steel;
|
|
137
190
|
outline: none;
|
|
138
191
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
192
|
+
&--dark {
|
|
193
|
+
color: $pewter;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
color: $brand-blue;
|
|
198
|
+
|
|
199
|
+
&--dark {
|
|
200
|
+
color: $banana-bread;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
svg {
|
|
143
205
|
width: 100%;
|
|
144
206
|
height: 100%;
|
|
145
|
-
position: absolute;
|
|
146
|
-
border: 1px solid $brand-blue;
|
|
147
|
-
border-radius: 5px;
|
|
148
207
|
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&__calendar-icon {
|
|
211
|
+
position: absolute;
|
|
212
|
+
top: 30px;
|
|
213
|
+
right: 8px;
|
|
214
|
+
bottom: 8px;
|
|
215
|
+
width: 20px;
|
|
216
|
+
height: 20px;
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
color: $steel;
|
|
219
|
+
outline: none;
|
|
149
220
|
|
|
150
221
|
&--dark {
|
|
151
|
-
color: $
|
|
222
|
+
color: $pewter;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&--active {
|
|
226
|
+
color: $brand-blue;
|
|
152
227
|
|
|
153
|
-
|
|
154
|
-
|
|
228
|
+
&--dark {
|
|
229
|
+
color: $banana-bread;
|
|
155
230
|
}
|
|
156
231
|
}
|
|
157
232
|
|
|
@@ -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>
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
v-dark="isDarkMode"
|
|
11
11
|
class="uikit-input__label"
|
|
12
12
|
:class="{
|
|
13
|
-
'uikit-input__label--hover': hover,
|
|
14
|
-
'uikit-input__label--focus': focus,
|
|
15
|
-
'uikit-input__label--error': error
|
|
13
|
+
'uikit-input__label--hover': hover || forceHoverStyle,
|
|
14
|
+
'uikit-input__label--focus': focus || forceFocusStyle,
|
|
15
|
+
'uikit-input__label--error': error,
|
|
16
|
+
'uikit-input__input--hide-caret': hideInputCaret,
|
|
16
17
|
}"
|
|
17
18
|
>{{ label }}</label>
|
|
18
19
|
<div
|
|
@@ -32,9 +33,10 @@
|
|
|
32
33
|
:tabindex="tabindex"
|
|
33
34
|
class="uikit-input__input"
|
|
34
35
|
:class="{
|
|
35
|
-
'uikit-input__input--hover': hover,
|
|
36
|
-
'uikit-input__input--focus': focus,
|
|
37
|
-
'uikit-input__input--error': error
|
|
36
|
+
'uikit-input__input--hover': hover || forceHoverStyle,
|
|
37
|
+
'uikit-input__input--focus': focus || forceFocusStyle,
|
|
38
|
+
'uikit-input__input--error': error,
|
|
39
|
+
'uikit-input__input--hide-caret': hideInputCaret,
|
|
38
40
|
}"
|
|
39
41
|
@input="valueChange"
|
|
40
42
|
@focus="focus = true"
|
|
@@ -73,15 +75,17 @@
|
|
|
73
75
|
:name="name"
|
|
74
76
|
:aria-required="ariaRequired"
|
|
75
77
|
:class="{
|
|
76
|
-
'uikit-input__input--hover': hover,
|
|
77
|
-
'uikit-input__input--focus': focus,
|
|
78
|
-
'uikit-input__input--error': error
|
|
78
|
+
'uikit-input__input--hover': hover || forceHoverStyle,
|
|
79
|
+
'uikit-input__input--focus': focus || forceFocusStyle,
|
|
80
|
+
'uikit-input__input--error': error,
|
|
81
|
+
'uikit-input__input--hide-caret': hideInputCaret,
|
|
79
82
|
}"
|
|
80
83
|
@input="valueChange"
|
|
81
84
|
@focus="focus = true"
|
|
82
85
|
@blur="focus = false"
|
|
83
86
|
@mouseover="hover = true"
|
|
84
87
|
>
|
|
88
|
+
<slot />
|
|
85
89
|
</div>
|
|
86
90
|
</template>
|
|
87
91
|
|
|
@@ -112,6 +116,9 @@ export default class Input extends Vue {
|
|
|
112
116
|
@Prop({ default: false }) isDarkMode!: boolean
|
|
113
117
|
@Prop({ default: false }) ariaRequired!: boolean
|
|
114
118
|
@Prop({ default: '' }) name!: string
|
|
119
|
+
@Prop({ default: false }) forceHoverStyle!: boolean
|
|
120
|
+
@Prop({ default: false }) forceFocusStyle!: boolean
|
|
121
|
+
@Prop({ default: false }) hideInputCaret!: boolean
|
|
115
122
|
|
|
116
123
|
hover = false
|
|
117
124
|
focus = false
|
|
@@ -148,47 +155,41 @@ export default class Input extends Vue {
|
|
|
148
155
|
background-color: $white;
|
|
149
156
|
border: 1px solid rgba($pewter, 0.85);
|
|
150
157
|
color: $brand-black;
|
|
151
|
-
-webkit-text-fill-color: $brand-black;
|
|
152
|
-
-webkit-box-shadow: 0 0 0 1000px $white inset;
|
|
153
|
-
box-shadow: 0 0 0 1000px $white inset;
|
|
154
158
|
border-radius: 3px;
|
|
155
159
|
caret-color: $brand-blue;
|
|
156
160
|
padding: 9px 11px;
|
|
157
|
-
font-size:
|
|
158
|
-
line-height:
|
|
161
|
+
font-size: 15px;
|
|
162
|
+
line-height: 20px;
|
|
159
163
|
height: 36px;
|
|
160
164
|
width: 100%;
|
|
161
165
|
box-sizing: border-box;
|
|
162
166
|
outline: none;
|
|
163
167
|
z-index: 2;
|
|
164
168
|
|
|
165
|
-
|
|
169
|
+
:not(&:disabled)::placeholder {
|
|
166
170
|
color: $pewter;
|
|
167
|
-
-webkit-text-fill-color: $pewter;
|
|
168
171
|
}
|
|
169
172
|
|
|
170
173
|
&:disabled {
|
|
171
174
|
background: $gray-background;
|
|
172
|
-
border: 1px solid $
|
|
173
|
-
color: $slate
|
|
175
|
+
border: 1px solid rgba($pewter, 0.5);
|
|
176
|
+
color: $slate;
|
|
177
|
+
}
|
|
174
178
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
179
|
+
&:disabled::placeholder {
|
|
180
|
+
color: $slate;
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
&--dark {
|
|
181
184
|
background-color: $moonlit-ocean;
|
|
182
|
-
-webkit-text-fill-color: $white;
|
|
183
|
-
-webkit-box-shadow: 0 0 0 1000px $moonlit-ocean inset;
|
|
184
|
-
box-shadow: 0 0 0 1000px $moonlit-ocean inset;
|
|
185
185
|
border-color: $pewter;
|
|
186
186
|
color: $white;
|
|
187
187
|
caret-color: $banana-bread;
|
|
188
188
|
|
|
189
189
|
&:disabled {
|
|
190
|
-
border-color: $
|
|
191
|
-
background-color: $moonlit-ocean;
|
|
190
|
+
border-color: rgba($pewter, 0.5);
|
|
191
|
+
background-color: rgba($moonlit-ocean, 0.5);
|
|
192
|
+
color: $steel;
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
|
|
@@ -196,7 +197,7 @@ export default class Input extends Vue {
|
|
|
196
197
|
border: 1px solid $baby-blue;
|
|
197
198
|
|
|
198
199
|
&--dark {
|
|
199
|
-
border:
|
|
200
|
+
border: 1px solid rgba($banana-bread, 0.4);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
|
|
@@ -204,38 +205,35 @@ export default class Input extends Vue {
|
|
|
204
205
|
border: 1px solid $brand-blue;
|
|
205
206
|
|
|
206
207
|
&--dark {
|
|
207
|
-
border
|
|
208
|
+
border: 1px solid $banana-bread;
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
&--error {
|
|
212
|
-
border: 1px solid $
|
|
213
|
+
border: 1px solid $pepper;
|
|
213
214
|
|
|
214
215
|
&--dark {
|
|
215
|
-
border
|
|
216
|
+
border: 1px solid $rosa;
|
|
216
217
|
}
|
|
217
218
|
}
|
|
219
|
+
|
|
220
|
+
&--hide-caret {
|
|
221
|
+
caret-color: transparent;
|
|
222
|
+
}
|
|
218
223
|
}
|
|
219
224
|
|
|
220
225
|
&__label {
|
|
221
226
|
font-size: 13px;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
227
|
+
font-weight: 600;
|
|
228
|
+
line-height: 18px;
|
|
229
|
+
margin: 0 0 4px 12px;
|
|
230
|
+
color: $pickled-bluewood;
|
|
225
231
|
display: block;
|
|
226
232
|
|
|
227
233
|
&--dark {
|
|
228
234
|
color: $fog;
|
|
229
235
|
}
|
|
230
236
|
|
|
231
|
-
&--hover {
|
|
232
|
-
color: $slate-03;
|
|
233
|
-
|
|
234
|
-
&--dark {
|
|
235
|
-
color: $fog;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
|
|
239
237
|
&--focus {
|
|
240
238
|
color: $brand-blue;
|
|
241
239
|
|
|
@@ -245,12 +243,16 @@ export default class Input extends Vue {
|
|
|
245
243
|
}
|
|
246
244
|
|
|
247
245
|
&--error {
|
|
248
|
-
color: $
|
|
246
|
+
color: $pepper;
|
|
249
247
|
|
|
250
248
|
&--dark {
|
|
251
249
|
color: $rosa;
|
|
252
250
|
}
|
|
253
251
|
}
|
|
252
|
+
|
|
253
|
+
&--hide-caret {
|
|
254
|
+
caret-color: transparent;
|
|
255
|
+
}
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
&__password-container {
|
|
@@ -39,21 +39,23 @@
|
|
|
39
39
|
}"
|
|
40
40
|
@click="showDropdown = !showDropdown"
|
|
41
41
|
>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
<slot name="selectValue" :item="modelValue">
|
|
43
|
+
{{ modelValue ? modelValue.label : placeholder }}
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
v-if="subtext"
|
|
47
|
+
v-dark="isDarkMode"
|
|
48
|
+
class="uikit-select__subtext"
|
|
49
|
+
:class="{
|
|
50
|
+
'uikit-select__subtext--placeholder': !subtext,
|
|
51
|
+
'uikit-select__subtext--hover': hover,
|
|
52
|
+
'uikit-select__subtext--focus': focus,
|
|
53
|
+
'uikit-select__subtext--disabled': disabled,
|
|
54
|
+
}"
|
|
55
|
+
>
|
|
56
|
+
{{ modelValue ? modelValue.subtext : subtext }}
|
|
57
|
+
</div>
|
|
58
|
+
</slot>
|
|
57
59
|
</div>
|
|
58
60
|
<input
|
|
59
61
|
v-else
|
|
@@ -96,31 +98,35 @@
|
|
|
96
98
|
'uikit-select__list--subtext': subtext,
|
|
97
99
|
}"
|
|
98
100
|
>
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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"
|
|
101
|
+
<slot name="dropdownList">
|
|
102
|
+
<li
|
|
103
|
+
v-for="item in filteredData"
|
|
104
|
+
:key="JSON.stringify(item)"
|
|
105
|
+
ref="uikit-select__items"
|
|
118
106
|
v-dark="isDarkMode"
|
|
119
|
-
class="uikit-select__item
|
|
107
|
+
class="uikit-select__item"
|
|
108
|
+
:class="{
|
|
109
|
+
'uikit-select__item--link': item.type === 'link',
|
|
110
|
+
'uikit-select__item--subtext': item.subtext
|
|
111
|
+
}"
|
|
112
|
+
:data-value="item.value || undefined"
|
|
113
|
+
tabindex="0"
|
|
114
|
+
@click="selectItem(item)"
|
|
115
|
+
@keydown="keyPressedItem"
|
|
116
|
+
@mousedown.prevent
|
|
120
117
|
>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
<slot name="dropdownListItem" :item="item">
|
|
119
|
+
{{ item.label }}
|
|
120
|
+
<div
|
|
121
|
+
v-if="item.subtext"
|
|
122
|
+
v-dark="isDarkMode"
|
|
123
|
+
class="uikit-select__item-subtext"
|
|
124
|
+
>
|
|
125
|
+
{{ item.subtext }}
|
|
126
|
+
</div>
|
|
127
|
+
</slot>
|
|
128
|
+
</li>
|
|
129
|
+
</slot>
|
|
124
130
|
</ul>
|
|
125
131
|
</div>
|
|
126
132
|
</div>
|
|
@@ -420,9 +426,10 @@ export default class Select extends Vue {
|
|
|
420
426
|
|
|
421
427
|
&__label {
|
|
422
428
|
font-size: 13px;
|
|
423
|
-
line-height:
|
|
424
|
-
|
|
425
|
-
|
|
429
|
+
line-height: 18px;
|
|
430
|
+
font-weight: 600;
|
|
431
|
+
margin: 0 0 4px 12px;
|
|
432
|
+
color: $pickled-bluewood;
|
|
426
433
|
display: block;
|
|
427
434
|
|
|
428
435
|
&--dark {
|
|
@@ -564,9 +571,9 @@ export default class Select extends Vue {
|
|
|
564
571
|
position: absolute;
|
|
565
572
|
right: 13px;
|
|
566
573
|
top: 14px;
|
|
567
|
-
color: $
|
|
574
|
+
color: $steel;
|
|
568
575
|
width: 12px;
|
|
569
|
-
height:
|
|
576
|
+
height: 8px;
|
|
570
577
|
z-index: 1;
|
|
571
578
|
|
|
572
579
|
&--hover {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
<IconExam v-else-if="type === 'exam'" :title="title" />
|
|
31
31
|
<IconLightning v-else-if="type === 'lightning'" :title="title" />
|
|
32
32
|
<IconCalendar v-else-if="type === 'calendar'" :title="title" />
|
|
33
|
+
<IconCalendarPicker v-else-if="type === 'calendarPicker'" :title="title" />
|
|
33
34
|
<IconPassage v-else-if="type === 'passage'" :title="title" />
|
|
34
35
|
<IconPencil v-else-if="type === 'pencil'" :title="title" />
|
|
35
36
|
<IconPeople v-else-if="type === 'people'" :title="title" />
|
|
@@ -101,6 +102,7 @@ import IconBarChart from './IconBarChart.vue'
|
|
|
101
102
|
import IconExam from './IconExam.vue'
|
|
102
103
|
import IconLightning from './IconLightning.vue'
|
|
103
104
|
import IconCalendar from './IconCalendar.vue'
|
|
105
|
+
import IconCalendarPicker from './IconCalendarPicker.vue'
|
|
104
106
|
import IconPassage from './IconPassage.vue'
|
|
105
107
|
import IconPencil from './IconPencil.vue'
|
|
106
108
|
import IconPeople from './IconPeople.vue'
|
|
@@ -169,6 +171,7 @@ import IconPresent from './IconPresent.vue'
|
|
|
169
171
|
IconExam,
|
|
170
172
|
IconLightning,
|
|
171
173
|
IconCalendar,
|
|
174
|
+
IconCalendarPicker,
|
|
172
175
|
IconPassage,
|
|
173
176
|
IconPencil,
|
|
174
177
|
IconPeople,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- eslint-disable -->
|
|
3
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<title>{{ title }}</title>
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 1.75C5.5 1.19772 5.94772 0.75 6.5 0.75C7.05228 0.75 7.5 1.19772 7.5 1.75V3.25H12.5V1.75C12.5 1.19772 12.9477 0.75 13.5 0.75C14.0523 0.75 14.5 1.19772 14.5 1.75V3.25H17C18.1046 3.25 19 4.14543 19 5.25V16.25C19 17.3546 18.1046 18.25 17 18.25H3C1.89543 18.25 1 17.3546 1 16.25V5.25C1 4.14543 1.89543 3.25 3 3.25H5.5V1.75ZM3 16.25V7.75H17V16.25H3Z" fill="currentColor"/>
|
|
6
|
+
</svg>
|
|
7
|
+
<!-- eslint-enable -->
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { Vue, Component, Prop } from 'vue-facing-decorator'
|
|
12
|
+
|
|
13
|
+
@Component
|
|
14
|
+
export default class IconCalendarPicker extends Vue {
|
|
15
|
+
@Prop() title!: string
|
|
16
|
+
}
|
|
17
|
+
</script>
|