isite 2024.8.9 → 2024.8.11

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.
@@ -36,15 +36,25 @@ body {
36
36
  .container {
37
37
  max-width: 100%;
38
38
  }
39
- .ar .form-check .form-check-input , .AR .form-check .form-check-input {
39
+ .ar .form-check .form-check-input,
40
+ .AR .form-check .form-check-input {
40
41
  float: right;
41
42
  margin-right: -1.5em;
42
43
  }
44
+ .form-label {
45
+ margin-bottom: 0.5rem;
46
+ margin-left: 5px;
47
+ border-bottom: 1px solid #00000061;
48
+ }
43
49
  label {
44
50
  float: left;
45
51
  color: var(--label-color);
52
+ font-weight: var(--label-font-weight);
53
+ font-size: var(--label-font-size);
54
+ background: var(--label-background);
46
55
  }
47
- .ar label , .AR label {
56
+ .ar label,
57
+ .AR label {
48
58
  float: right;
49
59
  }
50
60
  fieldset {
@@ -67,7 +77,8 @@ fieldset legend {
67
77
  width: auto;
68
78
  padding: 5px;
69
79
  }
70
- .ar fieldset legend , .AR fieldset legend{
80
+ .ar fieldset legend,
81
+ .AR fieldset legend {
71
82
  float: right;
72
83
  }
73
84
  legend::after {
@@ -105,6 +116,7 @@ i-button button {
105
116
  margin: 5px !important;
106
117
  margin-top: 30px !important;
107
118
  padding: 7px 9px !important;
119
+ max-height: 40px;
108
120
  }
109
121
  i-button.default button {
110
122
  margin: 3px;
@@ -129,7 +141,7 @@ i-file i-button {
129
141
  i-upload {
130
142
  display: contents;
131
143
  }
132
- i-upload form{
144
+ i-upload form {
133
145
  display: inline-block;
134
146
  }
135
147
  i-date .left-10,
@@ -181,7 +193,21 @@ i-datetime input {
181
193
  width: 100%;
182
194
  }
183
195
  .dropdown-content {
184
- top: 35px;
196
+ display: none;
197
+ position: absolute;
198
+ top: 30px !important;
199
+ background-color: #ffffff;
200
+ width: 100%;
201
+ box-shadow: 0px 20px 16px 16px rgb(0 0 0);
202
+ z-index: 999;
203
+ max-height: 75vh;
204
+ min-height: 20%;
205
+ padding: 0px;
206
+ margin: 0;
207
+ scroll-behavior: auto;
208
+ overflow: auto;
209
+ border: 5px solid #6b6868;
210
+ transition: all 0.2s ease;
185
211
  }
186
212
  .v-tabs .nav-link {
187
213
  color: #aaa !important;
@@ -213,7 +239,8 @@ i-datetime input {
213
239
  transform: translateY(-50%);
214
240
  opacity: 0;
215
241
  }
216
- .ar .v-tabs .nav-link::before , .AR .v-tabs .nav-link::before {
242
+ .ar .v-tabs .nav-link::before,
243
+ .AR .v-tabs .nav-link::before {
217
244
  border-right: 10px solid #fff;
218
245
  left: -10px;
219
246
  }
@@ -1,87 +1,92 @@
1
1
  /* The container <div> - needed to position the dropdown content */
2
2
  .dropdown {
3
- position: relative;
4
- display: inline-block;
5
- width: 100%;
3
+ position: relative;
4
+ display: inline-block;
5
+ width: 100%;
6
6
  }
7
7
 
8
8
  /* Dropdown Content (Hidden by Default) */
9
9
  .dropdown-content {
10
- display: none;
11
- position: absolute;
12
- top: 40px;
13
- background-color: #ffffff;
14
- width: 100%;
15
- box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
16
- z-index: 999;
17
- max-height: 50vh;
18
- padding: 0px;
19
- scroll-behavior: auto;
20
- overflow: auto;
21
- border: 1px solid var(--theme-color);
10
+ display: none;
11
+ position: absolute;
12
+ top: 40px;
13
+ background-color: #ffffff;
14
+ width: 100%;
15
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
16
+ z-index: 999;
17
+ max-height: 50vh;
18
+ padding: 0px;
19
+ scroll-behavior: auto;
20
+ overflow: auto;
21
+ border: 1px solid var(--theme-color);
22
22
  }
23
23
 
24
- .dropdown .dropdown-search{
25
- padding: 5%;
26
- position: sticky;
27
- top: 0;
28
- background: #ffffff;
24
+ .dropdown .dropdown-search {
25
+ padding: 5px;
26
+ position: sticky;
27
+ top: 0;
28
+ background: #eee;
29
+ }
30
+ .dropdown .dropdown-search i-control2 {
31
+ display: inline-block;
32
+ width: 85%;
33
+ }
34
+ .dropdown .dropdown-search i-button button {
35
+ margin-top: 10px !important;
36
+ }
37
+ .dropdown .dropdown-search .btns {
38
+ width: 50px !important;
39
+ display: contents !important;
29
40
  }
30
41
  /* Links inside the dropdown */
31
42
  .dropdown-content p {
32
- color: black;
33
- background-color: #ffffff;
34
- padding: 12px 16px;
35
- text-decoration: none;
36
- display: block;
43
+ color: black;
44
+ background-color: #ffffff;
45
+ padding: 12px 16px;
46
+ text-decoration: none;
47
+ display: block;
37
48
  }
38
49
 
39
50
  /* Change color of dropdown links on hover */
40
51
  .dropdown-content .dropdown-item:hover {
41
- background-color: var(--theme-color);
42
- color: #fff;
43
- }
44
- .dropdown-content .dropdown-item:hover p,
45
- .dropdown-content .dropdown-item:hover small {
46
- color: #fff;
47
- }
48
- /* Show the dropdown menu on hover */
49
- .dropdown:hover .dropdown-content {
50
- display: block;
52
+ background-color: #bbbbbb;
51
53
  }
52
54
 
53
- .dropdown-text:hover > .dropdown-content {
54
- display: block;
55
- }
55
+ /* Show the dropdown menu on hover
56
+ .dropdown:not([disabled]):hover .dropdown-content,
57
+ .dropdown-content:hover {
58
+ display: block;
59
+ } */
56
60
 
57
- .dropdown-item {
58
- display: inline-block;
59
- cursor: pointer;
60
- background: var(--dropdown-background);
61
- padding: 0px;
62
- margin: 0px;
63
- transition: all .1s ease;
61
+ i-list .dropdown-item {
62
+ display: inline-block !important;
63
+ cursor: pointer;
64
+ background: var(--dropdown-background);
65
+ padding: 0px !important;
66
+ margin: 0px !important;
67
+ transition: all 0.1s ease;
68
+ border-bottom: 1px solid #ddd !important;
64
69
  }
65
70
  .dropdown-item p {
66
- color: #055160;
67
- font-size: 14px;
68
- font-weight: bold;
69
- background: transparent;
70
- text-align: left;
71
+ color: var(--color);
72
+ font-size: 16px;
73
+ font-weight: bold;
74
+ background: transparent;
75
+ text-align: center;
76
+ padding: 0;
71
77
  }
72
- .ar .dropdown-item p , .AR .dropdown-item p{
73
- text-align: right;
78
+ .ar .dropdown-item p,
79
+ .AR .dropdown-item p {
80
+ text-align: right;
74
81
  }
75
- .dropdown-item small {
76
- color: antiquewhite;
77
- font-size: 9px;
78
- text-align: left;
79
- padding: 3px;
80
- background: #198754;
81
- font-weight: bold;
82
- padding-right: 9px;
83
- padding-left: 9px;
82
+ .dropdown-item .small {
83
+ color: #000000;
84
+ font-size: 12px;
85
+ text-align: center;
86
+ font-weight: bold;
87
+ padding: 0;
84
88
  }
85
- .ar .dropdown-item small , .AR .dropdown-item small{
86
- text-align: right;
89
+ .ar .dropdown-item .small,
90
+ .AR .dropdown-item small {
91
+ text-align: right;
87
92
  }
@@ -275,9 +275,8 @@
275
275
 
276
276
  .w50,
277
277
  .w50 input {
278
- min-width: 50px !important;
279
278
  width: 50px !important;
280
- white-space: pre-line !important;
279
+ display: contents !important;
281
280
  }
282
281
 
283
282
  .w100,
@@ -58,10 +58,12 @@
58
58
 
59
59
  --form-color: #000000;
60
60
  --form-background-color: none;
61
+
61
62
  --label-color : #000;
62
63
  --label-font-size: 16px;
63
64
  --label-font-weight: normal;
64
65
  --label-text-align: var(--text-align);
66
+ --label-background : none;
65
67
 
66
68
  --input-color: #0000ff;
67
69
  --input-background-color: #ffffff;
@@ -1,20 +1,20 @@
1
1
  <div class="dropdown i-list">
2
2
  <div class="mb-3 {{class2}}">
3
3
  <label class="form-label"> <span class="red bold"> {{requird}} </span> {{label}} </label>
4
- <input ng-focus="focus()" class="full-width text dropdown-text form-control {{css}}" ng-disabled="disabled" v="{{v}}" readonly ng-model="ngModel.$display" />
4
+ <input class="full-width text dropdown-text form-control {{css}}" v="{{v}}" readonly ng-model="ngModel.$display" />
5
5
  </div>
6
6
 
7
7
  <div class="dropdown-content">
8
8
  <div class="dropdown-search" ng-show="showSearch">
9
- <input class="full-width search form-control" />
9
+ <div class="row">
10
+ <div class="col"><i-control class="search" ng-model="_search"></i-control></div>
11
+ <div class="col btns"><i-button type="cancel" ng-click="updateModel(null)"></i-button> <i-button type="close" ng-click="updateModel(ngModel)"></i-button></div>
12
+ </div>
10
13
  </div>
11
14
 
12
15
  <div class="dropdown-item row" ng-repeat="item in items | filter:$filter" ng-click="updateModel(item)">
13
- <p>{{getValue(item)}} <small ng-show="display2"> {{getValue2(item)}} </small></p>
14
- </div>
15
-
16
- <div class="row center padding pointer">
17
- <i-button class="block center" type="clear" ng-click="updateModel(null)" label="Clear"></i-button>
16
+ <p>{{getValue(item)}}</p>
17
+ <p class="small" ng-show="display2">{{getValue2(item)}}</p>
18
18
  </div>
19
19
  </div>
20
20
  </div>
@@ -1,7 +1,7 @@
1
1
  <div class="dropdown i-list">
2
2
  <div class="control">
3
3
  <label> {{label}} </label>
4
- <input ng-focus="focus()" class="full-width text dropdown-text {{css}}" ng-disabled="disabled" v="{{v}}" readonly ng-model="ngModel.$display" />
4
+ <input class="full-width text dropdown-text {{css}}" ng-disabled="disabled" v="{{v}}" readonly ng-model="ngModel.$display" />
5
5
  </div>
6
6
 
7
7
  <div class="dropdown-content">
@@ -27,11 +27,6 @@ app.directive('iControl', function () {
27
27
  attrs.disabled = '';
28
28
  }
29
29
  $scope.class2 = $scope.class2 || '';
30
- $(element)
31
- .find('input')
32
- .focus(() => {
33
- $('.i-list .dropdown-content').css('display', 'none');
34
- });
35
30
  },
36
31
  template: `/*##client-side/directive/i-control.html*/`,
37
32
  };
@@ -365,9 +360,16 @@ app.directive('iList', [
365
360
  if ($scope.v.like('*r*')) {
366
361
  $scope.requird = '*';
367
362
  }
368
- $scope.searchElement = $(element).find('.dropdown .search');
363
+ $scope.searchElement = $(element).find('.dropdown .search input');
369
364
  $scope.popupElement = $(element).find('.dropdown .dropdown-content');
370
-
365
+ let input = $(element).find('input.dropdown-text');
366
+ $(input).click((ev) => {
367
+ $scope.popupElement.css('display', 'block');
368
+ });
369
+ $scope.hide = function () {
370
+ $scope.popupElement.css('display', 'none');
371
+ };
372
+
371
373
  if (typeof attrs.disabled !== 'undefined') {
372
374
  attrs.disabled = 'disabled';
373
375
  } else {
@@ -387,25 +389,9 @@ app.directive('iList', [
387
389
  $scope.showSearch = !0;
388
390
  }
389
391
 
390
- let input = $(element).find('input.dropdown-text');
391
- $(element).hover(
392
- () => {
393
- if (attrs.disabled !== 'disabled') {
394
- $scope.popupElement.css('display', 'block');
395
- }
396
- },
397
- () => {
398
- $scope.popupElement.css('display', 'none');
399
- }
400
- );
401
392
  $scope.focus = function () {
402
- $('.i-list .dropdown-content').css('display', 'none');
403
- $scope.popupElement.css('display', 'block');
404
393
  $scope.searchElement.focus();
405
394
  };
406
- $scope.hide = function () {
407
- $scope.popupElement.css('display', 'none');
408
- };
409
395
 
410
396
  $scope.getValue = function (item) {
411
397
  let v = isite.getValue(item, $scope.display);
@@ -450,7 +436,12 @@ app.directive('iList', [
450
436
  if (items) {
451
437
  items.forEach((item) => {
452
438
  if ($scope.display2) {
453
- item.$display = $scope.getValue(item) + $scope.space + $scope.getValue2(item);
439
+ let val = $scope.getValue(item);
440
+ if (val) {
441
+ val = val + $scope.space;
442
+ }
443
+ val = val + $scope.getValue2(item);
444
+ item.$display = val;
454
445
  } else {
455
446
  item.$display = $scope.getValue(item);
456
447
  }
@@ -462,7 +453,12 @@ app.directive('iList', [
462
453
  if (isite.getValue(item, $scope.primary) == isite.getValue($scope.ngModel, $scope.primary)) {
463
454
  $scope.ngModel = item;
464
455
  if ($scope.display2) {
465
- item.$display = $scope.getValue(item) + $scope.space + $scope.getValue2(item);
456
+ let val = $scope.getValue(item);
457
+ if (val) {
458
+ val = val + $scope.space;
459
+ }
460
+ val = val + $scope.getValue2(item);
461
+ item.$display = val;
466
462
  } else {
467
463
  item.$display = $scope.getValue(item);
468
464
  }
@@ -480,9 +476,14 @@ app.directive('iList', [
480
476
 
481
477
  if (ngModel) {
482
478
  if ($scope.display2) {
483
- input.val(' ' + $scope.getNgModelValue(ngModel) + $scope.space + $scope.getNgModelValue2(ngModel));
479
+ let val = $scope.getNgModelValue(ngModel);
480
+ if (val) {
481
+ val = val + $scope.space;
482
+ }
483
+ val = val + $scope.getNgModelValue2(ngModel);
484
+ input.val(val);
484
485
  } else {
485
- input.val(' ' + $scope.getNgModelValue(ngModel));
486
+ input.val($scope.getNgModelValue(ngModel));
486
487
  }
487
488
  }
488
489
  });
@@ -501,7 +502,12 @@ app.directive('iList', [
501
502
  if (item) {
502
503
  $scope.ngModel = $scope.getNgValue(item, $scope.ngValue);
503
504
  if ($scope.display2) {
504
- input.val($scope.getNgModelValue($scope.ngModel) + $scope.space + $scope.getNgModelValue2($scope.ngModel));
505
+ let val = $scope.getNgModelValue($scope.ngModel);
506
+ if (val) {
507
+ val = val + $scope.space;
508
+ }
509
+ val = val + $scope.getNgModelValue2($scope.ngModel);
510
+ input.val(val);
505
511
  } else {
506
512
  input.val($scope.getNgModelValue($scope.ngModel));
507
513
  }
@@ -0,0 +1 @@
1
+ app.directive("iControl",function(){return{restrict:"E",require:"ngModel",scope:{v:"@",id2:"@",label:"@",type:"@",class2:"@",disabled:"@",ngModel:"=",ngChange:"&",ngKeydown:"&"},link:function(e,t,i,n){i.type=i.type||"text",e.id2=e.id2||"input_"+Math.random().toString().replace("0.",""),e.v=e.v||"",e.requird="",e.v.like("*r*")&&(e.requird="*"),void 0!==i.disabled?i.disabled="disabled":i.disabled="",e.class2=e.class2||""},template:"/*##client-side/directive/i-control.html*/"}}),app.directive("iTextarea",function(){return{restrict:"E",require:"ngModel",scope:{v:"@",label:"@",id2:"@",disabled:"@",rows:"@",ngModel:"=",ngChange:"&"},link:function(e,t,i,n){void 0!==i.disabled?i.disabled="disabled":i.disabled="",e.rows=e.rows||10,e.id2=e.id2||"input_"+Math.random().toString().replace("0.",""),$(t).find("textarea").focus(()=>{$(".popup").hide()})},template:"/*##client-side/directive/i-textarea.html*/"}}),app.directive("iContent",function(e,t){return{restrict:"E",scope:{v:"@",label:"@",id2:"@",disabled:"@",rows:"@",ngModel:"=",ngChange:"&"},link:function(i,n,a,l){void 0!==a.disabled?a.disabled="disabled":a.disabled="",i.stopReading=!1,i.rows=i.rows||10,i.id2=i.id2||"textarea_"+Math.random().toString().replace("0.",""),$(n).find("textarea").id=i.id2,$(n).find("textarea").focus(()=>{$(".popup").hide()}),i.handelContentElement=function(){if(!document.querySelector("#"+i.id2))return e(()=>{i.handelContentElement()},1e3),!1;window["content_"+i.id2]=WebShareEditor.create(i.id2,{toolbarItem:[["undo","redo"],["font","fontSize","formatBlock"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["fontColor","hiliteColor"],["outdent","indent"],["align","horizontalRule","list","table"],["link","image","video"],["preview","print"]],width:"100%",minHeight:"300px"}),i.ngModel&&window["content_"+i.id2]&&window["content_"+i.id2].setContents(i.ngModel),i.readingNow()},i.readingNow=function(){i.intravalReading=t(()=>{window["content_"+i.id2]&&(i.ngModel2=window["content_"+i.id2].getContents(),i.ngModel!==i.ngModel2&&(i.ngModel=i.ngModel2,i.changed()))},1e3)},i.handelContentElement(),i.changed=function(){e(()=>{i.ngChange&&i.ngChange()},100)},i.$watch("ngModel",e=>{clearInterval(i.intravalReading),e&&window["content_"+i.id2]&&i.ngModel2&&i.ngModel!==i.ngModel2&&(i.ngModel=e,window["content_"+i.id2].setContents(i.ngModel)),i.readingNow()})},template:"/*##client-side/directive/i-content.html*/"}}),app.directive("iCheckbox",function(e){return{restrict:"E",require:"ngModel",scope:{label:"@",id2:"@",ngDisabled:"@",ngModel:"=",ngChange:"&"},link:function(t,i,n,a){t.id2=t.id2||"input_"+Math.random().toString().replace("0.",""),t.changed=function(){e(()=>{t.ngChange&&t.ngChange()},100)}},template:"/*##client-side/directive/i-checkbox.html*/"}}),app.directive("iRadio",function(){return{restrict:"E",require:"ngModel",scope:{label:"@",group:"@",id2:"@",ngValue:"@",ngModel:"=",ngChange:"&"},link:function(e,t,i,n){void 0!==i.disabled?i.disabled="disabled":i.disabled="",e.group=e.group||i.ngModel.replaceAll(".","_"),e.id2=e.id2||"input_"+Math.random().toString().replace("0.","")},template:"/*##client-side/directive/i-radio.html*/"}}),app.directive("iButton",["$interval","$timeout",function(e,t){return{restrict:"E",scope:{label:"@",type:"@",class2:"@",loading:"@",click:"&",fa:"@"},link:function(e,i,n,a){e.type=e.type||"",e.class=e.class="btn-light",e.fa=e.fa||e.label?"":"fas fa-mouse-pointer",e.type.like("*add*|*new*")?(e.fa="fas fa-plus",e.class="btn-primary"):e.type.like("*update*|*edit*")?(e.fa="fas fa-edit",e.class="btn-warning"):e.type.like("*save*")?(e.fa="fas fa-save",e.class="btn-success"):e.type.like("*list*")?(e.fa="fas fa-list",e.class="btn-info"):e.type.like("unapprove")?(e.fa="fas fa-eject",e.class="btn-danger"):e.type.like("approve")?(e.fa="fas fa-check-double",e.class="btn-primary"):e.type.like("*view*|*details*|*show*")?(e.fa="fas fa-eye",e.class="btn-info"):e.type.like("*delete*|*remove*|*clear*")?(e.fa="fas fa-trash",e.class="btn-danger"):e.type.like("*exit*|*close*")?(e.fa="fas fa-times-circle",e.class="btn-danger"):e.type.like("*print*")?(e.fa="fas fa-print",e.class="btn-secondary"):e.type.like("*export*|*excel*")?(e.fa="fas fa-file-export",e.class="btn-light"):e.type.like("*import*")?(e.fa="fas fa-file-upload",e.class="btn-light"):e.type.like("*search*|*find*")?(e.fa="fas fa-search",e.class="btn-light"):e.type.like("*login*|*signin*")?(e.fa="fas fa-sign-in-alt",e.class="btn-light"):e.type.like("*logout*|*signout*")?(e.fa="fas fa-sign-out-alt",e.class="btn-light"):e.type.like("*push*")?(e.fa="fas fa-plus-circle",e.class="btn-primary"):e.type.like("*cancel*")?(e.fa="fas fa-minus-circle",e.class="btn-danger"):e.type.like("*upload*")?(e.fa="fas fa-upload",e.class="btn-light"):e.type.like("*up*")?(e.fa="fas fa-long-arrow-alt-up",e.class="btn-light"):e.type.like("*down*")?(e.fa="fas fa-long-arrow-alt-down",e.class="btn-light"):e.type.like("*reset*")?(e.fa="fas fa-sync-alt",e.class="btn-light"):e.type.like("*stop*")?(e.fa="fas fa-stop",e.class="btn-light"):e.type.like("*play*")?(e.fa="far fa-play-circle",e.class="btn-light"):e.type.like("*copy*")&&(e.fa="fas fa-copy",e.class="btn-light"),e.type.like("*default*")&&(e.class=""),e.class2&&(e.class=e.class2),e.onclick=function(){e.clickBusy=!0,t(()=>{e.clickBusy=!1},250)},e.$watch("loading",t=>{e.busy="true"===t})},template:"/*##client-side/directive/i-button.html*/"}}]),app.directive("iList",["$interval","$timeout","isite",function(e,t,i){return{restrict:"E",require:"ngModel",scope:{v:"@",label:"@",display:"@",display2:"@",disabled:"@",css:"@",space:"@",primary:"@",ngValue:"@",ngModel:"=",ngSearch:"=",ngChange:"&",ngGet:"&",ngAdd:"&",items:"=",activeValue:"="},link:function(e,n,a,l){e.primary=e.primary||"id",e.display=e.display||"name",e.display2=e.display2||"",e.space=e.space||" - ",a.ngValue=a.ngValue||"",e.v=e.v||"",e.requird="",e.v.like("*r*")&&(e.requird="*"),e.searchElement=$(n).find(".dropdown .search input"),e.popupElement=$(n).find(".dropdown .dropdown-content"),void 0!==a.disabled?a.disabled="disabled":a.disabled="",void 0===a.ngAdd?e.fa_add="fa-search":e.fa_add="fa-plus",e.ngSearch&&(e.showSearch=!0),e.ngGet&&(e.showSearch=!0);let d=$(n).find("input.dropdown-text");e.focus=function(){e.searchElement.focus()},e.getValue=function(t){let n=i.getValue(t,e.display);return n||""},e.getValue2=function(t){return e.display2&&i.getValue(t,e.display2)||""},e.getNgModelValue=function(t){return t&&e.display&&e.ngValue?i.getValue(t,e.display.replace(e.ngValue+".",""))||"":t&&e.display&&i.getValue(t,e.display)||""},e.getNgModelValue2=function(t){return t&&e.display2&&e.ngValue?i.getValue(t,e.display2.replace(e.ngValue+".",""))||"":t&&e.display2&&i.getValue(t,e.display2)||""},e.getNgValue=function(t){return t&&e.ngValue?i.getValue(t,e.ngValue):t},e.$watch("items",t=>{d.val(""),t&&t.forEach(t=>{if(e.display2){let i=e.getValue(t);i&&(i+=e.space),i+=e.getValue2(t),t.$display=i}else t.$display=e.getValue(t)}),t&&e.ngModel&&t.forEach(t=>{if(i.getValue(t,e.primary)==i.getValue(e.ngModel,e.primary)){if(e.ngModel=t,e.display2){let i=e.getValue(t);i&&(i+=e.space),i+=e.getValue2(t),t.$display=i}else t.$display=e.getValue(t);d.val(t.$display)}})}),e.$watch("ngModel",t=>{if(d.val(""),e.ngModel=t,t)if(e.display2){let i=e.getNgModelValue(t);i&&(i+=e.space),i+=e.getNgModelValue2(t),d.val(i)}else d.val(e.getNgModelValue(t))}),e.searchElement.on("input",()=>{t(()=>{a.ngGet?e.ngGet({$search:e.searchElement.val()}):e.$filter=e.searchElement.val()},100)}),e.updateModel=function(i){if(i)if(e.ngModel=e.getNgValue(i,e.ngValue),e.display2){let t=e.getNgModelValue(e.ngModel);t&&(t+=e.space),t+=e.getNgModelValue2(e.ngModel),d.val(t)}else d.val(e.getNgModelValue(e.ngModel));else e.ngModel=null,d.val("");t(()=>{e.ngChange&&e.ngChange()},100),e.hide()}},template:"/*##client-side/directive/i-list.html*/"}}]),app.directive("iChecklist",["$interval","$timeout",function(e,t){return{restrict:"E",required:"ngModel",scope:{label:"@",primary:"@",display:"@",class2:"@",ngModel:"=",items:"=",like:"&",ngChange:"&"},link:function(e,i,n,a){e.primary=e.primary||"id",e.display=e.display||"name",e.class2=e.class2||"col3",e.selectedItems=[],e.$watch("ngModel",t=>{e.reload()}),e.$watch("items",t=>{e.reload()}),e.reload=function(){e.selectedItems=[],e.ngModel&&(e.ngModel.forEach(t=>{e.selectedItems.push(t)}),e.items&&e.items.forEach(t=>{let i=!1;e.selectedItems.forEach(n=>{t[e.primary]===n[e.primary]&&(i=!0)}),t.$selected=!!i})),e.ngModel||(e.selectedItems=[],e.items&&e.items.forEach(e=>{e.$selected=!1}))},e.change=function(i){if(i.$selected){let t=!1;if(e.selectedItems.forEach(n=>{n[e.primary]===i[e.primary]&&(t=!0)}),!t){let t={...i};delete t.$selected,delete t.$$hashKey,e.selectedItems.push(t)}}else e.selectedItems.forEach((t,n)=>{t[e.primary]===i[e.primary]&&e.selectedItems.splice(n,1)});e.ngModel=e.selectedItems,t(()=>{e.ngChange&&e.ngChange()},100)}},template:"/*##client-side/directive/i-checklist.html*/"}}]),app.directive("iDate",function(e){return{restrict:"E",required:"ngModel",scope:{v:"@",id2:"@",label:"@",type:"@",class2:"@",disabled:"@",ngModel:"=",ngChange:"&",ngKeydown:"&"},link:function(e,t,i){e.id2=e.id2||"input_"+Math.random().toString().replace("0.",""),e.v=e.v||"",e.requird="",e.v.like("*r*")&&(e.requird="*"),void 0!==i.disabled?i.disabled="disabled":i.disabled="",e.class2=e.class2||"",e.model={},e.lang=site.session?site.session.lang:"en","ar"===e.lang?e.monthes=[{id:0,name:"يناير"},{id:1,name:"فبراير"},{id:2,name:"مارس"},{id:3,name:"ابريل"},{id:4,name:"مايو"},{id:5,name:"يونيو"},{id:6,name:"يوليو"},{id:7,name:"اغسطس"},{id:8,name:"سبتمبر"},{id:9,name:"اكتوبر"},{id:10,name:"نوفمبر"},{id:11,name:"ديسمبر"}]:e.monthes=[{id:0,name:"January"},{id:1,name:"February"},{id:2,name:"March"},{id:3,name:"April"},{id:4,name:"May"},{id:5,name:"June"},{id:6,name:"July"},{id:7,name:"August"},{id:8,name:"September"},{id:9,name:"October"},{id:10,name:"November"},{id:11,name:"December"}],e.$watch("ngModel",function(i){i?(i=new Date(i),e.model=e.model||{},e.model.selectedDay=site.addZero(i.getDate(),2),e.model.selectedMonth=e.monthes.find(e=>e.id==i.getMonth()),e.model.selectedYear=i.getFullYear(),$(t).attr("value",i.getTime()),e.ngModel1=new Date(i)):(e.model=e.model||{},e.model.selectedDay=null,e.model.selectedMonth=null,e.model.selectedYear=null,$(t).attr("value",""))}),e.setDay=function(){e.ngModel=new Date},e.updateDate=function(t){e.ngModel1&&(e.ngModel=e.ngModel1,e.editOnly=!1,e.ngChange&&e.ngChange())}},restrict:"E",require:"ngModel",scope:{v:"@",disabled:"@",label:"@",ngModel:"="},template:"/*##client-side/directive/i-date.html*/"}}),app.directive("iDatetime",function(){return{restrict:"E",required:"ngModel",scope:{v:"@",id2:"@",label:"@",type:"@",class2:"@",disabled:"@",ngModel:"=",ngChange:"&",ngKeydown:"&"},link:function(e,t,i){e.id2=e.id2||"input_"+Math.random().toString().replace("0.",""),e.v=e.v||"",e.requird="",e.v.like("*r*")&&(e.requird="*"),void 0!==i.disabled?i.disabled="disabled":i.disabled="",e.class2=e.class2||"",e.model={},e.lang=site.session?site.session.lang:"en","ar"===e.lang?e.monthes=[{id:0,name:"يناير"},{id:1,name:"فبراير"},{id:2,name:"مارس"},{id:3,name:"ابريل"},{id:4,name:"مايو"},{id:5,name:"يونيو"},{id:6,name:"يوليو"},{id:7,name:"اغسطس"},{id:8,name:"سبتمبر"},{id:9,name:"اكتوبر"},{id:10,name:"نوفمبر"},{id:11,name:"ديسمبر"}]:e.monthes=[{id:0,name:"January"},{id:1,name:"February"},{id:2,name:"March"},{id:3,name:"April"},{id:4,name:"May"},{id:5,name:"June"},{id:6,name:"July"},{id:7,name:"August"},{id:8,name:"September"},{id:9,name:"October"},{id:10,name:"November"},{id:11,name:"December"}],e.$watch("ngModel",function(i){i?(i=new Date(i),e.model=e.model||{},e.model.selectedDay=site.addZero(i.getDate(),2),e.model.selectedMonth=e.monthes.find(e=>e.id==i.getMonth()),e.model.selectedYear=i.getFullYear(),e.model.selectedHour=site.addZero(i.getHours(),2),e.model.selectedMinute=site.addZero(i.getMinutes(),2),e.ngModel1=new Date(i),e.ngModel2=new Date(0,0,0,i.getHours(),i.getMinutes()),$(t).attr("value",i.getTime())):(e.model=e.model||{},e.model.selectedDay=null,e.model.selectedMonth=null,e.model.selectedYear=null,e.model.selectedHour=null,e.model.selectedMinute=null,$(t).attr("value",""))}),e.setDay=function(){e.ngModel=new Date},e.updateDate=function(i){let n=$("#time_"+e.id2).val();e.ngModel1&&n&&(e.ngModel=new Date(e.ngModel1.getFullYear(),e.ngModel1.getMonth(),e.ngModel1.getDate(),n.split(":")[0],n.split(":")[1],0),e.editOnly=!1,$(t).attr("value",e.ngModel.getTime()),e.ngChange&&e.ngChange())}},restrict:"E",require:"ngModel",scope:{v:"@",disabled:"@",label:"@",ngModel:"="},template:"/*##client-side/directive/i-datetime.html*/"}}),app.directive("iFile",["$interval","isite","$timeout",function(e,t,i){return{restrict:"E",required:"ngModel",scope:{label:"@",view:"@",accept:"@",folder:"@",ngModel:"=",ngClick:"&",onSelected:"&",ngChange:"&"},link:function(e,n,a,l){e.label=e.label||"",e.folder=e.folder||"default",e.accept=e.accept?e.accept:"",e.viewOnly=void 0!==e.view;let d=$(n).find("input")[0],o=$(n).find("i-button")[0],s=$(n).find(".progress")[0],r=$(n).find(".progress-bar")[0];$(s).hide(),e.id=Math.random().toString().replace(".","_"),e.viewOnly||o.addEventListener("click",function(){d.click()}),d.addEventListener("change",function(){t.uploadFile(this.files,{folder:e.folder},(t,i,n)=>{n&&($(s).show(),e.value=n.loaded/n.total*100,r.style.width=e.value+"%",e.max=n.total,100===e.value&&$(s).hide()),i&&(e.ngModel=i,e.changed())}),e.ngModel=this.files[0].path,e.onSelected(this.files[0].path),e.$applyAsync()}),e.$watch("ngModel",e=>{e&&o.setAttribute("url",e)}),e.changed=function(){i(()=>{e.ngChange&&e.ngChange()},200)}},template:"/*##client-side/directive/i-file.html*/"}}]),app.directive("iImage",["$interval","isite","$timeout",function(e,t,i){return{restrict:"E",required:"ngModel",scope:{folder:"@",view:"@",accept:"@",ngModel:"=",ngClick:"&",ngChange:"&"},link:function(e,n,a,l){e.accept=e.accept?e.accept:"image/*",e.viewOnly=void 0!==e.view;let d=$(n).find("input")[0],o=$(n).find("img")[0],s=$(n).find(".progress")[0];$(s).hide(),e.upload=function(){e.viewOnly||d.click()},e.delete=function(){o.src=null,e.ngModel=null},d.addEventListener("change",function(){t.uploadImage(this.files,{folder:e.folder},(t,n,a)=>{a&&($(s).show(),e.value=a.loaded/a.total*100,e.max=a.total,$(s).css("width",e.value),100===e.value&&$(s).hide()),n&&(e.ngModel=n,e.ngChange&&i(()=>{e.ngChange()},200))})}),e.$watch("ngModel",e=>{e&&o.setAttribute("src",e.url)})},template:"/*##client-side/directive/i-image.html*/"}}]),app.directive("iAudio",["$interval","isite","$timeout",function(e,t,i){return{restrict:"E",required:"ngModel",scope:{folder:"@",view:"@",accept:"@",ngModel:"=",ngClick:"&",ngChange:"&"},link:function(e,n,a,l){e.folder=e.folder||"default",e.accept=e.accept?e.accept:".mp3",e.viewOnly=void 0!==e.view;let d=$(n).find("input")[0],o=$(n).find("audio")[0],s=$(n).find(".progress")[0];$(s).hide(),e.upload=function(){e.viewOnly||d.click()},e.delete=function(){e.ngModel=null,o.setAttribute("src",null)},d.addEventListener("change",function(){t.uploadAudio(this.files,{folder:e.folder},(t,n,a)=>{a&&($(s).show(),e.value=a.loaded/a.total*100,e.max=a.total,$(s).css("width",e.value),100===e.value&&$(s).hide()),n&&(e.ngModel=n,e.ngChange&&i(()=>{e.ngChange()},200))})}),e.$watch("ngModel",e=>{e&&(o.setAttribute("src",e.url),o.setAttribute("type","audio/mpeg"))})},template:"/*##client-side/directive/i-audio.html*/"}}]),app.directive("iVideo",["$interval","isite","$timeout",function(e,t,i){return{restrict:"E",required:"ngModel",scope:{folder:"@",view:"@",accept:"@",ngModel:"=",ngClick:"&",ngChange:"&"},link:function(e,n,a,l){e.folder=e.folder||"default",e.accept=e.accept?e.accept:".mp4",e.viewOnly=void 0!==e.view;let d=$(n).find("input")[0],o=$(n).find("video")[0],s=$(n).find(".progress")[0];$(s).hide(),e.upload=function(){e.viewOnly||d.click()},e.delete=function(){e.ngModel=null,o.setAttribute("src",null)},d.addEventListener("change",function(){t.uploadVideo(this.files,{folder:e.folder},(t,n,a)=>{a&&($(s).show(),e.value=a.loaded/a.total*100,e.max=a.total,$(s).css("width",e.value),100===e.value&&$(s).hide()),n&&(e.ngModel=n,e.ngChange&&i(()=>{e.ngChange()},200))})}),e.capture=function(){let t=document.createElement("canvas");t.width=o.videoWidth/4,t.height=o.videoHeight/4,t.getContext("2d").drawImage(o,0,0,t.width,t.height),e.ngModel.imageURL=t.toDataURL("image/jpeg")},o.addEventListener("canplay",function(t){i(()=>{e.capture()},2e3)},!1),e.$watch("ngModel",e=>{e&&(o.setAttribute("src",e.url),o.setAttribute("type","video/mp4"),o.load())})},template:"/*##client-side/directive/i-video.html*/"}}]),app.directive("iUpload",["$interval","isite",function(e,t){return{restrict:"E",scope:{label:"@",api:"@",type:"@",view:"@",ngClick:"&",onUploaded:"&"},link:function(e,i,n,a){let l=$(i).find("input")[0],d=$(i).find("button")[0],o=$(i).find("progress")[0];$(o).hide(),""!==n.view&&d.addEventListener("click",function(){l.click()}),l.addEventListener("change",function(){e.api&&t.upload(this.files,{api:e.api},(t,i,n)=>{n?($(o).show(),o.value=n.loaded,o.max=n.total):i&&e.onUploaded&&e.onUploaded({$data:i})})})},template:"/*##client-side/directive/i-upload.html*/"}}]),app.directive("iTreeview",["$interval","$timeout","isite",function(e,t,i){return{restrict:"E",require:"ngModel",scope:{v:"@",label:"@",display:"@",display2:"@",disabled:"@",space:"@",primary:"@",ngValue:"@",ngModel:"=",ngSearch:"=",ngChange:"&",ngClick:"&",ngAdd:"&",ngNode:"&",ngEdit:"&",ngDelete:"&",nodes:"="},link:function(e,t,i,n){i.display=i.display||"name",i.primary=i.primary||"id",i.space=i.space||" ",i.ngValue=i.ngValue||"",e.source={},e.setNodes=function(t){t.nodes.forEach(t=>{t.nodes=t.nodes||[],e.nodes.forEach(e=>{if(e.$parent_id==t.id){e.v_display=e.v_display||"",e.v_display+=e[i.display];let n=!1;t.nodes.forEach(t=>{t.id==e.id&&(n=!0)}),n||t.nodes.push(e)}}),e.setNodes(t)})},e.v_nodes=[],e.$watch("ngModel",t=>{t&&(e.ngModel=t,e.ngModel.v_display=e.ngModel.v_display||t[i.display])}),e.$watch("nodes",t=>{e.v_nodes=[],t&&(t.forEach(t=>{if(t.$parent_id=t.parent_id||t.parentId||0,t.v_display=t.v_display||"",t.v_display+=t[i.display],0==t.$parent_id){let i=!1;e.v_nodes.forEach(e=>{e.id==t.id&&(i=!0)}),i||e.v_nodes.push(t)}}),e.v_nodes.forEach(n=>{n.nodes=n.nodes||[],t.forEach(e=>{if(e.$parent_id=e.parent_id||e.parentId||0,e.$parent_id==n.id){e.v_display=e.v_display||"",e.v_display+=e[i.display];let t=!1;n.nodes.forEach(i=>{i.id==e.id&&(t=!0)}),t||n.nodes.push(e)}}),e.setNodes(n)}))})},template:"/*##client-side/directive/i-treeview.html*/"}}]),app.directive("iTreenode",["$interval","$timeout","isite",function(e,t,i){return{restrict:"E",require:"ngModel",scope:{v:"@",label:"@",display:"@",display2:"@",disabled:"@",space:"@",primary:"@",ngValue:"@",ngChange:"&",ngClick:"&",ngAdd:"&",ngEdit:"&",ngDelete:"&",ngModel:"=",ngSearch:"=",nodes:"=",nodes:"="},link:function(e,t,i,n){i.display=i.display||"name",i.primary=i.primary||"id",i.space=i.space||" ",i.ngValue=i.ngValue||"",e.nodes=e.nodes||[],e.v_nodes=[],e.$watch("nodes",t=>{e.v_nodes=[],t&&t.forEach((e,t)=>{e.nodes&&e.nodes.forEach((t,n)=>{t.$parent_id=t.parent_id||e.id,t.v_display=e.v_display||" ",t.v_display+=" - "+t[i.display]})})}),e.updateParentModal=function(t,i){t&&(t.ngModel=i,t.$parent&&e.updateParentModal(t.$parent,i))},e.unSelectParent=function(t){t&&t.nodes&&(t.nodes.forEach(e=>{e.$selected=!1}),t.$parent&&e.unSelectParent(t.$parent))},e.unSelectNodes=function(t){t&&t.forEach(t=>{t.$selected=!1,t.nodes&&e.unSelectNodes(t.nodes)})},e.updateModal=function(t){e.ngModel=t,e.updateParentModal(e.$parent,t)},e.selected=function(t){e.unSelectParent(e.$parent),e.unSelectNodes(e.nodes),t.nodes&&t.nodes.forEach(e=>{e.$selected=!1}),t.$selected=!0}},template:"/*##client-side/directive/i-treenode.html*/"}}]);
@@ -66,20 +66,20 @@ app.service('isite', [
66
66
  }
67
67
 
68
68
  let arr = property.split('.');
69
+ let value = null;
69
70
 
70
- if (arr.length === 1) {
71
- return obj[arr[0]];
71
+ if (arr.length > 0) {
72
+ value = obj[arr[0]];
72
73
  }
73
74
 
74
- if (arr.length === 2) {
75
- return obj[arr[0]][arr[1]];
75
+ if (arr.length > 1 && value) {
76
+ value = value[arr[1]];
76
77
  }
77
-
78
- if (arr.length === 3) {
79
- return obj[arr[0]][arr[1]][arr[2]];
78
+ if (arr.length > 2 && value) {
79
+ value = value[arr[2]];
80
80
  }
81
81
 
82
- return null;
82
+ return value;
83
83
  };
84
84
 
85
85
  this.uploadImage = function (files, options, callback) {
@@ -668,12 +668,6 @@ app.directive('iControl', function () {
668
668
  attrs.disabled = '';
669
669
  }
670
670
 
671
- $(element)
672
- .find('input')
673
- .focus(() => {
674
- $('.i-list .dropdown-content').css('display', 'none');
675
- });
676
-
677
671
  scope.$watch(attrs.ngModel, function (v) {});
678
672
  },
679
673
  template: `
@@ -953,22 +947,11 @@ app.directive('iList', [
953
947
  }
954
948
 
955
949
  let input = $(element).find('input');
956
- $(element).hover(
957
- () => {
958
- $scope.popupElement.css('display', 'block');
959
- },
960
- () => {
961
- $scope.popupElement.css('display', 'none');
962
- }
963
- );
950
+
964
951
  $scope.focus = function () {
965
- $('.i-list .dropdown-content').css('display', 'none');
966
- $scope.popupElement.css('display', 'block');
967
952
  $scope.searchElement.focus();
968
953
  };
969
- $scope.hide = function () {
970
- $scope.popupElement.css('display', 'none');
971
- };
954
+
972
955
 
973
956
  $scope.getValue = function (item) {
974
957
  let v = isite.getValue(item, $scope.display);
@@ -1043,7 +1026,6 @@ app.directive('iList', [
1043
1026
  $timeout(() => {
1044
1027
  $scope.ngChange();
1045
1028
  });
1046
- $scope.hide();
1047
1029
  };
1048
1030
  },
1049
1031
  template: `/*##client-side/directive-core/i-list.html*/`,