@acorex/components 18.12.21 → 18.12.23
Sign up to get free protection for your applications and to get access to all the features.
- package/conversation/lib/conversation-messages/conversation-message-audio/conversation-message-audio.component.d.ts +11 -32
- package/data-table/lib/columns/row-command-column.component.d.ts +3 -3
- package/esm2022/comment/lib/comment-item/comment-item.component.mjs +3 -3
- package/esm2022/conversation/lib/conversation-messages/conversation-message-audio/conversation-message-audio.component.mjs +30 -58
- package/esm2022/conversation/lib/services/conversation.service.mjs +1 -1
- package/esm2022/data-table/lib/columns/row-command-column.component.mjs +20 -10
- package/esm2022/datetime-box/lib/datetime-box.component.mjs +3 -3
- package/esm2022/drawer/lib/drawer/drawer-item/drawer.component.mjs +3 -1
- package/esm2022/image-editor/lib/image-editor-tools/image-editor-color-picker/image-editor-color-picker.component.mjs +6 -16
- package/esm2022/image-editor/lib/image-editor-tools/image-editor-crop/image-editor-crop.component.mjs +4 -3
- package/esm2022/image-editor/lib/image-editor-tools/image-editor-pen-mode-changer/image-editor-pen-mode-changer.component.mjs +4 -3
- package/esm2022/image-editor/lib/image-editor.module.mjs +8 -5
- package/esm2022/json-viewer/acorex-components-json-viewer.mjs +5 -0
- package/esm2022/json-viewer/index.mjs +3 -0
- package/esm2022/json-viewer/lib/json-viewer/json-viewer.component.mjs +35 -0
- package/esm2022/json-viewer/lib/json-viewer.module.mjs +23 -0
- package/esm2022/media-viewer/lib/media-viewer-thumbnail/media-viewer-thumbnail.component.mjs +5 -4
- package/esm2022/menu/lib/menu.module.mjs +2 -2
- package/esm2022/paint/lib/paint/paint-tools/paint-color-picker/paint-color-picker.component.mjs +5 -15
- package/esm2022/paint/lib/paint/paint-tools/paint-pen-mode-changer/paint-pen-mode-changer.component.mjs +4 -3
- package/esm2022/paint/lib/paint.module.mjs +8 -5
- package/esm2022/phone-box/lib/phone-box.component.mjs +26 -22
- package/esm2022/range-slider/lib/range-slider.component.mjs +7 -7
- package/esm2022/step-wizard/lib/step-wizard-item/step-wizard-item.component.mjs +2 -2
- package/esm2022/text-box/lib/text-box.component.mjs +5 -4
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +2 -2
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +29 -57
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +19 -9
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +2 -2
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +2 -0
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +19 -23
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +62 -0
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -0
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +4 -3
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-nav.mjs.map +1 -1
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +14 -18
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +26 -22
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +6 -6
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +2 -2
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +4 -3
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/image-editor/lib/image-editor-tools/image-editor-color-picker/image-editor-color-picker.component.d.ts +0 -10
- package/image-editor/lib/image-editor.module.d.ts +3 -2
- package/json-viewer/README.md +3 -0
- package/json-viewer/index.d.ts +2 -0
- package/json-viewer/lib/json-viewer/json-viewer.component.d.ts +11 -0
- package/json-viewer/lib/json-viewer.module.d.ts +10 -0
- package/media-viewer/lib/media-viewer-thumbnail/media-viewer-thumbnail.component.d.ts +1 -1
- package/package.json +54 -48
- package/paint/lib/paint/paint-tools/paint-color-picker/paint-color-picker.component.d.ts +0 -10
- package/paint/lib/paint.module.d.ts +3 -2
- package/phone-box/lib/phone-box.component.d.ts +24 -22
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AXEvent, MXInputBaseValueComponent, MXLookComponent, AXComponent, AXFocusableComponent, AXValuableComponent, MXBaseComponent, AXRippleDirective } from '@acorex/components/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { Component, ViewEncapsulation, signal, Injectable, inject, computed, input, output, forwardRef, ChangeDetectionStrategy, ViewChild, viewChild, HostBinding,
|
3
|
+
import { Component, ViewEncapsulation, signal, Injectable, inject, computed, input, output, forwardRef, ChangeDetectionStrategy, ViewChild, viewChild, HostBinding, afterNextRender, ViewContainerRef, NgModule, Optional, Inject } from '@angular/core';
|
4
4
|
import * as i1 from '@angular/forms';
|
5
5
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
6
6
|
import { classes } from 'polytype';
|
@@ -23,7 +23,6 @@ import * as i5 from '@acorex/components/popover';
|
|
23
23
|
import { AXPopoverModule } from '@acorex/components/popover';
|
24
24
|
import * as i5$1 from '@acorex/core/format';
|
25
25
|
import { AXFormatModule } from '@acorex/core/format';
|
26
|
-
import { fromEvent } from 'rxjs';
|
27
26
|
import * as i3$1 from '@acorex/components/range-slider';
|
28
27
|
import { AXRangeSliderModule } from '@acorex/components/range-slider';
|
29
28
|
import { AXFileService, AXFileModule } from '@acorex/core/file';
|
@@ -458,11 +457,8 @@ class AXConversationMessageAudioComponent extends AXConversationMessageBaseCompo
|
|
458
457
|
/**
|
459
458
|
* @ignore
|
460
459
|
*/
|
461
|
-
|
462
|
-
|
463
|
-
* @ignore
|
464
|
-
*/
|
465
|
-
this.renderer = inject(Renderer2);
|
460
|
+
// audioTag = viewChild<ElementRef<HTMLAudioElement>>('a');
|
461
|
+
this.audioTag = signal(new Audio());
|
466
462
|
/**
|
467
463
|
* @ignore
|
468
464
|
*/
|
@@ -484,18 +480,26 @@ class AXConversationMessageAudioComponent extends AXConversationMessageBaseCompo
|
|
484
480
|
*/
|
485
481
|
this.durationFormat = signal(0);
|
486
482
|
afterNextRender(() => {
|
487
|
-
this.
|
488
|
-
this.
|
483
|
+
this.audioTag().autoplay = false;
|
484
|
+
this.audioTag().src = this.message.content;
|
485
|
+
this.audioTag().addEventListener('ended', () => {
|
486
|
+
this.audioState.set('paused');
|
487
|
+
this.audioTag().pause();
|
488
|
+
this.audioTag().currentTime = 0;
|
489
|
+
this.currentTime.set(0);
|
490
|
+
});
|
491
|
+
this.audioTag().addEventListener('durationchange', () => {
|
492
|
+
if (this.audioTag().duration === Infinity)
|
493
|
+
return;
|
494
|
+
this.duration.set(this.audioTag().duration);
|
495
|
+
this.durationFormat.set(Math.ceil(this.audioTag().duration) * 1000);
|
496
|
+
});
|
497
|
+
this.audioTag().addEventListener('timeupdate', () => {
|
498
|
+
this.currentTime.set(this.audioTag().currentTime);
|
499
|
+
this.currentTimeFormat.set(Math.ceil(this.audioTag().currentTime * 1000));
|
500
|
+
});
|
489
501
|
});
|
490
502
|
}
|
491
|
-
/**
|
492
|
-
* @ignore
|
493
|
-
*/
|
494
|
-
eventListeners() {
|
495
|
-
this.ended();
|
496
|
-
this.durationChange();
|
497
|
-
this.timeUpdate();
|
498
|
-
}
|
499
503
|
/**
|
500
504
|
* Seeks to the specified time and resumes audio playback.
|
501
505
|
*
|
@@ -503,9 +507,7 @@ class AXConversationMessageAudioComponent extends AXConversationMessageBaseCompo
|
|
503
507
|
* @ignore
|
504
508
|
*/
|
505
509
|
clickHandler(e) {
|
506
|
-
this.audioTag().
|
507
|
-
this.audioTag().nativeElement.currentTime = e;
|
508
|
-
this.audioTag().nativeElement.play();
|
510
|
+
this.audioTag().currentTime = e;
|
509
511
|
}
|
510
512
|
/**
|
511
513
|
* Pauses the audio and updates the state to 'paused'.
|
@@ -513,7 +515,7 @@ class AXConversationMessageAudioComponent extends AXConversationMessageBaseCompo
|
|
513
515
|
*/
|
514
516
|
handlePauseClick() {
|
515
517
|
this.audioState.set('paused');
|
516
|
-
this.audioTag().
|
518
|
+
this.audioTag().pause();
|
517
519
|
}
|
518
520
|
/**
|
519
521
|
* Plays the audio and updates the state to 'playing'.\
|
@@ -521,7 +523,7 @@ class AXConversationMessageAudioComponent extends AXConversationMessageBaseCompo
|
|
521
523
|
*/
|
522
524
|
handlePlayClick() {
|
523
525
|
this.audioState.set('playing');
|
524
|
-
this.audioTag().
|
526
|
+
this.audioTag().play();
|
525
527
|
}
|
526
528
|
/**
|
527
529
|
* Toggles the playback rate of the audio between 1x, 1.5x, and 2x.
|
@@ -530,53 +532,23 @@ class AXConversationMessageAudioComponent extends AXConversationMessageBaseCompo
|
|
530
532
|
handleRateClick() {
|
531
533
|
if (this.audioRate() === 1) {
|
532
534
|
this.audioRate.set(1.5);
|
533
|
-
this.audioTag().
|
535
|
+
this.audioTag().playbackRate = 1.5;
|
534
536
|
}
|
535
537
|
else if (this.audioRate() === 1.5) {
|
536
538
|
this.audioRate.set(2);
|
537
|
-
this.audioTag().
|
539
|
+
this.audioTag().playbackRate = 2;
|
538
540
|
}
|
539
541
|
else if (this.audioRate() === 2) {
|
540
542
|
this.audioRate.set(1);
|
541
|
-
this.audioTag().
|
543
|
+
this.audioTag().playbackRate = 1;
|
542
544
|
}
|
543
545
|
}
|
544
|
-
/**
|
545
|
-
* @ignore
|
546
|
-
*/
|
547
|
-
ended() {
|
548
|
-
fromEvent(this.audioTag().nativeElement, 'ended').subscribe((e) => {
|
549
|
-
this.audioState.set('paused');
|
550
|
-
this.audioTag().nativeElement.pause();
|
551
|
-
this.audioTag().nativeElement.currentTime = 0;
|
552
|
-
});
|
553
|
-
}
|
554
|
-
/**
|
555
|
-
* @ignore
|
556
|
-
*/
|
557
|
-
durationChange() {
|
558
|
-
fromEvent(this.audioTag().nativeElement, 'durationchange').subscribe((e) => {
|
559
|
-
if (this.audioTag().nativeElement.duration === Infinity)
|
560
|
-
return;
|
561
|
-
this.duration.set(this.audioTag().nativeElement.duration);
|
562
|
-
this.durationFormat.set(Math.ceil(this.audioTag().nativeElement.duration) * 1000);
|
563
|
-
});
|
564
|
-
}
|
565
|
-
/**
|
566
|
-
* @ignore
|
567
|
-
*/
|
568
|
-
timeUpdate() {
|
569
|
-
fromEvent(this.audioTag().nativeElement, 'timeupdate').subscribe((e) => {
|
570
|
-
this.currentTime.set(this.audioTag().nativeElement.currentTime);
|
571
|
-
this.currentTimeFormat.set(Math.ceil(this.audioTag().nativeElement.currentTime * 1000));
|
572
|
-
});
|
573
|
-
}
|
574
546
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXConversationMessageAudioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
575
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXConversationMessageAudioComponent, selector: "ax-conversation-message-audio",
|
547
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXConversationMessageAudioComponent, selector: "ax-conversation-message-audio", usesInheritance: true, ngImport: i0, template: "<ax-prefix>\n <div class=\"ax-time-rate\">\n @switch (audioState()) {\n @case ('paused') {\n {{ currentTimeFormat() | format: 'time-duration' | async }}\n }\n @case ('playing') {\n {{ currentTimeFormat() | format: 'time-duration' | async }}\n }\n @default {\n {{ durationFormat() | format: 'time-duration' | async }}\n }\n }\n <button class=\"ax-audio-speed\" (click)=\"handleRateClick()\">{{ audioRate() }}X</button>\n </div>\n</ax-prefix>\n<div class=\"ax-conversation-controller\">\n @switch (audioState()) {\n @case ('playing') {\n <button (click)=\"handlePauseClick()\">\n <i class=\"ax-icon ax-icon-pause\"></i>\n </button>\n }\n @case ('paused') {\n <button (click)=\"handlePlayClick()\">\n <i class=\"ax-icon ax-icon-play\"></i>\n </button>\n }\n }\n</div>\n<ax-range-slider\n class=\"ax-modify-bgSlider\"\n (ngModelChange)=\"clickHandler($event)\"\n [max]=\"duration()\"\n [min]=\"0\"\n mode=\"single\"\n [ngModel]=\"currentTime()\"\n color=\"secondary\"\n>\n</ax-range-slider>\n", styles: [".ax-time-rate button{margin-inline-start:.3rem;background-color:rgba(var(--ax-color-primary-fore));color:rgba(var(--ax-color-neutral-950));border-radius:.2rem;min-width:2rem}.ax-modify-bgSlider{width:14rem;margin:0 1rem}\n"], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-sub-title, ax-placeholder, ax-overlay" }, { kind: "component", type: i3$1.AXRangeSliderComponent, selector: "ax-range-slider", inputs: ["disabled", "readonly", "orientation", "color", "values", "mode", "min", "max", "step", "snap", "tooltipMode", "snapMode", "hasStep", "hasSnap", "hasLable", "hasTooltip"], outputs: ["valuesChange"] }, { kind: "pipe", type: i4$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i5$1.AXFormatPipe, name: "format" }], encapsulation: i0.ViewEncapsulation.None }); }
|
576
548
|
}
|
577
549
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXConversationMessageAudioComponent, decorators: [{
|
578
550
|
type: Component,
|
579
|
-
args: [{ selector: 'ax-conversation-message-audio', encapsulation: ViewEncapsulation.None, template: "<
|
551
|
+
args: [{ selector: 'ax-conversation-message-audio', encapsulation: ViewEncapsulation.None, template: "<ax-prefix>\n <div class=\"ax-time-rate\">\n @switch (audioState()) {\n @case ('paused') {\n {{ currentTimeFormat() | format: 'time-duration' | async }}\n }\n @case ('playing') {\n {{ currentTimeFormat() | format: 'time-duration' | async }}\n }\n @default {\n {{ durationFormat() | format: 'time-duration' | async }}\n }\n }\n <button class=\"ax-audio-speed\" (click)=\"handleRateClick()\">{{ audioRate() }}X</button>\n </div>\n</ax-prefix>\n<div class=\"ax-conversation-controller\">\n @switch (audioState()) {\n @case ('playing') {\n <button (click)=\"handlePauseClick()\">\n <i class=\"ax-icon ax-icon-pause\"></i>\n </button>\n }\n @case ('paused') {\n <button (click)=\"handlePlayClick()\">\n <i class=\"ax-icon ax-icon-play\"></i>\n </button>\n }\n }\n</div>\n<ax-range-slider\n class=\"ax-modify-bgSlider\"\n (ngModelChange)=\"clickHandler($event)\"\n [max]=\"duration()\"\n [min]=\"0\"\n mode=\"single\"\n [ngModel]=\"currentTime()\"\n color=\"secondary\"\n>\n</ax-range-slider>\n", styles: [".ax-time-rate button{margin-inline-start:.3rem;background-color:rgba(var(--ax-color-primary-fore));color:rgba(var(--ax-color-neutral-950));border-radius:.2rem;min-width:2rem}.ax-modify-bgSlider{width:14rem;margin:0 1rem}\n"] }]
|
580
552
|
}], ctorParameters: () => [] });
|
581
553
|
|
582
554
|
/**
|