@gipisistemas/ngx-core 1.0.14 → 1.0.16

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.
@@ -37,7 +37,7 @@
37
37
  height: fit-content;
38
38
  font-family: $font-family;
39
39
  font-size: $font-size;
40
- color: $black-300;
40
+ color: $font-color;
41
41
 
42
42
  .g-form-field-wrapper {
43
43
  display: flex;
@@ -51,11 +51,11 @@
51
51
  border-radius: 0.6rem;
52
52
  padding: 0;
53
53
  border: 0.1rem solid $black-400;
54
- caret-color: $black-300;
55
54
  background-color: $white-100;
56
55
  font-family: $font-family;
57
56
  font-size: $font-size;
58
- color: $black-300;
57
+ color: $font-color;
58
+ caret-color: $font-color;
59
59
 
60
60
  @include form-field-controls() {
61
61
  flex: 1;
@@ -7,8 +7,12 @@
7
7
 
8
8
  $white-100: utils.get-color($theme, white, 100);
9
9
  $white-300: utils.get-color($theme, white, 300);
10
+
10
11
  $black-200: utils.get-color($theme, black, 200);
11
12
  $black-300: utils.get-color($theme, black, 300);
13
+
14
+ $primary-500: utils.get-color($theme, primary, 500);
15
+
12
16
  $secondary-50: utils.get-color($theme, secondary, 50);
13
17
  $secondary-200: utils.get-color($theme, secondary, 200);
14
18
 
@@ -28,6 +32,80 @@
28
32
  height: fit-content;
29
33
  cursor: pointer;
30
34
 
35
+ .g-select-multiple-values {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 0.4rem;
39
+ flex: 1;
40
+ min-width: 0;
41
+ max-width: 100%;
42
+ overflow: hidden;
43
+ white-space: nowrap;
44
+ padding: 0.8rem 1rem;
45
+ pointer-events: auto;
46
+ }
47
+
48
+ .g-select-value-chip {
49
+ display: inline-flex;
50
+ align-items: center;
51
+ gap: 0.4rem;
52
+ max-width: 14rem;
53
+ max-height: 2rem;
54
+ padding: 0.2rem 0.8rem;
55
+ border-radius: 0.6rem;
56
+ background-color: #e0e1e2;
57
+ font-size: 1.2rem;
58
+ color: $font-color;
59
+ font-weight: 600;
60
+ flex-shrink: 0;
61
+ }
62
+
63
+ .g-select-value-chip-label {
64
+ overflow: hidden;
65
+ text-overflow: ellipsis;
66
+ white-space: nowrap;
67
+ min-width: 0;
68
+ }
69
+
70
+ .g-select-value-chip-remove {
71
+ display: inline-flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ width: 1.6rem;
75
+ height: 1.6rem;
76
+ padding: 0;
77
+ border: none;
78
+ border-radius: 50%;
79
+ background: transparent;
80
+ color: $font-color;
81
+ cursor: pointer;
82
+
83
+ > span {
84
+ font-size: 1.4rem;
85
+ line-height: 1;
86
+ }
87
+
88
+ &:hover {
89
+ color: $black-200;
90
+ background-color: $white-300;
91
+ }
92
+ }
93
+
94
+ .g-select-value-chip-ellipsis {
95
+ display: inline-flex;
96
+ align-items: center;
97
+ justify-content: center;
98
+ min-width: 2.4rem;
99
+ padding: 0 0.6rem;
100
+ font-size: $font-size;
101
+ color: $font-color;
102
+ flex-shrink: 0;
103
+ }
104
+
105
+ .select-input-multiple-hidden {
106
+ display: none;
107
+ }
108
+
31
109
  .g-select-actions {
32
110
  display: flex;
33
111
  align-items: center;
@@ -38,13 +116,13 @@
38
116
  display: inline-flex;
39
117
  align-items: center;
40
118
  justify-content: center;
41
- min-width: 2rem;
42
- height: 2rem;
119
+ min-width: 2.4rem;
120
+ height: 2.2rem;
43
121
  padding: 0 0.6rem;
44
122
  margin-right: 0.4rem;
45
- background-color: $secondary-50;
123
+ background-color: $primary-500;
46
124
  color: $white-100;
47
- border-radius: 1rem;
125
+ border-radius: 0.6rem;
48
126
  font-size: 1.2rem;
49
127
  font-weight: 600;
50
128
  line-height: 1;
@@ -60,6 +138,12 @@
60
138
  background: transparent;
61
139
  transition: color 150ms;
62
140
  cursor: pointer;
141
+ transition: all 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
142
+
143
+ &:disabled {
144
+ opacity: 0.5;
145
+ cursor: not-allowed;
146
+ }
63
147
 
64
148
  &.clear {
65
149
  width: 3.2rem;
@@ -69,6 +153,7 @@
69
153
 
70
154
  &:hover {
71
155
  color: $black-200;
156
+ background-color: $white-300;
72
157
  }
73
158
 
74
159
  > span {
@@ -85,11 +170,6 @@
85
170
  color: $black-200;
86
171
  }
87
172
 
88
- &:disabled {
89
- opacity: 0.5;
90
- cursor: not-allowed;
91
- }
92
-
93
173
  > span {
94
174
  font-size: 2.6rem;
95
175
  transition: transform 150ms;
@@ -285,8 +285,8 @@ class DateUtil {
285
285
  if (this.isEmpty(inp)) {
286
286
  return null;
287
287
  }
288
- const date = typeof inp === 'string' ? inp : DateTime.fromJSDate(inp).toFormat('yyyy-MM-dd');
289
- return DateTime.fromFormat(date, 'yyyy-MM-dd').set({ hour: 12 }).toJSDate();
288
+ const date = typeof inp === 'string' ? DateTime.fromISO(inp) : DateTime.fromJSDate(inp);
289
+ return date.set({ hour: 12 }).toJSDate();
290
290
  }
291
291
  /**
292
292
  * Retorna a data e hora atual.
@@ -2161,6 +2161,7 @@ class StateUtil {
2161
2161
  }
2162
2162
  }
2163
2163
 
2164
+ /* eslint-disable max-len */
2164
2165
  class DocumentUtil {
2165
2166
  static _isLastChar(index, input) {
2166
2167
  return index === input.length - 1;
@@ -2385,11 +2386,24 @@ class DocumentUtil {
2385
2386
  * DocumentUtil.isValidCep('12345678'); // Retorna `true`.
2386
2387
  * DocumentUtil.isValidCep('1234567'); // Retorna `false`.
2387
2388
  * DocumentUtil.isValidCep('123456789'); // Retorna `false`.
2389
+ * DocumentUtil.isValidCep('11111-111'); // Retorna `false`.
2390
+ * DocumentUtil.isValidCep('99999-999'); // Retorna `false`.
2388
2391
  */
2389
2392
  static isValidCep(cep) {
2390
- if (StringUtil.isEmpty(cep) || NumberUtil.onlyNumbers(cep).length !== 8) {
2393
+ if (StringUtil.isEmpty(cep)) {
2391
2394
  return false;
2392
2395
  }
2396
+ const cleanCep = NumberUtil.onlyNumbers(cep);
2397
+ // precisa ter 8 dígitos
2398
+ if (cleanCep.length !== 8)
2399
+ return false;
2400
+ // não pode ser todos iguais
2401
+ if (/^(\d)\1{7}$/.test(cleanCep))
2402
+ return false;
2403
+ const numCep = Number(cleanCep);
2404
+ // faixa válida do brasil
2405
+ if (numCep < 1000000 || numCep > 99999999)
2406
+ return false;
2393
2407
  return true;
2394
2408
  }
2395
2409
  /**
@@ -2525,8 +2539,11 @@ class DocumentUtil {
2525
2539
  * - `displayCorrectDigit`: Se `true`, exibe o dígito verificador correto.
2526
2540
  * @returns `true` se a inscrição estadual for válida, caso contrário, `false`.
2527
2541
  * @example
2528
- * DocumentUtil.isValidIE('GO', '113687214'); // Retorna `{ isValid: true, message: '' }`.
2529
- * DocumentUtil.isValidIE('AC', '0185402241495'); // Retorna `{ isValid: false, message: 'Inscrição estadual inválida para AC. Motivo: Dígito verificador inválido.' }`.
2542
+ * // Retorna `{ isValid: true, message: '' }`.
2543
+ * DocumentUtil.isValidIE('GO', '113687214');
2544
+ *
2545
+ * // Retorna `{ isValid: false, message: 'Inscrição estadual inválida para AC. Motivo: Dígito verificador inválido.' }`.
2546
+ * DocumentUtil.isValidIE('AC', '0185402241495');
2530
2547
  */
2531
2548
  static isValidIE(uf, stateRegistration, options) {
2532
2549
  const cIgnorarChar = './-';
@@ -6039,7 +6056,7 @@ class BaseAuthService extends BaseService {
6039
6056
  this.router = inject(Router);
6040
6057
  this.localStorageToken = inject(LocalStorageToken);
6041
6058
  this.sessionStorageToken = inject(SessionStorageToken);
6042
- this.TOKEN_KEY = 'auth_token';
6059
+ this.TOKEN_KEY = 'token';
6043
6060
  this._token = signal(null, ...(ngDevMode ? [{ debugName: "_token" }] : []));
6044
6061
  this._user = signal(null, ...(ngDevMode ? [{ debugName: "_user" }] : []));
6045
6062
  this.token$ = toObservable(this._token);
@@ -14169,15 +14186,19 @@ class Select extends BaseControlValueAccessor {
14169
14186
  this._optionId = inject(_IdGenerator).getId('gipi-select-option-');
14170
14187
  this._uniqueId = inject(_IdGenerator).getId('gipi-select-');
14171
14188
  this._inputRef = viewChild('inputElement', ...(ngDevMode ? [{ debugName: "_inputRef" }] : []));
14189
+ this._actionsRef = viewChild('actionsElement', ...(ngDevMode ? [{ debugName: "_actionsRef" }] : []));
14172
14190
  this._searchInputRef = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "_searchInputRef" }] : []));
14173
14191
  this._optionElementsRef = viewChildren('optionElement', ...(ngDevMode ? [{ debugName: "_optionElementsRef" }] : []));
14174
14192
  this._optionsContainerRef = viewChild('optionsContainer', ...(ngDevMode ? [{ debugName: "_optionsContainerRef" }] : []));
14175
14193
  this._dropdownPanelRef = viewChild('dropdownPanel', ...(ngDevMode ? [{ debugName: "_dropdownPanelRef" }] : []));
14176
14194
  this._typeAheadBuffer = '';
14177
14195
  this._typeAheadTimeout = null;
14196
+ this._resizeObserver = null;
14197
+ this._measureCanvas = null;
14178
14198
  this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
14179
14199
  this.search = useSearch('', 0);
14180
14200
  this.activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "activeIndex" }] : []));
14201
+ this.visibleSelectedCount = signal(2, ...(ngDevMode ? [{ debugName: "visibleSelectedCount" }] : []));
14181
14202
  this.positions = [
14182
14203
  {
14183
14204
  originX: 'start',
@@ -14249,6 +14270,26 @@ class Select extends BaseControlValueAccessor {
14249
14270
  }
14250
14271
  return !ObjectUtil.isEmpty(value);
14251
14272
  }, ...(ngDevMode ? [{ debugName: "hasValue" }] : []));
14273
+ this.visibleSelectedValues = computed(() => {
14274
+ if (!this.multiple()) {
14275
+ return [];
14276
+ }
14277
+ return this.valueAsArray().slice(0, this.visibleSelectedCount());
14278
+ }, ...(ngDevMode ? [{ debugName: "visibleSelectedValues" }] : []));
14279
+ this.hasHiddenSelectedValues = computed(() => {
14280
+ if (!this.multiple()) {
14281
+ return false;
14282
+ }
14283
+ return this.hiddenSelectedCount() > 0;
14284
+ }, ...(ngDevMode ? [{ debugName: "hasHiddenSelectedValues" }] : []));
14285
+ this.hiddenSelectedCount = computed(() => {
14286
+ if (!this.multiple()) {
14287
+ return 0;
14288
+ }
14289
+ const total = this.valueAsArray().length;
14290
+ const visible = this.visibleSelectedValues().length;
14291
+ return Math.max(total - visible, 0);
14292
+ }, ...(ngDevMode ? [{ debugName: "hiddenSelectedCount" }] : []));
14252
14293
  this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
14253
14294
  this.placeholder = input('Selecionar', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
14254
14295
  this.help = input('', ...(ngDevMode ? [{ debugName: "help" }] : []));
@@ -14279,6 +14320,23 @@ class Select extends BaseControlValueAccessor {
14279
14320
  const term = this.search.term() ?? '';
14280
14321
  this.searchChange.emit(term);
14281
14322
  });
14323
+ effect(() => {
14324
+ this.multiple();
14325
+ this.value();
14326
+ this.options();
14327
+ this.propertyLabel();
14328
+ setTimeout(() => this._recalculateVisibleSelectedCount(), 0);
14329
+ });
14330
+ }
14331
+ ngAfterViewInit() {
14332
+ this._initResizeObserver();
14333
+ setTimeout(() => this._recalculateVisibleSelectedCount(), 0);
14334
+ }
14335
+ ngOnDestroy() {
14336
+ if (this._resizeObserver) {
14337
+ this._resizeObserver.disconnect();
14338
+ this._resizeObserver = null;
14339
+ }
14282
14340
  }
14283
14341
  writeControlValue(value, setModelValue) {
14284
14342
  this.value.set(value);
@@ -14644,7 +14702,89 @@ class Select extends BaseControlValueAccessor {
14644
14702
  }
14645
14703
  getOptionLabelByValue(value) {
14646
14704
  const option = this.options().find((opt) => SelectOptionsUtil.isEqualOption(this.getOptionValue(opt), value));
14647
- return option ? this.getOptionLabel(option) : String(value);
14705
+ if (option) {
14706
+ return this.getOptionLabel(option);
14707
+ }
14708
+ if (value && typeof value === 'object') {
14709
+ const propertyLabelFn = this.propertyLabel();
14710
+ if (propertyLabelFn) {
14711
+ return SelectOptionsUtil.getOptionLabel(value, propertyLabelFn);
14712
+ }
14713
+ }
14714
+ return String(value);
14715
+ }
14716
+ _initResizeObserver() {
14717
+ const input = this._inputRef()?.nativeElement;
14718
+ if (!input) {
14719
+ return;
14720
+ }
14721
+ const wrapper = input.parentElement;
14722
+ if (!wrapper || typeof ResizeObserver === 'undefined') {
14723
+ return;
14724
+ }
14725
+ this._resizeObserver = new ResizeObserver(() => this._recalculateVisibleSelectedCount());
14726
+ this._resizeObserver.observe(wrapper);
14727
+ }
14728
+ _recalculateVisibleSelectedCount() {
14729
+ if (!this.multiple()) {
14730
+ this.visibleSelectedCount.set(0);
14731
+ return;
14732
+ }
14733
+ const selected = this.valueAsArray();
14734
+ if (ArrayUtil.isEmpty(selected)) {
14735
+ this.visibleSelectedCount.set(0);
14736
+ return;
14737
+ }
14738
+ const input = this._inputRef()?.nativeElement;
14739
+ const actions = this._actionsRef()?.nativeElement;
14740
+ const wrapper = input?.parentElement;
14741
+ if (!input || !wrapper) {
14742
+ this.visibleSelectedCount.set(Math.min(selected.length, 2));
14743
+ return;
14744
+ }
14745
+ const wrapperWidth = wrapper.clientWidth;
14746
+ const actionsWidth = actions?.offsetWidth ?? 0;
14747
+ const availableWidth = Math.max(wrapperWidth - actionsWidth - 24, 0);
14748
+ if (availableWidth <= 0) {
14749
+ this.visibleSelectedCount.set(0);
14750
+ return;
14751
+ }
14752
+ const chipGap = 4;
14753
+ const ellipsisWidth = 28;
14754
+ let usedWidth = 0;
14755
+ let visibleCount = 0;
14756
+ for (let i = 0; i < selected.length; i++) {
14757
+ const label = this.getOptionLabelByValue(selected[i]);
14758
+ const chipWidth = this._measureChipWidth(label, input);
14759
+ const remainingItems = selected.length - (i + 1);
14760
+ const needsEllipsis = remainingItems > 0;
14761
+ const projectedWidth = usedWidth +
14762
+ (visibleCount > 0 ? chipGap : 0) +
14763
+ chipWidth +
14764
+ (needsEllipsis ? chipGap + ellipsisWidth : 0);
14765
+ if (projectedWidth > availableWidth) {
14766
+ break;
14767
+ }
14768
+ usedWidth += (visibleCount > 0 ? chipGap : 0) + chipWidth;
14769
+ visibleCount++;
14770
+ }
14771
+ this.visibleSelectedCount.set(visibleCount);
14772
+ }
14773
+ _measureChipWidth(label, input) {
14774
+ if (!this._measureCanvas) {
14775
+ this._measureCanvas = document.createElement('canvas');
14776
+ }
14777
+ const ctx = this._measureCanvas.getContext('2d');
14778
+ if (!ctx) {
14779
+ return 120;
14780
+ }
14781
+ const style = window.getComputedStyle(input);
14782
+ ctx.font = `${style.fontWeight} ${style.fontSize} ${style.fontFamily}`;
14783
+ const textWidth = ctx.measureText(label).width;
14784
+ // label + close button + paddings/gap
14785
+ const maxLabelWidth = 140;
14786
+ const clampedLabelWidth = Math.min(textWidth, maxLabelWidth);
14787
+ return clampedLabelWidth + 32;
14648
14788
  }
14649
14789
  removeValue(value, event) {
14650
14790
  event.stopPropagation();
@@ -14761,7 +14901,7 @@ class Select extends BaseControlValueAccessor {
14761
14901
  this.notifyValueChange(newValue);
14762
14902
  }
14763
14903
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: Select, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14764
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: Select, isStandalone: true, selector: "gipi-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, suggestion: { classPropertyName: "suggestion", publicName: "suggestion", isSignal: true, isRequired: false, transformFunction: null }, suggestionTooltip: { classPropertyName: "suggestionTooltip", publicName: "suggestionTooltip", isSignal: true, isRequired: false, transformFunction: null }, hasError: { classPropertyName: "hasError", publicName: "hasError", isSignal: true, isRequired: false, transformFunction: null }, controlErrors: { classPropertyName: "controlErrors", publicName: "controlErrors", isSignal: true, isRequired: true, transformFunction: null }, noOptionsText: { classPropertyName: "noOptionsText", publicName: "noOptionsText", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, showSelectAll: { classPropertyName: "showSelectAll", publicName: "showSelectAll", isSignal: true, isRequired: false, transformFunction: null }, compareBy: { classPropertyName: "compareBy", publicName: "compareBy", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, propertyLabel: { classPropertyName: "propertyLabel", publicName: "propertyLabel", isSignal: true, isRequired: false, transformFunction: null }, propertyValue: { classPropertyName: "propertyValue", publicName: "propertyValue", isSignal: true, isRequired: false, transformFunction: null }, optionsExclude: { classPropertyName: "optionsExclude", publicName: "optionsExclude", isSignal: true, isRequired: false, transformFunction: null }, optionsDisable: { classPropertyName: "optionsDisable", publicName: "optionsDisable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchChange: "searchChange", loadMoreClick: "loadMoreClick", opened: "opened", closed: "closed", optionsScroll: "optionsScroll" }, host: { properties: { "attr.id": "id()", "attr.name": "name()", "class.g-select-disabled": "$disabled()", "class.g-select-multiple": "multiple()" }, classAttribute: "g-select" }, providers: [provideValueAccessor(Select)], viewQueries: [{ propertyName: "_inputRef", first: true, predicate: ["inputElement"], descendants: true, isSignal: true }, { propertyName: "_searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "_optionElementsRef", predicate: ["optionElement"], descendants: true, isSignal: true }, { propertyName: "_optionsContainerRef", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "_dropdownPanelRef", first: true, predicate: ["dropdownPanel"], descendants: true, isSignal: true }], exportAs: ["gSelect"], usesInheritance: true, ngImport: i0, template: `
14904
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: Select, isStandalone: true, selector: "gipi-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, help: { classPropertyName: "help", publicName: "help", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, suggestion: { classPropertyName: "suggestion", publicName: "suggestion", isSignal: true, isRequired: false, transformFunction: null }, suggestionTooltip: { classPropertyName: "suggestionTooltip", publicName: "suggestionTooltip", isSignal: true, isRequired: false, transformFunction: null }, hasError: { classPropertyName: "hasError", publicName: "hasError", isSignal: true, isRequired: false, transformFunction: null }, controlErrors: { classPropertyName: "controlErrors", publicName: "controlErrors", isSignal: true, isRequired: true, transformFunction: null }, noOptionsText: { classPropertyName: "noOptionsText", publicName: "noOptionsText", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, showSelectAll: { classPropertyName: "showSelectAll", publicName: "showSelectAll", isSignal: true, isRequired: false, transformFunction: null }, compareBy: { classPropertyName: "compareBy", publicName: "compareBy", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, propertyLabel: { classPropertyName: "propertyLabel", publicName: "propertyLabel", isSignal: true, isRequired: false, transformFunction: null }, propertyValue: { classPropertyName: "propertyValue", publicName: "propertyValue", isSignal: true, isRequired: false, transformFunction: null }, optionsExclude: { classPropertyName: "optionsExclude", publicName: "optionsExclude", isSignal: true, isRequired: false, transformFunction: null }, optionsDisable: { classPropertyName: "optionsDisable", publicName: "optionsDisable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchChange: "searchChange", loadMoreClick: "loadMoreClick", opened: "opened", closed: "closed", optionsScroll: "optionsScroll" }, host: { properties: { "attr.id": "id()", "attr.name": "name()", "class.g-select-disabled": "$disabled()", "class.g-select-multiple": "multiple()" }, classAttribute: "g-select" }, providers: [provideValueAccessor(Select)], viewQueries: [{ propertyName: "_inputRef", first: true, predicate: ["inputElement"], descendants: true, isSignal: true }, { propertyName: "_actionsRef", first: true, predicate: ["actionsElement"], descendants: true, isSignal: true }, { propertyName: "_searchInputRef", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "_optionElementsRef", predicate: ["optionElement"], descendants: true, isSignal: true }, { propertyName: "_optionsContainerRef", first: true, predicate: ["optionsContainer"], descendants: true, isSignal: true }, { propertyName: "_dropdownPanelRef", first: true, predicate: ["dropdownPanel"], descendants: true, isSignal: true }], exportAs: ["gSelect"], usesInheritance: true, ngImport: i0, template: `
14765
14905
  <gipi-form-field
14766
14906
  #trigger="cdkOverlayOrigin"
14767
14907
  cdkOverlayOrigin
@@ -14775,6 +14915,36 @@ class Select extends BaseControlValueAccessor {
14775
14915
  [required]="required()"
14776
14916
  [hasError]="hasError()"
14777
14917
  >
14918
+ @if (multiple() && hasValue()) {
14919
+ <div
14920
+ class="g-select-multiple-values"
14921
+ tabindex="-1"
14922
+ (blur)="onInputBlur()"
14923
+ (keydown)="onKeyDown($event)"
14924
+ (click)="onInputClick()"
14925
+ >
14926
+ @for (selectedValue of visibleSelectedValues(); track $index) {
14927
+ <span class="g-select-value-chip">
14928
+ <span class="g-select-value-chip-label">
14929
+ {{ getOptionLabelByValue(selectedValue) }}
14930
+ </span>
14931
+ <button
14932
+ type="button"
14933
+ tabindex="-1"
14934
+ class="g-select-value-chip-remove"
14935
+ aria-label="Remover item"
14936
+ (click)="removeValue(selectedValue, $event)"
14937
+ >
14938
+ <span class="material-symbols-rounded">close</span>
14939
+ </button>
14940
+ </span>
14941
+ }
14942
+ @if (hasHiddenSelectedValues()) {
14943
+ <span class="g-select-value-chip-ellipsis">...</span>
14944
+ }
14945
+ </div>
14946
+ }
14947
+
14778
14948
  <input
14779
14949
  #inputElement
14780
14950
  gInput
@@ -14783,29 +14953,31 @@ class Select extends BaseControlValueAccessor {
14783
14953
  role="combobox"
14784
14954
  class="select-input"
14785
14955
  [class.select-input-open]="isOpen()"
14956
+ [class.select-input-multiple-hidden]="multiple() && hasValue()"
14786
14957
  [attr.id]="_controlId"
14787
14958
  [attr.name]="_controlId"
14788
14959
  [attr.aria-expanded]="isOpen()"
14789
14960
  [attr.aria-haspopup]="'listbox'"
14790
14961
  [attr.aria-controls]="_listboxId"
14791
14962
  [attr.aria-label]="label() || placeholder()"
14792
- [placeholder]="placeholder()"
14963
+ [placeholder]="multiple() && hasValue() ? '' : placeholder()"
14793
14964
  [disabled]="$disabled()"
14794
14965
  [required]="required()"
14795
14966
  [readonly]="true"
14796
- [value]="getInputValue()"
14967
+ [value]="multiple() ? '' : getInputValue()"
14797
14968
  (blur)="onInputBlur()"
14798
14969
  (keydown)="onKeyDown($event)"
14799
14970
  (click)="onInputClick()"
14800
14971
  />
14801
14972
 
14802
14973
  <div
14974
+ #actionsElement
14803
14975
  gSuffix
14804
14976
  class="g-select-actions"
14805
14977
  [class.disabled]="$disabled()"
14806
14978
  >
14807
- @if (multiple() && hasValue() && valueAsArray().length > 1) {
14808
- <span class="g-select-badge">+{{ valueAsArray().length - 1 }}</span>
14979
+ @if (multiple() && hiddenSelectedCount() > 0) {
14980
+ <span class="g-select-badge">+{{ hiddenSelectedCount() }}</span>
14809
14981
  }
14810
14982
 
14811
14983
  @if (showClear() && hasValue() && !$disabled() && !required()) {
@@ -14984,6 +15156,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
14984
15156
  [required]="required()"
14985
15157
  [hasError]="hasError()"
14986
15158
  >
15159
+ @if (multiple() && hasValue()) {
15160
+ <div
15161
+ class="g-select-multiple-values"
15162
+ tabindex="-1"
15163
+ (blur)="onInputBlur()"
15164
+ (keydown)="onKeyDown($event)"
15165
+ (click)="onInputClick()"
15166
+ >
15167
+ @for (selectedValue of visibleSelectedValues(); track $index) {
15168
+ <span class="g-select-value-chip">
15169
+ <span class="g-select-value-chip-label">
15170
+ {{ getOptionLabelByValue(selectedValue) }}
15171
+ </span>
15172
+ <button
15173
+ type="button"
15174
+ tabindex="-1"
15175
+ class="g-select-value-chip-remove"
15176
+ aria-label="Remover item"
15177
+ (click)="removeValue(selectedValue, $event)"
15178
+ >
15179
+ <span class="material-symbols-rounded">close</span>
15180
+ </button>
15181
+ </span>
15182
+ }
15183
+ @if (hasHiddenSelectedValues()) {
15184
+ <span class="g-select-value-chip-ellipsis">...</span>
15185
+ }
15186
+ </div>
15187
+ }
15188
+
14987
15189
  <input
14988
15190
  #inputElement
14989
15191
  gInput
@@ -14992,29 +15194,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
14992
15194
  role="combobox"
14993
15195
  class="select-input"
14994
15196
  [class.select-input-open]="isOpen()"
15197
+ [class.select-input-multiple-hidden]="multiple() && hasValue()"
14995
15198
  [attr.id]="_controlId"
14996
15199
  [attr.name]="_controlId"
14997
15200
  [attr.aria-expanded]="isOpen()"
14998
15201
  [attr.aria-haspopup]="'listbox'"
14999
15202
  [attr.aria-controls]="_listboxId"
15000
15203
  [attr.aria-label]="label() || placeholder()"
15001
- [placeholder]="placeholder()"
15204
+ [placeholder]="multiple() && hasValue() ? '' : placeholder()"
15002
15205
  [disabled]="$disabled()"
15003
15206
  [required]="required()"
15004
15207
  [readonly]="true"
15005
- [value]="getInputValue()"
15208
+ [value]="multiple() ? '' : getInputValue()"
15006
15209
  (blur)="onInputBlur()"
15007
15210
  (keydown)="onKeyDown($event)"
15008
15211
  (click)="onInputClick()"
15009
15212
  />
15010
15213
 
15011
15214
  <div
15215
+ #actionsElement
15012
15216
  gSuffix
15013
15217
  class="g-select-actions"
15014
15218
  [class.disabled]="$disabled()"
15015
15219
  >
15016
- @if (multiple() && hasValue() && valueAsArray().length > 1) {
15017
- <span class="g-select-badge">+{{ valueAsArray().length - 1 }}</span>
15220
+ @if (multiple() && hiddenSelectedCount() > 0) {
15221
+ <span class="g-select-badge">+{{ hiddenSelectedCount() }}</span>
15018
15222
  }
15019
15223
 
15020
15224
  @if (showClear() && hasValue() && !$disabled() && !required()) {
@@ -15189,7 +15393,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
15189
15393
  LoadingModule,
15190
15394
  CheckboxModule,
15191
15395
  ] }]
15192
- }], ctorParameters: () => [], propDecorators: { _inputRef: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], _searchInputRef: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], _optionElementsRef: [{ type: i0.ViewChildren, args: ['optionElement', { isSignal: true }] }], _optionsContainerRef: [{ type: i0.ViewChild, args: ['optionsContainer', { isSignal: true }] }], _dropdownPanelRef: [{ type: i0.ViewChild, args: ['dropdownPanel', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], help: [{ type: i0.Input, args: [{ isSignal: true, alias: "help", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], suggestion: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestion", required: false }] }], suggestionTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestionTooltip", required: false }] }], hasError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasError", required: false }] }], controlErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlErrors", required: true }] }], noOptionsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noOptionsText", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], showSelectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectAll", required: false }] }], compareBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareBy", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], propertyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyLabel", required: false }] }], propertyValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyValue", required: false }] }], optionsExclude: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsExclude", required: false }] }], optionsDisable: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsDisable", required: false }] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], loadMoreClick: [{ type: i0.Output, args: ["loadMoreClick"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], optionsScroll: [{ type: i0.Output, args: ["optionsScroll"] }] } });
15396
+ }], ctorParameters: () => [], propDecorators: { _inputRef: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], _actionsRef: [{ type: i0.ViewChild, args: ['actionsElement', { isSignal: true }] }], _searchInputRef: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], _optionElementsRef: [{ type: i0.ViewChildren, args: ['optionElement', { isSignal: true }] }], _optionsContainerRef: [{ type: i0.ViewChild, args: ['optionsContainer', { isSignal: true }] }], _dropdownPanelRef: [{ type: i0.ViewChild, args: ['dropdownPanel', { isSignal: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], help: [{ type: i0.Input, args: [{ isSignal: true, alias: "help", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], suggestion: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestion", required: false }] }], suggestionTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "suggestionTooltip", required: false }] }], hasError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasError", required: false }] }], controlErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlErrors", required: true }] }], noOptionsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noOptionsText", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], showSelectAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSelectAll", required: false }] }], compareBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareBy", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], propertyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyLabel", required: false }] }], propertyValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyValue", required: false }] }], optionsExclude: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsExclude", required: false }] }], optionsDisable: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsDisable", required: false }] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], loadMoreClick: [{ type: i0.Output, args: ["loadMoreClick"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], optionsScroll: [{ type: i0.Output, args: ["optionsScroll"] }] } });
15193
15397
 
15194
15398
  class SelectClientSide extends BaseControlValueAccessor {
15195
15399
  constructor() {
@@ -19191,6 +19395,7 @@ class Sidenav {
19191
19395
  this.arrowType = signal('arrow_left', ...(ngDevMode ? [{ debugName: "arrowType" }] : []));
19192
19396
  this.mode = signal('over', ...(ngDevMode ? [{ debugName: "mode" }] : []));
19193
19397
  this.viewportSize = signal('mobile', ...(ngDevMode ? [{ debugName: "viewportSize" }] : []));
19398
+ this._hoverExpanded = false;
19194
19399
  this.id = input(this._uniqueId, ...(ngDevMode ? [{ debugName: "id" }] : []));
19195
19400
  this.name = input(this._uniqueId, ...(ngDevMode ? [{ debugName: "name" }] : []));
19196
19401
  this._opened = false;
@@ -19225,20 +19430,23 @@ class Sidenav {
19225
19430
  this._applyResponsiveState();
19226
19431
  }
19227
19432
  handleMouseEnter() {
19228
- if (this.viewportSize() === 'tablet' && !this.opened) {
19433
+ if (!this.opened) {
19434
+ this._hoverExpanded = true;
19229
19435
  this.opened = true;
19230
19436
  this._changeDetectorRef.detectChanges();
19231
19437
  }
19232
19438
  }
19233
19439
  handleMouseLeave() {
19234
- if (this.viewportSize() === 'tablet' && this.opened) {
19440
+ if (this._hoverExpanded && this.opened) {
19235
19441
  this.opened = false;
19442
+ this._hoverExpanded = false;
19236
19443
  this._menuLevel.set([]);
19237
19444
  this._changeDetectorRef.detectChanges();
19238
19445
  }
19239
19446
  }
19240
19447
  handleToggleSidenav() {
19241
19448
  this.opened = !this.opened;
19449
+ this._hoverExpanded = false;
19242
19450
  this._menuLevel.set([]);
19243
19451
  this._changeDetectorRef.detectChanges();
19244
19452
  }
@@ -19250,11 +19458,21 @@ class Sidenav {
19250
19458
  this._changeDetectorRef.detectChanges();
19251
19459
  }
19252
19460
  handleMenuItemSelect(menu) {
19461
+ if (!this.opened) {
19462
+ this._menuLevel.set([]);
19463
+ this._changeDetectorRef.detectChanges();
19464
+ menu.action?.();
19465
+ return;
19466
+ }
19253
19467
  if (menu.type === 'COLLAPSABLE') {
19254
19468
  this._menuLevel.update((level) => [...level, menu]);
19469
+ this._changeDetectorRef.detectChanges();
19470
+ return;
19255
19471
  }
19256
- if (this.mode() === 'over' && this.opened && menu.type !== 'COLLAPSABLE') {
19472
+ this._menuLevel.set([]);
19473
+ if (this.mode() === 'over' && this.opened) {
19257
19474
  this.opened = false;
19475
+ this._hoverExpanded = false;
19258
19476
  }
19259
19477
  this._changeDetectorRef.detectChanges();
19260
19478
  menu.action?.();
@@ -19271,10 +19489,12 @@ class Sidenav {
19271
19489
  if (nextViewport === 'desktop') {
19272
19490
  this.mode.set('side');
19273
19491
  this.opened = true;
19492
+ this._hoverExpanded = false;
19274
19493
  }
19275
19494
  else {
19276
19495
  this.mode.set('over');
19277
19496
  this.opened = false;
19497
+ this._hoverExpanded = false;
19278
19498
  }
19279
19499
  this._menuLevel.set([]);
19280
19500
  this._changeDetectorRef.detectChanges();
@@ -21756,7 +21976,6 @@ class Textarea extends BaseControlValueAccessor {
21756
21976
  return;
21757
21977
  }
21758
21978
  const processedValue = this._processValue(value);
21759
- this.value.set(processedValue);
21760
21979
  this.notifyValueChange(processedValue);
21761
21980
  this.markAsTouched();
21762
21981
  }
@@ -21821,7 +22040,6 @@ class Textarea extends BaseControlValueAccessor {
21821
22040
  if (this.$disabled()) {
21822
22041
  return;
21823
22042
  }
21824
- this.value.set('');
21825
22043
  this.notifyValueChange('');
21826
22044
  }
21827
22045
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: Textarea, deps: [], target: i0.ɵɵFactoryTarget.Component }); }