@citizenplane/pimp 18.9.12 → 18.9.14
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/components/CpAlert.vue.d.ts.map +1 -1
- package/dist/components/CpDate.vue.d.ts +2 -0
- package/dist/components/CpDate.vue.d.ts.map +1 -1
- package/dist/pimp.es.js +5 -1
- package/dist/pimp.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpAlert.vue +9 -1
- package/src/components/CpDate.vue +4 -2
package/package.json
CHANGED
|
@@ -218,9 +218,17 @@ const dynamicClasses = computed(() => [
|
|
|
218
218
|
|
|
219
219
|
&--isInline {
|
|
220
220
|
.cpAlert__body {
|
|
221
|
-
flex-
|
|
221
|
+
flex-flow: row wrap;
|
|
222
222
|
align-items: center;
|
|
223
223
|
}
|
|
224
|
+
|
|
225
|
+
.cpAlert__content {
|
|
226
|
+
flex: 0 1 auto;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.cpAlert__actions {
|
|
230
|
+
flex-shrink: 0;
|
|
231
|
+
}
|
|
224
232
|
}
|
|
225
233
|
|
|
226
234
|
&--isNeutral {
|
|
@@ -78,6 +78,7 @@ interface InputsOptions {
|
|
|
78
78
|
type DateField = 'day' | 'month'
|
|
79
79
|
|
|
80
80
|
interface Props {
|
|
81
|
+
allowEmpty?: boolean
|
|
81
82
|
autocompleteBirthday?: boolean
|
|
82
83
|
disabled?: boolean
|
|
83
84
|
displayErrorMessage?: boolean
|
|
@@ -99,6 +100,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
99
100
|
maxDate: () => DateTime.now().toISO(),
|
|
100
101
|
label: '',
|
|
101
102
|
required: false,
|
|
103
|
+
allowEmpty: false,
|
|
102
104
|
disabled: false,
|
|
103
105
|
isInvalid: false,
|
|
104
106
|
errorMessage: '',
|
|
@@ -179,7 +181,7 @@ const areInputsEmpty = computed(() => {
|
|
|
179
181
|
})
|
|
180
182
|
|
|
181
183
|
const isDateValid = computed(() => {
|
|
182
|
-
if (areInputsEmpty.value && !props.required)
|
|
184
|
+
if (areInputsEmpty.value && (!props.required || props.allowEmpty)) return true
|
|
183
185
|
|
|
184
186
|
return (
|
|
185
187
|
!props.isInvalid &&
|
|
@@ -476,7 +478,7 @@ watch(year, handleUpdate)
|
|
|
476
478
|
opacity: 0.4;
|
|
477
479
|
}
|
|
478
480
|
}
|
|
479
|
-
|
|
481
|
+
|
|
480
482
|
&--isInvalid {
|
|
481
483
|
.cpDate__inputs,
|
|
482
484
|
.cpDate__inputs:hover {
|