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,59 @@
|
|
|
1
|
+
.option-con {
|
|
2
|
+
float: right;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.option-con .caret-icon{
|
|
6
|
+
float: right;
|
|
7
|
+
width: 35px;
|
|
8
|
+
height: 35px;
|
|
9
|
+
line-height: 33px;
|
|
10
|
+
text-align: center;
|
|
11
|
+
font-size: 20px;
|
|
12
|
+
}
|
|
13
|
+
.option-con .children{
|
|
14
|
+
float: left;
|
|
15
|
+
width: calc(100% - 35px);
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
.option {
|
|
19
|
+
float: left;
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-height: 30px;
|
|
22
|
+
text-align: center;
|
|
23
|
+
font-size: 10px;
|
|
24
|
+
border-radius: 0;
|
|
25
|
+
position: relative;
|
|
26
|
+
line-height: 15px;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
display: flex;
|
|
30
|
+
padding: 3px 10px;
|
|
31
|
+
}
|
|
32
|
+
.option .check:after {
|
|
33
|
+
content: "\f0c8";
|
|
34
|
+
position: absolute;
|
|
35
|
+
font-family: "Font Awesome 5 Pro";
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
width: 20px;
|
|
38
|
+
height: 20px;
|
|
39
|
+
line-height: 20px;
|
|
40
|
+
right: 5px;
|
|
41
|
+
top: 5px;
|
|
42
|
+
font-size: 18px;
|
|
43
|
+
}
|
|
44
|
+
.option .check.checked:after {
|
|
45
|
+
content: "\f14a";
|
|
46
|
+
color: var(--green);
|
|
47
|
+
font-weight: 900;
|
|
48
|
+
animation: pop 180ms ease-in;
|
|
49
|
+
}
|
|
50
|
+
.option .check.null:after {
|
|
51
|
+
content: "\f146";
|
|
52
|
+
color: var(--green);
|
|
53
|
+
font-weight: 900;
|
|
54
|
+
animation: pop 180ms ease-in;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.option-con.selected > .option, .option-con.hover > .option{
|
|
58
|
+
background-color: var(--black-33);
|
|
59
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div [className]="'option-con' + (item.value == select.value ? ' selected' : '') + (item.index == select.hover ? ' hover' : '')" *ngIf="item.show">
|
|
2
|
+
<!-- <i class="fas fa-caret-left caret-icon" (click)="toggleChildren($event)" *ngIf="item.options.length > 0"></i>-->
|
|
3
|
+
<div (mousemove)="hoverOption(item)" (click)="selectOption.emit(item.value)" class="option">
|
|
4
|
+
<div [className]="(item.selected ? 'checked ' : item.selected == null ? 'null ' : '') + ' check'" *ngIf="select.multiple"></div>
|
|
5
|
+
<span [innerHTML]="select.l(item.name)"></span>
|
|
6
|
+
</div>
|
|
7
|
+
<div *ngIf="item.options.length > 0 && (select.level === null || select.level > index)" class="children rightline">
|
|
8
|
+
<lib-form-select-item (selectOption)="selectOption.emit($event)" [index]="index + 1" [parent]="item" [item]="op" [select]="select" *ngFor="let op of item.options"></lib-form-select-item>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
|
2
|
+
import * as $ from 'jquery';
|
|
3
|
+
import {InputClass, OptionClass} from '../../../../classes/form.class';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'lib-form-select-item',
|
|
7
|
+
templateUrl: './form.select.item.component.html',
|
|
8
|
+
styleUrls: ['./form.select.item.component.css']
|
|
9
|
+
})
|
|
10
|
+
export class FormSelectItemComponent implements OnInit{
|
|
11
|
+
@Output()
|
|
12
|
+
selectOption = new EventEmitter<string>();
|
|
13
|
+
@Input()
|
|
14
|
+
select: InputClass;
|
|
15
|
+
@Input()
|
|
16
|
+
item: OptionClass;
|
|
17
|
+
@Input()
|
|
18
|
+
parent: OptionClass = null;
|
|
19
|
+
@Input()
|
|
20
|
+
index: number;
|
|
21
|
+
ngOnInit(): void{
|
|
22
|
+
this.item.parent = this.parent;
|
|
23
|
+
}
|
|
24
|
+
hoverOption(opt: OptionClass): void{
|
|
25
|
+
this.select.hover = opt.index;
|
|
26
|
+
}
|
|
27
|
+
toggleChildren(e): void{
|
|
28
|
+
const ch = $(e.target).closest('.option-con').find(' > .children');
|
|
29
|
+
const oc = $(e.target).closest('.option-con').find(' > .caret-icon');
|
|
30
|
+
if (ch.hasClass('open')) {
|
|
31
|
+
ch.removeClass('open');
|
|
32
|
+
ch.slideUp();
|
|
33
|
+
oc.removeClass('fa-caret-down').addClass('fa-caret-left');
|
|
34
|
+
} else {
|
|
35
|
+
ch.addClass('open');
|
|
36
|
+
ch.slideDown();
|
|
37
|
+
oc.addClass('fa-caret-down').removeClass('fa-caret-left');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.form-input-con.table{
|
|
2
|
+
position: relative;
|
|
3
|
+
float: right;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 0 15px;
|
|
6
|
+
}
|
|
7
|
+
.form-input-con.table .form-input {
|
|
8
|
+
position: relative;
|
|
9
|
+
float: right;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.form-input-con.table .form-input .label {
|
|
14
|
+
float: right;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 20px;
|
|
17
|
+
line-height: 20px;
|
|
18
|
+
padding: 0 10px;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
margin-bottom: 3px;
|
|
21
|
+
cursor: default;
|
|
22
|
+
-webkit-user-select: none;
|
|
23
|
+
-moz-user-select: none;
|
|
24
|
+
-khtml-user-select: none;
|
|
25
|
+
-ms-user-select: none;
|
|
26
|
+
direction: rtl;
|
|
27
|
+
text-align: right;
|
|
28
|
+
}
|
|
29
|
+
.form-input-con.table.error .form-input .label {
|
|
30
|
+
font-size: 10px;
|
|
31
|
+
color: var(--red);
|
|
32
|
+
}
|
|
33
|
+
.form-input-con.table .form-input .label .required-icon{
|
|
34
|
+
height: 20px;
|
|
35
|
+
width: 20px;
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
font-size: 9px;
|
|
38
|
+
color: var(--red);
|
|
39
|
+
text-align: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.form-input-con.table .form-input .control {
|
|
43
|
+
float: right;
|
|
44
|
+
width: 100%;
|
|
45
|
+
border-radius: 5px;
|
|
46
|
+
border: var(--border-input);
|
|
47
|
+
}
|
|
48
|
+
.form-input-con.table.error .form-input .control {
|
|
49
|
+
border: var(--border-input-red);
|
|
50
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<div #inputDiv [id]="inp.name + 'Input'" [style]="inp.style" [className]="inp.class + ' form-input-con table' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '')">
|
|
2
|
+
<div class="form-input">
|
|
3
|
+
<div *ngIf="inp.displayLabel" class="label"><i *ngIf="inp.required" class="fas fa-star-of-life required-icon"></i>{{inp.getLabel()}}</div>
|
|
4
|
+
<div class="control">
|
|
5
|
+
<lib-table (changeRows)="changeRows($event)" [table]="inp.table"></lib-table>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
|
2
|
+
import {InputClass} from '../../../classes/form.class';
|
|
3
|
+
import {PermissionClass} from '../../../classes/permission.class';
|
|
4
|
+
import {InputError, InputType, PermissionTypeEnum} from '../../../classes/enum.class';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'lib-form-table',
|
|
8
|
+
templateUrl: './form.table.component.html',
|
|
9
|
+
styleUrls: ['./form.table.component.css']
|
|
10
|
+
})
|
|
11
|
+
export class FormTableComponent implements OnInit{
|
|
12
|
+
@Input()
|
|
13
|
+
inp: InputClass;
|
|
14
|
+
@Output()
|
|
15
|
+
changeIndex = new EventEmitter<string>();
|
|
16
|
+
constructor(){
|
|
17
|
+
}
|
|
18
|
+
ngOnInit(): void{
|
|
19
|
+
const p = new PermissionClass();
|
|
20
|
+
p.Type = PermissionTypeEnum.Form;
|
|
21
|
+
const lAccess = new PermissionClass();
|
|
22
|
+
lAccess.Action = 'List';
|
|
23
|
+
const iAccess = new PermissionClass();
|
|
24
|
+
iAccess.Action = 'Insert';
|
|
25
|
+
const uAccess = new PermissionClass();
|
|
26
|
+
uAccess.Action = 'Update';
|
|
27
|
+
const dAccess = new PermissionClass();
|
|
28
|
+
dAccess.Action = 'Delete';
|
|
29
|
+
p.Accesses = [
|
|
30
|
+
lAccess,
|
|
31
|
+
iAccess,
|
|
32
|
+
uAccess,
|
|
33
|
+
dAccess
|
|
34
|
+
];
|
|
35
|
+
this.inp.table.displayLabel = false;
|
|
36
|
+
this.inp.table.style = {padding: 0, boxShadow: 'unset'};
|
|
37
|
+
this.inp.table.permissions = p;
|
|
38
|
+
this.inp.table.showExtraButtons = false;
|
|
39
|
+
this.inp.table.cols.forEach(x => x.sort = false);
|
|
40
|
+
if (this.inp.table.form){
|
|
41
|
+
this.inp.table.form.onTop = true;
|
|
42
|
+
this.inp.table.form.inputs.push(new InputClass(this.inp.environment, this.inp.l, 'Id', null, InputType.Hidden, '', null, false));
|
|
43
|
+
this.inp.table.form.inputs.forEach(x => {
|
|
44
|
+
x.displayLabel = false;
|
|
45
|
+
x.class += ' h-30';
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
this.inp.setValue = (v) => {
|
|
49
|
+
this.inp.table.rows = v === null ? [] : v;
|
|
50
|
+
};
|
|
51
|
+
this.inp.focus = () => {
|
|
52
|
+
if (this.inp.table.form){
|
|
53
|
+
this.inp.table.form.inputs.find(_ => true).focus();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
this.inp.isValid = () => {
|
|
57
|
+
this.inp.error = null;
|
|
58
|
+
if (this.inp.required && this.inp.table.rows.length === 0) {
|
|
59
|
+
this.inp.error = InputError.Required;
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (!this.inp.required && this.inp.table.rows.length === 0) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (this.inp.required && this.inp.minLength !== -1 && this.inp.minLength === this.inp.maxLength &&
|
|
66
|
+
this.inp.table.rows.length !== this.inp.minLength) {
|
|
67
|
+
this.inp.error = InputError.Length;
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if (this.inp.required && this.inp.minLength !== -1 && this.inp.table.rows.length < this.inp.minLength) {
|
|
71
|
+
this.inp.error = InputError.MinLength;
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (this.inp.required && this.inp.maxLength !== -1 && this.inp.table.rows.length > this.inp.maxLength) {
|
|
75
|
+
this.inp.error = InputError.MaxLength;
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
return true;
|
|
79
|
+
};
|
|
80
|
+
this.inp.clear = () => {
|
|
81
|
+
this.inp.error = null;
|
|
82
|
+
this.inp.setValue(this.inp.default === null ? [] : this.inp.default, false);
|
|
83
|
+
};
|
|
84
|
+
this.inp.data = () => {
|
|
85
|
+
return this.inp.table.rows;
|
|
86
|
+
};
|
|
87
|
+
if (this.inp.default){
|
|
88
|
+
this.inp.setValue(this.inp.default, false);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
changeRows(e): void{
|
|
92
|
+
this.inp.error = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
.form-input-con.textarea {
|
|
2
|
+
position: relative;
|
|
3
|
+
float: right;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 0 15px;
|
|
6
|
+
}
|
|
7
|
+
.form-input-con.textarea .form-input {
|
|
8
|
+
position: relative;
|
|
9
|
+
float: right;
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
.form-input-con.textarea .form-input .label {
|
|
13
|
+
float: right;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 20px;
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
padding: 0 10px;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
margin-bottom: 3px;
|
|
20
|
+
cursor: default;
|
|
21
|
+
-webkit-user-select: none;
|
|
22
|
+
-moz-user-select: none;
|
|
23
|
+
-khtml-user-select: none;
|
|
24
|
+
-ms-user-select: none;
|
|
25
|
+
direction: rtl;
|
|
26
|
+
text-align: right;
|
|
27
|
+
}
|
|
28
|
+
.form-input-con.textarea.error .form-input .label {
|
|
29
|
+
font-size: 10px;
|
|
30
|
+
color: var(--red);
|
|
31
|
+
}
|
|
32
|
+
.form-input-con.textarea .form-input .label .required-icon{
|
|
33
|
+
height: 20px;
|
|
34
|
+
width: 20px;
|
|
35
|
+
line-height: 20px;
|
|
36
|
+
font-size: 9px;
|
|
37
|
+
color: var(--red);
|
|
38
|
+
text-align: center;
|
|
39
|
+
}
|
|
40
|
+
.form-input-con.textarea .form-input .control {
|
|
41
|
+
display: block;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 80px;
|
|
44
|
+
padding: 10px 35px;
|
|
45
|
+
font-family: Vazir;
|
|
46
|
+
color: var(--black);
|
|
47
|
+
background-image: none;
|
|
48
|
+
border: none;
|
|
49
|
+
border-radius: 5px;
|
|
50
|
+
text-align: center;
|
|
51
|
+
resize: none;
|
|
52
|
+
font-size: 11px;
|
|
53
|
+
margin: 0;
|
|
54
|
+
border: var(--border-input);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.form-input-con.textarea .form-input .control:hover, .form-input-con.textarea .form-input .control:focus {
|
|
58
|
+
border: var(--border-input-dark);
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.form-input-con.textarea .form-input i.icon {
|
|
63
|
+
position: absolute;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
color: var(--comp);
|
|
66
|
+
cursor: text;
|
|
67
|
+
top: 0;
|
|
68
|
+
z-index: 1;
|
|
69
|
+
-webkit-transition: all .35s ease-in-out;
|
|
70
|
+
transition: all .35s ease-in-out;
|
|
71
|
+
width: 35px;
|
|
72
|
+
text-align: center;
|
|
73
|
+
height: 35px;
|
|
74
|
+
line-height: 35px;
|
|
75
|
+
left: 0;
|
|
76
|
+
}
|
|
77
|
+
.form-input-con.textarea .form-input i.clear-icon {
|
|
78
|
+
position: absolute;
|
|
79
|
+
font-size: 14px;
|
|
80
|
+
color: var(--red);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
top: 0;
|
|
83
|
+
z-index: 3;
|
|
84
|
+
-webkit-transition: all .35s ease-in-out;
|
|
85
|
+
transition: all .35s ease-in-out;
|
|
86
|
+
width: 35px;
|
|
87
|
+
text-align: center;
|
|
88
|
+
height: 35px;
|
|
89
|
+
line-height: 38px;
|
|
90
|
+
right: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.form-input-con.textarea.error .form-input .control {
|
|
94
|
+
border: var(--border-input-red);
|
|
95
|
+
}
|
|
96
|
+
.form-input-con.textarea.error .form-input .control:hover, .form-input-con.textarea.error .form-input .control:focus {
|
|
97
|
+
border: var(--border-input-red-dark);
|
|
98
|
+
}
|
|
99
|
+
.form-input-con.textarea.error .form-input .control, .form-input-con.textarea.error .form-input i.icon {
|
|
100
|
+
color: var(--red-cc);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.form-input-con.textarea.h-50 .form-input, .form-input-con.textarea.h-50 .form-input .control{
|
|
104
|
+
height: 50px;
|
|
105
|
+
}
|
|
106
|
+
.form-input-con.textarea.h-50 .form-input i.icon{
|
|
107
|
+
height: 50px;
|
|
108
|
+
line-height: 50px;
|
|
109
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<div #inputDiv [id]="inp.name + 'Input'" [className]="inp.class + ' form-input-con textarea' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '')">
|
|
2
|
+
<div class="form-input" (click)="onFocusIn()">
|
|
3
|
+
<div *ngIf="inp.displayLabel" class="label"><i *ngIf="inp.required" class="fas fa-star-of-life required-icon"></i>{{inp.getLabel()}}</div>
|
|
4
|
+
<div class="w-100 p-r">
|
|
5
|
+
<textarea (keydown)="onKeyDown($event)" [disabled]="inp.disabled" [(ngModel)]="inp.value" [placeholder]="inp.l(inp.name)" #inputBase [name]="inp.name" class="control" autocomplete="off" [maxLength]="inp.maxLength > 0 ? inp.maxLength : 524288"></textarea>
|
|
6
|
+
<i *ngIf="inp.icon != null || inp.loading" #inputIcon [className]="(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'"></i>
|
|
7
|
+
<i *ngIf="inp.withClear && inp.value" (click)="inp.clear()" class="fa-duotone fa-eraser clear-icon"></i>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {Component, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, ViewChild} from '@angular/core';
|
|
2
|
+
import {InputClass} from '../../../classes/form.class';
|
|
3
|
+
import {InputError} from '../../../classes/enum.class';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'lib-form-textarea',
|
|
7
|
+
templateUrl: './form.textarea.component.html',
|
|
8
|
+
styleUrls: ['./form.textarea.component.css']
|
|
9
|
+
})
|
|
10
|
+
export class FormTextareaComponent implements OnInit{
|
|
11
|
+
@Input()
|
|
12
|
+
inp: InputClass;
|
|
13
|
+
@Output()
|
|
14
|
+
changeIndex = new EventEmitter<string>();
|
|
15
|
+
@ViewChild('inputBase') inputBase: ElementRef;
|
|
16
|
+
@ViewChild('inputDiv') inputDiv: ElementRef;
|
|
17
|
+
@ViewChild('inputLabel') inputLabel: ElementRef;
|
|
18
|
+
constructor(){
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
ngOnInit(): void {
|
|
22
|
+
this.inp.setValue = (v) => {
|
|
23
|
+
this.inp.value = v;
|
|
24
|
+
};
|
|
25
|
+
this.inp.isValid = () => {
|
|
26
|
+
this.inp.error = null;
|
|
27
|
+
if (this.inp.required && !this.inp.value) {
|
|
28
|
+
this.inp.error = InputError.Required;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (!this.inp.required && !this.inp.value) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (this.inp.required && this.inp.minLength !== -1 &&
|
|
35
|
+
this.inp.minLength === this.inp.maxLength &&
|
|
36
|
+
this.inp.value.length !== this.inp.minLength) {
|
|
37
|
+
this.inp.error = InputError.Length;
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (this.inp.required &&
|
|
41
|
+
this.inp.minLength !== -1 &&
|
|
42
|
+
this.inp.value.length < this.inp.minLength) {
|
|
43
|
+
this.inp.error = InputError.MinLength;
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (this.inp.required &&
|
|
47
|
+
this.inp.maxLength !== -1 &&
|
|
48
|
+
this.inp.value.length > this.inp.maxLength) {
|
|
49
|
+
this.inp.error = InputError.MaxLength;
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
54
|
+
this.inp.clear = () => {
|
|
55
|
+
this.inp.error = null;
|
|
56
|
+
this.inp.value = this.inp.default;
|
|
57
|
+
};
|
|
58
|
+
this.inp.data = () => {
|
|
59
|
+
return this.inp.value;
|
|
60
|
+
};
|
|
61
|
+
this.inp.focus = () => {
|
|
62
|
+
this.onFocusIn();
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
onFocusIn(): void{
|
|
66
|
+
this.inputBase.nativeElement.focus();
|
|
67
|
+
}
|
|
68
|
+
onKeyDown(e): void{
|
|
69
|
+
this.inp.error = null;
|
|
70
|
+
const code = e.keyCode || e.which;
|
|
71
|
+
if (code === 9) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
this.changeIndex.emit(e.shiftKey ? 'ShiftTab' : 'Tab');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|