diff --git a/CHANGELOG.md b/CHANGELOG.md index 10018997f3..f7a09925dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [1.9.101](https://github.com/surveyjs/survey-library/compare/v1.9.100...v1.9.101) (2023-08-02) + +## [1.9.100](https://github.com/surveyjs/survey-library/compare/v1.9.99...v1.9.100) (2023-07-26) + +## [1.9.99](https://github.com/surveyjs/survey-library/compare/v1.9.98...v1.9.99) (2023-07-26) + + +### Bug Fixes + +* should be one instance of survey-core in example ([cd30e10](https://github.com/surveyjs/survey-library/commit/cd30e10887cc1d1b24dad0a7455df0b560045258)) + ## [1.9.98](https://github.com/surveyjs/survey-library/compare/v1.9.97...v1.9.98) (2023-07-18) ## [1.9.97](https://github.com/surveyjs/survey-library/compare/v1.9.96...v1.9.97) (2023-07-12) diff --git a/build-packages.yml b/build-packages.yml index 32f4666121..cc2d6c3ee2 100644 --- a/build-packages.yml +++ b/build-packages.yml @@ -32,7 +32,46 @@ pool: jobs: +- job: NPMCache + + steps: + - checkout: self + - checkout: EmptyRepo + persistCredentials: true + clean: true + + - task: NodeTool@0 + inputs: + versionSpec: "14.x" + displayName: "Install Node.js" + + - task: CopyFiles@2 + inputs: + SourceFolder: "$(Build.SourcesDirectory)/survey-library/" + Contents: "package.json" + TargetFolder: "$(Build.SourcesDirectory)/Temp/" + OverWrite: true + displayName: "Copy package.json for cache key" + + - task: Cache@2 + inputs: + key: 'npm-cache-library | $(Build.SourcesDirectory)/Temp/package.json' + path: $(Build.SourcesDirectory)/survey-library/node_modules + cacheHitVar: NPM_CACHE_RESTORED + displayName: Cache NPM + + - task: Npm@1 + displayName: 'NPM install' + inputs: + command: install + verbose: false + workingDir: $(Build.SourcesDirectory)/survey-library + condition: ne(variables.NPM_CACHE_RESTORED, 'true') + + - job: CoreAngularJquery + dependsOn: + - NPMCache steps: - checkout: self @@ -138,6 +177,9 @@ jobs: - job: Knockout + dependsOn: + - NPMCache + steps: - checkout: self - checkout: EmptyRepo @@ -244,6 +286,8 @@ jobs: - job: React + dependsOn: + - NPMCache steps: - checkout: self @@ -345,6 +389,8 @@ jobs: - job: Vue + dependsOn: + - NPMCache steps: - checkout: self @@ -445,6 +491,9 @@ jobs: publishLocation: "Container" - job: Angular + dependsOn: + - NPMCache + steps: - checkout: self - checkout: EmptyRepo @@ -560,6 +609,9 @@ jobs: publishLocation: "Container" - job: Vue3 + dependsOn: + - NPMCache + steps: - checkout: self - checkout: EmptyRepo @@ -627,33 +679,33 @@ jobs: displayName: "Build Core" - script: | - cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue-ui + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui npm install - displayName: "NPM install packages/survey-vue-ui" + displayName: "NPM install packages/survey-vue3-ui" - script: | - cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue-ui + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui npm run release -- --release-as $(SurveyJSVersion) git status displayName: "npm run release" - script: | - cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue-ui + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui npm run build displayName: "Build Vue3" - script: | - cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue-ui/example + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui/example npm install - displayName: "NPM install survey-vue-ui/example" + displayName: "NPM install survey-vue3-ui/example" - script: | - cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue-ui/example + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui/example npm run build displayName: "Build Vue3 Example" - script: | - cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue-ui + cd $(Build.SourcesDirectory)/survey-library/packages/survey-vue3-ui npm run test:single displayName: "run unit and markup tests" diff --git a/build-scripts/survey-core/webpack.themes.config.js b/build-scripts/survey-core/webpack.themes.config.js new file mode 100644 index 0000000000..41553536c1 --- /dev/null +++ b/build-scripts/survey-core/webpack.themes.config.js @@ -0,0 +1,59 @@ +"use strict"; + +const webpackCommonConfigCreator = require("../webpack.common"); +const { merge } = require("webpack-merge"); +var FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries"); +var path = require("path"); + +const config = { + entry: { + "default-light": path.resolve(__dirname, "../../src/themes/default-light.ts"), + "default-dark": path.resolve(__dirname, "../../src/themes/default-dark.ts"), + "default-light-panelless": path.resolve(__dirname, "../../src/themes/default-light-panelless.ts"), + "default-dark-panelless": path.resolve(__dirname, "../../src/themes/default-dark-panelless.ts"), + "sharp-light": path.resolve(__dirname, "../../src/themes/sharp-light.ts"), + "sharp-dark": path.resolve(__dirname, "../../src/themes/sharp-dark.ts"), + "sharp-light-panelless": path.resolve(__dirname, "../../src/themes/sharp-light-panelless.ts"), + "sharp-dark-panelless": path.resolve(__dirname, "../../src/themes/sharp-dark-panelless.ts"), + "borderless-light": path.resolve(__dirname, "../../src/themes/borderless-light.ts"), + "borderless-dark": path.resolve(__dirname, "../../src/themes/borderless-dark.ts"), + "borderless-light-panelless.": path.resolve(__dirname, "../../src/themes/borderless-light-panelless.ts"), + "borderless-dark-panelless": path.resolve(__dirname, "../../src/themes/borderless-dark-panelless.ts"), + "flat-light": path.resolve(__dirname, "../../src/themes/flat-light.ts"), + "flat-dark": path.resolve(__dirname, "../../src/themes/flat-dark.ts"), + "flat-light-panelless": path.resolve(__dirname, "../../src/themes/flat-light-panelless.ts"), + "flat-dark-panelless": path.resolve(__dirname, "../../src/themes/flat-dark-panelless.ts"), + "plain-light": path.resolve(__dirname, "../../src/themes/plain-light.ts"), + "plain-dark": path.resolve(__dirname, "../../src/themes/plain-dark.ts"), + "plain-light-panelless": path.resolve(__dirname, "../../src/themes/plain-light-panelless.ts"), + "plain-dark-panelless": path.resolve(__dirname, "../../src/themes/plain-dark-panelless.ts"), + "doubleborder-light": path.resolve(__dirname, "../../src/themes/doubleborder-light.ts"), + "doubleborder-dark": path.resolve(__dirname, "../../src/themes/doubleborder-dark.ts"), + "doubleborder-light-panelles": path.resolve(__dirname, "../../src/themes/doubleborder-light-panelless.ts"), + "doubleborder-dark-panelless": path.resolve(__dirname, "../../src/themes/doubleborder-dark-panelless.ts"), + "layered-light": path.resolve(__dirname, "../../src/themes/layered-light.ts"), + "layered-dark": path.resolve(__dirname, "../../src/themes/layered-dark.ts"), + "layered-light-panelless": path.resolve(__dirname, "../../src/themes/layered-light-panelless.ts"), + "layered-dark-panelless": path.resolve(__dirname, "../../src/themes/layered-dark-panelless.ts"), + "solid-light": path.resolve(__dirname, "../../src/themes/solid-light.ts"), + "solid-dark": path.resolve(__dirname, "../../src/themes/solid-dark.ts"), + "solid-light-panelless": path.resolve(__dirname, "../../src/themes/solid-light-panelless.ts"), + "solid-dark-panelless": path.resolve(__dirname, "../../src/themes/solid-dark-panelless.ts"), + "three-dimensional-light": path.resolve(__dirname, "../../src/themes/threedimensional-light.ts"), + "three-dimensional-dark": path.resolve(__dirname, "../../src/themes/threedimensional-dark.ts"), + "three-dimensional-light-panelless": path.resolve(__dirname, "../../src/themes/threedimensional-light-panelless.ts"), + "three-dimensional-dark-panelless": path.resolve(__dirname, "../../src/themes/threedimensional-dark-panelless.ts"), + "contrast-light": path.resolve(__dirname, "../../src/themes/contrast-light.ts"), + "contrast-dark": path.resolve(__dirname, "../../src/themes/contrast-dark.ts"), + "contrast-light-panelless": path.resolve(__dirname, "../../src/themes/contrast-light-panelless.ts"), + "contrast-dark-panelless": path.resolve(__dirname, "../../src/themes/contrast-dark-panelless.ts"), + "index": path.resolve(__dirname, "../../src/themes/index.ts"), + }, + plugins: [new FixStyleOnlyEntriesPlugin()], +}; + +module.exports = function (options) { + options.platform = ""; + options.libraryName = "SurveyTheme"; + return merge(webpackCommonConfigCreator(options, { "name": "survey-themes" }, "survey.themes", "survey-core/themes"), config); +}; diff --git a/build-scripts/webpack.common.js b/build-scripts/webpack.common.js index 8b839a279e..17e9f77bef 100644 --- a/build-scripts/webpack.common.js +++ b/build-scripts/webpack.common.js @@ -205,6 +205,7 @@ module.exports = function (options, packageJson, chunkName, buildFolderName) { new webpack.DefinePlugin({ "process.env.ENVIRONMENT": JSON.stringify(options.buildType), "process.env.VERSION": JSON.stringify(packageJson.version), + "process.env.RELEASE_DATE": JSON.stringify(new Date().toISOString().slice(0, 10)), }), new MiniCssExtractPlugin({ filename: isProductionBuild ? "[rc-name].min.css" : "[rc-name].css", @@ -221,7 +222,7 @@ module.exports = function (options, packageJson, chunkName, buildFolderName) { ], }; - if(!!options.platform) { + if (!!options.platform) { config.plugins.unshift(new webpack.ProgressPlugin(percentage_handler)); config.entry = { [packageName]: path.resolve( @@ -232,7 +233,7 @@ module.exports = function (options, packageJson, chunkName, buildFolderName) { } if (isProductionBuild) { - if(!!options.platform) { + if (!!options.platform) { config.plugins.push( new GenerateJsonPlugin( /*buildPath +*/ "package.json", diff --git a/devops-pull-requests-parallel-jobs.yml b/devops-pull-requests-parallel-jobs.yml index ad72ed0f32..230341d43a 100644 --- a/devops-pull-requests-parallel-jobs.yml +++ b/devops-pull-requests-parallel-jobs.yml @@ -270,27 +270,27 @@ jobs: displayName: "Build Core" - script: | - cd packages/survey-vue-ui + cd packages/survey-vue3-ui npm install - displayName: "NPM install packages/survey-vue-ui" + displayName: "NPM install packages/survey-vue3-ui" - script: | - cd packages/survey-vue-ui + cd packages/survey-vue3-ui npm run build displayName: "Build Vue3" - script: | - cd packages/survey-vue-ui/example + cd packages/survey-vue3-ui/example npm install displayName: "NPM install examples/angular-ui" - script: | - cd packages/survey-vue-ui/example + cd packages/survey-vue3-ui/example npm run build displayName: "Build Vue3 Example" - script: | - cd packages/survey-vue-ui + cd packages/survey-vue3-ui npm run test:single displayName: "run unit and markup tests" diff --git a/devops-visual-regression-tests.yml b/devops-visual-regression-tests.yml index 441f4ce609..2745f781eb 100644 --- a/devops-visual-regression-tests.yml +++ b/devops-visual-regression-tests.yml @@ -303,22 +303,22 @@ jobs: displayName: "Build Core" - script: | - cd packages/survey-vue-ui + cd packages/survey-vue3-ui npm install - displayName: "NPM install packages/survey-vue-ui" + displayName: "NPM install packages/survey-vue3-ui" - script: | - cd packages/survey-vue-ui + cd packages/survey-vue3-ui npm run build displayName: "Build Vue3" - script: | - cd packages/survey-vue-ui/example + cd packages/survey-vue3-ui/example npm install - displayName: "NPM install packages/survey-vue-ui/example" + displayName: "NPM install packages/survey-vue3-ui/example" - script: | - cd packages/survey-vue-ui/example + cd packages/survey-vue3-ui/example npm run build displayName: "Build Vue3 Example" diff --git a/package.json b/package.json index 1c26de600e..7a1790fbf0 100644 --- a/package.json +++ b/package.json @@ -44,10 +44,13 @@ "build_react_ui": "webpack --config ./build-scripts/survey-react-ui/webpack.config.js --env.buildType dev && webpack --config ./build-scripts/survey-react-ui/webpack.config.js --env.buildType prod", "build_vue": "npm run build_vue_dev && npm run build_vue_prod", "build_vue_ui": "webpack --config ./build-scripts/survey-vue-ui/webpack.config.js --env.buildType dev && webpack --config ./build-scripts/survey-vue-ui/webpack.config.js --env.buildType prod", - "build_core": "npm run build_core_dev && npm run build_core_prod && rimraf build/survey-core/ts3.4 && downlevel-dts build/survey-core build/survey-core/ts3.4", + "build_core": "npm run build_core_dev && npm run build_core_prod && npm run build-themes && rimraf build/survey-core/ts3.4 && downlevel-dts build/survey-core build/survey-core/ts3.4", "build-plugins": "npm run build-plugins-dev && npm run build-plugins-prod", "build-plugins-dev": "concurrently \"webpack --config ./build-scripts/survey-core/webpack.plugins.bootstrap.config.js --env.buildType dev\" \"webpack --config ./build-scripts/survey-core/webpack.plugins.bootstrap.material.config.js --env.buildType dev\"", "build-plugins-prod": "concurrently \"webpack --config ./build-scripts/survey-core/webpack.plugins.bootstrap.config.js --env.buildType prod\" \"webpack --config ./build-scripts/survey-core/webpack.plugins.bootstrap.material.config.js --env.buildType prod\"", + "build-themes": "npm run build-themes-dev && npm run build-themes-prod", + "build-themes-dev": "webpack --config ./build-scripts/survey-core/webpack.themes.config.js --env.buildType dev", + "build-themes-prod": "webpack --config ./build-scripts/survey-core/webpack.themes.config.js --env.buildType prod", "build_i18n": "npm run build_i18n_dev && npm run build_i18n_prod", "build_jquery": "npm run build_jquery_dev && npm run build_jquery_prod", "build_angular": "npm run build_angular_dev && npm run build_angular_prod && rimraf build/survey-angular/ts3.4 && downlevel-dts build/survey-angular build/survey-angular/ts3.4", @@ -77,15 +80,15 @@ "visual-regression-tests:ci:react": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=react", "visual-regression-tests:ci:vue": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"http-server\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue", "visual-regression-tests:file": "testcafe chrome:headless --app \"http-server\" ./visualRegressionTests/tests/defaultV2/paneldynamic.ts --screenshots ./ --reporter minimal --selector-timeout 1500", - "visual-regression-tests:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3", - "visual-regression-tests:vue3": "testcafe -c 4 -q chrome ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3", - "testcafe:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"npm run preview --prefix ./packages/survey-vue-ui/example\" --selector-timeout 1500 --reporter minimal --env=vue3", - "testcafe:vue3": "testcafe chrome testCafe/ --app \"npm run preview --prefix ./packages/survey-vue-ui/example \" --selector-timeout 1500 --reporter minimal --env=vue3", + "visual-regression-tests:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3", + "visual-regression-tests:vue3": "testcafe -c 4 -q chrome ./visualRegressionTests/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --screenshots ./ --selector-timeout 1500 --reporter minimal --env=vue3", + "testcafe:ci:vue3": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example\" --selector-timeout 1500 --reporter minimal --env=vue3", + "testcafe:vue3": "testcafe chrome testCafe/ --app \"npm run preview --prefix ./packages/survey-vue3-ui/example \" --selector-timeout 1500 --reporter minimal --env=vue3", "testcafe:angular": "testcafe chrome testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular", "testcafe:ci:angular": "testcafe -c 4 -q attemptLimit=5,successThreshold=1 chrome:headless testCafe/ --app \"http-server ./packages/survey-angular-ui/example/dist --proxy http://localhost:8080? -p 8080\" --selector-timeout 1500 --reporter minimal --env=angular", "prepare": "husky install" }, - "version": "1.9.98", + "version": "1.9.101", "name": "survey-library", "private": true, "devDependencies": { @@ -192,4 +195,4 @@ "signature_pad": "^4.1.5", "vite": "^3.1.8" } -} \ No newline at end of file +} diff --git a/packages/survey-angular-ui/CHANGELOG.md b/packages/survey-angular-ui/CHANGELOG.md index d0f7ec64e8..ef81d7a6cd 100644 --- a/packages/survey-angular-ui/CHANGELOG.md +++ b/packages/survey-angular-ui/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## [1.9.101](https://github.com/surveyjs/surveyjs/compare/v1.9.100...v1.9.101) (2023-08-02) + +## [1.9.100](https://github.com/surveyjs/surveyjs/compare/v1.9.99...v1.9.100) (2023-07-26) + +## [1.9.99](https://github.com/surveyjs/surveyjs/compare/v1.9.98...v1.9.99) (2023-07-26) + + +### Bug Fixes + +* should be one instance of survey-core in example ([cd30e10](https://github.com/surveyjs/surveyjs/commit/cd30e10887cc1d1b24dad0a7455df0b560045258)) + ## [1.9.98](https://github.com/surveyjs/surveyjs/compare/v1.9.97...v1.9.98) (2023-07-18) ## [1.9.97](https://github.com/surveyjs/surveyjs/compare/v1.9.96...v1.9.97) (2023-07-12) diff --git a/packages/survey-angular-ui/package.json b/packages/survey-angular-ui/package.json index 84ac836908..c9e321147c 100644 --- a/packages/survey-angular-ui/package.json +++ b/packages/survey-angular-ui/package.json @@ -1,6 +1,6 @@ { "name": "survey-angular-ui", - "version": "1.9.98", + "version": "1.9.101", "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.", "keywords": [ "Survey", diff --git a/packages/survey-angular-ui/src/base-angular.ts b/packages/survey-angular-ui/src/base-angular.ts index b8a1449147..2a4198317d 100644 --- a/packages/survey-angular-ui/src/base-angular.ts +++ b/packages/survey-angular-ui/src/base-angular.ts @@ -4,7 +4,7 @@ import { EmbeddedViewContentComponent } from "./embedded-view-content.component" @Component({ template: "" - }) +}) export abstract class BaseAngular extends EmbeddedViewContentComponent implements DoCheck, OnDestroy { constructor(protected changeDetectorRef: ChangeDetectorRef, viewContainerRef?: ViewContainerRef) { super(viewContainerRef); @@ -84,15 +84,14 @@ export abstract class BaseAngular extends EmbeddedViewCon } } - private update(key: string) { + protected update(key?: string): void { if (this.getIsRendering()) return; this.beforeUpdate(); - if(this.getPropertiesToUpdateSync().indexOf(key) > -1) { + if(key && this.getPropertiesToUpdateSync().indexOf(key) > -1) { this.detectChanges(); this.afterUpdate(key); } else { - ((window)["__zone_symbol__queueMicrotask"] - ? (window)["__zone_symbol__queueMicrotask"] : queueMicrotask)(() => { + queueMicrotask(() => { if(!this.isDestroyed) { this.setIsRendering(true); this.detectChanges(); diff --git a/packages/survey-angular-ui/src/components/list/list-item.component.html b/packages/survey-angular-ui/src/components/list/list-item.component.html index 514fbcac44..f2a97904eb 100644 --- a/packages/survey-angular-ui/src/components/list/list-item.component.html +++ b/packages/survey-angular-ui/src/components/list/list-item.component.html @@ -5,7 +5,7 @@
- diff --git a/packages/survey-angular-ui/src/components/popup/modal-container.component.ts b/packages/survey-angular-ui/src/components/popup/modal-container.component.ts index 477f6ba7d9..7ae609e2df 100644 --- a/packages/survey-angular-ui/src/components/popup/modal-container.component.ts +++ b/packages/survey-angular-ui/src/components/popup/modal-container.component.ts @@ -17,8 +17,8 @@ export class ModalComponent { constructor(private popupService: PopupService) { } - showDialog(dialogOptions: IDialogOptions, container?: HTMLElement): PopupBaseViewModel { - this.model = createPopupModalViewModel(dialogOptions, container); + showDialog(dialogOptions: IDialogOptions, rootElement?: HTMLElement): PopupBaseViewModel { + this.model = createPopupModalViewModel(dialogOptions, rootElement); this.model.model.onHide = () => { this.portalHost.detach(); this.model.dispose(); @@ -52,10 +52,15 @@ export class ModalComponent { ); return this.showDialog(options); }; + + settings.showDialog = (dialogOptions: IDialogOptions, rootElement?: HTMLElement) => { + return this.showDialog(dialogOptions, rootElement); + }; } ngOnDestroy() { if(this.functionDefined) { settings.showModal = undefined; + settings.showDialog = undefined; } } } diff --git a/packages/survey-angular-ui/src/questions/file.component.html b/packages/survey-angular-ui/src/questions/file.component.html index 20840bb9ee..55c50e409a 100644 --- a/packages/survey-angular-ui/src/questions/file.component.html +++ b/packages/survey-angular-ui/src/questions/file.component.html @@ -36,6 +36,7 @@ {{ model.dragAreaPlaceholder }}