fng-bootstrap-date 0.12.0-beta.171 → 0.12.0-beta.175
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/fng-bootstrap-date.js +15 -2
- package/package.json +1 -1
package/fng-bootstrap-date.js
CHANGED
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
scope.dateOptions = Object.assign({}, overRiddenDateDefaults, jsonDateOptions);
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const isArray = processedAttr.info.array;
|
|
53
|
+
template = pluginHelper.buildInputMarkup(scope, attrs.model, processedAttr.info, processedAttr.options, isArray, isArray, function (buildingBlocks) {
|
|
53
54
|
var str = '';
|
|
54
55
|
for (var opt in overRiddenDefaults) {
|
|
55
56
|
if (opt !== 'date-options') {
|
|
@@ -62,8 +63,20 @@
|
|
|
62
63
|
if (processedAttr.info.arialabel) {
|
|
63
64
|
str += ' aria-label="' + processedAttr.info.arialabel + '"';
|
|
64
65
|
}
|
|
66
|
+
const prefix = "uibDatePopup";
|
|
67
|
+
const random = Math.floor(Math.random() * 10000);
|
|
68
|
+
scope[prefix + random] = {
|
|
69
|
+
opened: {}
|
|
70
|
+
};
|
|
71
|
+
scope["open" + random] = function ($index) {
|
|
72
|
+
const all = Object.keys(scope).filter((k) => k.startsWith(prefix));
|
|
73
|
+
for (const key of all) {
|
|
74
|
+
scope[key].opened = {};
|
|
75
|
+
}
|
|
76
|
+
scope[prefix + random].opened[$index || 0] = true;
|
|
77
|
+
}
|
|
65
78
|
return formMarkupHelper.generateSimpleInput(
|
|
66
|
-
buildingBlocks.common + str + ' validdate datepicker-options="dateOptions" uib-datepicker-popup="' + (processedAttr.directiveOptions.format || processedAttr.directiveOptions['date-format'] || 'dd/MM/yy') + '" is-open="
|
|
79
|
+
buildingBlocks.common + str + ' validdate datepicker-options="dateOptions" uib-datepicker-popup="' + (processedAttr.directiveOptions.format || processedAttr.directiveOptions['date-format'] || 'dd/MM/yy') + '" is-open="' + prefix + random + '.opened[$index || 0]" ng-click="open' + random + '($index)" ' + formMarkupHelper.addTextInputMarkup(buildingBlocks, processedAttr.info, ''),
|
|
67
80
|
processedAttr.info,
|
|
68
81
|
processedAttr.options
|
|
69
82
|
);
|
package/package.json
CHANGED