imm-element-ui 2.6.9 → 2.7.0

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.
@@ -7076,6 +7076,12 @@ class UploadRenderer {
7076
7076
  this.fileList = this.toFileList(params.value);
7077
7077
  return true;
7078
7078
  }
7079
+ choose(callback) {
7080
+ if (this.isDisabled() || this.loading) {
7081
+ return;
7082
+ }
7083
+ callback();
7084
+ }
7079
7085
  uploadHandler(event, fu) {
7080
7086
  const files = Array.from(event.files || []);
7081
7087
  if (!files.length || this.isDisabled()) {
@@ -7174,32 +7180,33 @@ class UploadRenderer {
7174
7180
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UploadRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7175
7181
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: UploadRenderer, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
7176
7182
  <div class="upload-renderer">
7177
- <p-fileUpload
7178
- #fu
7179
- auto
7180
- mode="basic"
7181
- [name]="uploadParams.name || 'file'"
7182
- [multiple]="uploadParams.multiple ?? true"
7183
- [accept]="uploadParams.accept"
7184
- [maxFileSize]="uploadParams.maxFileSize"
7185
- [fileLimit]="uploadParams.fileLimit"
7186
- [withCredentials]="uploadParams.withCredentials ?? false"
7187
- [customUpload]="true"
7188
- [disabled]="isDisabled() || loading"
7189
- mode="advanced"
7190
- [styleClass]="'upload-renderer-choose'"
7191
- (uploadHandler)="uploadHandler($event, fu)">
7192
- <ng-template
7193
- #header
7194
- let-chooseCallback="chooseCallback">
7195
- <p-button
7196
- icon="pi pi-cloud-upload"
7197
- [text]="true"
7198
- size="small"
7199
- [disabled]="isDisabled() || loading"
7200
- (onClick)="chooseCallback()" />
7201
- </ng-template>
7202
- </p-fileUpload>
7183
+ @if (!isDisabled()) {
7184
+ <p-fileUpload
7185
+ #fu
7186
+ auto
7187
+ mode="advanced"
7188
+ [name]="uploadParams.name || 'file'"
7189
+ [multiple]="uploadParams.multiple ?? true"
7190
+ [accept]="uploadParams.accept"
7191
+ [maxFileSize]="uploadParams.maxFileSize"
7192
+ [fileLimit]="uploadParams.fileLimit"
7193
+ [withCredentials]="uploadParams.withCredentials ?? false"
7194
+ [customUpload]="true"
7195
+ [disabled]="loading"
7196
+ [styleClass]="'upload-renderer-choose'"
7197
+ (uploadHandler)="uploadHandler($event, fu)">
7198
+ <ng-template
7199
+ #header
7200
+ let-chooseCallback="chooseCallback">
7201
+ <p-button
7202
+ icon="pi pi-cloud-upload"
7203
+ [text]="true"
7204
+ size="small"
7205
+ [disabled]="loading"
7206
+ (onClick)="choose(chooseCallback)" />
7207
+ </ng-template>
7208
+ </p-fileUpload>
7209
+ }
7203
7210
 
7204
7211
  <div class="upload-renderer-files">
7205
7212
  @for (file of fileList; track index; let index = $index) {
@@ -7212,13 +7219,15 @@ class UploadRenderer {
7212
7219
  (click)="$event.stopPropagation()"
7213
7220
  >{{ file }}</a
7214
7221
  >
7215
- <p-button
7216
- icon="pi pi-times"
7217
- severity="danger"
7218
- size="small"
7219
- [text]="true"
7220
- [disabled]="isDisabled() || loading"
7221
- (onClick)="deleteHandler(file, index)" />
7222
+ @if (!isDisabled()) {
7223
+ <p-button
7224
+ icon="pi pi-times"
7225
+ severity="danger"
7226
+ size="small"
7227
+ [text]="true"
7228
+ [disabled]="loading"
7229
+ (onClick)="deleteHandler(file, index)" />
7230
+ }
7222
7231
  </div>
7223
7232
  }
7224
7233
  </div>
@@ -7229,32 +7238,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7229
7238
  type: Component,
7230
7239
  args: [{ standalone: true, imports: [ButtonModule, FileUpload], template: `
7231
7240
  <div class="upload-renderer">
7232
- <p-fileUpload
7233
- #fu
7234
- auto
7235
- mode="basic"
7236
- [name]="uploadParams.name || 'file'"
7237
- [multiple]="uploadParams.multiple ?? true"
7238
- [accept]="uploadParams.accept"
7239
- [maxFileSize]="uploadParams.maxFileSize"
7240
- [fileLimit]="uploadParams.fileLimit"
7241
- [withCredentials]="uploadParams.withCredentials ?? false"
7242
- [customUpload]="true"
7243
- [disabled]="isDisabled() || loading"
7244
- mode="advanced"
7245
- [styleClass]="'upload-renderer-choose'"
7246
- (uploadHandler)="uploadHandler($event, fu)">
7247
- <ng-template
7248
- #header
7249
- let-chooseCallback="chooseCallback">
7250
- <p-button
7251
- icon="pi pi-cloud-upload"
7252
- [text]="true"
7253
- size="small"
7254
- [disabled]="isDisabled() || loading"
7255
- (onClick)="chooseCallback()" />
7256
- </ng-template>
7257
- </p-fileUpload>
7241
+ @if (!isDisabled()) {
7242
+ <p-fileUpload
7243
+ #fu
7244
+ auto
7245
+ mode="advanced"
7246
+ [name]="uploadParams.name || 'file'"
7247
+ [multiple]="uploadParams.multiple ?? true"
7248
+ [accept]="uploadParams.accept"
7249
+ [maxFileSize]="uploadParams.maxFileSize"
7250
+ [fileLimit]="uploadParams.fileLimit"
7251
+ [withCredentials]="uploadParams.withCredentials ?? false"
7252
+ [customUpload]="true"
7253
+ [disabled]="loading"
7254
+ [styleClass]="'upload-renderer-choose'"
7255
+ (uploadHandler)="uploadHandler($event, fu)">
7256
+ <ng-template
7257
+ #header
7258
+ let-chooseCallback="chooseCallback">
7259
+ <p-button
7260
+ icon="pi pi-cloud-upload"
7261
+ [text]="true"
7262
+ size="small"
7263
+ [disabled]="loading"
7264
+ (onClick)="choose(chooseCallback)" />
7265
+ </ng-template>
7266
+ </p-fileUpload>
7267
+ }
7258
7268
 
7259
7269
  <div class="upload-renderer-files">
7260
7270
  @for (file of fileList; track index; let index = $index) {
@@ -7267,13 +7277,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7267
7277
  (click)="$event.stopPropagation()"
7268
7278
  >{{ file }}</a
7269
7279
  >
7270
- <p-button
7271
- icon="pi pi-times"
7272
- severity="danger"
7273
- size="small"
7274
- [text]="true"
7275
- [disabled]="isDisabled() || loading"
7276
- (onClick)="deleteHandler(file, index)" />
7280
+ @if (!isDisabled()) {
7281
+ <p-button
7282
+ icon="pi pi-times"
7283
+ severity="danger"
7284
+ size="small"
7285
+ [text]="true"
7286
+ [disabled]="loading"
7287
+ (onClick)="deleteHandler(file, index)" />
7288
+ }
7277
7289
  </div>
7278
7290
  }
7279
7291
  </div>
@@ -7444,12 +7456,12 @@ class GridComponent {
7444
7456
  this.editingFix();
7445
7457
  }
7446
7458
  withGridContext(options) {
7447
- const gridDisabled = this.gridDisable();
7459
+ this.gridDisable();
7448
7460
  return {
7449
7461
  ...options,
7450
7462
  context: {
7451
7463
  ...(options.context || {}),
7452
- gridDisabled: () => gridDisabled,
7464
+ gridDisabled: () => this.gridDisable(),
7453
7465
  grid: () => this,
7454
7466
  },
7455
7467
  };