isite 2023.1.4 → 2023.1.5

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.
@@ -7,13 +7,13 @@
7
7
  </div>
8
8
  <div class="row dashed padding margin" ng-show="editOnly">
9
9
  <div class="col3">
10
- <i-list label="{{dayTitle}}" v="{{v}}" items="days" ng-model="model.selectedDay"></i-list>
10
+ <i-list label="{{dayTitle}}" v="{{v}}" items="days" ng-search="$selectedDay" ng-model="model.selectedDay"></i-list>
11
11
  </div>
12
12
  <div class="col4">
13
- <i-list label="{{monthTitle}}" v="{{v}}" items="monthes" ng-model="model.selectedMonth"></i-list>
13
+ <i-list label="{{monthTitle}}" v="{{v}}" items="monthes" ng-search="$selectedMonth" ng-model="model.selectedMonth"></i-list>
14
14
  </div>
15
15
  <div class="col3">
16
- <i-list label="{{yearTitle}}" v="{{v}}" items="years" ng-search="searchYear" ng-model="model.selectedYear"></i-list>
16
+ <i-list label="{{yearTitle}}" v="{{v}}" items="years" ng-search="$selectedYear" ng-model="model.selectedYear" active-value="model.activeYear"></i-list>
17
17
  </div>
18
18
 
19
19
  <div class="col2">
@@ -8,20 +8,20 @@
8
8
  </div>
9
9
  <div class="row dashed padding margin" ng-show="editOnly">
10
10
  <div class="col2">
11
- <i-list label="{{dayTitle}}" items="days" ng-model="model.selectedDay"></i-list>
11
+ <i-list label="{{dayTitle}}" items="days" ng-search="$selectedDay" ng-model="model.selectedDay"></i-list>
12
12
  </div>
13
13
  <div class="col3">
14
- <i-list label="{{monthTitle}}" items="monthes" ng-model="model.selectedMonth"></i-list>
14
+ <i-list label="{{monthTitle}}" items="monthes" ng-search="$selectedMonth" ng-model="model.selectedMonth"></i-list>
15
15
  </div>
16
16
  <div class="col3">
17
- <i-list label="{{yearTitle}}" items="years" ng-search="searchYear" ng-model="model.selectedYear"></i-list>
17
+ <i-list label="{{yearTitle}}" items="years" ng-search="$selectedYear" ng-model="model.selectedYear"></i-list>
18
18
  </div>
19
19
 
20
20
  <div class="col2">
21
- <i-list label="{{hourTitle}}" items="hours" ng-model="model.selectedHour"></i-list>
21
+ <i-list label="{{hourTitle}}" items="hours" ng-search="$selectedHour" ng-model="model.selectedHour"></i-list>
22
22
  </div>
23
23
  <div class="col2">
24
- <i-list label="{{minuteTitle}}" items="minutes" ng-model="model.selectedMinute"></i-list>
24
+ <i-list label="{{minuteTitle}}" items="minutes" ng-search="$selectedMinute" ng-model="model.selectedMinute"></i-list>
25
25
  </div>
26
26
  <div class="row">
27
27
  <br />
@@ -5,8 +5,8 @@
5
5
  </div>
6
6
 
7
7
  <div class="dropdown-content">
8
- <div class="padding" ng-show="showSearch">
9
- <input class="full-width search form-control" />
8
+ <div class="dropdown-search" ng-show="showSearch">
9
+ <input class="full-width search form-control" />
10
10
  </div>
11
11
 
12
12
  <div class="dropdown-item row" ng-repeat="item in items | filter:{ $display : $filter}" ng-click="updateModel(item)">
@@ -99,9 +99,9 @@ app.directive('iContent', function ($timeout, $interval) {
99
99
  ['outdent', 'indent'],
100
100
  ['align', 'horizontalRule', 'list', 'table'],
101
101
  ['link', 'image', 'video'],
102
+ ['preview', 'print'],
102
103
  /* ['fullScreen', 'showBlocks', 'codeView'],
103
- ['preview', 'print'],
104
- ['save', 'template'], */
104
+ ['save', 'template'],*/
105
105
  ],
106
106
  width: '100%',
107
107
  minHeight: '300px',
@@ -248,6 +248,12 @@ app.directive('iButton', function () {
248
248
  } else if ($scope.type.like('*logout*') || $scope.type.like('*signout*')) {
249
249
  $scope.fa = 'fas fa-sign-out-alt';
250
250
  $scope.class = 'btn-light';
251
+ } else if ($scope.type.like('*push*')) {
252
+ $scope.fa = 'fas fa-long-arrow-alt-down';
253
+ $scope.class = 'btn-primary';
254
+ } else if ($scope.type.like('*cancel*')) {
255
+ $scope.fa = 'fas fa-minus-circle';
256
+ $scope.class = 'btn-danger';
251
257
  }
252
258
  if ($scope.type.like('*default*')) {
253
259
  $scope.class = '';
@@ -290,6 +296,7 @@ app.directive('iList', [
290
296
  ngGet: '&',
291
297
  ngAdd: '&',
292
298
  items: '=',
299
+ activeValue: '=',
293
300
  },
294
301
  link: function ($scope, element, attrs, ctrl) {
295
302
  $scope.primary = $scope.primary || 'id';
@@ -323,7 +330,9 @@ app.directive('iList', [
323
330
  let input = $(element).find('input.dropdown-text');
324
331
  $(element).hover(
325
332
  () => {
326
- $scope.popupElement.css('display', 'block');
333
+ if (attrs.disabled !== 'disabled') {
334
+ $scope.popupElement.css('display', 'block');
335
+ }
327
336
  },
328
337
  () => {
329
338
  $scope.popupElement.css('display', 'none');
@@ -402,6 +411,8 @@ app.directive('iList', [
402
411
  }
403
412
  });
404
413
  }
414
+
415
+
405
416
  });
406
417
 
407
418
  $scope.$watch('ngModel', (ngModel) => {
@@ -420,9 +431,9 @@ app.directive('iList', [
420
431
 
421
432
  $scope.searchElement.on('input', () => {
422
433
  $timeout(() => {
423
- if ($scope.ngGet) {
434
+ if (attrs.ngGet) {
424
435
  $scope.ngGet({ $search: $scope.searchElement.val() });
425
- } else if ($scope.ngSearch) {
436
+ } else if (attrs.ngSearch) {
426
437
  $scope.$filter = $scope.searchElement.val();
427
438
  }
428
439
  }, 100);
@@ -583,6 +594,7 @@ app.directive('iDate', function () {
583
594
  $scope.dayTitle = 'Day';
584
595
  $scope.monthTitle = 'Month';
585
596
  $scope.yearTitle = 'Year';
597
+
586
598
 
587
599
  $scope.lang = site.session ? site.session.lang : 'en';
588
600
  if ($scope.lang === 'ar') {
@@ -627,11 +639,13 @@ app.directive('iDate', function () {
627
639
  $scope.model.selectedDay = $scope.days.find((d) => d.id == ngModel.getDate());
628
640
  $scope.model.selectedMonth = $scope.monthes.find((m) => m.id == ngModel.getMonth());
629
641
  $scope.model.selectedYear = $scope.years.find((y) => y.id == ngModel.getFullYear());
642
+ $scope.model.$selectedYear = 2023;
630
643
  } else {
631
644
  $scope.model = $scope.model || {};
632
645
  $scope.model.selectedDay = null;
633
646
  $scope.model.selectedMonth = null;
634
647
  $scope.model.selectedYear = null;
648
+ $scope.model.activeYear = 2023;
635
649
  }
636
650
  });
637
651
 
@@ -1247,7 +1247,7 @@
1247
1247
  console.error('qrcode need {selector , text}');
1248
1248
  return;
1249
1249
  }
1250
- return JsBarcode(options.selector, options.selector, options.options);
1250
+ return JsBarcode(options.selector, options.text, options.options);
1251
1251
  };
1252
1252
  site.qrcode = function (options) {
1253
1253
  if (!options || !options.selector || !options.text) {
@@ -1272,5 +1272,13 @@
1272
1272
  });
1273
1273
  }
1274
1274
  };
1275
+
1276
+ site.export = function (table, type = 'xlsx') {
1277
+ var data = typeof table === 'string' ? document.querySelector(table) : table;
1278
+ var excelFile = XLSX.utils.table_to_book(data, { sheet: 'sheet1' });
1279
+ XLSX.write(excelFile, { bookType: type, bookSST: true, type: 'base64' });
1280
+ XLSX.writeFile(excelFile, (data.id || data.tagName) + '.' + type);
1281
+ };
1282
+
1275
1283
  window.site = site;
1276
1284
  })(window, document, 'undefined', jQuery);