Skip to content

Commit

Permalink
Merge branch 'master' into FIO-8548-choices-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-formio committed Jan 17, 2025
2 parents c250e0b + fcd067b commit b0f317d
Show file tree
Hide file tree
Showing 56 changed files with 804 additions and 308 deletions.
7 changes: 7 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const replace = require('gulp-replace');
const rename = require('gulp-rename');
const cleanCSS = require('gulp-clean-css');
const clean = require('gulp-clean');
const packageJson = require('./package.json');

// Clean lib folder.
gulp.task('clean:dist', () => {
Expand All @@ -22,6 +23,12 @@ gulp.task('builder-fonts', function builderFonts() {
return gulp.src('./node_modules/bootstrap-icons/font/fonts/*').pipe(gulp.dest('dist/fonts'));
});

gulp.task('version', () => {
return gulp.src(['./lib/**/Formio.js', './lib/**/Embed.js'])
.pipe(replace('FORMIO_VERSION', packageJson.version))
.pipe(gulp.dest('lib'));
})

// Generate styles
const compileStyles = (styles, file) => {
const sassFilter = filter('**/*.scss', { restore: true });
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@formio/js",
"version": "5.0.0-rc.59",
"version": "5.1.0-dev.2",
"description": "JavaScript powered Forms with JSON Form Builder",
"main": "lib/cjs/index.js",
"exports": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"build": "yarn doc && yarn lib && yarn dist",
"doc": "typedoc",
"dist": "gulp clean:dist && webpack --config webpack.config.js && webpack --config webpack.prod.js && gulp build",
"lib": "gulp clean:lib && tsc --project tsconfig.cjs.json && tsc --project tsconfig.mjs.json && yarn lib:package",
"lib": "gulp clean:lib && tsc --project tsconfig.cjs.json && tsc --project tsconfig.mjs.json && yarn lib:package && gulp version",
"lib:package": "node ./libpackage.js",
"version": "node -e 'console.log(require(`./package.json`).version)'",
"build-app": "yarn build-app:create-app && yarn build-app:jekyll && yarn build-app:remove-app",
Expand Down Expand Up @@ -80,9 +80,9 @@
},
"homepage": "https://github.com/formio/formio.js#readme",
"dependencies": {
"@formio/bootstrap": "3.0.0-dev.119.c4cb299",
"@formio/bootstrap": "v3.0.0-dev.121.085d187",
"@formio/choices.js": "11.0.3-rc.1",
"@formio/core": "2.1.0-dev.193.68cf8c3",
"@formio/core": "v2.4.0-dev.2",
"@formio/text-mask-addons": "3.8.0-formio.4",
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
"abortcontroller-polyfill": "^1.7.5",
Expand Down
8 changes: 4 additions & 4 deletions src/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ export default class Form extends Element {
*/
build() {
if (!this.instance) {
return Promise.reject('Form not ready. Use form.ready promise');
return Promise.reject(this.t('formNotReady'));
}

if (!this.element) {
return Promise.reject('No DOM element for form.');
return Promise.reject(this.t('noFormElement'));
}

// Add temporary loader.
Expand All @@ -463,7 +463,7 @@ export default class Form extends Element {

render() {
if (!this.instance) {
return Promise.reject('Form not ready. Use form.ready promise');
return Promise.reject(this.t('formNotReady'));
}
return Promise.resolve(this.instance.render())
.then((param) => {
Expand All @@ -474,7 +474,7 @@ export default class Form extends Element {

attach(element) {
if (!this.instance) {
return Promise.reject('Form not ready. Use form.ready promise');
return Promise.reject(this.t('formNotReady'));
}
if (this.element) {
delete this.element.component;
Expand Down
8 changes: 4 additions & 4 deletions src/PDFBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ export default class PDFBuilder extends WebformBuilder {
const progress = Math.floor((event.loaded / event.total) * 100);
this.refs.uploadProgress.style.width = `${progress}%`;
if (progress > 98) {
this.refs.uploadProgress.innerHTML = this.t('Converting PDF. Please wait.');
this.refs.uploadProgress.innerHTML = this.t('waitPdfConverting');
}
else {
this.refs.uploadProgress.innerHTML = `${this.t('Uploading')} ${progress}%`;
this.refs.uploadProgress.innerHTML = `${this.t('uploading')} ${progress}%`;
}
}
}, `${this.projectUrl}/upload`, {}, 'file')
Expand Down Expand Up @@ -263,7 +263,7 @@ export default class PDFBuilder extends WebformBuilder {
return;
}
this.refs.uploadError.style.display = message ? '' : 'none';
this.refs.uploadError.innerHTML = message;
this.refs.uploadError.innerHTML = this.t(`${message}`);
}

createForm(options) {
Expand Down Expand Up @@ -522,7 +522,7 @@ export default class PDFBuilder extends WebformBuilder {
name: 'showBuilderErrors',
data: {
compId: comp.component.id,
errorMessage: `API Key is not unique: ${comp.key}`,
errorMessage: `${this.t('notUniqueKey')}: ${comp.key}`,
}
});
}
Expand Down
Loading

0 comments on commit b0f317d

Please sign in to comment.