@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-zone-picker.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/date-time-zone-picker.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"date-time-zone-picker.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/date-time-zone-picker.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,oDAA2B;AAQ3B,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,wBAAwB,EAAE,CAAC,qBAAqB,EAAE,SAAS,sBAAsB,CAAC,mBAAmB;QAEpI,OAAO;YACN,QAAQ,EAAE,GAAG;YACb,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE;gBACN,MAAM,EAAE,GAAG;gBACX,OAAO,EAAE,GAAG;gBACZ,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,MAAM,EAAE,GAAG;gBACX,IAAI,EAAE,GAAG;aACT;YACD,QAAQ,EAAE,OAAO,CAAC,8BAA8B,CAAC;YACjD,IAAI,CAAC,MAAyB,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAqC;gBAErF,6EAA6E;gBAC7E,qEAAqE;gBACrE,uDAAuD;gBACvD,y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CAAA;gBAChB,CAAC,CAAA;YAEF,CAAC;SACD,CAAA;IACF,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
autocomplete="off"
|
|
7
7
|
class="o-form-control"
|
|
8
8
|
id="{{ inputId }}"
|
|
9
|
-
mfly-datepicker="
|
|
9
|
+
mfly-datepicker="momentDate"
|
|
10
10
|
name="mflyDatepicker"
|
|
11
|
-
ng-blur="
|
|
11
|
+
ng-blur="focusAddOn = false"
|
|
12
|
+
ng-change="validateDate()"
|
|
12
13
|
ng-disabled="isDisabled"
|
|
13
14
|
ng-focus="focusAddOn = true"
|
|
14
15
|
ng-keydown="inputKeyDown($event)"
|
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const angular_1 = __importDefault(require("angular"));
|
|
7
|
-
const
|
|
7
|
+
const moment_1 = __importDefault(require("moment"));
|
|
8
8
|
const pikaday_1 = __importDefault(require("pikaday"));
|
|
9
9
|
const form_validation_utils_1 = require("../form-validation-utils/form-validation-utils");
|
|
10
10
|
// Wrapper directive for pikaday datepicker component
|
|
11
|
-
// This 3rd party component has
|
|
11
|
+
// This 3rd party component has a dependency on moment.js
|
|
12
12
|
angular_1.default.module('app').directive('mflyDatePicker', [
|
|
13
13
|
'dateTimeZoneFactory',
|
|
14
14
|
'translateFactory',
|
|
@@ -20,7 +20,7 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
20
20
|
isDisabled: '=',
|
|
21
21
|
isRequired: '@',
|
|
22
22
|
format: '@',
|
|
23
|
-
|
|
23
|
+
dateMoment: '=',
|
|
24
24
|
onDateChange: '&',
|
|
25
25
|
onOpen: '&'
|
|
26
26
|
},
|
|
@@ -31,7 +31,7 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
31
31
|
date: ''
|
|
32
32
|
};
|
|
33
33
|
// if a "small" format is required we need to set it here
|
|
34
|
-
const dateStringFormat = ($scope.format === 'short') ? '
|
|
34
|
+
const dateStringFormat = ($scope.format === 'short') ? 'D-MMM-YYYY' : 'D-MMMM-YYYY';
|
|
35
35
|
// The Pikaday component does some odd formatting at times
|
|
36
36
|
// This flag helps avoid this anomaly when it occurs
|
|
37
37
|
let preventPikadayUpdate = false;
|
|
@@ -42,9 +42,10 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
42
42
|
const wrapperDiv = element.find('div');
|
|
43
43
|
// set up default options for the pikaday component
|
|
44
44
|
const pikadayOptions = {
|
|
45
|
-
field:
|
|
45
|
+
field: inputElement[0],
|
|
46
|
+
trigger: wrapperDiv[0],
|
|
46
47
|
firstDay: 1,
|
|
47
|
-
format: dateStringFormat
|
|
48
|
+
format: dateStringFormat,
|
|
48
49
|
yearRange: 10,
|
|
49
50
|
setDefaultDate: true,
|
|
50
51
|
defaultDate: '',
|
|
@@ -62,33 +63,17 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
62
63
|
// Handler for when a date is 'selected' with the picker
|
|
63
64
|
// selection happens on enter, blur, and by using the popup calendars
|
|
64
65
|
onSelect() {
|
|
65
|
-
// update the bound date
|
|
66
|
-
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
$scope.$apply(() => { $scope.updateDate(selectedDate); });
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
$scope.updateDate(selectedDate);
|
|
73
|
-
}
|
|
66
|
+
// update the bound date moment
|
|
67
|
+
$scope.dateMoment = picker.getMoment();
|
|
68
|
+
// fire a change in the parent directive for the api
|
|
69
|
+
$scope.onDateChange({ newDate: $scope.dateMoment });
|
|
74
70
|
}
|
|
75
71
|
};
|
|
76
72
|
// Handle for the Pikaday component
|
|
77
73
|
const picker = new pikaday_1.default(pikadayOptions);
|
|
78
|
-
$scope
|
|
79
|
-
var _a, _b, _c, _d, _e, _f;
|
|
80
|
-
$scope.dateLuxon = newDate ? luxon_1.DateTime.fromJSDate(newDate) : null;
|
|
81
|
-
// fire a change in the parent directive for the api
|
|
82
|
-
$scope.onDateChange({ newDate: $scope.dateLuxon });
|
|
83
|
-
// Set the form control as dirty and valid when date changes
|
|
84
|
-
(_c = (_b = (_a = $scope.form) === null || _a === void 0 ? void 0 : _a.validation) === null || _b === void 0 ? void 0 : _b.mflyDatepicker) === null || _c === void 0 ? void 0 : _c.$setDirty();
|
|
85
|
-
(_f = (_e = (_d = $scope.form) === null || _d === void 0 ? void 0 : _d.validation) === null || _e === void 0 ? void 0 : _e.mflyDatepicker) === null || _f === void 0 ? void 0 : _f.$setValidity('invalidDate', true);
|
|
86
|
-
};
|
|
87
|
-
$scope.$watch('dateLuxon', function (newValue, oldValue) {
|
|
74
|
+
$scope.$watch('dateMoment', function (newValue, oldValue) {
|
|
88
75
|
if (newValue === oldValue) { // i.e., initializing
|
|
89
|
-
|
|
90
|
-
picker.setDate($scope.dateLuxon.toJSDate());
|
|
91
|
-
}
|
|
76
|
+
picker.setMoment($scope.dateMoment);
|
|
92
77
|
form_validation_utils_1.recursivelySetPristine($scope.form.validation);
|
|
93
78
|
return;
|
|
94
79
|
}
|
|
@@ -103,9 +88,7 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
103
88
|
}
|
|
104
89
|
// Otherwise, it may be a legit change. For example, if the model was
|
|
105
90
|
// programmatically changed from somewhere outside the component.
|
|
106
|
-
picker.
|
|
107
|
-
// Also update the input value to match our format
|
|
108
|
-
$scope.dateInputValue.date = newValue.toFormat(dateStringFormat);
|
|
91
|
+
picker.setMoment($scope.dateMoment, true); // true = do not trigger onSelect
|
|
109
92
|
});
|
|
110
93
|
// watch necessary to style preceding add-on element (CSS has no prev sibling selector)
|
|
111
94
|
$scope.$watch('form.validation.mflyDatepicker', function (newValue) {
|
|
@@ -118,61 +101,33 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
118
101
|
});
|
|
119
102
|
}
|
|
120
103
|
});
|
|
121
|
-
$scope.
|
|
122
|
-
|
|
123
|
-
let tempDateTime;
|
|
124
|
-
for (const format of dateTimeZoneFactory.validDateFormats) {
|
|
125
|
-
tempDateTime = luxon_1.DateTime.fromFormat($scope.dateInputValue.date, format);
|
|
126
|
-
if (tempDateTime.isValid) {
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
104
|
+
$scope.setPikadayMoment = function () {
|
|
105
|
+
const tempMoment = moment_1.default($scope.dateInputValue.date, 'DD-MMMM-YYYY');
|
|
130
106
|
// The pikaday will oddly format 2 digit years to 0003
|
|
131
|
-
// The year is correct in the
|
|
132
|
-
// To prevent we will set the
|
|
133
|
-
if (!preventPikadayUpdate
|
|
134
|
-
|
|
135
|
-
picker.setDate(tempDateTime.toJSDate(), true);
|
|
136
|
-
// Manually update the dateLuxon to trigger reformatting
|
|
137
|
-
const updateDateTime = () => {
|
|
138
|
-
$scope.dateLuxon = tempDateTime;
|
|
139
|
-
$scope.onDateChange({ newDate: tempDateTime });
|
|
140
|
-
};
|
|
141
|
-
// Safely handle the digest cycle
|
|
142
|
-
if ($scope.$root.$$phase !== '$digest' && $scope.$root.$$phase !== '$apply') {
|
|
143
|
-
$scope.$apply(updateDateTime);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
updateDateTime();
|
|
147
|
-
}
|
|
107
|
+
// The year is correct in the moment, but you can see the odd string when formatted
|
|
108
|
+
// To prevent we will set the moment manually if the user is not backspacing/deleting
|
|
109
|
+
if (!preventPikadayUpdate) {
|
|
110
|
+
picker.setMoment(tempMoment);
|
|
148
111
|
}
|
|
149
112
|
else {
|
|
150
113
|
preventPikadayUpdate = false;
|
|
151
114
|
}
|
|
152
115
|
};
|
|
153
|
-
// called
|
|
116
|
+
// called everytime the text input is changed manually
|
|
154
117
|
$scope.validateDate = function () {
|
|
155
118
|
// pikaday interrupts the normal binding - manually update scope
|
|
156
119
|
$scope.dateInputValue.date = angular_1.default.element(inputElement[0]).val();
|
|
157
120
|
let isValid = true;
|
|
158
121
|
if ($scope.dateInputValue.date && $scope.dateInputValue.date.length > 0) {
|
|
159
|
-
// attempt to create a date
|
|
160
|
-
isValid =
|
|
161
|
-
for (const format of dateTimeZoneFactory.validDateFormats) {
|
|
162
|
-
const parsed = luxon_1.DateTime.fromFormat($scope.dateInputValue.date, format);
|
|
163
|
-
if (parsed.isValid) {
|
|
164
|
-
isValid = true;
|
|
165
|
-
$scope.updateDate(parsed.toJSDate());
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
122
|
+
// attempt to create a date form value
|
|
123
|
+
isValid = moment_1.default($scope.dateInputValue.date, dateTimeZoneFactory.validDateFormats, true).isValid();
|
|
169
124
|
if (isValid) {
|
|
170
|
-
$scope.
|
|
125
|
+
$scope.setPikadayMoment();
|
|
171
126
|
}
|
|
172
127
|
}
|
|
173
128
|
else if ($scope.dateInputValue.date.length === 0) {
|
|
174
|
-
// clear the scope
|
|
175
|
-
$scope.
|
|
129
|
+
// clear the scope moment
|
|
130
|
+
$scope.dateMoment = null;
|
|
176
131
|
// update the parent component
|
|
177
132
|
$scope.onDateChange({ newDate: null });
|
|
178
133
|
}
|
|
@@ -188,14 +143,6 @@ angular_1.default.module('app').directive('mflyDatePicker', [
|
|
|
188
143
|
preventPikadayUpdate = true;
|
|
189
144
|
}
|
|
190
145
|
};
|
|
191
|
-
$scope.onBlur = function () {
|
|
192
|
-
// Validate the date
|
|
193
|
-
$scope.validateDate();
|
|
194
|
-
// Hide the Pikaday calendar popup
|
|
195
|
-
picker.hide();
|
|
196
|
-
// Update focus state
|
|
197
|
-
$scope.focusAddOn = false;
|
|
198
|
-
};
|
|
199
146
|
$scope.requiredText = translateFactory.instant('JSUI.REQUIRED');
|
|
200
147
|
$scope.invalidDateText = translateFactory.instant('JSUI.INVALID_DATE');
|
|
201
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/datepicker.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"datepicker.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/datepicker.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,oDAA2B;AAC3B,sDAA6B;AAC7B,0FAAuF;AAOvF,qDAAqD;AACrD,yDAAyD;AACzD,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE;IACjD,qBAAqB;IACrB,kBAAkB;IAClB,SAAS,cAAc,CACtB,mBAAmB,EACnB,gBAAkC;QAGnC,OAAO;YACN,QAAQ,EAAE,GAAG;YACb,KAAK,EAAE;gBACN,OAAO,EAAE,GAAG;gBACZ,UAAU,EAAE,GAAG;gBACf,UAAU,EAAE,GAAG;gBACf,MAAM,EAAE,GAAG;gBACX,UAAU,EAAE,GAAG;gBACf,YAAY,EAAE,GAAG;gBACjB,MAAM,EAAE,GAAG;aACX;YACD,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC;YACtC,IAAI,CAAC,MAAyB,EAAE,OAA4B;gBAC3D,sCAAsC;gBACtC,MAAM,CAAC,cAAc,GAAG;oBACvB,IAAI,EAAE,EAAE;iBACR,CAAA;gBAED,yDAAyD;gBACzD,MAAM,gBAAgB,GAAG,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAA;gBAEnF,0DAA0D;gBAC1D,oDAAoD;gBACpD,IAAI,oBAAoB,GAAG,KAAK,CAAA;gBAEhC,+CAA+C;gBAC/C,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;gBAC1C,kDAAkD;gBAClD,8EAA8E;gBAC9E,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;gBAEtC,mDAAmD;gBACnD,MAAM,cAAc,GAAG;oBACtB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CAAC,EAAE;wBACxE,sCAAsC;wBACtC,OAAO,GAAG,gBAAM,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,CAAA;wBAElG,IAAI,OAAO,EAAE;4BACZ,MAAM,CAAC,gBAAgB,EAAE,CAAA;yBACzB;qBAED;yBAAM,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;wBACnD,yBAAyB;wBACzB,MAAM,CAAC,UAAU,GAAG,IAAI,CAAA;wBACxB,8BAA8B;wBAC9B,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;qBACtC;yBAAM;wBACN,OAAO,GAAG,KAAK,CAAA;qBACf;oBACD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;gBAC3E,CAAC,CAAA;gBAED,MAAM,CAAC,YAAY,GAAG,UAAS,MAAM;oBACpC,IAAI,MAAM,CAAC,KAAK,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,KAAK,EAAE,EAAE;wBAC9C,qEAAqE;wBACrE,wFAAwF;wBACxF,oBAAoB,GAAG,IAAI,CAAA;qBAC3B;gBACF,CAAC,CAAA;gBAED,MAAM,CAAC,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;gBAC/D,MAAM,CAAC,eAAe,GAAG,gBAAgB,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;YACvE,CAAC;SACD,CAAA;IACF,CAAC;CAAC,CAAC,CAAA"}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const angular_1 = __importDefault(require("angular"));
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const
|
|
8
|
+
const moment_1 = __importDefault(require("moment"));
|
|
9
9
|
// This filter takes a datetime string with UTC offset, like `2015-09-30T00:00:00-08:00`
|
|
10
10
|
// and converts it to a short format with time zone code displayed, like `12:00 AM AKST`.
|
|
11
11
|
// It returns an empty string if the input is bad (undefined or empty string).
|
|
@@ -14,7 +14,7 @@ angular_1.default.module('app').filter('formatDate', function formatDate() {
|
|
|
14
14
|
if (lodash_1.default.isEmpty(date)) {
|
|
15
15
|
return '';
|
|
16
16
|
}
|
|
17
|
-
const formattedDateTime =
|
|
17
|
+
const formattedDateTime = moment_1.default.parseZone(date).format('M/DD/YY');
|
|
18
18
|
return formattedDateTime;
|
|
19
19
|
};
|
|
20
20
|
});
|
|
@@ -24,9 +24,9 @@ angular_1.default.module('app').filter('formatTimeWithTimeZone', ['dateTimeZoneF
|
|
|
24
24
|
return '';
|
|
25
25
|
}
|
|
26
26
|
// Parse zone preserves the string date's offset --ignoring offset in locale)
|
|
27
|
-
const dateTimeZone =
|
|
28
|
-
const formattedTime = dateTimeZone.
|
|
29
|
-
// NOTE: getTimeZone expects a
|
|
27
|
+
const dateTimeZone = moment_1.default.parseZone(date);
|
|
28
|
+
const formattedTime = dateTimeZone.format('h:mm A');
|
|
29
|
+
// NOTE: getTimeZone expects a momentDate
|
|
30
30
|
const formattedZone = dateTimeZoneFactory.getTimeZone(dateTimeZone).display;
|
|
31
31
|
return `${formattedTime} ${formattedZone}`;
|
|
32
32
|
};
|
|
@@ -37,9 +37,9 @@ angular_1.default.module('app').filter('formatDateTimeWithTimeZone', ['dateTimeZ
|
|
|
37
37
|
return '';
|
|
38
38
|
}
|
|
39
39
|
// Parse zone preserves the string date's offset --ignoring offset in locale)
|
|
40
|
-
const dateTimeZone =
|
|
41
|
-
const formattedDateTime =
|
|
42
|
-
// NOTE: getTimeZone expects a
|
|
40
|
+
const dateTimeZone = moment_1.default.parseZone(date);
|
|
41
|
+
const formattedDateTime = moment_1.default.parseZone(date).format('M/DD/YY h:mm A');
|
|
42
|
+
// NOTE: getTimeZone expects a momentDate
|
|
43
43
|
const formattedZone = dateTimeZoneFactory.getTimeZone(dateTimeZone).display;
|
|
44
44
|
return `${formattedDateTime} ${formattedZone}`;
|
|
45
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-format-filter.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/time-format-filter.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,oDAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"time-format-filter.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/time-format-filter.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,oDAAsB;AACtB,oDAA2B;AAE3B,wFAAwF;AACxF,yFAAyF;AACzF,8EAA8E;AAC9E,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,SAAS,UAAU;IAE7D,OAAO,CAAC,IAAI,EAAE,EAAE;QAEf,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACpB,OAAO,EAAE,CAAA;SACT;QAED,MAAM,iBAAiB,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAElE,OAAO,iBAAiB,CAAA;IACzB,CAAC,CAAA;AACF,CAAC,CAAC,CAAA;AAEF,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,qBAAqB,EAAE,SAAS,sBAAsB,CAAC,mBAAmB;QAEjI,OAAO,CAAC,IAAI,EAAE,EAAE;YAEf,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACpB,OAAO,EAAE,CAAA;aACT;YAED,6EAA6E;YAC7E,MAAM,YAAY,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAE3C,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAEnD,yCAAyC;YACzC,MAAM,aAAa,GAAG,mBAAmB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,OAAO,CAAA;YAE3E,OAAO,GAAG,aAAa,IAAI,aAAa,EAAE,CAAA;QAC3C,CAAC,CAAA;IACF,CAAC,CAAC,CAAC,CAAA;AAEH,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,4BAA4B,EAAE,CAAC,qBAAqB,EAAE,SAAS,0BAA0B,CAAC,mBAAmB;QAEzI,OAAO,CAAC,IAAI,EAAE,EAAE;YAEf,IAAI,gBAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACpB,OAAO,EAAE,CAAA;aACT;YAED,6EAA6E;YAC7E,MAAM,YAAY,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAE3C,MAAM,iBAAiB,GAAG,gBAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;YAEzE,yCAAyC;YACzC,MAAM,aAAa,GAAG,mBAAmB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,OAAO,CAAA;YAE3E,OAAO,GAAG,iBAAiB,IAAI,aAAa,EAAE,CAAA;QAC/C,CAAC,CAAA;IACF,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -35,7 +35,7 @@ angular_1.default.module('app').directive('mflyTimeZonePicker', ['dateTimeZoneFa
|
|
|
35
35
|
//update the bound timeZone object
|
|
36
36
|
$scope.timeZone = $scope.timeZones[index];
|
|
37
37
|
//update the parent component
|
|
38
|
-
//must pass the zone value as the parent
|
|
38
|
+
//must pass the zone value as the parent funciton does not get the update first
|
|
39
39
|
$scope.onTimeZoneChange({ zoneOffset: $scope.timeZone.value });
|
|
40
40
|
}
|
|
41
41
|
};
|
|
@@ -5,14 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const angular_1 = __importDefault(require("angular"));
|
|
7
7
|
const timepicker_html_1 = __importDefault(require("./timepicker.html"));
|
|
8
|
-
const
|
|
8
|
+
const moment_1 = __importDefault(require("moment"));
|
|
9
9
|
angular_1.default.module('app').directive('mflyTimePicker', ['translateFactory', function mflyTimePicker(translateFactory) {
|
|
10
10
|
return {
|
|
11
11
|
restrict: 'E',
|
|
12
12
|
replace: true,
|
|
13
13
|
scope: {
|
|
14
14
|
inputId: '@',
|
|
15
|
-
|
|
15
|
+
timeMoment: '=',
|
|
16
16
|
onTimeChange: '&'
|
|
17
17
|
},
|
|
18
18
|
template: timepicker_html_1.default,
|
|
@@ -22,7 +22,6 @@ angular_1.default.module('app').directive('mflyTimePicker', ['translateFactory',
|
|
|
22
22
|
'h:mm A',
|
|
23
23
|
'h:mmA'
|
|
24
24
|
];
|
|
25
|
-
const luxonFormats = ['H:mm', 'h:mm a', 'h:mma'];
|
|
26
25
|
$scope.timeValue = {
|
|
27
26
|
time: '',
|
|
28
27
|
initialized: false
|
|
@@ -33,26 +32,25 @@ angular_1.default.module('app').directive('mflyTimePicker', ['translateFactory',
|
|
|
33
32
|
populateDropdown();
|
|
34
33
|
// If the DTZ picker is initialized, or has its value changed
|
|
35
34
|
// programmatically, we need to update the time picker accordingly.
|
|
36
|
-
$scope.$watch('
|
|
35
|
+
$scope.$watch('timeMoment', function (newValue) {
|
|
37
36
|
if (newValue) {
|
|
38
|
-
$scope.timeValue.time = $scope.
|
|
37
|
+
$scope.timeValue.time = $scope.timeMoment.format('h:mm A');
|
|
39
38
|
}
|
|
40
39
|
});
|
|
41
40
|
$scope.validateTime = function () {
|
|
42
41
|
if ($scope.timeValue.time) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
processTime(parsed);
|
|
48
|
-
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', true);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
42
|
+
var isValid = moment_1.default($scope.timeValue.time, validTimeFormats, true).isValid();
|
|
43
|
+
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', isValid);
|
|
44
|
+
if (isValid) {
|
|
45
|
+
processTime();
|
|
51
46
|
}
|
|
52
47
|
}
|
|
53
|
-
|
|
48
|
+
else {
|
|
49
|
+
//if the time is removed it is invalid
|
|
50
|
+
$scope.form.validation.mflyTimepicker.$setValidity('invalidTime', false);
|
|
51
|
+
}
|
|
54
52
|
};
|
|
55
|
-
//watch necessary to style
|
|
53
|
+
//watch necessary to style preceeding add-on element (CSS has no prev sibling selector)
|
|
56
54
|
$scope.$watch('form.validation.mflyTimepicker', function (newValue) {
|
|
57
55
|
if (newValue) {
|
|
58
56
|
$scope.$watch('form.validation.mflyTimepicker.$valid', function (newValue) {
|
|
@@ -63,30 +61,37 @@ angular_1.default.module('app').directive('mflyTimePicker', ['translateFactory',
|
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
63
|
});
|
|
66
|
-
function processTime(
|
|
67
|
-
$scope.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
function processTime() {
|
|
65
|
+
if ($scope.timeValue.time && $scope.form.validation.mflyTimepicker.$valid) {
|
|
66
|
+
//update our time moment with the time change in the textbox
|
|
67
|
+
var tempMomemnt = moment_1.default($scope.timeValue.time, validTimeFormats, true);
|
|
68
|
+
$scope.timeMoment.hour(tempMomemnt.hour());
|
|
69
|
+
$scope.timeMoment.minute(tempMomemnt.minute());
|
|
70
|
+
//callback to the parent component
|
|
71
|
+
$scope.onTimeChange();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
//reset time value
|
|
75
|
+
$scope.timeValue.time = '12:00 AM';
|
|
76
|
+
$scope.validateTime();
|
|
77
|
+
}
|
|
75
78
|
}
|
|
76
79
|
function populateDropdown() {
|
|
77
|
-
if ($scope.
|
|
78
|
-
$scope.timeValue.time = $scope.
|
|
80
|
+
if ($scope.timeMoment) {
|
|
81
|
+
$scope.timeValue.time = $scope.timeMoment.format('hh:mm A');
|
|
79
82
|
}
|
|
80
|
-
//
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
//init a moment with todays date
|
|
84
|
+
var tempMoment = moment_1.default();
|
|
85
|
+
//store that date in a seperate value
|
|
86
|
+
var todaysDate = tempMoment.date();
|
|
87
|
+
//backup our moment to 12:00am
|
|
88
|
+
tempMoment.hour(0);
|
|
89
|
+
tempMoment.minute(0);
|
|
90
|
+
//push 30 min intervals into our dropdown array until the date changes
|
|
86
91
|
do {
|
|
87
|
-
$scope.dropdownItems.push(
|
|
88
|
-
|
|
89
|
-
} while (todaysDate ===
|
|
92
|
+
$scope.dropdownItems.push(tempMoment.format('hh:mm A'));
|
|
93
|
+
tempMoment.add(30, 'm');
|
|
94
|
+
} while (todaysDate === tempMoment.date());
|
|
90
95
|
}
|
|
91
96
|
$scope.itemClicked = function (itemValue) {
|
|
92
97
|
$scope.form.validation.mflyTimepicker.$setDirty();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/timepicker.js"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,wEAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"timepicker.js","sourceRoot":"","sources":["../../src/components/date-time-zone-picker/timepicker.js"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,wEAAwC;AACxC,oDAA2B;AAE3B,iBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,EAAE,SAAS,cAAc,CAAE,gBAAgB;QAE/G,OAAO;YACN,QAAQ,EAAE,GAAG;YACb,OAAO,EAAE,IAAI;YACb,KAAK,EAAE;gBACN,OAAO,EA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8BAA8B;oBAC9B,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBACnB,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBAErB,sEAAsE;oBACtE,GAAG;wBACF,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;wBACxD,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;qBACxB,QAAQ,UAAU,KAAK,UAAU,CAAC,IAAI,EAAE,EAAE;gBAC5C,CAAC;gBAGD,MAAM,CAAC,WAAW,GAAG,UAAS,SAAS;oBACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC;oBAClD,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC;oBAClC,MAAM,CAAC,YAAY,EAAE,CAAC;gBACvB,CAAC,CAAC;gBAEF,MAAM,CAAC,eAAe,GAAG,gBAAgB,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YACxE,CAAC;SACD,CAAC;IACH,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -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
|
|
package/lib/styles.css
CHANGED
|
@@ -536,39 +536,27 @@ fieldset[disabled] .o-button.active {
|
|
|
536
536
|
position: relative;
|
|
537
537
|
}
|
|
538
538
|
.o-alert--success {
|
|
539
|
-
background-color: #
|
|
540
|
-
border-color: #
|
|
539
|
+
background-color: #e3f3ed;
|
|
540
|
+
border-color: #a1d7c2;
|
|
541
541
|
color: #21664c;
|
|
542
542
|
}
|
|
543
543
|
.o-alert--danger {
|
|
544
|
-
background-color: #
|
|
545
|
-
border-color: #
|
|
544
|
+
background-color: #fcebe8;
|
|
545
|
+
border-color: #f7beb3;
|
|
546
546
|
color: #9d3a18;
|
|
547
547
|
}
|
|
548
548
|
.o-alert--warning {
|
|
549
|
-
background-color: #
|
|
550
|
-
border-color: #
|
|
551
|
-
color: #
|
|
549
|
+
background-color: #fcf6d6;
|
|
550
|
+
border-color: #fbf3c5;
|
|
551
|
+
color: #1e202b;
|
|
552
552
|
}
|
|
553
553
|
.o-alert--info {
|
|
554
|
-
background-color: #
|
|
555
|
-
border-color: #
|
|
554
|
+
background-color: #eaf1f3;
|
|
555
|
+
border-color: #bbd2d6;
|
|
556
556
|
color: #435f64;
|
|
557
557
|
}
|
|
558
558
|
.o-alert a {
|
|
559
|
-
color:
|
|
560
|
-
}
|
|
561
|
-
.o-alert.o-alert--success a {
|
|
562
|
-
color: #21664c;
|
|
563
|
-
}
|
|
564
|
-
.o-alert.o-alert--danger a {
|
|
565
|
-
color: #9d3a18;
|
|
566
|
-
}
|
|
567
|
-
.o-alert.o-alert--warning a {
|
|
568
|
-
color: #7e5105;
|
|
569
|
-
}
|
|
570
|
-
.o-alert.o-alert--info a {
|
|
571
|
-
color: #435f64;
|
|
559
|
+
color: inherit;
|
|
572
560
|
}
|
|
573
561
|
.o-alert__header {
|
|
574
562
|
font-weight: 700;
|