@ditojs/admin 2.72.0 → 2.73.0

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.
@@ -1,12 +1,21 @@
1
1
  <template lang="pug">
2
- InputField.dito-text(
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(#after)
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 { InputField } from '@ditojs/ui/src'
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: { InputField },
48
+ components: { DitoInput, DitoAffixes },
39
49
  nativeField: true,
40
50
  textField: true,
41
51
  ignoreMissingValue: ({ schema }) => schema.type === 'password',
@@ -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 = api.defaults[schema.type]
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>