@ditojs/admin 2.0.5 → 2.1.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.
Files changed (116) hide show
  1. package/dist/dito-admin.es.js +1511 -1435
  2. package/dist/dito-admin.umd.js +4 -4
  3. package/dist/style.css +1 -1
  4. package/package.json +31 -31
  5. package/src/DitoAdmin.js +66 -31
  6. package/src/DitoComponent.js +4 -1
  7. package/src/DitoContext.js +13 -5
  8. package/src/{TypeComponent.js → DitoTypeComponent.js} +8 -5
  9. package/src/components/DitoAccount.vue +20 -19
  10. package/src/components/DitoButtons.vue +14 -12
  11. package/src/components/DitoClipboard.vue +16 -8
  12. package/src/components/DitoContainer.vue +56 -43
  13. package/src/components/DitoCreateButton.vue +20 -15
  14. package/src/components/DitoDialog.vue +69 -48
  15. package/src/components/DitoEditButtons.vue +16 -14
  16. package/src/components/DitoElement.vue +2 -3
  17. package/src/components/DitoErrors.vue +18 -13
  18. package/src/components/DitoForm.vue +41 -24
  19. package/src/components/DitoFormNested.vue +12 -10
  20. package/src/components/DitoHeader.vue +103 -69
  21. package/src/components/DitoLabel.vue +108 -81
  22. package/src/components/DitoMenu.vue +52 -36
  23. package/src/components/DitoPagination.vue +9 -7
  24. package/src/components/DitoPane.vue +53 -45
  25. package/src/components/DitoPanel.vue +62 -42
  26. package/src/components/DitoPanels.vue +11 -10
  27. package/src/components/DitoRoot.vue +57 -46
  28. package/src/components/DitoSchema.vue +179 -131
  29. package/src/components/DitoSchemaInlined.vue +39 -28
  30. package/src/components/DitoScopes.vue +41 -31
  31. package/src/components/DitoSpinner.vue +31 -40
  32. package/src/components/DitoTableCell.vue +9 -9
  33. package/src/components/DitoTableHead.vue +52 -37
  34. package/src/components/DitoTabs.vue +39 -29
  35. package/src/components/DitoTreeItem.vue +140 -86
  36. package/src/components/DitoVNode.vue +1 -1
  37. package/src/components/DitoView.vue +13 -11
  38. package/src/mixins/DataMixin.js +11 -9
  39. package/src/mixins/DitoMixin.js +47 -25
  40. package/src/mixins/EmitterMixin.js +2 -1
  41. package/src/mixins/ItemMixin.js +15 -10
  42. package/src/mixins/LoadingMixin.js +2 -1
  43. package/src/mixins/NumberMixin.js +15 -10
  44. package/src/mixins/OptionsMixin.js +24 -12
  45. package/src/mixins/ResourceMixin.js +42 -34
  46. package/src/mixins/RouteMixin.js +8 -8
  47. package/src/mixins/SortableMixin.js +1 -1
  48. package/src/mixins/SourceMixin.js +68 -34
  49. package/src/mixins/TypeMixin.js +5 -4
  50. package/src/mixins/ValidationMixin.js +3 -0
  51. package/src/styles/_base.scss +17 -0
  52. package/src/styles/_button.scss +212 -0
  53. package/src/styles/_imports.scss +2 -0
  54. package/src/styles/_layout.scss +22 -0
  55. package/src/styles/_notifications.scss +54 -0
  56. package/src/styles/_pulldown.scss +39 -0
  57. package/src/styles/_scroll.scss +15 -0
  58. package/src/styles/_settings.scss +68 -0
  59. package/src/styles/_sortable.scss +13 -0
  60. package/src/styles/_table.scss +224 -0
  61. package/src/styles/style.scss +9 -0
  62. package/src/types/DitoTypeButton.vue +72 -0
  63. package/src/types/{TypeCheckbox.vue → DitoTypeCheckbox.vue} +12 -11
  64. package/src/types/{TypeCheckboxes.vue → DitoTypeCheckboxes.vue} +21 -15
  65. package/src/types/{TypeCode.vue → DitoTypeCode.vue} +46 -34
  66. package/src/types/{TypeColor.vue → DitoTypeColor.vue} +71 -52
  67. package/src/types/{TypeComponent.vue → DitoTypeComponent.vue} +2 -2
  68. package/src/types/DitoTypeComputed.vue +54 -0
  69. package/src/types/DitoTypeDate.vue +64 -0
  70. package/src/types/DitoTypeLabel.vue +23 -0
  71. package/src/types/{TypeList.vue → DitoTypeList.vue} +83 -61
  72. package/src/types/{TypeMarkup.vue → DitoTypeMarkup.vue} +172 -122
  73. package/src/types/DitoTypeMultiselect.vue +434 -0
  74. package/src/types/DitoTypeNumber.vue +46 -0
  75. package/src/types/{TypeObject.vue → DitoTypeObject.vue} +41 -26
  76. package/src/types/{TypePanel.vue → DitoTypePanel.vue} +2 -2
  77. package/src/types/{TypeProgress.vue → DitoTypeProgress.vue} +4 -6
  78. package/src/types/{TypeRadio.vue → DitoTypeRadio.vue} +17 -13
  79. package/src/types/{TypeSection.vue → DitoTypeSection.vue} +17 -17
  80. package/src/types/{TypeSelect.vue → DitoTypeSelect.vue} +39 -35
  81. package/src/types/{TypeSlider.vue → DitoTypeSlider.vue} +29 -23
  82. package/src/types/{TypeSwitch.vue → DitoTypeSwitch.vue} +15 -13
  83. package/src/types/DitoTypeText.vue +77 -0
  84. package/src/types/{TypeTextarea.vue → DitoTypeTextarea.vue} +17 -14
  85. package/src/types/DitoTypeTreeList.vue +191 -0
  86. package/src/types/{TypeUpload.vue → DitoTypeUpload.vue} +92 -65
  87. package/src/types/index.js +26 -26
  88. package/src/utils/SchemaGraph.js +21 -13
  89. package/src/utils/accessor.js +17 -9
  90. package/src/utils/data.js +4 -1
  91. package/src/utils/filter.js +8 -10
  92. package/src/utils/options.js +3 -3
  93. package/src/utils/resource.js +12 -10
  94. package/src/utils/schema.js +190 -125
  95. package/src/utils/type.js +31 -20
  96. package/src/validations/_decimals.js +1 -2
  97. package/types/index.d.ts +27 -23
  98. package/src/styles/_base.sass +0 -15
  99. package/src/styles/_button.sass +0 -127
  100. package/src/styles/_imports.sass +0 -2
  101. package/src/styles/_layout.sass +0 -13
  102. package/src/styles/_notifications.sass +0 -33
  103. package/src/styles/_pulldown.sass +0 -26
  104. package/src/styles/_scroll.sass +0 -13
  105. package/src/styles/_settings.sass +0 -55
  106. package/src/styles/_sortable.sass +0 -9
  107. package/src/styles/_table.sass +0 -153
  108. package/src/styles/style.sass +0 -10
  109. package/src/types/TypeButton.vue +0 -73
  110. package/src/types/TypeComputed.vue +0 -53
  111. package/src/types/TypeDate.vue +0 -64
  112. package/src/types/TypeLabel.vue +0 -19
  113. package/src/types/TypeMultiselect.vue +0 -376
  114. package/src/types/TypeNumber.vue +0 -44
  115. package/src/types/TypeText.vue +0 -67
  116. package/src/types/TypeTreeList.vue +0 -164
@@ -12,26 +12,38 @@
12
12
  span Status
13
13
  th
14
14
  span
15
- use-sortable(
16
- tag="tbody"
15
+ UseSortable(
17
16
  v-model="files"
17
+ tag="tbody"
18
18
  :options="getSortableOptions(draggable)"
19
19
  )
20
20
  tr(
21
21
  v-for="(file, index) in files"
22
22
  :key="file.key"
23
23
  )
24
- td(v-html="renderFile(file, index)")
24
+ td(
25
+ v-html="renderFile(file, index)"
26
+ )
25
27
  td {{ formatFileSize(file.size) }}
26
28
  td
27
- template(v-if="file.upload")
28
- template(v-if="file.upload.error")
29
+ template(
30
+ v-if="file.upload"
31
+ )
32
+ template(
33
+ v-if="file.upload.error"
34
+ )
29
35
  | Error: {{ file.upload.error }}
30
- template(v-else-if="file.upload.active")
36
+ template(
37
+ v-else-if="file.upload.active"
38
+ )
31
39
  | Uploading...
32
- template(v-else-if="file.upload.success")
40
+ template(
41
+ v-else-if="file.upload.success"
42
+ )
33
43
  | Uploaded
34
- template(v-else)
44
+ template(
45
+ v-else
46
+ )
35
47
  | Stored
36
48
  td.dito-cell-edit-buttons
37
49
  .dito-buttons.dito-buttons-round
@@ -43,8 +55,8 @@
43
55
  button.dito-button(
44
56
  v-if="deletable"
45
57
  type="button"
46
- @click="deleteFile(file, index)"
47
58
  v-bind="getButtonAttributes(verbs.delete)"
59
+ @click="deleteFile(file, index)"
48
60
  )
49
61
  tfoot
50
62
  tr
@@ -66,46 +78,25 @@
66
78
  type="button"
67
79
  @click.prevent="upload.active = true"
68
80
  ) Upload All
69
- vue-upload.dito-button.dito-button-add-upload(
70
- :input-id="dataPath"
81
+ VueUpload.dito-button.dito-button-add-upload(
82
+ ref="upload"
83
+ v-model="uploads"
84
+ :inputId="dataPath"
71
85
  :name="dataPath"
72
86
  :disabled="disabled"
73
- :post-action="uploadPath"
87
+ :postAction="uploadPath"
74
88
  :extensions="extensions"
75
89
  :accept="accept"
76
90
  :multiple="multiple"
77
91
  :size="maxSize"
78
- v-model="uploads"
92
+ title="Upload Files"
79
93
  @input-filter="inputFilter"
80
94
  @input-file="inputFile"
81
- ref="upload"
82
- title="Upload Files"
83
95
  )
84
96
  </template>
85
97
 
86
- <style lang="sass">
87
- @import '../styles/_imports'
88
-
89
- .dito-upload
90
- .dito-table
91
- tr
92
- vertical-align: middle
93
- .dito-button-add-upload
94
- padding: 0
95
- > *
96
- position: absolute
97
- cursor: pointer
98
- .dito-upload-footer
99
- display: flex
100
- justify-content: flex-end
101
- align-items: center
102
- .dito-progress
103
- flex: auto
104
- margin-right: $form-spacing
105
- </style>
106
-
107
98
  <script>
108
- import TypeComponent from '../TypeComponent.js'
99
+ import DitoTypeComponent from '../DitoTypeComponent.js'
109
100
  import DitoContext from '../DitoContext.js'
110
101
  import SortableMixin from '../mixins/SortableMixin.js'
111
102
  import parseFileSize from 'filesize-parser'
@@ -116,9 +107,9 @@ import { isArray, asArray, escapeHtml } from '@ditojs/utils'
116
107
  import VueUpload from 'vue-upload-component'
117
108
 
118
109
  // @vue/component
119
- export default TypeComponent.register('upload', {
120
- components: { VueUpload },
110
+ export default DitoTypeComponent.register('upload', {
121
111
  mixins: [SortableMixin],
112
+ components: { VueUpload },
122
113
 
123
114
  data() {
124
115
  return {
@@ -174,8 +165,10 @@ export default TypeComponent.register('upload', {
174
165
  }),
175
166
 
176
167
  isUploadReady() {
177
- return this.uploads.length &&
168
+ return (
169
+ this.uploads.length &&
178
170
  !(this.upload.active || this.upload.uploaded)
171
+ )
179
172
  },
180
173
 
181
174
  isUploadActive() {
@@ -204,22 +197,25 @@ export default TypeComponent.register('upload', {
204
197
  const { render } = this.schema
205
198
  return render
206
199
  ? render.call(
207
- this,
208
- new DitoContext(this, {
209
- value: file,
210
- data: this.files,
211
- index,
212
- dataPath: appendDataPath(this.dataPath, index)
213
- })
214
- )
200
+ this,
201
+ new DitoContext(this, {
202
+ value: file,
203
+ data: this.files,
204
+ index,
205
+ dataPath: appendDataPath(this.dataPath, index)
206
+ })
207
+ )
215
208
  : escapeHtml(file.name)
216
209
  },
217
210
 
218
211
  deleteFile(file, index) {
219
212
  const { name } = file
220
213
 
221
- if (file && window.confirm(
222
- `Do you really want to ${this.verbs.remove} ${name}?`)
214
+ if (
215
+ file &&
216
+ window.confirm(
217
+ `Do you really want to ${this.verbs.remove} ${name}?`
218
+ )
223
219
  ) {
224
220
  if (this.multiple) {
225
221
  this.value.splice(index, 1)
@@ -294,16 +290,18 @@ export default TypeComponent.register('upload', {
294
290
  this.removeFile(newFile)
295
291
  }
296
292
  } else if (error) {
297
- const text = {
298
- abort: 'Upload aborted',
299
- denied: 'Upload denied',
300
- extension: `Unsupported file-type: ${newFile.name}`,
301
- network: 'Network error encountered during upload',
302
- server: 'Server error occurred during upload',
303
- size: `File is too large: ${formatFileSize(newFile.size)}`,
304
- timeout: 'Timeout occurred during upload'
305
-
306
- }[error] || `Unknown File Upload Error: '${error}'`
293
+ const text = (
294
+ {
295
+ abort: 'Upload aborted',
296
+ denied: 'Upload denied',
297
+ extension: `Unsupported file-type: ${newFile.name}`,
298
+ network: 'Network error encountered during upload',
299
+ server: 'Server error occurred during upload',
300
+ size: `File is too large: ${formatFileSize(newFile.size)}`,
301
+ timeout: 'Timeout occurred during upload'
302
+ }[error] ||
303
+ `Unknown File Upload Error: '${error}'`
304
+ )
307
305
  this.notify({
308
306
  type: 'error',
309
307
  title: 'File Upload Error',
@@ -314,7 +312,7 @@ export default TypeComponent.register('upload', {
314
312
  }
315
313
  },
316
314
 
317
- inputFilter(newFile/*, oldFile, prevent */) {
315
+ inputFilter(newFile /*, oldFile, prevent */) {
318
316
  const xhr = newFile?.xhr
319
317
  if (this.api.cors?.credentials && xhr && !xhr.withCredentials) {
320
318
  xhr.withCredentials = true
@@ -325,9 +323,7 @@ export default TypeComponent.register('upload', {
325
323
  processValue(schema, value) {
326
324
  // Filter out all newly added files that weren't actually uploaded.
327
325
  const files = asFiles(value)
328
- .map(
329
- ({ upload, ...file }) => !upload || upload.success ? file : null
330
- )
326
+ .map(({ upload, ...file }) => (!upload || upload.success ? file : null))
331
327
  .filter(file => file)
332
328
  return schema.multiple ? files : files[0] || null
333
329
  }
@@ -336,5 +332,36 @@ export default TypeComponent.register('upload', {
336
332
  function asFiles(value) {
337
333
  return value ? asArray(value) : []
338
334
  }
339
-
340
335
  </script>
336
+
337
+ <style lang="scss">
338
+ @import '../styles/_imports';
339
+
340
+ .dito-upload {
341
+ .dito-table {
342
+ tr {
343
+ vertical-align: middle;
344
+ }
345
+ }
346
+
347
+ .dito-button-add-upload {
348
+ padding: 0;
349
+
350
+ > * {
351
+ position: absolute;
352
+ cursor: pointer;
353
+ }
354
+ }
355
+
356
+ .dito-upload-footer {
357
+ display: flex;
358
+ justify-content: flex-end;
359
+ align-items: center;
360
+
361
+ .dito-progress {
362
+ flex: auto;
363
+ margin-right: $form-spacing;
364
+ }
365
+ }
366
+ }
367
+ </style>
@@ -1,29 +1,29 @@
1
1
  // NOTE: index.js exports nothing, but type components will be registered in
2
- // DitoComponent and can be retrieved through TypeComponent.get(type) and
2
+ // DitoComponent and can be retrieved through DitoTypeComponent.get(type) and
3
3
  // rendered through their component-names (e.g. dito-type-list).
4
4
 
5
- export { default as TypeButton } from './TypeButton.vue'
6
- export { default as TypeCheckbox } from './TypeCheckbox.vue'
7
- export { default as TypeCheckboxes } from './TypeCheckboxes.vue'
8
- export { default as TypeCode } from './TypeCode.vue'
9
- export { default as TypeColor } from './TypeColor.vue'
10
- export { default as TypeComponent } from './TypeComponent.vue'
11
- export { default as TypeComputed } from './TypeComputed.vue'
12
- export { default as TypeDate } from './TypeDate.vue'
13
- export { default as TypeList } from './TypeList.vue'
14
- export { default as TypeLabel } from './TypeLabel.vue'
15
- export { default as TypeMarkup } from './TypeMarkup.vue'
16
- export { default as TypeMultiselect } from './TypeMultiselect.vue'
17
- export { default as TypeNumber } from './TypeNumber.vue'
18
- export { default as TypeObject } from './TypeObject.vue'
19
- export { default as TypePanel } from './TypePanel.vue'
20
- export { default as TypeProgress } from './TypeProgress.vue'
21
- export { default as TypeRadio } from './TypeRadio.vue'
22
- export { default as TypeSection } from './TypeSection.vue'
23
- export { default as TypeSelect } from './TypeSelect.vue'
24
- export { default as TypeSlider } from './TypeSlider.vue'
25
- export { default as TypeSwitch } from './TypeSwitch.vue'
26
- export { default as TypeText } from './TypeText.vue'
27
- export { default as TypeTextarea } from './TypeTextarea.vue'
28
- export { default as TypeTreeList } from './TypeTreeList.vue'
29
- export { default as TypeUpload } from './TypeUpload.vue'
5
+ export { default as DitoTypeButton } from './DitoTypeButton.vue'
6
+ export { default as DitoTypeCheckbox } from './DitoTypeCheckbox.vue'
7
+ export { default as DitoTypeCheckboxes } from './DitoTypeCheckboxes.vue'
8
+ export { default as DitoTypeCode } from './DitoTypeCode.vue'
9
+ export { default as DitoTypeColor } from './DitoTypeColor.vue'
10
+ export { default as DitoDitoTypeComponent } from './DitoTypeComponent.vue'
11
+ export { default as DitoTypeComputed } from './DitoTypeComputed.vue'
12
+ export { default as DitoTypeDate } from './DitoTypeDate.vue'
13
+ export { default as DitoTypeList } from './DitoTypeList.vue'
14
+ export { default as DitoTypeLabel } from './DitoTypeLabel.vue'
15
+ export { default as DitoTypeMarkup } from './DitoTypeMarkup.vue'
16
+ export { default as DitoTypeMultiselect } from './DitoTypeMultiselect.vue'
17
+ export { default as DitoTypeNumber } from './DitoTypeNumber.vue'
18
+ export { default as DitoTypeObject } from './DitoTypeObject.vue'
19
+ export { default as DitoTypePanel } from './DitoTypePanel.vue'
20
+ export { default as DitoTypeProgress } from './DitoTypeProgress.vue'
21
+ export { default as DitoTypeRadio } from './DitoTypeRadio.vue'
22
+ export { default as DitoTypeSection } from './DitoTypeSection.vue'
23
+ export { default as DitoTypeSelect } from './DitoTypeSelect.vue'
24
+ export { default as DitoTypeSlider } from './DitoTypeSlider.vue'
25
+ export { default as DitoTypeSwitch } from './DitoTypeSwitch.vue'
26
+ export { default as DitoTypeText } from './DitoTypeText.vue'
27
+ export { default as DitoTypeTextarea } from './DitoTypeTextarea.vue'
28
+ export { default as DitoTypeTreeList } from './DitoTypeTreeList.vue'
29
+ export { default as DitoTypeUpload } from './DitoTypeUpload.vue'
@@ -1,6 +1,9 @@
1
1
  import { isTemporaryId } from './data.js'
2
2
  import {
3
- isInteger, asArray, parseDataPath, getValueAtDataPath
3
+ isInteger,
4
+ asArray,
5
+ parseDataPath,
6
+ getValueAtDataPath
4
7
  } from '@ditojs/utils'
5
8
  import { nanoid } from 'nanoid'
6
9
 
@@ -29,7 +32,7 @@ export class SchemaGraph {
29
32
  let subGraph = this.graph
30
33
  for (const part of dataPath) {
31
34
  const key = isInteger(+part) ? '*' : part
32
- subGraph = (subGraph[key] ??= {})
35
+ subGraph = subGraph[key] ??= {}
33
36
  }
34
37
  subGraph.$settings = {
35
38
  ...defaults, // See `addSource(dataPath)`
@@ -95,9 +98,11 @@ export class SchemaGraph {
95
98
  if (source || relation && internal) {
96
99
  const values = getValueAtDataPath(data, dataPath, () => null)
97
100
  const removeId = clipboard && source && !related
98
- const referenceId = clipboard && (
99
- relation && internal ||
100
- source && related
101
+ const referenceId = (
102
+ clipboard && (
103
+ relation && internal ||
104
+ source && related
105
+ )
101
106
  )
102
107
  for (const value of asArray(values).flat()) {
103
108
  const idKey = (
@@ -109,20 +114,23 @@ export class SchemaGraph {
109
114
  if (id != null) {
110
115
  if (removeId) {
111
116
  delete value[idKey]
112
- } if (referenceId || isTemporaryId(id)) {
117
+ }
118
+ if (referenceId || isTemporaryId(id)) {
113
119
  if (isTemporaryId(id)) {
114
120
  id = id.slice(1)
115
121
  }
116
122
  const refKey = clipboard
117
- // Clipboard just needs temporary ids under the actual `idKey`.
118
- ? idKey
119
- // Server wants Objection-style '#id' / '#ref' pairs.
120
- : source ? '#id' : '#ref'
123
+ ? // Clipboard just needs temporary ids under the actual `idKey`
124
+ idKey
125
+ : // Server wants Objection-style '#id' / '#ref' pairs.
126
+ source
127
+ ? '#id'
128
+ : '#ref'
121
129
  const revValue = clipboard
122
130
  ? `@${id}`
123
- // Keep the ids unique in reference groups, since they reference
124
- // across the full graph.
125
- : reference
131
+ : // Keep the ids unique in reference groups, since they
132
+ // reference across the full graph.
133
+ reference
126
134
  ? `${reference}-${id}`
127
135
  : id // A temporary id without a related, just preserve it.
128
136
  value[refKey] = revValue
@@ -1,5 +1,8 @@
1
1
  import {
2
- isFunction, isString, parseDataPath, normalizeDataPath
2
+ isFunction,
3
+ isString,
4
+ parseDataPath,
5
+ normalizeDataPath
3
6
  } from '@ditojs/utils'
4
7
 
5
8
  export function getSchemaAccessor(
@@ -17,14 +20,19 @@ export function getSchemaAccessor(
17
20
  get() {
18
21
  // Only determine schema value if we have no getter, or the getter
19
22
  // wants to receive the value and process it further:
20
- const value = !get || get.length > 0
21
- // NOTE: Because `schema` objects are retrieved from `meta` object, they
22
- // don't seem to be reactive. To allow changed in `schema` values,
23
- // `set()` stores changed values in the separate `overrides` object.
24
- ? this.overrides && name in this.overrides
25
- ? this.overrides[name]
26
- : this.getSchemaValue(keyOrDataPath, { type, default: def, callback })
27
- : undefined
23
+ const value =
24
+ !get || get.length > 0
25
+ ? // NOTE: Because `schema` objects are retrieved from `meta`, they
26
+ // don't seem to be reactive. To allow changed in `schema` values,
27
+ // `set()` stores changed values in the separate `overrides` object.
28
+ this.overrides && name in this.overrides
29
+ ? this.overrides[name]
30
+ : this.getSchemaValue(keyOrDataPath, {
31
+ type,
32
+ default: def,
33
+ callback
34
+ })
35
+ : undefined
28
36
  return get ? get.call(this, value) : value
29
37
  },
30
38
 
package/src/utils/data.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import {
2
- isInteger, parseDataPath, getValueAtDataPath, normalizeDataPath
2
+ isInteger,
3
+ parseDataPath,
4
+ getValueAtDataPath,
5
+ normalizeDataPath
3
6
  } from '@ditojs/utils'
4
7
 
5
8
  export function appendDataPath(dataPath, token) {
@@ -1,7 +1,7 @@
1
1
  import { isArray, asArray, labelize } from '@ditojs/utils'
2
2
 
3
3
  export const filterComponents = {
4
- text(filter) {
4
+ 'text'(filter) {
5
5
  const options = [
6
6
  {
7
7
  label: 'contains',
@@ -23,15 +23,14 @@ export const filterComponents = {
23
23
  return {
24
24
  operator: filter.operators
25
25
  ? {
26
- type: 'select',
27
- options:
28
- isArray(filter.operators)
26
+ type: 'select',
27
+ options: isArray(filter.operators)
29
28
  ? options.filter(
30
- option => filter.operators.includes(option.value)
31
- )
29
+ option => filter.operators.includes(option.value)
30
+ )
32
31
  : options,
33
- width: '40%'
34
- }
32
+ width: '40%'
33
+ }
35
34
  : null,
36
35
  text: {
37
36
  type: 'text',
@@ -186,8 +185,7 @@ function parseFiltersData(schema, query) {
186
185
  const [, name, json] = filter.match(/^(\w+):(.*)$/)
187
186
  try {
188
187
  filters[name] = asArray(JSON.parse(`[${json}]`))
189
- } catch (error) {
190
- }
188
+ } catch (error) {}
191
189
  }
192
190
  }
193
191
  const filtersData = {}
@@ -6,9 +6,9 @@ export function resolveMergedOptions(options) {
6
6
  const { mixins } = options
7
7
  return mixins || options.extends
8
8
  ? mergeOptions(
9
- { ...options },
10
- options
11
- )
9
+ { ...options },
10
+ options
11
+ )
12
12
  : options
13
13
  }
14
14
 
@@ -6,9 +6,11 @@ export function hasResource(schema) {
6
6
 
7
7
  export function getResource(resource, defaults = {}) {
8
8
  const { parent, ...defs } = defaults
9
- resource = isObject(resource) ? { ...defs, ...resource }
10
- : isString(resource) ? { ...defs, path: resource }
11
- : null
9
+ resource = isObject(resource)
10
+ ? { ...defs, ...resource }
11
+ : isString(resource)
12
+ ? { ...defs, path: resource }
13
+ : null
12
14
  // Only set parent if path doesn't start with '/', so relative URLs are
13
15
  // dealt with correctly.
14
16
  if (
@@ -28,12 +30,12 @@ export function getResource(resource, defaults = {}) {
28
30
  export function getMemberResource(id, resource) {
29
31
  return id != null && resource?.type === 'collection'
30
32
  ? {
31
- type: 'member',
32
- ...pickBy(
33
- resource,
34
- (value, key) => ['method', 'path', 'parent'].includes(key)
35
- ),
36
- id: `${id}`
37
- }
33
+ type: 'member',
34
+ ...pickBy(
35
+ resource,
36
+ (value, key) => ['method', 'path', 'parent'].includes(key)
37
+ ),
38
+ id: `${id}`
39
+ }
38
40
  : null
39
41
  }