Skip to content

Commit

Permalink
Merge pull request #14198 from primefaces/v17
Browse files Browse the repository at this point in the history
V17
  • Loading branch information
cetincakiroglu committed Nov 24, 2023
2 parents 2090f63 + 4edf6db commit 465482e
Show file tree
Hide file tree
Showing 45 changed files with 22,789 additions and 40,946 deletions.
39 changes: 3 additions & 36 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "primeng:build:production"
"buildTarget": "primeng:build:production"
},
"development": {
"browserTarget": "primeng:build:development"
"buildTarget": "primeng:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "primeng:build"
"buildTarget": "primeng:build"
}
},
"test": {
Expand Down Expand Up @@ -152,39 +152,6 @@
}
},
"defaultConfiguration": "production"
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"configurations": {
"development": {
"browserTarget": "primeng:build:development",
"serverTarget": "primeng:server:development"
},
"production": {
"browserTarget": "primeng:build:production",
"serverTarget": "primeng:server:production"
}
},
"defaultConfiguration": "development"
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"routes": [
"/"
]
},
"configurations": {
"production": {
"browserTarget": "primeng:build:production",
"serverTarget": "primeng:server:production"
},
"development": {
"browserTarget": "primeng:build:development",
"serverTarget": "primeng:server:development"
}
},
"defaultConfiguration": "production"
}
}
}
Expand Down
62,982 changes: 22,450 additions & 40,532 deletions package-lock.json

Large diffs are not rendered by default.

191 changes: 95 additions & 96 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,98 +1,97 @@
{
"name": "primeng",
"version": "16.9.1",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"test:headless": "ng test --watch=false --browsers=ChromeHeadless",
"e2e": "ng e2e",
"lint": "ng lint",
"format": "prettier --write \"**/*.{js,ts,d.ts}\"",
"format:check": "prettier --check \"**/*.{js,ts,d.ts}\"",
"build:lib": "npm run build:check && npm run build:package",
"build:package": "BROWSERSLIST_ENV=library ng build primeng-library && gulp build-assets",
"build:check": "npm run format:check && npm run security:check",
"security:check": "npm audit --production --audit-level high",
"dev:ssr": "ng run primeng:serve-ssr",
"serve:ssr": "node dist/primeng/server/main.js",
"build:ssr": "ng build --configuration=production && ng run primeng:server",
"prerender": "ng run primeng:prerender",
"vercel-build": "npm run build:ssr",
"apidoc": "node ./api-generator/build-apidoc.ts"
},
"repository": {
"type": "git",
"url": "https://github.com/primefaces/primeng.git"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.2.0",
"@angular-eslint/eslint-plugin": "16.1.0",
"@angular-eslint/eslint-plugin-template": "16.1.0",
"@angular-eslint/schematics": "16.1.0",
"@angular-eslint/template-parser": "16.1.0",
"@angular/animations": "^16.2.0",
"@angular/cdk": "^16.2.0",
"@angular/cli": "^16.2.0",
"@angular/common": "^16.2.0",
"@angular/compiler": "^16.2.0",
"@angular/compiler-cli": "^16.2.0",
"@angular/core": "^16.2.0",
"@angular/forms": "^16.2.0",
"@angular/platform-browser": "^16.2.0",
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/platform-server": "^16.2.0",
"@angular/router": "^16.2.0",
"@nguniversal/builders": "^16.1.3",
"@nguniversal/common": "^16.1.3",
"@nguniversal/express-engine": "^16.1.3",
"@stackblitz/sdk": "1.9.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~4.3.1",
"@types/jest": "^29.5.1",
"@types/node": "^12.20.55",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"chart.js": "3.3.2",
"codelyzer": "^0.0.28",
"del": "^7.0.0",
"domino": "^2.1.6",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prefer-arrow": "latest",
"express": "^4.18.2",
"file-saver": "^2.0.5",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-flatten": "^0.4.0",
"gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2",
"gulp-uglifycss": "^1.1.0",
"jasmine-core": "~4.6.0",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.28",
"karma": "~6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"ng-packagr": "^16.2.0",
"prettier": "2.8.8",
"primeflex": "^3.3.0",
"primeicons": "^6.0.1",
"prismjs": "^1.29.0",
"quill": "1.3.7",
"rxjs": "~7.8.1",
"ts-node": "~8.3.0",
"tslib": "^2.5.0",
"typedoc": "0.24.7",
"typescript": "5.0.4",
"xlsx": "^0.18.5",
"zone.js": "~0.13.0"
},
"dependencies": {
"@docsearch/js": "^3.3.4"
}
"name": "primeng",
"version": "17.0.0-beta.1",
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"test:headless": "ng test --watch=false --browsers=ChromeHeadless",
"e2e": "ng e2e",
"lint": "ng lint",
"format": "prettier --write \"**/*.{js,ts,d.ts}\"",
"format:check": "prettier --check \"**/*.{js,ts,d.ts}\"",
"build:lib": "npm run build:check && npm run build:package",
"build:package": "BROWSERSLIST_ENV=library ng build primeng-library && gulp build-assets",
"build:check": "npm run format:check && npm run security:check",
"security:check": "npm audit --production --audit-level high",
"dev:ssr": "ng run primeng:serve-ssr",
"prerender": "ng run primeng:prerender",
"vercel-build": "npm run build:ssr",
"apidoc": "node ./api-generator/build-apidoc.ts",
"serve:ssr": "node dist/primeng/server/main.js",
"build:ssr": "ng build --configuration=production && ng run primeng:server"
},
"repository": {
"type": "git",
"url": "https://github.com/primefaces/primeng.git"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.0",
"@angular-eslint/eslint-plugin": "17.0.0",
"@angular-eslint/eslint-plugin-template": "17.0.0",
"@angular-eslint/schematics": "17.0.0",
"@angular-eslint/template-parser": "17.0.0",
"@angular/animations": "^17.0.0",
"@angular/cdk": "^17.0.0",
"@angular/cli": "^17.0.0",
"@angular/common": "^17.0.0",
"@angular/compiler": "^17.0.0",
"@angular/compiler-cli": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/forms": "^17.0.0",
"@angular/platform-browser": "^17.0.0",
"@angular/platform-browser-dynamic": "^17.0.0",
"@angular/platform-server": "^17.0.0",
"@angular/router": "^17.0.0",
"@stackblitz/sdk": "1.9.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~4.3.1",
"@types/jest": "^29.5.1",
"@types/node": "^16.10.9",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"chart.js": "3.3.2",
"codelyzer": "^0.0.28",
"del": "^7.1.0",
"domino": "^2.1.6",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jsdoc": "latest",
"eslint-plugin-prefer-arrow": "latest",
"express": "^4.18.2",
"file-saver": "^2.0.5",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-flatten": "^0.4.0",
"gulp-rename": "^2.0.0",
"gulp-uglify": "^3.0.2",
"gulp-uglifycss": "^1.1.0",
"jasmine-core": "~4.6.0",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.28",
"karma": "~6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"ng-packagr": "^17.0.0",
"prettier": "2.8.8",
"primeflex": "^3.3.1",
"primeicons": "^6.0.1",
"prismjs": "^1.29.0",
"quill": "1.3.7",
"rxjs": "~7.8.1",
"ts-node": "~10.9.1",
"tslib": "^2.5.0",
"typedoc": "0.25.3",
"typescript": "5.2.2",
"xlsx": "^0.18.5",
"zone.js": "~0.14.0"
},
"dependencies": {
"@angular/ssr": "^17.0.3",
"@docsearch/js": "^3.3.4",
"express": "^4.18.2"
}
}
40 changes: 21 additions & 19 deletions server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import 'zone.js/node';

import { APP_BASE_HREF } from '@angular/common';
import { ngExpressEngine } from '@nguniversal/express-engine';
import { CommonEngine } from '@angular/ssr';
import express from 'express';
import { existsSync } from 'fs';
import { join } from 'path';

import { AppServerModule } from './src/main.server';
import { existsSync } from 'node:fs';
import { join } from 'node:path';
import bootstrap from './src/main.server';

// ssr DOM
const domino = require('domino');
Expand Down Expand Up @@ -42,16 +40,9 @@ global['gtag'] = () => {};
export function app(): express.Express {
const server = express();
const distFolder = join(process.cwd(), 'dist/primeng/browser');
const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
const indexHtml = existsSync(join(distFolder, 'index.original.html')) ? join(distFolder, 'index.original.html') : join(distFolder, 'index.html');

// Our Universal express-engine (found @ https://github.com/angular/universal/tree/main/modules/express-engine)
server.engine(
'html',
ngExpressEngine({
bootstrap: AppServerModule,
inlineCriticalCss: false
})
);
const commonEngine = new CommonEngine();

server.set('view engine', 'html');
server.set('views', distFolder);
Expand All @@ -66,9 +57,20 @@ export function app(): express.Express {
})
);

// All regular routes use the Universal engine
server.get('*', (req, res) => {
res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
// All regular routes use the Angular engine
server.get('*', (req, res, next) => {
const { protocol, originalUrl, baseUrl, headers } = req;

commonEngine
.render({
bootstrap,
documentFilePath: indexHtml,
url: `${protocol}://${headers.host}${originalUrl}`,
publicPath: distFolder,
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }]
})
.then((html) => res.send(html))
.catch((err) => next(err));
});

return server;
Expand All @@ -94,4 +96,4 @@ if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
run();
}

export * from './src/main.server';
export default bootstrap;
9 changes: 6 additions & 3 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export const CALENDAR_VALUE_ACCESSOR: any = {
draggable="false"
(keydown)="onDateCellKeydown($event, date, i)"
pRipple
>
<ng-container *ngIf="!dateTemplate && (date.selectable || !disabledDateTemplate)">{{ date.day }}</ng-container>
<ng-container *ngIf="date.selectable || !disabledDateTemplate">
Expand Down Expand Up @@ -953,7 +954,7 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
Promise.resolve(null).then(() => this.updateFocus());
this.isMonthNavigate = false;
} else {
if (!this.focus) {
if (!this.focus && !this.inline) {
this.initFocusableCell();
}
}
Expand Down Expand Up @@ -1195,10 +1196,12 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
if (this.inline) {
this.contentViewChild && this.contentViewChild.nativeElement.setAttribute(this.attributeSelector, '');

if (!this.disabled) {
if (!this.disabled && !this.inline) {
this.initFocusableCell();
if (this.numberOfMonths === 1) {
this.contentViewChild.nativeElement.style.width = DomHandler.getOuterWidth(this.containerViewChild?.nativeElement) + 'px';
if(this.contentViewChild && this.contentViewChild.nativeElement) {
this.contentViewChild.nativeElement.style.width = DomHandler.getOuterWidth(this.containerViewChild?.nativeElement) + 'px';
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/cascadeselect/cascadeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,8 @@ export class CascadeSelect implements OnInit, AfterContentInit {

changeFocusedOptionIndex(event, index) {
if (this.focusedOptionInfo().index !== index) {
this.focusedOptionInfo.mutate((value) => (value.index = index));
const focusedOptionInfo = this.focusedOptionInfo();
this.focusedOptionInfo.set({...focusedOptionInfo, index})
this.scrollInView();
}

Expand Down

0 comments on commit 465482e

Please sign in to comment.