ps-toolkit-ui 1.19.67 → 1.19.70
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/bundles/ps-toolkit-ui.umd.js +402 -7
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/classes/form.class.js +22 -1
- package/esm2015/lib/classes/helper.class.js +3 -1
- package/esm2015/lib/classes/lang.class.js +25 -1
- package/esm2015/lib/components/table/row/table.row.component.js +97 -3
- package/esm2015/lib/components/table/table.component.js +2 -2
- package/fesm2015/ps-toolkit-ui.js +387 -3
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/package.json +5 -4
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Inject, Component, Input, Injectable, EventEmitter, Output, ViewChild, HostListener, Pipe, NgModule } from '@angular/core';
|
|
2
2
|
import * as $$1 from 'jquery';
|
|
3
3
|
import { ajax, param } from 'jquery';
|
|
4
|
+
import { merge, get, groupBy, set, cloneDeep } from 'lodash';
|
|
4
5
|
import * as moment from 'jalali-moment';
|
|
5
6
|
import { now } from 'jalali-moment';
|
|
6
7
|
import { NavigationEnd, Router, RouterModule } from '@angular/router';
|
|
@@ -73,14 +74,283 @@ AccordionComponent.propDecorators = {
|
|
|
73
74
|
accordion: [{ type: Input }]
|
|
74
75
|
};
|
|
75
76
|
|
|
77
|
+
const strings = {
|
|
78
|
+
fa: {
|
|
79
|
+
Public: {
|
|
80
|
+
Header: {
|
|
81
|
+
Logout: 'خروج'
|
|
82
|
+
},
|
|
83
|
+
Login: {
|
|
84
|
+
ReSendCodeDes: '<span class="c-secondary c-p">ارسال مجدد</span>',
|
|
85
|
+
ReSendCodeRemain: '<div class="ltr d-ib va-m"><div class="t-c d-ib w-20-p f-l">{}</div><div class="t-c d-ib w-5-p f-l">:</div><div class="t-c d-ib w-20-p f-l">{}</div></div><div class="d-ib va-m">مانده تا دریافت مجدد کد</div>',
|
|
86
|
+
Code: 'کد تایید',
|
|
87
|
+
Base: 'نام سایت',
|
|
88
|
+
BaseDesc: 'توضیحات سایت',
|
|
89
|
+
SendCode: 'ورود',
|
|
90
|
+
SendCodeSubTitle: 'برای ورود شماره همراه خود را وارد کنید',
|
|
91
|
+
LoginSms: 'تایید شماره همراه',
|
|
92
|
+
LoginSmsSubTitle: 'کد ارسال شده به شماره همراه {} را وارد کنید',
|
|
93
|
+
LoginPassword: 'ورود',
|
|
94
|
+
LoginPasswordSubTitle: 'برای ورود نام کاربری و کلمه عبور خود را وارد کنید',
|
|
95
|
+
Register: 'ثبت کد تایید نرم افزار',
|
|
96
|
+
DeviceId: 'کد نرم افزار: {}',
|
|
97
|
+
Copy: 'کپی',
|
|
98
|
+
RulesLabel: 'ورود شما به معنای پذیرش <span class="c-p c-blue">شرایط و قوانین حریمخصوصی</span> است',
|
|
99
|
+
RulesTitle: 'شرایط و قوانین حریمخصوصی'
|
|
100
|
+
},
|
|
101
|
+
Footer: {
|
|
102
|
+
Copyright: 'تمامی حقوق برای {} محفوظ است.',
|
|
103
|
+
CreatorDesc: 'طراحی و توسعه',
|
|
104
|
+
CreatorCom: 'پارت سیلیکون'
|
|
105
|
+
},
|
|
106
|
+
App: {
|
|
107
|
+
Notfound: 'صفحه مورد نظر یافت نشد',
|
|
108
|
+
Error: 'خطا در سیستم',
|
|
109
|
+
},
|
|
110
|
+
Notfound: {
|
|
111
|
+
Text: 'متاسفانه صفحه مورد نظر شما یافت نشد',
|
|
112
|
+
Back: 'بازگشت'
|
|
113
|
+
},
|
|
114
|
+
Version: 'نسخه {}',
|
|
115
|
+
Download: 'دریافت فایل',
|
|
116
|
+
ShowOptions: 'نمایش امکانات',
|
|
117
|
+
IranCode: 'ایران کد',
|
|
118
|
+
TrackingCode: 'کد رهگیری',
|
|
119
|
+
Plaque: 'پلاک',
|
|
120
|
+
DriverName: 'نام راننده',
|
|
121
|
+
Name: 'نام',
|
|
122
|
+
ProvinceId: 'استان',
|
|
123
|
+
CityId: 'شهر',
|
|
124
|
+
PostalCode: 'کدپستی',
|
|
125
|
+
Title: 'عنوان',
|
|
126
|
+
Text: 'متن',
|
|
127
|
+
Date: 'تاریخ',
|
|
128
|
+
Time: 'زمان',
|
|
129
|
+
Row: 'ردیف',
|
|
130
|
+
LoginTitle: 'ورود',
|
|
131
|
+
SendCode: 'ارسال کد',
|
|
132
|
+
Username: 'نام کاربری',
|
|
133
|
+
GetReport: 'چاپ',
|
|
134
|
+
Count: 'تعداد',
|
|
135
|
+
Choose: 'انتخاب',
|
|
136
|
+
Payable: 'مبلغ قابل پرداخت : {} ریال</br><span class="f-s-20">تایید و انتقال به درگاه پرداخت</span>',
|
|
137
|
+
PayableLoading: '<span class="l-h-60">تایید و انتقال به درگاه پرداخت</span>',
|
|
138
|
+
Processing: 'پردازش',
|
|
139
|
+
PDate: 'تاریخ',
|
|
140
|
+
SeeMore: 'نمایش بیشتر ...',
|
|
141
|
+
Alert: 'هشدار',
|
|
142
|
+
AccessDenied: 'عدم دسترسی',
|
|
143
|
+
Image: 'تصویر',
|
|
144
|
+
ImageFile: 'تصویر',
|
|
145
|
+
Grade: 'پایه تحصیلی',
|
|
146
|
+
Close: 'بستن',
|
|
147
|
+
Url: 'آدرس',
|
|
148
|
+
Type: 'نوع',
|
|
149
|
+
Desc: 'توضیحات',
|
|
150
|
+
Admin: 'ادمین',
|
|
151
|
+
Print: 'گزارش',
|
|
152
|
+
Password: 'کلمه عبور',
|
|
153
|
+
RePassword: 'تکرار کلمه عبور',
|
|
154
|
+
PassportLetter: 'حرف',
|
|
155
|
+
Passport: 'گذرنامه',
|
|
156
|
+
List: 'لیست',
|
|
157
|
+
Priority: 'اولویت',
|
|
158
|
+
PassportImage: 'تصویر گذرنامه',
|
|
159
|
+
PassportExpireDate: 'تاریخ انقضاء گذرنامه',
|
|
160
|
+
PassportPlace: 'محل صدور گذرنامه',
|
|
161
|
+
NationalCode: 'کدملی',
|
|
162
|
+
LicenseNum: 'شماره گواهی نامه',
|
|
163
|
+
BankCard: 'شماره کارت بانکی',
|
|
164
|
+
VehicleType: 'نوع وسیله نقلیه',
|
|
165
|
+
Gender: 'جنسیت',
|
|
166
|
+
Male: 'مرد',
|
|
167
|
+
FeMale: 'زن',
|
|
168
|
+
Accept: 'تایید',
|
|
169
|
+
Insert: 'افزودن',
|
|
170
|
+
Update: 'ویرایش',
|
|
171
|
+
Delete: 'حذف',
|
|
172
|
+
Subset: 'زیرمجموعه',
|
|
173
|
+
Other: 'سایر',
|
|
174
|
+
Rial: 'ریال',
|
|
175
|
+
ChooseMonth: 'انتخاب ماه',
|
|
176
|
+
FullName: 'نام کامل',
|
|
177
|
+
FirstName: 'نام',
|
|
178
|
+
Backup: 'بک آپ',
|
|
179
|
+
LastName: 'نام خانوادگی',
|
|
180
|
+
OperationSuccessful: 'عملیات با موفقیت انجام شد',
|
|
181
|
+
Reject: 'رد کردن',
|
|
182
|
+
Code: 'کد تایید',
|
|
183
|
+
InvalidRequest: 'درخواست شما نامعتبر است',
|
|
184
|
+
ChangeNotAllow: 'امکان ایجاد تغییرات وجود ندارد',
|
|
185
|
+
Confirm: 'تاییدیه',
|
|
186
|
+
Search: 'جستجو',
|
|
187
|
+
Yes: 'بله',
|
|
188
|
+
No: 'خیر',
|
|
189
|
+
Email: 'پست الکترونیک',
|
|
190
|
+
Mobile: 'شماره همراه',
|
|
191
|
+
Mobile2: 'شماره همراه 2',
|
|
192
|
+
Phone: 'شماره تلفن',
|
|
193
|
+
Address: 'آدرس',
|
|
194
|
+
Add: 'افزودن',
|
|
195
|
+
Edit: 'ویرایش',
|
|
196
|
+
VerifyCode: 'تایید کد',
|
|
197
|
+
Status: 'وضعیت',
|
|
198
|
+
Show: 'نمایش',
|
|
199
|
+
Step: 'وضعیت',
|
|
200
|
+
Pending: 'در حال بررسی',
|
|
201
|
+
Accepted: 'تایید شده',
|
|
202
|
+
Canceled: 'انصراف',
|
|
203
|
+
Rejected: 'رد شده : {}',
|
|
204
|
+
Answered: 'پاسخ داده شده',
|
|
205
|
+
FromDate: 'از تاریخ',
|
|
206
|
+
ToDate: 'تا تاریخ',
|
|
207
|
+
Package: 'اشتراک',
|
|
208
|
+
CodeInvalid: 'کد تایید نامعتبر است',
|
|
209
|
+
CodeExpired: 'کد تایید منقضی شده است',
|
|
210
|
+
Price: 'قیمت',
|
|
211
|
+
Description: 'توضیحات',
|
|
212
|
+
Photo: 'تصویر',
|
|
213
|
+
Select: 'انتخاب',
|
|
214
|
+
NextStep: 'مرحله بعد',
|
|
215
|
+
PreviousStep: 'مرحله قبل',
|
|
216
|
+
UploadFiles: 'بارگذاری مدارک',
|
|
217
|
+
NamadTitle: 'نماد',
|
|
218
|
+
Options: 'امکانات',
|
|
219
|
+
Process: 'پردازش',
|
|
220
|
+
NotfoundTitle: 'موردی یافت نشد',
|
|
221
|
+
PermissionDenied: 'عدم دسترسی',
|
|
222
|
+
PerPage: 'تعداد نمایش در هر صفحه',
|
|
223
|
+
Save: 'ذخیره',
|
|
224
|
+
Cancel: 'انصراف',
|
|
225
|
+
UserDeActive: 'نام کاربری غیر فعال شده است',
|
|
226
|
+
DeleteConfirm: 'آیا از حذف این مورد مطمئن هستید ؟',
|
|
227
|
+
DeleteConfirmMulti: 'آیا از حذف موارد انتخاب شده ({} مورد) مطمئن هستید ؟',
|
|
228
|
+
ChooseFiles: 'انتخاب فایل ها',
|
|
229
|
+
CodeNotExpired: 'کد تایید ارسال شده منقضی نشده است',
|
|
230
|
+
ChooseFile: 'انتخاب فایل',
|
|
231
|
+
FileNotSelected: 'فایلی انتخاب نشده است',
|
|
232
|
+
FileSelected: '{} فایل انتخاب شده ({})',
|
|
233
|
+
Selected: 'انتخاب شده',
|
|
234
|
+
Limit: 'محدودیت',
|
|
235
|
+
Today: 'امروز : {}',
|
|
236
|
+
SendCodeLimit: 'محدودیت در ارسال کد',
|
|
237
|
+
SendCodeError: 'خطا در ارسال کد',
|
|
238
|
+
CodeNotFound: 'کد تایید ارسال نشده است',
|
|
239
|
+
Total: 'جمع کل',
|
|
240
|
+
Month1: 'فروردین',
|
|
241
|
+
Month2: 'اردیبهشت',
|
|
242
|
+
Month3: 'خرداد',
|
|
243
|
+
Month4: 'تیر',
|
|
244
|
+
Month5: 'مرداد',
|
|
245
|
+
Month6: 'شهریور',
|
|
246
|
+
Month7: 'مهر',
|
|
247
|
+
Month8: 'آبان',
|
|
248
|
+
Month9: 'آذر',
|
|
249
|
+
Month10: 'دی',
|
|
250
|
+
Month11: 'بهمن',
|
|
251
|
+
Month12: 'اسفند',
|
|
252
|
+
Day: 'روز',
|
|
253
|
+
YearP: '{} سال',
|
|
254
|
+
MonthP: '{} ماه',
|
|
255
|
+
DayP: '{} روز',
|
|
256
|
+
HourP: '{} ساعت',
|
|
257
|
+
MinuteP: '{} دقیقه',
|
|
258
|
+
Hour: 'ساعت',
|
|
259
|
+
Minute: 'دقیقه',
|
|
260
|
+
AFew: 'چند لحظه',
|
|
261
|
+
Ago: 'پیش',
|
|
262
|
+
Later: 'دیگر',
|
|
263
|
+
LessThanMinute: 'کمتر از یک دقیقه',
|
|
264
|
+
Finished: 'پایان یافته',
|
|
265
|
+
Reload: 'بارگیری مجدد',
|
|
266
|
+
Maximum: 'بزرگ نمایی',
|
|
267
|
+
Minimum: 'کوچک نمایی',
|
|
268
|
+
Export: 'خروجی',
|
|
269
|
+
Send: 'ارسال',
|
|
270
|
+
And: ' و ',
|
|
271
|
+
UsernamePasswordInvalid: 'نام کاربری یا کلمه عبور اشتباه است',
|
|
272
|
+
DbUpdateException: 'امکان حذف رکورد مورد نظر به دلیل استفاده شدن در سامانه وجود ندارد',
|
|
273
|
+
UserMaxSessionCount: 'تعداد لاگین انجام شده بیش از سقف مجاز است.',
|
|
274
|
+
UserInvalidIp: 'آیپی شما نامعتبر است.',
|
|
275
|
+
// tslint:disable-next-line
|
|
276
|
+
LoadingDot: '<span class="dot-spinner black"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></span>',
|
|
277
|
+
LoadingDotWhite: '<span class="dot-spinner white"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></span>',
|
|
278
|
+
Loading: 'در حال {} <span class="dot-spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></span>',
|
|
279
|
+
LoadingEmpty: '<span class="dot-spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></span>',
|
|
280
|
+
LoadingTable: '<i class="fas fa-spin fa-spinner m-l-5-p icon"></i> در حال {} <span class="dot-spinner black"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></span>',
|
|
281
|
+
EmptyData: 'اطلاعاتی برای نمایش وجود ندارد',
|
|
282
|
+
LoadingText: 'در حال {}',
|
|
283
|
+
Waiting: 'انتظار',
|
|
284
|
+
Required: 'را وارد کنید',
|
|
285
|
+
Invalid: 'نامعتبر است',
|
|
286
|
+
ExpertSearch: 'جستجو پیشرفته',
|
|
287
|
+
UploaderTitle: 'برای آپلود فایل <span class="f-u f-w-700 c-primary">کلیک کنید</span> و یا فایل خود را به اینجا کشیده و رها کنید',
|
|
288
|
+
UploaderMaxLength: 'حداکثر اندازه برای آپلود {}MB',
|
|
289
|
+
FormErrorRequired: '{} را وارد کنید',
|
|
290
|
+
FormErrorInvalid: '{} نامعتبر است',
|
|
291
|
+
FormErrorLength: 'طول {} باید {} کاراکتر باشد',
|
|
292
|
+
FormErrorMinLength: 'طول {} باید حداقل {} کاراکتر باشد',
|
|
293
|
+
FormErrorMaxLength: 'طول {} باید حداکثر {} کاراکتر باشد',
|
|
294
|
+
FormErrorMinAmount: 'مقدار {} باید حداقل {} باشد',
|
|
295
|
+
FormErrorMaxAmount: 'مقدار {} باید حداکثر {} باشد',
|
|
296
|
+
FormErrorExpired: '{} منقضی شده است',
|
|
297
|
+
FormErrorWrong: '{} اشتباه است',
|
|
298
|
+
FormErrorNotMatch: '{} با تکرار آن مطابقت ندارد',
|
|
299
|
+
FormErrorExist: '{} در سامانه ثبت شده است',
|
|
300
|
+
FormErrorNotExist: '{} در سامانه ثبت نشده است',
|
|
301
|
+
FormErrorNotAllowed: 'نوع فایل {} نامعتبر است ({})',
|
|
302
|
+
FormErrorMaxContent: 'حجم فایل {} نباید بیشتر از {}KB باشد',
|
|
303
|
+
FormErrorUpload: 'خطا در بارگذاری {}',
|
|
304
|
+
FormError: 'خطا در {}',
|
|
305
|
+
FormBaseErrorExpired: 'لطفا مجددا وارد شوید',
|
|
306
|
+
FormBaseErrorNotRegistered: 'خطا در تایید کد نرم افزار',
|
|
307
|
+
FormBaseErrorExpiredRegistered: 'کد نرم افزار منقضی شده است',
|
|
308
|
+
FormBaseErrorInvalidIp: 'آیپی شما نامعتبر است',
|
|
309
|
+
FormBaseErrorNoCredit: 'اعتبار شما بارای انجام این عمیات ناکافی است',
|
|
310
|
+
ErrorUpload: 'خطا در بارگذاری فایل',
|
|
311
|
+
FormBaseErrorInvalidParam: 'خطا در اطلاعات ارسال شده',
|
|
312
|
+
FormBaseErrorTimeOut: 'درخواست شما بیش از حد معمول زمان برده است. لطفا مجددا تلاش کنید',
|
|
313
|
+
FormBaseErrorPermission: 'اجازه دسترسی به این عملیات را ندارید',
|
|
314
|
+
FormBaseErrorAccess: 'دسترسی به منبع مورد نظر امکانپذیر نمیباشد',
|
|
315
|
+
PaymentError: 'خطا در اتصال به درگاه بانکی',
|
|
316
|
+
Error: 'متاسفانه در سیستم خطایی به وجود آمده است. لطفا مجددا تلاش کنید',
|
|
317
|
+
ErrorFingerPrintNoDeviceConnected: 'دستگاه اثرانگشت به سیستم متصل نیست',
|
|
318
|
+
ErrorFingerPrintOpenDeviceFailed: 'خطا در باز کردن دستگاه اثرانگشت',
|
|
319
|
+
ErrorFingerPrintInitDBFailed: 'خطا در باز کردن دیتابیس دستگاه اثرانگشت',
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
|
|
76
324
|
// @dynamic
|
|
77
325
|
class LangClass {
|
|
78
|
-
constructor(d, strings) {
|
|
326
|
+
constructor(d, strings$1) {
|
|
327
|
+
this.lang = merge(strings[d], strings$1[d]);
|
|
79
328
|
}
|
|
80
329
|
get(area, c, k, v = null) {
|
|
81
330
|
if (k != null && (/^-?\d+$/.test(k) || /^\d+\.\d+$/.test(k))) {
|
|
82
331
|
return k;
|
|
83
332
|
}
|
|
333
|
+
let cv = get(this.lang, area ? `${area}.${c}.${k}` : `${c}.${k}`);
|
|
334
|
+
if (!cv) {
|
|
335
|
+
cv = get(this.lang, `Public.${c}.${k}`);
|
|
336
|
+
}
|
|
337
|
+
if (!cv) {
|
|
338
|
+
cv = get(this.lang, `Public.${k}`);
|
|
339
|
+
}
|
|
340
|
+
if (!cv) {
|
|
341
|
+
return k;
|
|
342
|
+
}
|
|
343
|
+
if (v !== null) {
|
|
344
|
+
if (v.constructor === Array) {
|
|
345
|
+
v.forEach((x) => {
|
|
346
|
+
cv = cv.replace('{}', this.get(area, c, x, null));
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
cv = cv.replace('{}', this.get(area, c, v, null));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return cv;
|
|
84
354
|
}
|
|
85
355
|
}
|
|
86
356
|
|
|
@@ -969,6 +1239,7 @@ class HelperClass {
|
|
|
969
1239
|
return fileIcons[k] ? fileIcons[k] : fileIcons.file;
|
|
970
1240
|
}
|
|
971
1241
|
static groupBy(data, iteratee) {
|
|
1242
|
+
return groupBy(data, iteratee);
|
|
972
1243
|
}
|
|
973
1244
|
static getTablePermissions(l = true, i = true, u = true, d = true) {
|
|
974
1245
|
const p = new PermissionClass();
|
|
@@ -1466,6 +1737,7 @@ class FormClass {
|
|
|
1466
1737
|
}
|
|
1467
1738
|
else {
|
|
1468
1739
|
if (d[n] === undefined) {
|
|
1740
|
+
set(d, n, vl);
|
|
1469
1741
|
}
|
|
1470
1742
|
else {
|
|
1471
1743
|
if (d[n] instanceof Array) {
|
|
@@ -1513,6 +1785,24 @@ class FormClass {
|
|
|
1513
1785
|
}
|
|
1514
1786
|
setData(d) {
|
|
1515
1787
|
this.inputs.forEach(inp => {
|
|
1788
|
+
var _a;
|
|
1789
|
+
const iv = (_a = get(d, inp.name)) !== null && _a !== void 0 ? _a : null;
|
|
1790
|
+
if (inp.type === InputType.Vehicle) {
|
|
1791
|
+
const ivt = get(d, inp.name + 'Type');
|
|
1792
|
+
inp.setValue({ Value: iv, Type: ivt }, true);
|
|
1793
|
+
}
|
|
1794
|
+
else if (inp.type === InputType.VehicleSearch) {
|
|
1795
|
+
const ivs = get(d, inp.name.replace('Id', ''));
|
|
1796
|
+
const ivt = get(d, inp.name.replace('Id', 'Type'));
|
|
1797
|
+
inp.setValue({ Search: ivs, Value: iv, Type: ivt }, true);
|
|
1798
|
+
}
|
|
1799
|
+
else if (inp.type !== InputType.Label || iv != null) {
|
|
1800
|
+
inp.setValue(iv, true);
|
|
1801
|
+
}
|
|
1802
|
+
if (inp.type === InputType.SelectAutoCompletePlaque || inp.type === InputType.SelectAutoComplete) {
|
|
1803
|
+
const ivs = get(d, inp.name.replace('Id', ''));
|
|
1804
|
+
inp.setSearch(ivs);
|
|
1805
|
+
}
|
|
1516
1806
|
});
|
|
1517
1807
|
}
|
|
1518
1808
|
setError(res) {
|
|
@@ -1610,6 +1900,7 @@ class InputClass {
|
|
|
1610
1900
|
InputType.PostalCode, InputType.Date, InputType.Time, InputType.BillNumber, InputType.Username, InputType.Url].includes(type) ? ' ltr' : '');
|
|
1611
1901
|
this.type = type;
|
|
1612
1902
|
this.value = value;
|
|
1903
|
+
this.default = value == null ? null : (typeof value === 'number' || typeof value === 'string' ? cloneDeep(value) : HelperClass.clone(value));
|
|
1613
1904
|
this.baseRequired = required;
|
|
1614
1905
|
this.required = required;
|
|
1615
1906
|
this.inEditRequired = required;
|
|
@@ -2555,7 +2846,100 @@ class TableRowComponent {
|
|
|
2555
2846
|
}
|
|
2556
2847
|
getCell(col) {
|
|
2557
2848
|
// console.log('getCell');
|
|
2558
|
-
|
|
2849
|
+
const cv = get(this.row.Data, col.name);
|
|
2850
|
+
if (cv === null) {
|
|
2851
|
+
return col.default ? col.default : '';
|
|
2852
|
+
}
|
|
2853
|
+
else if (col.fun != null) {
|
|
2854
|
+
return col.fun(this.row.Data);
|
|
2855
|
+
}
|
|
2856
|
+
else if (col.enum !== null) {
|
|
2857
|
+
return this.table.l(EnumUtils.getKeyByValue(col.enum, cv));
|
|
2858
|
+
}
|
|
2859
|
+
else if (col.type === TableCollType.DateDif) {
|
|
2860
|
+
return HelperClass.getDateDif(this.table.l, cv);
|
|
2861
|
+
}
|
|
2862
|
+
else if (col.type === TableCollType.Date) {
|
|
2863
|
+
return HelperClass.getDate(cv);
|
|
2864
|
+
}
|
|
2865
|
+
else if (col.type === TableCollType.DateTime) {
|
|
2866
|
+
return '<span class="ltr">' + HelperClass.getDateTime(cv) + '</span>';
|
|
2867
|
+
}
|
|
2868
|
+
else if (col.type === TableCollType.Month) {
|
|
2869
|
+
return HelperClass.getDate(cv, 'jMMMM jYYYY');
|
|
2870
|
+
}
|
|
2871
|
+
else if (col.type === TableCollType.Year) {
|
|
2872
|
+
return HelperClass.getDate(cv, 'jYYYY');
|
|
2873
|
+
}
|
|
2874
|
+
else if (col.type === TableCollType.Time) {
|
|
2875
|
+
return HelperClass.getTime(cv);
|
|
2876
|
+
}
|
|
2877
|
+
else if (col.type === TableCollType.Color) {
|
|
2878
|
+
return '<div class="color" style="background-color: ' + cv + '; color: ' + HelperClass.getColorByBgColor(cv) + '">' + cv + '</div>';
|
|
2879
|
+
}
|
|
2880
|
+
else if (col.type === TableCollType.Url) {
|
|
2881
|
+
return '<a target="_blank" class="ltr" href="' + cv + '">' + cv + '</a>';
|
|
2882
|
+
}
|
|
2883
|
+
else if (col.type === TableCollType.Image) {
|
|
2884
|
+
return '<img style="height: ' + this.table.height + 'px" alt="" src="' + this.service.environment.url + cv + '"/>';
|
|
2885
|
+
}
|
|
2886
|
+
else if (col.type === TableCollType.FileSize) {
|
|
2887
|
+
return HelperClass.getFileSize(cv);
|
|
2888
|
+
}
|
|
2889
|
+
else if (col.type === TableCollType.Price) {
|
|
2890
|
+
try {
|
|
2891
|
+
return HelperClass.toPrice(this.table.l, cv);
|
|
2892
|
+
}
|
|
2893
|
+
catch (_a) { }
|
|
2894
|
+
}
|
|
2895
|
+
else if (col.type === TableCollType.Number) {
|
|
2896
|
+
return cv.toLocaleString();
|
|
2897
|
+
}
|
|
2898
|
+
else if (col.type === TableCollType.Files) {
|
|
2899
|
+
let files = '';
|
|
2900
|
+
for (const f of cv) {
|
|
2901
|
+
const k = f.split('.').at(-1);
|
|
2902
|
+
if (k === 'jpeg' || k === 'jpg' || k === 'png') {
|
|
2903
|
+
files += '<a target="_blank" href="' + this.table.environment.url + f + '" class="m-h-5"><img alt="" src="' + this.table.environment.url + f + '" style="height: 30px"/></a>';
|
|
2904
|
+
}
|
|
2905
|
+
else {
|
|
2906
|
+
files += '<a target="_blank" href="' + this.table.environment.url + f + '" class="f-s-30 m-h-5 ' + FileIcons[k] + '"></a>';
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
return files;
|
|
2910
|
+
}
|
|
2911
|
+
else if (col.type === TableCollType.Plaque) {
|
|
2912
|
+
const parts = cv.split('_');
|
|
2913
|
+
if (parts.length === 4) {
|
|
2914
|
+
return '<div data-copy="' + parts.join(' ') + '" class="plaque' + (parts[1] === 'ع' ? ' p' : '') + (parts[1] === 'ا' ? ' g' : '') + '">' +
|
|
2915
|
+
'<div class="part1">' + parts[0] + '</div>' +
|
|
2916
|
+
'<div class="part2">' + parts[1] + '</div>' +
|
|
2917
|
+
'<div class="part3">' + parts[2] + '</div>' +
|
|
2918
|
+
'<div class="part4">' + parts[3] + '</div>' +
|
|
2919
|
+
'</div>';
|
|
2920
|
+
}
|
|
2921
|
+
else if (parts.length === 2 && parts.every(x => /^[0-9]+$/.test(x))) {
|
|
2922
|
+
return '<div data-copy="' + parts.join(' ') + '" class="plaque plaque-m">' +
|
|
2923
|
+
'<div class="part1">' + parts[0] + '</div>' +
|
|
2924
|
+
'<div class="part2">' + parts[1] + '</div>' +
|
|
2925
|
+
'</div>';
|
|
2926
|
+
}
|
|
2927
|
+
else if (parts.length === 2) {
|
|
2928
|
+
return '<div data-copy="' + parts.join(' ') + '" class="plaque plaque-f">' +
|
|
2929
|
+
'<div class="part1">' + parts[0] + '</div>' +
|
|
2930
|
+
'<div class="part2">' + parts[1] + '</div>' +
|
|
2931
|
+
'</div>';
|
|
2932
|
+
}
|
|
2933
|
+
else if (parts.length === 1) {
|
|
2934
|
+
return '<div data-copy="' + parts[0] + '" class="plaque plaque-g">' +
|
|
2935
|
+
'<div class="part1">' + parts[0] + '</div>' +
|
|
2936
|
+
'</div>';
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
else if (col.type === TableCollType.PlaqueText) {
|
|
2940
|
+
return `<div class="ltr">${HelperClass.ToReadablePlaque(cv)}</div>`;
|
|
2941
|
+
}
|
|
2942
|
+
return this.table.l(cv);
|
|
2559
2943
|
}
|
|
2560
2944
|
getCol(n) {
|
|
2561
2945
|
let c = this.row.Data;
|
|
@@ -2900,7 +3284,7 @@ class TableComponent {
|
|
|
2900
3284
|
TableComponent.decorators = [
|
|
2901
3285
|
{ type: Component, args: [{
|
|
2902
3286
|
selector: 'lib-table',
|
|
2903
|
-
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren || table.subTable != null ? ' has-children' : '') + (table.vertical ? ' vertical' : '') + (table.expertSearch ? ' expert-search' : '') + ' table-con w-100'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n <div class=\"f-r\"
|
|
3287
|
+
template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren || table.subTable != null ? ' has-children' : '') + (table.vertical ? ' vertical' : '') + (table.expertSearch ? ' expert-search' : '') + ' table-con w-100'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n <div class=\"f-r\" [innerHTML]=\"this.table.title ? this.table.title : table.l('List')\"></div>\r\n <span class=\"description\" *ngIf=\"this.table.description != null\" [innerHTML]=\"'( ' + this.table.description + ' )'\"></span>\r\n <div class=\"extra-buttons\" *ngIf=\"table.showExtraButtons\">\r\n <span *ngIf=\"isChecked()\">\r\n <lib-form-icon *ngFor=\"let btn of table.extraButtons\" [inp]=\"btn\"></lib-form-icon>\r\n </span>\r\n <span *ngIf=\"!isChecked()\">\r\n <lib-form-icon *ngIf=\"table.expertSearch\" [inp]=\"expertSearch\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </span>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <span *ngFor=\"let btn of table.buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngIf=\"btn.type == type.Button\"></lib-form-button>\r\n <lib-form-icon [inp]=\"btn\" *ngIf=\"btn.type == type.Icon\"></lib-form-icon>\r\n <lib-form-label [inp]=\"btn\" *ngIf=\"btn.type == type.Label\"></lib-form-label>\r\n <lib-form-select [inp]=\"btn\" *ngIf=\"btn.type == type.Select\"></lib-form-select>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\" (click)=\"hideExpertSearch($event)\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren || table.subTable != null ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withCheck ? 'with-handle-check ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-check\" *ngIf=\"table.hasChildren || table.subTable != null\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withCheck\">\r\n <i (click)=\"checkAll()\" [className]=\"(allChecked() ? 'fa-solid fa-square-check c-green' : isChecked() ? 'fa-solid fa-square-minus c-green' : 'fa-regular fa-square') + ' check-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </div>\r\n </div>\r\n <div (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort ' : '') + col.class + ' ' + col.name + '-cell cell w-100'\" *ngFor=\"let col of table.cols\">\r\n <div class=\"header-title\" *ngIf=\"col.search == null || table.sortable\" [innerHTML]=\"table.l(col.name)\"></div>\r\n <div class=\"header-search\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date && col.type != colType.DateTime && col.type != colType.DateDif && col.type != colType.DateRemain && col.type != colType.Month && col.type != colType.Year && col.enum == null\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"(col.type == colType.Date || col.type == colType.DateTime || col.type === colType.DateDif || col.type === colType.DateRemain || col.type == colType.Month || col.type == colType.Year) && col.enum == null\" [inp]=\"col.search\"></lib-form-date>\r\n <lib-form-select *ngIf=\"col.enum != null\" [inp]=\"col.search\"></lib-form-select>\r\n </div>\r\n <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>\r\n </div>\r\n <div class=\"cell options\" *ngIf=\"table.optionType == tableOptionType.Show\">{{table.l('Options')}}</div>\r\n </div>\r\n </div>\r\n <div class=\"body\" #rows [style]=\"table.perPage > 0 ? {minHeight: table.height * table.perPage + 'px'} : {minHeight: '250px'}\">\r\n <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>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </div>\r\n </div>\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt\" *ngFor=\"let opt of getModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
|
|
2904
3288
|
styles: [".table-con{background-color:#fff;border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:102}.table-con>.title{float:right;font-size:16px;font-weight:700;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%;z-index:3}.table-con>.title .description{font-size:13px;font-weight:200;margin-right:10px}.table-con>.title .buttons,.table-con>.title .extra-buttons{float:left;margin-top:5px;position:relative;z-index:1}.table-con>.title .extra-buttons{min-width:80px}.table-con>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.table-con.expert-search>.search-form{background-color:rgba(51,51,51,.4);height:100%;left:0;margin-bottom:0;opacity:0;overflow:hidden;position:absolute;top:0;transition:all .35s ease-in-out;visibility:hidden;width:100%;z-index:4}.table-con.expert-search.show-expert-search>.search-form{opacity:1;visibility:visible}::ng-deep .table-con.expert-search>.search-form .form{background-color:var(--white);box-shadow:var(--box-shadow-right);height:100%;left:calc(-20% - 20px);padding:20px;position:absolute;top:0;transition:all .35s ease-in-out;width:20%;z-index:4}::ng-deep .table-con.expert-search>.search-form .form .inputs{float:right;height:calc(100% - 50px);margin:0;overflow-y:auto;width:100%}::ng-deep .table-con.expert-search.show-expert-search>.search-form .form{left:0}.table-con .table,.table-con .table .header{float:right;width:100%}.table-con .table .header .row{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;background-color:var(--base-white);border-radius:var(--border-radius-base);display:flex;flex-wrap:wrap;float:right;justify-content:right;position:relative;width:100%}.table-con .table .header .row.with-handle-check,.table-con .table .header .row.with-handle-children,.table-con .table .header .row.with-handle-sortable{padding-right:30px}.table-con .table .header .row.with-handle-children.with-handle-check,.table-con .table .header .row.with-handle-sortable.with-handle-check,.table-con .table .header .row.with-handle-sortable.with-handle-children{padding-right:60px}.table-con .table .header .row.with-handle-sortable.with-handle-children.with-handle-check{padding-right:90px}.table-con .table .header .row .cell{align-items:center;color:var(--black-light);display:flex;float:right;font-size:12px;font-weight:200;font-weight:400;height:45px;justify-content:center;position:relative}.table-con .table .header .row .cell.options{margin-left:auto;margin-right:auto}.table-con .table .header .row .handle-con{height:100%;position:absolute;right:0;top:0}.table-con .table .header .row .handle-con .handle{align-items:center;display:flex;float:right;height:100%;justify-content:center;width:30px}.table-con .table .header .row .handle-con .handle i{cursor:pointer;font-size:18px}.table-con .table .header .row .cell.sort{cursor:pointer}.table-con .table .header .row .cell .header-title{float:right;padding:0 15px;text-align:center;width:calc(100% - 20px)}.table-con .table .header .row .cell .header-search{float:right;width:calc(100% - 20px)}.table-con .table .header .row .cell .sort-icon{float:right;font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;top:calc(50% - 10px);width:20px}.table-con .table .body{float:right;position:relative;width:100%}::ng-deep .table-con .table .header .row .cell .check-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}::ng-deep .table-con.vertical .table lib-table-row>.row-con>.row:after{background-image:linear-gradient(180deg,rgba(0,0,0,.05),rgba(50,50,50,.15),rgba(0,0,0,.05));height:100%;left:0;right:unset;width:1px}::ng-deep .table-con.vertical:not(.sortable) .table lib-table-row:first-of-type>.row-con>.row:after,::ng-deep .table-con:not(.sortable) .table lib-table-row:last-of-type>.row-con>.row:after{background-image:unset}.table-con.vertical .table .header{display:none}::ng-deep .table-con .table lib-table-row{display:contents}.table-con.vertical .table .body{display:flex}::ng-deep .table-con.vertical .table lib-table-row:first-of-type>.row-con{background-color:var(--base-white);border-radius:var(--border-radius-base);max-width:150px}@media (max-width:499.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-100% - 20px);width:100%}}@media (min-width:500px) and (max-width:699.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-50% - 20px);width:50%}}@media (min-width:700px) and (max-width:999.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-40% - 20px);width:40%}}@media (min-width:1000px) and (max-width:1599.99px){::ng-deep .table-con.expert-search>.search-form .form{left:calc(-30% - 20px);width:30%}}"]
|
|
2905
3289
|
},] }
|
|
2906
3290
|
];
|