@sd-angular/core 0.0.1004 → 0.0.1008

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 (187) hide show
  1. package/autocomplete/sd-angular-core-autocomplete.metadata.json +1 -1
  2. package/autocomplete/src/lib/autocomplete.component.d.ts +9 -5
  3. package/bundles/sd-angular-core-api.umd.js +29 -12
  4. package/bundles/sd-angular-core-api.umd.js.map +1 -1
  5. package/bundles/sd-angular-core-api.umd.min.js +1 -1
  6. package/bundles/sd-angular-core-api.umd.min.js.map +1 -1
  7. package/bundles/sd-angular-core-autocomplete.umd.js +65 -42
  8. package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
  9. package/bundles/sd-angular-core-autocomplete.umd.min.js +2 -2
  10. package/bundles/sd-angular-core-autocomplete.umd.min.js.map +1 -1
  11. package/bundles/sd-angular-core-button.umd.js +29 -12
  12. package/bundles/sd-angular-core-button.umd.js.map +1 -1
  13. package/bundles/sd-angular-core-button.umd.min.js +1 -1
  14. package/bundles/sd-angular-core-button.umd.min.js.map +1 -1
  15. package/bundles/sd-angular-core-cache.umd.js +29 -12
  16. package/bundles/sd-angular-core-cache.umd.js.map +1 -1
  17. package/bundles/sd-angular-core-cache.umd.min.js +2 -2
  18. package/bundles/sd-angular-core-cache.umd.min.js.map +1 -1
  19. package/bundles/sd-angular-core-chart.umd.js +29 -12
  20. package/bundles/sd-angular-core-chart.umd.js.map +1 -1
  21. package/bundles/sd-angular-core-chart.umd.min.js.map +1 -1
  22. package/bundles/sd-angular-core-checkbox.umd.js +29 -12
  23. package/bundles/sd-angular-core-checkbox.umd.js.map +1 -1
  24. package/bundles/sd-angular-core-checkbox.umd.min.js +1 -1
  25. package/bundles/sd-angular-core-checkbox.umd.min.js.map +1 -1
  26. package/bundles/sd-angular-core-chip.umd.js +29 -12
  27. package/bundles/sd-angular-core-chip.umd.js.map +1 -1
  28. package/bundles/sd-angular-core-chip.umd.min.js +1 -1
  29. package/bundles/sd-angular-core-chip.umd.min.js.map +1 -1
  30. package/bundles/sd-angular-core-comment.umd.js +446 -0
  31. package/bundles/sd-angular-core-comment.umd.js.map +1 -0
  32. package/bundles/sd-angular-core-comment.umd.min.js +16 -0
  33. package/bundles/sd-angular-core-comment.umd.min.js.map +1 -0
  34. package/bundles/sd-angular-core-common.umd.js +71 -16
  35. package/bundles/sd-angular-core-common.umd.js.map +1 -1
  36. package/bundles/sd-angular-core-common.umd.min.js +3 -2
  37. package/bundles/sd-angular-core-common.umd.min.js.map +1 -1
  38. package/bundles/sd-angular-core-date-range.umd.js +29 -12
  39. package/bundles/sd-angular-core-date-range.umd.js.map +1 -1
  40. package/bundles/sd-angular-core-date-range.umd.min.js +2 -2
  41. package/bundles/sd-angular-core-date-range.umd.min.js.map +1 -1
  42. package/bundles/sd-angular-core-date-time.umd.js +29 -12
  43. package/bundles/sd-angular-core-date-time.umd.js.map +1 -1
  44. package/bundles/sd-angular-core-date-time.umd.min.js +2 -2
  45. package/bundles/sd-angular-core-date-time.umd.min.js.map +1 -1
  46. package/bundles/sd-angular-core-editor.umd.js +29 -12
  47. package/bundles/sd-angular-core-editor.umd.js.map +1 -1
  48. package/bundles/sd-angular-core-editor.umd.min.js +1 -1
  49. package/bundles/sd-angular-core-editor.umd.min.js.map +1 -1
  50. package/bundles/sd-angular-core-excel.umd.js +29 -12
  51. package/bundles/sd-angular-core-excel.umd.js.map +1 -1
  52. package/bundles/sd-angular-core-excel.umd.min.js.map +1 -1
  53. package/bundles/sd-angular-core-export.umd.js +29 -12
  54. package/bundles/sd-angular-core-export.umd.js.map +1 -1
  55. package/bundles/sd-angular-core-export.umd.min.js +1 -1
  56. package/bundles/sd-angular-core-export.umd.min.js.map +1 -1
  57. package/bundles/sd-angular-core-grid-material.umd.js +31 -12
  58. package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
  59. package/bundles/sd-angular-core-grid-material.umd.min.js +1 -1
  60. package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
  61. package/bundles/sd-angular-core-grid.umd.js +29 -12
  62. package/bundles/sd-angular-core-grid.umd.js.map +1 -1
  63. package/bundles/sd-angular-core-grid.umd.min.js +1 -1
  64. package/bundles/sd-angular-core-grid.umd.min.js.map +1 -1
  65. package/bundles/sd-angular-core-input-currency.umd.js +29 -12
  66. package/bundles/sd-angular-core-input-currency.umd.js.map +1 -1
  67. package/bundles/sd-angular-core-input-currency.umd.min.js +2 -2
  68. package/bundles/sd-angular-core-input-currency.umd.min.js.map +1 -1
  69. package/bundles/sd-angular-core-input-dropdown.umd.js +29 -12
  70. package/bundles/sd-angular-core-input-dropdown.umd.js.map +1 -1
  71. package/bundles/sd-angular-core-input-dropdown.umd.min.js +1 -1
  72. package/bundles/sd-angular-core-input-dropdown.umd.min.js.map +1 -1
  73. package/bundles/sd-angular-core-input-upload-file.umd.js +29 -12
  74. package/bundles/sd-angular-core-input-upload-file.umd.js.map +1 -1
  75. package/bundles/sd-angular-core-input-upload-file.umd.min.js +2 -2
  76. package/bundles/sd-angular-core-input-upload-file.umd.min.js.map +1 -1
  77. package/bundles/sd-angular-core-input.umd.js +54 -17
  78. package/bundles/sd-angular-core-input.umd.js.map +1 -1
  79. package/bundles/sd-angular-core-input.umd.min.js +2 -2
  80. package/bundles/sd-angular-core-input.umd.min.js.map +1 -1
  81. package/bundles/sd-angular-core-konva.umd.js +29 -12
  82. package/bundles/sd-angular-core-konva.umd.js.map +1 -1
  83. package/bundles/sd-angular-core-konva.umd.min.js +1 -1
  84. package/bundles/sd-angular-core-konva.umd.min.js.map +1 -1
  85. package/bundles/sd-angular-core-radio.umd.js +29 -12
  86. package/bundles/sd-angular-core-radio.umd.js.map +1 -1
  87. package/bundles/sd-angular-core-radio.umd.min.js +1 -1
  88. package/bundles/sd-angular-core-radio.umd.min.js.map +1 -1
  89. package/bundles/sd-angular-core-select-editor.umd.js +29 -12
  90. package/bundles/sd-angular-core-select-editor.umd.js.map +1 -1
  91. package/bundles/sd-angular-core-select-editor.umd.min.js +2 -2
  92. package/bundles/sd-angular-core-select-editor.umd.min.js.map +1 -1
  93. package/bundles/sd-angular-core-select.umd.js +162 -135
  94. package/bundles/sd-angular-core-select.umd.js.map +1 -1
  95. package/bundles/sd-angular-core-select.umd.min.js +2 -2
  96. package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
  97. package/bundles/sd-angular-core-setting.umd.js +29 -12
  98. package/bundles/sd-angular-core-setting.umd.js.map +1 -1
  99. package/bundles/sd-angular-core-setting.umd.min.js +1 -1
  100. package/bundles/sd-angular-core-setting.umd.min.js.map +1 -1
  101. package/bundles/sd-angular-core-side-drawer.umd.js +29 -12
  102. package/bundles/sd-angular-core-side-drawer.umd.js.map +1 -1
  103. package/bundles/sd-angular-core-side-drawer.umd.min.js +2 -2
  104. package/bundles/sd-angular-core-side-drawer.umd.min.js.map +1 -1
  105. package/bundles/sd-angular-core-switch.umd.js +29 -12
  106. package/bundles/sd-angular-core-switch.umd.js.map +1 -1
  107. package/bundles/sd-angular-core-switch.umd.min.js +2 -2
  108. package/bundles/sd-angular-core-switch.umd.min.js.map +1 -1
  109. package/bundles/sd-angular-core-tab-router.umd.js +29 -12
  110. package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
  111. package/bundles/sd-angular-core-tab-router.umd.min.js +2 -2
  112. package/bundles/sd-angular-core-tab-router.umd.min.js.map +1 -1
  113. package/bundles/sd-angular-core-textarea.umd.js +29 -12
  114. package/bundles/sd-angular-core-textarea.umd.js.map +1 -1
  115. package/bundles/sd-angular-core-textarea.umd.min.js +2 -2
  116. package/bundles/sd-angular-core-textarea.umd.min.js.map +1 -1
  117. package/bundles/sd-angular-core-time.umd.js +29 -12
  118. package/bundles/sd-angular-core-time.umd.js.map +1 -1
  119. package/bundles/sd-angular-core-time.umd.min.js +2 -2
  120. package/bundles/sd-angular-core-time.umd.min.js.map +1 -1
  121. package/bundles/sd-angular-core-upload-excel.umd.js +29 -12
  122. package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
  123. package/bundles/sd-angular-core-upload-excel.umd.min.js +1 -1
  124. package/bundles/sd-angular-core-upload-excel.umd.min.js.map +1 -1
  125. package/bundles/sd-angular-core-upload-file.umd.js +29 -12
  126. package/bundles/sd-angular-core-upload-file.umd.js.map +1 -1
  127. package/bundles/sd-angular-core-upload-file.umd.min.js +2 -2
  128. package/bundles/sd-angular-core-upload-file.umd.min.js.map +1 -1
  129. package/bundles/sd-angular-core-utility.umd.js +29 -12
  130. package/bundles/sd-angular-core-utility.umd.js.map +1 -1
  131. package/bundles/sd-angular-core-utility.umd.min.js +1 -1
  132. package/bundles/sd-angular-core-utility.umd.min.js.map +1 -1
  133. package/bundles/sd-angular-core.umd.js +33 -16
  134. package/bundles/sd-angular-core.umd.js.map +1 -1
  135. package/bundles/sd-angular-core.umd.min.js +1 -1
  136. package/bundles/sd-angular-core.umd.min.js.map +1 -1
  137. package/comment/index.d.ts +1 -0
  138. package/comment/package.json +12 -0
  139. package/comment/sd-angular-core-comment.d.ts +4 -0
  140. package/comment/sd-angular-core-comment.metadata.json +1 -0
  141. package/comment/src/lib/comment.component.d.ts +17 -0
  142. package/comment/src/lib/comment.model.d.ts +21 -0
  143. package/comment/src/lib/comment.module.d.ts +2 -0
  144. package/comment/src/public-api.d.ts +3 -0
  145. package/common/sd-angular-core-common.metadata.json +1 -1
  146. package/common/src/lib/common.module.d.ts +2 -0
  147. package/common/src/lib/directives/view-def.directive.d.ts +5 -0
  148. package/common/src/public-api.d.ts +2 -0
  149. package/esm2015/autocomplete/src/lib/autocomplete.component.js +35 -26
  150. package/esm2015/autocomplete/src/lib/autocomplete.module.js +6 -3
  151. package/esm2015/comment/index.js +2 -0
  152. package/esm2015/comment/sd-angular-core-comment.js +5 -0
  153. package/esm2015/comment/src/lib/comment.component.js +60 -0
  154. package/esm2015/comment/src/lib/comment.model.js +2 -0
  155. package/esm2015/comment/src/lib/comment.module.js +37 -0
  156. package/esm2015/comment/src/public-api.js +7 -0
  157. package/esm2015/common/src/lib/common.module.js +20 -0
  158. package/esm2015/common/src/lib/directives/view-def.directive.js +16 -0
  159. package/esm2015/common/src/public-api.js +3 -1
  160. package/esm2015/grid-material/src/lib/pipes/selection-disable.pipe.js +2 -1
  161. package/esm2015/grid-material/src/lib/pipes/selection-visible.pipe.js +2 -1
  162. package/esm2015/input/src/lib/input.component.js +23 -4
  163. package/esm2015/input/src/lib/input.module.js +6 -3
  164. package/esm2015/public-api.js +2 -1
  165. package/esm2015/select/src/lib/select.component.js +72 -72
  166. package/esm2015/select/src/lib/select.module.js +6 -3
  167. package/fesm2015/sd-angular-core-autocomplete.js +37 -27
  168. package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
  169. package/fesm2015/sd-angular-core-comment.js +106 -0
  170. package/fesm2015/sd-angular-core-comment.js.map +1 -0
  171. package/fesm2015/sd-angular-core-common.js +35 -1
  172. package/fesm2015/sd-angular-core-common.js.map +1 -1
  173. package/fesm2015/sd-angular-core-grid-material.js +2 -0
  174. package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
  175. package/fesm2015/sd-angular-core-input.js +26 -6
  176. package/fesm2015/sd-angular-core-input.js.map +1 -1
  177. package/fesm2015/sd-angular-core-select.js +75 -73
  178. package/fesm2015/sd-angular-core-select.js.map +1 -1
  179. package/fesm2015/sd-angular-core.js +1 -0
  180. package/fesm2015/sd-angular-core.js.map +1 -1
  181. package/input/sd-angular-core-input.metadata.json +1 -1
  182. package/input/src/lib/input.component.d.ts +5 -0
  183. package/package.json +1 -1
  184. package/public-api.d.ts +1 -0
  185. package/{sd-angular-core-0.0.1004.tgz → sd-angular-core-0.0.1008.tgz} +0 -0
  186. package/select/sd-angular-core-select.metadata.json +1 -1
  187. package/select/src/lib/select.component.d.ts +11 -5
@@ -28,6 +28,8 @@
28
28
  return extendStatics(d, b);
29
29
  };
30
30
  function __extends(d, b) {
31
+ if (typeof b !== "function" && b !== null)
32
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
33
  extendStatics(d, b);
32
34
  function __() { this.constructor = d; }
33
35
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -213,11 +215,13 @@
213
215
  }
214
216
  return ar;
215
217
  }
218
+ /** @deprecated */
216
219
  function __spread() {
217
220
  for (var ar = [], i = 0; i < arguments.length; i++)
218
221
  ar = ar.concat(__read(arguments[i]));
219
222
  return ar;
220
223
  }
224
+ /** @deprecated */
221
225
  function __spreadArrays() {
222
226
  for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
227
  s += arguments[i].length;
@@ -226,7 +230,17 @@
226
230
  r[k] = a[j];
227
231
  return r;
228
232
  }
229
- ;
233
+ function __spreadArray(to, from, pack) {
234
+ if (pack || arguments.length === 2)
235
+ for (var i = 0, l = from.length, ar; i < l; i++) {
236
+ if (ar || !(i in from)) {
237
+ if (!ar)
238
+ ar = Array.prototype.slice.call(from, 0, i);
239
+ ar[i] = from[i];
240
+ }
241
+ }
242
+ return to.concat(ar || Array.prototype.slice.call(from));
243
+ }
230
244
  function __await(v) {
231
245
  return this instanceof __await ? (this.v = v, this) : new __await(v);
232
246
  }
@@ -291,18 +305,21 @@
291
305
  function __importDefault(mod) {
292
306
  return (mod && mod.__esModule) ? mod : { default: mod };
293
307
  }
294
- function __classPrivateFieldGet(receiver, privateMap) {
295
- if (!privateMap.has(receiver)) {
296
- throw new TypeError("attempted to get private field on non-instance");
297
- }
298
- return privateMap.get(receiver);
308
+ function __classPrivateFieldGet(receiver, state, kind, f) {
309
+ if (kind === "a" && !f)
310
+ throw new TypeError("Private accessor was defined without a getter");
311
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
312
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
313
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
299
314
  }
300
- function __classPrivateFieldSet(receiver, privateMap, value) {
301
- if (!privateMap.has(receiver)) {
302
- throw new TypeError("attempted to set private field on non-instance");
303
- }
304
- privateMap.set(receiver, value);
305
- return value;
315
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
316
+ if (kind === "m")
317
+ throw new TypeError("Private method is not writable");
318
+ if (kind === "a" && !f)
319
+ throw new TypeError("Private accessor was defined without a setter");
320
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
321
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
322
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
306
323
  }
307
324
 
308
325
  var SdSelectDisplayDefDirective = /** @class */ (function () {
@@ -320,7 +337,7 @@
320
337
  { type: core.TemplateRef }
321
338
  ]; };
322
339
 
323
- var _input, _name, _form, _items, _currentItems, _allItem, _delay, _validator, _allItems, _subscription, _updateValidator, _search, _loadItems, _onChange, _customValidator;
340
+ var _input, _name, _form, _items, _delay, _validator, _subscription, _selectedItems, _allItems, _allItem, _updateValidator, _loadSelectedItems, _loadItems, _onChange, _customValidator;
324
341
  var SdSelect = /** @class */ (function () {
325
342
  function SdSelect(ref, utilityService) {
326
343
  var _this = this;
@@ -334,8 +351,6 @@
334
351
  _form.set(this, void 0);
335
352
  // Items
336
353
  _items.set(this, []);
337
- _currentItems.set(this, []);
338
- _allItem.set(this, {});
339
354
  // Server search
340
355
  this.loading = false;
341
356
  _delay.set(this, 500); // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm
@@ -346,12 +361,15 @@
346
361
  this.limit = 100;
347
362
  this.filtered = false;
348
363
  this.selectAll = false;
349
- _allItems.set(this, void 0);
350
- this.allSelected = false;
351
364
  this.modelChange = new core.EventEmitter();
352
365
  this.sdChange = new core.EventEmitter();
353
366
  this.sdSelection = new core.EventEmitter();
354
367
  _subscription.set(this, new rxjs.Subscription());
368
+ _selectedItems.set(this, void 0);
369
+ _allItems.set(this, void 0);
370
+ _allItem.set(this, {});
371
+ this.allSelected = false;
372
+ this.isFocused = false;
355
373
  _updateValidator.set(this, function () {
356
374
  _this.formControl.clearValidators();
357
375
  _this.formControl.clearAsyncValidators();
@@ -367,23 +385,36 @@
367
385
  _this.formControl.setAsyncValidators(asyncValidators);
368
386
  _this.formControl.updateValueAndValidity();
369
387
  });
370
- _search.set(this, function (value, items) { return __awaiter(_this, void 0, void 0, function () {
371
- var results;
388
+ _loadSelectedItems.set(this, function (value, items) { return __awaiter(_this, void 0, void 0, function () {
389
+ var values, results, objItem_1;
372
390
  var _this = this;
373
391
  return __generator(this, function (_c) {
374
392
  switch (_c.label) {
375
- case 0: return [4 /*yield*/, items(value).catch(function () { return []; })];
393
+ case 0:
394
+ if (!(value === null || value === void 0 ? void 0 : value.toString())) {
395
+ return [2 /*return*/, []];
396
+ }
397
+ values = Array.isArray(value) ? value : [value];
398
+ if (!this.valueField && !this.displayField) {
399
+ return [2 /*return*/, values];
400
+ }
401
+ this.loading = true;
402
+ if (!values.some(function (val) { return __classPrivateFieldGet(_this, _allItem)[val] === undefined; })) return [3 /*break*/, 2];
403
+ return [4 /*yield*/, items(value, true).finally(function () { return _this.loading = false; })];
376
404
  case 1:
377
405
  results = _c.sent();
378
- if (Array.isArray(value)) {
379
- return [2 /*return*/, results.filter(function (e) { return !!e && (value.includes(e) || value.includes(e[_this.valueField])); })];
380
- }
381
- return [2 /*return*/, results.filter(function (e) { return !!e && (e === value || e[_this.valueField] === value); })];
406
+ objItem_1 = this.valueField ? this.utilityService.arrayToObject(results, this.valueField) : results.forEach(function (item) { return objItem_1[item === null || item === void 0 ? void 0 : item.toString()] = item; });
407
+ __classPrivateFieldSet(this, _allItem, Object.assign(Object.assign(Object.assign({}, values.map(function (val) {
408
+ var _c, _d;
409
+ return (_c = {}, _c[val] = (_d = {}, _d[_this.valueField] = val, _d[_this.displayField] = val, _d), _c);
410
+ })), __classPrivateFieldGet(this, _allItem)), objItem_1));
411
+ _c.label = 2;
412
+ case 2: return [2 /*return*/, values.map(function (val) { return __classPrivateFieldGet(_this, _allItem)[val]; })];
382
413
  }
383
414
  });
384
415
  }); });
385
416
  _loadItems.set(this, function (searchText, items) { return __awaiter(_this, void 0, void 0, function () {
386
- var _a, results, objItem, values;
417
+ var results, objItem, selectedItems;
387
418
  var _this = this;
388
419
  return __generator(this, function (_c) {
389
420
  switch (_c.label) {
@@ -393,31 +424,11 @@
393
424
  case 1:
394
425
  results = _c.sent();
395
426
  objItem = this.valueField ? this.utilityService.arrayToObject(results, this.valueField) : results.forEach(function (item) { return objItem[item === null || item === void 0 ? void 0 : item.toString()] = item; });
396
- Object.assign(__classPrivateFieldGet(this, _allItem), objItem);
397
- if (!((_a = this.formControl.value) === null || _a === void 0 ? void 0 : _a.toString())) {
398
- return [2 /*return*/, results];
399
- }
400
- values = Array.isArray(this.formControl.value) ? this.formControl.value : [this.formControl.value];
401
- values.map(function (val) { return val === null || val === void 0 ? void 0 : val.toString(); }).forEach(function (val) {
402
- var _c;
403
- if (!objItem[val]) {
404
- if (__classPrivateFieldGet(_this, _allItem)[val]) {
405
- results.push(__classPrivateFieldGet(_this, _allItem)[val]);
406
- }
407
- else {
408
- if (_this.valueField && _this.displayField) {
409
- results.push((_c = {},
410
- _c[_this.valueField] = val,
411
- _c[_this.displayField] = val,
412
- _c));
413
- }
414
- else {
415
- results.push(val);
416
- }
417
- }
418
- }
419
- });
420
- return [2 /*return*/, results];
427
+ __classPrivateFieldSet(this, _allItem, Object.assign(Object.assign({}, __classPrivateFieldGet(this, _allItem)), objItem));
428
+ return [4 /*yield*/, __classPrivateFieldGet(this, _loadSelectedItems).call(this, this.formControl.value, items)];
429
+ case 2:
430
+ selectedItems = _c.sent();
431
+ return [2 /*return*/, __spread(selectedItems, results)];
421
432
  }
422
433
  });
423
434
  }); });
@@ -437,13 +448,12 @@
437
448
  _this.formControl.updateValueAndValidity({ emitEvent: true });
438
449
  };
439
450
  _onChange.set(this, function (value) {
440
- var _a, _b;
441
451
  if (Array.isArray(value)) {
442
452
  _this.modelChange.emit(value);
443
453
  _this.sdChange.emit(value);
444
454
  _this.sdSelection.emit({
445
455
  value: value,
446
- items: (_a = __classPrivateFieldGet(_this, _currentItems)) === null || _a === void 0 ? void 0 : _a.filter(function (e) { return value.some(function (e1) { return e1 === (e === null || e === void 0 ? void 0 : e[_this.valueField]); }); })
456
+ items: _this.selectedItems
447
457
  });
448
458
  }
449
459
  else {
@@ -451,7 +461,7 @@
451
461
  _this.sdChange.emit(value);
452
462
  _this.sdSelection.emit({
453
463
  value: value,
454
- item: (_b = __classPrivateFieldGet(_this, _currentItems)) === null || _b === void 0 ? void 0 : _b.find(function (e) { return value === (e === null || e === void 0 ? void 0 : e[_this.valueField]); })
464
+ item: _this.selectedItems[0]
455
465
  });
456
466
  }
457
467
  });
@@ -476,6 +486,22 @@
476
486
  });
477
487
  }
478
488
  };
489
+ this.onClick = function () {
490
+ var _a;
491
+ if ((_a = _this.sdView) === null || _a === void 0 ? void 0 : _a.templateRef) {
492
+ if (!_this.formControl.disabled && !_this.isFocused) {
493
+ _this.focus();
494
+ }
495
+ }
496
+ };
497
+ this.focus = function () {
498
+ _this.isFocused = true;
499
+ setTimeout(function () {
500
+ var _a, _b;
501
+ (_a = _this.select) === null || _a === void 0 ? void 0 : _a.focus();
502
+ (_b = _this.select) === null || _b === void 0 ? void 0 : _b.open();
503
+ }, 100);
504
+ };
479
505
  _customValidator.set(this, function (func) {
480
506
  return function (c) { return __awaiter(_this, void 0, void 0, function () {
481
507
  var value, result, message;
@@ -509,11 +535,15 @@
509
535
  });
510
536
  this.onOpenChange = function (isOpened) {
511
537
  if (isOpened) {
538
+ _this.isFocused = true;
512
539
  if (__classPrivateFieldGet(_this, _input)) {
513
540
  __classPrivateFieldGet(_this, _input).value = null;
514
541
  }
515
542
  _this.searchTerm$.next('');
516
543
  }
544
+ else {
545
+ _this.isFocused = false;
546
+ }
517
547
  };
518
548
  }
519
549
  Object.defineProperty(SdSelect.prototype, "input", {
@@ -559,20 +589,7 @@
559
589
  });
560
590
  Object.defineProperty(SdSelect.prototype, "model", {
561
591
  set: function (value) {
562
- // this.#model = value;
563
- // if (Array.isArray(value)) {
564
- // this.formControl.setValue(value.map(val => (val ?? '') + ''));
565
- // } else {
566
- // this.formControl.setValue((value ?? '') + '');
567
- // }
568
- // this.ref.detectChanges();
569
- // this.#model = value;
570
- if (Array.isArray(value)) {
571
- this.formControl.setValue(value);
572
- }
573
- else {
574
- this.formControl.setValue(value);
575
- }
592
+ this.formControl.setValue(value);
576
593
  },
577
594
  enumerable: false,
578
595
  configurable: true
@@ -649,75 +666,82 @@
649
666
  __classPrivateFieldGet(this, _subscription).add(this.formControl.touchedChanges.subscribe(function () {
650
667
  _this.ref.markForCheck();
651
668
  }));
652
- __classPrivateFieldSet(this, _allItems, this.searchTerm$.asObservable().pipe(operators.startWith(''), operators.debounceTime(typeof (__classPrivateFieldGet(this, _items)) === 'function' ? __classPrivateFieldGet(this, _delay) : 0), operators.switchMap(function (val) { return __awaiter(_this, void 0, void 0, function () {
653
- var changeAliasLowerCase, searchText, formValue, isArray, hasFields;
654
- var _this = this;
655
- return __generator(this, function (_c) {
656
- switch (_c.label) {
657
- case 0:
658
- if (!(typeof (__classPrivateFieldGet(this, _items)) === 'function')) return [3 /*break*/, 2];
659
- return [4 /*yield*/, __classPrivateFieldGet(this, _loadItems).call(this, val, __classPrivateFieldGet(this, _items))];
660
- case 1: return [2 /*return*/, _c.sent()];
661
- case 2:
662
- changeAliasLowerCase = this.utilityService.changeAliasLowerCase;
663
- searchText = changeAliasLowerCase(val);
664
- formValue = this.formControl.value;
665
- isArray = Array.isArray(formValue);
666
- hasFields = !!this.valueField && !!this.displayField;
667
- return [2 /*return*/, __classPrivateFieldGet(this, _items).filter(function (item) {
668
- var value = hasFields ? item[_this.valueField] : item;
669
- var display = hasFields ? item[_this.displayField] : item;
670
- if (changeAliasLowerCase(value).includes(searchText) || changeAliasLowerCase(display).includes(searchText)) {
671
- return true;
672
- }
673
- if (isArray) {
674
- return formValue.some(function (e) { return e === value; });
675
- }
676
- return formValue === value;
677
- }).sort(function (a, b) {
678
- if (!_this.multiple) {
679
- return 0;
680
- }
681
- var value1 = hasFields ? a[_this.valueField] : a;
682
- var value2 = hasFields ? b[_this.valueField] : b;
683
- if (isArray) {
684
- var t1_1 = formValue.some(function (e) { return e === value1; });
685
- var t2_1 = formValue.some(function (e) { return e === value2; });
686
- if (t1_1 && !t2_1) {
669
+ __classPrivateFieldSet(this, _allItems, rxjs.combineLatest([
670
+ this.searchTerm$.asObservable().pipe(operators.startWith(''), operators.debounceTime(typeof (__classPrivateFieldGet(this, _items)) === 'function' ? __classPrivateFieldGet(this, _delay) : 0)),
671
+ this.formControl.valueChanges.pipe(operators.startWith(this.formControl.value))
672
+ ]).pipe(operators.switchMap(function (_c) {
673
+ var _d = __read(_c, 2), val = _d[0], formValue = _d[1];
674
+ return __awaiter(_this, void 0, void 0, function () {
675
+ var changeAliasLowerCase, searchText, isArray, hasFields;
676
+ var _this = this;
677
+ return __generator(this, function (_c) {
678
+ switch (_c.label) {
679
+ case 0:
680
+ if (!(typeof (__classPrivateFieldGet(this, _items)) === 'function')) return [3 /*break*/, 2];
681
+ return [4 /*yield*/, __classPrivateFieldGet(this, _loadItems).call(this, val, __classPrivateFieldGet(this, _items))];
682
+ case 1: return [2 /*return*/, _c.sent()];
683
+ case 2:
684
+ changeAliasLowerCase = this.utilityService.changeAliasLowerCase;
685
+ searchText = changeAliasLowerCase(val);
686
+ isArray = Array.isArray(formValue);
687
+ hasFields = !!this.valueField && !!this.displayField;
688
+ return [2 /*return*/, __classPrivateFieldGet(this, _items).filter(function (item) {
689
+ var value = hasFields ? item[_this.valueField] : item;
690
+ var display = hasFields ? item[_this.displayField] : item;
691
+ if (changeAliasLowerCase(value).includes(searchText) || changeAliasLowerCase(display).includes(searchText)) {
692
+ return true;
693
+ }
694
+ if (isArray) {
695
+ return formValue.some(function (e) { return e === value; });
696
+ }
697
+ return formValue === value;
698
+ }).sort(function (a, b) {
699
+ if (!_this.multiple) {
700
+ return 0;
701
+ }
702
+ var value1 = hasFields ? a[_this.valueField] : a;
703
+ var value2 = hasFields ? b[_this.valueField] : b;
704
+ if (isArray) {
705
+ var t1_1 = formValue.some(function (e) { return e === value1; });
706
+ var t2_1 = formValue.some(function (e) { return e === value2; });
707
+ if (t1_1 && !t2_1) {
708
+ return -1;
709
+ }
710
+ if (!t1_1 && t2_1) {
711
+ return 1;
712
+ }
713
+ return 0;
714
+ }
715
+ var t1 = formValue === value1;
716
+ var t2 = formValue === value2;
717
+ if (t1 && !t2) {
687
718
  return -1;
688
719
  }
689
- if (!t1_1 && t2_1) {
720
+ if (!t1 && t2) {
690
721
  return 1;
691
722
  }
692
723
  return 0;
693
- }
694
- var t1 = formValue === value1;
695
- var t2 = formValue === value2;
696
- if (t1 && !t2) {
697
- return -1;
698
- }
699
- if (!t1 && t2) {
700
- return 1;
701
- }
702
- return 0;
703
- })];
704
- }
724
+ })];
725
+ }
726
+ });
705
727
  });
706
- }); })));
707
- this.filteredItems = __classPrivateFieldGet(this, _allItems).pipe(operators.map(function (allItems) {
708
- __classPrivateFieldSet(_this, _currentItems, allItems);
709
- return allItems.filter(function (item, index) { return index < _this.limit; });
710
- }));
711
- this.display = rxjs.combineLatest([__classPrivateFieldGet(this, _allItems), this.formControl.valueChanges.pipe(operators.startWith(this.formControl.value))]).pipe(operators.map(function (_c) {
712
- var _d = __read(_c, 2), items = _d[0], formValue = _d[1];
713
- var isArray = Array.isArray(formValue);
714
- if (!_this.valueField || !_this.displayField) {
715
- return isArray ? formValue === null || formValue === void 0 ? void 0 : formValue.join(', ') : formValue;
728
+ })));
729
+ __classPrivateFieldSet(this, _selectedItems, __classPrivateFieldGet(this, _allItems).pipe(operators.map(function (items) {
730
+ var formValue = _this.formControl.value;
731
+ if (!(formValue === null || formValue === void 0 ? void 0 : formValue.toString())) {
732
+ return [];
716
733
  }
717
- return items.filter(function (e) { return isArray ? formValue.includes(e[_this.valueField]) : formValue === e[_this.valueField]; })
718
- .map(function (e) { var _a; return (_a = e[_this.displayField]) === null || _a === void 0 ? void 0 : _a.toString(); })
719
- .join(', ');
720
- }));
734
+ var values = Array.isArray(formValue) ? formValue : [formValue];
735
+ _this.selectedItems = values.map(function (val) {
736
+ if (_this.valueField) {
737
+ return items === null || items === void 0 ? void 0 : items.find(function (item) { return item[_this.valueField] === val; });
738
+ }
739
+ return val;
740
+ });
741
+ return _this.selectedItems;
742
+ })));
743
+ this.filteredItems = __classPrivateFieldGet(this, _allItems).pipe(operators.map(function (allItems) { return allItems.filter(function (item, index) { return index < _this.limit; }); }));
744
+ this.display = __classPrivateFieldGet(this, _selectedItems).pipe(operators.map(function (selectedItems) { var _a; return (_a = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.map(function (item) { return _this.displayField ? item[_this.displayField] : item; })) === null || _a === void 0 ? void 0 : _a.join(', '); }));
721
745
  };
722
746
  SdSelect.prototype.ngAfterViewInit = function () {
723
747
  var _a;
@@ -739,13 +763,13 @@
739
763
  };
740
764
  return SdSelect;
741
765
  }());
742
- _input = new WeakMap(), _name = new WeakMap(), _form = new WeakMap(), _items = new WeakMap(), _currentItems = new WeakMap(), _allItem = new WeakMap(), _delay = new WeakMap(), _validator = new WeakMap(), _allItems = new WeakMap(), _subscription = new WeakMap(), _updateValidator = new WeakMap(), _search = new WeakMap(), _loadItems = new WeakMap(), _onChange = new WeakMap(), _customValidator = new WeakMap();
766
+ _input = new WeakMap(), _name = new WeakMap(), _form = new WeakMap(), _items = new WeakMap(), _delay = new WeakMap(), _validator = new WeakMap(), _subscription = new WeakMap(), _selectedItems = new WeakMap(), _allItems = new WeakMap(), _allItem = new WeakMap(), _updateValidator = new WeakMap(), _loadSelectedItems = new WeakMap(), _loadItems = new WeakMap(), _onChange = new WeakMap(), _customValidator = new WeakMap();
743
767
  SdSelect.decorators = [
744
768
  { type: core.Component, args: [{
745
769
  selector: 'sd-select',
746
- template: "<div class=\"d-flex align-items-center\">\r\n <mat-form-field class=\"sd-md\" [ngClass]=\"{'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage}\"\r\n appearance=\"outline\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <mat-select #select [formControl]=\"formControl\" placeholder=\"{{placeholder || label}}\" multiple\r\n (selectionChange)=\"onSelectionChange($event)\" disableOptionCentering=\"true\" panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{'sd-selected': !isRequired && (multiple ? formControl?.value?.length : formControl?.value)}\"\r\n [required]=\"isRequired\" (openedChange)=\"onOpenChange($event)\" *ngIf=\"multiple\">\r\n <mat-select-trigger>\r\n {{display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #input placeholder=\"{{'Search' | sdTranslate}}\" matInput autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"searchTerm$.next($event.target.value)\">\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"multiple && selectAll\">\r\n <mat-checkbox class=\"mat-option\" [(ngModel)]=\"allSelected\" [ngModelOptions]=\"{standalone: true}\"\r\n (change)=\"onSelectAll()\">\r\n T\u1EA5t c\u1EA3</mat-checkbox>\r\n </ng-container>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item[valueField]\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-select #select [formControl]=\"formControl\" placeholder=\"{{placeholder || label}}\"\r\n (selectionChange)=\"onSelectionChange($event)\" disableOptionCentering=\"true\" panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{'sd-selected': !isRequired && formControl?.value}\" [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\" *ngIf=\"!multiple\">\r\n <mat-select-trigger>\r\n {{display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #input placeholder=\"{{'Search' | sdTranslate}}\" matInput autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"searchTerm$.next($event.target.value)\">\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item[valueField]\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-icon\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value) && !isRequired && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel\r\n </mat-icon>\r\n <mat-error *ngIf=\"formControl.errors?.required && !disableErrorMessage\">\r\n {{'This field is required' | sdTranslate}}\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.customValidator && !disableErrorMessage\">\r\n {{formControl?.errors?.customValidator}}\r\n </mat-error>\r\n </mat-form-field>\r\n</div>",
770
+ template: "<div class=\"d-flex align-items-center\" [class.sd-view]=\"sdView?.templateRef\" [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\" (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused; else default\">\r\n <ng-container\r\n *ngTemplateOutlet=\"sdView.templateRef;context: { value: formControl.value, selectedItems: selectedItems }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field class=\"sd-md\" [ngClass]=\"{'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage}\"\r\n appearance=\"outline\">\r\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\r\n <mat-select #select [formControl]=\"formControl\" placeholder=\"{{placeholder || label}}\" multiple\r\n (selectionChange)=\"onSelectionChange($event)\" disableOptionCentering=\"true\" panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{'sd-selected': !isRequired && (multiple ? formControl?.value?.length : formControl?.value)}\"\r\n [required]=\"isRequired\" (openedChange)=\"onOpenChange($event)\" *ngIf=\"multiple\">\r\n <mat-select-trigger>\r\n {{display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #input placeholder=\"{{'Search' | sdTranslate}}\" matInput autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"searchTerm$.next($event.target.value)\">\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"multiple && selectAll\">\r\n <mat-checkbox class=\"mat-option\" [(ngModel)]=\"allSelected\" [ngModelOptions]=\"{standalone: true}\"\r\n (change)=\"onSelectAll()\">\r\n T\u1EA5t c\u1EA3</mat-checkbox>\r\n </ng-container>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item[valueField]\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-select #select [formControl]=\"formControl\" placeholder=\"{{placeholder || label}}\"\r\n (selectionChange)=\"onSelectionChange($event)\" disableOptionCentering=\"true\" panelClass=\"sd-select-panel\"\r\n [ngClass]=\"{'sd-selected': !isRequired && formControl?.value}\" [required]=\"isRequired\"\r\n (openedChange)=\"onOpenChange($event)\" *ngIf=\"!multiple\">\r\n <mat-select-trigger>\r\n {{display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input #input placeholder=\"{{'Search' | sdTranslate}}\" matInput autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\" (keyup)=\"searchTerm$.next($event.target.value)\">\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item[valueField]\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async\" [value]=\"item\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-icon\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value) && !isRequired && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\" (click)=\"clear($event)\" matSuffix>cancel\r\n </mat-icon>\r\n <mat-error *ngIf=\"formControl.errors?.required && !disableErrorMessage\">\r\n {{'This field is required' | sdTranslate}}\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.customValidator && !disableErrorMessage\">\r\n {{formControl?.errors?.customValidator}}\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>",
747
771
  changeDetection: core.ChangeDetectionStrategy.OnPush,
748
- styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}"]
772
+ styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}"]
749
773
  },] }
750
774
  ];
751
775
  SdSelect.ctorParameters = function () { return [
@@ -775,7 +799,8 @@
775
799
  _selectAll: [{ type: core.Input, args: ['selectAll',] }],
776
800
  modelChange: [{ type: core.Output }],
777
801
  sdChange: [{ type: core.Output }],
778
- sdSelection: [{ type: core.Output }]
802
+ sdSelection: [{ type: core.Output }],
803
+ sdView: [{ type: core.ContentChild, args: [common.SdViewDefDirective,] }]
779
804
  };
780
805
 
781
806
  var SdSelectModule = /** @class */ (function () {
@@ -796,7 +821,8 @@
796
821
  select.MatSelectModule,
797
822
  progressSpinner.MatProgressSpinnerModule,
798
823
  checkbox.MatCheckboxModule,
799
- translate.SdTranslateModule
824
+ translate.SdTranslateModule,
825
+ common.SdCommonModule
800
826
  ],
801
827
  declarations: [
802
828
  SdSelect,
@@ -804,7 +830,8 @@
804
830
  ],
805
831
  exports: [
806
832
  SdSelect,
807
- SdSelectDisplayDefDirective
833
+ SdSelectDisplayDefDirective,
834
+ common.SdCommonModule
808
835
  ],
809
836
  providers: []
810
837
  },] }