@sd-angular/core 1.3.208 → 1.3.210

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 (35) hide show
  1. package/bundles/sd-angular-core-chip.umd.js +1 -1
  2. package/bundles/sd-angular-core-chip.umd.js.map +1 -1
  3. package/bundles/sd-angular-core-chip.umd.min.js +2 -2
  4. package/bundles/sd-angular-core-chip.umd.min.js.map +1 -1
  5. package/bundles/sd-angular-core-export.umd.js +1 -1
  6. package/bundles/sd-angular-core-export.umd.js.map +1 -1
  7. package/bundles/sd-angular-core-export.umd.min.js +1 -1
  8. package/bundles/sd-angular-core-export.umd.min.js.map +1 -1
  9. package/bundles/sd-angular-core-grid-material.umd.js +10 -0
  10. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  11. package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
  12. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  13. package/bundles/sd-angular-core-table.umd.js +42 -13
  14. package/bundles/sd-angular-core-table.umd.js.map +1 -1
  15. package/bundles/sd-angular-core-table.umd.min.js +1 -1
  16. package/bundles/sd-angular-core-table.umd.min.js.map +1 -1
  17. package/chip/sd-angular-core-chip.metadata.json +1 -1
  18. package/esm2015/chip/src/lib/chip.component.js +2 -2
  19. package/esm2015/export/src/lib/export.service.js +2 -2
  20. package/esm2015/grid-material/src/lib/models/grid-column.model.js +11 -1
  21. package/esm2015/table/src/lib/models/table-column.model.js +11 -1
  22. package/esm2015/table/src/lib/services/table-configuration.service.js +33 -14
  23. package/fesm2015/sd-angular-core-chip.js +1 -1
  24. package/fesm2015/sd-angular-core-chip.js.map +1 -1
  25. package/fesm2015/sd-angular-core-export.js +1 -1
  26. package/fesm2015/sd-angular-core-export.js.map +1 -1
  27. package/fesm2015/sd-angular-core-grid-material.js +10 -0
  28. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  29. package/fesm2015/sd-angular-core-table.js +42 -13
  30. package/fesm2015/sd-angular-core-table.js.map +1 -1
  31. package/grid-material/src/lib/models/grid-column.model.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/{sd-angular-core-1.3.208.tgz → sd-angular-core-1.3.210.tgz} +0 -0
  34. package/table/src/lib/models/table-column.model.d.ts +1 -1
  35. package/table/src/lib/services/table-configuration.service.d.ts +2 -2
@@ -290,23 +290,26 @@ class SdTableConfigurationService {
290
290
  GROUP: 'sdGroup',
291
291
  });
292
292
  _prefix.set(this, 'c9e94836-6ace-4aeb-b148-4f0be63589ee');
293
- _getSetting.set(this, (gridOption) => {
294
- if (!(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
293
+ _getSetting.set(this, (option) => {
294
+ // Nếu không key thì không lấy được setting
295
+ if (!(option === null || option === void 0 ? void 0 : option.key)) {
295
296
  return null;
296
297
  }
297
- return this.settingService.create({ prefix: __classPrivateFieldGet(this, _prefix), key: gridOption.key }, {
298
- default: __classPrivateFieldGet(this, _default).call(this, gridOption),
298
+ // Key của setting là tổ hợp từ key truyền vào và prefix để tránh chung key với các tính năng khác cũng dùng key trong core table
299
+ return this.settingService.create({ prefix: __classPrivateFieldGet(this, _prefix), key: option.key }, {
300
+ default: __classPrivateFieldGet(this, _default).call(this, option),
299
301
  });
300
302
  });
301
- this.loadConfiguration = (gridOption) => {
302
- if (!(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
303
- return __classPrivateFieldGet(this, _default).call(this, gridOption);
303
+ this.loadConfiguration = (option) => {
304
+ // Nếu không key thì trả về thông tin mặc định
305
+ if (!(option === null || option === void 0 ? void 0 : option.key)) {
306
+ return __classPrivateFieldGet(this, _default).call(this, option);
304
307
  }
305
- const setting = __classPrivateFieldGet(this, _getSetting).call(this, gridOption);
308
+ const setting = __classPrivateFieldGet(this, _getSetting).call(this, option);
306
309
  return setting.get();
307
310
  };
308
- this.loadConfigurationResult = (gridOption, configuration) => {
309
- var _a, _b;
311
+ this.loadConfigurationResult = (option, configuration) => {
312
+ var _a, _b, _c;
310
313
  const result = {
311
314
  column: {},
312
315
  fixedColumn: {},
@@ -318,7 +321,7 @@ class SdTableConfigurationService {
318
321
  displayedFooters: [],
319
322
  multipleHeader: false,
320
323
  };
321
- const { selector, commands, group } = gridOption || {};
324
+ const { selector, commands, group } = option || {};
322
325
  if (selector === null || selector === void 0 ? void 0 : selector.visible) {
323
326
  result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).SELECTION);
324
327
  result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).SELECTION);
@@ -333,7 +336,9 @@ class SdTableConfigurationService {
333
336
  }
334
337
  (_b = configuration === null || configuration === void 0 ? void 0 : configuration.columns) === null || _b === void 0 ? void 0 : _b.filter(col => !col.invisible).forEach(col => {
335
338
  var _a;
336
- const column = gridOption === null || gridOption === void 0 ? void 0 : gridOption.columns.find(e => e.field === col.origin.field);
339
+ // Kiểm tra column trong config còn được khai báo trong option
340
+ // Nếu không thì ẩn column đó đi
341
+ const column = option === null || option === void 0 ? void 0 : option.columns.find(e => e.field === col.origin.field);
337
342
  if (column) {
338
343
  result.column[col.origin.field] = {
339
344
  title: col.title || col.origin.title,
@@ -357,7 +362,21 @@ class SdTableConfigurationService {
357
362
  }
358
363
  }
359
364
  });
360
- if (gridOption.expand) {
365
+ // Nếu có thêm các column mới, chèn các column đó vào cuối
366
+ (_c = option === null || option === void 0 ? void 0 : option.columns) === null || _c === void 0 ? void 0 : _c.filter(column => { var _a; return !((_a = configuration === null || configuration === void 0 ? void 0 : configuration.columns) === null || _a === void 0 ? void 0 : _a.some(e => e.origin.field === column.field)); }).forEach(column => {
367
+ var _a;
368
+ result.firstColumns.push(Object.assign(Object.assign({}, column), { title: column.title, width: column.width }));
369
+ result.firstHeaders.push(column.field);
370
+ result.displayedColumns.push(column.field);
371
+ if (column.type === 'children') {
372
+ (_a = column.children) === null || _a === void 0 ? void 0 : _a.forEach(childColumn => {
373
+ result.secondColumns.push(childColumn);
374
+ result.secondHeaders.push(childColumn.field);
375
+ result.displayedColumns.push(childColumn.field);
376
+ });
377
+ }
378
+ });
379
+ if (option.expand) {
361
380
  result.firstHeaders.push(__classPrivateFieldGet(this, _COLUMNS).SUBINFORMATION);
362
381
  result.displayedColumns.push(__classPrivateFieldGet(this, _COLUMNS).SUBINFORMATION);
363
382
  }
@@ -2197,6 +2216,16 @@ const SdFilterOperators = [
2197
2216
  symbol: 'event_list',
2198
2217
  display: 'Không nằm trong',
2199
2218
  },
2219
+ {
2220
+ value: 'NULL',
2221
+ symbol: 'motion_photos_off',
2222
+ display: 'Là rỗng',
2223
+ },
2224
+ {
2225
+ value: 'NOT_NULL',
2226
+ symbol: 'adjust',
2227
+ display: 'Không rỗng',
2228
+ },
2200
2229
  ];
2201
2230
 
2202
2231
  var _inlineOperator_1, _valueChanges, _subcription;