fng-bootstrap-date 0.12.0-beta.170 → 0.12.0-beta.174

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.
@@ -49,7 +49,8 @@
49
49
  }
50
50
  scope.dateOptions = Object.assign({}, overRiddenDateDefaults, jsonDateOptions);
51
51
 
52
- template = pluginHelper.buildInputMarkup(scope, attrs.model, processedAttr.info, processedAttr.options, false, false, function (buildingBlocks) {
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="popup.opened" ng-click="open()" ' + formMarkupHelper.addTextInputMarkup(buildingBlocks, processedAttr.info, ''),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fng-bootstrap-date",
3
- "version": "0.12.0-beta.170",
3
+ "version": "0.12.0-beta.174",
4
4
  "description": "Date input plugin for forms-angular, using the Bootstrap datepicker from Angular-ui-bootstrap",
5
5
  "main": "fng-bootstrap-date.js",
6
6
  "scripts": {