Skip to content

Commit 5cce083

Browse files
authored
Update form-timepicker.js
1 parent ffbf34a commit 5cce083

File tree

1 file changed

+65
-16
lines changed

1 file changed

+65
-16
lines changed

src/components/form-timepicker/form-timepicker.js

Lines changed: 65 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ const propsMixin = {
4848
type: Boolean,
4949
default: false
5050
},
51-
showSeconds: {
52-
type: Boolean,
53-
default: false
54-
},
5551
required: {
5652
// If true adds the `aria-required` attribute
5753
type: Boolean,
@@ -70,14 +66,31 @@ const propsMixin = {
7066
type: Boolean,
7167
default: null
7268
},
73-
hideHeader: {
69+
hour12: {
70+
// Tri-state prop: `true` => 12 hour, `false` => 24 hour, `null` => auto
7471
type: Boolean,
75-
default: false
72+
default: null
7673
},
7774
locale: {
7875
type: [String, Array],
7976
default: null
8077
},
78+
showSeconds: {
79+
type: Boolean,
80+
default: false
81+
},
82+
hideHeader: {
83+
type: Boolean,
84+
default: false
85+
},
86+
secondsStep: {
87+
type: [Number, String],
88+
default: 1
89+
},
90+
minutesStep: {
91+
type: [Number, String],
92+
default: 1
93+
},
8194
nowButton: {
8295
type: Boolean,
8396
default: false
@@ -108,13 +121,46 @@ const propsMixin = {
108121
},
109122
labelCloseButton: {
110123
type: String,
111-
default: () => getComponentConfig(NAME, 'labelCloseButton') || 'Close'
124+
default: () => getComponentConfig(NAME, 'labelCloseButton')
112125
},
113126
closeButtonVariant: {
114127
type: String,
115128
default: 'outline-secondary'
116129
},
117130
// Labels
131+
// These fallback to BTime values
132+
labelNoTime: {
133+
type: String,
134+
default: () => getConfigFallback('labelNoTime')
135+
},
136+
labelSelected: {
137+
type: String,
138+
default: () => getConfigFallback('labelSelected')
139+
},
140+
labelHours: {
141+
type: String,
142+
default: () => getConfigFallback('labelHours')
143+
},
144+
labelMinutes: {
145+
type: String,
146+
default: () => getConfigFallback('labelMinutes')
147+
},
148+
labelSeconds: {
149+
type: String,
150+
default: () => getConfigFallback('labelSeconds')
151+
},
152+
labelAmpm: {
153+
type: String,
154+
default: () => getConfigFallback('labelAmpm')
155+
},
156+
labelAm: {
157+
type: String,
158+
default: () => getConfigFallback('labelAm')
159+
},
160+
labelPm: {
161+
type: String,
162+
default: () => getConfigFallback('labelPm')
163+
},
118164
// These pick BTime or BFormSpinbutton global config if no BFormTimepicker global config
119165
labelIncrement: {
120166
type: String,
@@ -123,13 +169,7 @@ const propsMixin = {
123169
labelDecrement: {
124170
type: String,
125171
default: () => getConfigFallback('labelDecrement')
126-
},
127-
// Thes only fallback to BTime values
128-
labelNoTime: {
129-
type: String,
130-
default: () => getConfigFallback('labelNoTime')
131172
}
132-
// TODO: add remaining props
133173
}
134174
}
135175

@@ -168,18 +208,27 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
168208
const idLabel = this.safeId('_value_')
169209
const idWrapper = this.safeId('_b-form-time_')
170210
return {
211+
hidden: !this.visible,
171212
ariaControls: [idLabel, idWrapper].filter(identity).join(' ') || null,
172213
value: this.localHMS,
173-
hidden: !this.visible,
174214
readonly: this.readonly,
175215
disabled: this.disabled,
176216
locale: this.locale,
217+
hour12: this.hour12,
177218
hideHeader: this.hideHeader,
178219
showSeconds: this.showSeconds,
220+
secondsStep: this.secondsStep,
221+
minutesStep: this.minutesStep,
222+
labelNoTime: this.labelNoTime,
223+
labelSelected: this.labelSelected,
224+
labelHours: this.labelHours,
225+
labelMinutes: this.labelMinutes,
226+
labelSeconds: this.labelSeconds,
227+
labelAmpm: this.labelAmpm,
228+
labelAm: this.labelAm,
229+
labelPm: this.labelPm,
179230
labelIncrement: this.labelIncrement,
180231
labelDecrement: this.labelDecrement,
181-
labelNoTime: this.labelNoTime
182-
// TODO: Add remaining label props here
183232
}
184233
}
185234
},

0 commit comments

Comments
 (0)