@vsn-ux/ngx-gaia 0.10.1 → 0.10.3
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/DOCS.md +24 -0
- package/fesm2022/vsn-ux-ngx-gaia.mjs +20 -9
- package/fesm2022/vsn-ux-ngx-gaia.mjs.map +1 -1
- package/index.d.ts +12 -11
- package/package.json +1 -1
package/DOCS.md
CHANGED
|
@@ -1114,6 +1114,7 @@ Segmented control container component.
|
|
|
1114
1114
|
#### Inputs:
|
|
1115
1115
|
|
|
1116
1116
|
- `selected: any` - Selected value
|
|
1117
|
+
- `compareFn: (o1: any, o2: any) => boolean` - Comparison function for object values (default: `(a, b) => a === b`)
|
|
1117
1118
|
|
|
1118
1119
|
#### Outputs:
|
|
1119
1120
|
|
|
@@ -1164,6 +1165,29 @@ Icon buttons
|
|
|
1164
1165
|
</ga-segmented-control>
|
|
1165
1166
|
```
|
|
1166
1167
|
|
|
1168
|
+
Object values with compareFn
|
|
1169
|
+
|
|
1170
|
+
```html
|
|
1171
|
+
<ga-segmented-control [(selected)]="selectedOption" [compareFn]="compareById">
|
|
1172
|
+
<ga-segmented-control-text-button [value]="options[0]"
|
|
1173
|
+
>{{ options[0].label }}</ga-segmented-control-text-button
|
|
1174
|
+
>
|
|
1175
|
+
<ga-segmented-control-text-button [value]="options[1]"
|
|
1176
|
+
>{{ options[1].label }}</ga-segmented-control-text-button
|
|
1177
|
+
>
|
|
1178
|
+
</ga-segmented-control>
|
|
1179
|
+
```
|
|
1180
|
+
|
|
1181
|
+
```typescript
|
|
1182
|
+
options = [
|
|
1183
|
+
{ id: 1, label: 'Table' },
|
|
1184
|
+
{ id: 2, label: 'List' },
|
|
1185
|
+
];
|
|
1186
|
+
selectedOption = { id: 1, label: 'Table' };
|
|
1187
|
+
compareById = (a: typeOfOption | null, b: typeOfOption | null) =>
|
|
1188
|
+
a?.id === b?.id;
|
|
1189
|
+
```
|
|
1190
|
+
|
|
1167
1191
|
## Select
|
|
1168
1192
|
|
|
1169
1193
|
Select components for dropdown selections with multi-select capabilities. Use for static selects where all options are loaded upfront.
|
|
@@ -1911,9 +1911,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
1911
1911
|
|
|
1912
1912
|
class GaSegmentedControlComponent {
|
|
1913
1913
|
selected = model();
|
|
1914
|
+
compareFn = input((a, b) => a === b);
|
|
1914
1915
|
change = output();
|
|
1916
|
+
safeCompareFn = computed(() => {
|
|
1917
|
+
const compareFn = this.compareFn();
|
|
1918
|
+
return (o1, o2) => {
|
|
1919
|
+
if (o1 === null || o1 === undefined || o2 === null || o2 === undefined) {
|
|
1920
|
+
return o1 === o2;
|
|
1921
|
+
}
|
|
1922
|
+
return compareFn(o1, o2);
|
|
1923
|
+
};
|
|
1924
|
+
});
|
|
1915
1925
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1916
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaSegmentedControlComponent, isStandalone: true, selector: "ga-segmented-control", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", change: "change" }, host: { attributes: { "role": "group" }, classAttribute: "ga-segmented-control" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1926
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaSegmentedControlComponent, isStandalone: true, selector: "ga-segmented-control", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, compareFn: { classPropertyName: "compareFn", publicName: "compareFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", change: "change" }, host: { attributes: { "role": "group" }, classAttribute: "ga-segmented-control" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1917
1927
|
}
|
|
1918
1928
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaSegmentedControlComponent, decorators: [{
|
|
1919
1929
|
type: Component,
|
|
@@ -1935,9 +1945,12 @@ class GaSegmentedControlButtonDirective {
|
|
|
1935
1945
|
});
|
|
1936
1946
|
value = input();
|
|
1937
1947
|
selected = computed(() => {
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1948
|
+
const value = this.value();
|
|
1949
|
+
const selectedValue = this.group.selected();
|
|
1950
|
+
if (value === undefined || selectedValue === undefined) {
|
|
1951
|
+
return false;
|
|
1952
|
+
}
|
|
1953
|
+
return this.group.safeCompareFn()(selectedValue, value);
|
|
1941
1954
|
});
|
|
1942
1955
|
onClick() {
|
|
1943
1956
|
this.group.selected.set(this.value());
|
|
@@ -5751,7 +5764,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImpor
|
|
|
5751
5764
|
}] });
|
|
5752
5765
|
|
|
5753
5766
|
class GaChipListboxComponent {
|
|
5754
|
-
cdkListbox = inject(CdkListbox, { self: true });
|
|
5767
|
+
cdkListbox = inject((CdkListbox), { self: true });
|
|
5755
5768
|
orientation = input('horizontal');
|
|
5756
5769
|
variant = input('default');
|
|
5757
5770
|
valueChange = output();
|
|
@@ -5763,8 +5776,7 @@ class GaChipListboxComponent {
|
|
|
5763
5776
|
this.cdkListbox.valueChange
|
|
5764
5777
|
.pipe(takeUntilDestroyed())
|
|
5765
5778
|
.subscribe((event) => {
|
|
5766
|
-
|
|
5767
|
-
this.valueChange.emit(value);
|
|
5779
|
+
this.valueChange.emit(event.value);
|
|
5768
5780
|
});
|
|
5769
5781
|
}
|
|
5770
5782
|
focus() {
|
|
@@ -5795,7 +5807,6 @@ class GaChipComponent {
|
|
|
5795
5807
|
listbox = inject(GaChipListboxComponent);
|
|
5796
5808
|
_isSelected = signal(null);
|
|
5797
5809
|
selected = this._isSelected.asReadonly();
|
|
5798
|
-
value = input.required();
|
|
5799
5810
|
disabled = input(false, { transform: booleanAttribute });
|
|
5800
5811
|
constructor() {
|
|
5801
5812
|
afterEveryRender({
|
|
@@ -5807,7 +5818,7 @@ class GaChipComponent {
|
|
|
5807
5818
|
});
|
|
5808
5819
|
}
|
|
5809
5820
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5810
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaChipComponent, isStandalone: true, selector: "ga-chip", inputs: {
|
|
5821
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.4", type: GaChipComponent, isStandalone: true, selector: "ga-chip", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ga-quick-filter-button--transparent": "listbox.variant() === 'transparent'", "class.ga-quick-filter-button--disabled": "disabled() || listbox.disabled()", "class.ga-quick-filter-button--selected": "selected()" }, classAttribute: "ga-quick-filter-button" }, hostDirectives: [{ directive: i1$5.CdkOption, inputs: ["cdkOption", "value", "cdkOptionDisabled", "disabled"] }], ngImport: i0, template: "<ng-content />\n", dependencies: [{ kind: "ngmodule", type: CdkListboxModule }] });
|
|
5811
5822
|
}
|
|
5812
5823
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.4", ngImport: i0, type: GaChipComponent, decorators: [{
|
|
5813
5824
|
type: Component,
|