@elite.framework/ng.core 1.0.62 → 1.0.65
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/fesm2022/elite.framework-ng.core-src-lib-components-attachments.mjs +204 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-attachments.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-breadcrumb.mjs +132 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-breadcrumb.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-color-picker.mjs +76 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-color-picker.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-column-settings-popover.mjs +172 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-column-settings-popover.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-condition-editor.mjs +794 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-condition-editor.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-custom-switch.mjs +110 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-custom-switch.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-deactivation-reason.mjs +130 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-deactivation-reason.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-form-button.mjs +50 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-form-button.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-form-field.mjs +154 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-form-field.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-form-template.mjs +24 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-form-template.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-avatar-image.mjs +100 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-avatar-image.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-avatar-label.mjs +78 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-avatar-label.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-button-selector.mjs +167 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-button-selector.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-button.mjs +62 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-button.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-split-button.mjs +50 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-split-button.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-username-with-domain.mjs +76 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-formly-username-with-domain.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-autocomplete.mjs +163 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-autocomplete.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-button.mjs +133 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-button.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-card.mjs +214 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-card.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-crud-table.mjs +385 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-crud-table.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-errormessage.mjs +23 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-errormessage.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-formly-fields.mjs +53 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-formly-fields.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-loadingspinner.mjs +23 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-loadingspinner.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-search.mjs +85 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-search.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-selector.mjs +430 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-selector.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-table.mjs +216 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-generic-table.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-header-wrapper.mjs +18 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-header-wrapper.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-icon-picker.mjs +195 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-icon-picker.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-input-switch.mjs +94 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-input-switch.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-input-with-icon.mjs +55 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-input-with-icon.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-label-type.mjs +112 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-label-type.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-odata-query-builder.mjs +297 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-odata-query-builder.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-repeat.mjs +135 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-repeat.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-sidebar-cards.mjs +40 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-sidebar-cards.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-sidebar-toggles.mjs +41 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-sidebar-toggles.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-tabs.mjs +45 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-tabs.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-tag-type.mjs +192 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-tag-type.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-text-editor.mjs +44 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-text-editor.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-wrappers.mjs +174 -0
- package/fesm2022/elite.framework-ng.core-src-lib-components-wrappers.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-directives.mjs +59 -0
- package/fesm2022/elite.framework-ng.core-src-lib-directives.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core-src-lib-pipes.mjs +135 -0
- package/fesm2022/elite.framework-ng.core-src-lib-pipes.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.core.mjs +1371 -6371
- package/fesm2022/elite.framework-ng.core.mjs.map +1 -1
- package/index.d.ts +347 -1274
- package/package.json +162 -22
- package/src/lib/components/attachments/index.d.ts +31 -0
- package/src/lib/components/breadcrumb/index.d.ts +10 -0
- package/src/lib/components/color-picker/index.d.ts +9 -0
- package/src/lib/components/column-settings-popover/index.d.ts +39 -0
- package/src/lib/components/condition-editor/index.d.ts +73 -0
- package/src/lib/components/custom-switch/index.d.ts +12 -0
- package/src/lib/components/deactivation-reason/index.d.ts +24 -0
- package/src/lib/components/form-button/index.d.ts +10 -0
- package/src/lib/components/form-field/index.d.ts +30 -0
- package/src/lib/components/form-template/index.d.ts +9 -0
- package/src/lib/components/formly-avatar-image/index.d.ts +11 -0
- package/src/lib/components/formly-avatar-label/index.d.ts +29 -0
- package/src/lib/components/formly-button/index.d.ts +13 -0
- package/src/lib/components/formly-button-selector/index.d.ts +28 -0
- package/src/lib/components/formly-split-button/index.d.ts +16 -0
- package/src/lib/components/formly-username-with-domain/index.d.ts +12 -0
- package/src/lib/components/generic-autocomplete/index.d.ts +34 -0
- package/src/lib/components/generic-button/index.d.ts +35 -0
- package/src/lib/components/generic-card/index.d.ts +90 -0
- package/src/lib/components/generic-crud-table/index.d.ts +120 -0
- package/src/lib/components/generic-errormessage/index.d.ts +10 -0
- package/src/lib/components/generic-formly-fields/index.d.ts +22 -0
- package/src/lib/components/generic-loadingspinner/index.d.ts +9 -0
- package/src/lib/components/generic-search/index.d.ts +29 -0
- package/src/lib/components/generic-selector/index.d.ts +66 -0
- package/src/lib/components/generic-table/index.d.ts +60 -0
- package/src/lib/components/header-wrapper/index.d.ts +8 -0
- package/src/lib/components/icon-picker/index.d.ts +23 -0
- package/src/lib/components/input-switch/index.d.ts +9 -0
- package/src/lib/components/input-with-icon/index.d.ts +10 -0
- package/src/lib/components/label-type/index.d.ts +19 -0
- package/src/lib/components/odata-query-builder/index.d.ts +81 -0
- package/src/lib/components/repeat/index.d.ts +17 -0
- package/src/lib/components/sidebar-cards/index.d.ts +18 -0
- package/src/lib/components/sidebar-toggles/index.d.ts +18 -0
- package/src/lib/components/tabs/index.d.ts +10 -0
- package/src/lib/components/tag-type/index.d.ts +27 -0
- package/src/lib/components/text-editor/index.d.ts +9 -0
- package/src/lib/components/wrappers/index.d.ts +24 -0
- package/src/lib/directives/index.d.ts +23 -0
- package/src/lib/pipes/index.d.ts +20 -0
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
import { Chip } from 'primeng/chip';
|
|
2
|
+
import * as i9 from '@ngx-translate/core';
|
|
3
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { ViewChild, Component } from '@angular/core';
|
|
6
|
+
import { FieldType } from '@ngx-formly/core';
|
|
7
|
+
import * as i2 from '@angular/common';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import * as i3 from '@angular/forms';
|
|
10
|
+
import { FormsModule } from '@angular/forms';
|
|
11
|
+
import * as i4 from 'primeng/autocomplete';
|
|
12
|
+
import { AutoCompleteModule } from 'primeng/autocomplete';
|
|
13
|
+
import * as i6 from 'primeng/button';
|
|
14
|
+
import { ButtonModule } from 'primeng/button';
|
|
15
|
+
import * as i7 from 'primeng/inputtext';
|
|
16
|
+
import { InputTextModule } from 'primeng/inputtext';
|
|
17
|
+
import * as i8 from 'primeng/dialog';
|
|
18
|
+
import { DialogModule } from 'primeng/dialog';
|
|
19
|
+
import { PopoverModule } from 'primeng/popover';
|
|
20
|
+
import { firstValueFrom, finalize } from 'rxjs';
|
|
21
|
+
import * as i1 from '@elite.framework/ng.core';
|
|
22
|
+
import { BaseService } from '@elite.framework/ng.core';
|
|
23
|
+
import * as i5 from 'primeng/api';
|
|
24
|
+
|
|
25
|
+
const suggestions = [
|
|
26
|
+
{
|
|
27
|
+
label: "عدد دقائق التأخير",
|
|
28
|
+
value: "AttendanceDelayMinutes",
|
|
29
|
+
kind: "Field",
|
|
30
|
+
detail: "عدد دقائق التأخير",
|
|
31
|
+
documentation: "**AttendanceDelayMinutes**\nعدد الدقائق التي تأخر بها الموظف عن بدء الورديّة."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "دقائق الانصراف المبكر",
|
|
35
|
+
value: "EarlyLeaveMinutes",
|
|
36
|
+
kind: "Field",
|
|
37
|
+
detail: "دقائق الانصراف المبكر",
|
|
38
|
+
documentation: "**EarlyLeaveMinutes**\nعدد الدقائق التي سجل بها الموظف انسحابًا مبكرًا عن الورديّة."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "سعر الساعة",
|
|
42
|
+
value: "HourlyRate",
|
|
43
|
+
kind: "Field",
|
|
44
|
+
detail: "سعر الساعة",
|
|
45
|
+
documentation: "**HourlyRate**\nتكلفة الساعة المستخرجة من الراتب الأساسي وساعات العمل المتوقعة."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: "قيمة اليوم المتوقعة",
|
|
49
|
+
value: "ScheduledDayValue",
|
|
50
|
+
kind: "Field",
|
|
51
|
+
detail: "قيمة اليوم المتوقعة",
|
|
52
|
+
documentation: "**ScheduledDayValue**\nقيمة اليوم المحسوبة بناءً على السعر بالساعة وساعات الورديّة المتوقعة."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "قيمة اليوم الفعلية",
|
|
56
|
+
value: "ActualDayValue",
|
|
57
|
+
kind: "Field",
|
|
58
|
+
detail: "قيمة اليوم الفعلية",
|
|
59
|
+
documentation: "**ActualDayValue**\nقيمة اليوم المحسوبة بناءً على السعر بالساعة وساعات العمل الفعليّة."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: "عدد أيام العمل",
|
|
63
|
+
value: "WorkingDays",
|
|
64
|
+
kind: "Field",
|
|
65
|
+
detail: "عدد أيام العمل",
|
|
66
|
+
documentation: "**WorkingDays**\nعدد الأيام في دفتر الحضور."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "الراتب الأساسي",
|
|
70
|
+
value: "BasicSalary",
|
|
71
|
+
kind: "Field",
|
|
72
|
+
detail: "بند الراتب الأساسي",
|
|
73
|
+
documentation: "**BasicSalary**\n بند الراتب الأساسي."
|
|
74
|
+
},
|
|
75
|
+
// Employee fields
|
|
76
|
+
{
|
|
77
|
+
label: "رمز الموظف",
|
|
78
|
+
value: "Employee.Code",
|
|
79
|
+
kind: "Field",
|
|
80
|
+
detail: "رمز الموظف",
|
|
81
|
+
documentation: "**Employee.Code**\nالرمز الفريد المعطى للموظف في النظام."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: "الاسم الكامل",
|
|
85
|
+
value: "Employee.FullName",
|
|
86
|
+
kind: "Field",
|
|
87
|
+
detail: "الاسم الكامل للموظف",
|
|
88
|
+
documentation: "**Employee.FullName**\nالاسم الأول واسم العائلة للموظف."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: "نوع الموظف",
|
|
92
|
+
value: "Employee.Type",
|
|
93
|
+
kind: "Field",
|
|
94
|
+
detail: "نوع الموظف",
|
|
95
|
+
documentation: "**Employee.Type**\nنوع الموظف (دوام كامل، مؤقت، الخ)."
|
|
96
|
+
},
|
|
97
|
+
// Shift fields
|
|
98
|
+
{
|
|
99
|
+
label: "اسم الورديّة",
|
|
100
|
+
value: "Shift.Name",
|
|
101
|
+
kind: "Field",
|
|
102
|
+
detail: "اسم الورديّة",
|
|
103
|
+
documentation: "**Shift.Name**\nالاسم المعطى للورديّة (صباحية، مسائية)."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: "بداية الورديّة",
|
|
107
|
+
value: "Shift.StartTime",
|
|
108
|
+
kind: "Field",
|
|
109
|
+
detail: "بداية الورديّة",
|
|
110
|
+
documentation: "**Shift.StartTime**\nوقت بدء الورديّة."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: "نهاية الورديّة",
|
|
114
|
+
value: "Shift.EndTime",
|
|
115
|
+
kind: "Field",
|
|
116
|
+
detail: "نهاية الورديّة",
|
|
117
|
+
documentation: "**Shift.EndTime**\nوقت نهاية الورديّة."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "رمز نوع الورديّة",
|
|
121
|
+
value: "Shift.TypeKey",
|
|
122
|
+
kind: "Field",
|
|
123
|
+
detail: "رمز نوع الورديّة",
|
|
124
|
+
documentation: "**Shift.TypeKey**\nالمفتاح البرمجي لنوع الورديّة."
|
|
125
|
+
},
|
|
126
|
+
// AttendanceSheet fields
|
|
127
|
+
{
|
|
128
|
+
label: "من تاريخ",
|
|
129
|
+
value: "Sheet.DateFrom",
|
|
130
|
+
kind: "Field",
|
|
131
|
+
detail: "تاريخ بداية الدفتر",
|
|
132
|
+
documentation: "**Sheet.DateFrom**\nأول يوم في دفتر الحضور (اليوم الأول للشهر)."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: "إلى تاريخ",
|
|
136
|
+
value: "Sheet.DateTo",
|
|
137
|
+
kind: "Field",
|
|
138
|
+
detail: "تاريخ نهاية الدفتر",
|
|
139
|
+
documentation: "**Sheet.DateTo**\nآخر يوم في دفتر الحضور (اليوم الأخير للشهر)."
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: "عدد أيام الحضور",
|
|
143
|
+
value: "Sheet.PresentDays",
|
|
144
|
+
kind: "Field",
|
|
145
|
+
detail: "عدد أيام الحضور",
|
|
146
|
+
documentation: "**Sheet.PresentDays**\nعدد الأيام التي سجل فيها الموظف دخول وخروج."
|
|
147
|
+
},
|
|
148
|
+
// AttendanceDay fields
|
|
149
|
+
{
|
|
150
|
+
label: "تاريخ اليوم",
|
|
151
|
+
value: "Day.Date",
|
|
152
|
+
kind: "Field",
|
|
153
|
+
detail: "تاريخ يوم الحضور",
|
|
154
|
+
documentation: "**Day.Date**\nالتاريخ الفعلي ليوم الحضور."
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: "تسجيل دخول",
|
|
158
|
+
value: "Day.SignIn",
|
|
159
|
+
kind: "Field",
|
|
160
|
+
detail: "وقت تسجيل دخول الموظف",
|
|
161
|
+
documentation: "**Day.SignIn**\nالطابع الزمني لتسجيل دخول الموظف."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: "تسجيل خروج",
|
|
165
|
+
value: "Day.SignOut",
|
|
166
|
+
kind: "Field",
|
|
167
|
+
detail: "وقت تسجيل خروج الموظف",
|
|
168
|
+
documentation: "**Day.SignOut**\nالطابع الزمني لتسجيل خروج الموظف."
|
|
169
|
+
},
|
|
170
|
+
// LeavePolicy fields
|
|
171
|
+
{
|
|
172
|
+
label: "اسم سياسة الإجازة",
|
|
173
|
+
value: "LeavePolicy.Name",
|
|
174
|
+
kind: "Field",
|
|
175
|
+
detail: "اسم سياسة الإجازة",
|
|
176
|
+
documentation: "**LeavePolicy.Name**\nالاسم المعطى لسياسة الإجازة."
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: "رمز الحالة",
|
|
180
|
+
value: "LeavePolicy.StatusKey",
|
|
181
|
+
kind: "Field",
|
|
182
|
+
detail: "رمز حالة السياسة",
|
|
183
|
+
documentation: "**LeavePolicy.StatusKey**\nالمفتاح البرمجي لحالة سياسة الإجازة."
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
label: "حالة السياسة",
|
|
187
|
+
value: "LeavePolicy.Status",
|
|
188
|
+
kind: "Field",
|
|
189
|
+
detail: "حالة السياسة",
|
|
190
|
+
documentation: "**LeavePolicy.Status**\nالوصف الكامل لحالة سياسة الإجازة."
|
|
191
|
+
},
|
|
192
|
+
// Leave fields
|
|
193
|
+
{
|
|
194
|
+
label: "بداية الإجازة",
|
|
195
|
+
value: "Leave.DateStart",
|
|
196
|
+
kind: "Field",
|
|
197
|
+
detail: "بداية الإجازة",
|
|
198
|
+
documentation: "**Leave.DateStart**\nاليوم الأول للإجازة."
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
label: "نهاية الإجازة",
|
|
202
|
+
value: "Leave.DateEnd",
|
|
203
|
+
kind: "Field",
|
|
204
|
+
detail: "نهاية الإجازة",
|
|
205
|
+
documentation: "**Leave.DateEnd**\nاليوم الأخير للإجازة."
|
|
206
|
+
},
|
|
207
|
+
// SalaryTemplate fields
|
|
208
|
+
// {
|
|
209
|
+
// label: "بنود الأرباح",
|
|
210
|
+
// value: "template.Earnings",
|
|
211
|
+
// kind: "Field",
|
|
212
|
+
// detail: "قائمة بنود الأرباح",
|
|
213
|
+
// documentation: "**SalaryTemplate.Earnings**\nقائمة العناصر التي تمثل مستحقات (أرباح) القالب."
|
|
214
|
+
// },
|
|
215
|
+
// {
|
|
216
|
+
// label: "بنود الاستقطاعات",
|
|
217
|
+
// value: "template.Deductions",
|
|
218
|
+
// kind: "Field",
|
|
219
|
+
// detail: "قائمة بنود الاستقطاعات",
|
|
220
|
+
// documentation: "**SalaryTemplate.Deductions**\nقائمة العناصر التي تمثل استقطاعات القالب."
|
|
221
|
+
// },
|
|
222
|
+
// // SalaryTemplateItem fields
|
|
223
|
+
// {
|
|
224
|
+
// label: "المبلغ الثابت للبند",
|
|
225
|
+
// value: "item.Amount",
|
|
226
|
+
// kind: "Field",
|
|
227
|
+
// detail: "المبلغ الثابت للبند",
|
|
228
|
+
// documentation: "**SalaryTemplateItem.Amount**\nالقيمة الثابتة المخصصة لهذا البند."
|
|
229
|
+
// },
|
|
230
|
+
// {
|
|
231
|
+
// label: "صيغة البند",
|
|
232
|
+
// value: "item.Formula",
|
|
233
|
+
// kind: "Field",
|
|
234
|
+
// detail: "الصيغة الحسابية للبند",
|
|
235
|
+
// documentation: "**SalaryTemplateItem.Formula**\nالصيغة البرمجية لتعريف قيمة البند عند SalaryValueType = Formula."
|
|
236
|
+
// },
|
|
237
|
+
{ label: '(Leave) Total Leaves Taken', value: 'GetLeaveTaken(leaveId)', detail: 'إجمالي الإجازات المأخوذة' },
|
|
238
|
+
{ label: '(Leave) Total Leaves Taken Before', value: 'GetLeaveTakenBefore(leaveId)', detail: 'إجمالي الإجازات المأخوذة قبل' },
|
|
239
|
+
{ label: '(Leave) Total Leaves After', value: 'GetLeaveTakenAfter(leaveId)', detail: 'إجمالي الإجازات المأخوذة بعد' },
|
|
240
|
+
{ label: '(Leave) Leaves Credit Before', value: 'GetLeaveCreditBefore(leaveId)', detail: 'رصيد الإجازات قبل' },
|
|
241
|
+
{ label: '(Leave) Leaves Credit After', value: 'GetLeaveCreditAfter(leaveId)', detail: 'رصيد الإجازات بعد' },
|
|
242
|
+
{ label: 'عدد مرات تحقق القاعدة', value: 'GetFlagCount(ruleId)', detail: 'عدد مرات تحقق القاعدة خلال الفترة' },
|
|
243
|
+
{ label: 'إجمالي قيمة القاعدة', value: 'GetFlagValue(ruleId)', detail: 'القيمة الإجمالية للقاعدة' },
|
|
244
|
+
{ label: 'أكبر من', value: '>', detail: 'القيمة الأولى أكبر من الثانية' },
|
|
245
|
+
{ label: 'أكبر من أو يساوي', value: '>=', detail: 'القيمة الأولى أكبر من أو تساوي الثانية' },
|
|
246
|
+
{ label: 'أصغر من', value: '<', detail: 'القيمة الأولى أصغر من الثانية' },
|
|
247
|
+
{ label: 'أصغر من أو يساوي', value: '<=', detail: 'القيمة الأولى أصغر من أو تساوي الثانية' },
|
|
248
|
+
{ label: 'يساوي', value: '==', detail: 'القيمتان متساويتان' },
|
|
249
|
+
{ label: 'لا يساوي', value: '!=', detail: 'القيمتان غير متساويتان' },
|
|
250
|
+
{ label: 'و (AND)', value: '&&', detail: 'تتحقق إذا كان الشرطان صحيحين' },
|
|
251
|
+
{ label: 'أو (OR)', value: '||', detail: 'تتحقق إذا كان أحد الشرطين صحيحاً' },
|
|
252
|
+
{ label: 'صحيح', value: 'true', detail: 'القيمة صحيحة' },
|
|
253
|
+
{ label: 'خطأ', value: 'false', detail: 'القيمة خاطئة' }
|
|
254
|
+
];
|
|
255
|
+
|
|
256
|
+
class ConditionExpressionBuilderType extends FieldType {
|
|
257
|
+
svc;
|
|
258
|
+
cdr;
|
|
259
|
+
// @ViewChild('paramOverlay') paramOverlay!: OverlayPanel;
|
|
260
|
+
autoComp;
|
|
261
|
+
op;
|
|
262
|
+
tokens = [];
|
|
263
|
+
selectedSuggestion;
|
|
264
|
+
customValue = '';
|
|
265
|
+
filteredSuggestions = [];
|
|
266
|
+
// Dialog state
|
|
267
|
+
displayDialog = false;
|
|
268
|
+
dialogSelectedRule = null;
|
|
269
|
+
pendingSuggestion = null;
|
|
270
|
+
filteredRuleSuggestions = [];
|
|
271
|
+
suggestions = suggestions;
|
|
272
|
+
loading = false;
|
|
273
|
+
api;
|
|
274
|
+
dialogMode = '';
|
|
275
|
+
displayMode = 'full';
|
|
276
|
+
editDialogTitle = 'Edit Expression';
|
|
277
|
+
displayEditDialog = false;
|
|
278
|
+
/**
|
|
279
|
+
*
|
|
280
|
+
*/
|
|
281
|
+
valueChangeSubscription;
|
|
282
|
+
constructor(svc, cdr) {
|
|
283
|
+
super();
|
|
284
|
+
this.svc = svc;
|
|
285
|
+
this.cdr = cdr;
|
|
286
|
+
}
|
|
287
|
+
ngOnInit() {
|
|
288
|
+
this.api = this.svc;
|
|
289
|
+
const to = this.props;
|
|
290
|
+
this.api.apiName = to['serviceName'];
|
|
291
|
+
this.displayMode = to['displayMode'] ?? 'full';
|
|
292
|
+
this.initTokens();
|
|
293
|
+
this.valueChangeSubscription = this.formControl.valueChanges
|
|
294
|
+
.subscribe(() => {
|
|
295
|
+
this.initTokens();
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
ngOnDestroy() {
|
|
299
|
+
if (this.valueChangeSubscription) {
|
|
300
|
+
this.valueChangeSubscription.unsubscribe();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
initTokens() {
|
|
304
|
+
const existing = this.formControl.value || '';
|
|
305
|
+
if (existing) {
|
|
306
|
+
const tokens = existing.split(' ').filter((x) => x);
|
|
307
|
+
Promise.all(tokens.map(async (v) => ({
|
|
308
|
+
value: v,
|
|
309
|
+
label: await this.getLabelForValue(v)
|
|
310
|
+
}))).then(resolvedTokens => {
|
|
311
|
+
this.tokens = resolvedTokens;
|
|
312
|
+
this.cdr.detectChanges(); // <-- Trigger UI update
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
this.tokens = [];
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
openDialogForTableMode() {
|
|
320
|
+
// You can reuse your dialog logic here
|
|
321
|
+
this.displayDialog = true;
|
|
322
|
+
this.dialogMode = 'rule'; // or 'leave', depending on your case
|
|
323
|
+
}
|
|
324
|
+
parseParameterizedToken(value) {
|
|
325
|
+
const match = value.match(/^(\w+)\(([^)]+)\)$/);
|
|
326
|
+
if (match) {
|
|
327
|
+
return { base: match[1], param: match[2] };
|
|
328
|
+
}
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
// getLabelForValue(value: string): string {
|
|
332
|
+
// const paramToken = this.parseParameterizedToken(value);
|
|
333
|
+
// if (paramToken) {
|
|
334
|
+
// // Find a matching suggestion by replacing any parameter placeholder
|
|
335
|
+
// const baseSuggestion = this.suggestions.find(
|
|
336
|
+
// s =>
|
|
337
|
+
// s.value === `${paramToken.base}(ruleId)` ||
|
|
338
|
+
// s.value === `${paramToken.base}(leaveId)` ||
|
|
339
|
+
// s.value === paramToken.base
|
|
340
|
+
// );
|
|
341
|
+
// if (baseSuggestion) {
|
|
342
|
+
// // Remove any placeholder text from the label
|
|
343
|
+
// const baseLabel = baseSuggestion.label
|
|
344
|
+
// .replace(/\(ruleId\)/g, '')
|
|
345
|
+
// .replace(/\(leaveId\)/g, '')
|
|
346
|
+
// .trim();
|
|
347
|
+
// return `${baseLabel} (${paramToken.param})`;
|
|
348
|
+
// }
|
|
349
|
+
// }
|
|
350
|
+
// // Exact match without parameters
|
|
351
|
+
// const exact = this.suggestions.find(s => s.value === value);
|
|
352
|
+
// if (exact) return exact.label;
|
|
353
|
+
// return value;
|
|
354
|
+
// }
|
|
355
|
+
async getLabelForValue(value) {
|
|
356
|
+
const paramToken = this.parseParameterizedToken(value);
|
|
357
|
+
if (paramToken) {
|
|
358
|
+
let paramLabel = paramToken.param;
|
|
359
|
+
// Find matching base suggestion early (optional)
|
|
360
|
+
const baseSuggestion = this.suggestions.find(s => s.value === `${paramToken.base}(ruleId)` ||
|
|
361
|
+
s.value === `${paramToken.base}(leaveId)` ||
|
|
362
|
+
s.value === paramToken.base);
|
|
363
|
+
if (value.includes('(ruleId)') || paramToken.base.toLowerCase().includes('flag')) {
|
|
364
|
+
this.api.apiName = this.props['ruleServiceName'];
|
|
365
|
+
try {
|
|
366
|
+
const res = await firstValueFrom(this.api.get(paramToken.param).pipe());
|
|
367
|
+
// Assuming API returns { items: [...] } or array directly
|
|
368
|
+
// const matchedRule = (res.items ?? res ?? []).find((r: any) => r.id == Number(paramToken.param));
|
|
369
|
+
const matchedRule = res;
|
|
370
|
+
if (matchedRule)
|
|
371
|
+
paramLabel = matchedRule.label || matchedRule.name || paramLabel;
|
|
372
|
+
}
|
|
373
|
+
catch {
|
|
374
|
+
// ignore errors, fallback to param value
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (value.includes('(leaveId)') || paramToken.base.toLowerCase().includes('leave')) {
|
|
378
|
+
this.api.apiName = this.props['leaveServiceName'];
|
|
379
|
+
try {
|
|
380
|
+
const res = await firstValueFrom(this.api.getList(paramToken.param).pipe());
|
|
381
|
+
const matchedLeave = res;
|
|
382
|
+
if (matchedLeave)
|
|
383
|
+
paramLabel = matchedLeave.label || matchedLeave.name || paramLabel;
|
|
384
|
+
}
|
|
385
|
+
catch {
|
|
386
|
+
// ignore errors
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
if (baseSuggestion) {
|
|
390
|
+
const baseLabel = baseSuggestion.label
|
|
391
|
+
.replace(/\(ruleId\)/g, '')
|
|
392
|
+
.replace(/\(leaveId\)/g, '')
|
|
393
|
+
.trim();
|
|
394
|
+
return `${baseLabel} (${paramLabel})`;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
// fallback exact match in suggestions
|
|
398
|
+
const exact = this.suggestions.find(s => s.value === value);
|
|
399
|
+
if (exact)
|
|
400
|
+
return exact.label;
|
|
401
|
+
return value;
|
|
402
|
+
}
|
|
403
|
+
filterSuggestions(event) {
|
|
404
|
+
const query = event.query.toLowerCase();
|
|
405
|
+
this.filteredSuggestions = this.suggestions.filter(s => {
|
|
406
|
+
const paramToken = this.parseParameterizedToken(s.value);
|
|
407
|
+
const baseValue = paramToken ? paramToken.base : s.value;
|
|
408
|
+
return (s.label.toLowerCase().includes(query) ||
|
|
409
|
+
baseValue.toLowerCase().includes(query) ||
|
|
410
|
+
s.value.toLowerCase().includes(query));
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
search(event) {
|
|
414
|
+
this.api.apiName = this.dialogMode === 'rule'
|
|
415
|
+
? this.props['ruleServiceName'] // existing rules service
|
|
416
|
+
: this.props['leaveServiceName']; // new leave service
|
|
417
|
+
const q = event.query?.toString().toLowerCase() || '';
|
|
418
|
+
const lf = this.props['labelField'] || 'name';
|
|
419
|
+
const fixedFilters = this.props['fixedFilters'] || {};
|
|
420
|
+
this.loading = true;
|
|
421
|
+
this.filteredRuleSuggestions = [];
|
|
422
|
+
const searchParams = {
|
|
423
|
+
[lf]: q,
|
|
424
|
+
...fixedFilters,
|
|
425
|
+
};
|
|
426
|
+
this.api.getList(searchParams)
|
|
427
|
+
.pipe(finalize(() => (this.loading = false)))
|
|
428
|
+
.subscribe({
|
|
429
|
+
next: (res) => {
|
|
430
|
+
this.filteredRuleSuggestions = res.items ?? res ?? [];
|
|
431
|
+
setTimeout(() => this.autoComp?.show(), 0);
|
|
432
|
+
},
|
|
433
|
+
error: () => {
|
|
434
|
+
this.filteredRuleSuggestions = [];
|
|
435
|
+
},
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
onSuggestionRule(event) {
|
|
439
|
+
const suggestion = event.value;
|
|
440
|
+
if (!suggestion)
|
|
441
|
+
return;
|
|
442
|
+
this.dialogSelectedRule = suggestion;
|
|
443
|
+
}
|
|
444
|
+
async onSuggestionSelected(event) {
|
|
445
|
+
const suggestion = event.value;
|
|
446
|
+
if (!suggestion)
|
|
447
|
+
return;
|
|
448
|
+
if (suggestion.value.includes('(ruleId)') || suggestion.value.includes('(leaveId)')) {
|
|
449
|
+
this.pendingSuggestion = suggestion;
|
|
450
|
+
this.dialogSelectedRule = null;
|
|
451
|
+
this.displayDialog = true;
|
|
452
|
+
// Detect mode: rule or leave
|
|
453
|
+
this.dialogMode = suggestion.value.includes('(ruleId)') ? 'rule' : 'leave';
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
this.tokens.push({
|
|
457
|
+
value: suggestion.value,
|
|
458
|
+
label: await this.getLabelForValue(suggestion.value)
|
|
459
|
+
});
|
|
460
|
+
this.updateExpression();
|
|
461
|
+
}
|
|
462
|
+
this.selectedSuggestion = '';
|
|
463
|
+
}
|
|
464
|
+
async confirmDialog() {
|
|
465
|
+
if (!this.pendingSuggestion || !this.dialogSelectedRule)
|
|
466
|
+
return;
|
|
467
|
+
const paramValue = this.dialogSelectedRule.id
|
|
468
|
+
|| this.dialogSelectedRule.value
|
|
469
|
+
|| this.dialogSelectedRule.label;
|
|
470
|
+
const placeholder = this.dialogMode === 'rule' ? '(ruleId)' : '(leaveId)';
|
|
471
|
+
const newValue = this.pendingSuggestion.value.replace(placeholder, `(${paramValue})`);
|
|
472
|
+
this.tokens.push({
|
|
473
|
+
value: newValue,
|
|
474
|
+
label: await this.getLabelForValue(newValue)
|
|
475
|
+
});
|
|
476
|
+
this.updateExpression();
|
|
477
|
+
this.closeDialog();
|
|
478
|
+
}
|
|
479
|
+
cancelDialog() {
|
|
480
|
+
this.closeDialog();
|
|
481
|
+
}
|
|
482
|
+
closeDialog() {
|
|
483
|
+
this.displayDialog = false;
|
|
484
|
+
this.dialogSelectedRule = null;
|
|
485
|
+
this.pendingSuggestion = null;
|
|
486
|
+
}
|
|
487
|
+
async addCustomToken() {
|
|
488
|
+
if (!this.customValue.trim())
|
|
489
|
+
return;
|
|
490
|
+
const val = this.customValue.trim();
|
|
491
|
+
this.tokens.push({
|
|
492
|
+
value: val,
|
|
493
|
+
label: await this.getLabelForValue(val)
|
|
494
|
+
});
|
|
495
|
+
this.updateExpression();
|
|
496
|
+
this.customValue = '';
|
|
497
|
+
}
|
|
498
|
+
removeToken(index) {
|
|
499
|
+
this.tokens.splice(index, 1);
|
|
500
|
+
this.updateExpression();
|
|
501
|
+
}
|
|
502
|
+
updateExpression() {
|
|
503
|
+
const expression = this.tokens.map(t => t.value).join(' ');
|
|
504
|
+
this.formControl.setValue(expression);
|
|
505
|
+
if (this.to['expressionChange']) {
|
|
506
|
+
this.to['expressionChange'].emit(expression);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ConditionExpressionBuilderType, deps: [{ token: i1.BaseService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
510
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.4", type: ConditionExpressionBuilderType, isStandalone: true, selector: "condition-expression-builder", providers: [BaseService], viewQueries: [{ propertyName: "autoComp", first: true, predicate: ["autoComp"], descendants: true }, { propertyName: "op", first: true, predicate: ["op"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
511
|
+
<div class="flex flex-col gap-3">
|
|
512
|
+
|
|
513
|
+
<!-- TABLE MODE -->
|
|
514
|
+
@if (displayMode === 'table') {
|
|
515
|
+
<div class="flex gap-2">
|
|
516
|
+
<div class="flex flex-wrap flex-1 gap-1">
|
|
517
|
+
<div class="border rounded-md p-2 bg-gray-50 flex flex-wrap gap-2 min-h-[40px] items-center">
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
@for (token of tokens; track $index) {
|
|
521
|
+
<span class="px-2 py-1 rounded bg-blue-100 text-blue-800 flex items-center gap-1">
|
|
522
|
+
{{ token.label | translate }}
|
|
523
|
+
</span>
|
|
524
|
+
}
|
|
525
|
+
</div>
|
|
526
|
+
</div>
|
|
527
|
+
<button type="button" pButton icon="pi pi-pencil" label=""
|
|
528
|
+
class="p-button-sm"
|
|
529
|
+
(click)="displayEditDialog = true"></button>
|
|
530
|
+
</div>
|
|
531
|
+
|
|
532
|
+
<!-- Dialog with full editor inside -->
|
|
533
|
+
<p-dialog [(visible)]="displayEditDialog" [modal]="false" [style]="{width: '700px'}">
|
|
534
|
+
|
|
535
|
+
<ng-template pTemplate="header">
|
|
536
|
+
{{ editDialogTitle | translate }}
|
|
537
|
+
</ng-template>
|
|
538
|
+
|
|
539
|
+
<div class="p-4 space-y-4">
|
|
540
|
+
<ng-container *ngTemplateOutlet="fullEditorTpl"></ng-container>
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
</p-dialog>
|
|
544
|
+
}
|
|
545
|
+
@else{
|
|
546
|
+
<ng-container *ngTemplateOutlet="fullEditorTpl"></ng-container>
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
<!-- FULL MODE -->
|
|
551
|
+
<ng-template #fullEditorTpl>
|
|
552
|
+
<!-- Your existing full UI layout here -->
|
|
553
|
+
<div class="flex flex-col gap-3">
|
|
554
|
+
|
|
555
|
+
<!-- Expression preview -->
|
|
556
|
+
<div class="border rounded-md p-2 bg-gray-50 flex flex-wrap gap-2 min-h-[40px] items-center">
|
|
557
|
+
@for (token of tokens; track $index) {
|
|
558
|
+
<span class="px-2 py-1 rounded bg-blue-100 text-blue-800 flex items-center gap-1">
|
|
559
|
+
{{ token.label | translate }}
|
|
560
|
+
<button type="button" pButton icon="pi pi-times"
|
|
561
|
+
class="p-button-rounded p-button-text p-button-sm"
|
|
562
|
+
(click)="removeToken($index)">
|
|
563
|
+
</button>
|
|
564
|
+
</span>
|
|
565
|
+
}
|
|
566
|
+
</div>
|
|
567
|
+
|
|
568
|
+
<!-- Autocomplete for suggestions -->
|
|
569
|
+
<p-autoComplete
|
|
570
|
+
[(ngModel)]="selectedSuggestion"
|
|
571
|
+
field="label"
|
|
572
|
+
[suggestions]="filteredSuggestions"
|
|
573
|
+
(completeMethod)="filterSuggestions($event)"
|
|
574
|
+
(onSelect)="onSuggestionSelected($event)"
|
|
575
|
+
placeholder="اكتب للبحث عن الحقول أو العمليات أو الدوال..."
|
|
576
|
+
[forceSelection]="false"
|
|
577
|
+
[dropdown]="true"
|
|
578
|
+
dropdownMode="current"
|
|
579
|
+
appendTo="body"
|
|
580
|
+
class="w-full"
|
|
581
|
+
>
|
|
582
|
+
<ng-template let-suggestion pTemplate="item">
|
|
583
|
+
<div>
|
|
584
|
+
<strong>{{ suggestion.label | translate}}</strong>
|
|
585
|
+
<small class="block text-gray-500">{{ suggestion.detail| translate }}</small>
|
|
586
|
+
</div>
|
|
587
|
+
</ng-template>
|
|
588
|
+
</p-autoComplete>
|
|
589
|
+
|
|
590
|
+
<!-- Add custom value -->
|
|
591
|
+
<div class="flex gap-2">
|
|
592
|
+
<input pInputText type="text" [(ngModel)]="customValue" placeholder="أدخل قيمة ثابتة..." class="flex-1">
|
|
593
|
+
<button pButton label="إضافة" icon="pi pi-plus" (click)="addCustomToken()" class="p-button-sm" type="button"></button>
|
|
594
|
+
</div>
|
|
595
|
+
|
|
596
|
+
<!-- Parameter input dialog -->
|
|
597
|
+
<p-dialog [(visible)]="displayDialog" [modal]="false" [closable]="false" [style]="{width: '400px'}">
|
|
598
|
+
<ng-template pTemplate="header">
|
|
599
|
+
{{ (dialogMode === 'rule' ? 'اختر القاعدة' : 'اختر الإجازة') | translate }}
|
|
600
|
+
</ng-template>
|
|
601
|
+
|
|
602
|
+
<div class="p-4 space-y-4">
|
|
603
|
+
<p-autoComplete
|
|
604
|
+
#autoComp
|
|
605
|
+
[(ngModel)]="dialogSelectedRule"
|
|
606
|
+
field="name"
|
|
607
|
+
optionLabel="name"
|
|
608
|
+
[suggestions]="filteredRuleSuggestions"
|
|
609
|
+
(completeMethod)="search($event)"
|
|
610
|
+
(onSelect)="onSuggestionRule($event)"
|
|
611
|
+
placeholder="{{ dialogMode === 'rule' ? 'ابحث عن قاعدة' : 'ابحث عن إجازة' }}"
|
|
612
|
+
[forceSelection]="true"
|
|
613
|
+
[dropdown]="true"
|
|
614
|
+
dropdownMode="current"
|
|
615
|
+
appendTo="body"
|
|
616
|
+
class="w-full rounded-none"
|
|
617
|
+
>
|
|
618
|
+
<ng-template let-suggestion pTemplate="item">
|
|
619
|
+
<div>
|
|
620
|
+
<strong>{{ suggestion.name | translate}}</strong>
|
|
621
|
+
<small class="block text-gray-500">{{ suggestion.description | translate}}</small>
|
|
622
|
+
</div>
|
|
623
|
+
</ng-template>
|
|
624
|
+
</p-autoComplete>
|
|
625
|
+
</div>
|
|
626
|
+
|
|
627
|
+
<p-footer class="flex justify-end gap-2">
|
|
628
|
+
<button type="button" pButton label="إلغاء" icon="pi pi-times" class="p-button-text" severity="danger" (click)="cancelDialog()"></button>
|
|
629
|
+
<button type="button" pButton label="موافق" icon="pi pi-check" (click)="confirmDialog()" [disabled]="!dialogSelectedRule"></button>
|
|
630
|
+
</p-footer>
|
|
631
|
+
</p-dialog>
|
|
632
|
+
</div>
|
|
633
|
+
</ng-template>
|
|
634
|
+
</div>
|
|
635
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i4.AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "appendTo"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "component", type: i5.Footer, selector: "p-footer" }, { kind: "directive", type: i5.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i7.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i8.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }] });
|
|
636
|
+
}
|
|
637
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ConditionExpressionBuilderType, decorators: [{
|
|
638
|
+
type: Component,
|
|
639
|
+
args: [{
|
|
640
|
+
selector: 'condition-expression-builder',
|
|
641
|
+
standalone: true,
|
|
642
|
+
imports: [
|
|
643
|
+
CommonModule,
|
|
644
|
+
FormsModule,
|
|
645
|
+
AutoCompleteModule,
|
|
646
|
+
Chip,
|
|
647
|
+
ButtonModule,
|
|
648
|
+
InputTextModule,
|
|
649
|
+
DialogModule,
|
|
650
|
+
PopoverModule,
|
|
651
|
+
TranslateModule
|
|
652
|
+
],
|
|
653
|
+
providers: [BaseService],
|
|
654
|
+
template: `
|
|
655
|
+
<div class="flex flex-col gap-3">
|
|
656
|
+
|
|
657
|
+
<!-- TABLE MODE -->
|
|
658
|
+
@if (displayMode === 'table') {
|
|
659
|
+
<div class="flex gap-2">
|
|
660
|
+
<div class="flex flex-wrap flex-1 gap-1">
|
|
661
|
+
<div class="border rounded-md p-2 bg-gray-50 flex flex-wrap gap-2 min-h-[40px] items-center">
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
@for (token of tokens; track $index) {
|
|
665
|
+
<span class="px-2 py-1 rounded bg-blue-100 text-blue-800 flex items-center gap-1">
|
|
666
|
+
{{ token.label | translate }}
|
|
667
|
+
</span>
|
|
668
|
+
}
|
|
669
|
+
</div>
|
|
670
|
+
</div>
|
|
671
|
+
<button type="button" pButton icon="pi pi-pencil" label=""
|
|
672
|
+
class="p-button-sm"
|
|
673
|
+
(click)="displayEditDialog = true"></button>
|
|
674
|
+
</div>
|
|
675
|
+
|
|
676
|
+
<!-- Dialog with full editor inside -->
|
|
677
|
+
<p-dialog [(visible)]="displayEditDialog" [modal]="false" [style]="{width: '700px'}">
|
|
678
|
+
|
|
679
|
+
<ng-template pTemplate="header">
|
|
680
|
+
{{ editDialogTitle | translate }}
|
|
681
|
+
</ng-template>
|
|
682
|
+
|
|
683
|
+
<div class="p-4 space-y-4">
|
|
684
|
+
<ng-container *ngTemplateOutlet="fullEditorTpl"></ng-container>
|
|
685
|
+
</div>
|
|
686
|
+
|
|
687
|
+
</p-dialog>
|
|
688
|
+
}
|
|
689
|
+
@else{
|
|
690
|
+
<ng-container *ngTemplateOutlet="fullEditorTpl"></ng-container>
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
<!-- FULL MODE -->
|
|
695
|
+
<ng-template #fullEditorTpl>
|
|
696
|
+
<!-- Your existing full UI layout here -->
|
|
697
|
+
<div class="flex flex-col gap-3">
|
|
698
|
+
|
|
699
|
+
<!-- Expression preview -->
|
|
700
|
+
<div class="border rounded-md p-2 bg-gray-50 flex flex-wrap gap-2 min-h-[40px] items-center">
|
|
701
|
+
@for (token of tokens; track $index) {
|
|
702
|
+
<span class="px-2 py-1 rounded bg-blue-100 text-blue-800 flex items-center gap-1">
|
|
703
|
+
{{ token.label | translate }}
|
|
704
|
+
<button type="button" pButton icon="pi pi-times"
|
|
705
|
+
class="p-button-rounded p-button-text p-button-sm"
|
|
706
|
+
(click)="removeToken($index)">
|
|
707
|
+
</button>
|
|
708
|
+
</span>
|
|
709
|
+
}
|
|
710
|
+
</div>
|
|
711
|
+
|
|
712
|
+
<!-- Autocomplete for suggestions -->
|
|
713
|
+
<p-autoComplete
|
|
714
|
+
[(ngModel)]="selectedSuggestion"
|
|
715
|
+
field="label"
|
|
716
|
+
[suggestions]="filteredSuggestions"
|
|
717
|
+
(completeMethod)="filterSuggestions($event)"
|
|
718
|
+
(onSelect)="onSuggestionSelected($event)"
|
|
719
|
+
placeholder="اكتب للبحث عن الحقول أو العمليات أو الدوال..."
|
|
720
|
+
[forceSelection]="false"
|
|
721
|
+
[dropdown]="true"
|
|
722
|
+
dropdownMode="current"
|
|
723
|
+
appendTo="body"
|
|
724
|
+
class="w-full"
|
|
725
|
+
>
|
|
726
|
+
<ng-template let-suggestion pTemplate="item">
|
|
727
|
+
<div>
|
|
728
|
+
<strong>{{ suggestion.label | translate}}</strong>
|
|
729
|
+
<small class="block text-gray-500">{{ suggestion.detail| translate }}</small>
|
|
730
|
+
</div>
|
|
731
|
+
</ng-template>
|
|
732
|
+
</p-autoComplete>
|
|
733
|
+
|
|
734
|
+
<!-- Add custom value -->
|
|
735
|
+
<div class="flex gap-2">
|
|
736
|
+
<input pInputText type="text" [(ngModel)]="customValue" placeholder="أدخل قيمة ثابتة..." class="flex-1">
|
|
737
|
+
<button pButton label="إضافة" icon="pi pi-plus" (click)="addCustomToken()" class="p-button-sm" type="button"></button>
|
|
738
|
+
</div>
|
|
739
|
+
|
|
740
|
+
<!-- Parameter input dialog -->
|
|
741
|
+
<p-dialog [(visible)]="displayDialog" [modal]="false" [closable]="false" [style]="{width: '400px'}">
|
|
742
|
+
<ng-template pTemplate="header">
|
|
743
|
+
{{ (dialogMode === 'rule' ? 'اختر القاعدة' : 'اختر الإجازة') | translate }}
|
|
744
|
+
</ng-template>
|
|
745
|
+
|
|
746
|
+
<div class="p-4 space-y-4">
|
|
747
|
+
<p-autoComplete
|
|
748
|
+
#autoComp
|
|
749
|
+
[(ngModel)]="dialogSelectedRule"
|
|
750
|
+
field="name"
|
|
751
|
+
optionLabel="name"
|
|
752
|
+
[suggestions]="filteredRuleSuggestions"
|
|
753
|
+
(completeMethod)="search($event)"
|
|
754
|
+
(onSelect)="onSuggestionRule($event)"
|
|
755
|
+
placeholder="{{ dialogMode === 'rule' ? 'ابحث عن قاعدة' : 'ابحث عن إجازة' }}"
|
|
756
|
+
[forceSelection]="true"
|
|
757
|
+
[dropdown]="true"
|
|
758
|
+
dropdownMode="current"
|
|
759
|
+
appendTo="body"
|
|
760
|
+
class="w-full rounded-none"
|
|
761
|
+
>
|
|
762
|
+
<ng-template let-suggestion pTemplate="item">
|
|
763
|
+
<div>
|
|
764
|
+
<strong>{{ suggestion.name | translate}}</strong>
|
|
765
|
+
<small class="block text-gray-500">{{ suggestion.description | translate}}</small>
|
|
766
|
+
</div>
|
|
767
|
+
</ng-template>
|
|
768
|
+
</p-autoComplete>
|
|
769
|
+
</div>
|
|
770
|
+
|
|
771
|
+
<p-footer class="flex justify-end gap-2">
|
|
772
|
+
<button type="button" pButton label="إلغاء" icon="pi pi-times" class="p-button-text" severity="danger" (click)="cancelDialog()"></button>
|
|
773
|
+
<button type="button" pButton label="موافق" icon="pi pi-check" (click)="confirmDialog()" [disabled]="!dialogSelectedRule"></button>
|
|
774
|
+
</p-footer>
|
|
775
|
+
</p-dialog>
|
|
776
|
+
</div>
|
|
777
|
+
</ng-template>
|
|
778
|
+
</div>
|
|
779
|
+
`
|
|
780
|
+
}]
|
|
781
|
+
}], ctorParameters: () => [{ type: i1.BaseService }, { type: i0.ChangeDetectorRef }], propDecorators: { autoComp: [{
|
|
782
|
+
type: ViewChild,
|
|
783
|
+
args: ['autoComp']
|
|
784
|
+
}], op: [{
|
|
785
|
+
type: ViewChild,
|
|
786
|
+
args: ['op']
|
|
787
|
+
}] } });
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Generated bundle index. Do not edit.
|
|
791
|
+
*/
|
|
792
|
+
|
|
793
|
+
export { ConditionExpressionBuilderType, suggestions };
|
|
794
|
+
//# sourceMappingURL=elite.framework-ng.core-src-lib-components-condition-editor.mjs.map
|