@defra-fish/gafl-webapp-service 1.61.0-rc.5 → 1.61.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/gafl-webapp-service",
|
|
3
|
-
"version": "1.61.0-rc.
|
|
3
|
+
"version": "1.61.0-rc.7",
|
|
4
4
|
"description": "The websales frontend for the GAFL service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"prepare": "gulp --gulpfile build/gulpfile.cjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@defra-fish/business-rules-lib": "1.61.0-rc.
|
|
40
|
-
"@defra-fish/connectors-lib": "1.61.0-rc.
|
|
39
|
+
"@defra-fish/business-rules-lib": "1.61.0-rc.7",
|
|
40
|
+
"@defra-fish/connectors-lib": "1.61.0-rc.7",
|
|
41
41
|
"@defra/hapi-gapi": "^2.0.0",
|
|
42
42
|
"@hapi/boom": "^9.1.2",
|
|
43
43
|
"@hapi/catbox-redis": "^6.0.2",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"debug": "^4.3.3",
|
|
53
53
|
"disinfect": "^1.1.0",
|
|
54
54
|
"find": "^0.3.0",
|
|
55
|
-
"flatpickr": "^4.6.9",
|
|
56
55
|
"govuk-frontend": "^5.2.0",
|
|
57
56
|
"hapi-i18n": "^3.0.1",
|
|
58
57
|
"joi": "^17.6.0",
|
|
@@ -80,5 +79,5 @@
|
|
|
80
79
|
"./gafl-jest-matchers.js"
|
|
81
80
|
]
|
|
82
81
|
},
|
|
83
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "6f25e94fea4bfd5b6ce7a33ca0b0fc5eba46c1ae"
|
|
84
83
|
}
|
|
@@ -118,59 +118,4 @@
|
|
|
118
118
|
import { initAll } from '/public/javascript/govuk-frontend-min.js'
|
|
119
119
|
initAll()
|
|
120
120
|
</script>
|
|
121
|
-
<script src="/public/javascript/flatpickr-min.js"></script>
|
|
122
|
-
<script nonce="{{nonce}}">(function () {
|
|
123
|
-
const dataInputDiv = document.getElementById('licence-start-date')
|
|
124
|
-
const calImageDiv = document.createElement('div')
|
|
125
|
-
calImageDiv.id = 'cal-image-div'
|
|
126
|
-
const calImage = document.createElement('img')
|
|
127
|
-
calImage.src = '/public/images/icon-calendar-2x.png'
|
|
128
|
-
calImage.alt = '{{ mssgs.licence_date_picker }}'
|
|
129
|
-
calImageDiv.appendChild(calImage)
|
|
130
|
-
calImageDiv.setAttribute('aria-hidden', true)
|
|
131
|
-
dataInputDiv.appendChild(calImageDiv)
|
|
132
|
-
const fpk = flatpickr(calImageDiv, {
|
|
133
|
-
dateFormat: "d m Y",
|
|
134
|
-
disableMobile: true,
|
|
135
|
-
minDate: 'today',
|
|
136
|
-
maxDate: '{{ data.maxStartDate }}',
|
|
137
|
-
position: 'below',
|
|
138
|
-
monthSelectorType: 'static',
|
|
139
|
-
showMonths: 1,
|
|
140
|
-
clickOpens: false,
|
|
141
|
-
ariaDateFormat: "",
|
|
142
|
-
onChange: function(selectedDates, dateStr, instance) {
|
|
143
|
-
var d = new Date(selectedDates[0])
|
|
144
|
-
document.getElementById('licence-start-date-day').value = d.getDate()
|
|
145
|
-
document.getElementById('licence-start-date-month').value = d.getMonth() + 1
|
|
146
|
-
document.getElementById('licence-start-date-year').value = d.getFullYear()
|
|
147
|
-
},
|
|
148
|
-
onOpen: [ function(selectedDates, dateStr, instance) {
|
|
149
|
-
if (!document.getElementById('year-read-only')) {
|
|
150
|
-
const yearInputWrapper = document.getElementsByClassName('numInputWrapper')[0];
|
|
151
|
-
yearInputWrapper.style.display= 'none';
|
|
152
|
-
const currentMonthDiv = document.getElementsByClassName('flatpickr-current-month')[0];
|
|
153
|
-
const yearReadOnly = document.createElement('span');
|
|
154
|
-
yearReadOnly.id = 'year-read-only';
|
|
155
|
-
yearReadOnly.innerHTML = ' ' + instance.currentYear;
|
|
156
|
-
currentMonthDiv.appendChild(yearReadOnly);
|
|
157
|
-
}
|
|
158
|
-
} ],
|
|
159
|
-
onYearChange: function(selectedDates, dateStr, instance) {
|
|
160
|
-
const yearReadOnly = document.getElementById('year-read-only');
|
|
161
|
-
yearReadOnly.innerHTML = ' ' + instance.currentYear;
|
|
162
|
-
}
|
|
163
|
-
})
|
|
164
|
-
window.addEventListener('keydown', function (event) {
|
|
165
|
-
if (event.defaultPrevented) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (event.key === 'Esc' || event.key === 'Escape' ) {
|
|
169
|
-
fpk.close()
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
calImageDiv.onclick = function() {
|
|
173
|
-
fpk.toggle()
|
|
174
|
-
}
|
|
175
|
-
})()</script>
|
|
176
121
|
{% endblock %}
|