@mapomodule/uikit 1.0.0-alpha.5 → 1.0.0-alpha.6

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/CHANGELOG.md CHANGED
@@ -3,6 +3,46 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.6](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2021-12-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **uikit:** fix sidebar footer items not collapsing on mini variant ([04c510e](https://github.com/lotrekagency/mapo/commit/04c510ee87bd7b74161725c366e2eac2bd3efe9f))
12
+ * **uikit:** fix sidebar items not collapsing on mini variant ([67a9524](https://github.com/lotrekagency/mapo/commit/67a9524b17b6cbdf455b8e6f56f7cc0674b1dbed))
13
+ * various css fixes ([658c363](https://github.com/lotrekagency/mapo/commit/658c3636e869f0a2bd53efe41295cf87d6af3962))
14
+ * **list:** fix v-menu position on large screens ([41bd08d](https://github.com/lotrekagency/mapo/commit/41bd08d36d85e685a755c7e0de97bbb05a24c03d))
15
+ * **list:** fixed v-menu filter positioning ([e99848e](https://github.com/lotrekagency/mapo/commit/e99848e0beb2df124db1ba9968696bbe8ee7b683))
16
+ * **list:** fixed v-menu position for filters ([cb95260](https://github.com/lotrekagency/mapo/commit/cb9526085d536ff7b468316b1d2571c7ae9509d8))
17
+ * **list:** load page from query params ([88dea98](https://github.com/lotrekagency/mapo/commit/88dea98063cdab79c9c518fe0e3bf8d3c90f0161))
18
+ * **list:** refactoring for injected elements and FE pagination ([f9c968e](https://github.com/lotrekagency/mapo/commit/f9c968e0edf87654df60781d7d2d465d15e40ab9))
19
+ * **list:** removed lock to BE pagination if items in list are less than itemsPerPage ([3fe34e0](https://github.com/lotrekagency/mapo/commit/3fe34e0d1438a0980e8819070f9b158ad3b6e0b8))
20
+ * **uikit:** better handle detail component lang switches ([5297e49](https://github.com/lotrekagency/mapo/commit/5297e4956536b382600c250f5c797c8db5e58f84))
21
+ * **uikit:** fix detailfield not reading conf value changes ([5628268](https://github.com/lotrekagency/mapo/commit/5628268e4e78201523eba60adaf17286dfb38c8b))
22
+ * **uikit:** fix lang changhe in detail component ([32494f7](https://github.com/lotrekagency/mapo/commit/32494f7d094f7e9cebc14f7524ad716eb89fd6d7))
23
+ * **uikit:** fix positioning of element in list component and subcomponents ([887c3b6](https://github.com/lotrekagency/mapo/commit/887c3b6aae52d1a3494ebcc01f0f155f21373f9c))
24
+ * **uikit:** set endpoint to default null in detail field ([5c9296c](https://github.com/lotrekagency/mapo/commit/5c9296c81f8667319699e933f528c4c05a1f541d))
25
+ * fixed v-model with datepicker filter ([ef4634e](https://github.com/lotrekagency/mapo/commit/ef4634e8ad0719ec2991a8c40a87191c0e32d7ec))
26
+ * load saved date range into datepicker ([eb94dd5](https://github.com/lotrekagency/mapo/commit/eb94dd5686b9fed16e0f39bf122c767d8bd1017b))
27
+
28
+
29
+ ### Features
30
+
31
+ * **list:** added support to offline items ([495fd1f](https://github.com/lotrekagency/mapo/commit/495fd1f30cd0adc228b48ca4384b9df572e69216))
32
+ * **list:** handle multisort ([41feb88](https://github.com/lotrekagency/mapo/commit/41feb88ec15be5cc9afbcdf3d2dea23142301153))
33
+ * **uikit:** add possibility to remove icon from sidebar ([106d85f](https://github.com/lotrekagency/mapo/commit/106d85f576cdc9e6438b48fa8e695315cac2262b))
34
+ * **uikit:** added langChange event to detail component ([70d3430](https://github.com/lotrekagency/mapo/commit/70d3430694e67dfcd65539a3d474847123e05db5))
35
+ * **uikit:** added possibility to change detail component current lang fromprop ([1993aa7](https://github.com/lotrekagency/mapo/commit/1993aa74a66768eea319f41a41878916544adcbb))
36
+ * **uikit:** added possibility to override field container class in detail component with key class in field configuration ([afe1e52](https://github.com/lotrekagency/mapo/commit/afe1e522683d08c5e63650e55dbe2f9a9404e681))
37
+ * **uikit:** added seopreview field ([03e52fe](https://github.com/lotrekagency/mapo/commit/03e52fed08e60c8b43226856a8d05d4c724ad9b2))
38
+ * **uikit:** added v-model to Detail Component, now you can bind the payload externally from detail field. ([a50b082](https://github.com/lotrekagency/mapo/commit/a50b08261d6b8eba3e5b6f1ea2f1f4bb0d591b8e))
39
+ * **uikit:** display errors on tinymce component also with red label shake animation ([2c9e158](https://github.com/lotrekagency/mapo/commit/2c9e158090ee1f770518ad755437171a1b16afbd))
40
+ * **uikit:** newsidebar built with vuetify components to better support theming ([9cc237f](https://github.com/lotrekagency/mapo/commit/9cc237fa7dcfe193edc0fd9cb90e3bbbb103931d))
41
+
42
+
43
+
44
+
45
+
6
46
  # [1.0.0-alpha.5](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-12-20)
7
47
 
8
48
 
@@ -26,47 +26,55 @@
26
26
  <slot name="body.top.underlang" v-bind="slotBindings"></slot>
27
27
  <!-- Use this to override the content of the main body. -->
28
28
  <slot name="body" v-bind="slotBindings">
29
- <!-- The result of the [`DetailConfiguration`](#detailconfiguration) contained in the main body. -->
30
- <div v-for="(field, index) in mainFields" :key="index">
31
- <v-card v-if="field.group" class="my-2">
32
- <v-card-title>
33
- <v-icon left> {{ field.group.icon }} </v-icon>
34
- <span>{{ field.group.name }}</span>
35
- </v-card-title>
36
- <v-card-text>
37
- <div
38
- v-for="(fields, fieldsI) in field.fields"
39
- :key="fieldsI"
40
- class="mb-4"
41
- >
42
- <!-- This is a dynamic slot. You can use it to override a field component. For example use `fields.title` to override the component of the field with value `title`. -->
43
- <slot
44
- :name="fields.slotName"
45
- v-bind="{
46
- conf: fields,
47
- ...slotBindings,
48
- }"
49
- >
50
- <!-- A [`DetailField`](/components/detail/DetailField/) configured by a [`FieldConfiguration`](#fieldconfiguration). -->
51
- <DetailField
52
- v-model="model"
53
- :conf="fields"
54
- :errors="errors"
55
- />
56
- </slot>
57
- </div>
58
- </v-card-text>
59
- </v-card>
60
- <slot
61
- v-else
62
- :name="field.slotName"
63
- v-bind="{
64
- conf: field,
65
- ...slotBindings,
66
- }"
29
+ <div class="row">
30
+ <!-- The result of the [`DetailConfiguration`](#detailconfiguration) contained in the main body. -->
31
+ <div
32
+ class="col-12"
33
+ :class="field.class"
34
+ v-for="(field, index) in mainFields"
35
+ :key="index"
67
36
  >
68
- <DetailField v-model="model" :conf="field" :errors="errors" />
69
- </slot>
37
+ <v-card v-if="field.group" class="my-2">
38
+ <v-card-title>
39
+ <v-icon left> {{ field.group.icon }} </v-icon>
40
+ <span>{{ field.group.name }}</span>
41
+ </v-card-title>
42
+ <v-card-text class="row">
43
+ <div
44
+ v-for="(fields, fieldsI) in field.fields"
45
+ :key="fieldsI"
46
+ class="col-12"
47
+ :class="fields.class"
48
+ >
49
+ <!-- This is a dynamic slot. You can use it to override a field component. For example use `fields.title` to override the component of the field with value `title`. -->
50
+ <slot
51
+ :name="fields.slotName"
52
+ v-bind="{
53
+ conf: fields,
54
+ ...slotBindings,
55
+ }"
56
+ >
57
+ <!-- A [`DetailField`](/components/detail/DetailField/) configured by a [`FieldConfiguration`](#fieldconfiguration). -->
58
+ <DetailField
59
+ v-model="model"
60
+ :conf="fields"
61
+ :errors="errors"
62
+ />
63
+ </slot>
64
+ </div>
65
+ </v-card-text>
66
+ </v-card>
67
+ <slot
68
+ v-else
69
+ :name="field.slotName"
70
+ v-bind="{
71
+ conf: field,
72
+ ...slotBindings,
73
+ }"
74
+ >
75
+ <DetailField v-model="model" :conf="field" :errors="errors" />
76
+ </slot>
77
+ </div>
70
78
  </div>
71
79
  </slot>
72
80
  <!-- Use this to add content under the main body. -->
@@ -118,45 +126,53 @@
118
126
  </slot>
119
127
  <!-- Use this to add content on the top of the sidebar fields (or under sidebar buttons). -->
120
128
  <slot name="side.top" v-bind="slotBindings"></slot>
121
- <div v-for="(field, index) in sideFields" :key="index">
122
- <v-card v-if="field.group" class="mb-4">
123
- <v-card-title>
124
- <v-icon left> {{ field.group.icon }} </v-icon>
125
- <span>{{ field.group.name }}</span>
126
- </v-card-title>
127
- <v-card-text>
128
- <div
129
- v-for="(fields, fieldsI) in field.fields"
130
- :key="fieldsI"
131
- class="mb-4"
132
- >
133
- <!-- @vuese-ignore -->
134
- <slot
135
- :name="fields.slotName"
136
- v-bind="{
137
- conf: fields,
138
- ...slotBindings,
139
- }"
140
- >
141
- <DetailField
142
- v-model="model"
143
- :conf="fields"
144
- :errors="errors"
145
- />
146
- </slot>
147
- </div>
148
- </v-card-text>
149
- </v-card>
150
- <slot
151
- v-else
152
- :name="field.slotName"
153
- v-bind="{
154
- conf: field,
155
- ...slotBindings,
156
- }"
129
+ <div class="row">
130
+ <div
131
+ class="col-12"
132
+ :class="field.class"
133
+ v-for="(field, index) in sideFields"
134
+ :key="index"
157
135
  >
158
- <DetailField v-model="model" :conf="field" :errors="errors" />
159
- </slot>
136
+ <v-card v-if="field.group" class="mb-4">
137
+ <v-card-title>
138
+ <v-icon left> {{ field.group.icon }} </v-icon>
139
+ <span>{{ field.group.name }}</span>
140
+ </v-card-title>
141
+ <v-card-text class="row">
142
+ <div
143
+ v-for="(fields, fieldsI) in field.fields"
144
+ :key="fieldsI"
145
+ class="col-12"
146
+ :class="field.class"
147
+ >
148
+ <!-- @vuese-ignore -->
149
+ <slot
150
+ :name="fields.slotName"
151
+ v-bind="{
152
+ conf: fields,
153
+ ...slotBindings,
154
+ }"
155
+ >
156
+ <DetailField
157
+ v-model="model"
158
+ :conf="fields"
159
+ :errors="errors"
160
+ />
161
+ </slot>
162
+ </div>
163
+ </v-card-text>
164
+ </v-card>
165
+ <slot
166
+ v-else
167
+ :name="field.slotName"
168
+ v-bind="{
169
+ conf: field,
170
+ ...slotBindings,
171
+ }"
172
+ >
173
+ <DetailField v-model="model" :conf="field" :errors="errors" />
174
+ </slot>
175
+ </div>
160
176
  </div>
161
177
  <!-- Use this to add content under the sidebar fields. -->
162
178
  <slot name="side.bottom" v-bind="slotBindings"></slot>
@@ -183,6 +199,16 @@ export default {
183
199
  };
184
200
  },
185
201
  props: {
202
+ // V-model of the object we are editing.
203
+ value: {
204
+ type: Object,
205
+ required: false
206
+ },
207
+ // Set the current lang to value.
208
+ lang: {
209
+ type: String,
210
+ required: false
211
+ },
186
212
  // The main configuration that determines the arrangement of the fields in the detail layout.
187
213
  fields: {
188
214
  // [`DetailConfiguration`](#detailconfiguration)
@@ -195,7 +221,10 @@ export default {
195
221
  default: () => []
196
222
  },
197
223
  // The url of the endpoint to which the payload is to be sent. From this url a complete crud (See [this.$mapo.$api.crud](/core/#$api.crud)) will be created.
198
- endpoint: String,
224
+ endpoint: {
225
+ type: String,
226
+ default: null
227
+ },
199
228
  // The identifier of the object you need to retrieve and edit. It can be "new" if you need to create a new payload.
200
229
  identifier: {
201
230
  // `String|Number`.
@@ -247,12 +276,22 @@ export default {
247
276
  }
248
277
  });
249
278
  },
250
- parseConf(field) {
279
+ initLang(lang = this.currentLang) {
280
+ if (lang && !this.model.translations) {
281
+ this.model.translations = {};
282
+ }
283
+ if (lang && !this.model.translations[lang]) {
284
+ this.model.translations[lang] = {};
285
+ }
286
+ },
287
+ parseConf(field, i) {
251
288
  const conf = typeof field === "string" ? { value: field } : field;
252
- conf.value = conf.value.replace(/^translations\..*\./, "");
253
- conf.slotName = `fields.${conf.value}`;
289
+ conf.value = conf.value || "";
290
+ conf.value = conf.value.replace(new RegExp(`^translations\.(${this.languages.join("|")})\.?`), "");
291
+ conf.slotName = `fields.${conf.value || i}`;
254
292
  if (this.currentLang && !field.synci18n) {
255
- conf.value = `translations.${this.currentLang}.${conf.value}`;
293
+ const base = `translations.${this.currentLang}`;
294
+ conf.value = (conf.value && `${base}.${conf.value}`) || base;
256
295
  }
257
296
  return conf;
258
297
  },
@@ -262,20 +301,34 @@ export default {
262
301
  typeof group === "string"
263
302
  ? { name: group, icon }
264
303
  : { ...group, icon: group.icon || icon };
265
- return fields.map(f =>
304
+ return fields.map((f, i) =>
266
305
  f.group
267
306
  ? { group: parseGroup(f.group), fields: this.mapConf(f.fields) }
268
- : this.parseConf(f)
307
+ : this.parseConf(f, i)
269
308
  );
270
309
  }
271
310
  },
272
311
  watch: {
273
312
  currentLang(val) {
274
- if (val && !this.model.translations) {
275
- this.model.translations = {};
313
+ this.initLang();
314
+ // Fired when the current language changes.
315
+ // @arg Emits the language name as a string.
316
+ this.$emit("update:lang", val);
317
+ },
318
+ model(val) {
319
+ // Fired when the v-model changes.
320
+ // @arg Emits the entire payload modified.
321
+ this.$emit("input", val);
322
+ },
323
+ lang(val) {
324
+ if (val && this.langs.includes(val)) {
325
+ this.currentLang = val;
276
326
  }
277
- if (val && !this.model.translations[val]) {
278
- this.model.translations[val] = {};
327
+ },
328
+ value(val) {
329
+ if (val) {
330
+ this.model = val;
331
+ this.initLang();
279
332
  }
280
333
  }
281
334
  },
@@ -331,7 +384,10 @@ export default {
331
384
  },
332
385
  mounted() {
333
386
  if (this.identifier && this.identifier !== "new") {
334
- this.crud.detail(this.identifier).then(res => (this.model = res));
387
+ this.crud.detail(this.identifier).then(res => {
388
+ this.model = res;
389
+ this.initLang();
390
+ });
335
391
  }
336
392
  }
337
393
  };
@@ -446,6 +502,7 @@ export default {
446
502
  "title",
447
503
  { value: "description", type: "textarea" },
448
504
  "permalink",
505
+ { type: "seoPreview" }
449
506
  ]
450
507
  }
451
508
  ],
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <component :is="is" v-model="model" v-bind="fieldProp"></component>
2
+ <component :is="is" v-model="model" v-bind="fieldAttrs"></component>
3
3
  </template>
4
4
 
5
5
  <script>
@@ -8,6 +8,8 @@ import DateField from "@mapomodule/uikit/components/fields/DateField.vue";
8
8
  import M2mField from "@mapomodule/uikit/components/fields/M2mField.vue";
9
9
  import MediaM2mField from "@mapomodule/uikit/components/fields/MediaM2mField.vue";
10
10
  import MediaField from "@mapomodule/uikit/components/fields/MediaField.vue";
11
+ import SeoPreview from "@mapomodule/uikit/components/fields/SeoPreview.vue";
12
+
11
13
 
12
14
  import { getPointed, setPointed } from "@mapomodule/utils/helpers/objHelpers";
13
15
  import defaults from "./defaults";
@@ -22,15 +24,16 @@ export default {
22
24
  DateField,
23
25
  M2mField,
24
26
  MediaM2mField,
25
- MediaField
27
+ MediaField,
28
+ SeoPreview
26
29
  },
27
30
 
28
31
  data() {
29
32
  return {
30
33
  model: null,
31
- fieldsMap: defaults.mapping,
32
- fieldsProps: defaults.props,
33
- fieldsAccess: defaults.accessor
34
+ defaultMap: defaults.mapping,
35
+ defaultAttrs: defaults.props,
36
+ defaultAccess: defaults.accessor
34
37
  };
35
38
  },
36
39
  props: {
@@ -55,8 +58,8 @@ export default {
55
58
  this.setModel(val);
56
59
  }
57
60
  },
58
- conf(newConf, oldConf) {
59
- if (newConf.value !== oldConf.value) {
61
+ "conf.value"(newValue, oldValue) {
62
+ if (newValue !== oldValue) {
60
63
  this.setModel();
61
64
  }
62
65
  },
@@ -90,15 +93,15 @@ export default {
90
93
  return {
91
94
  get: func,
92
95
  set: func,
93
- ...(this.fieldsAccess[this.is] || {}),
96
+ ...(this.defaultAccess[this.is] || {}),
94
97
  ...this.conf.accessor
95
98
  };
96
99
  },
97
- fieldProp() {
100
+ fieldAttrs() {
98
101
  return {
99
102
  label: this.label,
100
103
  errorMessages: getPointed(this.errors || {}, this.conf.value, []),
101
- ...(this.fieldsProps[this.is] || {}),
104
+ ...(this.defaultAttrs[this.is] || {}),
102
105
  ...this.conf.attrs
103
106
  };
104
107
  },
@@ -120,7 +123,7 @@ export default {
120
123
  is() {
121
124
  return (
122
125
  this.conf.is ||
123
- (this.conf.type && this.fieldsMap[this.conf.type]) ||
126
+ (this.conf.type && this.defaultMap[this.conf.type]) ||
124
127
  "v-text-field"
125
128
  );
126
129
  }
@@ -9,7 +9,8 @@ const mapping = {
9
9
  editor: "tiny-mce",
10
10
  media: "media-field",
11
11
  m2m: "m2m-field",
12
- mediaList: "media-m2m-field"
12
+ mediaList: "media-m2m-field",
13
+ seoPreview: "seo-preview"
13
14
  }
14
15
 
15
16
  const props = {
@@ -43,6 +44,10 @@ const accessor = {
43
44
  },
44
45
  "date-field": {
45
46
  get: dateFunc, set: dateFunc
47
+ },
48
+ "seo-preview": {
49
+ get: ({ val }) => ({ title: "", permalink: "", description: "", ...val }),
50
+ set: ({ val }) => ({ title: "", permalink: "", description: "", ...val })
46
51
  }
47
52
  }
48
53
  export default {
@@ -3,7 +3,7 @@
3
3
  <ListHead v-bind="$attrs" />
4
4
 
5
5
  <div>
6
- <v-row class="mb-4">
6
+ <v-row class="mb-1">
7
7
  <v-col cols="12" md="4">
8
8
  <ListActions
9
9
  v-bind="$attrs"
@@ -14,9 +14,22 @@
14
14
  />
15
15
  </v-col>
16
16
  <v-col cols="12" md="8" class="d-flex flex-nowrap justify-end align-center">
17
- <!-- Overrides counter for selected items. -->
17
+ <ListFilters v-bind="$attrs" v-model="filters">
18
+ <template v-for="(_, slot) in $slots" :slot="slot">
19
+ <!-- @vuese-ignore -->
20
+ <slot :name="slot"></slot>
21
+ </template>
22
+ <template v-for="(_, slot) in $scopedSlots" v-slot:[slot]="props">
23
+ <!-- @vuese-ignore -->
24
+ <slot :name="slot" v-bind="props" />
25
+ </template>
26
+ </ListFilters>
27
+ </v-col>
28
+ </v-row>
29
+ <div class="d-flex justify-end">
30
+ <!-- Overrides counter for selected items. -->
18
31
  <slot name="item-counter" v-bind="{ selection, canSelectAll, allSelected, toggleSelectAll }">
19
- <div class="caption mr-1">
32
+ <div v-if="selection" class="caption mr-1 mb-1">
20
33
  <b v-if="allSelected">All items selected</b>
21
34
  <span v-else-if="selection.length">
22
35
  {{ selection.length }} items selected
@@ -32,18 +45,7 @@
32
45
  </span>
33
46
  </div>
34
47
  </slot>
35
- <ListFilters v-bind="$attrs" v-model="filters">
36
- <template v-for="(_, slot) in $slots" :slot="slot">
37
- <!-- @vuese-ignore -->
38
- <slot :name="slot"></slot>
39
- </template>
40
- <template v-for="(_, slot) in $scopedSlots" v-slot:[slot]="props">
41
- <!-- @vuese-ignore -->
42
- <slot :name="slot" v-bind="props" />
43
- </template>
44
- </ListFilters>
45
- </v-col>
46
- </v-row>
48
+ </div>
47
49
  </div>
48
50
  <div>
49
51
  <ListTable
@@ -86,8 +88,7 @@ export default {
86
88
  props: {
87
89
  // The url of the endpoint that provides the data to display. From this url a complete crud (See [this.$mapo.$api.crud](/core/#$api.crud)) will be created.
88
90
  endpoint: {
89
- type: String,
90
- required: true,
91
+ type: String
91
92
  },
92
93
  // Add option to select all items in all pages
93
94
  canSelectAll: Boolean,
@@ -156,20 +157,25 @@ This is an interactive example. You can play with it but remember that all http
156
157
 
157
158
  ::: demo
158
159
  <template>
159
- <v-app >
160
- <List
160
+ <v-app>
161
+ <List
161
162
  show-select
163
+ title="Sweets archive:"
164
+ lookup="name"
162
165
  :headers="headers"
163
166
  :editFields="editFields"
164
167
  :filters="availableFilters"
165
- endpoint="api/camomilla/articles"
166
- title="List Example"
167
- addItem
168
- canSelectAll
168
+ multi-sort
169
+ can-select-all
169
170
  searchable
170
- >
171
- </List>
172
- </v-app>
171
+ :data.sync="desserts"
172
+ :actions="[]"
173
+ >
174
+ </List>
175
+ <br>
176
+ <h3> Data: </h3>
177
+ <pre>{{ desserts }}</pre>
178
+ </v-app>
173
179
  </template>
174
180
 
175
181
  <script>
@@ -178,37 +184,66 @@ export default {
178
184
  return {
179
185
  headers: [
180
186
  {
181
- text: "ID",
187
+ text: "Dessert (100g serving)",
182
188
  align: "start",
183
189
  sortable: false,
184
- value: "id",
190
+ value: "name",
185
191
  },
186
- { text: "Title", value: "title" },
187
- { text: "Identifier", value: "identifier" },
192
+ { text: "Protein (g)", value: "protein" },
193
+ { text: "Gluten-Free", value: "glutenfree" },
188
194
  { text: "Actions", value: "actions", sortable: false },
189
195
  ],
190
196
  editFields: [
191
- { attrs: { rules:[v => !!v || 'Title is required'] }, value: "title" },
192
- { attrs: { rules:[v => !!v || 'Permalink is required'] }, value: "permalink" },
193
- { attrs: { rules:[v => !!v || 'Identifier is required'] }, value: "identifier" },
197
+ { attrs: { rules: [(v) => !!v || "Name is required"] }, value: "name" },
198
+ { value: "protein" }
194
199
  ],
195
200
  availableFilters: [
196
201
  {
197
- text: "Status",
198
- value: "status",
202
+ text: "Gluten Free",
203
+ value: "glutenfree",
199
204
  choices: [
200
- { text: "Draft", value: "DRF" },
201
- { text: "Published", value: "PUB" },
202
- { text: "Trash", value: "TRS" },
205
+ { text: "Yes", value: true },
206
+ { text: "No", value: false },
203
207
  ],
204
208
  },
209
+ ],
210
+ desserts: [
211
+ {
212
+ name: "Frozen Yogurt",
213
+ protein: 4.0,
214
+ glutenfree: true,
215
+ },
216
+ {
217
+ name: "Ice cream sandwich",
218
+ protein: 4.3,
219
+ glutenfree: false,
220
+ },
205
221
  {
206
- text: "Date",
207
- value: "date",
208
- datepicker: true
222
+ name: "Eclair",
223
+ protein: 6.0,
224
+ glutenfree: false,
225
+ },
226
+ {
227
+ name: "Jelly bean",
228
+ protein: 0.0,
229
+ glutenfree: true,
230
+ },
231
+ {
232
+ name: "Lollipop",
233
+ protein: 0,
234
+ glutenfree: true,
235
+ },
236
+ {
237
+ name: "KitKat",
238
+ protein: 7,
239
+ glutenfree: false,
240
+ },
241
+ {
242
+ name: "KitKat2",
243
+ protein: 77,
244
+ glutenfree: false,
209
245
  },
210
246
  ],
211
-
212
247
  };
213
248
  },
214
249
  };
@@ -51,7 +51,7 @@ export default {
51
51
  {
52
52
  label: "Permanent delete",
53
53
  handler: function ({ selection, lookup, crud }) {
54
- return Promise.all(selection.map((i) => crud.delete(i[lookup])));
54
+ return Promise.all(selection.map((i) => crud && crud.delete(i[lookup])));
55
55
  },
56
56
  },
57
57
  ];