@theseam/ui-common 2.0.1-beta.99 → 2.1.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.
- package/ai/index.d.ts +1 -363
- package/carousel/index.d.ts +1 -21
- package/data-filters/index.d.ts +30 -6
- package/datatable/index.d.ts +3 -299
- package/datatable-alterations-display/index.d.ts +1 -61
- package/fesm2022/theseam-ui-common-ai.mjs +1 -1368
- package/fesm2022/theseam-ui-common-ai.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-carousel.mjs +1 -48
- package/fesm2022/theseam-ui-common-carousel.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-data-filters.mjs +61 -18
- package/fesm2022/theseam-ui-common-data-filters.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs +1 -197
- package/fesm2022/theseam-ui-common-datatable-alterations-display.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-datatable.mjs +4 -668
- package/fesm2022/theseam-ui-common-datatable.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-file-input.mjs +1 -156
- package/fesm2022/theseam-ui-common-file-input.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-google-maps.mjs +299 -218
- package/fesm2022/theseam-ui-common-google-maps.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-icon.mjs +1 -72
- package/fesm2022/theseam-ui-common-icon.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-table-cell-types.mjs +0 -4
- package/fesm2022/theseam-ui-common-table-cell-types.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-toggle-group.mjs +81 -112
- package/fesm2022/theseam-ui-common-toggle-group.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-tooltip.mjs +1 -110
- package/fesm2022/theseam-ui-common-tooltip.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-utils.mjs +112 -21
- package/fesm2022/theseam-ui-common-utils.mjs.map +1 -1
- package/fesm2022/theseam-ui-common-widget.mjs +1 -23
- package/fesm2022/theseam-ui-common-widget.mjs.map +1 -1
- package/file-input/index.d.ts +1 -78
- package/google-maps/index.d.ts +35 -23
- package/icon/index.d.ts +3 -33
- package/package.json +5 -2
- package/toggle-group/index.d.ts +42 -18
- package/tooltip/index.d.ts +2 -40
- package/utils/index.d.ts +38 -6
- package/widget/index.d.ts +2 -17
|
@@ -1,38 +1,25 @@
|
|
|
1
|
-
import { coerceBooleanProperty, coerceArray } from '@angular/cdk/coercion';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { InjectionToken, inject, HostBinding, Input, Directive, forwardRef, EventEmitter, ContentChildren, Output, NgModule } from '@angular/core';
|
|
4
3
|
import { __decorate } from 'tslib';
|
|
4
|
+
import { coerceArray } from '@angular/cdk/coercion';
|
|
5
5
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
|
-
import { Subject, of, combineLatest, from } from 'rxjs';
|
|
7
|
-
import { startWith, map, takeUntil, switchMap, filter, tap } from 'rxjs/operators';
|
|
8
6
|
import { InputBoolean } from '@theseam/ui-common/core';
|
|
9
7
|
|
|
8
|
+
const THESEAM_TOGGLE_GROUP_PARENT = new InjectionToken('TheSeamToggleGroupParent');
|
|
9
|
+
|
|
10
10
|
class ToggleGroupOptionDirective {
|
|
11
|
-
|
|
11
|
+
_group = inject(THESEAM_TOGGLE_GROUP_PARENT, {
|
|
12
|
+
optional: true,
|
|
13
|
+
});
|
|
12
14
|
seamToggleGroupOption;
|
|
13
|
-
get selected() {
|
|
14
|
-
return this._selected;
|
|
15
|
-
}
|
|
16
|
-
set selected(value) {
|
|
17
|
-
if (!this._canUnselect && !value) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
this._selected = coerceBooleanProperty(value);
|
|
21
|
-
this.selectionChange.emit(this._selected);
|
|
22
|
-
this._cdr.markForCheck();
|
|
23
|
-
}
|
|
24
|
-
_selected = false;
|
|
25
|
-
/** Internal use only for now. */
|
|
26
|
-
_canUnselect = true;
|
|
27
|
-
selectionChange = new EventEmitter();
|
|
28
15
|
get _checkioSelectedClass() {
|
|
29
|
-
return this.
|
|
16
|
+
return this._group?.isSelected(this.value) || false;
|
|
30
17
|
}
|
|
31
18
|
get value() {
|
|
32
19
|
return this.seamToggleGroupOption;
|
|
33
20
|
}
|
|
34
21
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ToggleGroupOptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
35
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: ToggleGroupOptionDirective, isStandalone: true, selector: "[seamToggleGroupOption]", inputs: { seamToggleGroupOption: "seamToggleGroupOption"
|
|
22
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: ToggleGroupOptionDirective, isStandalone: true, selector: "[seamToggleGroupOption]", inputs: { seamToggleGroupOption: "seamToggleGroupOption" }, host: { properties: { "class.lib-toggle-group-option-selected": "this._checkioSelectedClass" } }, exportAs: ["seamToggleGroupOption"], ngImport: i0 });
|
|
36
23
|
}
|
|
37
24
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ToggleGroupOptionDirective, decorators: [{
|
|
38
25
|
type: Directive,
|
|
@@ -42,10 +29,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
42
29
|
}]
|
|
43
30
|
}], propDecorators: { seamToggleGroupOption: [{
|
|
44
31
|
type: Input
|
|
45
|
-
}], selected: [{
|
|
46
|
-
type: Input
|
|
47
|
-
}], selectionChange: [{
|
|
48
|
-
type: Output
|
|
49
32
|
}], _checkioSelectedClass: [{
|
|
50
33
|
type: HostBinding,
|
|
51
34
|
args: ['class.lib-toggle-group-option-selected']
|
|
@@ -60,7 +43,6 @@ class ToggleGroupDirective {
|
|
|
60
43
|
static ngAcceptInputType_disabled;
|
|
61
44
|
static ngAcceptInputType_multiple;
|
|
62
45
|
static ngAcceptInputType_selectionToggleable;
|
|
63
|
-
_ngUnsubscribe = new Subject();
|
|
64
46
|
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
65
47
|
val;
|
|
66
48
|
disabled = false;
|
|
@@ -70,47 +52,11 @@ class ToggleGroupDirective {
|
|
|
70
52
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
71
53
|
change = new EventEmitter();
|
|
72
54
|
optionDirectives;
|
|
73
|
-
options;
|
|
74
55
|
onChange;
|
|
75
56
|
onTouched;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
ngAfterViewInit() {
|
|
81
|
-
setTimeout(() => {
|
|
82
|
-
this._updateDirectiveStates();
|
|
83
|
-
if (this.optionDirectives) {
|
|
84
|
-
this.options = this.optionDirectives.changes.pipe(startWith(this.optionDirectives), map((v) => v.toArray()), takeUntil(this._ngUnsubscribe));
|
|
85
|
-
this.options
|
|
86
|
-
.pipe(switchMap((opts) => {
|
|
87
|
-
const _tmp = of(undefined);
|
|
88
|
-
if (opts) {
|
|
89
|
-
const _v = [];
|
|
90
|
-
for (const opt of opts) {
|
|
91
|
-
_v.push(opt.selectionChange.pipe(filter((v) => opt.selected !== this.isSelected(opt.value)), tap((v) => {
|
|
92
|
-
if (this.isSelected(opt.value)) {
|
|
93
|
-
this.unselectValue(opt.value);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
this.selectValue(opt.value);
|
|
97
|
-
}
|
|
98
|
-
})));
|
|
99
|
-
}
|
|
100
|
-
return combineLatest(_v);
|
|
101
|
-
}
|
|
102
|
-
return _tmp;
|
|
103
|
-
}), takeUntil(this._ngUnsubscribe))
|
|
104
|
-
.subscribe();
|
|
105
|
-
}
|
|
106
|
-
this.change
|
|
107
|
-
.pipe(switchMap((_) => from(this.optionDirectives?.toArray() || []).pipe(tap((opt) => {
|
|
108
|
-
this._updateDirectiveState(opt);
|
|
109
|
-
}))), takeUntil(this._ngUnsubscribe))
|
|
110
|
-
.subscribe();
|
|
111
|
-
});
|
|
112
|
-
this.optionDirectives?.changes.subscribe(() => this._updateDirectiveStates());
|
|
113
|
-
}
|
|
57
|
+
_selectedSet;
|
|
58
|
+
_selectedSetSource;
|
|
59
|
+
_selectedSetMultiple;
|
|
114
60
|
get value() {
|
|
115
61
|
return this.val;
|
|
116
62
|
}
|
|
@@ -142,17 +88,63 @@ class ToggleGroupDirective {
|
|
|
142
88
|
this.disabled = isDisabled;
|
|
143
89
|
}
|
|
144
90
|
isSelected(value) {
|
|
91
|
+
if (value === null || value === undefined) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return this._selected().has(value);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The current selection as a set, rebuilt only when the value (or `multiple`)
|
|
98
|
+
* changes.
|
|
99
|
+
*
|
|
100
|
+
* `isSelected` is called from templates and from every option's host binding,
|
|
101
|
+
* so it runs several times per option per change detection pass. Hashing the
|
|
102
|
+
* selection once keeps those lookups O(1) instead of scanning the value array
|
|
103
|
+
* on every call.
|
|
104
|
+
*
|
|
105
|
+
* Invalidation is keyed on the `val` reference rather than done in the `value`
|
|
106
|
+
* setter, because `val` is also written directly by the `[value]` input, which
|
|
107
|
+
* does not go through the setter.
|
|
108
|
+
*/
|
|
109
|
+
_selected() {
|
|
110
|
+
if (this._selectedSet === undefined ||
|
|
111
|
+
this.val !== this._selectedSetSource ||
|
|
112
|
+
this.multiple !== this._selectedSetMultiple) {
|
|
113
|
+
this._selectedSetSource = this.val;
|
|
114
|
+
this._selectedSetMultiple = this.multiple;
|
|
115
|
+
this._selectedSet = this._buildSelectedSet();
|
|
116
|
+
}
|
|
117
|
+
return this._selectedSet;
|
|
118
|
+
}
|
|
119
|
+
_buildSelectedSet() {
|
|
120
|
+
const val = this.val;
|
|
145
121
|
if (this.multiple) {
|
|
146
|
-
|
|
147
|
-
return idx !== -1;
|
|
122
|
+
return new Set(val ?? []);
|
|
148
123
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
124
|
+
// TODO: Clean this up when the directive no longer allows array value type when multiple is false
|
|
125
|
+
const v = Array.isArray(val) && val.length === 1 ? val[0] : val;
|
|
126
|
+
return typeof v === 'string' ? new Set([v]) : new Set();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Toggles an option's selected state by value.
|
|
130
|
+
*/
|
|
131
|
+
toggleOptionSelect(value) {
|
|
132
|
+
if (this.isSelected(value)) {
|
|
133
|
+
if (!this.selectionToggleable && this._selectedCount() <= 1) {
|
|
134
|
+
// Unselecting would leave nothing selected.
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.unselectValue(value);
|
|
138
|
+
return;
|
|
155
139
|
}
|
|
140
|
+
this.selectValue(value);
|
|
141
|
+
}
|
|
142
|
+
_selectedCount() {
|
|
143
|
+
if (this.multiple) {
|
|
144
|
+
return (this.value || []).length;
|
|
145
|
+
}
|
|
146
|
+
const v = this.value;
|
|
147
|
+
return v === null || v === undefined || v === '' ? 0 : 1;
|
|
156
148
|
}
|
|
157
149
|
unselectValue(value) {
|
|
158
150
|
if (this.multiple) {
|
|
@@ -177,43 +169,14 @@ class ToggleGroupDirective {
|
|
|
177
169
|
}
|
|
178
170
|
return this.optionDirectives.toArray().find((opt) => opt.value === value);
|
|
179
171
|
}
|
|
180
|
-
_updateDirectiveStates() {
|
|
181
|
-
if (this.optionDirectives) {
|
|
182
|
-
for (const opt of this.optionDirectives.toArray()) {
|
|
183
|
-
this._updateDirectiveState(opt);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
_updateDirectiveState(opt) {
|
|
188
|
-
const selected = this.isSelected(opt.value);
|
|
189
|
-
if (opt.selected !== selected) {
|
|
190
|
-
if (!opt._canUnselect) {
|
|
191
|
-
opt._canUnselect = true;
|
|
192
|
-
}
|
|
193
|
-
opt.selected = selected;
|
|
194
|
-
}
|
|
195
|
-
if (!this.selectionToggleable) {
|
|
196
|
-
if (!this.multiple || (this.value && this.value.length <= 1)) {
|
|
197
|
-
if (opt.selected) {
|
|
198
|
-
if (opt._canUnselect) {
|
|
199
|
-
opt._canUnselect = false;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
if (!opt._canUnselect) {
|
|
204
|
-
opt._canUnselect = true;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
if (!opt._canUnselect) {
|
|
210
|
-
opt._canUnselect = true;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
172
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ToggleGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
216
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: ToggleGroupDirective, isStandalone: true, selector: "[seamToggleGroup]", inputs: { val: ["value", "val"], disabled: "disabled", multiple: "multiple", selectionToggleable: "selectionToggleable" }, outputs: { change: "change" }, providers: [
|
|
173
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: ToggleGroupDirective, isStandalone: true, selector: "[seamToggleGroup]", inputs: { val: ["value", "val"], disabled: "disabled", multiple: "multiple", selectionToggleable: "selectionToggleable" }, outputs: { change: "change" }, providers: [
|
|
174
|
+
TOGGLE_GROUP_VALUE_ACCESSOR,
|
|
175
|
+
{
|
|
176
|
+
provide: THESEAM_TOGGLE_GROUP_PARENT,
|
|
177
|
+
useExisting: forwardRef(() => ToggleGroupDirective),
|
|
178
|
+
},
|
|
179
|
+
], queries: [{ propertyName: "optionDirectives", predicate: ToggleGroupOptionDirective }], exportAs: ["seamToggleGroup"], ngImport: i0 });
|
|
217
180
|
}
|
|
218
181
|
__decorate([
|
|
219
182
|
InputBoolean()
|
|
@@ -229,7 +192,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
229
192
|
args: [{
|
|
230
193
|
selector: '[seamToggleGroup]',
|
|
231
194
|
exportAs: 'seamToggleGroup',
|
|
232
|
-
providers: [
|
|
195
|
+
providers: [
|
|
196
|
+
TOGGLE_GROUP_VALUE_ACCESSOR,
|
|
197
|
+
{
|
|
198
|
+
provide: THESEAM_TOGGLE_GROUP_PARENT,
|
|
199
|
+
useExisting: forwardRef(() => ToggleGroupDirective),
|
|
200
|
+
},
|
|
201
|
+
],
|
|
233
202
|
}]
|
|
234
203
|
}], propDecorators: { val: [{
|
|
235
204
|
type: Input,
|
|
@@ -264,5 +233,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
264
233
|
* Generated bundle index. Do not edit.
|
|
265
234
|
*/
|
|
266
235
|
|
|
267
|
-
export { TOGGLE_GROUP_VALUE_ACCESSOR, TheSeamToggleGroupModule, ToggleGroupDirective, ToggleGroupOptionDirective };
|
|
236
|
+
export { THESEAM_TOGGLE_GROUP_PARENT, TOGGLE_GROUP_VALUE_ACCESSOR, TheSeamToggleGroupModule, ToggleGroupDirective, ToggleGroupOptionDirective };
|
|
268
237
|
//# sourceMappingURL=theseam-ui-common-toggle-group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theseam-ui-common-toggle-group.mjs","sources":["../../../projects/ui-common/toggle-group/toggle-group-option.directive.ts","../../../projects/ui-common/toggle-group/toggle-group.directive.ts","../../../projects/ui-common/toggle-group/toggle-group.module.ts","../../../projects/ui-common/toggle-group/theseam-ui-common-toggle-group.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion'\nimport {\n ChangeDetectorRef,\n Directive,\n EventEmitter,\n HostBinding,\n inject,\n Input,\n Output,\n} from '@angular/core'\n\n@Directive({\n selector: '[seamToggleGroupOption]',\n exportAs: 'seamToggleGroupOption',\n})\nexport class ToggleGroupOptionDirective {\n private readonly _cdr = inject(ChangeDetectorRef)\n\n @Input() seamToggleGroupOption: string | undefined | null\n\n @Input()\n get selected(): boolean {\n return this._selected\n }\n set selected(value: boolean) {\n if (!this._canUnselect && !value) {\n return\n }\n this._selected = coerceBooleanProperty(value)\n this.selectionChange.emit(this._selected)\n this._cdr.markForCheck()\n }\n private _selected = false\n\n /** Internal use only for now. */\n _canUnselect = true\n\n @Output() selectionChange = new EventEmitter<boolean>()\n\n @HostBinding('class.lib-toggle-group-option-selected')\n get _checkioSelectedClass() {\n return this._selected\n }\n\n get value(): string | undefined | null {\n return this.seamToggleGroupOption\n }\n}\n","import { BooleanInput, coerceArray } from '@angular/cdk/coercion'\nimport {\n AfterViewInit,\n ContentChildren,\n Directive,\n EventEmitter,\n forwardRef,\n Input,\n OnDestroy,\n Output,\n QueryList,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { combineLatest, from, Observable, of, Subject } from 'rxjs'\nimport {\n filter,\n map,\n startWith,\n switchMap,\n takeUntil,\n tap,\n} from 'rxjs/operators'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\n\nimport { ToggleGroupOptionDirective } from './toggle-group-option.directive'\n\nexport const TOGGLE_GROUP_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleGroupDirective),\n multi: true,\n}\n\n@Directive({\n selector: '[seamToggleGroup]',\n exportAs: 'seamToggleGroup',\n providers: [TOGGLE_GROUP_VALUE_ACCESSOR],\n})\nexport class ToggleGroupDirective\n implements OnDestroy, AfterViewInit, ControlValueAccessor\n{\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_multiple: BooleanInput\n static ngAcceptInputType_selectionToggleable: BooleanInput\n\n private readonly _ngUnsubscribe = new Subject<void>()\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value') val: string | string[] | undefined | null\n\n @Input() @InputBoolean() disabled = false\n @Input() @InputBoolean() multiple = false\n @Input() @InputBoolean() selectionToggleable = true\n\n // TODO: Add min/max selected inputs to make toggling better for multi select\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<\n string | string[] | undefined | null\n >()\n\n @ContentChildren(ToggleGroupOptionDirective)\n optionDirectives?: QueryList<ToggleGroupOptionDirective>\n\n public options?: Observable<ToggleGroupOptionDirective[]>\n\n onChange: any\n onTouched: any\n\n ngOnDestroy() {\n this._ngUnsubscribe.next()\n this._ngUnsubscribe.complete()\n }\n\n ngAfterViewInit() {\n setTimeout(() => {\n this._updateDirectiveStates()\n\n if (this.optionDirectives) {\n this.options = this.optionDirectives.changes.pipe(\n startWith(this.optionDirectives),\n map((v) => v.toArray() as ToggleGroupOptionDirective[]),\n takeUntil(this._ngUnsubscribe),\n )\n\n this.options\n .pipe(\n switchMap((opts) => {\n const _tmp = of(undefined)\n if (opts) {\n const _v: Observable<boolean>[] = []\n for (const opt of opts) {\n _v.push(\n opt.selectionChange.pipe(\n filter(\n (v) => opt.selected !== this.isSelected(opt.value),\n ),\n tap((v) => {\n if (this.isSelected(opt.value)) {\n this.unselectValue(opt.value)\n } else {\n this.selectValue(opt.value)\n }\n }),\n ),\n )\n }\n return combineLatest(_v)\n }\n return _tmp\n }),\n takeUntil(this._ngUnsubscribe),\n )\n .subscribe()\n }\n\n this.change\n .pipe(\n switchMap((_) =>\n from(this.optionDirectives?.toArray() || []).pipe(\n tap((opt) => {\n this._updateDirectiveState(opt)\n }),\n ),\n ),\n takeUntil(this._ngUnsubscribe),\n )\n .subscribe()\n })\n\n this.optionDirectives?.changes.subscribe(() =>\n this._updateDirectiveStates(),\n )\n }\n\n get value(): string | string[] | undefined | null {\n return this.val\n }\n\n set value(value: string | string[] | undefined | null) {\n const _value = this.multiple\n ? value !== null && value !== undefined\n ? coerceArray(value)\n : value\n : value\n\n this.val = this.multiple ? [...((_value as string[]) || [])] : _value || ''\n this.change.emit(this.val)\n if (this.onChange) {\n this.onChange(_value)\n }\n if (this.onTouched) {\n this.onTouched()\n }\n }\n\n writeValue(value: any): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n isSelected(value: string | undefined | null) {\n if (this.multiple) {\n const idx = ((this.value as string[]) || []).findIndex((v) => v === value)\n return idx !== -1\n } else {\n // TODO: Clean this up when the directive no longer allows array value type when multiple is false\n const v =\n Array.isArray(this.value) && this.value.length === 1\n ? this.value[0]\n : this.value\n return v === value\n }\n }\n\n unselectValue(value: string | undefined | null) {\n if (this.multiple) {\n this.value = ((this.value as string[]) || []).filter((v) => v !== value)\n } else {\n this.value = undefined\n }\n }\n\n selectValue(value: string | undefined | null) {\n if (this.multiple) {\n const _value = [...((this.value as string[]) || [])]\n this.value = value ? [..._value, value] : _value\n } else {\n this.value = value\n }\n }\n\n getOptionDirectiveByValue(value: string) {\n if (!this.optionDirectives || this.optionDirectives.length < 1) {\n return null\n }\n\n return this.optionDirectives.toArray().find((opt) => opt.value === value)\n }\n\n private _updateDirectiveStates(): void {\n if (this.optionDirectives) {\n for (const opt of this.optionDirectives.toArray()) {\n this._updateDirectiveState(opt)\n }\n }\n }\n\n private _updateDirectiveState(opt: ToggleGroupOptionDirective): void {\n const selected = this.isSelected(opt.value)\n if (opt.selected !== selected) {\n if (!opt._canUnselect) {\n opt._canUnselect = true\n }\n opt.selected = selected\n }\n if (!this.selectionToggleable) {\n if (!this.multiple || (this.value && this.value.length <= 1)) {\n if (opt.selected) {\n if (opt._canUnselect) {\n opt._canUnselect = false\n }\n } else {\n if (!opt._canUnselect) {\n opt._canUnselect = true\n }\n }\n } else {\n if (!opt._canUnselect) {\n opt._canUnselect = true\n }\n }\n }\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { ToggleGroupOptionDirective } from './toggle-group-option.directive'\nimport { ToggleGroupDirective } from './toggle-group.directive'\n\n@NgModule({\n imports: [ToggleGroupDirective, ToggleGroupOptionDirective],\n exports: [ToggleGroupDirective, ToggleGroupOptionDirective],\n})\nexport class TheSeamToggleGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAea,0BAA0B,CAAA;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAExC,IAAA,qBAAqB;AAE9B,IAAA,IACI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;IACvB;IACA,IAAI,QAAQ,CAAC,KAAc,EAAA;QACzB,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,KAAK,EAAE;YAChC;QACF;AACA,QAAA,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,KAAK,CAAC;QAC7C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;AACzC,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;IAC1B;IACQ,SAAS,GAAG,KAAK;;IAGzB,YAAY,GAAG,IAAI;AAET,IAAA,eAAe,GAAG,IAAI,YAAY,EAAW;AAEvD,IAAA,IACI,qBAAqB,GAAA;QACvB,OAAO,IAAI,CAAC,SAAS;IACvB;AAEA,IAAA,IAAI,KAAK,GAAA;QACP,OAAO,IAAI,CAAC,qBAAqB;IACnC;wGA/BW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,EAAA,qBAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EA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BAKA;;sBAIA,eAAe;uBAAC,0BAA0B;;;MCpDhC,wBAAwB,CAAA;wGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,YAHzB,oBAAoB,EAAE,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAChD,oBAAoB,EAAE,0BAA0B,CAAA,EAAA,CAAA;yGAE/C,wBAAwB,EAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;AAC3D,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;AAC5D,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"theseam-ui-common-toggle-group.mjs","sources":["../../../projects/ui-common/toggle-group/toggle-group-parent.ts","../../../projects/ui-common/toggle-group/toggle-group-option.directive.ts","../../../projects/ui-common/toggle-group/toggle-group.directive.ts","../../../projects/ui-common/toggle-group/toggle-group.module.ts","../../../projects/ui-common/toggle-group/theseam-ui-common-toggle-group.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core'\n\n/**\n * The part of the toggle group that an option needs in order to resolve its own\n * selected state.\n *\n * This exists as a separate token so `ToggleGroupOptionDirective` can reach its\n * parent group without importing `ToggleGroupDirective`, which would create a\n * circular import between the two directives.\n */\nexport interface TheSeamToggleGroupParent {\n isSelected(value: string | undefined | null): boolean\n}\n\nexport const THESEAM_TOGGLE_GROUP_PARENT =\n new InjectionToken<TheSeamToggleGroupParent>('TheSeamToggleGroupParent')\n","import { Directive, HostBinding, inject, Input } from '@angular/core'\n\nimport { THESEAM_TOGGLE_GROUP_PARENT } from './toggle-group-parent'\n\n@Directive({\n selector: '[seamToggleGroupOption]',\n exportAs: 'seamToggleGroupOption',\n})\nexport class ToggleGroupOptionDirective {\n private readonly _group = inject(THESEAM_TOGGLE_GROUP_PARENT, {\n optional: true,\n })\n\n @Input() seamToggleGroupOption: string | undefined | null\n\n @HostBinding('class.lib-toggle-group-option-selected')\n get _checkioSelectedClass() {\n return this._group?.isSelected(this.value) || false\n }\n\n get value(): string | undefined | null {\n return this.seamToggleGroupOption\n }\n}\n","import { BooleanInput, coerceArray } from '@angular/cdk/coercion'\nimport {\n ContentChildren,\n Directive,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n QueryList,\n} from '@angular/core'\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'\n\nimport { InputBoolean } from '@theseam/ui-common/core'\n\nimport { THESEAM_TOGGLE_GROUP_PARENT } from './toggle-group-parent'\nimport { ToggleGroupOptionDirective } from './toggle-group-option.directive'\n\nexport const TOGGLE_GROUP_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleGroupDirective),\n multi: true,\n}\n\n@Directive({\n selector: '[seamToggleGroup]',\n exportAs: 'seamToggleGroup',\n providers: [\n TOGGLE_GROUP_VALUE_ACCESSOR,\n {\n provide: THESEAM_TOGGLE_GROUP_PARENT,\n useExisting: forwardRef(() => ToggleGroupDirective),\n },\n ],\n})\nexport class ToggleGroupDirective implements ControlValueAccessor {\n static ngAcceptInputType_disabled: BooleanInput\n static ngAcceptInputType_multiple: BooleanInput\n static ngAcceptInputType_selectionToggleable: BooleanInput\n\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('value') val: string | string[] | undefined | null\n\n @Input() @InputBoolean() disabled = false\n @Input() @InputBoolean() multiple = false\n @Input() @InputBoolean() selectionToggleable = true\n\n // TODO: Add min/max selected inputs to make toggling better for multi select\n\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() readonly change = new EventEmitter<\n string | string[] | undefined | null\n >()\n\n @ContentChildren(ToggleGroupOptionDirective)\n optionDirectives?: QueryList<ToggleGroupOptionDirective>\n\n onChange: any\n onTouched: any\n\n private _selectedSet: Set<string> | undefined\n private _selectedSetSource: string | string[] | undefined | null\n private _selectedSetMultiple: boolean | undefined\n\n get value(): string | string[] | undefined | null {\n return this.val\n }\n\n set value(value: string | string[] | undefined | null) {\n const _value = this.multiple\n ? value !== null && value !== undefined\n ? coerceArray(value)\n : value\n : value\n\n this.val = this.multiple ? [...((_value as string[]) || [])] : _value || ''\n this.change.emit(this.val)\n if (this.onChange) {\n this.onChange(_value)\n }\n if (this.onTouched) {\n this.onTouched()\n }\n }\n\n writeValue(value: any): void {\n this.value = value\n }\n\n registerOnChange(fn: any): void {\n this.onChange = fn\n }\n\n registerOnTouched(fn: any): void {\n this.onTouched = fn\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled\n }\n\n isSelected(value: string | undefined | null): boolean {\n if (value === null || value === undefined) {\n return false\n }\n return this._selected().has(value)\n }\n\n /**\n * The current selection as a set, rebuilt only when the value (or `multiple`)\n * changes.\n *\n * `isSelected` is called from templates and from every option's host binding,\n * so it runs several times per option per change detection pass. Hashing the\n * selection once keeps those lookups O(1) instead of scanning the value array\n * on every call.\n *\n * Invalidation is keyed on the `val` reference rather than done in the `value`\n * setter, because `val` is also written directly by the `[value]` input, which\n * does not go through the setter.\n */\n private _selected(): ReadonlySet<string> {\n if (\n this._selectedSet === undefined ||\n this.val !== this._selectedSetSource ||\n this.multiple !== this._selectedSetMultiple\n ) {\n this._selectedSetSource = this.val\n this._selectedSetMultiple = this.multiple\n this._selectedSet = this._buildSelectedSet()\n }\n return this._selectedSet\n }\n\n private _buildSelectedSet(): Set<string> {\n const val = this.val\n\n if (this.multiple) {\n return new Set((val as string[]) ?? [])\n }\n\n // TODO: Clean this up when the directive no longer allows array value type when multiple is false\n const v = Array.isArray(val) && val.length === 1 ? val[0] : val\n return typeof v === 'string' ? new Set([v]) : new Set()\n }\n\n /**\n * Toggles an option's selected state by value.\n */\n toggleOptionSelect(value: string | undefined | null): void {\n if (this.isSelected(value)) {\n if (!this.selectionToggleable && this._selectedCount() <= 1) {\n // Unselecting would leave nothing selected.\n return\n }\n this.unselectValue(value)\n return\n }\n\n this.selectValue(value)\n }\n\n private _selectedCount(): number {\n if (this.multiple) {\n return ((this.value as string[]) || []).length\n }\n const v = this.value\n return v === null || v === undefined || v === '' ? 0 : 1\n }\n\n unselectValue(value: string | undefined | null) {\n if (this.multiple) {\n this.value = ((this.value as string[]) || []).filter((v) => v !== value)\n } else {\n this.value = undefined\n }\n }\n\n selectValue(value: string | undefined | null) {\n if (this.multiple) {\n const _value = [...((this.value as string[]) || [])]\n this.value = value ? [..._value, value] : _value\n } else {\n this.value = value\n }\n }\n\n getOptionDirectiveByValue(\n value: string,\n ): ToggleGroupOptionDirective | null | undefined {\n if (!this.optionDirectives || this.optionDirectives.length < 1) {\n return null\n }\n\n return this.optionDirectives.toArray().find((opt) => opt.value === value)\n }\n}\n","import { NgModule } from '@angular/core'\n\nimport { ToggleGroupOptionDirective } from './toggle-group-option.directive'\nimport { ToggleGroupDirective } from './toggle-group.directive'\n\n@NgModule({\n imports: [ToggleGroupDirective, ToggleGroupOptionDirective],\n exports: [ToggleGroupDirective, ToggleGroupOptionDirective],\n})\nexport class TheSeamToggleGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAca,2BAA2B,GACtC,IAAI,cAAc,CAA2B,0BAA0B;;MCP5D,0BAA0B,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,2BAA2B,EAAE;AAC5D,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAC;AAEO,IAAA,qBAAqB;AAE9B,IAAA,IACI,qBAAqB,GAAA;AACvB,QAAA,OAAO,IAAI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W,EAAE,UAAU,CAAC,0BAA0B,CAAC;AACpD,yBAAA;AACF,qBAAA;AACF,iBAAA;;sBAOE,KAAK;uBAAC,OAAO;;sBAEb;;sBACA;;sBACA;;sBAKA;;sBAIA,eAAe;uBAAC,0BAA0B;;;MC5ChC,wBAAwB,CAAA;wGAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAxB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,YAHzB,oBAAoB,EAAE,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAChD,oBAAoB,EAAE,0BAA0B,CAAA,EAAA,CAAA;yGAE/C,wBAAwB,EAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAJpC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;AAC3D,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;AAC5D,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -8,7 +8,6 @@ import { Subject, BehaviorSubject, fromEvent } from 'rxjs';
|
|
|
8
8
|
import { filter, takeUntil } from 'rxjs/operators';
|
|
9
9
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
10
10
|
import { NgIf, NgClass, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
11
|
-
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
12
11
|
|
|
13
12
|
class TheSeamTooltipComponent {
|
|
14
13
|
content = null;
|
|
@@ -744,117 +743,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
744
743
|
}]
|
|
745
744
|
}] });
|
|
746
745
|
|
|
747
|
-
/**
|
|
748
|
-
* Harness for interacting with tooltip directives in tests
|
|
749
|
-
*/
|
|
750
|
-
class TheSeamTooltipHarness extends ComponentHarness {
|
|
751
|
-
static hostSelector = '[seamTooltip]';
|
|
752
|
-
/**
|
|
753
|
-
* Gets a `HarnessPredicate` that can be used to search for a tooltip with specific attributes
|
|
754
|
-
*/
|
|
755
|
-
static with(options = {}) {
|
|
756
|
-
return new HarnessPredicate(TheSeamTooltipHarness, options);
|
|
757
|
-
}
|
|
758
|
-
/** Hovers over the element to show the tooltip */
|
|
759
|
-
async hover() {
|
|
760
|
-
return (await this.host()).hover();
|
|
761
|
-
}
|
|
762
|
-
/** Moves the mouse away from the element to hide the tooltip */
|
|
763
|
-
async mouseAway() {
|
|
764
|
-
return (await this.host()).mouseAway();
|
|
765
|
-
}
|
|
766
|
-
/** Focuses the element to show the tooltip */
|
|
767
|
-
async focus() {
|
|
768
|
-
return (await this.host()).focus();
|
|
769
|
-
}
|
|
770
|
-
/** Blurs the element to hide the tooltip */
|
|
771
|
-
async blur() {
|
|
772
|
-
return (await this.host()).blur();
|
|
773
|
-
}
|
|
774
|
-
/** Clicks the element */
|
|
775
|
-
async click() {
|
|
776
|
-
return (await this.host()).click();
|
|
777
|
-
}
|
|
778
|
-
/** Gets whether the tooltip is currently visible */
|
|
779
|
-
async isTooltipVisible() {
|
|
780
|
-
const tooltipId = await this._getTooltipId();
|
|
781
|
-
if (!tooltipId) {
|
|
782
|
-
return false;
|
|
783
|
-
}
|
|
784
|
-
const tooltip = await this.documentRootLocatorFactory().locatorForOptional(`#${tooltipId}.tooltip.show`)();
|
|
785
|
-
return tooltip !== null;
|
|
786
|
-
}
|
|
787
|
-
/** Gets the visible tooltip text content */
|
|
788
|
-
async getVisibleTooltipText() {
|
|
789
|
-
const tooltipId = await this._getTooltipId();
|
|
790
|
-
if (!tooltipId) {
|
|
791
|
-
return null;
|
|
792
|
-
}
|
|
793
|
-
const tooltipInner = await this.documentRootLocatorFactory().locatorForOptional(`#${tooltipId} .tooltip-inner`)();
|
|
794
|
-
if (!tooltipInner) {
|
|
795
|
-
return null;
|
|
796
|
-
}
|
|
797
|
-
return tooltipInner.text();
|
|
798
|
-
}
|
|
799
|
-
/** Gets the visible tooltip classes */
|
|
800
|
-
async getVisibleTooltipClasses() {
|
|
801
|
-
const tooltipId = await this._getTooltipId();
|
|
802
|
-
if (!tooltipId) {
|
|
803
|
-
return [];
|
|
804
|
-
}
|
|
805
|
-
const tooltip = await this.documentRootLocatorFactory().locatorForOptional(`#${tooltipId}.tooltip.show`)();
|
|
806
|
-
if (!tooltip) {
|
|
807
|
-
return [];
|
|
808
|
-
}
|
|
809
|
-
const classAttr = await tooltip.getAttribute('class');
|
|
810
|
-
return classAttr ? classAttr.split(' ').filter((c) => c.trim()) : [];
|
|
811
|
-
}
|
|
812
|
-
/** Gets the tooltip ID from the aria-describedby attribute */
|
|
813
|
-
async _getTooltipId() {
|
|
814
|
-
return (await this.host()).getAttribute('aria-describedby');
|
|
815
|
-
}
|
|
816
|
-
/** Waits for the tooltip to appear */
|
|
817
|
-
async waitForTooltipToShow(timeout = 1000) {
|
|
818
|
-
const start = Date.now();
|
|
819
|
-
while (Date.now() - start < timeout) {
|
|
820
|
-
if (await this.isTooltipVisible()) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
824
|
-
}
|
|
825
|
-
throw new Error(`Tooltip did not appear within ${timeout}ms`);
|
|
826
|
-
}
|
|
827
|
-
/** Waits for the tooltip to disappear */
|
|
828
|
-
async waitForTooltipToHide(timeout = 1000) {
|
|
829
|
-
const start = Date.now();
|
|
830
|
-
while (Date.now() - start < timeout) {
|
|
831
|
-
if (!(await this.isTooltipVisible())) {
|
|
832
|
-
return;
|
|
833
|
-
}
|
|
834
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
835
|
-
}
|
|
836
|
-
throw new Error(`Tooltip did not hide within ${timeout}ms`);
|
|
837
|
-
}
|
|
838
|
-
async getTriggerDimensions() {
|
|
839
|
-
const host = await this.host();
|
|
840
|
-
return host.getDimensions();
|
|
841
|
-
}
|
|
842
|
-
async getTooltipDimensions() {
|
|
843
|
-
const tooltipId = await this._getTooltipId();
|
|
844
|
-
if (!tooltipId) {
|
|
845
|
-
return null;
|
|
846
|
-
}
|
|
847
|
-
const tooltip = await this.documentRootLocatorFactory().locatorForOptional(`#${tooltipId}.tooltip.show`)();
|
|
848
|
-
if (!tooltip) {
|
|
849
|
-
return null;
|
|
850
|
-
}
|
|
851
|
-
return tooltip.getDimensions();
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
|
|
855
746
|
/**
|
|
856
747
|
* Generated bundle index. Do not edit.
|
|
857
748
|
*/
|
|
858
749
|
|
|
859
|
-
export { TheSeamTooltipComponent, TheSeamTooltipDirective,
|
|
750
|
+
export { TheSeamTooltipComponent, TheSeamTooltipDirective, TheSeamTooltipModule };
|
|
860
751
|
//# sourceMappingURL=theseam-ui-common-tooltip.mjs.map
|