forked from onecx/onecx-portal-ui-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add freeze action column functionality to table view (onecx#120)
* feat: add freeze functionality to table view * fix: fix broken column comparison * test: smoke tests for frozen column in interactive data view, data view and data table * test: test config dialog and dynamic config changes * refactor: rename variables from sticky to frozen * fix: fix custom group column selector story
- Loading branch information
1 parent
2869bfd
commit 6cecae9
Showing
17 changed files
with
576 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...components/custom-group-column-selector/custom-group-column-selector.component.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { CustomGroupColumnSelectorComponent } from './custom-group-column-selector.component'; | ||
import { Meta, moduleMetadata, applicationConfig, StoryFn } from '@storybook/angular'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { ButtonModule } from 'primeng/button'; | ||
import { importProvidersFrom } from '@angular/core'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | ||
import { ColumnType } from '../../../model/column-type.model'; | ||
import { DropdownModule } from 'primeng/dropdown'; | ||
import { DialogModule } from 'primeng/dialog'; | ||
import { PickListModule } from 'primeng/picklist'; | ||
import { CheckboxModule } from 'primeng/checkbox'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { SelectButtonModule } from 'primeng/selectbutton'; | ||
import { StorybookTranslateModule } from '../../storybook-translate.module'; | ||
|
||
|
||
type CustomGroupColumnSelectorInputs = Pick<CustomGroupColumnSelectorComponent, 'columns' | 'displayedColumns' |'actionColumnPosition' | 'frozenActionColumn' | 'dialogTitle' | 'saveButtonLabel' | 'cancelButtonLabel' | 'activeColumnsLabel' | 'inactiveColumnsLabel'> | ||
const CustomGroupColumnSelectorComponentSBConfig: Meta<CustomGroupColumnSelectorComponent> = { | ||
title: 'CustomGroupColumnSelectorComponent', | ||
component: CustomGroupColumnSelectorComponent, | ||
decorators: [ | ||
applicationConfig({ | ||
providers: [ | ||
importProvidersFrom(BrowserModule), | ||
importProvidersFrom(BrowserAnimationsModule), | ||
importProvidersFrom(TranslateModule.forRoot({})), | ||
] | ||
}), | ||
moduleMetadata({ | ||
declarations: [CustomGroupColumnSelectorComponent], | ||
imports: [ | ||
DropdownModule, | ||
DialogModule, | ||
PickListModule, | ||
ButtonModule, | ||
CheckboxModule, | ||
FormsModule, | ||
SelectButtonModule, | ||
StorybookTranslateModule | ||
] | ||
}) | ||
] | ||
} | ||
const Template: StoryFn = (args) => ({ | ||
props: args, | ||
}) | ||
|
||
const defaultComponentArgs: CustomGroupColumnSelectorInputs = { | ||
columns: [ | ||
{ | ||
id: "product", | ||
columnType: ColumnType.STRING, | ||
nameKey: "Product", | ||
sortable: false, | ||
}, | ||
{ | ||
id: "amount", | ||
columnType: ColumnType.NUMBER, | ||
nameKey: "Amount", | ||
sortable: true | ||
} | ||
], | ||
displayedColumns: [ | ||
{ | ||
id: "date", | ||
columnType: ColumnType.DATE, | ||
nameKey: "Date", | ||
sortable: false, | ||
}, | ||
], | ||
frozenActionColumn: true, | ||
actionColumnPosition: 'right', | ||
dialogTitle: 'Column configurator', | ||
saveButtonLabel: 'Save', | ||
cancelButtonLabel: 'Cancel', | ||
activeColumnsLabel: 'Active', | ||
inactiveColumnsLabel: 'Inactive' | ||
} | ||
|
||
export const Default = { | ||
render: Template, | ||
args: { | ||
...defaultComponentArgs, | ||
actionColumnConfigChanged: ($event: any) => console.log("Action column config changed ", $event) | ||
}, | ||
argTypes: { | ||
actionColumnConfigChanged: {action: 'actionColumnConfigChanged'} | ||
}, | ||
} | ||
|
||
export default CustomGroupColumnSelectorComponentSBConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.