@mintplayer/ng-bootstrap 22.31.0 → 22.33.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.
- package/README.md +12 -11
- package/_bootstrap.scss +2 -4
- package/a11y/forms/package.json +4 -0
- package/fesm2022/mintplayer-ng-bootstrap-a11y-forms.mjs +120 -0
- package/fesm2022/mintplayer-ng-bootstrap-a11y-forms.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +3 -273
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +72 -139
- package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +34 -60
- package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +24 -27
- package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs +39 -17
- package/fesm2022/mintplayer-ng-bootstrap-breadcrumb.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs +26 -6
- package/fesm2022/mintplayer-ng-bootstrap-button-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +4 -8
- package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs +169 -240
- package/fesm2022/mintplayer-ng-bootstrap-card.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +9 -8
- package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs +6 -8
- package/fesm2022/mintplayer-ng-bootstrap-charts-hierarchy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs +31 -40
- package/fesm2022/mintplayer-ng-bootstrap-charts-sparkline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-charts-trend.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs +316 -211
- package/fesm2022/mintplayer-ng-bootstrap-checkbox.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs +26 -12
- package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +5 -5
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +87 -676
- package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs +52 -119
- package/fesm2022/mintplayer-ng-bootstrap-context-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +16 -24
- package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs +9 -9
- package/fesm2022/mintplayer-ng-bootstrap-datetime-picker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +5 -7
- package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +201 -197
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs +11 -19
- package/fesm2022/mintplayer-ng-bootstrap-file-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +64 -123
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs +19 -29
- package/fesm2022/mintplayer-ng-bootstrap-floating-labels.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-for.mjs +8 -4
- package/fesm2022/mintplayer-ng-bootstrap-for.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs +54 -35
- package/fesm2022/mintplayer-ng-bootstrap-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +72 -99
- package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs +23 -36
- package/fesm2022/mintplayer-ng-bootstrap-input-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs +45 -28
- package/fesm2022/mintplayer-ng-bootstrap-list-group.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +214 -19
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-marquee.mjs +27 -12
- package/fesm2022/mintplayer-ng-bootstrap-marquee.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +61 -245
- package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-multi-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-nav.mjs +92 -0
- package/fesm2022/mintplayer-ng-bootstrap-nav.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs +31 -15
- package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +49 -77
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +53 -393
- package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs +11 -9
- package/fesm2022/mintplayer-ng-bootstrap-otp-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +29 -49
- package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-parallax.mjs +21 -12
- package/fesm2022/mintplayer-ng-bootstrap-parallax.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs +12 -12
- package/fesm2022/mintplayer-ng-bootstrap-phone-input.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +27 -49
- package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs +29 -15
- package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +57 -253
- package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs +60 -335
- package/fesm2022/mintplayer-ng-bootstrap-priority-nav.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +48 -57
- package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs +11 -15
- package/fesm2022/mintplayer-ng-bootstrap-query-builder.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs +235 -168
- package/fesm2022/mintplayer-ng-bootstrap-radio.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs +86 -44
- package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +80 -137
- package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +29 -326
- package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs +47 -63
- package/fesm2022/mintplayer-ng-bootstrap-ribbon.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +16 -22
- package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +48 -171
- package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs +12 -10
- package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +52 -108
- package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +9 -9
- package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs +25 -11
- package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +6 -6
- package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +37 -32
- package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +61 -99
- package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs +31 -30
- package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-theming.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs +67 -306
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs +7 -9
- package/fesm2022/mintplayer-ng-bootstrap-timeline.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +14 -15
- package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +109 -143
- package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +51 -154
- package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs +9 -11
- package/fesm2022/mintplayer-ng-bootstrap-tree-select.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +11 -13
- package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +160 -232
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/nav/package.json +4 -0
- package/package.json +11 -28
- package/types/mintplayer-ng-bootstrap-a11y-forms.d.ts +64 -0
- package/types/mintplayer-ng-bootstrap-a11y.d.ts +3 -142
- package/types/mintplayer-ng-bootstrap-accordion.d.ts +51 -86
- package/types/mintplayer-ng-bootstrap-alert.d.ts +21 -28
- package/types/mintplayer-ng-bootstrap-badge.d.ts +13 -12
- package/types/mintplayer-ng-bootstrap-breadcrumb.d.ts +31 -8
- package/types/mintplayer-ng-bootstrap-button-group.d.ts +15 -4
- package/types/mintplayer-ng-bootstrap-calendar.d.ts +1 -5
- package/types/mintplayer-ng-bootstrap-card.d.ts +102 -76
- package/types/mintplayer-ng-bootstrap-carousel.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-charts-hierarchy.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-charts-sparkline.d.ts +24 -17
- package/types/mintplayer-ng-bootstrap-charts-trend.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-checkbox.d.ts +144 -92
- package/types/mintplayer-ng-bootstrap-close.d.ts +17 -5
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-color-picker.d.ts +42 -226
- package/types/mintplayer-ng-bootstrap-context-menu.d.ts +35 -17
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +23 -35
- package/types/mintplayer-ng-bootstrap-datepicker.d.ts +3 -7
- package/types/mintplayer-ng-bootstrap-datetime-picker.d.ts +3 -5
- package/types/mintplayer-ng-bootstrap-dock.d.ts +6 -8
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +122 -54
- package/types/mintplayer-ng-bootstrap-file-manager.d.ts +10 -20
- package/types/mintplayer-ng-bootstrap-file-upload.d.ts +62 -44
- package/types/mintplayer-ng-bootstrap-floating-labels.d.ts +12 -15
- package/types/mintplayer-ng-bootstrap-for.d.ts +5 -5
- package/types/mintplayer-ng-bootstrap-form.d.ts +33 -11
- package/types/mintplayer-ng-bootstrap-grid.d.ts +42 -21
- package/types/mintplayer-ng-bootstrap-input-group.d.ts +11 -22
- package/types/mintplayer-ng-bootstrap-list-group.d.ts +31 -10
- package/types/mintplayer-ng-bootstrap-machine.d.ts +107 -5
- package/types/mintplayer-ng-bootstrap-marquee.d.ts +18 -5
- package/types/mintplayer-ng-bootstrap-modal.d.ts +43 -84
- package/types/mintplayer-ng-bootstrap-multi-range.d.ts +4 -6
- package/types/mintplayer-ng-bootstrap-nav.d.ts +52 -0
- package/types/mintplayer-ng-bootstrap-navbar-toggler.d.ts +22 -6
- package/types/mintplayer-ng-bootstrap-navbar.d.ts +27 -38
- package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +35 -112
- package/types/mintplayer-ng-bootstrap-otp-input.d.ts +5 -4
- package/types/mintplayer-ng-bootstrap-pagination.d.ts +22 -34
- package/types/mintplayer-ng-bootstrap-parallax.d.ts +14 -4
- package/types/mintplayer-ng-bootstrap-phone-input.d.ts +6 -7
- package/types/mintplayer-ng-bootstrap-placeholder.d.ts +19 -18
- package/types/mintplayer-ng-bootstrap-playlist-toggler.d.ts +22 -6
- package/types/mintplayer-ng-bootstrap-popover.d.ts +36 -59
- package/types/mintplayer-ng-bootstrap-priority-nav.d.ts +80 -68
- package/types/mintplayer-ng-bootstrap-progress-bar.d.ts +35 -18
- package/types/mintplayer-ng-bootstrap-query-builder.d.ts +12 -20
- package/types/mintplayer-ng-bootstrap-radio.d.ts +112 -84
- package/types/mintplayer-ng-bootstrap-range.d.ts +36 -13
- package/types/mintplayer-ng-bootstrap-rating.d.ts +33 -42
- package/types/mintplayer-ng-bootstrap-resizable.d.ts +24 -114
- package/types/mintplayer-ng-bootstrap-ribbon.d.ts +21 -37
- package/types/mintplayer-ng-bootstrap-scheduler.d.ts +19 -27
- package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +26 -50
- package/types/mintplayer-ng-bootstrap-select.d.ts +9 -8
- package/types/mintplayer-ng-bootstrap-shell.d.ts +40 -63
- package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +5 -7
- package/types/mintplayer-ng-bootstrap-spinner.d.ts +14 -7
- package/types/mintplayer-ng-bootstrap-splitter.d.ts +3 -3
- package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +23 -13
- package/types/mintplayer-ng-bootstrap-tab-control.d.ts +61 -57
- package/types/mintplayer-ng-bootstrap-table.d.ts +23 -18
- package/types/mintplayer-ng-bootstrap-tile-manager.d.ts +94 -154
- package/types/mintplayer-ng-bootstrap-timeline.d.ts +23 -25
- package/types/mintplayer-ng-bootstrap-timepicker.d.ts +4 -8
- package/types/mintplayer-ng-bootstrap-toast.d.ts +94 -55
- package/types/mintplayer-ng-bootstrap-tooltip.d.ts +34 -33
- package/types/mintplayer-ng-bootstrap-tree-select.d.ts +14 -16
- package/types/mintplayer-ng-bootstrap-treeview.d.ts +12 -13
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +109 -133
- package/calendar-month/package.json +0 -4
- package/container/package.json +0 -4
- package/dropdown-divider/package.json +0 -4
- package/dropdown-menu/package.json +0 -4
- package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs +0 -136
- package/fesm2022/mintplayer-ng-bootstrap-calendar-month.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-container.mjs +0 -18
- package/fesm2022/mintplayer-ng-bootstrap-container.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs +0 -23
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-divider.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +0 -161
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs +0 -32
- package/fesm2022/mintplayer-ng-bootstrap-has-overlay.mjs.map +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs +0 -31
- package/fesm2022/mintplayer-ng-bootstrap-no-noscript.mjs.map +0 -1
- package/has-overlay/package.json +0 -4
- package/no-noscript/package.json +0 -4
- package/types/mintplayer-ng-bootstrap-calendar-month.d.ts +0 -54
- package/types/mintplayer-ng-bootstrap-container.d.ts +0 -8
- package/types/mintplayer-ng-bootstrap-dropdown-divider.d.ts +0 -8
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +0 -94
- package/types/mintplayer-ng-bootstrap-has-overlay.d.ts +0 -22
- package/types/mintplayer-ng-bootstrap-no-noscript.d.ts +0 -11
|
@@ -1,154 +1,95 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { inject, TemplateRef, Directive, ElementRef, model, input, booleanAttribute, output, contentChild, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { useHostAttrs, useCore, useScopedStyles, MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';
|
|
5
|
+
import { fileUploadCore, fileUploadScopedStyles } from '@mintplayer/ui-core/file-upload';
|
|
6
|
+
export { formatBytes } from '@mintplayer/ui-core/file-upload';
|
|
7
|
+
import { bootstrapProgress } from '@mintplayer/ui-core/bootstrap/progress';
|
|
8
|
+
import { bootstrapListGroup } from '@mintplayer/ui-core/bootstrap/list-group';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// Clamped: below 1 byte the log is negative, and past the last unit there is no name.
|
|
19
|
-
const i = Math.min(sizes.length - 1, Math.max(0, Math.floor(Math.log(value) / Math.log(k))));
|
|
20
|
-
return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
10
|
+
// GENERATED from the file-upload manifest (file-upload) by @mintplayer/nx-component-compiler. Do not edit.
|
|
11
|
+
/** The `fileTemplate` slot of `<bs-file-upload>`: `<ng-template bsFileUploadFileTemplate>` or `*bsFileUploadFileTemplate`. */
|
|
12
|
+
class BsFileUploadFileTemplateDirective {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.templateRef = inject(TemplateRef);
|
|
15
|
+
}
|
|
16
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
17
|
+
return true;
|
|
21
18
|
}
|
|
22
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type:
|
|
23
|
-
static { this.ɵ
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadFileTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
20
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsFileUploadFileTemplateDirective, isStandalone: true, selector: "[bsFileUploadFileTemplate]", ngImport: i0 }); }
|
|
24
21
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type:
|
|
26
|
-
type:
|
|
27
|
-
args: [{
|
|
28
|
-
name: 'bsFormatBytes',
|
|
29
|
-
pure: true,
|
|
30
|
-
}]
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadFileTemplateDirective, decorators: [{
|
|
23
|
+
type: Directive,
|
|
24
|
+
args: [{ selector: '[bsFileUploadFileTemplate]' }]
|
|
31
25
|
}] });
|
|
32
|
-
|
|
26
|
+
/**
|
|
27
|
+
* A file drop zone over a native file input, with the list of files added. Drop files on it, click
|
|
28
|
+
* it or use the browse button; each batch is added to the two-way `files` list, emitted as
|
|
29
|
+
* `filesDropped` and announced. Rows show the name, size and a progress bar the consumer updates;
|
|
30
|
+
* the `fileTemplate` slot replaces a row. With `name` the input submits its files with a form, no
|
|
31
|
+
* JavaScript needed.
|
|
32
|
+
*/
|
|
33
33
|
class BsFileUploadComponent {
|
|
34
|
+
#core;
|
|
34
35
|
constructor() {
|
|
35
|
-
|
|
36
|
+
/** The host element. */
|
|
37
|
+
this.elementRef = inject(ElementRef);
|
|
38
|
+
/** The consumer's aria-*, id and tabindex on the host, for the role-bearing node. */
|
|
39
|
+
this.hostAttrs = useHostAttrs();
|
|
40
|
+
this.files = model([], /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
42
|
+
this.name = input(null, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
44
|
+
this.accept = input(null, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
|
|
46
|
+
this.multiple = input(true, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
47
|
+
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
36
48
|
this.dropFilesCaption = input('Drop your files here', /* @ts-ignore */
|
|
37
49
|
...(ngDevMode ? [{ debugName: "dropFilesCaption" }] : /* istanbul ignore next */ []));
|
|
38
50
|
this.browseFilesCaption = input('Browse for files', /* @ts-ignore */
|
|
39
51
|
...(ngDevMode ? [{ debugName: "browseFilesCaption" }] : /* istanbul ignore next */ []));
|
|
40
|
-
this.
|
|
41
|
-
...(ngDevMode ? [{ debugName: "
|
|
42
|
-
this.
|
|
43
|
-
...(ngDevMode ? [{ debugName: "
|
|
44
|
-
this.inputAriaLabel = input('Choose files to upload', /* @ts-ignore */
|
|
45
|
-
...(ngDevMode ? [{ debugName: "inputAriaLabel" }] : /* istanbul ignore next */ []));
|
|
46
|
-
/** Live-region announcement after one file is added. Override to translate. */
|
|
52
|
+
this.label = input('File upload drop zone', /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
54
|
+
this.inputLabel = input('Choose files to upload', /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "inputLabel" }] : /* istanbul ignore next */ []));
|
|
47
56
|
this.fileAddedAnnouncement = input((fileName) => `Added ${fileName}`, /* @ts-ignore */
|
|
48
57
|
...(ngDevMode ? [{ debugName: "fileAddedAnnouncement" }] : /* istanbul ignore next */ []));
|
|
49
|
-
/** Live-region announcement after several files are added at once. Override to translate. */
|
|
50
58
|
this.filesAddedAnnouncement = input((count) => `Added ${count} files`, /* @ts-ignore */
|
|
51
59
|
...(ngDevMode ? [{ debugName: "filesAddedAnnouncement" }] : /* istanbul ignore next */ []));
|
|
52
|
-
/** Accessible name of the default template's progress bar. Override to translate. */
|
|
53
60
|
this.progressLabel = input((fileName) => `Upload progress for ${fileName}`, /* @ts-ignore */
|
|
54
61
|
...(ngDevMode ? [{ debugName: "progressLabel" }] : /* istanbul ignore next */ []));
|
|
55
|
-
this.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.fileTemplate = signal(undefined, /* @ts-ignore */
|
|
59
|
-
...(ngDevMode ? [{ debugName: "fileTemplate" }] : /* istanbul ignore next */ []));
|
|
60
|
-
this.files = model([], /* @ts-ignore */
|
|
61
|
-
...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
62
|
+
this.formatSize = input(null, /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "formatSize" }] : /* istanbul ignore next */ []));
|
|
64
|
+
/** Files were chosen or dropped: the batch just added. */
|
|
62
65
|
this.filesDropped = output();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.processDroppedFiles(files);
|
|
75
|
-
}
|
|
76
|
-
onDragOver(event) {
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
event.stopPropagation();
|
|
79
|
-
if (event.dataTransfer) {
|
|
80
|
-
this.isDraggingFile.set(true);
|
|
81
|
-
event.dataTransfer.effectAllowed = "copy";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
onDragLeave(event) {
|
|
85
|
-
event.preventDefault();
|
|
86
|
-
event.stopPropagation();
|
|
87
|
-
this.isDraggingFile.set(false);
|
|
88
|
-
}
|
|
89
|
-
onDrop(event) {
|
|
90
|
-
event.preventDefault();
|
|
91
|
-
event.stopPropagation();
|
|
92
|
-
this.isDraggingFile.set(false);
|
|
93
|
-
if (event.dataTransfer && event.dataTransfer.files) {
|
|
94
|
-
this.processDroppedFiles(event.dataTransfer.files);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
processDroppedFiles(fileList) {
|
|
98
|
-
const newFiles = [...Array(fileList.length).keys()]
|
|
99
|
-
.map(i => fileList.item(i))
|
|
100
|
-
.filter(f => !!f)
|
|
101
|
-
.map((file, index) => ({ file, progress: 0, index: this.files().length + index }));
|
|
102
|
-
this.files.update(f => [...f, ...newFiles]);
|
|
103
|
-
this.filesDropped.emit(newFiles);
|
|
104
|
-
if (newFiles.length === 1) {
|
|
105
|
-
this.announcer.announce(this.fileAddedAnnouncement()(newFiles[0].file.name));
|
|
106
|
-
}
|
|
107
|
-
else if (newFiles.length > 1) {
|
|
108
|
-
this.announcer.announce(this.filesAddedAnnouncement()(newFiles.length));
|
|
109
|
-
}
|
|
66
|
+
this.fileTemplateSlot = contentChild(BsFileUploadFileTemplateDirective, /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "fileTemplateSlot" }] : /* istanbul ignore next */ []));
|
|
68
|
+
/** The template's named slots. */
|
|
69
|
+
this.slots = computed(() => ({ fileTemplate: this.fileTemplateSlot()?.templateRef }), /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "slots" }] : /* istanbul ignore next */ []));
|
|
71
|
+
this.#core = useCore(fileUploadCore, { inputs: () => ({ files: this.files(), name: this.name(), accept: this.accept(), multiple: this.multiple(), disabled: this.disabled(), dropFilesCaption: this.dropFilesCaption(), browseFilesCaption: this.browseFilesCaption(), label: this.label(), inputLabel: this.inputLabel(), fileAddedAnnouncement: this.fileAddedAnnouncement(), filesAddedAnnouncement: this.filesAddedAnnouncement(), progressLabel: this.progressLabel(), formatSize: this.formatSize() }), idPrefix: 'bs-file-upload', outputs: { filesDropped: this.filesDropped }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'file-upload' }), models: { files: this.files } });
|
|
72
|
+
/** The template's props. */
|
|
73
|
+
this.props = this.#core.props;
|
|
74
|
+
useScopedStyles(bootstrapProgress.key, bootstrapProgress.css, { order: bootstrapProgress.order });
|
|
75
|
+
useScopedStyles(bootstrapListGroup.key, bootstrapListGroup.css, { order: bootstrapListGroup.order });
|
|
76
|
+
useScopedStyles('file-upload', fileUploadScopedStyles);
|
|
110
77
|
}
|
|
111
78
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
112
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsFileUploadComponent, isStandalone: true, selector: "bs-file-upload", inputs: {
|
|
79
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsFileUploadComponent, isStandalone: true, selector: "bs-file-upload", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, dropFilesCaption: { classPropertyName: "dropFilesCaption", publicName: "dropFilesCaption", isSignal: true, isRequired: false, transformFunction: null }, browseFilesCaption: { classPropertyName: "browseFilesCaption", publicName: "browseFilesCaption", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, inputLabel: { classPropertyName: "inputLabel", publicName: "inputLabel", isSignal: true, isRequired: false, transformFunction: null }, fileAddedAnnouncement: { classPropertyName: "fileAddedAnnouncement", publicName: "fileAddedAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, filesAddedAnnouncement: { classPropertyName: "filesAddedAnnouncement", publicName: "filesAddedAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, progressLabel: { classPropertyName: "progressLabel", publicName: "progressLabel", isSignal: true, isRequired: false, transformFunction: null }, formatSize: { classPropertyName: "formatSize", publicName: "formatSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { files: "filesChange", filesDropped: "filesDropped" }, queries: [{ propertyName: "fileTemplateSlot", first: true, predicate: BsFileUploadFileTemplateDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- GENERATED from libs/mintplayer-ui-core/file-upload/src/templates/file-upload.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"file-upload\" [mpProps]=\"p_view.zone\" [mpHostAttrs]=\"hostAttrs\">\n <input data-mps=\"file-upload\" [mpProps]=\"p_view.input\">\n <span data-mps=\"file-upload\" [mpProps]=\"p_view.caption\">\n {{ p_view.dropFilesCaption }}\n </span>\n <label data-mps=\"file-upload\" [mpProps]=\"p_view.browse\">\n {{ p_view.browseFilesCaption }}\n </label>\n</div>\n<ul data-mps=\"file-upload\" [mpProps]=\"p_view.list\">\n @for (row of p_view.rows; track row.key) {\n <li data-mps=\"file-upload\" [mpProps]=\"row.item\">\n @if (slots().fileTemplate; as slot_fileTemplate) {\n <ng-container [ngTemplateOutlet]=\"slot_fileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: row.upload, upload: row.upload }\" />\n } @else {\n <div data-mps=\"file-upload\" class=\"file-upload-row d-flex flex-row\">\n <div data-mps=\"file-upload\" class=\"file-upload-icon\" aria-hidden=\"true\"></div>\n <div data-mps=\"file-upload\" class=\"flex-grow-1 text-start px-2\">\n <span data-mps=\"file-upload\" class=\"d-block text-truncate text-secondary\">\n {{ row.name }}\n </span>\n <span data-mps=\"file-upload\" class=\"d-block text-body-secondary mb-0\">\n {{ row.size }}\n </span>\n <div data-mps=\"file-upload\" [mpProps]=\"row.progress\">\n <div data-mps=\"file-upload\" [mpProps]=\"row.bar\" [style]=\"row.barStyle\"></div>\n </div>\n </div>\n </div>\n }\n </li>\n }\n</ul>\n", dependencies: [{ kind: "directive", type: MpPropsDirective, selector: "[mpProps],[mpHostAttrs]", inputs: ["mpProps", "mpHostAttrs"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
113
80
|
}
|
|
114
81
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadComponent, decorators: [{
|
|
115
82
|
type: Component,
|
|
116
|
-
args: [{ selector: 'bs-file-upload', imports: [
|
|
117
|
-
|
|
118
|
-
'(dragleave)': 'onDragLeave($event)',
|
|
119
|
-
'(drop)': 'onDrop($event)',
|
|
120
|
-
}, template: "<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"progressLabel()(upload.file.name)\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>\n", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid var(--bs-danger)!important;background:var(--bs-danger-bg-subtle);margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:var(--bs-secondary-color)}.list-group span{margin:-5px auto}\n"] }]
|
|
121
|
-
}], propDecorators: { dropFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropFilesCaption", required: false }] }], browseFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "browseFilesCaption", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], inputAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputAriaLabel", required: false }] }], fileAddedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileAddedAnnouncement", required: false }] }], filesAddedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesAddedAnnouncement", required: false }] }], progressLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressLabel", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], filesDropped: [{ type: i0.Output, args: ["filesDropped"] }] } });
|
|
83
|
+
args: [{ selector: 'bs-file-upload', imports: [MpPropsDirective, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- GENERATED from libs/mintplayer-ui-core/file-upload/src/templates/file-upload.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"file-upload\" [mpProps]=\"p_view.zone\" [mpHostAttrs]=\"hostAttrs\">\n <input data-mps=\"file-upload\" [mpProps]=\"p_view.input\">\n <span data-mps=\"file-upload\" [mpProps]=\"p_view.caption\">\n {{ p_view.dropFilesCaption }}\n </span>\n <label data-mps=\"file-upload\" [mpProps]=\"p_view.browse\">\n {{ p_view.browseFilesCaption }}\n </label>\n</div>\n<ul data-mps=\"file-upload\" [mpProps]=\"p_view.list\">\n @for (row of p_view.rows; track row.key) {\n <li data-mps=\"file-upload\" [mpProps]=\"row.item\">\n @if (slots().fileTemplate; as slot_fileTemplate) {\n <ng-container [ngTemplateOutlet]=\"slot_fileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: row.upload, upload: row.upload }\" />\n } @else {\n <div data-mps=\"file-upload\" class=\"file-upload-row d-flex flex-row\">\n <div data-mps=\"file-upload\" class=\"file-upload-icon\" aria-hidden=\"true\"></div>\n <div data-mps=\"file-upload\" class=\"flex-grow-1 text-start px-2\">\n <span data-mps=\"file-upload\" class=\"d-block text-truncate text-secondary\">\n {{ row.name }}\n </span>\n <span data-mps=\"file-upload\" class=\"d-block text-body-secondary mb-0\">\n {{ row.size }}\n </span>\n <div data-mps=\"file-upload\" [mpProps]=\"row.progress\">\n <div data-mps=\"file-upload\" [mpProps]=\"row.bar\" [style]=\"row.barStyle\"></div>\n </div>\n </div>\n </div>\n }\n </li>\n }\n</ul>\n" }]
|
|
84
|
+
}], ctorParameters: () => [], propDecorators: { files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], dropFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropFilesCaption", required: false }] }], browseFilesCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "browseFilesCaption", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], inputLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputLabel", required: false }] }], fileAddedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileAddedAnnouncement", required: false }] }], filesAddedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "filesAddedAnnouncement", required: false }] }], progressLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "progressLabel", required: false }] }], formatSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "formatSize", required: false }] }], filesDropped: [{ type: i0.Output, args: ["filesDropped"] }], fileTemplateSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsFileUploadFileTemplateDirective), { isSignal: true }] }] } });
|
|
122
85
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.bsFileUploadTemplateOf = input(undefined, /* @ts-ignore */
|
|
127
|
-
...(ngDevMode ? [{ debugName: "bsFileUploadTemplateOf" }] : /* istanbul ignore next */ []));
|
|
128
|
-
const templateRef = inject(TemplateRef);
|
|
129
|
-
this.fileUploadComponent.fileTemplate.set(templateRef);
|
|
130
|
-
}
|
|
131
|
-
static ngTemplateContextGuard(dir, ctx) {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
135
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsFileUploadTemplateDirective, isStandalone: true, selector: "[bsFileUploadTemplate]", inputs: { bsFileUploadTemplateOf: { classPropertyName: "bsFileUploadTemplateOf", publicName: "bsFileUploadTemplateOf", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
136
|
-
}
|
|
137
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFileUploadTemplateDirective, decorators: [{
|
|
138
|
-
type: Directive,
|
|
139
|
-
args: [{
|
|
140
|
-
selector: '[bsFileUploadTemplate]',
|
|
141
|
-
}]
|
|
142
|
-
}], ctorParameters: () => [], propDecorators: { bsFileUploadTemplateOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsFileUploadTemplateOf", required: false }] }] } });
|
|
143
|
-
class BsFileUploadTemplateContext {
|
|
144
|
-
constructor() {
|
|
145
|
-
this.$implicit = null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
86
|
+
// GENERATED from the file-upload manifest by @mintplayer/nx-component-compiler. Do not edit.
|
|
87
|
+
|
|
88
|
+
// Generated from @mintplayer/ui-core/file-upload (#458 D10).
|
|
148
89
|
|
|
149
90
|
/**
|
|
150
91
|
* Generated bundle index. Do not edit.
|
|
151
92
|
*/
|
|
152
93
|
|
|
153
|
-
export { BsFileUploadComponent,
|
|
94
|
+
export { BsFileUploadComponent, BsFileUploadFileTemplateDirective };
|
|
154
95
|
//# sourceMappingURL=mintplayer-ng-bootstrap-file-upload.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-file-upload.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-upload/src/pipes/format-bytes/format-bytes.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.html","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/directive/file-upload-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/mintplayer-ng-bootstrap-file-upload.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsFormatBytes',\n pure: true,\n})\nexport class BsFormatBytesPipe implements PipeTransform {\n\n transform(value: number, decimals = 2) {\n if (value === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n // Clamped: below 1 byte the log is negative, and past the last unit there is no name.\n const i = Math.min(sizes.length - 1, Math.max(0, Math.floor(Math.log(value) / Math.log(k))));\n\n return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n }\n\n}\n","import { Component, inject, input, model, output, signal, TemplateRef, ChangeDetectionStrategy } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BsLiveAnnouncerService } from '@mintplayer/ng-bootstrap/a11y';\nimport { BsForDirective } from '@mintplayer/ng-bootstrap/for';\nimport { BsListGroupComponent } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsListGroupItemComponent } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsProgressComponent, BsProgressBarComponent } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { FileUpload } from '../file-upload';\nimport { BsFormatBytesPipe } from '../pipes/format-bytes/format-bytes.pipe';\n\n@Component({\n selector: 'bs-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss'],\n imports: [NgTemplateOutlet, BsForDirective, BsListGroupComponent, BsListGroupItemComponent, BsProgressComponent, BsProgressBarComponent, BsFormatBytesPipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(dragover)': 'onDragOver($event)',\n '(dragleave)': 'onDragLeave($event)',\n '(drop)': 'onDrop($event)',\n },\n})\nexport class BsFileUploadComponent {\n private announcer = inject(BsLiveAnnouncerService);\n\n readonly dropFilesCaption = input('Drop your files here');\n readonly browseFilesCaption = input('Browse for files');\n readonly placeholder = input('Drop files to upload');\n readonly ariaLabel = input<string>('File upload drop zone');\n readonly inputAriaLabel = input<string>('Choose files to upload');\n /** Live-region announcement after one file is added. Override to translate. */\n readonly fileAddedAnnouncement = input<(fileName: string) => string>((fileName) => `Added ${fileName}`);\n /** Live-region announcement after several files are added at once. Override to translate. */\n readonly filesAddedAnnouncement = input<(count: number) => string>((count) => `Added ${count} files`);\n /** Accessible name of the default template's progress bar. Override to translate. */\n readonly progressLabel = input<(fileName: string) => string>((fileName) => `Upload progress for ${fileName}`);\n\n readonly colors = Color;\n isDraggingFile = signal(false);\n readonly fileTemplate = signal<TemplateRef<FileUpload> | undefined>(undefined);\n readonly files = model<FileUpload[]>([]);\n readonly filesDropped = output<FileUpload[]>();\n\n onChange(event: Event) {\n if (!event.target) return;\n if (!('files' in event.target)) return;\n if (!event.target['files']) return;\n\n const files = (<HTMLInputElement>event.target).files;\n if (!files) return;\n\n this.processDroppedFiles(files);\n }\n\n onDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n if (event.dataTransfer) {\n this.isDraggingFile.set(true);\n event.dataTransfer.effectAllowed = \"copy\";\n }\n }\n\n onDragLeave(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile.set(false);\n }\n\n onDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile.set(false);\n if (event.dataTransfer && event.dataTransfer.files) {\n this.processDroppedFiles(event.dataTransfer.files);\n }\n }\n\n private processDroppedFiles(fileList: FileList) {\n const newFiles = [...Array(fileList.length).keys()]\n .map(i => fileList.item(i))\n .filter(f => !!f)\n .map((file, index) => <FileUpload>{ file, progress: 0, index: this.files().length + index });\n\n this.files.update(f => [...f, ...newFiles]);\n this.filesDropped.emit(newFiles);\n\n if (newFiles.length === 1) {\n this.announcer.announce(this.fileAddedAnnouncement()(newFiles[0].file.name));\n } else if (newFiles.length > 1) {\n this.announcer.announce(this.filesAddedAnnouncement()(newFiles.length));\n }\n }\n}\n","<div class=\"dropzone border position-relative p-5\" role=\"region\" [attr.aria-label]=\"ariaLabel()\" [class.dragging]=\"isDraggingFile()\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder()\" [placeholder]=\"placeholder()\" [attr.aria-label]=\"inputAriaLabel()\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder()\"> -->\n <span class=\"h3 d-block\" aria-hidden=\"true\">{{ dropFilesCaption() }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption() }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n @for (upload of files(); track upload.index) {\n <bs-list-group-item>\n <ng-container *ngTemplateOutlet=\"fileTemplate() ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n }\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\" aria-hidden=\"true\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\" [ariaLabel]=\"progressLabel()(upload.file.name)\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>\n","import { Directive, inject, input, TemplateRef } from '@angular/core';\nimport { BsFileUploadComponent } from '../component/file-upload.component';\nimport { FileUpload } from '../file-upload';\n\n@Directive({\n selector: '[bsFileUploadTemplate]',\n})\nexport class BsFileUploadTemplateDirective {\n private fileUploadComponent = inject(BsFileUploadComponent);\n\n constructor() {\n const templateRef = inject(TemplateRef);\n this.fileUploadComponent.fileTemplate.set(templateRef);\n }\n\n readonly bsFileUploadTemplateOf = input<FileUpload[] | undefined>(undefined);\n\n static ngTemplateContextGuard(dir: BsFileUploadTemplateDirective, ctx: any): ctx is BsFileUploadTemplateContext {\n return true;\n }\n\n}\n\nexport class BsFileUploadTemplateContext {\n $implicit: FileUpload = null!;\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAMa,iBAAiB,CAAA;AAE5B,IAAA,SAAS,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC,EAAA;AACnC,QAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,SAAS;QAClB;QAEA,MAAM,CAAC,GAAG,IAAI;AACd,QAAA,MAAM,EAAE,GAAG,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ;QACvC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;;AAEvE,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE5F,OAAO,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;IAC1E;8GAdW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,eAAA,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,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"mintplayer-ng-bootstrap-file-upload.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-upload/src/generated/file-upload.component.generated.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/generated/file-upload.view.generated.html","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/generated/index.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/index.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/mintplayer-ng-bootstrap-file-upload.ts"],"sourcesContent":["// GENERATED from the file-upload manifest (file-upload) by @mintplayer/nx-component-compiler. Do not edit.\nimport { ChangeDetectionStrategy, Component, Directive, ElementRef, TemplateRef, booleanAttribute, computed, contentChild, inject, input, model, output } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MpPropsDirective, useCore, useHostAttrs, useScopedStyles } from '@mintplayer/ng-bootstrap/machine';\nimport { type FileUpload, fileUploadCore, type FileUploadInputs, fileUploadScopedStyles } from '@mintplayer/ui-core/file-upload';\nimport { bootstrapProgress } from '@mintplayer/ui-core/bootstrap/progress';\nimport { bootstrapListGroup } from '@mintplayer/ui-core/bootstrap/list-group';\n\n/** The `fileTemplate` slot of `<bs-file-upload>`: `<ng-template bsFileUploadFileTemplate>` or `*bsFileUploadFileTemplate`. */\n@Directive({ selector: '[bsFileUploadFileTemplate]' })\nexport class BsFileUploadFileTemplateDirective {\n readonly templateRef = inject<TemplateRef<{ upload: FileUpload } & { $implicit: { upload: FileUpload }['upload'] }>>(TemplateRef);\n static ngTemplateContextGuard(_dir: BsFileUploadFileTemplateDirective, ctx: unknown): ctx is { upload: FileUpload } & { $implicit: { upload: FileUpload }['upload'] } {\n return true;\n }\n}\n\n/**\n * A file drop zone over a native file input, with the list of files added. Drop files on it, click\n * it or use the browse button; each batch is added to the two-way `files` list, emitted as\n * `filesDropped` and announced. Rows show the name, size and a progress bar the consumer updates;\n * the `fileTemplate` slot replaces a row. With `name` the input submits its files with a form, no\n * JavaScript needed.\n */\n@Component({\n selector: 'bs-file-upload',\n templateUrl: './file-upload.view.generated.html',\n imports: [MpPropsDirective, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsFileUploadComponent {\n /** The host element. */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The consumer's aria-*, id and tabindex on the host, for the role-bearing node. */\n protected readonly hostAttrs = useHostAttrs();\n\n readonly files = model<FileUploadInputs['files']>([]);\n readonly name = input<FileUploadInputs['name']>(null);\n readonly accept = input<FileUploadInputs['accept']>(null);\n readonly multiple = input<FileUploadInputs['multiple'], unknown>(true, { transform: booleanAttribute });\n readonly disabled = input<FileUploadInputs['disabled'], unknown>(false, { transform: booleanAttribute });\n readonly dropFilesCaption = input<FileUploadInputs['dropFilesCaption']>('Drop your files here');\n readonly browseFilesCaption = input<FileUploadInputs['browseFilesCaption']>('Browse for files');\n readonly label = input<FileUploadInputs['label']>('File upload drop zone');\n readonly inputLabel = input<FileUploadInputs['inputLabel']>('Choose files to upload');\n readonly fileAddedAnnouncement = input<FileUploadInputs['fileAddedAnnouncement']>((fileName: string) => `Added ${fileName}`);\n readonly filesAddedAnnouncement = input<FileUploadInputs['filesAddedAnnouncement']>((count: number) => `Added ${count} files`);\n readonly progressLabel = input<FileUploadInputs['progressLabel']>((fileName: string) => `Upload progress for ${fileName}`);\n readonly formatSize = input<FileUploadInputs['formatSize']>(null);\n /** Files were chosen or dropped: the batch just added. */\n readonly filesDropped = output<FileUpload[]>();\n\n private readonly fileTemplateSlot = contentChild(BsFileUploadFileTemplateDirective);\n /** The template's named slots. */\n protected readonly slots = computed(() => ({ fileTemplate: this.fileTemplateSlot()?.templateRef }));\n readonly #core = useCore(fileUploadCore, { inputs: () => ({ files: this.files(), name: this.name(), accept: this.accept(), multiple: this.multiple(), disabled: this.disabled(), dropFilesCaption: this.dropFilesCaption(), browseFilesCaption: this.browseFilesCaption(), label: this.label(), inputLabel: this.inputLabel(), fileAddedAnnouncement: this.fileAddedAnnouncement(), filesAddedAnnouncement: this.filesAddedAnnouncement(), progressLabel: this.progressLabel(), formatSize: this.formatSize() }), idPrefix: 'bs-file-upload', outputs: { filesDropped: this.filesDropped }, hostBag: (props) => ({ ...props.view.root, 'data-mps': 'file-upload' }), models: { files: this.files } });\n /** The template's props. */\n protected readonly props = this.#core.props;\n\n constructor() {\n useScopedStyles(bootstrapProgress.key, bootstrapProgress.css, { order: bootstrapProgress.order }); useScopedStyles(bootstrapListGroup.key, bootstrapListGroup.css, { order: bootstrapListGroup.order }); useScopedStyles('file-upload', fileUploadScopedStyles);\n }\n}\n","<!-- GENERATED from libs/mintplayer-ui-core/file-upload/src/templates/file-upload.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n@let p_view = props().view;\n<div data-mps=\"file-upload\" [mpProps]=\"p_view.zone\" [mpHostAttrs]=\"hostAttrs\">\n <input data-mps=\"file-upload\" [mpProps]=\"p_view.input\">\n <span data-mps=\"file-upload\" [mpProps]=\"p_view.caption\">\n {{ p_view.dropFilesCaption }}\n </span>\n <label data-mps=\"file-upload\" [mpProps]=\"p_view.browse\">\n {{ p_view.browseFilesCaption }}\n </label>\n</div>\n<ul data-mps=\"file-upload\" [mpProps]=\"p_view.list\">\n @for (row of p_view.rows; track row.key) {\n <li data-mps=\"file-upload\" [mpProps]=\"row.item\">\n @if (slots().fileTemplate; as slot_fileTemplate) {\n <ng-container [ngTemplateOutlet]=\"slot_fileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: row.upload, upload: row.upload }\" />\n } @else {\n <div data-mps=\"file-upload\" class=\"file-upload-row d-flex flex-row\">\n <div data-mps=\"file-upload\" class=\"file-upload-icon\" aria-hidden=\"true\"></div>\n <div data-mps=\"file-upload\" class=\"flex-grow-1 text-start px-2\">\n <span data-mps=\"file-upload\" class=\"d-block text-truncate text-secondary\">\n {{ row.name }}\n </span>\n <span data-mps=\"file-upload\" class=\"d-block text-body-secondary mb-0\">\n {{ row.size }}\n </span>\n <div data-mps=\"file-upload\" [mpProps]=\"row.progress\">\n <div data-mps=\"file-upload\" [mpProps]=\"row.bar\" [style]=\"row.barStyle\"></div>\n </div>\n </div>\n </div>\n }\n </li>\n }\n</ul>\n","// GENERATED from the file-upload manifest by @mintplayer/nx-component-compiler. Do not edit.\nexport { BsFileUploadComponent, BsFileUploadFileTemplateDirective } from './file-upload.component.generated';\n","// Generated from @mintplayer/ui-core/file-upload (#458 D10).\nexport * from './generated';\nexport { formatBytes } from '@mintplayer/ui-core/file-upload';\nexport type { FileUpload } from '@mintplayer/ui-core/file-upload';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAQA;MAEa,iCAAiC,CAAA;AAD9C,IAAA,WAAA,GAAA;AAEW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAwF,WAAW,CAAC;AAIlI,IAAA;AAHC,IAAA,OAAO,sBAAsB,CAAC,IAAuC,EAAE,GAAY,EAAA;AACjF,QAAA,OAAO,IAAI;IACb;8GAJW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAjC,iCAAiC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,4BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAjC,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,SAAS;mBAAC,EAAE,QAAQ,EAAE,4BAA4B,EAAE;;AAQrD;;;;;;AAMG;MAOU,qBAAqB,CAAA;AA0BvB,IAAA,KAAK;AAId,IAAA,WAAA,GAAA;;AA5BS,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;;QAG9C,IAAA,CAAA,SAAS,GAAG,YAAY,EAAE;QAEpC,IAAA,CAAA,KAAK,GAAG,KAAK,CAA4B,EAAE;kFAAC;QAC5C,IAAA,CAAA,IAAI,GAAG,KAAK,CAA2B,IA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,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,g9DAuBiB,iCAAiC,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECrDpF,qsDAmCA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDRY,gBAAgB,wGAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGjC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EAEjB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAA,eAAA,EAC5B,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qsDAAA,EAAA;4hDAyBE,iCAAiC,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErDpF;;ACAA;;ACAA;;AAEG;;;;"}
|
|
@@ -1,44 +1,34 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { useCore, useScopedStyles } from '@mintplayer/ng-bootstrap/machine';
|
|
4
|
+
import { floatingLabelCore, floatingLabelsScopedStyles } from '@mintplayer/ui-core/floating-labels';
|
|
5
|
+
import { bootstrapForms } from '@mintplayer/ui-core/bootstrap/forms';
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
// GENERATED from the floating-labels manifest (floating-label) by @mintplayer/nx-component-compiler. Do not edit.
|
|
8
|
+
/** Bootstrap's `.form-floating` around a control and then its `<label>`; a label without `for` is associated with the control. */
|
|
6
9
|
class BsFloatingLabelComponent {
|
|
10
|
+
#core;
|
|
7
11
|
constructor() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* Associate the projected `<label>` with the projected control.
|
|
16
|
-
*
|
|
17
|
-
* Bootstrap's floating-label pattern *looks* labelled with no association at
|
|
18
|
-
* all — the label floats over the control purely via CSS — so the visual
|
|
19
|
-
* result gives no hint that a screen reader announces an unnamed textbox.
|
|
20
|
-
* `label`/`for` is the native mechanism and everything here is light DOM, so
|
|
21
|
-
* a generated id is all that is missing. Consumer-authored `for`/`id` are
|
|
22
|
-
* left untouched.
|
|
23
|
-
*/
|
|
24
|
-
ngAfterViewInit() {
|
|
25
|
-
const host = this.hostRef.nativeElement;
|
|
26
|
-
const control = host.querySelector('input, select, textarea');
|
|
27
|
-
const label = host.querySelector('label');
|
|
28
|
-
if (!control || !label || label.htmlFor)
|
|
29
|
-
return;
|
|
30
|
-
if (!control.id)
|
|
31
|
-
control.id = `bs-floating-label-${++instanceCounter}`;
|
|
32
|
-
label.htmlFor = control.id;
|
|
12
|
+
/** The host element. */
|
|
13
|
+
this.elementRef = inject(ElementRef);
|
|
14
|
+
this.#core = useCore(floatingLabelCore, { inputs: () => ({}), idPrefix: 'bs-floating-label', hostBag: (props) => ({ ...props.root, 'data-mps': 'floating-labels' }) });
|
|
15
|
+
/** The template's props. */
|
|
16
|
+
this.props = this.#core.props;
|
|
17
|
+
useScopedStyles(bootstrapForms.key, bootstrapForms.css, { order: bootstrapForms.order });
|
|
18
|
+
useScopedStyles('floating-labels', floatingLabelsScopedStyles);
|
|
33
19
|
}
|
|
34
20
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFloatingLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
35
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: BsFloatingLabelComponent, isStandalone: true, selector: "bs-floating-label", ngImport: i0, template: "
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: BsFloatingLabelComponent, isStandalone: true, selector: "bs-floating-label", ngImport: i0, template: "<!-- GENERATED from libs/mintplayer-ui-core/floating-labels/src/templates/floating-label.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n<ng-content />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
36
22
|
}
|
|
37
23
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsFloatingLabelComponent, decorators: [{
|
|
38
24
|
type: Component,
|
|
39
|
-
args: [{ selector: 'bs-floating-label', changeDetection: ChangeDetectionStrategy.OnPush, template: "
|
|
25
|
+
args: [{ selector: 'bs-floating-label', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- GENERATED from libs/mintplayer-ui-core/floating-labels/src/templates/floating-label.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n<ng-content />\n" }]
|
|
40
26
|
}], ctorParameters: () => [] });
|
|
41
27
|
|
|
28
|
+
// GENERATED from the floating-labels manifest by @mintplayer/nx-component-compiler. Do not edit.
|
|
29
|
+
|
|
30
|
+
// Generated from @mintplayer/ui-core/floating-labels (#458 D10).
|
|
31
|
+
|
|
42
32
|
/**
|
|
43
33
|
* Generated bundle index. Do not edit.
|
|
44
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-floating-labels.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/floating-labels/src/
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-floating-labels.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/floating-labels/src/generated/floating-label.component.generated.ts","../../../../libs/mintplayer-ng-bootstrap/floating-labels/src/generated/floating-label.view.generated.html","../../../../libs/mintplayer-ng-bootstrap/floating-labels/src/generated/index.ts","../../../../libs/mintplayer-ng-bootstrap/floating-labels/src/index.ts","../../../../libs/mintplayer-ng-bootstrap/floating-labels/mintplayer-ng-bootstrap-floating-labels.ts"],"sourcesContent":["// GENERATED from the floating-labels manifest (floating-label) by @mintplayer/nx-component-compiler. Do not edit.\nimport { ChangeDetectionStrategy, Component, ElementRef, inject } from '@angular/core';\nimport { useCore, useScopedStyles } from '@mintplayer/ng-bootstrap/machine';\nimport { floatingLabelCore, floatingLabelsScopedStyles } from '@mintplayer/ui-core/floating-labels';\nimport { bootstrapForms } from '@mintplayer/ui-core/bootstrap/forms';\n\n/** Bootstrap's `.form-floating` around a control and then its `<label>`; a label without `for` is associated with the control. */\n@Component({\n selector: 'bs-floating-label',\n templateUrl: './floating-label.view.generated.html',\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsFloatingLabelComponent {\n /** The host element. */\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n readonly #core = useCore(floatingLabelCore, { inputs: () => ({ }), idPrefix: 'bs-floating-label', hostBag: (props) => ({ ...props.root, 'data-mps': 'floating-labels' }) });\n /** The template's props. */\n protected readonly props = this.#core.props;\n\n constructor() {\n useScopedStyles(bootstrapForms.key, bootstrapForms.css, { order: bootstrapForms.order }); useScopedStyles('floating-labels', floatingLabelsScopedStyles);\n }\n}\n","<!-- GENERATED from libs/mintplayer-ui-core/floating-labels/src/templates/floating-label.view.vue by @mintplayer/nx-component-compiler. Do not edit. -->\n<ng-content />\n","// GENERATED from the floating-labels manifest by @mintplayer/nx-component-compiler. Do not edit.\nexport { BsFloatingLabelComponent } from './floating-label.component.generated';\n","// Generated from @mintplayer/ui-core/floating-labels (#458 D10).\nexport * from './generated';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AAMA;MAOa,wBAAwB,CAAA;AAI1B,IAAA,KAAK;AAId,IAAA,WAAA,GAAA;;AANS,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AAExD,QAAA,IAAA,CAAA,KAAK,GAAG,OAAO,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAI,CAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,KAAK,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;;AAEzJ,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK;AAGzC,QAAA,eAAe,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;AAAE,QAAA,eAAe,CAAC,iBAAiB,EAAE,0BAA0B,CAAC;IAC1J;8GAVW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,6ECbrC,4KAEA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDWa,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBANpC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,OAAA,EAEpB,EAAE,EAAA,eAAA,EACM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4KAAA,EAAA;;;AEXjD;;ACAA;;ACAA;;AAEG;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, effect, Directive } from '@angular/core';
|
|
2
|
+
import { input, signal, effect, Directive } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
class BsForDirective {
|
|
5
5
|
static { this.counter = 1; }
|
|
6
6
|
constructor() {
|
|
7
7
|
this.bsFor = input(undefined, /* @ts-ignore */
|
|
8
8
|
...(ngDevMode ? [{ debugName: "bsFor" }] : /* istanbul ignore next */ []));
|
|
9
|
+
this.forValue = signal(undefined, /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "forValue" }] : /* istanbul ignore next */ []));
|
|
9
11
|
effect(() => {
|
|
10
12
|
const value = this.bsFor();
|
|
11
13
|
if (value !== undefined) {
|
|
@@ -15,13 +17,13 @@ class BsForDirective {
|
|
|
15
17
|
const count = BsForDirective.counter++;
|
|
16
18
|
this.target.id = `for-target-${count}`;
|
|
17
19
|
}
|
|
18
|
-
this.forValue
|
|
20
|
+
this.forValue.set(this.target.id);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
25
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsForDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
24
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsForDirective, isStandalone: true, selector: "label[bsFor]", inputs: { bsFor: { classPropertyName: "bsFor", publicName: "bsFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cursor-default": "true", "attr.for": "forValue" } }, ngImport: i0 }); }
|
|
26
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsForDirective, isStandalone: true, selector: "label[bsFor]", inputs: { bsFor: { classPropertyName: "bsFor", publicName: "bsFor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cursor-default": "true", "attr.for": "forValue()" } }, ngImport: i0 }); }
|
|
25
27
|
}
|
|
26
28
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsForDirective, decorators: [{
|
|
27
29
|
type: Directive,
|
|
@@ -29,7 +31,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
29
31
|
selector: 'label[bsFor]',
|
|
30
32
|
host: {
|
|
31
33
|
'[class.cursor-default]': 'true',
|
|
32
|
-
|
|
34
|
+
// A signal: the effect below writes it, and a zoneless host binding re-renders
|
|
35
|
+
// only when a signal it reads changes.
|
|
36
|
+
'[attr.for]': 'forValue()',
|
|
33
37
|
},
|
|
34
38
|
}]
|
|
35
39
|
}], ctorParameters: () => [], propDecorators: { bsFor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsFor", required: false }] }] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-for.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/for/src/for.directive.ts","../../../../libs/mintplayer-ng-bootstrap/for/mintplayer-ng-bootstrap-for.ts"],"sourcesContent":["import { Directive, effect, input } from '@angular/core';\n\n@Directive({\n selector: 'label[bsFor]',\n host: {\n '[class.cursor-default]': 'true',\n '[attr.for]': 'forValue',\n },\n})\nexport class BsForDirective {\n\n static counter = 1;\n private target: any;\n readonly bsFor = input<any>(undefined);\n\n constructor() {\n effect(() => {\n const value = this.bsFor();\n if (value !== undefined) {\n this.target = value;\n if (this.target instanceof HTMLElement) {\n if (!this.target.id) {\n const count = BsForDirective.counter++;\n this.target.id = `for-target-${count}`;\n }\n this.forValue
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-for.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/for/src/for.directive.ts","../../../../libs/mintplayer-ng-bootstrap/for/mintplayer-ng-bootstrap-for.ts"],"sourcesContent":["import { Directive, effect, input, signal } from '@angular/core';\n\n@Directive({\n selector: 'label[bsFor]',\n host: {\n '[class.cursor-default]': 'true',\n // A signal: the effect below writes it, and a zoneless host binding re-renders\n // only when a signal it reads changes.\n '[attr.for]': 'forValue()',\n },\n})\nexport class BsForDirective {\n\n static counter = 1;\n private target: any;\n readonly bsFor = input<any>(undefined);\n\n constructor() {\n effect(() => {\n const value = this.bsFor();\n if (value !== undefined) {\n this.target = value;\n if (this.target instanceof HTMLElement) {\n if (!this.target.id) {\n const count = BsForDirective.counter++;\n this.target.id = `for-target-${count}`;\n }\n this.forValue.set(this.target.id);\n }\n }\n });\n }\n\n readonly forValue = signal<string | undefined>(undefined);\n\n // @HostListener('click') onMouseClick() {\n // if (!('tagName' in this.target)) {\n // // Not a form-control, let's just assume the class has some \"focus\" method\n // this.target.focus();\n // } else if (this.target.tagName.toLowerCase() !== 'input') {\n // // HTML element, but not an input, probably a textarea\n // this.target.focus();\n // } else if (this.target.type.toLowerCase() === 'file') {\n // // HtmlInputElement for a file\n // this.target.click();\n // } else {\n // // HtmlInputElement\n // this.target.focus();\n // }\n // }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAWa,cAAc,CAAA;aAElB,IAAA,CAAA,OAAO,GAAG,CAAH,CAAK;AAInB,IAAA,WAAA,GAAA;QAFS,IAAA,CAAA,KAAK,GAAG,KAAK,CAAM,SAAS;kFAAC;QAkB7B,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAqB,SAAS;qFAAC;QAfvD,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,YAAA,IAAI,KAAK,KAAK,SAAS,EAAE;AACvB,gBAAA,IAAI,CAAC,MAAM,GAAG,K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