@ditojs/admin 0.271.0 → 0.274.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/admin",
3
- "version": "0.271.0",
3
+ "version": "0.274.0",
4
4
  "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",
5
5
  "main": "dist/dito-admin.umd.min.js",
6
6
  "repository": "https://github.com/ditojs/dito/tree/master/packages/admin",
@@ -33,15 +33,15 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@babel/runtime": "^7.15.4",
37
- "@ditojs/ui": "^0.271.0",
38
- "@ditojs/utils": "^0.271.0",
39
- "axios": "^0.22.0",
36
+ "@babel/runtime": "^7.17.2",
37
+ "@ditojs/ui": "^0.274.0",
38
+ "@ditojs/utils": "^0.274.0",
39
+ "axios": "^0.26.0",
40
40
  "codeflask": "^1.4.1",
41
- "core-js": "^3.18.1",
42
- "filesize": "^8.0.3",
41
+ "core-js": "^3.21.1",
42
+ "filesize": "^8.0.7",
43
43
  "filesize-parser": "^1.5.0",
44
- "nanoid": "^3.1.28",
44
+ "nanoid": "^3.3.1",
45
45
  "postcss-inset": "^1.0.0",
46
46
  "tinycolor2": "^1.4.2",
47
47
  "tiptap": "^1.32.2",
@@ -53,29 +53,28 @@
53
53
  "vue-js-modal": "^1.3.35",
54
54
  "vue-multiselect": "^2.1.6",
55
55
  "vue-notification": "^1.3.20",
56
- "vue-router": "^3.5.2",
56
+ "vue-router": "^3.5.3",
57
57
  "vue-spinner": "^1.0.4",
58
58
  "vue-template-compiler": "^2.6.14",
59
59
  "vue-upload-component": "^2.8.22",
60
60
  "vuedraggable": "^2.24.3"
61
61
  },
62
62
  "devDependencies": {
63
- "@babel/core": "^7.15.5",
64
- "@babel/preset-env": "^7.15.6",
65
- "@ditojs/babel-preset": "^0.271.0",
66
- "@ditojs/build": "^0.271.0",
67
- "@vue/cli-plugin-babel": "^4.5.13",
68
- "@vue/cli-service": "^4.5.13",
69
- "autoprefixer": "^9.8.7",
70
- "babel-loader": "^8.2.2",
71
- "fibers": "^5.0.0",
72
- "postcss": "^8.3.8",
63
+ "@babel/core": "^7.17.5",
64
+ "@babel/preset-env": "^7.16.11",
65
+ "@ditojs/babel-preset": "^0.274.0",
66
+ "@ditojs/build": "^0.274.0",
67
+ "@vue/cli-plugin-babel": "^4.5.15",
68
+ "@vue/cli-service": "^4.5.15",
69
+ "autoprefixer": "^9.8.8",
70
+ "babel-loader": "^8.2.3",
71
+ "postcss": "^8.4.8",
73
72
  "postcss-loader": "^4.3.0",
74
73
  "pug": "^3.0.2",
75
74
  "pug-plain-loader": "^1.1.0",
76
- "sass": "1.32.13",
77
- "sass-loader": "^10.2.0",
75
+ "sass": "1.49.9",
76
+ "sass-loader": "^10.2.1",
78
77
  "webpack": "^4.46.0"
79
78
  },
80
- "gitHead": "23245bf234f83049097413475a32d5bd27c5a603"
79
+ "gitHead": "0ebfe0bb8913f9d338bb91a0a507e7a4c6e49ecb"
81
80
  }
@@ -19,7 +19,7 @@
19
19
  <style lang="sass">
20
20
  .dito-panels
21
21
  max-width: $content-sidebar-width
22
- min-width: $content-sidebar-width / 2
22
+ min-width: calc($content-sidebar-width / 2)
23
23
  </style>
24
24
 
25
25
  <script>
@@ -158,6 +158,10 @@ export default DitoComponent.component('dito-root', {
158
158
 
159
159
  async login() {
160
160
  this.allowLogin = true
161
+ const {
162
+ additionalComponents,
163
+ redirectAfterLogin
164
+ } = this.options.login || {}
161
165
  const loginData = await this.showDialog({
162
166
  components: {
163
167
  username: {
@@ -166,7 +170,8 @@ export default DitoComponent.component('dito-root', {
166
170
  },
167
171
  password: {
168
172
  type: 'password'
169
- }
173
+ },
174
+ ...additionalComponents
170
175
  },
171
176
  buttons: {
172
177
  cancel: {},
@@ -180,8 +185,12 @@ export default DitoComponent.component('dito-root', {
180
185
  data: loginData,
181
186
  internal: true
182
187
  })
183
- this.setUser(response.data.user)
184
- await this.resolveViews()
188
+ if (redirectAfterLogin) {
189
+ location.replace(redirectAfterLogin)
190
+ } else {
191
+ this.setUser(response.data.user)
192
+ await this.resolveViews()
193
+ }
185
194
  } catch (err) {
186
195
  const error = err.response?.data?.error
187
196
  this.notify({
@@ -3,6 +3,7 @@
3
3
  tr
4
4
  th(
5
5
  v-for="(column, index) in columns"
6
+ v-if="shouldRender(column)"
6
7
  :class="getColumnClass(column)"
7
8
  )
8
9
  router-link(
@@ -4,7 +4,7 @@
4
4
  display: inline-block
5
5
  width: round($button-order-arrow-size * $math-sqrt2)
6
6
  padding-left: $form-spacing
7
- $arrow-offset: $button-order-arrow-size / 2 + $border-width
7
+ $arrow-offset: calc($button-order-arrow-size / 2 + $border-width)
8
8
  &::before
9
9
  +arrow($button-order-arrow-size, 'up')
10
10
  bottom: $arrow-offset
@@ -13,7 +13,7 @@ $font-size-small: 11px
13
13
  // NOTE: Due to higher precision in dart-sass, this needs to be rounded to 5
14
14
  // fractional digits, otherwise CSS creates the wrong resulting line-height with
15
15
  // 1 mixsing pixel.
16
- $line-height: rounded($input-height-factor - 2 * ($border-width + $input-padding-ver) / $font-size, 5)
16
+ $line-height: rounded(calc($input-height-factor - 2 * ($border-width + $input-padding-ver) / $font-size), 5)
17
17
 
18
18
  // Button
19
19
  $button-order-arrow-size: 4px
@@ -28,12 +28,12 @@ $pulldown-padding: $pulldown-padding-ver $pulldown-padding-hor
28
28
  $content-width: 900px
29
29
  $content-sidebar-width: 360px
30
30
  $content-padding: 16px
31
- $content-padding-half: $content-padding / 2
31
+ $content-padding-half: calc($content-padding / 2)
32
32
  $content-color-background: $color-lightest
33
33
 
34
34
  // Form
35
35
  $form-spacing: $input-padding-hor
36
- $form-spacing-half: $form-spacing / 2
36
+ $form-spacing-half: calc($form-spacing / 2)
37
37
 
38
38
  // Menu
39
39
  $menu-font-size: 14px
@@ -47,7 +47,7 @@ $menu-height: $menu-font-size + 2 * $menu-padding-ver
47
47
  // Tabs
48
48
  $tab-margin: 6px
49
49
  $tab-padding-hor: 12px
50
- $tab-padding-ver: ($menu-padding-ver * 2 - $tab-margin) / 2
50
+ $tab-padding-ver: calc(($menu-padding-ver * 2 - $tab-margin) / 2)
51
51
  $tab-radius: 4px // $border-radius
52
52
 
53
53
  // Patterns
@@ -103,6 +103,7 @@ export default TypeComponent.register('color', {
103
103
  } else {
104
104
  this.value = tinycolor(value).toString(format)
105
105
  }
106
+ this.onChange()
106
107
  }
107
108
  },
108
109
 
@@ -51,6 +51,7 @@
51
51
  template(v-if="columns")
52
52
  dito-table-cell(
53
53
  v-for="column in columns"
54
+ v-if="shouldRender(column)"
54
55
  :key="column.name"
55
56
  :class="getCellClass(column)"
56
57
  :cell="column"
@@ -113,11 +113,11 @@
113
113
 
114
114
  .multiselect__select
115
115
  width: 0
116
- margin-right: $select-arrow-width / 2
116
+ margin-right: calc($select-arrow-width / 2)
117
117
  &::before
118
118
  +arrow($select-arrow-size)
119
119
  bottom: $select-arrow-bottom
120
- right: -$select-arrow-size / 2
120
+ right: calc(-1 * $select-arrow-size / 2)
121
121
 
122
122
  .multiselect__spinner
123
123
  width: $spinner-width
@@ -43,7 +43,7 @@
43
43
 
44
44
  <style lang="sass">
45
45
  // TODO: Move to dito-ui
46
- $select-arrow-right: ($select-arrow-width - $select-arrow-size) / 2
46
+ $select-arrow-right: calc(($select-arrow-width - $select-arrow-size) / 2)
47
47
 
48
48
  .dito-select
49
49
  display: inline-block