@koumoul/vjsf 3.13.0 → 3.13.2
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/package.json
CHANGED
package/src/compat/v2.js
CHANGED
|
@@ -19,7 +19,7 @@ const expressionKeyMappings = {
|
|
|
19
19
|
*/
|
|
20
20
|
const fixSimpleExpression = (expression) => {
|
|
21
21
|
// looks like a simple expression is missing the data. prefix
|
|
22
|
-
if (expression.match(/^[a-z.]*$/i) && !['data', 'context', 'rootData', 'parent'].some(key => expression.startsWith(key + '.'))) {
|
|
22
|
+
if (expression.match(/^[a-z.0-9]*$/i) && !['data', 'context', 'rootData', 'parent'].some(key => expression.startsWith(key + '.'))) {
|
|
23
23
|
expression = 'rootData.' + expression
|
|
24
24
|
}
|
|
25
25
|
// replace a array item referenced with dot notation to bracket notation
|
|
@@ -10,8 +10,10 @@ import { useDate, useDefaults } from 'vuetify'
|
|
|
10
10
|
import { computed, ref, watch, toRef } from 'vue'
|
|
11
11
|
import { getDateTimeParts, getDateTimeWithOffset, getShortTime } from '../../utils/dates.js'
|
|
12
12
|
import useNode from '../../composables/use-node.js'
|
|
13
|
+
import useCompDefaults from '../../composables/use-comp-defaults.js'
|
|
13
14
|
|
|
14
15
|
useDefaults({}, 'VjsfDatePicker')
|
|
16
|
+
const timePickerDefaults = useCompDefaults('VTimePicker')
|
|
15
17
|
|
|
16
18
|
const props = defineProps({
|
|
17
19
|
modelValue: {
|
|
@@ -54,8 +56,8 @@ const datePickerProps = computed(() => {
|
|
|
54
56
|
})
|
|
55
57
|
|
|
56
58
|
const timePickerProps = computed(() => {
|
|
57
|
-
const timePickerProps = { ...compProps.value }
|
|
58
|
-
timePickerProps['ampm-in-title'] = true
|
|
59
|
+
const timePickerProps = { ...timePickerDefaults.value, ...compProps.value }
|
|
60
|
+
if (timePickerProps.format !== '24hr') timePickerProps['ampm-in-title'] = true
|
|
59
61
|
if (localData.value) timePickerProps.modelValue = getShortTime(localData.value.slice(11))
|
|
60
62
|
timePickerProps['onUpdate:modelValue'] = (/** @type {string} */value) => {
|
|
61
63
|
if (!localData.value) return
|
|
@@ -111,7 +111,7 @@ const pushEmptyIndexedItem = () => {
|
|
|
111
111
|
if (!newKey.value) return
|
|
112
112
|
if (!newKeyForm.value) return
|
|
113
113
|
if (!newKeyForm.value.isValid) return
|
|
114
|
-
const newData = { ...(props.modelValue.data ?? {}), [newKey.value]:
|
|
114
|
+
const newData = { ...(props.modelValue.data ?? {}), [newKey.value]: undefined }
|
|
115
115
|
props.statefulLayout.input(props.modelValue, newData)
|
|
116
116
|
if (layout.value.listEditMode === 'inline-single') {
|
|
117
117
|
props.statefulLayout.activateItem(props.modelValue, Object.keys(newData).length - 1)
|
|
@@ -7,8 +7,10 @@ import { useDate, useDefaults } from 'vuetify'
|
|
|
7
7
|
import { computed, toRef } from 'vue'
|
|
8
8
|
import { getShortTime, getLongTime } from '../../utils/dates.js'
|
|
9
9
|
import useNode from '../../composables/use-node.js'
|
|
10
|
+
import useCompDefaults from '../../composables/use-comp-defaults.js'
|
|
10
11
|
|
|
11
|
-
useDefaults({}, '
|
|
12
|
+
useDefaults({}, 'VjsfTimePicker')
|
|
13
|
+
const timePickerDefaults = useCompDefaults('VTimePicker')
|
|
12
14
|
|
|
13
15
|
const props = defineProps({
|
|
14
16
|
modelValue: {
|
|
@@ -28,8 +30,8 @@ const vDate = useDate()
|
|
|
28
30
|
const { compProps, localData } = useNode(toRef(props, 'modelValue'), props.statefulLayout)
|
|
29
31
|
|
|
30
32
|
const timePickerProps = computed(() => {
|
|
31
|
-
const timePickerProps = { ...compProps.value }
|
|
32
|
-
timePickerProps['ampm-in-title'] = true
|
|
33
|
+
const timePickerProps = { ...timePickerDefaults.value, ...compProps.value }
|
|
34
|
+
if (timePickerProps.format !== '24hr') timePickerProps['ampm-in-title'] = true
|
|
33
35
|
if (localData.value) timePickerProps.modelValue = getShortTime(localData.value)
|
|
34
36
|
return timePickerProps
|
|
35
37
|
})
|