Skip to content

Commit

Permalink
Merge branch 'main' into feat/search-config-remote-component
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Sep 24, 2024
2 parents 50470b8 + ff4c5a2 commit 8eb6a35
Show file tree
Hide file tree
Showing 34 changed files with 1,493 additions and 822 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ dist
.idea

.nx

libs/angular-accelerator/tmp/
libs/portal-integration-angular/tmp/
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## [5.12.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.11.1...v5.12.0) (2024-09-20)

### Features

* allow hiding of selectAll checkbox & fix initial selection of disabled table rows ([#479](https://github.com/onecx/onecx-portal-ui-libs/issues/479)) ([9097001](https://github.com/onecx/onecx-portal-ui-libs/commit/90970014bf676f4abdb795fc316945896174bf8a))

### Chores

* **deps-dev:** bump @schematics/angular from 18.1.4 to 18.2.4 ([#468](https://github.com/onecx/onecx-portal-ui-libs/issues/468)) ([88d4614](https://github.com/onecx/onecx-portal-ui-libs/commit/88d46144d4103ac1d42b0ba75482125ab27c23f1))
* **deps-dev:** bump postcss-preset-env from 10.0.1 to 10.0.3 ([#477](https://github.com/onecx/onecx-portal-ui-libs/issues/477)) ([e6aea7f](https://github.com/onecx/onecx-portal-ui-libs/commit/e6aea7f8eee07b235936a1b230e0f5e539eef7de))
* **deps:** bump the angular group with 12 updates ([#476](https://github.com/onecx/onecx-portal-ui-libs/issues/476)) ([f1c8704](https://github.com/onecx/onecx-portal-ui-libs/commit/f1c8704f60c84d9937a133f25128e2e3bb5dd577))
* **deps:** bump the angular group with 16 updates ([#480](https://github.com/onecx/onecx-portal-ui-libs/issues/480)) ([236e2c4](https://github.com/onecx/onecx-portal-ui-libs/commit/236e2c45352dfc1b2b100da20e40840db888945f))

## [5.11.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.11.0...v5.11.1) (2024-09-17)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion libs/accelerator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/accelerator",
"version": "5.11.1",
"version": "5.12.0",
"license": "Apache-2.0",
"peerDependencies": {
"tslib": "^2.6.3",
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-accelerator/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const preview: Preview = {
},
},
},
tags: ['autodocs', 'autodocs']
tags: ['autodocs', 'autodocs', 'autodocs']
}

export default preview
7 changes: 6 additions & 1 deletion libs/angular-accelerator/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"entryFile": "src/index.ts"
},
"assets": [
"./assets/**"
"./assets/**",
{
"input": "tmp/primelocale/",
"glob": "{en,de}.json",
"output": "assets/i18n/primeng"
}
]
}
2 changes: 1 addition & 1 deletion libs/angular-accelerator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onecx/angular-accelerator",
"version": "5.11.1",
"version": "5.12.0",
"license": "Apache-2.0",
"peerDependencies": {
"@angular/common": "^18.0.5",
Expand Down
14 changes: 14 additions & 0 deletions libs/angular-accelerator/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@
"tags": [],
"projectType": "library",
"targets": {
"copyPrimelocaleTranslations": {
"executor": "nx:run-commands",
"options": {
"commands": [
"mkdir -p libs/angular-accelerator/tmp/primelocale",
"cp node_modules/primelocale/de.json libs/angular-accelerator/tmp/primelocale/",
"cp node_modules/primelocale/en.json libs/angular-accelerator/tmp/primelocale/",
"sed -i 's/\"de\":/\"primeng\":/' libs/angular-accelerator/tmp/primelocale/de.json",
"sed -i 's/\"en\":/\"primeng\":/' libs/angular-accelerator/tmp/primelocale/en.json"
],
"parallel": false
}
},
"build": {
"executor": "@nx/angular:package",
"dependsOn": ["^build", "copyPrimelocaleTranslations"],
"outputs": [
"{workspaceRoot}/dist/{projectRoot}"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import { BreadcrumbModule } from 'primeng/breadcrumb'
import { SkeletonModule } from 'primeng/skeleton'
import { MessageModule } from 'primeng/message'
import { SharedModule } from 'primeng/api'
import { CheckboxModule } from 'primeng/checkbox'

@NgModule({
imports: [
BreadcrumbModule,
CheckboxModule,
DropdownModule,
ButtonModule,
DialogModule,
Expand All @@ -33,6 +35,7 @@ import { SharedModule } from 'primeng/api'
],
exports: [
BreadcrumbModule,
CheckboxModule,
DropdownModule,
ButtonModule,
DialogModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<ng-template pTemplate="header">
<tr>
<th style="width: 4rem" scope="col" *ngIf="selectionChangedObserved">
<p-tableHeaderCheckbox></p-tableHeaderCheckbox>
<p-tableHeaderCheckbox *ngIf="allowSelectAll"></p-tableHeaderCheckbox>
</th>
<ng-container *ngIf="actionColumnPosition === 'left';">
<ng-container *ngTemplateOutlet="actionColumnHeader"></ng-container>
Expand Down Expand Up @@ -194,10 +194,18 @@
<ng-template pTemplate="body" let-rowObject>
<tr>
<td *ngIf="selectionChangedObserved">
<p-tableCheckbox
[value]="rowObject"
[disabled]="!!selectionEnabledField && !fieldIsTruthy(rowObject, selectionEnabledField)"
></p-tableCheckbox>
<p-checkbox
*ngIf="(!!selectionEnabledField && !fieldIsTruthy(rowObject, selectionEnabledField)) && isSelected(rowObject); else defaultCheckbox"
[(ngModel)]="checked"
[binary]="true"
[disabled]="true"
></p-checkbox>
<ng-template #defaultCheckbox>
<p-tableCheckbox
[value]="rowObject"
[disabled]="!!selectionEnabledField && !fieldIsTruthy(rowObject, selectionEnabledField)"
></p-tableCheckbox>
</ng-template>
</td>
<ng-container *ngIf="actionColumnPosition === 'left';">
<ng-container *ngTemplateOutlet="actionColumn; context: {localRowObject: rowObject}"></ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { HAS_PERMISSION_CHECKER, IfPermissionDirective } from '../../directives/
import { ColumnType } from '../../model/column-type.model'
import { MenuModule } from 'primeng/menu'
import { DynamicLocaleId } from '../../utils/dynamic-locale-id'
import { CheckboxModule } from 'primeng/checkbox'
import { FormsModule } from '@angular/forms'

type DataTableInputTypes = Pick<DataTableComponent, 'rows' | 'columns' | 'emptyResultsMessage' | 'selectedRows'>

Expand All @@ -36,7 +38,7 @@ const DataTableComponentSBConfig: Meta<DataTableComponent> = {
}),
moduleMetadata({
declarations: [DataTableComponent, IfPermissionDirective],
imports: [TableModule, ButtonModule, MultiSelectModule, StorybookTranslateModule, MockAuthModule, MenuModule],
imports: [TableModule, ButtonModule, MultiSelectModule, StorybookTranslateModule, MockAuthModule, MenuModule, CheckboxModule, FormsModule],
}),
],
}
Expand All @@ -52,6 +54,7 @@ const dataTableActionsArgTypes = {

const dataTableSelectionArgTypes = {
selectionChanged: { action: 'selectionChanged' },
componentStateChanged: { action: 'componentStateChanged' },
}

const defaultComponentArgs: DataTableInputTypes = {
Expand Down Expand Up @@ -142,6 +145,16 @@ export const WithRowSelectionAndDefaultSelection = {
},
}

export const WithRowSelectionAndDisabledDefaultSelection = {
argTypes: dataTableSelectionArgTypes,
render: Template,
args: {
...defaultComponentArgs,
selectedRows: [1],
selectionEnabledField: 'available'
},
}

const extendedComponentArgs: DataTableInputTypes = {
columns: [
{
Expand Down
Loading

0 comments on commit 8eb6a35

Please sign in to comment.