@ditojs/admin 2.74.0 → 2.75.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "2.74.0",
3
+ "version": "2.75.1",
4
4
  "type": "module",
5
5
  "description": "Dito.js Admin is a schema based admin interface for Dito.js Server, featuring auto-generated views and forms and built with Vue.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -42,8 +42,8 @@
42
42
  "not ie_mob > 0"
43
43
  ],
44
44
  "dependencies": {
45
- "@ditojs/ui": "^2.74.0",
46
- "@ditojs/utils": "^2.74.0",
45
+ "@ditojs/ui": "^2.75.0",
46
+ "@ditojs/utils": "^2.75.0",
47
47
  "@kyvg/vue3-notification": "^3.4.2",
48
48
  "@lk77/vue3-color": "^3.0.6",
49
49
  "@tiptap/core": "^3.15.3",
@@ -89,9 +89,9 @@
89
89
  "vue-upload-component": "^3.1.17"
90
90
  },
91
91
  "devDependencies": {
92
- "@ditojs/build": "^2.74.0",
92
+ "@ditojs/build": "^2.75.0",
93
93
  "typescript": "^5.9.3",
94
94
  "vite": "^7.3.1"
95
95
  },
96
- "gitHead": "26c5b4bd33d1bc469c8b621a214ae3c8f0927c11"
96
+ "gitHead": "d16421580ee018bd1e606570bbf7b41c0f537fc8"
97
97
  }
@@ -1,11 +1,11 @@
1
1
  <template lang="pug">
2
2
  component(
3
3
  v-if="item.type === 'text'"
4
- :is="item.as || 'span'"
4
+ :is="item.as || 'div'"
5
5
  ) {{ item.text }}
6
6
  component(
7
7
  v-else-if="item.type === 'html'"
8
- :is="item.as || 'span'"
8
+ :is="item.as || 'div'"
9
9
  v-html="item.html"
10
10
  )
11
11
  DitoSpinner(
@@ -48,9 +48,21 @@ export default DitoComponent.component('DitoAffix', {
48
48
  </script>
49
49
 
50
50
  <style lang="scss">
51
+ @import '../styles/_imports';
52
+
51
53
  .dito-affix {
54
+ &--html,
52
55
  &--text {
53
56
  display: inline-block;
54
57
  }
58
+
59
+ &--ellipsis {
60
+ @include ellipsis;
61
+
62
+ flex: 1;
63
+ display: block;
64
+ min-width: 0;
65
+ width: 0;
66
+ }
55
67
  }
56
68
  </style>
@@ -7,7 +7,7 @@
7
7
  DitoAffix.dito-affix(
8
8
  v-for="(item, index) in visibleItems"
9
9
  :key="index"
10
- :class="[`dito-affix--${item.type}`, item.class]"
10
+ :class="getItemClasses(item)"
11
11
  :style="item.style"
12
12
  :item="item"
13
13
  :parentContext="parentContext"
@@ -15,6 +15,7 @@
15
15
  button.dito-affixes__clear(
16
16
  v-if="clearable"
17
17
  type="button"
18
+ title="Clear"
18
19
  :disabled="disabled"
19
20
  @click.stop="$emit('clear')"
20
21
  @mousedown.stop
@@ -35,6 +36,7 @@ export default DitoComponent.component('DitoAffixes', {
35
36
 
36
37
  props: {
37
38
  items: { type: [String, Object, Array], default: null },
39
+ mode: { type: String, default: null },
38
40
  position: { type: String, default: null },
39
41
  absolute: { type: Boolean, default: false },
40
42
  clearable: { type: Boolean, default: false },
@@ -74,6 +76,7 @@ export default DitoComponent.component('DitoAffixes', {
74
76
  const prefix = 'dito-affixes'
75
77
  return {
76
78
  [`${prefix}--${this.position}`]: this.position,
79
+ [`${prefix}--${this.mode}`]: this.mode,
77
80
  [`${prefix}--absolute`]: this.absolute
78
81
  }
79
82
  },
@@ -86,6 +89,21 @@ export default DitoComponent.component('DitoAffixes', {
86
89
  hasSlotContent(this.$slots.append)
87
90
  )
88
91
  }
92
+ },
93
+
94
+ methods: {
95
+ getItemClasses(item) {
96
+ const prefix = 'dito-affix'
97
+ return [
98
+ {
99
+ [`${prefix}--${item.type}`]: item.type,
100
+ [`${prefix}--ellipsis`]: (
101
+ this.mode === 'ellipsis' && ['text', 'html'].includes(item.type)
102
+ )
103
+ },
104
+ item.class
105
+ ]
106
+ }
89
107
  }
90
108
  })
91
109
  </script>
@@ -121,16 +139,20 @@ export default DitoComponent.component('DitoAffixes', {
121
139
  }
122
140
  }
123
141
 
124
- @at-root .dito-component & {
142
+ &--ellipsis {
143
+ flex: 1;
144
+ }
145
+
146
+ &--input {
125
147
  color: $color-grey;
126
148
 
127
149
  .dito-icon--disabled {
128
150
  color: $color-light;
129
151
  }
130
- }
131
152
 
132
- @at-root .dito-component:focus-within:not(:has(.dito-component)) & {
133
- color: $color-active;
153
+ @at-root .dito-component:not(:has(.dito-component)):focus-within & {
154
+ color: $color-active;
155
+ }
134
156
  }
135
157
 
136
158
  &__clear {
@@ -147,7 +169,7 @@ export default DitoComponent.component('DitoAffixes', {
147
169
  padding: 0;
148
170
  border: 0;
149
171
 
150
- @at-root .dito-component:hover:not(:has(.dito-component)) & {
172
+ @at-root .dito-component:not(:has(.dito-component)):hover & {
151
173
  display: block;
152
174
  }
153
175
 
@@ -13,7 +13,7 @@ component.dito-label(
13
13
  .dito-label__inner(
14
14
  v-if="text || prefixes.length > 0 || suffixes.length > 0"
15
15
  )
16
- DitoAffixes.dito-label__prefix(
16
+ DitoAffixes(
17
17
  :items="prefixes"
18
18
  position="prefix"
19
19
  :parentContext="context"
@@ -23,8 +23,9 @@ component.dito-label(
23
23
  :for="dataPath"
24
24
  v-html="text"
25
25
  )
26
- DitoAffixes.dito-label__suffix(
26
+ DitoAffixes(
27
27
  :items="suffixes"
28
+ mode="ellipsis"
28
29
  position="suffix"
29
30
  :parentContext="context"
30
31
  )
@@ -117,6 +118,7 @@ export default DitoComponent.component('DitoLabel', {
117
118
  display: flex;
118
119
  align-items: center;
119
120
  overflow: hidden;
121
+ gap: $input-padding-hor;
120
122
  }
121
123
 
122
124
  label {
@@ -140,44 +142,6 @@ export default DitoComponent.component('DitoLabel', {
140
142
  transform: translateY(-4px);
141
143
  }
142
144
 
143
- &__prefix,
144
- &__suffix {
145
- flex: 1;
146
- position: relative;
147
- line-height: $input-height;
148
-
149
- // For ellipsis to work on prefix and suffix with flex layout, we need to
150
- // use a nested absolutely positioned span.
151
-
152
- &::before {
153
- content: '\200b'; // zero-width space to keep container from collapsing.
154
- }
155
-
156
- span {
157
- position: absolute;
158
- inset: 0;
159
- }
160
- }
161
-
162
- label,
163
- &__prefix span,
164
- &__suffix span {
165
- @include user-select(none);
166
- @include ellipsis;
167
-
168
- white-space: nowrap;
169
- }
170
-
171
- &__prefix + label,
172
- label + &__suffix {
173
- &,
174
- span {
175
- &::before {
176
- content: '\a0'; // &nbsp;
177
- }
178
- }
179
- }
180
-
181
145
  .dito-buttons {
182
146
  // Move the label padding inside .dito-buttons, so that it captures all
183
147
  // near mouse events:
@@ -17,6 +17,7 @@ DitoTrigger.dito-color(
17
17
  DitoAffixes(
18
18
  :items="schema.prefix"
19
19
  position="prefix"
20
+ mode="input"
20
21
  :disabled="disabled"
21
22
  :parentContext="context"
22
23
  )
@@ -24,6 +25,7 @@ DitoTrigger.dito-color(
24
25
  DitoAffixes(
25
26
  :items="schema.suffix"
26
27
  position="suffix"
28
+ mode="input"
27
29
  :clearable="showClearButton"
28
30
  :disabled="disabled"
29
31
  :parentContext="context"
@@ -13,6 +13,7 @@
13
13
  DitoAffixes(
14
14
  :items="schema.prefix"
15
15
  position="prefix"
16
+ mode="input"
16
17
  absolute
17
18
  :disabled="disabled"
18
19
  :parentContext="context"
@@ -21,6 +22,7 @@
21
22
  DitoAffixes(
22
23
  :items="schema.suffix"
23
24
  position="suffix"
25
+ mode="input"
24
26
  absolute
25
27
  :clearable="showClearButton"
26
28
  :disabled="disabled"
@@ -4,6 +4,7 @@
4
4
  DitoAffixes(
5
5
  :items="schema.prefix"
6
6
  position="prefix"
7
+ mode="input"
7
8
  absolute
8
9
  :disabled="disabled"
9
10
  :parentContext="context"
@@ -37,6 +38,7 @@
37
38
  DitoAffixes(
38
39
  :items="schema.suffix"
39
40
  position="suffix"
41
+ mode="input"
40
42
  absolute
41
43
  :clearable="showClearButton"
42
44
  :disabled="disabled"
@@ -13,6 +13,7 @@ DitoInput.dito-number(
13
13
  DitoAffixes(
14
14
  :items="schema.prefix"
15
15
  position="prefix"
16
+ mode="input"
16
17
  :disabled="disabled"
17
18
  :parentContext="context"
18
19
  )
@@ -20,6 +21,7 @@ DitoInput.dito-number(
20
21
  DitoAffixes(
21
22
  :items="schema.suffix"
22
23
  position="suffix"
24
+ mode="input"
23
25
  :clearable="showClearButton"
24
26
  :disabled="disabled"
25
27
  :parentContext="context"
@@ -5,6 +5,7 @@
5
5
  DitoAffixes(
6
6
  :items="schema.prefix"
7
7
  position="prefix"
8
+ mode="input"
8
9
  absolute
9
10
  :disabled="disabled"
10
11
  :parentContext="context"
@@ -42,6 +43,7 @@
42
43
  DitoAffixes(
43
44
  :items="schema.suffix"
44
45
  position="suffix"
46
+ mode="input"
45
47
  absolute
46
48
  :clearable="showClearButton"
47
49
  :disabled="disabled"
@@ -10,6 +10,7 @@ DitoInput.dito-text(
10
10
  DitoAffixes(
11
11
  :items="schema.prefix"
12
12
  position="prefix"
13
+ mode="input"
13
14
  :disabled="disabled"
14
15
  :parentContext="context"
15
16
  )
@@ -17,6 +18,7 @@ DitoInput.dito-text(
17
18
  DitoAffixes(
18
19
  :items="schema.suffix"
19
20
  position="suffix"
21
+ mode="input"
20
22
  :clearable="showClearButton"
21
23
  :disabled="disabled"
22
24
  :parentContext="context"