ps-toolkit-ui 0.0.210 → 0.0.211
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/karma.conf.js +32 -0
- package/ng-package.json +16 -0
- package/package.json +19 -22
- package/src/lib/classes/chart.class.ts +140 -0
- package/src/lib/classes/enum.class.ts +193 -0
- package/src/lib/classes/excel.class.ts +46 -0
- package/src/lib/classes/form.class.ts +528 -0
- package/src/lib/classes/helper.class.ts +283 -0
- package/src/lib/classes/lang.class.ts +32 -0
- package/src/lib/classes/login.class.ts +27 -0
- package/src/lib/classes/modal.class.ts +59 -0
- package/src/lib/classes/permission.class.ts +55 -0
- package/src/lib/classes/request.class.ts +255 -0
- package/src/lib/classes/safestyle.class.ts +4 -0
- package/src/lib/classes/sidebar.class.ts +20 -0
- package/src/lib/classes/steps.class.ts +19 -0
- package/src/lib/classes/string.class.ts +219 -0
- package/src/lib/classes/table.class.ts +228 -0
- package/src/lib/components/accordion/accordion.component.css +116 -0
- package/src/lib/components/accordion/accordion.component.html +19 -0
- package/src/lib/components/accordion/accordion.component.ts +41 -0
- package/src/lib/components/alert/alert.component.css +112 -0
- package/src/lib/components/alert/alert.component.html +1 -0
- package/src/lib/components/alert/alert.component.ts +35 -0
- package/src/lib/components/base.component.ts +38 -0
- package/src/lib/components/calendar/calendar.component.css +206 -0
- package/src/lib/components/calendar/calendar.component.html +36 -0
- package/src/lib/components/calendar/calendar.component.ts +99 -0
- package/src/lib/components/chart/chart.component.css +24 -0
- package/src/lib/components/chart/chart.component.html +6 -0
- package/src/lib/components/chart/chart.component.ts +14 -0
- package/src/lib/components/clock/clock.component.css +141 -0
- package/src/lib/components/clock/clock.component.html +10 -0
- package/src/lib/components/clock/clock.component.ts +37 -0
- package/src/lib/components/confirm/confirm.component.css +112 -0
- package/src/lib/components/confirm/confirm.component.html +1 -0
- package/src/lib/components/confirm/confirm.component.ts +47 -0
- package/src/lib/components/footer/footer.component.css +46 -0
- package/src/lib/components/footer/footer.component.html +9 -0
- package/src/lib/components/footer/footer.component.ts +18 -0
- package/src/lib/components/form/bank-card/form.bank-card.component.css +115 -0
- package/src/lib/components/form/bank-card/form.bank-card.component.html +13 -0
- package/src/lib/components/form/bank-card/form.bank-card.component.ts +144 -0
- package/src/lib/components/form/button/form.button.component.css +222 -0
- package/src/lib/components/form/button/form.button.component.html +16 -0
- package/src/lib/components/form/button/form.button.component.ts +65 -0
- package/src/lib/components/form/car/form.car.component.css +287 -0
- package/src/lib/components/form/car/form.car.component.html +11 -0
- package/src/lib/components/form/car/form.car.component.ts +82 -0
- package/src/lib/components/form/car/search/form.car.search.component.css +287 -0
- package/src/lib/components/form/car/search/form.car.search.component.html +15 -0
- package/src/lib/components/form/car/search/form.car.search.component.ts +170 -0
- package/src/lib/components/form/checkbox/form.checkbox.component.css +128 -0
- package/src/lib/components/form/checkbox/form.checkbox.component.html +8 -0
- package/src/lib/components/form/checkbox/form.checkbox.component.ts +64 -0
- package/src/lib/components/form/date/form.date.component.css +310 -0
- package/src/lib/components/form/date/form.date.component.html +46 -0
- package/src/lib/components/form/date/form.date.component.ts +247 -0
- package/src/lib/components/form/datetime/form.datetime.component.css +157 -0
- package/src/lib/components/form/datetime/form.datetime.component.html +11 -0
- package/src/lib/components/form/datetime/form.datetime.component.ts +98 -0
- package/src/lib/components/form/file/form.file.component.css +151 -0
- package/src/lib/components/form/file/form.file.component.html +12 -0
- package/src/lib/components/form/file/form.file.component.ts +130 -0
- package/src/lib/components/form/finger/form.finger.component.css +215 -0
- package/src/lib/components/form/finger/form.finger.component.html +59 -0
- package/src/lib/components/form/finger/form.finger.component.ts +131 -0
- package/src/lib/components/form/hidden/form.hidden.component.css +0 -0
- package/src/lib/components/form/hidden/form.hidden.component.html +0 -0
- package/src/lib/components/form/hidden/form.hidden.component.ts +29 -0
- package/src/lib/components/form/icon/form.icon.component.css +108 -0
- package/src/lib/components/form/icon/form.icon.component.html +14 -0
- package/src/lib/components/form/icon/form.icon.component.ts +73 -0
- package/src/lib/components/form/index/form.component.css +89 -0
- package/src/lib/components/form/index/form.component.html +35 -0
- package/src/lib/components/form/index/form.component.ts +45 -0
- package/src/lib/components/form/label/form.label.component.css +45 -0
- package/src/lib/components/form/label/form.label.component.html +2 -0
- package/src/lib/components/form/label/form.label.component.ts +30 -0
- package/src/lib/components/form/plaque/form.plaque.component.css +76 -0
- package/src/lib/components/form/plaque/form.plaque.component.html +10 -0
- package/src/lib/components/form/plaque/form.plaque.component.ts +178 -0
- package/src/lib/components/form/plaque/select/form.plaque.select.component.css +167 -0
- package/src/lib/components/form/plaque/select/form.plaque.select.component.html +19 -0
- package/src/lib/components/form/plaque/select/form.plaque.select.component.ts +385 -0
- package/src/lib/components/form/radio/form.radio.component.css +158 -0
- package/src/lib/components/form/radio/form.radio.component.html +16 -0
- package/src/lib/components/form/radio/form.radio.component.ts +78 -0
- package/src/lib/components/form/select/form.select.component.css +326 -0
- package/src/lib/components/form/select/form.select.component.html +16 -0
- package/src/lib/components/form/select/form.select.component.ts +358 -0
- package/src/lib/components/form/select/item/form.select.item.component.css +59 -0
- package/src/lib/components/form/select/item/form.select.item.component.html +10 -0
- package/src/lib/components/form/select/item/form.select.item.component.ts +40 -0
- package/src/lib/components/form/table/form.table.component.css +50 -0
- package/src/lib/components/form/table/form.table.component.html +8 -0
- package/src/lib/components/form/table/form.table.component.ts +94 -0
- package/src/lib/components/form/textarea/form.textarea.component.css +109 -0
- package/src/lib/components/form/textarea/form.textarea.component.html +10 -0
- package/src/lib/components/form/textarea/form.textarea.component.ts +76 -0
- package/src/lib/components/form/textbox/form.textbox.component.css +296 -0
- package/src/lib/components/form/textbox/form.textbox.component.html +13 -0
- package/src/lib/components/form/textbox/form.textbox.component.ts +185 -0
- package/src/lib/components/form/time/form.time.component.css +205 -0
- package/src/lib/components/form/time/form.time.component.html +22 -0
- package/src/lib/components/form/time/form.time.component.ts +139 -0
- package/src/lib/components/form/tree/form.tree.component.css +109 -0
- package/src/lib/components/form/tree/form.tree.component.html +11 -0
- package/src/lib/components/form/tree/form.tree.component.ts +98 -0
- package/src/lib/components/form/tree/item/form.tree.item.component.css +142 -0
- package/src/lib/components/form/tree/item/form.tree.item.component.html +9 -0
- package/src/lib/components/form/tree/item/form.tree.item.component.ts +49 -0
- package/src/lib/components/header/header.component.css +57 -0
- package/src/lib/components/header/header.component.html +5 -0
- package/src/lib/components/header/header.component.ts +28 -0
- package/src/lib/components/header/sub/sub.header.component.css +62 -0
- package/src/lib/components/header/sub/sub.header.component.html +8 -0
- package/src/lib/components/header/sub/sub.header.component.ts +11 -0
- package/src/lib/components/layout/layout.component.css +300 -0
- package/src/lib/components/layout/layout.component.html +20 -0
- package/src/lib/components/layout/layout.component.ts +21 -0
- package/src/lib/components/loading/loading.component.css +39 -0
- package/src/lib/components/loading/loading.component.html +8 -0
- package/src/lib/components/loading/loading.component.ts +18 -0
- package/src/lib/components/login/login.component.css +389 -0
- package/src/lib/components/login/login.component.html +27 -0
- package/src/lib/components/login/login.component.ts +145 -0
- package/src/lib/components/modal/modal.component.css +60 -0
- package/src/lib/components/modal/modal.component.html +12 -0
- package/src/lib/components/modal/modal.component.ts +23 -0
- package/src/lib/components/notfound/notfound.component.css +134 -0
- package/src/lib/components/notfound/notfound.component.html +10 -0
- package/src/lib/components/notfound/notfound.component.ts +25 -0
- package/src/lib/components/notification/notification.component.css +45 -0
- package/src/lib/components/notification/notification.component.html +2 -0
- package/src/lib/components/notification/notification.component.ts +11 -0
- package/src/lib/components/sidebar/item/sidebar.item.component.css +236 -0
- package/src/lib/components/sidebar/item/sidebar.item.component.html +16 -0
- package/src/lib/components/sidebar/item/sidebar.item.component.ts +54 -0
- package/src/lib/components/sidebar/sidebar.component.css +42 -0
- package/src/lib/components/sidebar/sidebar.component.html +10 -0
- package/src/lib/components/sidebar/sidebar.component.ts +60 -0
- package/src/lib/components/steps/steps.component.css +320 -0
- package/src/lib/components/steps/steps.component.html +18 -0
- package/src/lib/components/steps/steps.component.ts +44 -0
- package/src/lib/components/table/loading/table.loading.component.css +29 -0
- package/src/lib/components/table/loading/table.loading.component.html +9 -0
- package/src/lib/components/table/loading/table.loading.component.ts +14 -0
- package/src/lib/components/table/pagination/table.pagination.component.css +138 -0
- package/src/lib/components/table/pagination/table.pagination.component.html +9 -0
- package/src/lib/components/table/pagination/table.pagination.component.ts +89 -0
- package/src/lib/components/table/report/table.report.component.css +125 -0
- package/src/lib/components/table/report/table.report.component.html +19 -0
- package/src/lib/components/table/report/table.report.component.ts +238 -0
- package/src/lib/components/table/row/table.row.component.css +170 -0
- package/src/lib/components/table/row/table.row.component.html +21 -0
- package/src/lib/components/table/row/table.row.component.ts +373 -0
- package/src/lib/components/table/table.component.css +116 -0
- package/src/lib/components/table/table.component.html +62 -0
- package/src/lib/components/table/table.component.ts +180 -0
- package/src/lib/components/tooltip/tooltip.component.css +159 -0
- package/src/lib/components/tooltip/tooltip.component.html +1 -0
- package/src/lib/components/tooltip/tooltip.component.ts +15 -0
- package/src/lib/ps-toolkit-ui.module.ts +94 -0
- package/src/lib/services/config.service.ts +8 -0
- package/{public-api.d.ts → src/public-api.ts} +53 -48
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/bundles/ps-toolkit-ui.umd.js +0 -7646
- package/bundles/ps-toolkit-ui.umd.js.map +0 -1
- package/bundles/ps-toolkit-ui.umd.min.js +0 -2
- package/bundles/ps-toolkit-ui.umd.min.js.map +0 -1
- package/esm2015/lib/classes/chart.class.js +0 -140
- package/esm2015/lib/classes/enum.class.js +0 -187
- package/esm2015/lib/classes/form.class.js +0 -481
- package/esm2015/lib/classes/helper.class.js +0 -284
- package/esm2015/lib/classes/lang.class.js +0 -32
- package/esm2015/lib/classes/login.class.js +0 -22
- package/esm2015/lib/classes/modal.class.js +0 -52
- package/esm2015/lib/classes/permission.class.js +0 -61
- package/esm2015/lib/classes/request.class.js +0 -256
- package/esm2015/lib/classes/safestyle.class.js +0 -15
- package/esm2015/lib/classes/sidebar.class.js +0 -14
- package/esm2015/lib/classes/steps.class.js +0 -20
- package/esm2015/lib/classes/string.class.js +0 -220
- package/esm2015/lib/classes/table.class.js +0 -215
- package/esm2015/lib/components/accordion/accordion.component.js +0 -45
- package/esm2015/lib/components/alert/alert.component.js +0 -39
- package/esm2015/lib/components/base.component.js +0 -45
- package/esm2015/lib/components/calendar/calendar.component.js +0 -97
- package/esm2015/lib/components/chart/chart.component.js +0 -17
- package/esm2015/lib/components/clock/clock.component.js +0 -33
- package/esm2015/lib/components/confirm/confirm.component.js +0 -50
- package/esm2015/lib/components/footer/footer.component.js +0 -23
- package/esm2015/lib/components/form/bank-card/form.bank-card.component.js +0 -148
- package/esm2015/lib/components/form/button/form.button.component.js +0 -68
- package/esm2015/lib/components/form/car/form.car.component.js +0 -84
- package/esm2015/lib/components/form/car/search/form.car.search.component.js +0 -172
- package/esm2015/lib/components/form/checkbox/form.checkbox.component.js +0 -66
- package/esm2015/lib/components/form/date/form.date.component.js +0 -254
- package/esm2015/lib/components/form/datetime/form.datetime.component.js +0 -104
- package/esm2015/lib/components/form/file/form.file.component.js +0 -133
- package/esm2015/lib/components/form/finger/form.finger.component.js +0 -138
- package/esm2015/lib/components/form/hidden/form.hidden.component.js +0 -31
- package/esm2015/lib/components/form/icon/form.icon.component.js +0 -76
- package/esm2015/lib/components/form/index/form.component.js +0 -48
- package/esm2015/lib/components/form/label/form.label.component.js +0 -32
- package/esm2015/lib/components/form/plaque/form.plaque.component.js +0 -176
- package/esm2015/lib/components/form/plaque/select/form.plaque.select.component.js +0 -390
- package/esm2015/lib/components/form/radio/form.radio.component.js +0 -79
- package/esm2015/lib/components/form/select/form.select.component.js +0 -374
- package/esm2015/lib/components/form/select/item/form.select.item.component.js +0 -43
- package/esm2015/lib/components/form/table/form.table.component.js +0 -98
- package/esm2015/lib/components/form/textarea/form.textarea.component.js +0 -78
- package/esm2015/lib/components/form/textbox/form.textbox.component.js +0 -186
- package/esm2015/lib/components/form/time/form.time.component.js +0 -145
- package/esm2015/lib/components/form/tree/form.tree.component.js +0 -99
- package/esm2015/lib/components/form/tree/item/form.tree.item.component.js +0 -48
- package/esm2015/lib/components/header/header.component.js +0 -33
- package/esm2015/lib/components/header/sub/sub.header.component.js +0 -14
- package/esm2015/lib/components/layout/layout.component.js +0 -25
- package/esm2015/lib/components/loading/loading.component.js +0 -22
- package/esm2015/lib/components/login/login.component.js +0 -148
- package/esm2015/lib/components/modal/modal.component.js +0 -25
- package/esm2015/lib/components/notfound/notfound.component.js +0 -29
- package/esm2015/lib/components/notification/notification.component.js +0 -14
- package/esm2015/lib/components/sidebar/item/sidebar.item.component.js +0 -53
- package/esm2015/lib/components/sidebar/sidebar.component.js +0 -67
- package/esm2015/lib/components/steps/steps.component.js +0 -51
- package/esm2015/lib/components/table/loading/table.loading.component.js +0 -17
- package/esm2015/lib/components/table/pagination/table.pagination.component.js +0 -84
- package/esm2015/lib/components/table/report/table.report.component.js +0 -246
- package/esm2015/lib/components/table/row/table.row.component.js +0 -379
- package/esm2015/lib/components/table/table.component.js +0 -179
- package/esm2015/lib/components/tooltip/tooltip.component.js +0 -19
- package/esm2015/lib/ps-toolkit-ui.module.js +0 -95
- package/esm2015/lib/services/config.service.js +0 -14
- package/esm2015/ps-toolkit-ui.js +0 -20
- package/esm2015/public-api.js +0 -52
- package/fesm2015/ps-toolkit-ui.js +0 -6566
- package/fesm2015/ps-toolkit-ui.js.map +0 -1
- package/lib/classes/chart.class.d.ts +0 -11
- package/lib/classes/enum.class.d.ts +0 -158
- package/lib/classes/form.class.d.ts +0 -173
- package/lib/classes/helper.class.d.ts +0 -28
- package/lib/classes/lang.class.d.ts +0 -5
- package/lib/classes/login.class.d.ts +0 -17
- package/lib/classes/modal.class.d.ts +0 -19
- package/lib/classes/permission.class.d.ts +0 -31
- package/lib/classes/request.class.d.ts +0 -12
- package/lib/classes/safestyle.class.d.ts +0 -7
- package/lib/classes/sidebar.class.d.ts +0 -11
- package/lib/classes/steps.class.d.ts +0 -17
- package/lib/classes/string.class.d.ts +0 -218
- package/lib/classes/table.class.d.ts +0 -69
- package/lib/components/accordion/accordion.component.d.ts +0 -7
- package/lib/components/alert/alert.component.d.ts +0 -10
- package/lib/components/base.component.d.ts +0 -14
- package/lib/components/calendar/calendar.component.d.ts +0 -26
- package/lib/components/chart/chart.component.d.ts +0 -5
- package/lib/components/clock/clock.component.d.ts +0 -11
- package/lib/components/confirm/confirm.component.d.ts +0 -14
- package/lib/components/footer/footer.component.d.ts +0 -6
- package/lib/components/form/bank-card/form.bank-card.component.d.ts +0 -22
- package/lib/components/form/button/form.button.component.d.ts +0 -15
- package/lib/components/form/car/form.car.component.d.ts +0 -16
- package/lib/components/form/car/search/form.car.search.component.d.ts +0 -17
- package/lib/components/form/checkbox/form.checkbox.component.d.ts +0 -14
- package/lib/components/form/date/form.date.component.d.ts +0 -42
- package/lib/components/form/datetime/form.datetime.component.d.ts +0 -13
- package/lib/components/form/file/form.file.component.d.ts +0 -17
- package/lib/components/form/finger/form.finger.component.d.ts +0 -15
- package/lib/components/form/hidden/form.hidden.component.d.ts +0 -7
- package/lib/components/form/icon/form.icon.component.d.ts +0 -15
- package/lib/components/form/index/form.component.d.ts +0 -10
- package/lib/components/form/label/form.label.component.d.ts +0 -8
- package/lib/components/form/plaque/form.plaque.component.d.ts +0 -22
- package/lib/components/form/plaque/select/form.plaque.select.component.d.ts +0 -36
- package/lib/components/form/radio/form.radio.component.d.ts +0 -13
- package/lib/components/form/select/form.select.component.d.ts +0 -39
- package/lib/components/form/select/item/form.select.item.component.d.ts +0 -12
- package/lib/components/form/table/form.table.component.d.ts +0 -9
- package/lib/components/form/textarea/form.textarea.component.d.ts +0 -13
- package/lib/components/form/textbox/form.textbox.component.d.ts +0 -20
- package/lib/components/form/time/form.time.component.d.ts +0 -25
- package/lib/components/form/tree/form.tree.component.d.ts +0 -16
- package/lib/components/form/tree/item/form.tree.item.component.d.ts +0 -17
- package/lib/components/header/header.component.d.ts +0 -9
- package/lib/components/header/sub/sub.header.component.d.ts +0 -3
- package/lib/components/layout/layout.component.d.ts +0 -8
- package/lib/components/loading/loading.component.d.ts +0 -5
- package/lib/components/login/login.component.d.ts +0 -13
- package/lib/components/modal/modal.component.d.ts +0 -9
- package/lib/components/notfound/notfound.component.d.ts +0 -8
- package/lib/components/notification/notification.component.d.ts +0 -3
- package/lib/components/sidebar/item/sidebar.item.component.d.ts +0 -14
- package/lib/components/sidebar/sidebar.component.d.ts +0 -19
- package/lib/components/steps/steps.component.d.ts +0 -10
- package/lib/components/table/loading/table.loading.component.d.ts +0 -5
- package/lib/components/table/pagination/table.pagination.component.d.ts +0 -15
- package/lib/components/table/report/table.report.component.d.ts +0 -34
- package/lib/components/table/row/table.row.component.d.ts +0 -34
- package/lib/components/table/table.component.d.ts +0 -40
- package/lib/components/tooltip/tooltip.component.d.ts +0 -5
- package/lib/ps-toolkit-ui.module.d.ts +0 -4
- package/lib/services/config.service.d.ts +0 -6
- package/ps-toolkit-ui.d.ts +0 -19
- package/ps-toolkit-ui.metadata.json +0 -1
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
|
|
2
|
+
import * as _ from 'lodash';
|
|
3
|
+
import {TableClass, TableCollClass} from '../../../classes/table.class';
|
|
4
|
+
import {
|
|
5
|
+
InputType,
|
|
6
|
+
Method, PermissionAccessTypeEnum,
|
|
7
|
+
PermissionInputActionEnum,
|
|
8
|
+
PermissionInputTypeEnum,
|
|
9
|
+
PermissionTypeEnum,
|
|
10
|
+
TableCollType,
|
|
11
|
+
TableOptionType
|
|
12
|
+
} from '../../../classes/enum.class';
|
|
13
|
+
import {InputClass} from '../../../classes/form.class';
|
|
14
|
+
import {RequestClass} from '../../../classes/request.class';
|
|
15
|
+
import {HelperClass} from '../../../classes/helper.class';
|
|
16
|
+
import {PsToolkitUiConfigService} from '../../../services/config.service';
|
|
17
|
+
import * as $ from 'jquery';
|
|
18
|
+
import {PermissionClass} from '../../../classes/permission.class';
|
|
19
|
+
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'lib-table-row',
|
|
22
|
+
templateUrl: './table.row.component.html',
|
|
23
|
+
styleUrls: ['./table.row.component.css']
|
|
24
|
+
})
|
|
25
|
+
export class TableRowComponent implements OnInit{
|
|
26
|
+
@Output()
|
|
27
|
+
confirmShow = new EventEmitter<object>();
|
|
28
|
+
@Output()
|
|
29
|
+
changeRows = new EventEmitter<object>();
|
|
30
|
+
@Input()
|
|
31
|
+
level: number;
|
|
32
|
+
@Input()
|
|
33
|
+
table: TableClass;
|
|
34
|
+
@Input()
|
|
35
|
+
row;
|
|
36
|
+
@Output()
|
|
37
|
+
loadParent = new EventEmitter<string>();
|
|
38
|
+
get type(): typeof InputType { return InputType; }
|
|
39
|
+
get tableOptionType(): typeof TableOptionType{ return TableOptionType; }
|
|
40
|
+
optStatus: InputClass;
|
|
41
|
+
showChildren: InputClass = null;
|
|
42
|
+
addChildren: InputClass = null;
|
|
43
|
+
itemsWidth = 0;
|
|
44
|
+
children: any[] = [];
|
|
45
|
+
@ViewChild('childrenDiv') childrenDiv: ElementRef;
|
|
46
|
+
constructor(public service: PsToolkitUiConfigService) {
|
|
47
|
+
}
|
|
48
|
+
ngOnInit(): void {
|
|
49
|
+
this.itemsWidth = this.table.cols.reduce((a, {percent}) => a + percent, 0);
|
|
50
|
+
if (this.table.hasChildren){
|
|
51
|
+
if (!this.table.childrenAutoLoad){
|
|
52
|
+
this.children = this.getChildren();
|
|
53
|
+
}
|
|
54
|
+
if (this.table.permissions.hasAccess(PermissionAccessTypeEnum.Insert)){
|
|
55
|
+
this.addChildren = new InputClass(this.table.environment, this.table.l, this.table.name + 'AddSubsetTitle',
|
|
56
|
+
'fa-duotone fa-plus fa-rotate-90', InputType.Icon,
|
|
57
|
+
'green m-h-5 h-25 d-ib va-m f-u');
|
|
58
|
+
this.addChildren.onClick = () => {
|
|
59
|
+
this.table.form.onSuccessBase = () => {
|
|
60
|
+
this.table.modal.hide();
|
|
61
|
+
this.showChildren.type = InputType.Icon;
|
|
62
|
+
this.loadChildren(this.row.Data.Id);
|
|
63
|
+
};
|
|
64
|
+
this.table.showInsertModal(this.row.Data.Id);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
this.showChildren = new InputClass(this.table.environment, this.table.l, this.table.name + 'SubsetTitle', 'fa-duotone fa-angle-left f-s-22',
|
|
68
|
+
this.row.Data.CountChild > 0 || (!this.table.childrenAutoLoad && this.children.length > 0) ? InputType.Icon : InputType.Hidden, 'h-25 m-h-5 d-ib va-m f-u');
|
|
69
|
+
this.showChildren.onClick = () => {
|
|
70
|
+
if ($(this.childrenDiv.nativeElement).is(':visible')){
|
|
71
|
+
$(this.childrenDiv.nativeElement).hide();
|
|
72
|
+
this.showChildren.icon = 'fa-duotone fa-angle-left f-s-22';
|
|
73
|
+
} else if (this.children.length === 0){
|
|
74
|
+
this.loadChildren(this.row.Data.Id);
|
|
75
|
+
} else {
|
|
76
|
+
$(this.childrenDiv.nativeElement).show();
|
|
77
|
+
this.showChildren.icon = 'fa-duotone fa-angle-down f-s-22';
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (this.table.hasStatus){
|
|
82
|
+
this.optStatus = new InputClass(this.table.environment, this.table.l, 'Status',
|
|
83
|
+
this.row.Data.Active ? 'fa-toggle-on' : 'fa-toggle-off', InputType.Icon,
|
|
84
|
+
'm-h-5 h-20 ' + (this.row.Data.Active ? 'green' : ''));
|
|
85
|
+
this.optStatus.row = this.row.Data;
|
|
86
|
+
this.optStatus.onClick = (btn) => {
|
|
87
|
+
new RequestClass(this.table.l).send(this.table.url + '/Status/' + btn.row.Id, Method.Post, null, btn, (r) => {
|
|
88
|
+
btn.class = 'm-h-5 h-20 ' + (r ? 'green' : '');
|
|
89
|
+
btn.icon = r ? 'fa-toggle-on' : 'fa-toggle-off';
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (this.table.sortable){
|
|
94
|
+
this.setSortRow();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
loadChildren(p): void{
|
|
98
|
+
new RequestClass(this.table.environment, this.table.l).send(this.table.url + `List/${p}`, Method.Post,
|
|
99
|
+
null, this.showChildren, (result) => {
|
|
100
|
+
this.children = result.List;
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
$(this.childrenDiv.nativeElement).slideDown();
|
|
103
|
+
this.showChildren.icon = 'fa-duotone fa-angle-down f-s-22';
|
|
104
|
+
}, 50);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
select(): void{
|
|
108
|
+
this.row.Data.selected = !this.row.Data.selected;
|
|
109
|
+
}
|
|
110
|
+
onChangeRows(e): void{
|
|
111
|
+
return this.changeRows.emit(e);
|
|
112
|
+
}
|
|
113
|
+
onConfirmShow(e): void{
|
|
114
|
+
return this.confirmShow.emit(e);
|
|
115
|
+
}
|
|
116
|
+
setSortRow(): void{
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
if (this.table.hasChildren) {
|
|
119
|
+
// @ts-ignore
|
|
120
|
+
$(this.childrenDiv.nativeElement).sortable({
|
|
121
|
+
axis: 'y',
|
|
122
|
+
handle: '> .row > .item-con > .handle-sortable',
|
|
123
|
+
update: () => {
|
|
124
|
+
const data = [];
|
|
125
|
+
// @ts-ignore
|
|
126
|
+
$(this.childrenDiv.nativeElement).sortable('toArray').forEach(x => data.push(x));
|
|
127
|
+
new RequestClass(this.table.l).send(this.table.url + 'Sort', Method.Post, data, null, () => {
|
|
128
|
+
if (this.table.onSort){
|
|
129
|
+
this.table.onSort();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}, 500);
|
|
136
|
+
}
|
|
137
|
+
getOptions(): InputClass[]{
|
|
138
|
+
const opts: InputClass[] = this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ?
|
|
139
|
+
[this.addChildren] : [];
|
|
140
|
+
for (const option of this.row.Options.filter(x => x.Type === PermissionTypeEnum.Option)){
|
|
141
|
+
const opt = new InputClass(this.table.environment, this.table.l, option.Name, option.Icon,
|
|
142
|
+
option.InputType === PermissionInputTypeEnum.Icon ? InputType.Icon : InputType.Button, 'blue h-25 m-h-5 d-ib va-m f-u');
|
|
143
|
+
opt.row = this.row;
|
|
144
|
+
if (option.AccessType === PermissionAccessTypeEnum.Update){
|
|
145
|
+
if (this.table.form){
|
|
146
|
+
opt.onClick = () => {
|
|
147
|
+
this.table.form.url = this.table.url + 'Update/' + this.row.Data.Id;
|
|
148
|
+
if (this.table.hasChildren && this.row.Data.ParentId != null) {
|
|
149
|
+
this.table.form.onSuccessBase = () => {
|
|
150
|
+
this.table.modal.hide();
|
|
151
|
+
if (this.table.childrenAutoLoad){
|
|
152
|
+
this.loadParent.emit(this.row.Data.ParentId);
|
|
153
|
+
}else{
|
|
154
|
+
this.table.load();
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
} else {
|
|
158
|
+
this.table.form.onSuccessBase = () => {
|
|
159
|
+
if (!this.table.form.onTop){
|
|
160
|
+
this.table.modal.hide();
|
|
161
|
+
}
|
|
162
|
+
this.table.form.clear();
|
|
163
|
+
this.table.load();
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
this.edit(opt);
|
|
167
|
+
};
|
|
168
|
+
} else {
|
|
169
|
+
opt.url = this.table.url + '/Update/' + this.row.Data.Id;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else if (option.AccessType === PermissionAccessTypeEnum.Delete){
|
|
173
|
+
opt.class = opt.class.replace('blue', 'red');
|
|
174
|
+
opt.onClick = () => {
|
|
175
|
+
if (this.table.form){
|
|
176
|
+
this.table.form.clear();
|
|
177
|
+
}
|
|
178
|
+
if (this.table.permissions.Type === PermissionTypeEnum.Form){
|
|
179
|
+
this.table.rows = this.table.rows.filter(x => x.Id !== this.row.Data.Id);
|
|
180
|
+
this.changeRows.emit(this.row.Data);
|
|
181
|
+
} else {
|
|
182
|
+
this.confirmShow.emit({id: this.row.Data.Id, accept: () => {
|
|
183
|
+
if (this.table.hasChildren && this.table.childrenAutoLoad && this.row.Data.ParentId != null ){
|
|
184
|
+
this.loadParent.emit(this.row.Data.ParentId);
|
|
185
|
+
}else{
|
|
186
|
+
this.table.load();
|
|
187
|
+
}
|
|
188
|
+
}});
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
else if (option.AccessType === PermissionAccessTypeEnum.Print){
|
|
193
|
+
const p = new PermissionClass();
|
|
194
|
+
p.RelatedId = 'Index';
|
|
195
|
+
p.Area = this.table.permissions.Area;
|
|
196
|
+
p.Controller = 'Print';
|
|
197
|
+
p.Action = option.Controller;
|
|
198
|
+
opt.url = '/Report' + p.getUrl() + '/' + this.row.Data.Id;
|
|
199
|
+
opt.urlNewTab = true;
|
|
200
|
+
}
|
|
201
|
+
else if (option.InputAction === PermissionInputActionEnum.Link || option.InputAction === PermissionInputActionEnum.LinkNewTab){
|
|
202
|
+
const p = new PermissionClass();
|
|
203
|
+
p.RelatedId = this.table.permissions.RelatedId;
|
|
204
|
+
p.Area = this.table.permissions.Area;
|
|
205
|
+
p.Controller = option.Controller;
|
|
206
|
+
p.Action = option.Action;
|
|
207
|
+
opt.url = p.getUrl() + '/' + this.row.Data.Id;
|
|
208
|
+
opt.urlNewTab = option.InputAction === PermissionInputActionEnum.LinkNewTab;
|
|
209
|
+
}
|
|
210
|
+
else if (option.InputAction === PermissionInputActionEnum.Modal){
|
|
211
|
+
opt.modal = this.table.optionsActions.find(x => x.name === option.Action);
|
|
212
|
+
opt.onClick = () => {
|
|
213
|
+
if (opt.modal.table){
|
|
214
|
+
const p = new PermissionClass();
|
|
215
|
+
p.RelatedId = this.row.Data.Id;
|
|
216
|
+
p.Area = this.table.permissions.Area;
|
|
217
|
+
p.Controller = this.table.permissions.Controller;
|
|
218
|
+
p.Action = option.Action;
|
|
219
|
+
p.Accesses = this.row.Options.filter(x => x.ParentId === option.Id);
|
|
220
|
+
opt.modal.table.permissions = p;
|
|
221
|
+
if (opt.modal.table.form){
|
|
222
|
+
opt.modal.table.form.url = p.getUrl() + 'Insert';
|
|
223
|
+
opt.modal.table.form.baseUrl = p.getUrl() + 'Insert';
|
|
224
|
+
}
|
|
225
|
+
opt.modal.table.set();
|
|
226
|
+
}
|
|
227
|
+
if (opt.modal.form){
|
|
228
|
+
opt.modal.form.name = option.Name;
|
|
229
|
+
opt.modal.form.url = opt.modal.form.baseUrl + 'Update/' + this.row.Data.Id;
|
|
230
|
+
opt.modal.form.loadData(opt.modal.form.baseUrl + 'Get/' + this.row.Data.Id);
|
|
231
|
+
opt.modal.form.onSuccessBase = () => {
|
|
232
|
+
opt.modal.hide();
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (opt.modal.accordion){
|
|
236
|
+
for (const r of opt.modal.accordion.rows){
|
|
237
|
+
if (r.table){
|
|
238
|
+
const p = new PermissionClass();
|
|
239
|
+
p.RelatedId = this.row.Data.Id;
|
|
240
|
+
p.Area = this.table.permissions.Area;
|
|
241
|
+
p.Controller = option.Controller;
|
|
242
|
+
p.Action = r.name;
|
|
243
|
+
p.Accesses = this.row.Options.filter(x => x.ParentId === option.Id);
|
|
244
|
+
r.table.permissions = p;
|
|
245
|
+
if (r.table.form){
|
|
246
|
+
r.table.form.url = p.getUrl() + 'Insert';
|
|
247
|
+
r.table.form.baseUrl = p.getUrl() + 'Insert';
|
|
248
|
+
}
|
|
249
|
+
r.table.set();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
else if (option.InputAction === PermissionInputActionEnum.File){
|
|
256
|
+
const p = new PermissionClass();
|
|
257
|
+
p.RelatedId = this.table.permissions.RelatedId;
|
|
258
|
+
p.Area = this.table.permissions.Area;
|
|
259
|
+
p.Controller = option.Controller;
|
|
260
|
+
p.Action = option.Action;
|
|
261
|
+
opt.url = '/File' + p.getUrl() + '/' + this.row.Data.Id;
|
|
262
|
+
opt.urlNewTab = true;
|
|
263
|
+
}
|
|
264
|
+
else if (option.InputAction === PermissionInputActionEnum.Confirm){
|
|
265
|
+
opt.onClick = () => {
|
|
266
|
+
const p = new PermissionClass();
|
|
267
|
+
p.RelatedId = this.table.permissions.RelatedId;
|
|
268
|
+
p.Area = this.table.permissions.Area;
|
|
269
|
+
p.Controller = option.Controller;
|
|
270
|
+
p.Action = option.Action;
|
|
271
|
+
this.table.showConfirm(this.table.l(option.Action + 'Confirm'), p.getUrl() + '/' + this.row.Data.Id, null, () => {
|
|
272
|
+
this.table.load();
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
else if (option.InputAction === PermissionInputActionEnum.OnClick){
|
|
277
|
+
opt.onClick = (btn) => {
|
|
278
|
+
this.table.optionsActions.find(x => x.name === option.Action).onClick(btn);
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
opts.push(opt);
|
|
282
|
+
}
|
|
283
|
+
return opts;
|
|
284
|
+
// return (this.addChildren !== null && (this.table.level === null || this.table.level > this.level) ? [this.addChildren] : [])
|
|
285
|
+
// .concat(this.table.options.filter(x => x.condition == null ||
|
|
286
|
+
// (x.condition.startsWith('!') ? !this.row.Data[x.condition.substring(1)] : this.row.Data[x.condition])).map((o) => {
|
|
287
|
+
// const i = HelperClass.clone(o);
|
|
288
|
+
// if (i.url){
|
|
289
|
+
// i.url = i.url.replace('{}', this.row.Data.Id);
|
|
290
|
+
// }
|
|
291
|
+
// i.row = this.row.Data;
|
|
292
|
+
// i.class = i.class + ' m-h-5 h-25 d-ib va-m f-u';
|
|
293
|
+
// return i;
|
|
294
|
+
// })).concat(this.table.hasStatus ? [this.optStatus] : [])
|
|
295
|
+
// .concat(this.table.permissions.hasAccess('Update') ? [this.optEdit] : [])
|
|
296
|
+
// .concat(this.table.permissions.hasAccess('Delete') ? [this.optDelete] : []);
|
|
297
|
+
}
|
|
298
|
+
getCell(col: TableCollClass): any{
|
|
299
|
+
console.log('getCell');
|
|
300
|
+
const cv = _.get(this.row.Data, col.name);
|
|
301
|
+
if (col.fun != null) {
|
|
302
|
+
return col.fun(this.row.Data);
|
|
303
|
+
} else if (col.enum !== null) {
|
|
304
|
+
return col.enum.get(cv);
|
|
305
|
+
} else if (col.type === TableCollType.DateDif) {
|
|
306
|
+
return HelperClass.getDateDif(this.table.l, cv);
|
|
307
|
+
} else if (col.type === TableCollType.Date) {
|
|
308
|
+
return HelperClass.getDate(cv);
|
|
309
|
+
} else if (col.type === TableCollType.DateTime) {
|
|
310
|
+
return HelperClass.getDateTime(cv);
|
|
311
|
+
} else if (col.type === TableCollType.Time) {
|
|
312
|
+
return HelperClass.getTime(cv);
|
|
313
|
+
} else if (col.type === TableCollType.Url) {
|
|
314
|
+
return '<a target="_blank" href="' + cv + '">' + cv + '</a>';
|
|
315
|
+
} else if (col.type === TableCollType.Image) {
|
|
316
|
+
return '<img class="h-100" alt="" src="' + this.service.environment.url + cv + '"/>';
|
|
317
|
+
} else if (col.type === TableCollType.Price) {
|
|
318
|
+
return cv.toLocaleString() + ' ' + this.table.l('Rial');
|
|
319
|
+
} else if (col.type === TableCollType.Plaque) {
|
|
320
|
+
const parts = cv.split('_');
|
|
321
|
+
if (parts.length === 4) {
|
|
322
|
+
return '<div class="plaque' + (parts[1] === 'ع' ? ' p' : '') + (parts[1] === 'الف' ? ' g' : '') + '">' +
|
|
323
|
+
'<div class="part1">' + parts[0] + '</div>' +
|
|
324
|
+
'<div class="part2">' + parts[1] + '</div>' +
|
|
325
|
+
'<div class="part3">' + parts[2] + '</div>' +
|
|
326
|
+
'<div class="part4">' + parts[3] + '</div>' +
|
|
327
|
+
'</div>';
|
|
328
|
+
} else if (parts.length === 2){
|
|
329
|
+
return '<div class="plaque plaque-m">' +
|
|
330
|
+
'<div class="part1">' + parts[0] + '</div>' +
|
|
331
|
+
'<div class="part2">' + parts[1] + '</div>' +
|
|
332
|
+
'</div>';
|
|
333
|
+
}
|
|
334
|
+
} else if (col.type === TableCollType.PlaqueText) {
|
|
335
|
+
const parts = cv.split('_');
|
|
336
|
+
if (parts.length === 4){
|
|
337
|
+
return `<div class="ltr">${parts[0]} ${parts[1]}‎ ${parts[2]} ${parts[3]}</div>`;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return this.table.l(cv);
|
|
341
|
+
}
|
|
342
|
+
getCol(n): string{
|
|
343
|
+
let c = this.row.Data;
|
|
344
|
+
n.split('.').forEach((x) => {
|
|
345
|
+
c = c[x];
|
|
346
|
+
});
|
|
347
|
+
return c;
|
|
348
|
+
}
|
|
349
|
+
edit(opt: InputClass): void{
|
|
350
|
+
if (this.table.permissions.Type === PermissionTypeEnum.Form){
|
|
351
|
+
this.table.form.name = opt.name;
|
|
352
|
+
this.table.form.setData(this.row.Data);
|
|
353
|
+
this.table.form.setButtons(this.table.form.onTop, true, this.row.Data.Id);
|
|
354
|
+
this.table.form.inputs.filter(x => x.inEditDisabled).forEach(x => x.disabled = true);
|
|
355
|
+
this.table.form.inputs.filter(x => !x.inEditVisible).forEach(x => x.visible = false);
|
|
356
|
+
}else{
|
|
357
|
+
new RequestClass(this.table.environment, this.table.l).send(this.table.url + 'Get/' + this.row.Data.Id, Method.Post,
|
|
358
|
+
null, opt, (result) => {
|
|
359
|
+
this.table.form.name = opt.name;
|
|
360
|
+
this.table.form.setButtons(this.table.form.onTop, true, this.row.Data.Id);
|
|
361
|
+
this.table.form.setData(result);
|
|
362
|
+
this.table.form.inputs.filter(x => x.inEditDisabled).forEach(x => x.disabled = true);
|
|
363
|
+
this.table.form.inputs.filter(x => !x.inEditVisible).forEach(x => x.visible = false);
|
|
364
|
+
if (this.table.modal){
|
|
365
|
+
this.table.modal.show();
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
getChildren(): any[]{
|
|
371
|
+
return this.row.Data.Id ? this.table.rows.filter(x => x.Data.ParentId === this.row.Data.Id) : [];
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
.table-con {
|
|
2
|
+
float: right;
|
|
3
|
+
width: 100%;
|
|
4
|
+
border-radius: 5px;
|
|
5
|
+
padding: 20px;
|
|
6
|
+
background-color: white;
|
|
7
|
+
position: relative;
|
|
8
|
+
box-shadow: var(--box-shadow-table);
|
|
9
|
+
}
|
|
10
|
+
.table-con.maximum {
|
|
11
|
+
position: fixed;
|
|
12
|
+
right: 0;
|
|
13
|
+
top: 0;
|
|
14
|
+
z-index: 11;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
border-radius: 0;
|
|
19
|
+
}
|
|
20
|
+
.table-con > .title{
|
|
21
|
+
float: right;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 40px;
|
|
24
|
+
line-height: 40px;
|
|
25
|
+
font-family: VazirBold;
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
text-align: right;
|
|
28
|
+
margin-bottom: 10px;
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
.table-con > .title .description{
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
margin-right: 10px;
|
|
34
|
+
font-family: VazirLight;
|
|
35
|
+
vertical-align: middle;
|
|
36
|
+
}
|
|
37
|
+
.table-con > .title .extra-buttons{
|
|
38
|
+
float: left;
|
|
39
|
+
margin-top: 5px;
|
|
40
|
+
}
|
|
41
|
+
.table-con > .title .buttons{
|
|
42
|
+
float: left;
|
|
43
|
+
margin-left: 10px;
|
|
44
|
+
margin-top: 5px;
|
|
45
|
+
}
|
|
46
|
+
.table-con > .search-form {
|
|
47
|
+
float: right;
|
|
48
|
+
width: 100%;
|
|
49
|
+
border-radius: 5px;
|
|
50
|
+
margin-bottom: 5px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.table-con table{
|
|
54
|
+
width: 100%;
|
|
55
|
+
border-spacing: 0 !important;
|
|
56
|
+
}
|
|
57
|
+
.table-con table thead tr{
|
|
58
|
+
position: relative;
|
|
59
|
+
-webkit-user-select: none;
|
|
60
|
+
-moz-user-select: none;
|
|
61
|
+
-khtml-user-select: none;
|
|
62
|
+
-ms-user-select: none;
|
|
63
|
+
}
|
|
64
|
+
.table-con table thead tr th{
|
|
65
|
+
height: 45px;
|
|
66
|
+
font-family: VazirLight;
|
|
67
|
+
font-weight: normal;
|
|
68
|
+
position: relative;
|
|
69
|
+
color: var(--black-88);
|
|
70
|
+
vertical-align: middle;
|
|
71
|
+
font-size: 12px;
|
|
72
|
+
background-color: var(--base-11);
|
|
73
|
+
}
|
|
74
|
+
.table-con table thead tr th:first-child{
|
|
75
|
+
border-top-right-radius: 5px;
|
|
76
|
+
border-bottom-right-radius: 5px;
|
|
77
|
+
}
|
|
78
|
+
.table-con table thead tr th:last-child{
|
|
79
|
+
border-top-left-radius: 5px;
|
|
80
|
+
border-bottom-left-radius: 5px;
|
|
81
|
+
}
|
|
82
|
+
.table-con table thead tr th.sort{
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.table-con table thead tr th .sort-icon {
|
|
87
|
+
position: absolute;
|
|
88
|
+
width: 20px;
|
|
89
|
+
height: 20px;
|
|
90
|
+
line-height: 20px;
|
|
91
|
+
top: calc(50% - 10px);
|
|
92
|
+
left: 5px;
|
|
93
|
+
font-size: 13px;
|
|
94
|
+
opacity: 0.6;
|
|
95
|
+
}
|
|
96
|
+
.table-con table tbody{
|
|
97
|
+
position: relative;
|
|
98
|
+
}
|
|
99
|
+
.table-con table tfoot tr{
|
|
100
|
+
height: 45px;
|
|
101
|
+
}
|
|
102
|
+
.table-con table tfoot tr td {
|
|
103
|
+
position: relative;
|
|
104
|
+
vertical-align: bottom;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
::ng-deep .table-con:not(.sortable) table lib-table-row:last-of-type > tr:after{
|
|
108
|
+
background-image: unset;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
::ng-deep .table-con table thead tr th .select-row{
|
|
112
|
+
font-size: 18px;
|
|
113
|
+
height: 30px;
|
|
114
|
+
line-height: 30px;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<div [id]="table.id + 'Table'" [style]="table.style" #tableDiv [className]="(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + ' table-con'">
|
|
2
|
+
<div *ngIf="table.displayLabel" class="title">
|
|
3
|
+
{{this.table.title ? this.table.title : 'List'}}
|
|
4
|
+
<span class="description" *ngIf="this.table.description != null" [innerHTML]="'( ' + this.table.description + ' )'"></span>
|
|
5
|
+
<div class="extra-buttons" *ngIf="table.showExtraButtons">
|
|
6
|
+
<lib-form-icon *ngFor="let btn of table.extraButtons" [inp]="btn"></lib-form-icon>
|
|
7
|
+
<lib-form-icon [inp]="reload"></lib-form-icon>
|
|
8
|
+
<lib-form-icon [inp]="maximum"></lib-form-icon>
|
|
9
|
+
</div>
|
|
10
|
+
<div *ngIf="table.buttons.length > 0" class="buttons">
|
|
11
|
+
<lib-form-button [inp]="btn" *ngFor="let btn of table.buttons"></lib-form-button>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="search-form" *ngIf="table.searchForm">
|
|
15
|
+
<lib-form [form]="table.searchForm"></lib-form>
|
|
16
|
+
</div>
|
|
17
|
+
<lib-form *ngIf="table.form && table.form.onTop" [form]="table.form"></lib-form>
|
|
18
|
+
<table>
|
|
19
|
+
<thead>
|
|
20
|
+
<tr>
|
|
21
|
+
<th *ngIf="table.hasChildren" style="width: 50px"></th>
|
|
22
|
+
<th *ngIf="table.sortable" style="width: 50px"></th>
|
|
23
|
+
<th *ngIf="table.withSelect" style="width: 50px">
|
|
24
|
+
<i (click)="selectAll()" [className]="(allSelected() ? 'fas fa-check-square green' : isSelected() ? 'fas fa-minus-square green' : 'far fa-square') + ' select-row'" *ngIf="table.rows.length > 0"></i>
|
|
25
|
+
</th>
|
|
26
|
+
<th (click)="!table.sortable && col.sort && changeSort($event, col.name)" [className]="(!table.sortable && col.sort ? 'sort' : '')" *ngFor="let col of table.cols" [style]="{width: col.percent + '%'}">
|
|
27
|
+
<i *ngIf="!table.sortable && col.sort" [className]="'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')"></i>
|
|
28
|
+
<span *ngIf="col.search == null">{{ table.l(col.name) }}</span>
|
|
29
|
+
<div class="w-90 header-search p-h-20 m-r-5" *ngIf="!table.sortable && col.search != null">
|
|
30
|
+
<lib-form-textbox *ngIf="col.type != colType.Date" [inp]="col.search"></lib-form-textbox>
|
|
31
|
+
<lib-form-date *ngIf="col.type == colType.Date" [inp]="col.search"></lib-form-date>
|
|
32
|
+
</div>
|
|
33
|
+
</th>
|
|
34
|
+
<th *ngIf="table.optionType == tableOptionType.Show" [style]="{width: (100 - itemsWidth) + '%'}">{{table.l('Options')}}</th>
|
|
35
|
+
<!-- <th *ngIf="table.hasOption()" [style]="{width: (100 - itemsWidth) + '%'}">-->
|
|
36
|
+
<!-- <span *ngIf="!table.withSelect || !isSelected()">{{ table.l('Options') }}</span>-->
|
|
37
|
+
<!-- <span *ngIf="table.withSelect && isSelected()" class="option-con">-->
|
|
38
|
+
<!-- <span *ngFor="let opt of options">-->
|
|
39
|
+
<!-- <lib-form-button *ngIf="opt.type == type.Button" [inp]="opt"></lib-form-button>-->
|
|
40
|
+
<!-- <lib-form-icon *ngIf="opt.type == type.Icon" [inp]="opt"></lib-form-icon>-->
|
|
41
|
+
<!-- </span>-->
|
|
42
|
+
<!-- </span>-->
|
|
43
|
+
<!-- </th>-->
|
|
44
|
+
</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody #rows [style]="table.perPage > 0 ? {height: table.height * table.perPage + 'px'} : table.loading || !table.permission || table.rows.length == 0 ? {height: '100px'} : {}">
|
|
47
|
+
<lib-table-row (confirmShow)="onConfirmShow($event)" [level]="1" (changeRows)="onChangeRows($event)" [id]="row.id ? row.id : ''" [table]="table" [row]="row" *ngFor="let row of getRows()"></lib-table-row>
|
|
48
|
+
<tr *ngIf="table.perPage > 0" [style]="{height: (table.perPage > 0 ? (table.perPage - table.rows.length) * table.height : '100') + 'px', visibility: 'hidden'}"></tr>
|
|
49
|
+
<lib-table-loading [table]="table"></lib-table-loading>
|
|
50
|
+
</tbody>
|
|
51
|
+
<tfoot>
|
|
52
|
+
<tr>
|
|
53
|
+
<td colspan="100%">
|
|
54
|
+
<lib-table-pagination [table]="table" *ngIf="table.perPage > 0"></lib-table-pagination>
|
|
55
|
+
</td>
|
|
56
|
+
</tr>
|
|
57
|
+
</tfoot>
|
|
58
|
+
</table>
|
|
59
|
+
<lib-modal *ngIf="table.modal != null" [modal]="table.modal"></lib-modal>
|
|
60
|
+
<lib-modal [modal]="opt" *ngFor="let opt of getModals()"></lib-modal>
|
|
61
|
+
<lib-confirm #confirm [tableId]="table.name"></lib-confirm>
|
|
62
|
+
</div>
|