@propbinder/mobile-design 0.2.34 → 0.2.36

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.
@@ -15144,8 +15144,10 @@ class DsMobileChatModalComponent {
15144
15144
  }, 150);
15145
15145
  });
15146
15146
  });
15147
- // In a real app, you would send this to your backend
15148
- // this.chatService.sendMessage(this.chatData.participant.id, event.content, event.attachments);
15147
+ // Executing the onSend callback if provided
15148
+ if (this.chatData.onSend) {
15149
+ this.chatData.onSend(event.content, event.attachments || []);
15150
+ }
15149
15151
  }
15150
15152
  /**
15151
15153
  * Handle attachment click
@@ -15251,8 +15253,28 @@ class DsMobileChatModalComponent {
15251
15253
  * Handle file attachment click
15252
15254
  */
15253
15255
  handleFileAttachmentClick(fileAttachment) {
15254
- console.log('[ChatModal] File attachment clicked:', fileAttachment);
15255
- // In a real app, you would open the file viewer
15256
+ // If a custom handler is provided, use it
15257
+ if (this.chatData.onFileClick) {
15258
+ this.chatData.onFileClick(fileAttachment);
15259
+ return;
15260
+ }
15261
+ // Default behavior: Try to open/download the file
15262
+ const url = fileAttachment.src || fileAttachment.url;
15263
+ if (url) {
15264
+ const link = document.createElement('a');
15265
+ link.href = url;
15266
+ link.target = '_blank';
15267
+ // If it has a name, setting download attribute suggests downloading
15268
+ if (fileAttachment.name) {
15269
+ link.download = fileAttachment.name;
15270
+ }
15271
+ document.body.appendChild(link);
15272
+ link.click();
15273
+ document.body.removeChild(link);
15274
+ }
15275
+ else {
15276
+ console.warn('[ChatModal] No URL or source for file attachment:', fileAttachment);
15277
+ }
15256
15278
  }
15257
15279
  /**
15258
15280
  * Handle image attachment click - opens lightbox
@@ -15809,7 +15831,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
15809
15831
  * ],
15810
15832
  * currentUserId: '456',
15811
15833
  * currentUserInitials: 'JD',
15812
- * autoFocus: true
15834
+ * currentUserInitials: 'JD',
15835
+ * autoFocus: true,
15836
+ * onSend: async (message, attachments) => {
15837
+ * console.log('Sending message:', message);
15838
+ * // await this.chatService.sendMessage(participant.id, message, attachments);
15839
+ * },
15840
+ * onFileClick: (file) => {
15841
+ * console.log('File clicked:', file);
15842
+ * // window.open(file.url, '_blank');
15843
+ * }
15813
15844
  * });
15814
15845
  * }
15815
15846
  * ```
@@ -16119,15 +16150,7 @@ class DsMobileNewInquiryModalComponent {
16119
16150
  }
16120
16151
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: DsMobileNewInquiryModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16121
16152
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: DsMobileNewInquiryModalComponent, isStandalone: true, selector: "ds-mobile-new-inquiry-modal", inputs: { loading: "loading", error: "error", onSubmit: "onSubmit", titlePlaceholder: "titlePlaceholder", descriptionPlaceholder: "descriptionPlaceholder", submitButtonLabel: "submitButtonLabel" }, viewQueries: [{ propertyName: "titleInputRef", first: true, predicate: ["titleInput"], descendants: true, read: ElementRef }, { propertyName: "titleInput", first: true, predicate: ["titleInput"], descendants: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0, template: `
16122
- <ds-mobile-modal-base
16123
- [loading]="loading"
16124
- [error]="error"
16125
- [showHeader]="false"
16126
- [hasFixedBottom]="true"
16127
- [enableKeyboardHandling]="true"
16128
- [isAutoHeight]="true"
16129
- closeButtonLabel="Close"
16130
- >
16153
+ <ds-mobile-modal-base [loading]="loading" [error]="error" [showHeader]="false" [hasFixedBottom]="true" [enableKeyboardHandling]="true" closeButtonLabel="Close">
16131
16154
  <!-- Form Content -->
16132
16155
  <ds-mobile-section>
16133
16156
  <!-- Title Field (Large Ghost Textarea) -->
@@ -16207,15 +16230,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
16207
16230
  DsMobileAttachmentPreviewComponent,
16208
16231
  DsMobileSectionComponent,
16209
16232
  ], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: `
16210
- <ds-mobile-modal-base
16211
- [loading]="loading"
16212
- [error]="error"
16213
- [showHeader]="false"
16214
- [hasFixedBottom]="true"
16215
- [enableKeyboardHandling]="true"
16216
- [isAutoHeight]="true"
16217
- closeButtonLabel="Close"
16218
- >
16233
+ <ds-mobile-modal-base [loading]="loading" [error]="error" [showHeader]="false" [hasFixedBottom]="true" [enableKeyboardHandling]="true" closeButtonLabel="Close">
16219
16234
  <!-- Form Content -->
16220
16235
  <ds-mobile-section>
16221
16236
  <!-- Title Field (Large Ghost Textarea) -->
@@ -16359,11 +16374,6 @@ class DsMobileNewInquiryModalService extends BaseModalService {
16359
16374
  ...(options?.submitButtonLabel && { submitButtonLabel: options.submitButtonLabel }),
16360
16375
  }, {
16361
16376
  keyboardClose: false, // Don't close on keyboard hide for this modal
16362
- cssClass: ['ds-modal-base', 'auto-height'],
16363
- breakpoints: [0, 1],
16364
- initialBreakpoint: 1,
16365
- handle: false,
16366
- presentingElement: undefined,
16367
16377
  });
16368
16378
  console.log('[NewInquiryModal] Modal created, presenting...');
16369
16379
  await modal.present();