asksuite-citrus 0.5.3 → 0.6.0

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 (27) hide show
  1. package/assets/citrus-i18n/en.json +3 -0
  2. package/assets/citrus-i18n/es.json +3 -0
  3. package/assets/citrus-i18n/pt.json +3 -0
  4. package/esm2022/lib/asksuite-citrus.module.mjs +11 -10
  5. package/esm2022/lib/components/autocomplete/autocomplete.component.mjs +133 -48
  6. package/esm2022/lib/components/avatar/avatar.component.mjs +2 -2
  7. package/esm2022/lib/components/box/box.component.mjs +2 -2
  8. package/esm2022/lib/components/button/button.component.mjs +2 -2
  9. package/esm2022/lib/components/checkbox/checkbox.component.mjs +5 -5
  10. package/esm2022/lib/components/chips/chips.component.mjs +2 -2
  11. package/esm2022/lib/components/date-picker/date-picker-calendar/date-picker-calendar.component.mjs +2 -2
  12. package/esm2022/lib/components/date-picker/date-picker.component.mjs +2 -2
  13. package/esm2022/lib/components/dropdown-container/dropdown-container.component.mjs +2 -2
  14. package/esm2022/lib/components/input/input.component.mjs +2 -2
  15. package/esm2022/lib/components/select/select.component.mjs +2 -2
  16. package/esm2022/lib/directives/badge/badge.directive.mjs +82 -0
  17. package/esm2022/public-api.mjs +2 -1
  18. package/fesm2022/asksuite-citrus.mjs +245 -82
  19. package/fesm2022/asksuite-citrus.mjs.map +1 -1
  20. package/lib/asksuite-citrus.module.d.ts +5 -5
  21. package/lib/components/autocomplete/autocomplete.component.d.ts +22 -3
  22. package/lib/directives/badge/badge.directive.d.ts +20 -0
  23. package/package.json +1 -1
  24. package/public-api.d.ts +1 -0
  25. package/styles/animations.scss +83 -0
  26. package/styles/styles.scss +64 -0
  27. package/styles/tokens.scss +1 -0
@@ -11,15 +11,28 @@ export declare class AutocompleteComponent implements AfterViewInit, ControlValu
11
11
  list: ElementRef | undefined;
12
12
  wrapper: ElementRef | undefined;
13
13
  overlayContent: TemplateRef<any> | undefined;
14
+ set listViewport(value: ElementRef);
14
15
  protected inputControl: FormControl<string | null>;
15
16
  protected filteredOptions: any[];
16
17
  protected paginatedFilteredOptions: any[];
17
18
  protected selectedOption?: any;
19
+ protected selection: any[];
18
20
  protected closed: boolean;
19
21
  protected selectionForm: FormGroup;
20
22
  protected chipsCollapsed: boolean;
21
23
  protected checkAllValue: boolean;
22
24
  protected disabled: boolean;
25
+ protected showChips: boolean;
26
+ protected showAllSelectionBtn: boolean;
27
+ protected showPlaceholder: boolean;
28
+ protected showExpandedSelectionActions: boolean;
29
+ protected showSelectAllCheckbox: boolean;
30
+ protected chipsContainerClasses: {
31
+ "-two": boolean;
32
+ "-three": boolean;
33
+ "-four": boolean;
34
+ "-many": boolean;
35
+ };
23
36
  private _overlayRef;
24
37
  private _portal;
25
38
  private _destroy;
@@ -34,22 +47,28 @@ export declare class AutocompleteComponent implements AfterViewInit, ControlValu
34
47
  placeholder: string;
35
48
  emptyMessage: string;
36
49
  selectAll: boolean;
50
+ allOptionsSelectedText: string | null;
37
51
  constructor(formBuilder: FormBuilder, overlay: Overlay, viewContainerRef: ViewContainerRef, change: ChangeDetectorRef);
38
52
  ngAfterViewInit(): void;
39
53
  private handleInputChange;
54
+ private listenSelectionChange;
40
55
  private handleSelectionChange;
56
+ private updateChipsContainerClasses;
41
57
  handleOptionSelected(item: any): void;
42
58
  handleAutocompleteClick(): void;
59
+ protected handleChipsListActionClick(): void;
43
60
  showOptions(): void;
44
61
  private getOverlayConfig;
45
62
  hideOptions(): void;
46
63
  handleClick(event: MouseEvent): void;
47
64
  get selectedOptions(): any[];
48
- handleSelectAll(event: Event): void;
65
+ handleSelectAll(checked: boolean): void;
49
66
  selectAllOptions(selected: boolean): void;
50
67
  handleChipAction(option: any): void;
51
68
  display(option: any): string | undefined;
52
- getMoreItems(scrollIndex: number): void;
69
+ getMoreItems(): void;
70
+ private updateFormControls;
71
+ protected updateValidation(): void;
53
72
  writeValue(obj: any[] | any): void;
54
73
  onChange: (_: any) => void;
55
74
  registerOnChange(fn: any): void;
@@ -57,5 +76,5 @@ export declare class AutocompleteComponent implements AfterViewInit, ControlValu
57
76
  registerOnTouched(fn: any): void;
58
77
  setDisabledState(isDisabled: boolean): void;
59
78
  static ɵfac: i0.ɵɵFactoryDeclaration<AutocompleteComponent, never>;
60
- static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteComponent, "ask-autocomplete", never, { "filterFn": { "alias": "filterFn"; "required": false; }; "displayFn": { "alias": "displayFn"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "valueProp": { "alias": "valueProp"; "required": false; }; "options": { "alias": "options"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "selectAll": { "alias": "selectAll"; "required": false; }; }, {}, never, never, false, never>;
79
+ static ɵcmp: i0.ɵɵComponentDeclaration<AutocompleteComponent, "ask-autocomplete", never, { "filterFn": { "alias": "filterFn"; "required": false; }; "displayFn": { "alias": "displayFn"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "valueProp": { "alias": "valueProp"; "required": false; }; "options": { "alias": "options"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "selectAll": { "alias": "selectAll"; "required": false; }; "allOptionsSelectedText": { "alias": "allOptionsSelectedText"; "required": false; }; }, {}, never, never, false, never>;
61
80
  }
@@ -0,0 +1,20 @@
1
+ import { ElementRef, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class BadgeDirective implements OnChanges, OnDestroy {
4
+ private elRef;
5
+ private document;
6
+ askBadge: number | null;
7
+ badgePosition: 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right';
8
+ badgeCustomClasses?: string;
9
+ badgeVariant: 'secondary' | 'primary';
10
+ badgeSize: 'regular' | 'large' | 'small';
11
+ badgeElement: HTMLElement | null;
12
+ constructor(elRef: ElementRef, document: Document);
13
+ ngOnChanges(changes: SimpleChanges): void;
14
+ ngOnDestroy(): void;
15
+ private updateBadgeText;
16
+ private createBadge;
17
+ private addClasses;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<BadgeDirective, never>;
19
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BadgeDirective, "[askBadge]", never, { "askBadge": { "alias": "askBadge"; "required": false; }; "badgePosition": { "alias": "badgePosition"; "required": false; }; "badgeCustomClasses": { "alias": "badgeCustomClasses"; "required": false; }; "badgeVariant": { "alias": "badgeVariant"; "required": false; }; "badgeSize": { "alias": "badgeSize"; "required": false; }; }, {}, never, never, false, never>;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asksuite-citrus",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
package/public-api.d.ts CHANGED
@@ -13,3 +13,4 @@ export * from './lib/components/date-picker/date-picker-calendar/date-picker-cal
13
13
  export * from './lib/components/skeleton/skeleton.component';
14
14
  export * from './lib/directives/ask-dropdown.directive';
15
15
  export * from './lib/directives/spinner/spinner.directive';
16
+ export * from './lib/directives/badge/badge.directive';
@@ -0,0 +1,83 @@
1
+ .scale-in-center {
2
+ -webkit-animation: scale-in-center 0.3s ease-in-out both;
3
+ animation: scale-in-center 0.3s ease-in-out both;
4
+ }
5
+
6
+ /* ----------------------------------------------
7
+ * Generated by Animista on 2023-9-6 16:3:54
8
+ * Licensed under FreeBSD License.
9
+ * See http://animista.net/license for more info.
10
+ * w: http://animista.net, t: @cssanimista
11
+ * ---------------------------------------------- */
12
+
13
+ /**
14
+ * ----------------------------------------
15
+ * animation scale-in-center
16
+ * ----------------------------------------
17
+ */
18
+ @-webkit-keyframes scale-in-center {
19
+ 0% {
20
+ -webkit-transform: scale(0);
21
+ transform: scale(0);
22
+ opacity: 1;
23
+ }
24
+ 100% {
25
+ -webkit-transform: scale(1);
26
+ transform: scale(1);
27
+ opacity: 1;
28
+ }
29
+ }
30
+ @keyframes scale-in-center {
31
+ 0% {
32
+ -webkit-transform: scale(0);
33
+ transform: scale(0);
34
+ opacity: 1;
35
+ }
36
+ 100% {
37
+ -webkit-transform: scale(1);
38
+ transform: scale(1);
39
+ opacity: 1;
40
+ }
41
+ }
42
+
43
+ .scale-out-center {
44
+ -webkit-animation: scale-out-center 0.3s ease-in-out both;
45
+ animation: scale-out-center 0.3s ease-in-out both;
46
+ }
47
+
48
+ /* ----------------------------------------------
49
+ * Generated by Animista on 2023-9-6 16:4:36
50
+ * Licensed under FreeBSD License.
51
+ * See http://animista.net/license for more info.
52
+ * w: http://animista.net, t: @cssanimista
53
+ * ---------------------------------------------- */
54
+
55
+ /**
56
+ * ----------------------------------------
57
+ * animation scale-out-center
58
+ * ----------------------------------------
59
+ */
60
+ @-webkit-keyframes scale-out-center {
61
+ 0% {
62
+ -webkit-transform: scale(1);
63
+ transform: scale(1);
64
+ opacity: 1;
65
+ }
66
+ 100% {
67
+ -webkit-transform: scale(0);
68
+ transform: scale(0);
69
+ opacity: 1;
70
+ }
71
+ }
72
+ @keyframes scale-out-center {
73
+ 0% {
74
+ -webkit-transform: scale(1);
75
+ transform: scale(1);
76
+ opacity: 1;
77
+ }
78
+ 100% {
79
+ -webkit-transform: scale(0);
80
+ transform: scale(0);
81
+ opacity: 1;
82
+ }
83
+ }
@@ -68,3 +68,67 @@
68
68
  input {
69
69
  font-size: $font-md;
70
70
  }
71
+
72
+ /**
73
+ Badge
74
+ */
75
+
76
+ .ask-badge {
77
+ position: relative;
78
+
79
+ > .badge {
80
+ position: absolute;
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+ background-color: var(--bg-color);
85
+ color: #fff;
86
+ font-size: 12px;
87
+ text-overflow: ellipsis;
88
+ white-space: nowrap;
89
+ overflow: hidden;
90
+ border-radius: 50%;
91
+ box-shadow: 0 2px 6px -1px rgb(0 0 0 / 50%);
92
+ }
93
+
94
+ > .badge.-primary {
95
+ --bg-color: var(--asksuite-orange);
96
+ }
97
+
98
+ > .badge.-secondary {
99
+ --bg-color: var(--grey-800);
100
+ }
101
+
102
+ > .badge.-top {
103
+ top: -10px;
104
+ }
105
+ > .badge.-bottom {
106
+ bottom: -10px;
107
+ }
108
+
109
+ > .badge.-left {
110
+ left: -10px;
111
+ }
112
+
113
+ > .badge.-right {
114
+ right: -10px;
115
+ }
116
+
117
+ > .badge.-small {
118
+ width: 18px;
119
+ height: 18px;
120
+ font-size: 10px;
121
+ }
122
+ > .badge.-regular {
123
+ width: 22px;
124
+ height: 22px;
125
+ font-size: 11px;
126
+ }
127
+
128
+ > .badge.-large {
129
+ width: 28px;
130
+ height: 28px;
131
+ font-size: 12px;
132
+ }
133
+ }
134
+
@@ -7,3 +7,4 @@
7
7
  @import './font-weights';
8
8
  @import './radii';
9
9
  @import './helpers';
10
+ @import './animations';