@ditojs/admin 2.72.0 → 2.73.1
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/dito-admin.css +1 -1
- package/dist/dito-admin.es.js +2499 -2344
- package/dist/dito-admin.umd.js +5 -5
- package/package.json +5 -5
- package/src/DitoContext.js +8 -0
- package/src/components/DitoAffix.vue +56 -0
- package/src/components/DitoAffixes.vue +82 -0
- package/src/components/DitoLabel.vue +9 -16
- package/src/components/DitoPagination.vue +1 -1
- package/src/components/DitoPanel.vue +1 -1
- package/src/components/DitoSchema.vue +2 -2
- package/src/components/index.js +2 -1
- package/src/mixins/EmitterMixin.js +13 -7
- package/src/styles/_button.scss +4 -3
- package/src/types/DitoTypeButton.vue +61 -18
- package/src/types/DitoTypeColor.vue +3 -3
- package/src/types/DitoTypeDate.vue +20 -6
- package/src/types/DitoTypeMarkup.vue +4 -3
- package/src/types/DitoTypeNumber.vue +14 -4
- package/src/types/DitoTypeSlider.vue +3 -3
- package/src/types/DitoTypeSwitch.vue +3 -3
- package/src/types/DitoTypeText.vue +14 -4
- package/src/utils/schema.js +4 -1
- package/src/components/DitoElement.vue +0 -68
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
|
|
2
|
+
DitoInput.dito-text(
|
|
3
3
|
:id="dataPath"
|
|
4
4
|
ref="element"
|
|
5
5
|
v-model="inputValue"
|
|
6
6
|
:type="inputType"
|
|
7
7
|
v-bind="attributes"
|
|
8
8
|
)
|
|
9
|
-
template(#
|
|
9
|
+
template(#prefix)
|
|
10
|
+
DitoAffixes(
|
|
11
|
+
:items="schema.prefix"
|
|
12
|
+
:parentContext="context"
|
|
13
|
+
)
|
|
14
|
+
template(#suffix)
|
|
15
|
+
DitoAffixes(
|
|
16
|
+
:items="schema.suffix"
|
|
17
|
+
:parentContext="context"
|
|
18
|
+
)
|
|
10
19
|
button.dito-button--clear.dito-button--overlay(
|
|
11
20
|
v-if="showClearButton"
|
|
12
21
|
:disabled="disabled"
|
|
@@ -17,7 +26,8 @@ InputField.dito-text(
|
|
|
17
26
|
<script>
|
|
18
27
|
import DitoTypeComponent from '../DitoTypeComponent.js'
|
|
19
28
|
import TextMixin from '../mixins/TextMixin'
|
|
20
|
-
import
|
|
29
|
+
import DitoAffixes from '../components/DitoAffixes.vue'
|
|
30
|
+
import { DitoInput } from '@ditojs/ui/src'
|
|
21
31
|
|
|
22
32
|
const maskedPassword = '****************'
|
|
23
33
|
|
|
@@ -35,7 +45,7 @@ export default DitoTypeComponent.register(
|
|
|
35
45
|
// @vue/component
|
|
36
46
|
{
|
|
37
47
|
mixins: [TextMixin],
|
|
38
|
-
components: {
|
|
48
|
+
components: { DitoInput, DitoAffixes },
|
|
39
49
|
nativeField: true,
|
|
40
50
|
textField: true,
|
|
41
51
|
ignoreMissingValue: ({ schema }) => schema.type === 'password',
|
package/src/utils/schema.js
CHANGED
|
@@ -332,7 +332,10 @@ export async function processView(component, api, schema, name, fullPath = '') {
|
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
export function processSchemaDefaults(api, schema) {
|
|
335
|
-
let defaults =
|
|
335
|
+
let defaults = (
|
|
336
|
+
api.defaults[schema.type] ||
|
|
337
|
+
api.defaults[camelize(schema.type)]
|
|
338
|
+
)
|
|
336
339
|
if (defaults) {
|
|
337
340
|
if (isFunction(defaults)) {
|
|
338
341
|
defaults = defaults(schema)
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<template lang="pug">
|
|
2
|
-
component(
|
|
3
|
-
v-if="options?.text != null"
|
|
4
|
-
:is="tagName"
|
|
5
|
-
:class="classes"
|
|
6
|
-
:style="styles"
|
|
7
|
-
) {{ options.text }}
|
|
8
|
-
component(
|
|
9
|
-
v-else-if="options?.html != null"
|
|
10
|
-
:is="tagName"
|
|
11
|
-
:class="classes"
|
|
12
|
-
:style="styles"
|
|
13
|
-
v-html="options.html"
|
|
14
|
-
)
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import DitoComponent from '../DitoComponent.js'
|
|
19
|
-
import { isObject, isString, asArray } from '@ditojs/utils'
|
|
20
|
-
|
|
21
|
-
// @vue/component
|
|
22
|
-
export default DitoComponent.component('DitoElement', {
|
|
23
|
-
props: {
|
|
24
|
-
as: { type: String, default: 'span' },
|
|
25
|
-
content: { type: [String, Object], default: null }
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
computed: {
|
|
29
|
-
options() {
|
|
30
|
-
const { content } = this
|
|
31
|
-
return content != null
|
|
32
|
-
? isObject(content)
|
|
33
|
-
? content
|
|
34
|
-
: { text: content }
|
|
35
|
-
: null
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
tagName() {
|
|
39
|
-
return this.options.as || this.as
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
classes() {
|
|
43
|
-
return {
|
|
44
|
-
...asObject(this.$attrs.class),
|
|
45
|
-
...asObject(this.options.class)
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
styles() {
|
|
50
|
-
return {
|
|
51
|
-
...asObject(this.$attrs.style),
|
|
52
|
-
...asObject(this.options.style)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
function asObject(value) {
|
|
59
|
-
return asArray(value).reduce((object, entry) => {
|
|
60
|
-
if (isString(entry)) {
|
|
61
|
-
object[entry] = true
|
|
62
|
-
} else if (isObject(entry)) {
|
|
63
|
-
Object.assign(object, entry)
|
|
64
|
-
}
|
|
65
|
-
return object
|
|
66
|
-
}, {})
|
|
67
|
-
}
|
|
68
|
-
</script>
|