Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
84b634aa
Commit
84b634aa
authored
Feb 26, 2024
by
Alfonso Abella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generateFields WG-484 in progress
parent
b1bec4d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+9
-4
No files found.
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
84b634aa
...
@@ -274,6 +274,7 @@ const inputString = (key, validation) => {
...
@@ -274,6 +274,7 @@ const inputString = (key, validation) => {
const
{
const
{
mandatory
,
mandatory
,
fieldLength
,
fieldLength
,
validDate
,
collection
collection
}
=
validation
}
=
validation
...
@@ -378,7 +379,8 @@ const inputDate = (key, validation) => {
...
@@ -378,7 +379,8 @@ const inputDate = (key, validation) => {
try
{
try
{
const
{
const
{
mandatory
,
mandatory
,
fieldLength
fieldLength
,
validDate
}
=
validation
}
=
validation
const
input
=
document
.
createElement
(
'input'
)
const
input
=
document
.
createElement
(
'input'
)
...
@@ -386,9 +388,9 @@ const inputDate = (key, validation) => {
...
@@ -386,9 +388,9 @@ const inputDate = (key, validation) => {
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'name'
,
`
${
key
}
`
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
mandatory
?
input
.
setAttribute
(
'required'
,
'true'
)
:
null
mandatory
?
input
.
setAttribute
(
'required'
,
'true'
)
:
null
validDate
?
input
.
setAttribute
(
'validDate'
,
validDate
)
:
null
return
input
return
input
}
catch
(
err
)
{
}
catch
(
err
)
{
throw
err
throw
err
...
@@ -438,7 +440,8 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
...
@@ -438,7 +440,8 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
try
{
try
{
const
{
const
{
mandatory
,
mandatory
,
fieldLength
fieldLength
,
validDate
}
=
validation
}
=
validation
const
dateRangePicker
=
document
.
createElement
(
'div'
)
const
dateRangePicker
=
document
.
createElement
(
'div'
)
...
@@ -458,6 +461,7 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
...
@@ -458,6 +461,7 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
input
.
setAttribute
(
'type'
,
'date'
)
input
.
setAttribute
(
'type'
,
'date'
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
input
.
addEventListener
(
'focusout'
,
handleInput
)
mandatory
?
input
.
setAttribute
(
'required'
,
'true'
)
:
null
mandatory
?
input
.
setAttribute
(
'required'
,
'true'
)
:
null
validDate
?
input
.
setAttribute
(
'validDate'
,
validDate
)
:
null
startDate
.
setAttribute
(
'class'
,
'dateContainer'
)
startDate
.
setAttribute
(
'class'
,
'dateContainer'
)
// "TO" Label
// "TO" Label
...
@@ -470,6 +474,7 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
...
@@ -470,6 +474,7 @@ const inputDateRange = (key, validation) => { //Input date range is a field main
input2
.
setAttribute
(
'type'
,
'date'
)
input2
.
setAttribute
(
'type'
,
'date'
)
input2
.
addEventListener
(
'focusout'
,
handleInput
)
input2
.
addEventListener
(
'focusout'
,
handleInput
)
mandatory
?
input2
.
setAttribute
(
'required'
,
'true'
)
:
null
mandatory
?
input2
.
setAttribute
(
'required'
,
'true'
)
:
null
validDate
?
input2
.
setAttribute
(
'validDate'
,
validDate
)
:
null
endDate
.
setAttribute
(
'class'
,
'dateContainer'
)
endDate
.
setAttribute
(
'class'
,
'dateContainer'
)
dateRangePicker
.
appendChild
(
dateRange
);
dateRangePicker
.
appendChild
(
dateRange
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment