@dereekb/dbx-web 9.24.16 → 9.24.18
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/calendar/package.json +2 -2
- package/esm2020/lib/interaction/filter/filter.popover.button.directive.mjs +1 -1
- package/esm2020/lib/interaction/filter/filter.popover.component.mjs +28 -14
- package/esm2020/lib/interaction/filter/filter.preset.mjs +9 -4
- package/fesm2015/dereekb-dbx-web.mjs +35 -18
- package/fesm2015/dereekb-dbx-web.mjs.map +1 -1
- package/fesm2020/dereekb-dbx-web.mjs +31 -13
- package/fesm2020/dereekb-dbx-web.mjs.map +1 -1
- package/lib/interaction/filter/filter.popover.button.directive.d.ts +4 -1
- package/lib/interaction/filter/filter.popover.component.d.ts +28 -4
- package/lib/interaction/filter/filter.preset.d.ts +3 -2
- package/mapbox/package.json +3 -3
- package/package.json +3 -3
- package/table/package.json +3 -3
|
@@ -1885,6 +1885,9 @@ class DbxFilterPopoverComponent extends AbstractPopoverDirective {
|
|
|
1885
1885
|
constructor(popover) {
|
|
1886
1886
|
super(popover);
|
|
1887
1887
|
this._closeOnChangeSub = new SubscriptionObject();
|
|
1888
|
+
this.showCloseButton = this.config.showCloseButton ?? !(this.config.closeOnFilterChange ?? true);
|
|
1889
|
+
this.closeButtonText = this.config.closeButtonText ?? 'Close';
|
|
1890
|
+
this.customizeButtonText = this.config.customizeButtonText ?? 'Customize';
|
|
1888
1891
|
/**
|
|
1889
1892
|
* Whether or not to display buttons to toggle between custom and preset filters.
|
|
1890
1893
|
*/
|
|
@@ -1892,15 +1895,19 @@ class DbxFilterPopoverComponent extends AbstractPopoverDirective {
|
|
|
1892
1895
|
this._showPreset = new BehaviorSubject(false);
|
|
1893
1896
|
this.showPreset$ = this._showPreset.asObservable();
|
|
1894
1897
|
this.config$ = this._showPreset.pipe(map((showPreset) => {
|
|
1895
|
-
const { closeOnFilterChange = true, connector, initialFilterObs, customFilterComponentClass, presetFilterComponentClass } = this.config;
|
|
1898
|
+
const { closeOnFilterChange = true, connector, initialFilterObs, customFilterComponentClass, presetFilterComponentClass, customFilterComponentConfig, presetFilterComponentConfig } = this.config;
|
|
1896
1899
|
let componentClass;
|
|
1900
|
+
let baseConfig;
|
|
1897
1901
|
if (showPreset) {
|
|
1898
|
-
componentClass = presetFilterComponentClass;
|
|
1902
|
+
componentClass = (presetFilterComponentConfig?.componentClass ?? presetFilterComponentClass);
|
|
1903
|
+
baseConfig = presetFilterComponentConfig;
|
|
1899
1904
|
}
|
|
1900
1905
|
else {
|
|
1901
|
-
componentClass = customFilterComponentClass;
|
|
1906
|
+
componentClass = (customFilterComponentConfig?.componentClass ?? customFilterComponentClass);
|
|
1907
|
+
baseConfig = customFilterComponentConfig;
|
|
1902
1908
|
}
|
|
1903
1909
|
const config = {
|
|
1910
|
+
...baseConfig,
|
|
1904
1911
|
componentClass,
|
|
1905
1912
|
init: (filterSource) => {
|
|
1906
1913
|
connector.connectWithSource(filterSource);
|
|
@@ -1909,16 +1916,17 @@ class DbxFilterPopoverComponent extends AbstractPopoverDirective {
|
|
|
1909
1916
|
}
|
|
1910
1917
|
if (closeOnFilterChange !== false) {
|
|
1911
1918
|
this._closeOnChangeSub.subscription = filterSource.filter$.pipe(skip(1), filterMaybe(), first(), defaultIfEmpty(undefined)).subscribe(() => {
|
|
1912
|
-
console.log();
|
|
1913
1919
|
this.close();
|
|
1914
1920
|
});
|
|
1915
1921
|
}
|
|
1922
|
+
// run the next init if provided
|
|
1923
|
+
baseConfig?.init?.(filterSource);
|
|
1916
1924
|
}
|
|
1917
1925
|
};
|
|
1918
1926
|
return config;
|
|
1919
1927
|
}));
|
|
1920
1928
|
}
|
|
1921
|
-
static openPopover(popupService, { width, height, isResizable, origin, header, icon, customFilterComponentClass, presetFilterComponentClass, connector, initialFilterObs, closeOnFilterChange }, popoverKey) {
|
|
1929
|
+
static openPopover(popupService, { width, height, isResizable, origin, header, icon, customFilterComponentClass, presetFilterComponentClass, customFilterComponentConfig, presetFilterComponentConfig, connector, initialFilterObs, closeOnFilterChange, customizeButtonText, showCloseButton, closeButtonText }, popoverKey) {
|
|
1922
1930
|
return popupService.open({
|
|
1923
1931
|
key: popoverKey ?? DEFAULT_FILTER_POPOVER_KEY,
|
|
1924
1932
|
origin,
|
|
@@ -1929,8 +1937,13 @@ class DbxFilterPopoverComponent extends AbstractPopoverDirective {
|
|
|
1929
1937
|
data: {
|
|
1930
1938
|
header,
|
|
1931
1939
|
icon,
|
|
1940
|
+
customizeButtonText,
|
|
1941
|
+
showCloseButton,
|
|
1942
|
+
closeButtonText,
|
|
1932
1943
|
customFilterComponentClass,
|
|
1933
1944
|
presetFilterComponentClass,
|
|
1945
|
+
customFilterComponentConfig,
|
|
1946
|
+
presetFilterComponentConfig,
|
|
1934
1947
|
connector,
|
|
1935
1948
|
initialFilterObs,
|
|
1936
1949
|
closeOnFilterChange
|
|
@@ -1948,14 +1961,14 @@ class DbxFilterPopoverComponent extends AbstractPopoverDirective {
|
|
|
1948
1961
|
}
|
|
1949
1962
|
ngOnInit() {
|
|
1950
1963
|
let showPreset = false;
|
|
1951
|
-
const { customFilterComponentClass, presetFilterComponentClass } = this.config;
|
|
1952
|
-
if (customFilterComponentClass) {
|
|
1964
|
+
const { customFilterComponentClass, presetFilterComponentClass, customFilterComponentConfig, presetFilterComponentConfig } = this.config;
|
|
1965
|
+
if (customFilterComponentClass || customFilterComponentConfig) {
|
|
1953
1966
|
showPreset = false;
|
|
1954
1967
|
}
|
|
1955
|
-
if (presetFilterComponentClass) {
|
|
1968
|
+
if (presetFilterComponentClass || presetFilterComponentConfig) {
|
|
1956
1969
|
showPreset = true;
|
|
1957
1970
|
}
|
|
1958
|
-
if (!customFilterComponentClass && !presetFilterComponentClass) {
|
|
1971
|
+
if (!(customFilterComponentClass || customFilterComponentConfig) && !(presetFilterComponentClass || presetFilterComponentConfig)) {
|
|
1959
1972
|
throw new Error('Requires a preset or custom class provided for DbxFilterPopover.');
|
|
1960
1973
|
}
|
|
1961
1974
|
this._showPreset.next(showPreset);
|
|
@@ -1972,10 +1985,10 @@ class DbxFilterPopoverComponent extends AbstractPopoverDirective {
|
|
|
1972
1985
|
}
|
|
1973
1986
|
}
|
|
1974
1987
|
DbxFilterPopoverComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFilterPopoverComponent, deps: [{ token: DbxPopoverComponent }], target: i0.ɵɵFactoryTarget.Component });
|
|
1975
|
-
DbxFilterPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFilterPopoverComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\">\n <ng-container *ngIf=\"showSwitchButtons\" [ngSwitch]=\"showPreset$ | async\">\n <button *ngSwitchCase=\"true\" mat-flat-button color=\"accent\" (click)=\"showCustom()\">
|
|
1988
|
+
DbxFilterPopoverComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DbxFilterPopoverComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\">\n <ng-container *ngIf=\"showSwitchButtons\" [ngSwitch]=\"showPreset$ | async\">\n <button *ngSwitchCase=\"true\" mat-flat-button color=\"accent\" (click)=\"showCustom()\">{{ customizeButtonText }}</button>\n <button *ngSwitchCase=\"false\" mat-flat-button color=\"accent\" (click)=\"showPresets()\">Presets</button>\n </ng-container>\n <ng-container *ngIf=\"showCloseButton\">\n <dbx-button-spacer *ngIf=\"showSwitchButtons\"></dbx-button-spacer>\n <button mat-stroked-button color=\"accent\" (click)=\"close()\">{{ closeButtonText }}</button>\n </ng-container>\n </dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-injection [config]=\"config$ | async\"></dbx-injection>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: DbxPopoverContentComponent, selector: "dbx-popover-content" }, { kind: "component", type: DbxPopoverHeaderComponent, selector: "dbx-popover-header", inputs: ["header", "icon"] }, { kind: "component", type: DbxPopoverScrollContentComponent, selector: "dbx-popover-scroll-content" }, { kind: "directive", type: DbxButtonSpacerDirective, selector: "dbx-button-spacer,[dbxButtonSpacer]" }, { kind: "component", type: i1$2.DbxInjectionComponent, selector: "dbx-injection, [dbxInjection], [dbx-injection]", inputs: ["config", "template"] }, { kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
1976
1989
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DbxFilterPopoverComponent, decorators: [{
|
|
1977
1990
|
type: Component,
|
|
1978
|
-
args: [{ template: "<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\">\n <ng-container *ngIf=\"showSwitchButtons\" [ngSwitch]=\"showPreset$ | async\">\n <button *ngSwitchCase=\"true\" mat-flat-button color=\"accent\" (click)=\"showCustom()\">
|
|
1991
|
+
args: [{ template: "<dbx-popover-content>\n <!-- Header -->\n <dbx-popover-header [icon]=\"icon\" [header]=\"header\">\n <ng-container *ngIf=\"showSwitchButtons\" [ngSwitch]=\"showPreset$ | async\">\n <button *ngSwitchCase=\"true\" mat-flat-button color=\"accent\" (click)=\"showCustom()\">{{ customizeButtonText }}</button>\n <button *ngSwitchCase=\"false\" mat-flat-button color=\"accent\" (click)=\"showPresets()\">Presets</button>\n </ng-container>\n <ng-container *ngIf=\"showCloseButton\">\n <dbx-button-spacer *ngIf=\"showSwitchButtons\"></dbx-button-spacer>\n <button mat-stroked-button color=\"accent\" (click)=\"close()\">{{ closeButtonText }}</button>\n </ng-container>\n </dbx-popover-header>\n <!-- Content -->\n <dbx-popover-scroll-content>\n <dbx-injection [config]=\"config$ | async\"></dbx-injection>\n </dbx-popover-scroll-content>\n</dbx-popover-content>\n" }]
|
|
1979
1992
|
}], ctorParameters: function () { return [{ type: DbxPopoverComponent }]; } });
|
|
1980
1993
|
|
|
1981
1994
|
/**
|
|
@@ -2268,6 +2281,7 @@ class AbstractDbxPresetFilterMenuComponent {
|
|
|
2268
2281
|
constructor(filterSourceDirective) {
|
|
2269
2282
|
this.filterSourceDirective = filterSourceDirective;
|
|
2270
2283
|
//TODO: Rename to AbstractDbxPresetFilterMenuDirective with next breaking changes
|
|
2284
|
+
this.presetSelected = new EventEmitter();
|
|
2271
2285
|
this._presets = new BehaviorSubject([]);
|
|
2272
2286
|
this.selected$ = this.filterSourceDirective.filter$.pipe(startWith(undefined), distinctUntilChanged(), shareReplay(1));
|
|
2273
2287
|
this.presetsWithPresetStringOnly$ = this._presets.pipe(map((x) => x.filter((y) => Boolean(y.preset))));
|
|
@@ -2331,16 +2345,20 @@ class AbstractDbxPresetFilterMenuComponent {
|
|
|
2331
2345
|
}
|
|
2332
2346
|
this.filterSourceDirective.setFilter(filter);
|
|
2333
2347
|
}
|
|
2348
|
+
this.presetSelected.next(preset);
|
|
2334
2349
|
}
|
|
2335
2350
|
ngOnDestroy() {
|
|
2336
2351
|
this._presets.complete();
|
|
2352
|
+
this.presetSelected.complete();
|
|
2337
2353
|
}
|
|
2338
2354
|
}
|
|
2339
2355
|
AbstractDbxPresetFilterMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractDbxPresetFilterMenuComponent, deps: [{ token: i1$2.FilterSourceDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2340
|
-
AbstractDbxPresetFilterMenuComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: AbstractDbxPresetFilterMenuComponent, inputs: { presets: "presets" }, ngImport: i0 });
|
|
2356
|
+
AbstractDbxPresetFilterMenuComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: AbstractDbxPresetFilterMenuComponent, inputs: { presets: "presets" }, outputs: { presetSelected: "presetSelected" }, ngImport: i0 });
|
|
2341
2357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractDbxPresetFilterMenuComponent, decorators: [{
|
|
2342
2358
|
type: Directive
|
|
2343
|
-
}], ctorParameters: function () { return [{ type: i1$2.FilterSourceDirective }]; }, propDecorators: {
|
|
2359
|
+
}], ctorParameters: function () { return [{ type: i1$2.FilterSourceDirective }]; }, propDecorators: { presetSelected: [{
|
|
2360
|
+
type: Output
|
|
2361
|
+
}], presets: [{
|
|
2344
2362
|
type: Input
|
|
2345
2363
|
}] } });
|
|
2346
2364
|
|