@mediafly/js-ui 51.3.3-2 → 51.4.0-0
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/lib/constants/constants.js +1 -2
- package/lib/constants/constants.js.map +1 -1
- package/lib/date-input/date-input.js +12 -33
- package/lib/date-input/date-input.js.map +1 -1
- package/lib/date-input/validate-date.js +8 -12
- package/lib/date-input/validate-date.js.map +1 -1
- package/lib/date-time-zone-picker/date-time-zone-factory.js +49 -62
- package/lib/date-time-zone-picker/date-time-zone-factory.js.map +1 -1
- package/lib/date-time-zone-picker/date-time-zone-picker.html +6 -6
- package/lib/date-time-zone-picker/date-time-zone-picker.js +59 -119
- package/lib/date-time-zone-picker/date-time-zone-picker.js.map +1 -1
- package/lib/date-time-zone-picker/datepicker.html +3 -2
- package/lib/date-time-zone-picker/datepicker.js +26 -79
- package/lib/date-time-zone-picker/datepicker.js.map +1 -1
- package/lib/date-time-zone-picker/time-format-filter.js +8 -8
- package/lib/date-time-zone-picker/time-format-filter.js.map +1 -1
- package/lib/date-time-zone-picker/time-zone-picker.js +1 -1
- package/lib/date-time-zone-picker/timepicker.html +2 -1
- package/lib/date-time-zone-picker/timepicker.js +40 -35
- package/lib/date-time-zone-picker/timepicker.js.map +1 -1
- package/lib/feedback/feedback.component.html +17 -7
- package/lib/styles.css +10 -22
- package/lib/time-input/time-input.js +23 -27
- package/lib/time-input/time-input.js.map +1 -1
- package/lib/time-input/validate-time.js +3 -6
- package/lib/time-input/validate-time.js.map +1 -1
- package/lib/tsconfig.deploy.tsbuildinfo +25 -163
- package/package.json +4 -4
- package/src/components/constants/constants.js +1 -2
- package/src/components/date-input/date-input.js +12 -31
- package/src/components/date-input/validate-date.js +10 -14
- package/src/components/date-time-zone-picker/date-time-zone-factory.ts +49 -62
- package/src/components/date-time-zone-picker/date-time-zone-picker.html +6 -6
- package/src/components/date-time-zone-picker/date-time-zone-picker.ts +70 -131
- package/src/components/date-time-zone-picker/datepicker.html +3 -2
- package/src/components/date-time-zone-picker/datepicker.ts +26 -83
- package/src/components/date-time-zone-picker/time-format-filter.ts +8 -8
- package/src/components/date-time-zone-picker/time-zone-picker.js +1 -1
- package/src/components/date-time-zone-picker/timepicker.html +2 -1
- package/src/components/date-time-zone-picker/timepicker.js +47 -46
- package/src/components/feedback/feedback.component.html +17 -7
- package/src/components/feedback/feedback.less +24 -13
- package/src/components/less/objects/containers.less +15 -17
- package/src/components/less/variables/colors.less +8 -0
- package/src/components/time-input/time-input.js +24 -27
- package/src/components/time-input/validate-time.js +3 -6
- package/src/index.spec.js +1 -1
- package/tsconfig.tsbuildinfo +7221 -0
- package/webpack.config.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
|
-
import
|
|
2
|
+
import moment from 'moment'
|
|
3
3
|
import Pikaday from 'pikaday'
|
|
4
4
|
import { recursivelySetPristine } from '../form-validation-utils/form-validation-utils'
|
|
5
5
|
import type { TranslateFactory } from '../translate/translate-factory'
|
|
@@ -9,7 +9,7 @@ interface PikadayInstance {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// Wrapper directive for pikaday datepicker component
|
|
12
|
-
// This 3rd party component has
|
|
12
|
+
// This 3rd party component has a dependency on moment.js
|
|
13
13
|
angular.module('app').directive('mflyDatePicker', [
|
|
14
14
|
'dateTimeZoneFactory',
|
|
15
15
|
'translateFactory',
|
|
@@ -25,7 +25,7 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
25
25
|
isDisabled: '=',
|
|
26
26
|
isRequired: '@',
|
|
27
27
|
format: '@',
|
|
28
|
-
|
|
28
|
+
dateMoment: '=',
|
|
29
29
|
onDateChange: '&',
|
|
30
30
|
onOpen: '&'
|
|
31
31
|
},
|
|
@@ -37,7 +37,7 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// if a "small" format is required we need to set it here
|
|
40
|
-
const dateStringFormat = ($scope.format === 'short') ? '
|
|
40
|
+
const dateStringFormat = ($scope.format === 'short') ? 'D-MMM-YYYY' : 'D-MMMM-YYYY'
|
|
41
41
|
|
|
42
42
|
// The Pikaday component does some odd formatting at times
|
|
43
43
|
// This flag helps avoid this anomaly when it occurs
|
|
@@ -51,9 +51,10 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
51
51
|
|
|
52
52
|
// set up default options for the pikaday component
|
|
53
53
|
const pikadayOptions = {
|
|
54
|
-
field:
|
|
54
|
+
field: inputElement[0],
|
|
55
|
+
trigger: wrapperDiv[0],
|
|
55
56
|
firstDay: 1,
|
|
56
|
-
format: dateStringFormat
|
|
57
|
+
format: dateStringFormat,
|
|
57
58
|
yearRange: 10,
|
|
58
59
|
setDefaultDate: true,
|
|
59
60
|
defaultDate: '',
|
|
@@ -70,37 +71,21 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
70
71
|
// Handler for when a date is 'selected' with the picker
|
|
71
72
|
// selection happens on enter, blur, and by using the popup calendars
|
|
72
73
|
onSelect() {
|
|
73
|
-
// update the bound date
|
|
74
|
-
|
|
74
|
+
// update the bound date moment
|
|
75
|
+
$scope.dateMoment = picker.getMoment()
|
|
75
76
|
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
$scope.$apply(() => { $scope.updateDate(selectedDate) })
|
|
79
|
-
} else {
|
|
80
|
-
$scope.updateDate(selectedDate)
|
|
81
|
-
}
|
|
77
|
+
// fire a change in the parent directive for the api
|
|
78
|
+
$scope.onDateChange({ newDate: $scope.dateMoment })
|
|
82
79
|
}
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
// Handle for the Pikaday component
|
|
86
83
|
const picker = new Pikaday(pikadayOptions)
|
|
87
84
|
|
|
88
|
-
$scope
|
|
89
|
-
$scope.dateLuxon = newDate ? DateTime.fromJSDate(newDate) : null
|
|
90
|
-
// fire a change in the parent directive for the api
|
|
91
|
-
$scope.onDateChange({ newDate: $scope.dateLuxon })
|
|
92
|
-
|
|
93
|
-
// Set the form control as dirty and valid when date changes
|
|
94
|
-
$scope.form?.validation?.mflyDatepicker?.$setDirty()
|
|
95
|
-
$scope.form?.validation?.mflyDatepicker?.$setValidity('invalidDate', true)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
$scope.$watch('dateLuxon', function(newValue: any, oldValue) {
|
|
85
|
+
$scope.$watch('dateMoment', function(newValue, oldValue) {
|
|
99
86
|
|
|
100
87
|
if (newValue === oldValue) { // i.e., initializing
|
|
101
|
-
|
|
102
|
-
picker.setDate($scope.dateLuxon.toJSDate())
|
|
103
|
-
}
|
|
88
|
+
picker.setMoment($scope.dateMoment)
|
|
104
89
|
recursivelySetPristine($scope.form.validation)
|
|
105
90
|
return
|
|
106
91
|
}
|
|
@@ -118,9 +103,7 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
118
103
|
|
|
119
104
|
// Otherwise, it may be a legit change. For example, if the model was
|
|
120
105
|
// programmatically changed from somewhere outside the component.
|
|
121
|
-
picker.
|
|
122
|
-
// Also update the input value to match our format
|
|
123
|
-
$scope.dateInputValue.date = newValue.toFormat(dateStringFormat)
|
|
106
|
+
picker.setMoment($scope.dateMoment, true) // true = do not trigger onSelect
|
|
124
107
|
})
|
|
125
108
|
|
|
126
109
|
// watch necessary to style preceding add-on element (CSS has no prev sibling selector)
|
|
@@ -136,66 +119,37 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
136
119
|
})
|
|
137
120
|
|
|
138
121
|
|
|
139
|
-
$scope.
|
|
122
|
+
$scope.setPikadayMoment = function() {
|
|
140
123
|
|
|
141
|
-
|
|
142
|
-
let tempDateTime
|
|
143
|
-
for (const format of dateTimeZoneFactory.validDateFormats) {
|
|
144
|
-
tempDateTime = DateTime.fromFormat($scope.dateInputValue.date, format)
|
|
145
|
-
if (tempDateTime.isValid) {
|
|
146
|
-
break
|
|
147
|
-
}
|
|
148
|
-
}
|
|
124
|
+
const tempMoment = moment($scope.dateInputValue.date, 'DD-MMMM-YYYY')
|
|
149
125
|
|
|
150
126
|
// The pikaday will oddly format 2 digit years to 0003
|
|
151
|
-
// The year is correct in the
|
|
152
|
-
// To prevent we will set the
|
|
153
|
-
if (!preventPikadayUpdate
|
|
154
|
-
|
|
155
|
-
picker.setDate(tempDateTime.toJSDate(), true)
|
|
156
|
-
|
|
157
|
-
// Manually update the dateLuxon to trigger reformatting
|
|
158
|
-
const updateDateTime = () => {
|
|
159
|
-
$scope.dateLuxon = tempDateTime
|
|
160
|
-
$scope.onDateChange({ newDate: tempDateTime })
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// Safely handle the digest cycle
|
|
164
|
-
if ($scope.$root.$$phase !== '$digest' && $scope.$root.$$phase !== '$apply') {
|
|
165
|
-
$scope.$apply(updateDateTime)
|
|
166
|
-
} else {
|
|
167
|
-
updateDateTime()
|
|
168
|
-
}
|
|
127
|
+
// The year is correct in the moment, but you can see the odd string when formatted
|
|
128
|
+
// To prevent we will set the moment manually if the user is not backspacing/deleting
|
|
129
|
+
if (!preventPikadayUpdate) {
|
|
130
|
+
picker.setMoment(tempMoment)
|
|
169
131
|
} else {
|
|
170
132
|
preventPikadayUpdate = false
|
|
171
133
|
}
|
|
172
134
|
}
|
|
173
135
|
|
|
174
|
-
// called
|
|
136
|
+
// called everytime the text input is changed manually
|
|
175
137
|
$scope.validateDate = function() {
|
|
176
138
|
// pikaday interrupts the normal binding - manually update scope
|
|
177
139
|
$scope.dateInputValue.date = angular.element(inputElement[0]).val()
|
|
178
140
|
|
|
179
141
|
let isValid = true
|
|
180
142
|
if ($scope.dateInputValue.date && $scope.dateInputValue.date.length > 0) {
|
|
181
|
-
// attempt to create a date
|
|
182
|
-
isValid =
|
|
183
|
-
for (const format of dateTimeZoneFactory.validDateFormats) {
|
|
184
|
-
const parsed = DateTime.fromFormat($scope.dateInputValue.date, format)
|
|
185
|
-
if (parsed.isValid) {
|
|
186
|
-
isValid = true
|
|
187
|
-
$scope.updateDate(parsed.toJSDate())
|
|
188
|
-
break
|
|
189
|
-
}
|
|
190
|
-
}
|
|
143
|
+
// attempt to create a date form value
|
|
144
|
+
isValid = moment($scope.dateInputValue.date, dateTimeZoneFactory.validDateFormats, true).isValid()
|
|
191
145
|
|
|
192
146
|
if (isValid) {
|
|
193
|
-
$scope.
|
|
147
|
+
$scope.setPikadayMoment()
|
|
194
148
|
}
|
|
195
149
|
|
|
196
150
|
} else if ($scope.dateInputValue.date.length === 0) {
|
|
197
|
-
// clear the scope
|
|
198
|
-
$scope.
|
|
151
|
+
// clear the scope moment
|
|
152
|
+
$scope.dateMoment = null
|
|
199
153
|
// update the parent component
|
|
200
154
|
$scope.onDateChange({ newDate: null })
|
|
201
155
|
} else {
|
|
@@ -212,17 +166,6 @@ angular.module('app').directive('mflyDatePicker', [
|
|
|
212
166
|
}
|
|
213
167
|
}
|
|
214
168
|
|
|
215
|
-
$scope.onBlur = function() {
|
|
216
|
-
// Validate the date
|
|
217
|
-
$scope.validateDate()
|
|
218
|
-
|
|
219
|
-
// Hide the Pikaday calendar popup
|
|
220
|
-
picker.hide()
|
|
221
|
-
|
|
222
|
-
// Update focus state
|
|
223
|
-
$scope.focusAddOn = false
|
|
224
|
-
}
|
|
225
|
-
|
|
226
169
|
$scope.requiredText = translateFactory.instant('JSUI.REQUIRED')
|
|
227
170
|
$scope.invalidDateText = translateFactory.instant('JSUI.INVALID_DATE')
|
|
228
171
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
2
|
import _ from 'lodash'
|
|
3
|
-
import
|
|
3
|
+
import moment from 'moment'
|
|
4
4
|
|
|
5
5
|
// This filter takes a datetime string with UTC offset, like `2015-09-30T00:00:00-08:00`
|
|
6
6
|
// and converts it to a short format with time zone code displayed, like `12:00 AM AKST`.
|
|
@@ -13,7 +13,7 @@ angular.module('app').filter('formatDate', function formatDate() {
|
|
|
13
13
|
return ''
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
const formattedDateTime =
|
|
16
|
+
const formattedDateTime = moment.parseZone(date).format('M/DD/YY')
|
|
17
17
|
|
|
18
18
|
return formattedDateTime
|
|
19
19
|
}
|
|
@@ -28,11 +28,11 @@ angular.module('app').filter('formatTimeWithTimeZone', ['dateTimeZoneFactory', f
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// Parse zone preserves the string date's offset --ignoring offset in locale)
|
|
31
|
-
const dateTimeZone =
|
|
31
|
+
const dateTimeZone = moment.parseZone(date)
|
|
32
32
|
|
|
33
|
-
const formattedTime = dateTimeZone.
|
|
33
|
+
const formattedTime = dateTimeZone.format('h:mm A')
|
|
34
34
|
|
|
35
|
-
// NOTE: getTimeZone expects a
|
|
35
|
+
// NOTE: getTimeZone expects a momentDate
|
|
36
36
|
const formattedZone = dateTimeZoneFactory.getTimeZone(dateTimeZone).display
|
|
37
37
|
|
|
38
38
|
return `${formattedTime} ${formattedZone}`
|
|
@@ -48,11 +48,11 @@ angular.module('app').filter('formatDateTimeWithTimeZone', ['dateTimeZoneFactory
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// Parse zone preserves the string date's offset --ignoring offset in locale)
|
|
51
|
-
const dateTimeZone =
|
|
51
|
+
const dateTimeZone = moment.parseZone(date)
|
|
52
52
|
|
|
53
|
-
const formattedDateTime =
|
|
53
|
+
const formattedDateTime = moment.parseZone(date).format('M/DD/YY h:mm A')
|
|
54
54
|
|
|
55
|
-
// NOTE: getTimeZone expects a
|
|
55
|
+
// NOTE: getTimeZone expects a momentDate
|
|
56
56
|
const formattedZone = dateTimeZoneFactory.getTimeZone(dateTimeZone).display
|
|
57
57
|
|
|
58
58
|
return `${formattedDateTime} ${formattedZone}`
|
|
@@ -36,7 +36,7 @@ angular.module('app').directive('mflyTimeZonePicker', ['dateTimeZoneFactory', fu
|
|
|
36
36
|
//update the bound timeZone object
|
|
37
37
|
$scope.timeZone = $scope.timeZones[index];
|
|
38
38
|
//update the parent component
|
|
39
|
-
//must pass the zone value as the parent
|
|
39
|
+
//must pass the zone value as the parent funciton does not get the update first
|
|
40
40
|
$scope.onTimeZoneChange({zoneOffset:$scope.timeZone.value});
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import angular from 'angular'
|
|
2
2
|
import template from './timepicker.html'
|
|
3
|
-
|
|
3
|
+
import moment from 'moment'
|
|
4
4
|
|
|
5
|
-
angular.module('app').directive('mflyTimePicker', ['translateFactory', function mflyTimePicker(translateFactory) {
|
|
5
|
+
angular.module('app').directive('mflyTimePicker', ['translateFactory', function mflyTimePicker (translateFactory) {
|
|
6
6
|
|
|
7
7
|
return {
|
|
8
8
|
restrict: 'E',
|
|
9
9
|
replace: true,
|
|
10
10
|
scope: {
|
|
11
11
|
inputId: '@',
|
|
12
|
-
|
|
12
|
+
timeMoment: '=',
|
|
13
13
|
onTimeChange: '&'
|
|
14
14
|
},
|
|
15
15
|
template,
|
|
16
|
-
link: function
|
|
16
|
+
link: function($scope) {
|
|
17
17
|
var validTimeFormats = [
|
|
18
18
|
'h:mm',
|
|
19
19
|
'h:mm A',
|
|
20
20
|
'h:mmA'
|
|
21
21
|
];
|
|
22
22
|
|
|
23
|
-
const luxonFormats = ['H:mm', 'h:mm a', 'h:mma'];
|
|
24
|
-
|
|
25
23
|
$scope.timeValue = {
|
|
26
24
|
time: '',
|
|
27
25
|
initialized: false
|
|
@@ -34,75 +32,78 @@ angular.module('app').directive('mflyTimePicker', ['translateFactory', function
|
|
|
34
32
|
|
|
35
33
|
// If the DTZ picker is initialized, or has its value changed
|
|
36
34
|
// programmatically, we need to update the time picker accordingly.
|
|
37
|
-
$scope.$watch('
|
|
35
|
+
$scope.$watch('timeMoment', function (newValue) {
|
|
38
36
|
if (newValue) {
|
|
39
|
-
$scope.timeValue.time = $scope.
|
|
37
|
+
$scope.timeValue.time = $scope.timeMoment.format('h:mm A');
|
|
40
38
|
}
|
|
41
39
|
});
|
|
42
40
|
|
|
43
|
-
$scope.validateTime = function
|
|
41
|
+
$scope.validateTime = function() {
|
|
44
42
|
if ($scope.timeValue.time) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
processTime(parsed);
|
|
50
|
-
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', true);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
43
|
+
var isValid = moment($scope.timeValue.time, validTimeFormats, true).isValid();
|
|
44
|
+
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', isValid);
|
|
45
|
+
if (isValid) {
|
|
46
|
+
processTime();
|
|
53
47
|
}
|
|
48
|
+
} else {
|
|
49
|
+
//if the time is removed it is invalid
|
|
50
|
+
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', false);
|
|
54
51
|
}
|
|
55
|
-
|
|
56
|
-
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', false);
|
|
57
52
|
};
|
|
58
53
|
|
|
59
|
-
//watch necessary to style
|
|
60
|
-
$scope.$watch('form.validation.mflyTimepicker', function
|
|
54
|
+
//watch necessary to style preceeding add-on element (CSS has no prev sibling selector)
|
|
55
|
+
$scope.$watch('form.validation.mflyTimepicker', function(newValue){
|
|
61
56
|
if (newValue) {
|
|
62
|
-
$scope.$watch('form.validation.mflyTimepicker.$valid', function
|
|
57
|
+
$scope.$watch('form.validation.mflyTimepicker.$valid', function(newValue){
|
|
63
58
|
$scope.invalidAddOn = !newValue;
|
|
64
59
|
});
|
|
65
|
-
$scope.$watch('form.validation.mflyTimepicker.$dirty', function
|
|
60
|
+
$scope.$watch('form.validation.mflyTimepicker.$dirty', function(newValue){
|
|
66
61
|
$scope.dirtyAddOn = newValue;
|
|
67
62
|
});
|
|
68
63
|
}
|
|
69
64
|
});
|
|
70
65
|
|
|
71
|
-
function processTime(
|
|
72
|
-
$scope.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
function processTime() {
|
|
67
|
+
if ($scope.timeValue.time && $scope.form.validation.mflyTimepicker.$valid) {
|
|
68
|
+
//update our time moment with the time change in the textbox
|
|
69
|
+
var tempMomemnt = moment($scope.timeValue.time, validTimeFormats, true);
|
|
70
|
+
|
|
71
|
+
$scope.timeMoment.hour(tempMomemnt.hour());
|
|
72
|
+
$scope.timeMoment.minute(tempMomemnt.minute());
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
//callback to the parent component
|
|
75
|
+
$scope.onTimeChange();
|
|
76
|
+
} else {
|
|
77
|
+
//reset time value
|
|
78
|
+
$scope.timeValue.time = '12:00 AM';
|
|
79
|
+
$scope.validateTime();
|
|
80
|
+
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
|
|
84
|
-
function populateDropdown()
|
|
85
|
-
if ($scope.
|
|
86
|
-
$scope.timeValue.time = $scope.
|
|
84
|
+
function populateDropdown(){
|
|
85
|
+
if ($scope.timeMoment) {
|
|
86
|
+
$scope.timeValue.time = $scope.timeMoment.format('hh:mm A');
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
//
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
var todaysDate =
|
|
89
|
+
//init a moment with todays date
|
|
90
|
+
var tempMoment = moment();
|
|
91
|
+
//store that date in a seperate value
|
|
92
|
+
var todaysDate = tempMoment.date();
|
|
93
93
|
|
|
94
|
-
//
|
|
95
|
-
|
|
94
|
+
//backup our moment to 12:00am
|
|
95
|
+
tempMoment.hour(0);
|
|
96
|
+
tempMoment.minute(0);
|
|
96
97
|
|
|
97
|
-
//
|
|
98
|
+
//push 30 min intervals into our dropdown array until the date changes
|
|
98
99
|
do {
|
|
99
|
-
$scope.dropdownItems.push(
|
|
100
|
-
|
|
101
|
-
} while (todaysDate ===
|
|
100
|
+
$scope.dropdownItems.push(tempMoment.format('hh:mm A'));
|
|
101
|
+
tempMoment.add(30, 'm');
|
|
102
|
+
} while (todaysDate === tempMoment.date());
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
|
|
105
|
-
$scope.itemClicked = function
|
|
106
|
+
$scope.itemClicked = function(itemValue){
|
|
106
107
|
$scope.form.validation.mflyTimepicker.$setDirty();
|
|
107
108
|
$scope.timeValue.time = itemValue;
|
|
108
109
|
$scope.validateTime();
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
<div class="c-feedback_container">
|
|
2
2
|
<div class="c-feedback">
|
|
3
3
|
|
|
4
|
-
<div
|
|
5
|
-
ng-
|
|
4
|
+
<div
|
|
5
|
+
ng-repeat="alert in $ctrl.alerts"
|
|
6
|
+
ng-class="'o-alert--' + alert.type"
|
|
6
7
|
class="o-alert c-feedback__contents u-center-vertical"
|
|
7
8
|
close="$ctrl.closeAlert()"
|
|
8
|
-
role="alert"
|
|
9
|
+
role="alert"
|
|
10
|
+
>
|
|
11
|
+
<div class="c-feedback__icon">
|
|
12
|
+
<span ng-if="alert.type === 'success'" class="far fa-check-circle"></span>
|
|
13
|
+
<span ng-if="alert.type === 'danger'" class="far fa-exclamation-circle"></span>
|
|
14
|
+
<span ng-if="alert.type === 'warning'" class="far fa-exclamation-triangle"></span>
|
|
15
|
+
<span ng-if="alert.type === 'info'" class="far fa-info-circle"></span>
|
|
16
|
+
</div>
|
|
9
17
|
|
|
10
|
-
<button
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
ng-
|
|
18
|
+
<button
|
|
19
|
+
type="button"
|
|
20
|
+
class="c-feedback__close"
|
|
21
|
+
ng-class="'c-feedback--' + alert.type + '__close'"
|
|
22
|
+
ng-click="$ctrl.closeAlert()"
|
|
23
|
+
>
|
|
14
24
|
<span class="far fa-times"></span>
|
|
15
25
|
</button>
|
|
16
26
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
margin-left: auto;
|
|
19
19
|
margin-right: auto;
|
|
20
20
|
pointer-events: none;
|
|
21
|
-
text-align:
|
|
21
|
+
text-align: left;
|
|
22
22
|
width: @feedback-width-flexible;
|
|
23
23
|
|
|
24
24
|
@media (min-width: @feedback-breakpoint) {
|
|
@@ -73,6 +73,17 @@
|
|
|
73
73
|
font-size: @font-size-base;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
.c-feedback__icon {
|
|
77
|
+
align-items: center;
|
|
78
|
+
display: flex;
|
|
79
|
+
font-size: 22px;
|
|
80
|
+
height: 100%;
|
|
81
|
+
left: 0;
|
|
82
|
+
padding-left: 20px;
|
|
83
|
+
position: absolute;
|
|
84
|
+
top: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
76
87
|
// Close button
|
|
77
88
|
.c-feedback__close {
|
|
78
89
|
border: none;
|
|
@@ -90,37 +101,37 @@
|
|
|
90
101
|
|
|
91
102
|
// Close button colors
|
|
92
103
|
.c-feedback--success__close {
|
|
93
|
-
background-color:
|
|
94
|
-
color: @color-
|
|
104
|
+
background-color: tint(@color-ui-theme-success-light, 85%);
|
|
105
|
+
color: @color-ui-theme-text-primary;
|
|
95
106
|
|
|
96
107
|
&:hover {
|
|
97
|
-
background-color:
|
|
108
|
+
background-color: tint(@color-ui-theme-success-light, 85%);
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
|
|
101
112
|
.c-feedback--danger__close {
|
|
102
|
-
background-color:
|
|
103
|
-
color: @color-
|
|
113
|
+
background-color: tint(@color-ui-theme-error-light, 85%);
|
|
114
|
+
color: @color-ui-theme-text-primary;
|
|
104
115
|
|
|
105
116
|
&:hover {
|
|
106
|
-
background-color:
|
|
117
|
+
background-color: tint(@color-ui-theme-error-light, 85%);
|
|
107
118
|
}
|
|
108
119
|
}
|
|
109
120
|
|
|
110
121
|
.c-feedback--warning__close {
|
|
111
|
-
background-color:
|
|
112
|
-
color: @color-
|
|
122
|
+
background-color: tint(@color-ui-theme-warning-light, 65%);
|
|
123
|
+
color: @color-ui-theme-text-primary;
|
|
113
124
|
|
|
114
125
|
&:hover {
|
|
115
|
-
background-color:
|
|
126
|
+
background-color: tint(@color-ui-theme-warning-light, 65%);
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
129
|
|
|
119
130
|
.c-feedback--info__close {
|
|
120
|
-
background-color:
|
|
121
|
-
color: @color-
|
|
131
|
+
background-color: tint(@color-ui-theme-info-light, 85%);
|
|
132
|
+
color: @color-ui-theme-text-primary;
|
|
122
133
|
|
|
123
134
|
&:hover {
|
|
124
|
-
background-color:
|
|
135
|
+
background-color: tint(@color-ui-theme-info-light, 85%);
|
|
125
136
|
}
|
|
126
137
|
}
|
|
@@ -30,34 +30,32 @@
|
|
|
30
30
|
|
|
31
31
|
// Alert colors
|
|
32
32
|
.o-alert--success {
|
|
33
|
-
background-color: @color-success-light;
|
|
34
|
-
border-color:
|
|
35
|
-
color: @color-success;
|
|
33
|
+
background-color: tint(@color-ui-theme-success-light, 85%);
|
|
34
|
+
border-color: tint(@color-ui-theme-success-light, 50%);
|
|
35
|
+
color: @color-ui-theme-success;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.o-alert--danger {
|
|
39
|
-
background-color: @color-
|
|
40
|
-
border-color:
|
|
41
|
-
color: @color-
|
|
39
|
+
background-color: tint(@color-ui-theme-error-light, 85%);
|
|
40
|
+
border-color: tint(@color-ui-theme-error-light, 50%);
|
|
41
|
+
color: @color-ui-theme-error;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.o-alert--warning {
|
|
45
|
-
background-color: @color-warning-light;
|
|
46
|
-
border-color:
|
|
47
|
-
color: @color-
|
|
45
|
+
background-color: tint(@color-ui-theme-warning-light, 65%);
|
|
46
|
+
border-color: tint(@color-ui-theme-warning-light, 50%);
|
|
47
|
+
color: @color-ui-theme-text-primary;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.o-alert--info {
|
|
51
|
-
background-color: @color-info-light;
|
|
52
|
-
border-color:
|
|
53
|
-
color: @color-info;
|
|
51
|
+
background-color: tint(@color-ui-theme-info-light, 85%);
|
|
52
|
+
border-color: tint(@color-ui-theme-info-light, 50%);
|
|
53
|
+
color: @color-ui-theme-info;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.o-alert a {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
.o-alert.o-alert--warning a { color: @color-warning-dark; }
|
|
60
|
-
.o-alert.o-alert--info a { color: @color-info; }
|
|
56
|
+
.o-alert a {
|
|
57
|
+
color: inherit;
|
|
58
|
+
}
|
|
61
59
|
|
|
62
60
|
// Headers
|
|
63
61
|
.o-alert__header {
|
|
@@ -52,9 +52,17 @@
|
|
|
52
52
|
@color-ui-theme-primary-light: #2b83c6;
|
|
53
53
|
@color-ui-theme-secondary: #5f5094;
|
|
54
54
|
@color-ui-theme-success: #21664c;
|
|
55
|
+
@color-ui-theme-success-dark: #194f3a;
|
|
56
|
+
@color-ui-theme-success-light: #42af84;
|
|
55
57
|
@color-ui-theme-warning: #e4cd6d;
|
|
58
|
+
@color-ui-theme-warning-dark: #deb133;
|
|
59
|
+
@color-ui-theme-warning-light: #f6e68a;
|
|
56
60
|
@color-ui-theme-info: #435f64;
|
|
61
|
+
@color-ui-theme-info-dark: #33494e;
|
|
62
|
+
@color-ui-theme-info-light: #76a4ac;
|
|
57
63
|
@color-ui-theme-error: #9d3a18;
|
|
64
|
+
@color-ui-theme-error-dark: #7a2d13;
|
|
65
|
+
@color-ui-theme-error-light: #ee7c67;
|
|
58
66
|
@color-ui-theme-text-primary: #1e202b;
|
|
59
67
|
@color-ui-theme-text-secondary: #737582; /* Only use over white. */
|
|
60
68
|
@color-ui-theme-text-disabled: #b6b7c1;
|