@znap/components-vue2 1.0.8 → 1.0.9

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.
@@ -49191,6 +49191,7 @@ class CrudViewConfigs {
49191
49191
  const optionsPromises = [];
49192
49192
  tableOptions.forEach(option => {
49193
49193
  if (!option?.endpoint[0]) return optionsPromises.push(null);
49194
+ if (option?.ignoreOnFetchFunction) return optionsPromises.push(null);
49194
49195
  optionsPromises.push(httpFetcher.post(option.endpoint[0], option.endpoint[1] ?? null));
49195
49196
  });
49196
49197
  const optionsData = await Promise.all(optionsPromises);
@@ -49202,6 +49203,7 @@ class CrudViewConfigs {
49202
49203
  const optionsPromises = [];
49203
49204
  formOptions.forEach(option => {
49204
49205
  option.loading = true;
49206
+ if (option?.ignoreOnFetchFunction) return optionsPromises.push(null);
49205
49207
  optionsPromises.push(httpFetcher.post(option.endpoint[0], option.endpoint[1] ?? null));
49206
49208
  });
49207
49209
  const optionsData = await Promise.all(optionsPromises);
@@ -49213,12 +49215,14 @@ class CrudViewConfigs {
49213
49215
  async fetchFiltersData(filters, httpFetcher) {
49214
49216
  const primaryFiltersPromises = filters?.primary.flatMap(async (filter, index) => {
49215
49217
  if (!filter.endpoint?.length || !filter.endpoint[0]) return [index, null];
49218
+ if (filter.ignoreOnFetchFunction) return [index, null];
49216
49219
  filter.props.loading = true;
49217
49220
  const response = await httpFetcher.post(filter.endpoint[0], filter.endpoint[1] ?? {});
49218
49221
  return [index, response?.data];
49219
49222
  }) ?? [];
49220
49223
  const secondaryFiltersPromises = filters?.secondary?.flatMap(async (filter, index) => {
49221
49224
  if (!filter.endpoint?.length || !filter.endpoint[0]) return [index, null];
49225
+ if (filter.ignoreOnFetchFunction) return [index, null];
49222
49226
  filter.props.loading = true;
49223
49227
  const response = await httpFetcher.post(filter.endpoint[0], filter.endpoint[1] ?? {});
49224
49228
  return [index, response?.data];
@@ -49271,7 +49275,8 @@ class CrudViewConfigs {
49271
49275
  endpoint = [],
49272
49276
  componentProps = {},
49273
49277
  hooks = {},
49274
- dependsOn = ""
49278
+ dependsOn = "",
49279
+ ignoreOnFetchFunction = false
49275
49280
  } = {}) {
49276
49281
  if (!this.avalibleFilterComponents.has(filterComponent)) throw new Error("O componente escolhido para o filtro não é um componente valido!");
49277
49282
  const hooksKeys = Object.keys(hooks);
@@ -49291,7 +49296,8 @@ class CrudViewConfigs {
49291
49296
  returnObject: false,
49292
49297
  ...componentProps
49293
49298
  },
49294
- hooks
49299
+ hooks,
49300
+ ignoreOnFetchFunction
49295
49301
  });
49296
49302
  return this;
49297
49303
  }
@@ -49315,7 +49321,8 @@ class CrudViewConfigs {
49315
49321
  endpoint = [],
49316
49322
  componentProps = {},
49317
49323
  hooks = {},
49318
- dependsOn = ""
49324
+ dependsOn = "",
49325
+ ignoreOnFetchFunction = false
49319
49326
  } = {}) {
49320
49327
  if (!this.avalibleFilterComponents.has(filterComponent)) throw new Error("O componente escolhido para o filtro não é um componente valido!");
49321
49328
  const hooksKeys = Object.keys(hooks);
@@ -49335,7 +49342,8 @@ class CrudViewConfigs {
49335
49342
  ...componentProps
49336
49343
  },
49337
49344
  dependsOn,
49338
- hooks
49345
+ hooks,
49346
+ ignoreOnFetchFunction
49339
49347
  });
49340
49348
  return this;
49341
49349
  }
@@ -49348,14 +49356,16 @@ class CrudViewConfigs {
49348
49356
  itemsArray = [],
49349
49357
  endpoint = [],
49350
49358
  formatter = null,
49351
- filterFunction = null
49359
+ filterFunction = null,
49360
+ ignoreOnFetchFunction = false
49352
49361
  } = {}) {
49353
49362
  this.tableOptions.push({
49354
49363
  column: this.isValidColumn(column) ? column : "",
49355
49364
  endpoint: this.isValidEndpoint(endpoint) ? endpoint : CrudViewConfigs.generateEndpoint(),
49356
49365
  items: this.isValidItemsArray(itemsArray) ? itemsArray : [],
49357
49366
  formatter,
49358
- filterFunction
49367
+ filterFunction,
49368
+ ignoreOnFetchFunction
49359
49369
  });
49360
49370
  return this;
49361
49371
  }