@elite.framework/ng.core 1.0.29 → 1.0.30

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.
@@ -60,7 +60,7 @@ import * as i2$3 from 'primeng/table';
60
60
  import { TableModule } from 'primeng/table';
61
61
  import * as i5$2 from 'primeng/drawer';
62
62
  import { DrawerModule, Drawer } from 'primeng/drawer';
63
- import { SwalService as SwalService$1 } from '@framework/ng.core';
63
+ import Swal from 'sweetalert2';
64
64
  import * as i2$4 from 'primeng/datepicker';
65
65
  import { DatePickerModule } from 'primeng/datepicker';
66
66
  import { TabsModule } from 'primeng/tabs';
@@ -77,7 +77,6 @@ import * as i2$6 from 'primeng/textarea';
77
77
  import { TextareaModule } from 'primeng/textarea';
78
78
  import * as i3$4 from 'primeng/radiobutton';
79
79
  import { RadioButtonModule } from 'primeng/radiobutton';
80
- import Swal from 'sweetalert2';
81
80
 
82
81
  class ODataQueryBuilderComponent {
83
82
  set entityFields(fields) {
@@ -3184,10 +3183,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
3184
3183
  type: Input
3185
3184
  }] } });
3186
3185
 
3186
+ // app/shared/services/swal.service.ts
3187
+ class SwalService {
3188
+ /** رسالة تأكيد قبل تنفيذ إجراء */
3189
+ confirm(title = 'هل أنت متأكد؟', text = 'لن يمكنك التراجع عن هذا الإجراء', confirmButtonText = 'نعم', cancelButtonText = 'إلغاء') {
3190
+ return Swal.fire({
3191
+ icon: 'warning',
3192
+ title,
3193
+ text,
3194
+ showCancelButton: true,
3195
+ confirmButtonText,
3196
+ cancelButtonText,
3197
+ // reverseButtons: true,
3198
+ customClass: {
3199
+ container: 'swal2-container' // ✅ أضف هذه الفئة
3200
+ }
3201
+ });
3202
+ }
3203
+ /** رسالة نجاح */
3204
+ success(title, text, timer = 2000) {
3205
+ return Swal.fire({
3206
+ icon: 'success',
3207
+ title,
3208
+ text,
3209
+ timer,
3210
+ showConfirmButton: false,
3211
+ customClass: {
3212
+ container: 'swal2-container' // ✅ أضف هذه الفئة
3213
+ }
3214
+ });
3215
+ }
3216
+ /** رسالة خطأ */
3217
+ error(title, text, footer) {
3218
+ return Swal.fire({
3219
+ icon: 'error',
3220
+ title,
3221
+ text,
3222
+ footer,
3223
+ customClass: {
3224
+ container: 'swal2-container' // ✅ أضف هذه الفئة
3225
+ }
3226
+ });
3227
+ }
3228
+ /** رسالة معلومات */
3229
+ info(title, text) {
3230
+ return Swal.fire({
3231
+ icon: 'info',
3232
+ title,
3233
+ text,
3234
+ });
3235
+ }
3236
+ /** عرض نافذة SweetAlert2 بأي خيارات تريد */
3237
+ alert(options) {
3238
+ return Swal.fire(options);
3239
+ }
3240
+ /** Toast بسيط قابل لإعادة الاستخدام */
3241
+ toast(title, icon = 'info', position = 'top-end', timer = 3000) {
3242
+ const Toast = Swal.mixin({
3243
+ toast: true,
3244
+ position,
3245
+ timer,
3246
+ showConfirmButton: false,
3247
+ });
3248
+ Toast.fire({ icon, title });
3249
+ }
3250
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SwalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3251
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SwalService, providedIn: 'root' });
3252
+ }
3253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SwalService, decorators: [{
3254
+ type: Injectable,
3255
+ args: [{ providedIn: 'root' }]
3256
+ }] });
3257
+
3187
3258
  class GenericCrudTableComponent {
3188
3259
  genericTable;
3189
3260
  translate = inject(TranslateService);
3190
- swalService = inject(SwalService$1);
3261
+ swalService = inject(SwalService);
3191
3262
  home = { icon: 'pi pi-home', routerLink: '/' };
3192
3263
  data = [];
3193
3264
  formFields_ = []; // <-- هنا
@@ -5976,7 +6047,7 @@ class BaseCrud {
5976
6047
  currentFilters = {};
5977
6048
  mode = '';
5978
6049
  scrollHeight = '400px';
5979
- swalService = inject(SwalService$1);
6050
+ swalService = inject(SwalService);
5980
6051
  dialogRef;
5981
6052
  dialogVisible = false;
5982
6053
  drawerVisible = false;
@@ -6907,78 +6978,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
6907
6978
  args: [REQUEST]
6908
6979
  }] }] });
6909
6980
 
6910
- // app/shared/services/swal.service.ts
6911
- class SwalService {
6912
- /** رسالة تأكيد قبل تنفيذ إجراء */
6913
- confirm(title = 'هل أنت متأكد؟', text = 'لن يمكنك التراجع عن هذا الإجراء', confirmButtonText = 'نعم', cancelButtonText = 'إلغاء') {
6914
- return Swal.fire({
6915
- icon: 'warning',
6916
- title,
6917
- text,
6918
- showCancelButton: true,
6919
- confirmButtonText,
6920
- cancelButtonText,
6921
- // reverseButtons: true,
6922
- customClass: {
6923
- container: 'swal2-container' // ✅ أضف هذه الفئة
6924
- }
6925
- });
6926
- }
6927
- /** رسالة نجاح */
6928
- success(title, text, timer = 2000) {
6929
- return Swal.fire({
6930
- icon: 'success',
6931
- title,
6932
- text,
6933
- timer,
6934
- showConfirmButton: false,
6935
- customClass: {
6936
- container: 'swal2-container' // ✅ أضف هذه الفئة
6937
- }
6938
- });
6939
- }
6940
- /** رسالة خطأ */
6941
- error(title, text, footer) {
6942
- return Swal.fire({
6943
- icon: 'error',
6944
- title,
6945
- text,
6946
- footer,
6947
- customClass: {
6948
- container: 'swal2-container' // ✅ أضف هذه الفئة
6949
- }
6950
- });
6951
- }
6952
- /** رسالة معلومات */
6953
- info(title, text) {
6954
- return Swal.fire({
6955
- icon: 'info',
6956
- title,
6957
- text,
6958
- });
6959
- }
6960
- /** عرض نافذة SweetAlert2 بأي خيارات تريد */
6961
- alert(options) {
6962
- return Swal.fire(options);
6963
- }
6964
- /** Toast بسيط قابل لإعادة الاستخدام */
6965
- toast(title, icon = 'info', position = 'top-end', timer = 3000) {
6966
- const Toast = Swal.mixin({
6967
- toast: true,
6968
- position,
6969
- timer,
6970
- showConfirmButton: false,
6971
- });
6972
- Toast.fire({ icon, title });
6973
- }
6974
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SwalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
6975
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SwalService, providedIn: 'root' });
6976
- }
6977
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: SwalService, decorators: [{
6978
- type: Injectable,
6979
- args: [{ providedIn: 'root' }]
6980
- }] });
6981
-
6982
6981
  /*
6983
6982
  * Public API Surface of @framework/ng.core
6984
6983
  */