@ditojs/admin 2.47.0 → 2.48.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": "2.47.0",
3
+ "version": "2.48.0",
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",
@@ -39,8 +39,8 @@
39
39
  "not ie_mob > 0"
40
40
  ],
41
41
  "dependencies": {
42
- "@ditojs/ui": "^2.47.0",
43
- "@ditojs/utils": "^2.47.0",
42
+ "@ditojs/ui": "^2.48.0",
43
+ "@ditojs/utils": "^2.48.0",
44
44
  "@kyvg/vue3-notification": "^3.4.1",
45
45
  "@lk77/vue3-color": "^3.0.6",
46
46
  "@tiptap/core": "^2.11.9",
@@ -84,10 +84,10 @@
84
84
  "vue-upload-component": "^3.1.17"
85
85
  },
86
86
  "devDependencies": {
87
- "@ditojs/build": "^2.47.0",
87
+ "@ditojs/build": "^2.48.0",
88
88
  "typescript": "^5.8.3",
89
89
  "vite": "^6.3.4"
90
90
  },
91
91
  "types": "types",
92
- "gitHead": "9ce26a1dc412e67304e823c0206593ee4a9c8ae4"
92
+ "gitHead": "bacff1f9a6b314fad4f01b4a83d5cf4778d344e1"
93
93
  }
package/src/DitoAdmin.js CHANGED
@@ -7,8 +7,7 @@ import {
7
7
  assignDeeply,
8
8
  hyphenate,
9
9
  camelize,
10
- defaultFormats,
11
- deprecate
10
+ defaultFormats
12
11
  } from '@ditojs/utils'
13
12
  import * as components from './components/index.js'
14
13
  import * as types from './types/index.js'
@@ -244,20 +243,11 @@ class RequestError extends Error {
244
243
  async function request(api, {
245
244
  url,
246
245
  method = 'get',
247
- // TODO: `request.params` was deprecated in favour of `query` on 2022-11-01,
248
- // remove once not in use anywhere any more.
249
- params = null,
250
- query = params || null,
246
+ query = null,
251
247
  headers = null,
252
248
  data = null,
253
249
  signal = null
254
250
  }) {
255
- if (params) {
256
- deprecate(
257
- `request.params is deprecated. Use action.method and action.path instead.`
258
- )
259
- }
260
-
261
251
  const isApiUrl = api.isApiUrl(url)
262
252
 
263
253
  const response = await fetch(api.getApiUrl({ url, query }), {
@@ -248,7 +248,6 @@ export default DitoComponent.component('DitoRoot', {
248
248
  // buttons in the dialog can use `dialog.resolve()` and `dialog.reject()`
249
249
  // to close the modal dialog and resolve / reject the promise at once.
250
250
  return new Promise(
251
- // eslint-disable-next-line no-async-promise-executor
252
251
  async (resolve, reject) => {
253
252
  // Process components to resolve async schemas.
254
253
  const routes = []
@@ -245,14 +245,12 @@ export default DitoComponent.component('DitoSchema', {
245
245
  // @override
246
246
  processedData() {
247
247
  // TODO: Fix side-effects
248
- // eslint-disable-next-line vue/no-side-effects-in-computed-properties
249
248
  return this.processData({ target: 'server', schemaOnly: true })
250
249
  },
251
250
 
252
251
  clipboardData: {
253
252
  get() {
254
253
  // TODO: Fix side-effects
255
- // eslint-disable-next-line vue/no-side-effects-in-computed-properties
256
254
  return this.processData({ target: 'clipboard', schemaOnly: true })
257
255
  },
258
256
 
@@ -671,7 +669,6 @@ export default DitoComponent.component('DitoSchema', {
671
669
  setData(data) {
672
670
  for (const name in data) {
673
671
  if (name in this.data) {
674
- // eslint-disable-next-line vue/no-mutating-props
675
672
  if (!equals(this.data[name], data[name])) {
676
673
  // eslint-disable-next-line vue/no-mutating-props
677
674
  this.data[name] = data[name]
@@ -392,9 +392,7 @@ export default {
392
392
  } ${
393
393
  options.url
394
394
  } ${
395
- // TODO: `request.params` was deprecated in favour of `query` on
396
- // 2022-11-01, remove once not in use anywhere any more.
397
- JSON.stringify(options.query || options.params || '')
395
+ JSON.stringify(options.query || '')
398
396
  } ${
399
397
  JSON.stringify(options.data || '')
400
398
  }`
@@ -13,7 +13,7 @@ export default {
13
13
  this.value =
14
14
  value !== ''
15
15
  ? this.isInteger
16
- ? parseInt(value, 10)
16
+ ? Number(value)
17
17
  : parseFloat(value)
18
18
  : null
19
19
  }
@@ -189,8 +189,6 @@ export default {
189
189
  for (const option of options) {
190
190
  if (!('id' in option)) {
191
191
  // TODO: Fix side-effects
192
- // eslint-disable-next-line max-len
193
- // eslint-disable-next-line vue/no-side-effects-in-computed-properties
194
192
  setTemporaryId(option, 'id')
195
193
  }
196
194
  }
@@ -24,7 +24,6 @@ export default {
24
24
  value = parse(new DitoContext(this, { value }))
25
25
  }
26
26
  this.parsedValue = value
27
- // eslint-disable-next-line vue/no-mutating-props
28
27
  this.data[this.name] = value
29
28
  }
30
29
  }
@@ -326,7 +326,6 @@ export default DitoTypeComponent.register('markup', {
326
326
  // See if `href` can be parsed as a URL, and if not,
327
327
  // prefix it with a default protocol.
328
328
  try {
329
- // eslint-disable-next-line no-new
330
329
  new URL(href)
331
330
  } catch {
332
331
  href = `https://${href}`
@@ -242,7 +242,7 @@ function parseFiltersData(schema, query) {
242
242
  const [, filterName, json] = filter.match(/^(\w+):(.*)$/)
243
243
  try {
244
244
  filters[filterName] = asArray(JSON.parse(`[${json}]`))
245
- } catch (error) {}
245
+ } catch {}
246
246
  }
247
247
  }
248
248
  const filtersData = {}
@@ -719,14 +719,12 @@ export function computeValue(schema, data, name, dataPath, {
719
719
  // Access `data[name]` directly to update the value without calling
720
720
  // parse():
721
721
  // TODO: Fix side-effects
722
- // eslint-disable-next-line vue/no-side-effects-in-computed-properties
723
722
  data[name] = value
724
723
  }
725
724
  }
726
725
  // If the value is still missing after compute, set the default for it:
727
726
  if (!(name in data) && !shouldIgnoreMissingValue(schema, context)) {
728
727
  // TODO: Fix side-effects
729
- // eslint-disable-next-line vue/no-side-effects-in-computed-properties
730
728
  data[name] = getDefaultValue(schema, context)
731
729
  }
732
730
  // Now access the value. This is important for reactivity and needs to
package/types/index.d.ts CHANGED
@@ -35,8 +35,6 @@ export type RequestMethod = <T>({
35
35
  */
36
36
  method: HTTPVerb
37
37
  data: any
38
- /** @deprecated use query instead */
39
- params: Record<string, string | string[]> | [string, string][]
40
38
  query: Record<string, string | string[]> | [string, string][]
41
39
  headers: Record<string, string>
42
40
  }) => Promise<RequestMethodResponse<T>>
@@ -1018,8 +1016,6 @@ export type DitoContext<$Item = any> = {
1018
1016
  * @default 'get'
1019
1017
  */
1020
1018
  method?: HTTPVerb
1021
- /** @deprecated use query instead */
1022
- params?: Record<string, string | string[]> | [string, string][]
1023
1019
  query?: Record<string, string | string[]> | [string, string][]
1024
1020
  data?: any
1025
1021
  resource?: Resource