This is an automated email from the ASF dual-hosted git repository. thiagohp pushed a commit to branch feature/coffeescript-to-typescript in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
commit b051ea8c91f8cfdc7a5ffd6fd5be610dbb615b68 Author: Thiago H. de Paula Figueiredo <thi...@arsmachina.com.br> AuthorDate: Sat Apr 19 17:12:43 2025 -0300 TAP5-2804: more CS to TS adjustments --- .../assets/es-modules/t5/core/{ => beanvalidator}/.gitignore | 0 .../{modules/t5 => assets/es-modules/t5/core}/core/.gitignore | 0 .../t5/core => modules/t5/core/beanvalidator}/.gitignore | 0 .../{assets/es-modules/t5 => modules/t5/core}/core/.gitignore | 0 tapestry-core/src/main/typescript/package.json | 2 +- .../src/t5/beanvalidator/beanvalidator-validation.ts | 11 ++++++++--- .../src/t5/core/{dom-jquery.ts => t5-core-dom-jquery.ts} | 0 .../t5/core/{dom-prototype.ts => t5-core-dom-prototype.ts} | 0 8 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/.gitignore b/tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/beanvalidator/.gitignore similarity index 100% copy from tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/.gitignore copy to tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/beanvalidator/.gitignore diff --git a/tapestry-core/src/main/resources/META-INF/modules/t5/core/.gitignore b/tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/core/.gitignore similarity index 100% rename from tapestry-core/src/main/resources/META-INF/modules/t5/core/.gitignore rename to tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/core/.gitignore diff --git a/tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/.gitignore b/tapestry-core/src/main/resources/META-INF/modules/t5/core/beanvalidator/.gitignore similarity index 100% copy from tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/.gitignore copy to tapestry-core/src/main/resources/META-INF/modules/t5/core/beanvalidator/.gitignore diff --git a/tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/.gitignore b/tapestry-core/src/main/resources/META-INF/modules/t5/core/core/.gitignore similarity index 100% rename from tapestry-core/src/main/resources/META-INF/assets/es-modules/t5/core/.gitignore rename to tapestry-core/src/main/resources/META-INF/modules/t5/core/core/.gitignore diff --git a/tapestry-core/src/main/typescript/package.json b/tapestry-core/src/main/typescript/package.json index eb668549c..93c0bf46e 100644 --- a/tapestry-core/src/main/typescript/package.json +++ b/tapestry-core/src/main/typescript/package.json @@ -13,7 +13,7 @@ "dependencies": { }, "scripts": { - "build": "npx tsc", + "build": "npm run build-es-module; npm run build-amd", "build-es-module": "npx tsc --outDir ../resources/META-INF/assets/es-modules/t5/core/", "build-amd": "npx tsc --module amd --outDir ../resources/META-INF/modules/t5/core/", "docs": "typedoc", diff --git a/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts b/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts index b1aecfb4e..5396188d3 100644 --- a/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts +++ b/tapestry-core/src/main/typescript/src/t5/beanvalidator/beanvalidator-validation.ts @@ -13,8 +13,7 @@ // limitations under the License. /** - * - * ## t5/beanvalidator/beanvalidator-validation + * * ## t5/beanvalidator/beanvalidator-validation * * The awkward name is to accomidate the "docco" documentation tool; it doesn't understand * having the same named file in multiple folders. See https://github.com/jashkenas/docco/issues/201. @@ -28,6 +27,7 @@ import events from "t5/core/events.js" import utils from "t5/core/utils.js" import validation from "t5/core/validation.js"; +// @ts-ignore const rangeValue = function(element, attribute, defaultValue) { const v = element.attr(attribute); if (v === null) { @@ -37,6 +37,7 @@ const rangeValue = function(element, attribute, defaultValue) { } }; +// @ts-ignore const countOptions = function(e) { // A select that is used as part of a palette is different; the validation attributes // are attached to the selected (right side) <select>, and anything there counts as part @@ -49,6 +50,7 @@ const countOptions = function(e) { } }; +// @ts-ignore const doRangeValidate = function(element, value, memo) { const min = rangeValue(element, "data-range-min", 0); const max = rangeValue(element, "data-range-max", Number.MAX_VALUE); @@ -67,9 +69,10 @@ const doRangeValidate = function(element, value, memo) { return true; }; -dom.onDocument(events.field.optional, "[data-optionality=prohibited]", function(event, memo) { +dom.onDocument(events.field.optional, "[data-optionality=prohibited]", function(event, memo: any) { if (!utils.isBlank(memo.value)) { + // @ts-ignore memo.error = (this.attr("data-prohibited-message")) || "PROHIBITED"; return false; } @@ -78,9 +81,11 @@ dom.onDocument(events.field.optional, "[data-optionality=prohibited]", function( }); dom.onDocument(events.field.validate, "input[data-range-min], input[data-range-max], textarea[data-range-min], textarea[data-range-max]", function(event, memo) { + // @ts-ignore return doRangeValidate(this, memo.translated, memo); }); dom.onDocument(events.field.validate, "select[data-range-min], select[data-range-max]", function(event, memo) { + // @ts-ignore return doRangeValidate(this, (countOptions(this)), memo); }); \ No newline at end of file diff --git a/tapestry-core/src/main/typescript/src/t5/core/dom-jquery.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts similarity index 100% rename from tapestry-core/src/main/typescript/src/t5/core/dom-jquery.ts rename to tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-jquery.ts diff --git a/tapestry-core/src/main/typescript/src/t5/core/dom-prototype.ts b/tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts similarity index 100% rename from tapestry-core/src/main/typescript/src/t5/core/dom-prototype.ts rename to tapestry-core/src/main/typescript/src/t5/core/t5-core-dom-prototype.ts