File tree 5 files changed +5
-17
lines changed
5 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,7 @@ export interface VueDatePickerProps {
215
215
style ?: Record < string , string > ;
216
216
slot ?: string ;
217
217
noTz ?: boolean ;
218
+ testId ?: string ;
218
219
} [ ] ;
219
220
flow ?: ( 'month' | 'year' | 'calendar' | 'time' | 'minutes' | 'hours' | 'seconds' ) [ ] ;
220
221
partialFlow ?: boolean ;
Original file line number Diff line number Diff line change 26
26
v-if =" !$slots['dp-input']"
27
27
:id =" uid ? `dp-input-${uid}` : undefined"
28
28
ref =" inputRef"
29
+ data-test =" dp-input"
29
30
:name =" name"
30
31
:class =" inputClass"
31
32
:inputmode =" defaultedTextInput.enabled ? 'text' : 'none'"
Original file line number Diff line number Diff line change 53
53
:style =" preset.style || {}"
54
54
class =" dp__btn dp--preset-range"
55
55
:class =" { 'dp--preset-range-collapsed': collapse }"
56
+ :data-test =" preset.testId ?? undefined"
56
57
@click.prevent =" presetDate(preset.value, preset.noTz)"
57
58
@keydown.enter.prevent =" presetDate(preset.value, preset.noTz)"
58
59
@keydown.space.prevent =" presetDate(preset.value, preset.noTz)"
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ export type PresetDate = {
130
130
style ?: Record < string , string > ;
131
131
slot ?: string ;
132
132
noTz ?: boolean ;
133
+ testId ?: string ;
133
134
} ;
134
135
135
136
export type Flow = 'month' | 'year' | 'calendar' | 'time' | 'minutes' | 'hours' | 'seconds' ;
Original file line number Diff line number Diff line change @@ -6,24 +6,8 @@ import minimist from 'minimist';
6
6
7
7
const { f } = minimist ( process . argv . slice ( 2 ) ) ;
8
8
9
- function removeDataTestAttrs ( node : any ) {
10
- if ( node . type === 1 ) {
11
- node . props = node . props . filter ( ( prop : any ) => {
12
- if ( prop . name === 'data-test' ) return false ;
13
- return ! ( prop . name === 'bind' && prop . arg ?. content === 'data-test' ) ;
14
- } ) ;
15
- }
16
- }
17
9
export default defineConfig ( {
18
- plugins : [
19
- vue ( {
20
- template : {
21
- compilerOptions : {
22
- nodeTransforms : process . env . NODE_ENV === 'production' ? [ removeDataTestAttrs ] : [ ] ,
23
- } ,
24
- } ,
25
- } ) ,
26
- ] ,
10
+ plugins : [ vue ( ) ] ,
27
11
resolve : {
28
12
alias : {
29
13
'@' : fileURLToPath ( new URL ( './src/VueDatePicker' , import . meta. url ) ) ,
You can’t perform that action at this time.
0 commit comments