@kusena/wui-single 18.0.1
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 +24 -0
- package/esm2022/kusena-wui-single.mjs +5 -0
- package/esm2022/lib/components/app/app.component.mjs +63 -0
- package/esm2022/lib/components/app-bar/app-bar.component.mjs +16 -0
- package/esm2022/lib/components/avatar/avatar.component.mjs +35 -0
- package/esm2022/lib/components/dialog/dialog.component.mjs +54 -0
- package/esm2022/lib/components/drawer/drawer-item.component.mjs +41 -0
- package/esm2022/lib/components/drawer/drawer.component.mjs +82 -0
- package/esm2022/lib/components/drawer/drawer.directive.mjs +22 -0
- package/esm2022/lib/components/form-field/wui-form-field.component.mjs +63 -0
- package/esm2022/lib/components/form-field/wui-input.directive.mjs +68 -0
- package/esm2022/lib/components/icon/icon.component.mjs +22 -0
- package/esm2022/lib/components/list/list.component.mjs +31 -0
- package/esm2022/lib/components/loading/loading.component.mjs +60 -0
- package/esm2022/lib/components/loading-dialog/loading-dialog.component.mjs +24 -0
- package/esm2022/lib/components/menu/menu.component.mjs +134 -0
- package/esm2022/lib/components/modal/modal-host.component.mjs +21 -0
- package/esm2022/lib/components/modal/modal-overlay.mjs +63 -0
- package/esm2022/lib/components/modal/modal.component.mjs +38 -0
- package/esm2022/lib/components/nav/nav.component.mjs +85 -0
- package/esm2022/lib/components/page/page-host.component.mjs +21 -0
- package/esm2022/lib/components/page/page-overlay.service.mjs +63 -0
- package/esm2022/lib/components/page/page.component.mjs +23 -0
- package/esm2022/lib/components/snackbar/snackbar.component.mjs +65 -0
- package/esm2022/lib/components/toggle/toggle.component.mjs +79 -0
- package/esm2022/lib/directives/menu.directive.mjs +79 -0
- package/esm2022/lib/directives/nav.directive.mjs +78 -0
- package/esm2022/lib/directives/num-input.directive.mjs +105 -0
- package/esm2022/lib/directives/page-header.directive.mjs +48 -0
- package/esm2022/lib/directives/ripple.directive.mjs +87 -0
- package/esm2022/lib/directives/scroll-end.directive.mjs +27 -0
- package/esm2022/lib/directives/sortable.directive.mjs +99 -0
- package/esm2022/lib/index.mjs +39 -0
- package/esm2022/lib/services/message.service.mjs +22 -0
- package/esm2022/lib/services/modal.service.mjs +26 -0
- package/esm2022/lib/services/nav.service.mjs +55 -0
- package/esm2022/lib/services/page.service.mjs +38 -0
- package/esm2022/lib/services/router.service.mjs +42 -0
- package/esm2022/lib/services/wui.service.mjs +43 -0
- package/esm2022/lib/wui-single.component.mjs +19 -0
- package/esm2022/lib/wui.providers.mjs +20 -0
- package/esm2022/public-api.mjs +5 -0
- package/fesm2022/kusena-wui-single.mjs +1841 -0
- package/fesm2022/kusena-wui-single.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/app/app.component.d.ts +16 -0
- package/lib/components/app-bar/app-bar.component.d.ts +5 -0
- package/lib/components/avatar/avatar.component.d.ts +10 -0
- package/lib/components/dialog/dialog.component.d.ts +9 -0
- package/lib/components/drawer/drawer-item.component.d.ts +8 -0
- package/lib/components/drawer/drawer.component.d.ts +21 -0
- package/lib/components/drawer/drawer.directive.d.ts +7 -0
- package/lib/components/form-field/wui-form-field.component.d.ts +13 -0
- package/lib/components/form-field/wui-input.directive.d.ts +17 -0
- package/lib/components/icon/icon.component.d.ts +7 -0
- package/lib/components/list/list.component.d.ts +9 -0
- package/lib/components/loading/loading.component.d.ts +9 -0
- package/lib/components/loading-dialog/loading-dialog.component.d.ts +8 -0
- package/lib/components/menu/menu.component.d.ts +27 -0
- package/lib/components/modal/modal-host.component.d.ts +10 -0
- package/lib/components/modal/modal-overlay.d.ts +25 -0
- package/lib/components/modal/modal.component.d.ts +11 -0
- package/lib/components/nav/nav.component.d.ts +17 -0
- package/lib/components/page/page-host.component.d.ts +10 -0
- package/lib/components/page/page-overlay.service.d.ts +25 -0
- package/lib/components/page/page.component.d.ts +5 -0
- package/lib/components/snackbar/snackbar.component.d.ts +18 -0
- package/lib/components/toggle/toggle.component.d.ts +21 -0
- package/lib/directives/menu.directive.d.ts +17 -0
- package/lib/directives/nav.directive.d.ts +30 -0
- package/lib/directives/num-input.directive.d.ts +27 -0
- package/lib/directives/page-header.directive.d.ts +13 -0
- package/lib/directives/ripple.directive.d.ts +16 -0
- package/lib/directives/scroll-end.directive.d.ts +9 -0
- package/lib/directives/sortable.directive.d.ts +19 -0
- package/lib/index.d.ts +33 -0
- package/lib/services/message.service.d.ts +9 -0
- package/lib/services/modal.service.d.ts +13 -0
- package/lib/services/nav.service.d.ts +14 -0
- package/lib/services/page.service.d.ts +16 -0
- package/lib/services/router.service.d.ts +16 -0
- package/lib/services/wui.service.d.ts +16 -0
- package/lib/wui-single.component.d.ts +5 -0
- package/lib/wui.providers.d.ts +2 -0
- package/package.json +25 -0
- package/public-api.d.ts +1 -0
- package/scss/screen/appbar.scss +71 -0
- package/scss/screen/avatar.scss +17 -0
- package/scss/screen/backdrop.scss +15 -0
- package/scss/screen/box.scss +67 -0
- package/scss/screen/breadcrumb.scss +34 -0
- package/scss/screen/buttons.scss +177 -0
- package/scss/screen/core.scss +103 -0
- package/scss/screen/drawer.scss +273 -0
- package/scss/screen/formfields.scss +288 -0
- package/scss/screen/icon.scss +33 -0
- package/scss/screen/list.scss +90 -0
- package/scss/screen/loading.scss +169 -0
- package/scss/screen/menu.scss +120 -0
- package/scss/screen/modal.scss +238 -0
- package/scss/screen/normalize.scss +340 -0
- package/scss/screen/page.scss +115 -0
- package/scss/screen/pagination.scss +46 -0
- package/scss/screen/ripple.scss +18 -0
- package/scss/screen/scrollbar.scss +108 -0
- package/scss/screen/searchbox.scss +40 -0
- package/scss/screen/selection.scss +190 -0
- package/scss/screen/snackbar.scss +25 -0
- package/scss/screen/sortable.scss +10 -0
- package/scss/screen/table.scss +199 -0
- package/scss/screen/tabs.scss +71 -0
- package/scss/screen/toogle.scss +79 -0
- package/scss/screen/tooltip.scss +16 -0
- package/scss/screen/utils.scss +140 -0
- package/scss/variables/colors.scss +180 -0
- package/scss/variables/defaults.scss +0 -0
- package/scss/wui.scss +2 -0
|
@@ -0,0 +1,1841 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Injectable, Inject, Optional, inject, input, HostBinding, signal, computed, Directive, Input, HostListener, output, EventEmitter, Output, ElementRef, model, effect, ViewContainerRef, ViewChild, Renderer2, Injector, runInInjectionContext, ContentChild } from '@angular/core';
|
|
3
|
+
import * as i3 from '@angular/common';
|
|
4
|
+
import { DOCUMENT, CommonModule, DatePipe, DecimalPipe } from '@angular/common';
|
|
5
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
6
|
+
import { OverlayContainer, Overlay } from '@angular/cdk/overlay';
|
|
7
|
+
import * as i4 from '@angular/cdk/dialog';
|
|
8
|
+
import { Dialog, DEFAULT_DIALOG_CONFIG, DIALOG_SCROLL_STRATEGY, DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';
|
|
9
|
+
import * as i2 from '@angular/cdk/bidi';
|
|
10
|
+
import { Subject, BehaviorSubject, takeUntil as takeUntil$1 } from 'rxjs';
|
|
11
|
+
import { filter, map, takeUntil } from 'rxjs/operators';
|
|
12
|
+
import { NG_VALUE_ACCESSOR, ControlContainer, NgModel } from '@angular/forms';
|
|
13
|
+
import { CdkMenu, CdkMenuItem, CdkMenuTrigger, MENU_TRIGGER, PARENT_OR_NEW_MENU_STACK_PROVIDER } from '@angular/cdk/menu';
|
|
14
|
+
|
|
15
|
+
class WuiSingleComponent {
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiSingleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: WuiSingleComponent, isStandalone: true, selector: "lib-wui-single", ngImport: i0, template: `
|
|
18
|
+
<p>
|
|
19
|
+
wui-single works!
|
|
20
|
+
</p>
|
|
21
|
+
`, isInline: true, styles: [""] });
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiSingleComponent, decorators: [{
|
|
24
|
+
type: Component,
|
|
25
|
+
args: [{ selector: 'lib-wui-single', standalone: true, imports: [], template: `
|
|
26
|
+
<p>
|
|
27
|
+
wui-single works!
|
|
28
|
+
</p>
|
|
29
|
+
` }]
|
|
30
|
+
}] });
|
|
31
|
+
|
|
32
|
+
class WuiModalOverlayContainer extends OverlayContainer {
|
|
33
|
+
setContainerElement(containerElement) {
|
|
34
|
+
this._containerElement = containerElement;
|
|
35
|
+
}
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModalOverlayContainer, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModalOverlayContainer });
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModalOverlayContainer, decorators: [{
|
|
40
|
+
type: Injectable
|
|
41
|
+
}] });
|
|
42
|
+
class WuiModalOverlay extends Overlay {
|
|
43
|
+
_modalOverlayContainer;
|
|
44
|
+
constructor(_scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _appRef, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher) {
|
|
45
|
+
super(_scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher);
|
|
46
|
+
this._modalOverlayContainer = _overlayContainer;
|
|
47
|
+
}
|
|
48
|
+
setContainerElement(containerElement) {
|
|
49
|
+
this._modalOverlayContainer.setContainerElement(containerElement);
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModalOverlay, deps: [{ token: i1.ScrollStrategyOptions }, { token: WuiModalOverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: i1.OverlayPositionBuilder }, { token: i1.OverlayKeyboardDispatcher }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i2.Directionality }, { token: i3.Location }, { token: i1.OverlayOutsideClickDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModalOverlay });
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModalOverlay, decorators: [{
|
|
55
|
+
type: Injectable
|
|
56
|
+
}], ctorParameters: () => [{ type: i1.ScrollStrategyOptions }, { type: WuiModalOverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: i1.OverlayPositionBuilder }, { type: i1.OverlayKeyboardDispatcher }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
57
|
+
type: Inject,
|
|
58
|
+
args: [DOCUMENT]
|
|
59
|
+
}] }, { type: i2.Directionality }, { type: i3.Location }, { type: i1.OverlayOutsideClickDispatcher }] });
|
|
60
|
+
class WuiModal extends Dialog {
|
|
61
|
+
_customOverlay;
|
|
62
|
+
constructor(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, _scrollStrategy) {
|
|
63
|
+
super(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, _scrollStrategy);
|
|
64
|
+
this._customOverlay = _overlay;
|
|
65
|
+
}
|
|
66
|
+
setContainerElement(containerElement) {
|
|
67
|
+
this._customOverlay.setContainerElement(containerElement);
|
|
68
|
+
}
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModal, deps: [{ token: WuiModalOverlay }, { token: i0.Injector }, { token: DEFAULT_DIALOG_CONFIG, optional: true }, { token: i4.Dialog }, { token: WuiModalOverlayContainer }, { token: DIALOG_SCROLL_STRATEGY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
70
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModal });
|
|
71
|
+
}
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiModal, decorators: [{
|
|
73
|
+
type: Injectable
|
|
74
|
+
}], ctorParameters: () => [{ type: WuiModalOverlay }, { type: i0.Injector }, { type: i4.DialogConfig, decorators: [{
|
|
75
|
+
type: Optional
|
|
76
|
+
}, {
|
|
77
|
+
type: Inject,
|
|
78
|
+
args: [DEFAULT_DIALOG_CONFIG]
|
|
79
|
+
}] }, { type: i4.Dialog }, { type: WuiModalOverlayContainer }, { type: undefined, decorators: [{
|
|
80
|
+
type: Optional
|
|
81
|
+
}, {
|
|
82
|
+
type: Inject,
|
|
83
|
+
args: [DIALOG_SCROLL_STRATEGY]
|
|
84
|
+
}] }] });
|
|
85
|
+
|
|
86
|
+
class WuiPageOverlayContainer extends OverlayContainer {
|
|
87
|
+
setContainerElement(containerElement) {
|
|
88
|
+
this._containerElement = containerElement;
|
|
89
|
+
}
|
|
90
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPageOverlayContainer, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
91
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPageOverlayContainer });
|
|
92
|
+
}
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPageOverlayContainer, decorators: [{
|
|
94
|
+
type: Injectable
|
|
95
|
+
}] });
|
|
96
|
+
class WuiPageOverlay extends Overlay {
|
|
97
|
+
_pageOverlayContainer;
|
|
98
|
+
constructor(_scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _appRef, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher) {
|
|
99
|
+
super(_scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher);
|
|
100
|
+
this._pageOverlayContainer = _overlayContainer;
|
|
101
|
+
}
|
|
102
|
+
setContainerElement(containerElement) {
|
|
103
|
+
this._pageOverlayContainer.setContainerElement(containerElement);
|
|
104
|
+
}
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPageOverlay, deps: [{ token: i1.ScrollStrategyOptions }, { token: WuiPageOverlayContainer }, { token: i0.ComponentFactoryResolver }, { token: i1.OverlayPositionBuilder }, { token: i1.OverlayKeyboardDispatcher }, { token: i0.ApplicationRef }, { token: i0.Injector }, { token: i0.NgZone }, { token: DOCUMENT }, { token: i2.Directionality }, { token: i3.Location }, { token: i1.OverlayOutsideClickDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
106
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPageOverlay });
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPageOverlay, decorators: [{
|
|
109
|
+
type: Injectable
|
|
110
|
+
}], ctorParameters: () => [{ type: i1.ScrollStrategyOptions }, { type: WuiPageOverlayContainer }, { type: i0.ComponentFactoryResolver }, { type: i1.OverlayPositionBuilder }, { type: i1.OverlayKeyboardDispatcher }, { type: i0.ApplicationRef }, { type: i0.Injector }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
111
|
+
type: Inject,
|
|
112
|
+
args: [DOCUMENT]
|
|
113
|
+
}] }, { type: i2.Directionality }, { type: i3.Location }, { type: i1.OverlayOutsideClickDispatcher }] });
|
|
114
|
+
class WuiPage extends Dialog {
|
|
115
|
+
_customOverlay;
|
|
116
|
+
constructor(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, _scrollStrategy) {
|
|
117
|
+
super(_overlay, _injector, _defaultOptions, _parentDialog, _overlayContainer, _scrollStrategy);
|
|
118
|
+
this._customOverlay = _overlay;
|
|
119
|
+
}
|
|
120
|
+
setContainerElement(containerElement) {
|
|
121
|
+
this._customOverlay.setContainerElement(containerElement);
|
|
122
|
+
}
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPage, deps: [{ token: WuiPageOverlay }, { token: i0.Injector }, { token: DEFAULT_DIALOG_CONFIG, optional: true }, { token: i4.Dialog }, { token: WuiPageOverlayContainer }, { token: DIALOG_SCROLL_STRATEGY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
124
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPage });
|
|
125
|
+
}
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiPage, decorators: [{
|
|
127
|
+
type: Injectable
|
|
128
|
+
}], ctorParameters: () => [{ type: WuiPageOverlay }, { type: i0.Injector }, { type: i4.DialogConfig, decorators: [{
|
|
129
|
+
type: Optional
|
|
130
|
+
}, {
|
|
131
|
+
type: Inject,
|
|
132
|
+
args: [DEFAULT_DIALOG_CONFIG]
|
|
133
|
+
}] }, { type: i4.Dialog }, { type: WuiPageOverlayContainer }, { type: undefined, decorators: [{
|
|
134
|
+
type: Optional
|
|
135
|
+
}, {
|
|
136
|
+
type: Inject,
|
|
137
|
+
args: [DIALOG_SCROLL_STRATEGY]
|
|
138
|
+
}] }] });
|
|
139
|
+
|
|
140
|
+
class MessageService {
|
|
141
|
+
handler = new Subject();
|
|
142
|
+
set(name, payload) {
|
|
143
|
+
this.handler.next({ name: name, payload: payload });
|
|
144
|
+
}
|
|
145
|
+
get(name) {
|
|
146
|
+
return this.handler.asObservable().pipe(filter(message => message.name === name), map(message => message.payload));
|
|
147
|
+
}
|
|
148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
149
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MessageService, providedIn: 'root' });
|
|
150
|
+
}
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MessageService, decorators: [{
|
|
152
|
+
type: Injectable,
|
|
153
|
+
args: [{
|
|
154
|
+
providedIn: 'root'
|
|
155
|
+
}]
|
|
156
|
+
}] });
|
|
157
|
+
|
|
158
|
+
class DialogComponent {
|
|
159
|
+
data = inject(DIALOG_DATA);
|
|
160
|
+
ref = inject(DialogRef);
|
|
161
|
+
close(index) {
|
|
162
|
+
this.ref.close(index);
|
|
163
|
+
}
|
|
164
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
165
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DialogComponent, isStandalone: true, selector: "wui-dialog", ngImport: i0, template: `
|
|
166
|
+
<div class="wui-modal">
|
|
167
|
+
<div class="wui-modal-inner">
|
|
168
|
+
<div class="wui-modal-header">{{data?.title ?? ""}}</div>
|
|
169
|
+
<div class="wui-modal-content">{{data?.message ?? ""}}</div>
|
|
170
|
+
<div class="wui-modal-footer">
|
|
171
|
+
<div class="d-flex justify-content-end">
|
|
172
|
+
@for(caption of (data?.buttons ?? []); track $index) {
|
|
173
|
+
<button class="wui-button wui-button-smooth" (click)="close($index)">
|
|
174
|
+
{{caption}}
|
|
175
|
+
</button>
|
|
176
|
+
}
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
`, isInline: true });
|
|
182
|
+
}
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogComponent, decorators: [{
|
|
184
|
+
type: Component,
|
|
185
|
+
args: [{
|
|
186
|
+
selector: 'wui-dialog',
|
|
187
|
+
standalone: true,
|
|
188
|
+
imports: [],
|
|
189
|
+
template: `
|
|
190
|
+
<div class="wui-modal">
|
|
191
|
+
<div class="wui-modal-inner">
|
|
192
|
+
<div class="wui-modal-header">{{data?.title ?? ""}}</div>
|
|
193
|
+
<div class="wui-modal-content">{{data?.message ?? ""}}</div>
|
|
194
|
+
<div class="wui-modal-footer">
|
|
195
|
+
<div class="d-flex justify-content-end">
|
|
196
|
+
@for(caption of (data?.buttons ?? []); track $index) {
|
|
197
|
+
<button class="wui-button wui-button-smooth" (click)="close($index)">
|
|
198
|
+
{{caption}}
|
|
199
|
+
</button>
|
|
200
|
+
}
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
`
|
|
206
|
+
}]
|
|
207
|
+
}] });
|
|
208
|
+
|
|
209
|
+
class LoadingComponent {
|
|
210
|
+
mode = input('indeterminate');
|
|
211
|
+
pos = input(0);
|
|
212
|
+
size = input(32);
|
|
213
|
+
get hostClass() {
|
|
214
|
+
return `mode-${this.mode()}`;
|
|
215
|
+
}
|
|
216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: LoadingComponent, isStandalone: true, selector: "wui-loading", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, pos: { classPropertyName: "pos", publicName: "pos", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: `
|
|
218
|
+
<div class="indeterminate" *ngIf="mode() === 'indeterminate'"></div>
|
|
219
|
+
|
|
220
|
+
<div class="linear" *ngIf="mode() === 'linear'">
|
|
221
|
+
<div class="pos" [style.width.%]="pos()"></div>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div class="circular" *ngIf="mode() === 'circular'">
|
|
225
|
+
<div class="showbox">
|
|
226
|
+
<div class="loader" [style.width.px]="size()">
|
|
227
|
+
<svg class="circle" viewBox="25 25 50 50">
|
|
228
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="4" stroke-miterlimit="10"/>
|
|
229
|
+
</svg>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
234
|
+
}
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
236
|
+
type: Component,
|
|
237
|
+
args: [{
|
|
238
|
+
selector: 'wui-loading',
|
|
239
|
+
standalone: true,
|
|
240
|
+
imports: [CommonModule],
|
|
241
|
+
// changeDetection: ChangeDetectionStrategy.OnPush,
|
|
242
|
+
template: `
|
|
243
|
+
<div class="indeterminate" *ngIf="mode() === 'indeterminate'"></div>
|
|
244
|
+
|
|
245
|
+
<div class="linear" *ngIf="mode() === 'linear'">
|
|
246
|
+
<div class="pos" [style.width.%]="pos()"></div>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div class="circular" *ngIf="mode() === 'circular'">
|
|
250
|
+
<div class="showbox">
|
|
251
|
+
<div class="loader" [style.width.px]="size()">
|
|
252
|
+
<svg class="circle" viewBox="25 25 50 50">
|
|
253
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="4" stroke-miterlimit="10"/>
|
|
254
|
+
</svg>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
`,
|
|
259
|
+
}]
|
|
260
|
+
}], propDecorators: { hostClass: [{
|
|
261
|
+
type: HostBinding,
|
|
262
|
+
args: ['class']
|
|
263
|
+
}] } });
|
|
264
|
+
|
|
265
|
+
class LoadingDialogComponent {
|
|
266
|
+
loading = signal(true);
|
|
267
|
+
dialogClass = computed(() => this.loading() ? 'loading-active' : 'loading-idle');
|
|
268
|
+
get hostClass() {
|
|
269
|
+
return this.dialogClass();
|
|
270
|
+
}
|
|
271
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
272
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LoadingDialogComponent, isStandalone: true, selector: "wui-loading-dialog", host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: `
|
|
273
|
+
<wui-loading mode="circular" />
|
|
274
|
+
`, isInline: true, styles: [":host{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;background-color:#fff;box-shadow:0 4px 5px #00000024,0 1px 10px #0000001f,0 2px 4px -1px #0003}\n"], dependencies: [{ kind: "component", type: LoadingComponent, selector: "wui-loading", inputs: ["mode", "pos", "size"] }] });
|
|
275
|
+
}
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingDialogComponent, decorators: [{
|
|
277
|
+
type: Component,
|
|
278
|
+
args: [{ selector: 'wui-loading-dialog', standalone: true, imports: [LoadingComponent], template: `
|
|
279
|
+
<wui-loading mode="circular" />
|
|
280
|
+
`, styles: [":host{display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:50%;background-color:#fff;box-shadow:0 4px 5px #00000024,0 1px 10px #0000001f,0 2px 4px -1px #0003}\n"] }]
|
|
281
|
+
}], propDecorators: { hostClass: [{
|
|
282
|
+
type: HostBinding,
|
|
283
|
+
args: ['class']
|
|
284
|
+
}] } });
|
|
285
|
+
|
|
286
|
+
class WuiService {
|
|
287
|
+
messageService = inject(MessageService);
|
|
288
|
+
rootDialog = inject(Dialog);
|
|
289
|
+
loadingRef;
|
|
290
|
+
dialog(params) {
|
|
291
|
+
return new Promise((resolve) => {
|
|
292
|
+
let ref = this.rootDialog.open(DialogComponent, { disableClose: true, width: '350px', data: params });
|
|
293
|
+
ref.closed.subscribe(result => {
|
|
294
|
+
resolve(result);
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
snackbar(params) {
|
|
299
|
+
this.messageService.set('wui:snackbar', params);
|
|
300
|
+
}
|
|
301
|
+
toggleDrawer() {
|
|
302
|
+
this.messageService.set('wui:toggleDrawer', null);
|
|
303
|
+
}
|
|
304
|
+
openLoading() {
|
|
305
|
+
this.loadingRef = this.rootDialog.open(LoadingDialogComponent, { disableClose: true });
|
|
306
|
+
}
|
|
307
|
+
closeLoading() {
|
|
308
|
+
this.loadingRef.close();
|
|
309
|
+
}
|
|
310
|
+
actionSheet(params) {
|
|
311
|
+
this.messageService.set('wui:action-sheet', params);
|
|
312
|
+
}
|
|
313
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
314
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiService, providedIn: 'root' });
|
|
315
|
+
}
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiService, decorators: [{
|
|
317
|
+
type: Injectable,
|
|
318
|
+
args: [{
|
|
319
|
+
providedIn: 'root'
|
|
320
|
+
}]
|
|
321
|
+
}] });
|
|
322
|
+
|
|
323
|
+
function provideWui() {
|
|
324
|
+
return [
|
|
325
|
+
DatePipe,
|
|
326
|
+
DecimalPipe,
|
|
327
|
+
WuiModalOverlayContainer,
|
|
328
|
+
WuiModalOverlay,
|
|
329
|
+
WuiModal,
|
|
330
|
+
WuiPageOverlayContainer,
|
|
331
|
+
WuiPageOverlay,
|
|
332
|
+
WuiPage,
|
|
333
|
+
WuiService,
|
|
334
|
+
MessageService
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
class NavService {
|
|
339
|
+
lastNavId = 0;
|
|
340
|
+
components = [];
|
|
341
|
+
events = new BehaviorSubject(null);
|
|
342
|
+
constructor() { }
|
|
343
|
+
willPop(navId) {
|
|
344
|
+
let index = this.components.findIndex((c) => c.navId == navId);
|
|
345
|
+
return index > 0;
|
|
346
|
+
}
|
|
347
|
+
setRoot(name, params = {}, options = {}) {
|
|
348
|
+
this.lastNavId++;
|
|
349
|
+
this.events.next({
|
|
350
|
+
type: 'command',
|
|
351
|
+
action: 'root',
|
|
352
|
+
componentName: name,
|
|
353
|
+
navId: this.lastNavId,
|
|
354
|
+
params: params,
|
|
355
|
+
options: options
|
|
356
|
+
});
|
|
357
|
+
return this.lastNavId;
|
|
358
|
+
}
|
|
359
|
+
push(name, params = null, options = {}) {
|
|
360
|
+
this.lastNavId++;
|
|
361
|
+
this.events.next({
|
|
362
|
+
type: 'command',
|
|
363
|
+
action: 'push',
|
|
364
|
+
componentName: name,
|
|
365
|
+
navId: this.lastNavId,
|
|
366
|
+
params: params,
|
|
367
|
+
options: options
|
|
368
|
+
});
|
|
369
|
+
return this.lastNavId;
|
|
370
|
+
}
|
|
371
|
+
pop(params = null, options = {}) {
|
|
372
|
+
this.events.next({
|
|
373
|
+
type: 'command',
|
|
374
|
+
action: 'pop',
|
|
375
|
+
params: params,
|
|
376
|
+
options: options
|
|
377
|
+
});
|
|
378
|
+
return this.lastNavId;
|
|
379
|
+
}
|
|
380
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
381
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavService, providedIn: 'root' });
|
|
382
|
+
}
|
|
383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavService, decorators: [{
|
|
384
|
+
type: Injectable,
|
|
385
|
+
args: [{
|
|
386
|
+
providedIn: 'root'
|
|
387
|
+
}]
|
|
388
|
+
}], ctorParameters: () => [] });
|
|
389
|
+
|
|
390
|
+
class PageService {
|
|
391
|
+
wuiPage = inject(WuiPage);
|
|
392
|
+
isCloseAll = false;
|
|
393
|
+
constructor() { }
|
|
394
|
+
open(component, config) {
|
|
395
|
+
const defaultConfig = {
|
|
396
|
+
width: '100%',
|
|
397
|
+
height: '100%',
|
|
398
|
+
disableClose: true,
|
|
399
|
+
closeOnNavigation: false,
|
|
400
|
+
closeOnDestroy: true,
|
|
401
|
+
hasBackdrop: false,
|
|
402
|
+
...config,
|
|
403
|
+
};
|
|
404
|
+
return this.wuiPage.open(component, defaultConfig);
|
|
405
|
+
}
|
|
406
|
+
replace(component, config) {
|
|
407
|
+
this.closeAll();
|
|
408
|
+
return this.open(component, config);
|
|
409
|
+
}
|
|
410
|
+
closeAll() {
|
|
411
|
+
this.isCloseAll = true;
|
|
412
|
+
this.wuiPage.closeAll();
|
|
413
|
+
this.isCloseAll = false;
|
|
414
|
+
}
|
|
415
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
416
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageService, providedIn: 'root' });
|
|
417
|
+
}
|
|
418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageService, decorators: [{
|
|
419
|
+
type: Injectable,
|
|
420
|
+
args: [{
|
|
421
|
+
providedIn: 'root'
|
|
422
|
+
}]
|
|
423
|
+
}], ctorParameters: () => [] });
|
|
424
|
+
|
|
425
|
+
class ModalService {
|
|
426
|
+
wuiModal = inject(WuiModal);
|
|
427
|
+
open(componentOrTemplateRef, config) {
|
|
428
|
+
const defaultConfig = {
|
|
429
|
+
panelClass: 'wui-modal-overlay-pane',
|
|
430
|
+
height: '100%',
|
|
431
|
+
...config,
|
|
432
|
+
};
|
|
433
|
+
return this.wuiModal.open(componentOrTemplateRef, defaultConfig);
|
|
434
|
+
}
|
|
435
|
+
closeAll() {
|
|
436
|
+
this.wuiModal.closeAll();
|
|
437
|
+
}
|
|
438
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
439
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, providedIn: 'root' });
|
|
440
|
+
}
|
|
441
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalService, decorators: [{
|
|
442
|
+
type: Injectable,
|
|
443
|
+
args: [{
|
|
444
|
+
providedIn: 'root'
|
|
445
|
+
}]
|
|
446
|
+
}] });
|
|
447
|
+
|
|
448
|
+
class RouterService {
|
|
449
|
+
navService;
|
|
450
|
+
$params = new BehaviorSubject(null);
|
|
451
|
+
eventTrigger = 'pushState';
|
|
452
|
+
events = new BehaviorSubject(null);
|
|
453
|
+
navigateUrl = new Subject();
|
|
454
|
+
constructor(navService) {
|
|
455
|
+
this.navService = navService;
|
|
456
|
+
this.events.subscribe(event => {
|
|
457
|
+
if (event?.eventName == 'ActivationEnd') {
|
|
458
|
+
this.$params.next({
|
|
459
|
+
navId: event.navId,
|
|
460
|
+
params: event.params
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
get routeParams() {
|
|
466
|
+
let currentNav = this.navService.components[this.navService.components.length - 1];
|
|
467
|
+
return this.$params.pipe(filter(v => v !== null && v.navId == currentNav.navId), map(v => v.params));
|
|
468
|
+
}
|
|
469
|
+
setParams(navId, params = {}) {
|
|
470
|
+
this.$params.next({ navId: navId, params: params });
|
|
471
|
+
}
|
|
472
|
+
navigate(url) {
|
|
473
|
+
this.navigateUrl.next(url);
|
|
474
|
+
}
|
|
475
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RouterService, deps: [{ token: NavService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
476
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RouterService, providedIn: 'root' });
|
|
477
|
+
}
|
|
478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RouterService, decorators: [{
|
|
479
|
+
type: Injectable,
|
|
480
|
+
args: [{
|
|
481
|
+
providedIn: 'root'
|
|
482
|
+
}]
|
|
483
|
+
}], ctorParameters: () => [{ type: NavService }] });
|
|
484
|
+
|
|
485
|
+
class RippleDirective {
|
|
486
|
+
el;
|
|
487
|
+
rippleEl;
|
|
488
|
+
interval;
|
|
489
|
+
theme = 'light';
|
|
490
|
+
constructor(el) {
|
|
491
|
+
this.el = el;
|
|
492
|
+
}
|
|
493
|
+
onMouseDown(e) {
|
|
494
|
+
this.start(e.clientX, e.clientY);
|
|
495
|
+
}
|
|
496
|
+
onTouchStart(e) {
|
|
497
|
+
this.start(e.touches[0].clientX, e.touches[0].clientY);
|
|
498
|
+
}
|
|
499
|
+
start(x, y) {
|
|
500
|
+
if (!this.rippleEl) {
|
|
501
|
+
this.rippleEl = document.createElement('div');
|
|
502
|
+
this.rippleEl.classList.add('wuiRipple__obj');
|
|
503
|
+
this.rippleEl.classList.add('wuiRipple__' + this.theme);
|
|
504
|
+
this.el.nativeElement.appendChild(this.rippleEl);
|
|
505
|
+
}
|
|
506
|
+
this.rippleEl.style.cssText = "";
|
|
507
|
+
if (this.interval) {
|
|
508
|
+
clearInterval(this.interval);
|
|
509
|
+
}
|
|
510
|
+
var elRect = this.el.nativeElement.getBoundingClientRect();
|
|
511
|
+
let top = (y - elRect.y);
|
|
512
|
+
let left = (x - elRect.x);
|
|
513
|
+
this.rippleEl.style.top = top + 'px';
|
|
514
|
+
this.rippleEl.style.left = left + 'px';
|
|
515
|
+
let matrix = (this.el.nativeElement.offsetWidth > this.el.nativeElement.offsetHeight ? 'width' : 'height');
|
|
516
|
+
let size = 0;
|
|
517
|
+
let durMatrix = 0;
|
|
518
|
+
if (matrix == 'width') {
|
|
519
|
+
size = ((this.el.nativeElement.offsetWidth - left) > left ? ((this.el.nativeElement.offsetWidth - left) * 2) :
|
|
520
|
+
(left * 2));
|
|
521
|
+
durMatrix = document.body.clientWidth;
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
size = ((this.el.nativeElement.offsetHeight - top) > top ? ((this.el.nativeElement.offsetHeight - top) * 2) :
|
|
525
|
+
(top * 2));
|
|
526
|
+
durMatrix = document.body.clientHeight;
|
|
527
|
+
}
|
|
528
|
+
this.animate(size, 200 + (200 * (size / durMatrix)));
|
|
529
|
+
}
|
|
530
|
+
animate(size, duration) {
|
|
531
|
+
let pos = 0;
|
|
532
|
+
this.interval = setInterval(() => {
|
|
533
|
+
let vsize = this.rippleEl.offsetHeight + (size / (duration / 10));
|
|
534
|
+
this.rippleEl.style.width = vsize + 'px';
|
|
535
|
+
this.rippleEl.style.height = vsize + 'px';
|
|
536
|
+
this.rippleEl.style.opacity = ((duration - pos) / duration);
|
|
537
|
+
if (pos < duration) {
|
|
538
|
+
pos += 10;
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
this.rippleEl.style.cssText = "";
|
|
542
|
+
clearInterval(this.interval);
|
|
543
|
+
}
|
|
544
|
+
}, 10);
|
|
545
|
+
}
|
|
546
|
+
ngOnInit() {
|
|
547
|
+
this.el.nativeElement.style.position = 'relative';
|
|
548
|
+
this.el.nativeElement.style.overflow = 'hidden';
|
|
549
|
+
}
|
|
550
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RippleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
551
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: RippleDirective, isStandalone: true, selector: "[wuiRipple]", inputs: { theme: ["rippleTheme", "theme"] }, host: { listeners: { "mousedown": "onMouseDown($event)", "touchstart": "onTouchStart($event)" } }, ngImport: i0 });
|
|
552
|
+
}
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RippleDirective, decorators: [{
|
|
554
|
+
type: Directive,
|
|
555
|
+
args: [{
|
|
556
|
+
selector: '[wuiRipple]',
|
|
557
|
+
standalone: true
|
|
558
|
+
}]
|
|
559
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { theme: [{
|
|
560
|
+
type: Input,
|
|
561
|
+
args: ['rippleTheme']
|
|
562
|
+
}], onMouseDown: [{
|
|
563
|
+
type: HostListener,
|
|
564
|
+
args: ['mousedown', ['$event']]
|
|
565
|
+
}], onTouchStart: [{
|
|
566
|
+
type: HostListener,
|
|
567
|
+
args: ['touchstart', ['$event']]
|
|
568
|
+
}] } });
|
|
569
|
+
|
|
570
|
+
class NavRootDirective {
|
|
571
|
+
navService = inject(NavService);
|
|
572
|
+
name = input.required({ alias: 'wuiNavRoot' });
|
|
573
|
+
params = input({}, { alias: 'wuiNavParams' });
|
|
574
|
+
navigated = output();
|
|
575
|
+
navigateToRoot() {
|
|
576
|
+
this.navService.setRoot(this.name());
|
|
577
|
+
this.navigated.emit();
|
|
578
|
+
}
|
|
579
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
580
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NavRootDirective, isStandalone: true, selector: "[wuiNavRoot]", inputs: { name: { classPropertyName: "name", publicName: "wuiNavRoot", isSignal: true, isRequired: true, transformFunction: null }, params: { classPropertyName: "params", publicName: "wuiNavParams", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigated: "navigated" }, host: { listeners: { "click": "navigateToRoot()" } }, ngImport: i0 });
|
|
581
|
+
}
|
|
582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavRootDirective, decorators: [{
|
|
583
|
+
type: Directive,
|
|
584
|
+
args: [{
|
|
585
|
+
selector: '[wuiNavRoot]',
|
|
586
|
+
standalone: true,
|
|
587
|
+
host: {
|
|
588
|
+
'(click)': 'navigateToRoot()'
|
|
589
|
+
}
|
|
590
|
+
}]
|
|
591
|
+
}] });
|
|
592
|
+
class NavPushDirective {
|
|
593
|
+
navService;
|
|
594
|
+
name = input.required({ alias: 'wuiNavPush' });
|
|
595
|
+
params = input({}, { alias: 'wuiNavParams' });
|
|
596
|
+
navigated = output();
|
|
597
|
+
constructor(navService) {
|
|
598
|
+
this.navService = navService;
|
|
599
|
+
}
|
|
600
|
+
navigatePush() {
|
|
601
|
+
this.navService.push(this.name());
|
|
602
|
+
this.navigated.emit();
|
|
603
|
+
}
|
|
604
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavPushDirective, deps: [{ token: NavService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
605
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NavPushDirective, isStandalone: true, selector: "[wuiNavPush]", inputs: { name: { classPropertyName: "name", publicName: "wuiNavPush", isSignal: true, isRequired: true, transformFunction: null }, params: { classPropertyName: "params", publicName: "wuiNavParams", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigated: "navigated" }, host: { listeners: { "click": "navigatePush()" } }, ngImport: i0 });
|
|
606
|
+
}
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavPushDirective, decorators: [{
|
|
608
|
+
type: Directive,
|
|
609
|
+
args: [{
|
|
610
|
+
selector: '[wuiNavPush]',
|
|
611
|
+
standalone: true,
|
|
612
|
+
host: {
|
|
613
|
+
'(click)': 'navigatePush()'
|
|
614
|
+
}
|
|
615
|
+
}]
|
|
616
|
+
}], ctorParameters: () => [{ type: NavService }] });
|
|
617
|
+
class NavPopDirective {
|
|
618
|
+
navService;
|
|
619
|
+
// Optional pop params
|
|
620
|
+
params = input(null, { alias: 'wuiNavParams' });
|
|
621
|
+
// Navigation event output
|
|
622
|
+
navigated = output();
|
|
623
|
+
constructor(navService) {
|
|
624
|
+
this.navService = navService;
|
|
625
|
+
}
|
|
626
|
+
navigatePop() {
|
|
627
|
+
this.navService.pop(this.params());
|
|
628
|
+
this.navigated.emit();
|
|
629
|
+
}
|
|
630
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavPopDirective, deps: [{ token: NavService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
631
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NavPopDirective, isStandalone: true, selector: "[wuiNavPop]", inputs: { params: { classPropertyName: "params", publicName: "wuiNavParams", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { navigated: "navigated" }, host: { listeners: { "click": "navigatePop()" } }, ngImport: i0 });
|
|
632
|
+
}
|
|
633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavPopDirective, decorators: [{
|
|
634
|
+
type: Directive,
|
|
635
|
+
args: [{
|
|
636
|
+
selector: '[wuiNavPop]',
|
|
637
|
+
standalone: true,
|
|
638
|
+
host: {
|
|
639
|
+
'(click)': 'navigatePop()'
|
|
640
|
+
}
|
|
641
|
+
}]
|
|
642
|
+
}], ctorParameters: () => [{ type: NavService }] });
|
|
643
|
+
|
|
644
|
+
class ScrollEndDirective {
|
|
645
|
+
scrollEnd = new EventEmitter();
|
|
646
|
+
onScroll(e) {
|
|
647
|
+
if (e.target.offsetHeight + e.target.scrollTop >= e.target.scrollHeight) {
|
|
648
|
+
this.scrollEnd.emit(e);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
constructor() { }
|
|
652
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScrollEndDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
653
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ScrollEndDirective, isStandalone: true, selector: "[wuiScrollEnd]", outputs: { scrollEnd: "scrollEnd" }, host: { listeners: { "scroll": "onScroll($event)" } }, ngImport: i0 });
|
|
654
|
+
}
|
|
655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ScrollEndDirective, decorators: [{
|
|
656
|
+
type: Directive,
|
|
657
|
+
args: [{
|
|
658
|
+
selector: '[wuiScrollEnd]',
|
|
659
|
+
standalone: true
|
|
660
|
+
}]
|
|
661
|
+
}], ctorParameters: () => [], propDecorators: { scrollEnd: [{
|
|
662
|
+
type: Output,
|
|
663
|
+
args: ['scrollEnd']
|
|
664
|
+
}], onScroll: [{
|
|
665
|
+
type: HostListener,
|
|
666
|
+
args: ['scroll', ['$event']]
|
|
667
|
+
}] } });
|
|
668
|
+
|
|
669
|
+
class PageHeaderDirective {
|
|
670
|
+
el;
|
|
671
|
+
contentEl;
|
|
672
|
+
wuiTitle;
|
|
673
|
+
constructor(el) {
|
|
674
|
+
this.el = el;
|
|
675
|
+
}
|
|
676
|
+
getClosest(elem, selector) {
|
|
677
|
+
for (; elem && elem !== document; elem = elem.parentNode) {
|
|
678
|
+
if (elem.matches(selector))
|
|
679
|
+
return elem;
|
|
680
|
+
}
|
|
681
|
+
return null;
|
|
682
|
+
}
|
|
683
|
+
;
|
|
684
|
+
onScroll(e) {
|
|
685
|
+
if (e.target.scrollTop > Math.round((e.target.offsetHeight / 2) / 2)) {
|
|
686
|
+
this.wuiTitle.classList.add('show');
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
this.wuiTitle.classList.remove('show');
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
ngOnInit() {
|
|
693
|
+
this.contentEl = this.getClosest(this.el.nativeElement, 'div.content');
|
|
694
|
+
this.el.nativeElement.style.height = Math.round(this.contentEl.offsetHeight / 2) + "px";
|
|
695
|
+
if (this.wuiTitle !== undefined) {
|
|
696
|
+
this.contentEl.addEventListener('scroll', (e) => {
|
|
697
|
+
this.onScroll(e);
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageHeaderDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
702
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: PageHeaderDirective, isStandalone: true, selector: "[wuiPageHeader]", inputs: { wuiTitle: "wuiTitle" }, ngImport: i0 });
|
|
703
|
+
}
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageHeaderDirective, decorators: [{
|
|
705
|
+
type: Directive,
|
|
706
|
+
args: [{
|
|
707
|
+
selector: '[wuiPageHeader]',
|
|
708
|
+
standalone: true
|
|
709
|
+
}]
|
|
710
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { wuiTitle: [{
|
|
711
|
+
type: Input,
|
|
712
|
+
args: ['wuiTitle']
|
|
713
|
+
}] } });
|
|
714
|
+
|
|
715
|
+
class NumInputDirective {
|
|
716
|
+
decimalPipe = inject(DecimalPipe);
|
|
717
|
+
elementRef = inject((ElementRef));
|
|
718
|
+
// Input signals
|
|
719
|
+
format = input('1.0-2');
|
|
720
|
+
value = model(null);
|
|
721
|
+
// Computed signals
|
|
722
|
+
isNegative = computed(() => this.value()?.includes('-') ?? false);
|
|
723
|
+
isDecimal = computed(() => this.value()?.includes('.') ?? false);
|
|
724
|
+
numberPart = computed(() => {
|
|
725
|
+
const regex = this.isNegative() ? /-(.*)/ : /(.*)/;
|
|
726
|
+
const match = this.value()?.match(regex);
|
|
727
|
+
return this.parseNumber(match?.[1] ?? null);
|
|
728
|
+
});
|
|
729
|
+
decimalPart = computed(() => {
|
|
730
|
+
if (!this.isDecimal())
|
|
731
|
+
return null;
|
|
732
|
+
const match = this.value()?.match(/\.(.*)/);
|
|
733
|
+
return match?.[1] ?? null;
|
|
734
|
+
});
|
|
735
|
+
numericValue = computed(() => {
|
|
736
|
+
const numStr = [this.numberPart(), this.decimalPart()].filter(Boolean).join('.');
|
|
737
|
+
const num = parseFloat(numStr);
|
|
738
|
+
return this.isNegative() ? -num : num;
|
|
739
|
+
});
|
|
740
|
+
formattedValue = computed(() => {
|
|
741
|
+
const prefix = this.isNegative() ? '-' : '';
|
|
742
|
+
const number = this.numberPart() ?
|
|
743
|
+
this.decimalPipe.transform(this.numberPart(), this.format()) : '';
|
|
744
|
+
const decimal = this.isDecimal() ? `.${this.decimalPart()}` : '';
|
|
745
|
+
return `${prefix}${number}${decimal}`;
|
|
746
|
+
});
|
|
747
|
+
// Filter functions (unchanged from previous version)
|
|
748
|
+
allowNumbers(event) { }
|
|
749
|
+
allowFunctional(event) { }
|
|
750
|
+
allowDecimals(event) { }
|
|
751
|
+
allowNegative(event) { }
|
|
752
|
+
constructor() {
|
|
753
|
+
effect(() => {
|
|
754
|
+
this.elementRef.nativeElement.value = this.formattedValue();
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
handleKeyDown(event) {
|
|
758
|
+
const allowed = [
|
|
759
|
+
this.allowNumbers(event),
|
|
760
|
+
this.allowFunctional(event),
|
|
761
|
+
this.allowDecimals(event),
|
|
762
|
+
this.allowNegative(event)
|
|
763
|
+
].some(Boolean);
|
|
764
|
+
if (!allowed) {
|
|
765
|
+
event.preventDefault();
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
setTimeout(() => {
|
|
769
|
+
this.value.set(this.elementRef.nativeElement.value);
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
handleFocusOut() {
|
|
773
|
+
this.value.set(this.elementRef.nativeElement.value);
|
|
774
|
+
}
|
|
775
|
+
parseNumber(str) {
|
|
776
|
+
if (!str)
|
|
777
|
+
return null;
|
|
778
|
+
const num = parseFloat(str.replace(/[^\d.]/g, ''));
|
|
779
|
+
return isNaN(num) ? null : num;
|
|
780
|
+
}
|
|
781
|
+
// ControlValueAccessor implementation
|
|
782
|
+
writeValue(obj) {
|
|
783
|
+
this.value.set(obj?.toString() ?? null);
|
|
784
|
+
}
|
|
785
|
+
registerOnChange(fn) {
|
|
786
|
+
effect(() => {
|
|
787
|
+
fn(this.numericValue());
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
registerOnTouched(fn) { }
|
|
791
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NumInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
792
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: NumInputDirective, isStandalone: true, selector: "[wuiNumInput]", inputs: { format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "keydown": "handleKeyDown($event)", "focusout": "handleFocusOut($event)" }, properties: { "attr.inputmode": "\"decimal\"" } }, providers: [{
|
|
793
|
+
provide: NG_VALUE_ACCESSOR,
|
|
794
|
+
useExisting: NumInputDirective,
|
|
795
|
+
multi: true
|
|
796
|
+
}], ngImport: i0 });
|
|
797
|
+
}
|
|
798
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NumInputDirective, decorators: [{
|
|
799
|
+
type: Directive,
|
|
800
|
+
args: [{
|
|
801
|
+
selector: '[wuiNumInput]',
|
|
802
|
+
standalone: true,
|
|
803
|
+
providers: [{
|
|
804
|
+
provide: NG_VALUE_ACCESSOR,
|
|
805
|
+
useExisting: NumInputDirective,
|
|
806
|
+
multi: true
|
|
807
|
+
}],
|
|
808
|
+
host: {
|
|
809
|
+
'(keydown)': 'handleKeyDown($event)',
|
|
810
|
+
'(focusout)': 'handleFocusOut($event)',
|
|
811
|
+
'[attr.inputmode]': '"decimal"'
|
|
812
|
+
}
|
|
813
|
+
}]
|
|
814
|
+
}], ctorParameters: () => [] });
|
|
815
|
+
|
|
816
|
+
class SortableDirective {
|
|
817
|
+
el;
|
|
818
|
+
change = new EventEmitter();
|
|
819
|
+
xFactor = 0;
|
|
820
|
+
yFactor = 0;
|
|
821
|
+
child;
|
|
822
|
+
childOriginRect;
|
|
823
|
+
placeholder;
|
|
824
|
+
mouseMove(e) {
|
|
825
|
+
if (this.child == null && this.placeholder == null)
|
|
826
|
+
return;
|
|
827
|
+
let parentRect = this.child.offsetParent != null ? this.child.offsetParent.getBoundingClientRect() : { x: 0, y: 0 };
|
|
828
|
+
this.child.style.top = e.clientY - parentRect.y - this.yFactor + 'px';
|
|
829
|
+
this.child.style.left = e.clientX - parentRect.x - this.xFactor + 'px';
|
|
830
|
+
let elementAfter = this.getElementBefore(this.el.nativeElement, e.clientY);
|
|
831
|
+
if (elementAfter == null) {
|
|
832
|
+
this.el.nativeElement.appendChild(this.placeholder);
|
|
833
|
+
}
|
|
834
|
+
else {
|
|
835
|
+
this.el.nativeElement.insertBefore(this.placeholder, elementAfter);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
mouseUp(e) {
|
|
839
|
+
if (this.child == null && this.placeholder == null)
|
|
840
|
+
return;
|
|
841
|
+
this.child.classList.remove('wui-sortable-item-dragging');
|
|
842
|
+
this.child.style.removeProperty('width');
|
|
843
|
+
this.child.style.removeProperty('top');
|
|
844
|
+
this.child.style.removeProperty('left');
|
|
845
|
+
this.el.nativeElement.insertBefore(this.child, this.placeholder);
|
|
846
|
+
this.placeholder.remove();
|
|
847
|
+
this.child = null;
|
|
848
|
+
this.placeholder = null;
|
|
849
|
+
this.change.emit([].slice.call(this.el.nativeElement.children).map((child) => child.dataset.key));
|
|
850
|
+
}
|
|
851
|
+
getElementBefore(container, y) {
|
|
852
|
+
let items = [...container.querySelectorAll('.wui-sortable-item:not(.wui-sortable-item-dragging, .wui-sortable-item-placeholder)')];
|
|
853
|
+
return items.reduce((terdekat, child) => {
|
|
854
|
+
let box = child.getBoundingClientRect();
|
|
855
|
+
let offset = y - box.top - (box.height / 2);
|
|
856
|
+
if (offset < 0 && offset > terdekat.offset) {
|
|
857
|
+
return { offset: offset, element: child };
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
return terdekat;
|
|
861
|
+
}
|
|
862
|
+
}, { offset: Number.NEGATIVE_INFINITY }).element;
|
|
863
|
+
}
|
|
864
|
+
constructor(el) {
|
|
865
|
+
this.el = el;
|
|
866
|
+
}
|
|
867
|
+
init() {
|
|
868
|
+
this.el.nativeElement.classList.add('wui-sortable');
|
|
869
|
+
[].slice.call(this.el.nativeElement.children).forEach((child) => {
|
|
870
|
+
child.classList.add('wui-sortable-item');
|
|
871
|
+
child.addEventListener('mousedown', (e) => {
|
|
872
|
+
let parentRect = child.offsetParent != null ? child.offsetParent.getBoundingClientRect() : { x: 0, y: 0 };
|
|
873
|
+
// console.log(child.offsetParent);
|
|
874
|
+
this.childOriginRect = child.getBoundingClientRect();
|
|
875
|
+
this.xFactor = e.clientX - this.childOriginRect.x;
|
|
876
|
+
this.yFactor = e.clientY - this.childOriginRect.y;
|
|
877
|
+
this.placeholder = document.createElement('div');
|
|
878
|
+
this.placeholder.classList.add('wui-sortable-item', 'wui-sortable-item-placeholder');
|
|
879
|
+
this.placeholder.style.height = this.childOriginRect.height + 'px';
|
|
880
|
+
this.placeholder.style.opacity = '0';
|
|
881
|
+
this.el.nativeElement.insertBefore(this.placeholder, child);
|
|
882
|
+
this.child = child;
|
|
883
|
+
this.child.classList.add('wui-sortable-item-dragging');
|
|
884
|
+
this.child.style.width = this.childOriginRect.width + 'px';
|
|
885
|
+
this.child.style.top = e.clientY - parentRect.y - this.yFactor + 'px';
|
|
886
|
+
this.child.style.left = e.clientX - parentRect.x - this.xFactor + 'px';
|
|
887
|
+
});
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
ngAfterViewInit() {
|
|
891
|
+
this.init();
|
|
892
|
+
}
|
|
893
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SortableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
894
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: SortableDirective, isStandalone: true, selector: "[wuiSortable]", outputs: { change: "wuiSortableChange" }, host: { listeners: { "window:mousemove": "mouseMove($event)", "window:mouseup": "mouseUp($event)" } }, ngImport: i0 });
|
|
895
|
+
}
|
|
896
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SortableDirective, decorators: [{
|
|
897
|
+
type: Directive,
|
|
898
|
+
args: [{
|
|
899
|
+
selector: '[wuiSortable]',
|
|
900
|
+
standalone: true
|
|
901
|
+
}]
|
|
902
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { change: [{
|
|
903
|
+
type: Output,
|
|
904
|
+
args: ['wuiSortableChange']
|
|
905
|
+
}], mouseMove: [{
|
|
906
|
+
type: HostListener,
|
|
907
|
+
args: ['window:mousemove', ['$event']]
|
|
908
|
+
}], mouseUp: [{
|
|
909
|
+
type: HostListener,
|
|
910
|
+
args: ['window:mouseup', ['$event']]
|
|
911
|
+
}] } });
|
|
912
|
+
|
|
913
|
+
class ContextMenuDirective extends CdkMenu {
|
|
914
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContextMenuDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
915
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ContextMenuDirective, isStandalone: true, selector: "[wuiContextMenu]", usesInheritance: true, ngImport: i0 });
|
|
916
|
+
}
|
|
917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContextMenuDirective, decorators: [{
|
|
918
|
+
type: Directive,
|
|
919
|
+
args: [{
|
|
920
|
+
selector: '[wuiContextMenu]',
|
|
921
|
+
standalone: true
|
|
922
|
+
}]
|
|
923
|
+
}] });
|
|
924
|
+
class ContextMenuItemDirective extends CdkMenuItem {
|
|
925
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContextMenuItemDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
926
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ContextMenuItemDirective, isStandalone: true, selector: "[wuiContextMenuItem]", usesInheritance: true, ngImport: i0 });
|
|
927
|
+
}
|
|
928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContextMenuItemDirective, decorators: [{
|
|
929
|
+
type: Directive,
|
|
930
|
+
args: [{
|
|
931
|
+
selector: '[wuiContextMenuItem]',
|
|
932
|
+
standalone: true
|
|
933
|
+
}]
|
|
934
|
+
}] });
|
|
935
|
+
class ContextMenuTriggerDirective extends CdkMenuTrigger {
|
|
936
|
+
menuPosBehavior = 'default'; // or 'edge'
|
|
937
|
+
handleDocumentEvent(event) {
|
|
938
|
+
if (this.isOpen())
|
|
939
|
+
this.close();
|
|
940
|
+
}
|
|
941
|
+
open() {
|
|
942
|
+
if (this.menuPosBehavior === 'default') {
|
|
943
|
+
this.menuPosition = [
|
|
944
|
+
{ overlayY: 'top', overlayX: 'start', originY: 'top', originX: 'start' },
|
|
945
|
+
{ overlayY: 'top', overlayX: 'end', originY: 'top', originX: 'end' },
|
|
946
|
+
{ overlayY: 'bottom', overlayX: 'start', originY: 'bottom', originX: 'start' },
|
|
947
|
+
{ overlayY: 'bottom', overlayX: 'end', originY: 'bottom', originX: 'start' }
|
|
948
|
+
];
|
|
949
|
+
}
|
|
950
|
+
super.open();
|
|
951
|
+
}
|
|
952
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContextMenuTriggerDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
953
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ContextMenuTriggerDirective, isStandalone: true, selector: "[wuiContextMenuTrigger]", inputs: { menuTemplateRef: ["wuiContextMenuTrigger", "menuTemplateRef"], menuPosition: ["wuiContextMenuPosition", "menuPosition"], menuData: ["wuiContextMenuTriggerData", "menuData"], menuPosBehavior: ["wuiContextMenuPosBehavior", "menuPosBehavior"] }, host: { listeners: { "document:touchmove": "handleDocumentEvent($event)", "document:mousewheel": "handleDocumentEvent($event)" } }, providers: [
|
|
954
|
+
{ provide: MENU_TRIGGER, useExisting: ContextMenuTriggerDirective },
|
|
955
|
+
PARENT_OR_NEW_MENU_STACK_PROVIDER,
|
|
956
|
+
], exportAs: ["wuiContextMenuTrigger"], usesInheritance: true, ngImport: i0 });
|
|
957
|
+
}
|
|
958
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ContextMenuTriggerDirective, decorators: [{
|
|
959
|
+
type: Directive,
|
|
960
|
+
args: [{
|
|
961
|
+
selector: '[wuiContextMenuTrigger]',
|
|
962
|
+
exportAs: 'wuiContextMenuTrigger',
|
|
963
|
+
standalone: true,
|
|
964
|
+
inputs: [
|
|
965
|
+
{ name: 'menuTemplateRef', alias: 'wuiContextMenuTrigger' },
|
|
966
|
+
{ name: 'menuPosition', alias: 'wuiContextMenuPosition' },
|
|
967
|
+
{ name: 'menuData', alias: 'wuiContextMenuTriggerData' }
|
|
968
|
+
],
|
|
969
|
+
providers: [
|
|
970
|
+
{ provide: MENU_TRIGGER, useExisting: ContextMenuTriggerDirective },
|
|
971
|
+
PARENT_OR_NEW_MENU_STACK_PROVIDER,
|
|
972
|
+
],
|
|
973
|
+
host: {
|
|
974
|
+
'(document:touchmove)': 'handleDocumentEvent($event)',
|
|
975
|
+
'(document:mousewheel)': 'handleDocumentEvent($event)'
|
|
976
|
+
}
|
|
977
|
+
}]
|
|
978
|
+
}], propDecorators: { menuPosBehavior: [{
|
|
979
|
+
type: Input,
|
|
980
|
+
args: ['wuiContextMenuPosBehavior']
|
|
981
|
+
}], handleDocumentEvent: [{
|
|
982
|
+
type: HostListener,
|
|
983
|
+
args: ['document:touchmove', ['$event']]
|
|
984
|
+
}, {
|
|
985
|
+
type: HostListener,
|
|
986
|
+
args: ['document:mousewheel', ['$event']]
|
|
987
|
+
}] } });
|
|
988
|
+
|
|
989
|
+
class ModalComponent {
|
|
990
|
+
width = input('300px');
|
|
991
|
+
showSignal = signal(false);
|
|
992
|
+
isVisible = computed(() => this.showSignal());
|
|
993
|
+
get show() {
|
|
994
|
+
return this.isVisible();
|
|
995
|
+
}
|
|
996
|
+
open() {
|
|
997
|
+
this.showSignal.set(true);
|
|
998
|
+
}
|
|
999
|
+
close() {
|
|
1000
|
+
this.showSignal.set(false);
|
|
1001
|
+
}
|
|
1002
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1003
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: ModalComponent, isStandalone: true, selector: "wui-modal", inputs: { width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.show": "this.show" } }, ngImport: i0, template: `
|
|
1004
|
+
<div class="wui-modal-inner" [style.max-width]="width()" cdkTrapFocus>
|
|
1005
|
+
<ng-content></ng-content>
|
|
1006
|
+
</div>
|
|
1007
|
+
`, isInline: true });
|
|
1008
|
+
}
|
|
1009
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalComponent, decorators: [{
|
|
1010
|
+
type: Component,
|
|
1011
|
+
args: [{
|
|
1012
|
+
selector: 'wui-modal',
|
|
1013
|
+
standalone: true,
|
|
1014
|
+
template: `
|
|
1015
|
+
<div class="wui-modal-inner" [style.max-width]="width()" cdkTrapFocus>
|
|
1016
|
+
<ng-content></ng-content>
|
|
1017
|
+
</div>
|
|
1018
|
+
`
|
|
1019
|
+
}]
|
|
1020
|
+
}], propDecorators: { show: [{
|
|
1021
|
+
type: HostBinding,
|
|
1022
|
+
args: ['class.show']
|
|
1023
|
+
}] } });
|
|
1024
|
+
|
|
1025
|
+
class NavComponent {
|
|
1026
|
+
navService;
|
|
1027
|
+
componentFactoryResolver;
|
|
1028
|
+
viewContainer;
|
|
1029
|
+
unsub = new Subject();
|
|
1030
|
+
constructor(navService, componentFactoryResolver) {
|
|
1031
|
+
this.navService = navService;
|
|
1032
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1033
|
+
}
|
|
1034
|
+
root(e) {
|
|
1035
|
+
this.viewContainer?.clear();
|
|
1036
|
+
this.navService.components = [];
|
|
1037
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(e.componentName);
|
|
1038
|
+
const componentRef = this.viewContainer?.createComponent(componentFactory);
|
|
1039
|
+
const instance = componentRef?.instance;
|
|
1040
|
+
instance.navId = e.navId;
|
|
1041
|
+
instance.params = e.params;
|
|
1042
|
+
this.navService.components.push({
|
|
1043
|
+
navId: e.navId,
|
|
1044
|
+
componentName: e.componentName,
|
|
1045
|
+
componentRef,
|
|
1046
|
+
options: e.options
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
push(e) {
|
|
1050
|
+
const componentFactory = this.componentFactoryResolver.resolveComponentFactory(e.componentName);
|
|
1051
|
+
const componentRef = this.viewContainer?.createComponent(componentFactory);
|
|
1052
|
+
const instance = componentRef?.instance;
|
|
1053
|
+
instance.navId = e.navId;
|
|
1054
|
+
instance.params = e.params;
|
|
1055
|
+
this.navService.components.push({
|
|
1056
|
+
navId: e.navId,
|
|
1057
|
+
componentName: e.componentName,
|
|
1058
|
+
componentRef,
|
|
1059
|
+
options: e.options
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
pop(e) {
|
|
1063
|
+
if (this.viewContainer && (this.viewContainer?.length ?? 0) > 0) {
|
|
1064
|
+
this.viewContainer.remove(this.viewContainer?.length - 1);
|
|
1065
|
+
}
|
|
1066
|
+
this.navService.components[this.navService.components.length - 1].componentRef.destroy();
|
|
1067
|
+
this.navService.components.pop();
|
|
1068
|
+
}
|
|
1069
|
+
ngOnInit() {
|
|
1070
|
+
this.navService.events.pipe(takeUntil(this.unsub)).subscribe(async (e) => {
|
|
1071
|
+
if (e !== null && e.type === 'command') {
|
|
1072
|
+
switch (e.action) {
|
|
1073
|
+
case 'root':
|
|
1074
|
+
this.root(e);
|
|
1075
|
+
break;
|
|
1076
|
+
case 'push':
|
|
1077
|
+
this.push(e);
|
|
1078
|
+
break;
|
|
1079
|
+
case 'pop':
|
|
1080
|
+
this.pop(e);
|
|
1081
|
+
break;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
ngOnDestroy() {
|
|
1087
|
+
this.unsub.next(null);
|
|
1088
|
+
this.unsub.complete();
|
|
1089
|
+
}
|
|
1090
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavComponent, deps: [{ token: NavService }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
|
|
1091
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NavComponent, isStandalone: true, selector: "wui-nav", viewQueries: [{ propertyName: "viewContainer", first: true, predicate: ["navHost"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `<ng-template #navHost></ng-template>`, isInline: true });
|
|
1092
|
+
}
|
|
1093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavComponent, decorators: [{
|
|
1094
|
+
type: Component,
|
|
1095
|
+
args: [{
|
|
1096
|
+
selector: 'wui-nav',
|
|
1097
|
+
standalone: true,
|
|
1098
|
+
template: `<ng-template #navHost></ng-template>`
|
|
1099
|
+
}]
|
|
1100
|
+
}], ctorParameters: () => [{ type: NavService }, { type: i0.ComponentFactoryResolver }], propDecorators: { viewContainer: [{
|
|
1101
|
+
type: ViewChild,
|
|
1102
|
+
args: ['navHost', { read: ViewContainerRef, static: true }]
|
|
1103
|
+
}] } });
|
|
1104
|
+
|
|
1105
|
+
class PageHostComponent {
|
|
1106
|
+
pageDialog = inject(WuiPage);
|
|
1107
|
+
elementRef = inject(ElementRef);
|
|
1108
|
+
constructor() {
|
|
1109
|
+
this.pageDialog.setContainerElement(this.elementRef.nativeElement);
|
|
1110
|
+
}
|
|
1111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PageHostComponent, isStandalone: true, selector: "wui-page-host", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
1113
|
+
}
|
|
1114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageHostComponent, decorators: [{
|
|
1115
|
+
type: Component,
|
|
1116
|
+
args: [{
|
|
1117
|
+
selector: 'wui-page-host',
|
|
1118
|
+
standalone: true,
|
|
1119
|
+
template: `<ng-content></ng-content>`
|
|
1120
|
+
}]
|
|
1121
|
+
}], ctorParameters: () => [] });
|
|
1122
|
+
|
|
1123
|
+
class ModalHostComponent {
|
|
1124
|
+
modalDialog = inject(WuiModal);
|
|
1125
|
+
elementRef = inject(ElementRef);
|
|
1126
|
+
constructor() {
|
|
1127
|
+
this.modalDialog.setContainerElement(this.elementRef.nativeElement);
|
|
1128
|
+
}
|
|
1129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1130
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ModalHostComponent, isStandalone: true, selector: "wui-modal-host", ngImport: i0, template: ``, isInline: true });
|
|
1131
|
+
}
|
|
1132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModalHostComponent, decorators: [{
|
|
1133
|
+
type: Component,
|
|
1134
|
+
args: [{
|
|
1135
|
+
selector: 'wui-modal-host',
|
|
1136
|
+
standalone: true,
|
|
1137
|
+
template: ``
|
|
1138
|
+
}]
|
|
1139
|
+
}], ctorParameters: () => [] });
|
|
1140
|
+
|
|
1141
|
+
class SnackbarComponent {
|
|
1142
|
+
messageService;
|
|
1143
|
+
actionItems = [];
|
|
1144
|
+
label = '';
|
|
1145
|
+
show = false;
|
|
1146
|
+
autocloseTimeoutId;
|
|
1147
|
+
unsub = new Subject();
|
|
1148
|
+
constructor(messageService) {
|
|
1149
|
+
this.messageService = messageService;
|
|
1150
|
+
}
|
|
1151
|
+
open(label, autoclose = true, actionItems = []) {
|
|
1152
|
+
this.label = label;
|
|
1153
|
+
this.actionItems = actionItems;
|
|
1154
|
+
clearTimeout(this.autocloseTimeoutId);
|
|
1155
|
+
if (this.show) {
|
|
1156
|
+
this.close();
|
|
1157
|
+
setTimeout(() => this.show = true, 150);
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
this.show = true;
|
|
1161
|
+
}
|
|
1162
|
+
if (autoclose) {
|
|
1163
|
+
this.autocloseTimeoutId = setTimeout(() => this.close(), 3000);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
close() {
|
|
1167
|
+
this.show = false;
|
|
1168
|
+
}
|
|
1169
|
+
ngOnInit() {
|
|
1170
|
+
this.messageService.get('wui:snackbar')
|
|
1171
|
+
.pipe(takeUntil(this.unsub))
|
|
1172
|
+
.subscribe(data => {
|
|
1173
|
+
if (data.label === 'close') {
|
|
1174
|
+
this.close();
|
|
1175
|
+
}
|
|
1176
|
+
else {
|
|
1177
|
+
this.open(data.label, data.autoclose ?? true, data.actionItems);
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
ngOnDestroy() {
|
|
1182
|
+
this.unsub.next();
|
|
1183
|
+
this.unsub.complete();
|
|
1184
|
+
clearTimeout(this.autocloseTimeoutId);
|
|
1185
|
+
}
|
|
1186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SnackbarComponent, deps: [{ token: MessageService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1187
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SnackbarComponent, isStandalone: true, selector: "wui-snackbar", host: { properties: { "class.show": "this.show" } }, ngImport: i0, template: `{{ label }}`, isInline: true });
|
|
1188
|
+
}
|
|
1189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SnackbarComponent, decorators: [{
|
|
1190
|
+
type: Component,
|
|
1191
|
+
args: [{
|
|
1192
|
+
selector: 'wui-snackbar',
|
|
1193
|
+
standalone: true,
|
|
1194
|
+
template: `{{ label }}`
|
|
1195
|
+
}]
|
|
1196
|
+
}], ctorParameters: () => [{ type: MessageService }], propDecorators: { show: [{
|
|
1197
|
+
type: HostBinding,
|
|
1198
|
+
args: ['class.show']
|
|
1199
|
+
}] } });
|
|
1200
|
+
|
|
1201
|
+
class AppComponent {
|
|
1202
|
+
messageService = inject(MessageService);
|
|
1203
|
+
wuiModal = inject(WuiModal);
|
|
1204
|
+
elementRef = inject(ElementRef);
|
|
1205
|
+
renderer = inject(Renderer2);
|
|
1206
|
+
tooltip;
|
|
1207
|
+
unsub = new Subject();
|
|
1208
|
+
ngOnInit() {
|
|
1209
|
+
this.messageService.get('wui:tooltip').pipe(takeUntil(this.unsub)).subscribe(params => {
|
|
1210
|
+
this.tooltip.nativeElement.textContent = params.label;
|
|
1211
|
+
let rect = params.el.getBoundingClientRect();
|
|
1212
|
+
this.tooltip.nativeElement.style.top = (rect.y + rect.height + 16) + 'px';
|
|
1213
|
+
this.tooltip.nativeElement.style.left = (rect.x + (rect.width / 2)) + 'px';
|
|
1214
|
+
this.tooltip.nativeElement.classList.add('show');
|
|
1215
|
+
});
|
|
1216
|
+
this.messageService.get('wui:tooltip:hide').pipe(takeUntil(this.unsub)).subscribe(params => {
|
|
1217
|
+
this.tooltip.nativeElement.classList.remove('show');
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1220
|
+
ngOnDestroy() {
|
|
1221
|
+
this.unsub.next(null);
|
|
1222
|
+
}
|
|
1223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1224
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AppComponent, isStandalone: true, selector: "wui-app", viewQueries: [{ propertyName: "tooltip", first: true, predicate: ["tooltip"], descendants: true }], ngImport: i0, template: `
|
|
1225
|
+
<ng-content select="wui-drawer"></ng-content>
|
|
1226
|
+
<div class="wui-app-main" #appMain>
|
|
1227
|
+
<ng-content/>
|
|
1228
|
+
<wui-page-host/>
|
|
1229
|
+
</div>
|
|
1230
|
+
<wui-modal-host/>
|
|
1231
|
+
<wui-snackbar/>
|
|
1232
|
+
`, isInline: true, dependencies: [{ kind: "component", type: PageHostComponent, selector: "wui-page-host" }, { kind: "component", type: ModalHostComponent, selector: "wui-modal-host" }, { kind: "component", type: SnackbarComponent, selector: "wui-snackbar" }] });
|
|
1233
|
+
}
|
|
1234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppComponent, decorators: [{
|
|
1235
|
+
type: Component,
|
|
1236
|
+
args: [{
|
|
1237
|
+
selector: 'wui-app',
|
|
1238
|
+
standalone: true,
|
|
1239
|
+
imports: [PageHostComponent, ModalHostComponent, SnackbarComponent],
|
|
1240
|
+
template: `
|
|
1241
|
+
<ng-content select="wui-drawer"></ng-content>
|
|
1242
|
+
<div class="wui-app-main" #appMain>
|
|
1243
|
+
<ng-content/>
|
|
1244
|
+
<wui-page-host/>
|
|
1245
|
+
</div>
|
|
1246
|
+
<wui-modal-host/>
|
|
1247
|
+
<wui-snackbar/>
|
|
1248
|
+
`
|
|
1249
|
+
}]
|
|
1250
|
+
}], propDecorators: { tooltip: [{
|
|
1251
|
+
type: ViewChild,
|
|
1252
|
+
args: ['tooltip']
|
|
1253
|
+
}] } });
|
|
1254
|
+
|
|
1255
|
+
class WuiInputDirective {
|
|
1256
|
+
elementRef = inject(ElementRef);
|
|
1257
|
+
controlContainer = inject(ControlContainer, { optional: true, host: true, skipSelf: true });
|
|
1258
|
+
ngModel = inject(NgModel, { optional: true });
|
|
1259
|
+
valueChanges = signal('');
|
|
1260
|
+
set value(val) {
|
|
1261
|
+
this.valueChanges.set(val);
|
|
1262
|
+
}
|
|
1263
|
+
formControlName = input(undefined);
|
|
1264
|
+
unsub = new Subject();
|
|
1265
|
+
whenKeyup(event) {
|
|
1266
|
+
const value = event.target.value;
|
|
1267
|
+
this.valueChanges.set(value);
|
|
1268
|
+
}
|
|
1269
|
+
whenChange(event) {
|
|
1270
|
+
const value = event.target.value;
|
|
1271
|
+
this.valueChanges.set(value);
|
|
1272
|
+
}
|
|
1273
|
+
ngOnInit() {
|
|
1274
|
+
const name = this.formControlName();
|
|
1275
|
+
if (this.controlContainer && name) {
|
|
1276
|
+
const control = this.controlContainer.control?.get(name);
|
|
1277
|
+
control?.valueChanges.pipe(takeUntil(this.unsub)).subscribe(value => {
|
|
1278
|
+
this.valueChanges.set(value);
|
|
1279
|
+
});
|
|
1280
|
+
this.valueChanges.set(control?.value || '');
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
if (this.ngModel) {
|
|
1284
|
+
this.ngModel.valueChanges?.pipe(takeUntil(this.unsub)).subscribe(value => {
|
|
1285
|
+
this.valueChanges.set(value);
|
|
1286
|
+
});
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
// Fallback: initial native element value
|
|
1290
|
+
const nativeValue = this.elementRef.nativeElement.value;
|
|
1291
|
+
this.valueChanges.set(nativeValue || '');
|
|
1292
|
+
}
|
|
1293
|
+
ngOnDestroy() {
|
|
1294
|
+
this.unsub.next();
|
|
1295
|
+
this.unsub.complete();
|
|
1296
|
+
}
|
|
1297
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1298
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: WuiInputDirective, isStandalone: true, selector: "[wuiInput]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keyup": "whenKeyup($event)", "change": "whenChange($event)" } }, exportAs: ["wuiInput"], ngImport: i0 });
|
|
1299
|
+
}
|
|
1300
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WuiInputDirective, decorators: [{
|
|
1301
|
+
type: Directive,
|
|
1302
|
+
args: [{
|
|
1303
|
+
selector: '[wuiInput]',
|
|
1304
|
+
exportAs: 'wuiInput',
|
|
1305
|
+
standalone: true
|
|
1306
|
+
}]
|
|
1307
|
+
}], propDecorators: { value: [{
|
|
1308
|
+
type: Input
|
|
1309
|
+
}], whenKeyup: [{
|
|
1310
|
+
type: HostListener,
|
|
1311
|
+
args: ['keyup', ['$event']]
|
|
1312
|
+
}], whenChange: [{
|
|
1313
|
+
type: HostListener,
|
|
1314
|
+
args: ['change', ['$event']]
|
|
1315
|
+
}] } });
|
|
1316
|
+
|
|
1317
|
+
class FormFieldComponent {
|
|
1318
|
+
input;
|
|
1319
|
+
hasContent = false;
|
|
1320
|
+
unsub = new Subject();
|
|
1321
|
+
injector = inject(Injector);
|
|
1322
|
+
ngAfterContentInit() {
|
|
1323
|
+
if (this.input) {
|
|
1324
|
+
runInInjectionContext(this.injector, () => {
|
|
1325
|
+
effect(() => {
|
|
1326
|
+
const value = this.input.valueChanges();
|
|
1327
|
+
this.hasContent = !!value && value.toString().length > 0;
|
|
1328
|
+
});
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
ngOnDestroy() {
|
|
1333
|
+
this.unsub.next();
|
|
1334
|
+
this.unsub.complete();
|
|
1335
|
+
}
|
|
1336
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FormFieldComponent, isStandalone: true, selector: "wui-form-field", host: { properties: { "class.has-content": "this.hasContent" } }, queries: [{ propertyName: "input", first: true, predicate: WuiInputDirective, descendants: true }], ngImport: i0, template: `
|
|
1338
|
+
<div class="wui-form-field-flex">
|
|
1339
|
+
<ng-content select=".wui-form-field-prefix"></ng-content>
|
|
1340
|
+
<div class="wui-form-field-infix">
|
|
1341
|
+
<ng-content select=".wui-form-field-input-prefix"></ng-content>
|
|
1342
|
+
<ng-content></ng-content>
|
|
1343
|
+
<ng-content select=".wui-form-field-input-suffix"></ng-content>
|
|
1344
|
+
</div>
|
|
1345
|
+
<ng-content select=".wui-form-field-suffix"></ng-content>
|
|
1346
|
+
</div>
|
|
1347
|
+
<ng-content select=".wui-form-field-hint"></ng-content>
|
|
1348
|
+
`, isInline: true });
|
|
1349
|
+
}
|
|
1350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
1351
|
+
type: Component,
|
|
1352
|
+
args: [{
|
|
1353
|
+
selector: 'wui-form-field',
|
|
1354
|
+
standalone: true,
|
|
1355
|
+
template: `
|
|
1356
|
+
<div class="wui-form-field-flex">
|
|
1357
|
+
<ng-content select=".wui-form-field-prefix"></ng-content>
|
|
1358
|
+
<div class="wui-form-field-infix">
|
|
1359
|
+
<ng-content select=".wui-form-field-input-prefix"></ng-content>
|
|
1360
|
+
<ng-content></ng-content>
|
|
1361
|
+
<ng-content select=".wui-form-field-input-suffix"></ng-content>
|
|
1362
|
+
</div>
|
|
1363
|
+
<ng-content select=".wui-form-field-suffix"></ng-content>
|
|
1364
|
+
</div>
|
|
1365
|
+
<ng-content select=".wui-form-field-hint"></ng-content>
|
|
1366
|
+
`
|
|
1367
|
+
}]
|
|
1368
|
+
}], propDecorators: { input: [{
|
|
1369
|
+
type: ContentChild,
|
|
1370
|
+
args: [WuiInputDirective]
|
|
1371
|
+
}], hasContent: [{
|
|
1372
|
+
type: HostBinding,
|
|
1373
|
+
args: ['class.has-content']
|
|
1374
|
+
}] } });
|
|
1375
|
+
|
|
1376
|
+
class PageComponent {
|
|
1377
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1378
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PageComponent, isStandalone: true, selector: "wui-page", ngImport: i0, template: `
|
|
1379
|
+
<ng-content select="wui-app-bar"></ng-content>
|
|
1380
|
+
<ng-content select=".wui-page-inner"></ng-content>
|
|
1381
|
+
<ng-content select=".wui-page-footer"></ng-content>
|
|
1382
|
+
`, isInline: true });
|
|
1383
|
+
}
|
|
1384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PageComponent, decorators: [{
|
|
1385
|
+
type: Component,
|
|
1386
|
+
args: [{
|
|
1387
|
+
selector: 'wui-page',
|
|
1388
|
+
standalone: true,
|
|
1389
|
+
template: `
|
|
1390
|
+
<ng-content select="wui-app-bar"></ng-content>
|
|
1391
|
+
<ng-content select=".wui-page-inner"></ng-content>
|
|
1392
|
+
<ng-content select=".wui-page-footer"></ng-content>
|
|
1393
|
+
`
|
|
1394
|
+
}]
|
|
1395
|
+
}] });
|
|
1396
|
+
|
|
1397
|
+
class AvatarComponent {
|
|
1398
|
+
src = input('');
|
|
1399
|
+
size = input(40);
|
|
1400
|
+
width = '40px';
|
|
1401
|
+
height = '40px';
|
|
1402
|
+
constructor() {
|
|
1403
|
+
effect(() => {
|
|
1404
|
+
const px = this.size() + 'px';
|
|
1405
|
+
this.width = px;
|
|
1406
|
+
this.height = px;
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1410
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: AvatarComponent, isStandalone: true, selector: "wui-avatar", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.width": "this.width", "style.height": "this.height" } }, ngImport: i0, template: `<img *ngIf="src.length > 0" [src]="src()"/>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1411
|
+
}
|
|
1412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
1413
|
+
type: Component,
|
|
1414
|
+
args: [{
|
|
1415
|
+
selector: 'wui-avatar',
|
|
1416
|
+
standalone: true,
|
|
1417
|
+
imports: [CommonModule],
|
|
1418
|
+
template: `<img *ngIf="src.length > 0" [src]="src()"/>`
|
|
1419
|
+
}]
|
|
1420
|
+
}], ctorParameters: () => [], propDecorators: { width: [{
|
|
1421
|
+
type: HostBinding,
|
|
1422
|
+
args: ['style.width']
|
|
1423
|
+
}], height: [{
|
|
1424
|
+
type: HostBinding,
|
|
1425
|
+
args: ['style.height']
|
|
1426
|
+
}] } });
|
|
1427
|
+
|
|
1428
|
+
class DrawerComponent {
|
|
1429
|
+
_showInput = input(false, {
|
|
1430
|
+
transform: (value) => value != null && `${value}` !== 'false'
|
|
1431
|
+
});
|
|
1432
|
+
show = signal(this._showInput());
|
|
1433
|
+
isMobile = signal(this.isMobileDevice());
|
|
1434
|
+
avatar;
|
|
1435
|
+
messageService = inject(MessageService);
|
|
1436
|
+
unsub = new Subject();
|
|
1437
|
+
constructor() {
|
|
1438
|
+
effect(() => {
|
|
1439
|
+
this.isShow = this.show();
|
|
1440
|
+
}, { allowSignalWrites: true });
|
|
1441
|
+
}
|
|
1442
|
+
isShow = false;
|
|
1443
|
+
onClick(e) {
|
|
1444
|
+
const target = e.target;
|
|
1445
|
+
if (target.tagName !== 'WUI-DRAWER-ITEM' &&
|
|
1446
|
+
target.offsetParent?.tagName !== 'WUI-DRAWER-ITEM') {
|
|
1447
|
+
return;
|
|
1448
|
+
}
|
|
1449
|
+
this.drawerItemClicked();
|
|
1450
|
+
}
|
|
1451
|
+
isMobileDevice() {
|
|
1452
|
+
return /Android|webOS|iPhone|iPad|Mac|Macintosh|iPod|BlackBerry|IEMobile|Opera Mini/i
|
|
1453
|
+
.test(navigator.userAgent);
|
|
1454
|
+
}
|
|
1455
|
+
drawerItemClicked() {
|
|
1456
|
+
if (this.isMobile()) {
|
|
1457
|
+
this.show.set(false);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
ngAfterContentInit() {
|
|
1461
|
+
this.show.set(!this.isMobile());
|
|
1462
|
+
}
|
|
1463
|
+
ngOnInit() {
|
|
1464
|
+
this.messageService.get('wui:toggleDrawer')
|
|
1465
|
+
.pipe(takeUntil$1(this.unsub))
|
|
1466
|
+
.subscribe(() => {
|
|
1467
|
+
this.show.update(v => !v);
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
ngOnDestroy() {
|
|
1471
|
+
this.unsub.next();
|
|
1472
|
+
this.unsub.complete();
|
|
1473
|
+
}
|
|
1474
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1475
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DrawerComponent, isStandalone: true, selector: "wui-drawer", inputs: { _showInput: { classPropertyName: "_showInput", publicName: "_showInput", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.show": "this.isShow" } }, queries: [{ propertyName: "avatar", first: true, predicate: AvatarComponent, descendants: true }], ngImport: i0, template: `
|
|
1476
|
+
@if (show()) {
|
|
1477
|
+
<div class="wui-drawer-backdrop" (click)="show.set(false)"></div>
|
|
1478
|
+
}
|
|
1479
|
+
<ng-content></ng-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
1480
|
+
}
|
|
1481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
1482
|
+
type: Component,
|
|
1483
|
+
args: [{
|
|
1484
|
+
selector: 'wui-drawer',
|
|
1485
|
+
standalone: true,
|
|
1486
|
+
imports: [CommonModule],
|
|
1487
|
+
template: `
|
|
1488
|
+
@if (show()) {
|
|
1489
|
+
<div class="wui-drawer-backdrop" (click)="show.set(false)"></div>
|
|
1490
|
+
}
|
|
1491
|
+
<ng-content></ng-content>`,
|
|
1492
|
+
}]
|
|
1493
|
+
}], ctorParameters: () => [], propDecorators: { avatar: [{
|
|
1494
|
+
type: ContentChild,
|
|
1495
|
+
args: [AvatarComponent]
|
|
1496
|
+
}], isShow: [{
|
|
1497
|
+
type: HostBinding,
|
|
1498
|
+
args: ['class.show']
|
|
1499
|
+
}], onClick: [{
|
|
1500
|
+
type: HostListener,
|
|
1501
|
+
args: ['click', ['$event']]
|
|
1502
|
+
}] } });
|
|
1503
|
+
|
|
1504
|
+
class IconComponent {
|
|
1505
|
+
icon = input('');
|
|
1506
|
+
get hostClass() {
|
|
1507
|
+
return this.icon() ? `mdi mdi-${this.icon()}` : 'mdi';
|
|
1508
|
+
}
|
|
1509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1510
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: IconComponent, isStandalone: true, selector: "wui-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: ``, isInline: true });
|
|
1511
|
+
}
|
|
1512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IconComponent, decorators: [{
|
|
1513
|
+
type: Component,
|
|
1514
|
+
args: [{
|
|
1515
|
+
selector: 'wui-icon',
|
|
1516
|
+
standalone: true,
|
|
1517
|
+
template: ``,
|
|
1518
|
+
}]
|
|
1519
|
+
}], propDecorators: { hostClass: [{
|
|
1520
|
+
type: HostBinding,
|
|
1521
|
+
args: ['class']
|
|
1522
|
+
}] } });
|
|
1523
|
+
|
|
1524
|
+
class DrawerItemComponent {
|
|
1525
|
+
messageService = inject(MessageService);
|
|
1526
|
+
icon = input('');
|
|
1527
|
+
onClick() {
|
|
1528
|
+
this.messageService.set('wui:showDrawer', false);
|
|
1529
|
+
}
|
|
1530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DrawerItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1531
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: DrawerItemComponent, isStandalone: true, selector: "wui-drawer-item", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()" } }, ngImport: i0, template: `
|
|
1532
|
+
@if (icon()) {
|
|
1533
|
+
<wui-icon [icon]="icon()"></wui-icon>
|
|
1534
|
+
}
|
|
1535
|
+
<div class="content">
|
|
1536
|
+
<ng-content></ng-content>
|
|
1537
|
+
</div>
|
|
1538
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "wui-icon", inputs: ["icon"] }, { kind: "ngmodule", type: CommonModule }] });
|
|
1539
|
+
}
|
|
1540
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DrawerItemComponent, decorators: [{
|
|
1541
|
+
type: Component,
|
|
1542
|
+
args: [{
|
|
1543
|
+
selector: 'wui-drawer-item',
|
|
1544
|
+
standalone: true,
|
|
1545
|
+
imports: [IconComponent, CommonModule],
|
|
1546
|
+
template: `
|
|
1547
|
+
@if (icon()) {
|
|
1548
|
+
<wui-icon [icon]="icon()"></wui-icon>
|
|
1549
|
+
}
|
|
1550
|
+
<div class="content">
|
|
1551
|
+
<ng-content></ng-content>
|
|
1552
|
+
</div>
|
|
1553
|
+
`
|
|
1554
|
+
}]
|
|
1555
|
+
}], propDecorators: { onClick: [{
|
|
1556
|
+
type: HostListener,
|
|
1557
|
+
args: ['click']
|
|
1558
|
+
}] } });
|
|
1559
|
+
|
|
1560
|
+
class DrawerTogglerDirective {
|
|
1561
|
+
messageService = inject(MessageService);
|
|
1562
|
+
onClick() {
|
|
1563
|
+
this.messageService.set('wui:toggleDrawer', null);
|
|
1564
|
+
}
|
|
1565
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DrawerTogglerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1566
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DrawerTogglerDirective, isStandalone: true, selector: "[wuiToggleDrawer]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1567
|
+
}
|
|
1568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DrawerTogglerDirective, decorators: [{
|
|
1569
|
+
type: Directive,
|
|
1570
|
+
args: [{
|
|
1571
|
+
selector: '[wuiToggleDrawer]',
|
|
1572
|
+
standalone: true,
|
|
1573
|
+
}]
|
|
1574
|
+
}], propDecorators: { onClick: [{
|
|
1575
|
+
type: HostListener,
|
|
1576
|
+
args: ['click']
|
|
1577
|
+
}] } });
|
|
1578
|
+
|
|
1579
|
+
class AppBarComponent {
|
|
1580
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1581
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AppBarComponent, isStandalone: true, selector: "wui-app-bar", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
1582
|
+
}
|
|
1583
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AppBarComponent, decorators: [{
|
|
1584
|
+
type: Component,
|
|
1585
|
+
args: [{
|
|
1586
|
+
standalone: true,
|
|
1587
|
+
imports: [],
|
|
1588
|
+
selector: 'wui-app-bar',
|
|
1589
|
+
template: `<ng-content></ng-content>`
|
|
1590
|
+
}]
|
|
1591
|
+
}] });
|
|
1592
|
+
|
|
1593
|
+
class ListTileComponent {
|
|
1594
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ListTileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1595
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ListTileComponent, isStandalone: true, selector: "wui-list-tile", ngImport: i0, template: `
|
|
1596
|
+
<ng-content></ng-content>
|
|
1597
|
+
`, isInline: true });
|
|
1598
|
+
}
|
|
1599
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ListTileComponent, decorators: [{
|
|
1600
|
+
type: Component,
|
|
1601
|
+
args: [{
|
|
1602
|
+
selector: 'wui-list-tile',
|
|
1603
|
+
standalone: true,
|
|
1604
|
+
template: `
|
|
1605
|
+
<ng-content></ng-content>
|
|
1606
|
+
`
|
|
1607
|
+
}]
|
|
1608
|
+
}] });
|
|
1609
|
+
class ListComponent {
|
|
1610
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1611
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ListComponent, isStandalone: true, selector: "wui-list", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
1612
|
+
}
|
|
1613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ListComponent, decorators: [{
|
|
1614
|
+
type: Component,
|
|
1615
|
+
args: [{
|
|
1616
|
+
selector: 'wui-list',
|
|
1617
|
+
standalone: true,
|
|
1618
|
+
template: `<ng-content></ng-content>`
|
|
1619
|
+
}]
|
|
1620
|
+
}] });
|
|
1621
|
+
|
|
1622
|
+
class MenuDirective {
|
|
1623
|
+
el = inject(ElementRef);
|
|
1624
|
+
menu;
|
|
1625
|
+
onClick() {
|
|
1626
|
+
this.menu?.open(this.el.nativeElement);
|
|
1627
|
+
}
|
|
1628
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1629
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: MenuDirective, isStandalone: true, selector: "[wuiMenu]", inputs: { menu: ["wuiMenu", "menu"] }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
1630
|
+
}
|
|
1631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuDirective, decorators: [{
|
|
1632
|
+
type: Directive,
|
|
1633
|
+
args: [{
|
|
1634
|
+
selector: '[wuiMenu]',
|
|
1635
|
+
standalone: true
|
|
1636
|
+
}]
|
|
1637
|
+
}], propDecorators: { menu: [{
|
|
1638
|
+
type: Input,
|
|
1639
|
+
args: ['wuiMenu']
|
|
1640
|
+
}], onClick: [{
|
|
1641
|
+
type: HostListener,
|
|
1642
|
+
args: ['click']
|
|
1643
|
+
}] } });
|
|
1644
|
+
class MenuItemComponent {
|
|
1645
|
+
icon = '';
|
|
1646
|
+
host = inject(MenuComponent, { optional: true, host: true, skipSelf: true });
|
|
1647
|
+
onClick(e) {
|
|
1648
|
+
this.host?.close();
|
|
1649
|
+
}
|
|
1650
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1651
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MenuItemComponent, isStandalone: true, selector: "wui-menu-item", inputs: { icon: "icon" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0, template: `
|
|
1652
|
+
<div class="wui-menu-item-leading">
|
|
1653
|
+
<wui-icon [icon]="icon"></wui-icon>
|
|
1654
|
+
</div>
|
|
1655
|
+
<div class="wui-menu-item-content"><ng-content></ng-content></div>
|
|
1656
|
+
`, isInline: true, dependencies: [{ kind: "component", type: IconComponent, selector: "wui-icon", inputs: ["icon"] }] });
|
|
1657
|
+
}
|
|
1658
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
1659
|
+
type: Component,
|
|
1660
|
+
args: [{
|
|
1661
|
+
selector: 'wui-menu-item',
|
|
1662
|
+
standalone: true,
|
|
1663
|
+
imports: [IconComponent],
|
|
1664
|
+
template: `
|
|
1665
|
+
<div class="wui-menu-item-leading">
|
|
1666
|
+
<wui-icon [icon]="icon"></wui-icon>
|
|
1667
|
+
</div>
|
|
1668
|
+
<div class="wui-menu-item-content"><ng-content></ng-content></div>
|
|
1669
|
+
`
|
|
1670
|
+
}]
|
|
1671
|
+
}], propDecorators: { icon: [{
|
|
1672
|
+
type: Input
|
|
1673
|
+
}], onClick: [{
|
|
1674
|
+
type: HostListener,
|
|
1675
|
+
args: ['click', ['$event']]
|
|
1676
|
+
}] } });
|
|
1677
|
+
class MenuComponent {
|
|
1678
|
+
el = inject(ElementRef);
|
|
1679
|
+
renderer = inject(Renderer2);
|
|
1680
|
+
_show = signal(false);
|
|
1681
|
+
listenDocumentClick = false;
|
|
1682
|
+
get showClass() {
|
|
1683
|
+
return this._show();
|
|
1684
|
+
}
|
|
1685
|
+
onWindowClick(e) {
|
|
1686
|
+
if (this.listenDocumentClick && this._show() && !this.el.nativeElement.contains(e.target)) {
|
|
1687
|
+
this.close();
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
open(triggerElement) {
|
|
1691
|
+
this.close();
|
|
1692
|
+
setTimeout(() => {
|
|
1693
|
+
const rect = triggerElement.getBoundingClientRect();
|
|
1694
|
+
const el = this.el.nativeElement;
|
|
1695
|
+
const menuWidth = el.offsetWidth;
|
|
1696
|
+
const menuHeight = el.offsetHeight;
|
|
1697
|
+
const windowWidth = window.innerWidth;
|
|
1698
|
+
const windowHeight = window.innerHeight;
|
|
1699
|
+
const possibleLeft = rect.x;
|
|
1700
|
+
if (windowWidth - possibleLeft < menuWidth) {
|
|
1701
|
+
const possibleRight = windowWidth - (rect.x + rect.width);
|
|
1702
|
+
this.renderer.setStyle(el, 'right', `${possibleRight}px`);
|
|
1703
|
+
}
|
|
1704
|
+
else {
|
|
1705
|
+
this.renderer.setStyle(el, 'left', `${possibleLeft}px`);
|
|
1706
|
+
}
|
|
1707
|
+
if (windowHeight < menuHeight) {
|
|
1708
|
+
this.renderer.setStyle(el, 'top', '1rem');
|
|
1709
|
+
this.renderer.setStyle(el, 'bottom', '1rem');
|
|
1710
|
+
}
|
|
1711
|
+
else {
|
|
1712
|
+
const possibleTop = rect.y;
|
|
1713
|
+
if (windowHeight - possibleTop > menuHeight) {
|
|
1714
|
+
this.renderer.setStyle(el, 'top', `${possibleTop}px`);
|
|
1715
|
+
}
|
|
1716
|
+
else {
|
|
1717
|
+
const possibleBottom = windowHeight - (rect.y + rect.height);
|
|
1718
|
+
this.renderer.setStyle(el, 'bottom', `${possibleBottom}px`);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
this.listenDocumentClick = true;
|
|
1722
|
+
this._show.set(true);
|
|
1723
|
+
}, 200);
|
|
1724
|
+
}
|
|
1725
|
+
close() {
|
|
1726
|
+
this._show.set(false);
|
|
1727
|
+
this.listenDocumentClick = false;
|
|
1728
|
+
const el = this.el.nativeElement;
|
|
1729
|
+
this.renderer.removeStyle(el, 'top');
|
|
1730
|
+
this.renderer.removeStyle(el, 'right');
|
|
1731
|
+
this.renderer.removeStyle(el, 'bottom');
|
|
1732
|
+
this.renderer.removeStyle(el, 'left');
|
|
1733
|
+
}
|
|
1734
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1735
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: MenuComponent, isStandalone: true, selector: "wui-menu", host: { listeners: { "document:click": "onWindowClick($event)" }, properties: { "class.show": "this.showClass" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
1736
|
+
}
|
|
1737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MenuComponent, decorators: [{
|
|
1738
|
+
type: Component,
|
|
1739
|
+
args: [{
|
|
1740
|
+
selector: 'wui-menu',
|
|
1741
|
+
standalone: true,
|
|
1742
|
+
template: `<ng-content></ng-content>`
|
|
1743
|
+
}]
|
|
1744
|
+
}], propDecorators: { showClass: [{
|
|
1745
|
+
type: HostBinding,
|
|
1746
|
+
args: ['class.show']
|
|
1747
|
+
}], onWindowClick: [{
|
|
1748
|
+
type: HostListener,
|
|
1749
|
+
args: ['document:click', ['$event']]
|
|
1750
|
+
}] } });
|
|
1751
|
+
|
|
1752
|
+
class ToggleComponent {
|
|
1753
|
+
// Input signals
|
|
1754
|
+
tabindex = input(0);
|
|
1755
|
+
// Output signals
|
|
1756
|
+
change = output();
|
|
1757
|
+
// State signals
|
|
1758
|
+
checked = model(false);
|
|
1759
|
+
disabled = signal(false);
|
|
1760
|
+
isTouched = signal(false);
|
|
1761
|
+
// ControlValueAccessor callbacks
|
|
1762
|
+
onChange = () => { };
|
|
1763
|
+
onTouched = () => { };
|
|
1764
|
+
constructor() {
|
|
1765
|
+
// Auto-update form control value
|
|
1766
|
+
effect(() => {
|
|
1767
|
+
this.onChange(this.checked());
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
onKeyDown(e) {
|
|
1771
|
+
if (e.key === ' ') {
|
|
1772
|
+
e.preventDefault();
|
|
1773
|
+
this.toggle();
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
toggle() {
|
|
1777
|
+
if (!this.disabled()) {
|
|
1778
|
+
this.markAsTouched();
|
|
1779
|
+
this.checked.update(value => !value);
|
|
1780
|
+
this.change.emit(this.checked());
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
// ControlValueAccessor implementation
|
|
1784
|
+
writeValue(value) {
|
|
1785
|
+
this.checked.set(!!value);
|
|
1786
|
+
}
|
|
1787
|
+
registerOnChange(fn) {
|
|
1788
|
+
this.onChange = fn;
|
|
1789
|
+
}
|
|
1790
|
+
registerOnTouched(fn) {
|
|
1791
|
+
this.onTouched = fn;
|
|
1792
|
+
}
|
|
1793
|
+
setDisabledState(isDisabled) {
|
|
1794
|
+
this.disabled.set(isDisabled);
|
|
1795
|
+
}
|
|
1796
|
+
markAsTouched() {
|
|
1797
|
+
if (!this.isTouched()) {
|
|
1798
|
+
this.onTouched();
|
|
1799
|
+
this.isTouched.set(true);
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1803
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.13", type: ToggleComponent, isStandalone: true, selector: "wui-toggle", inputs: { tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change", checked: "checkedChange" }, host: { listeners: { "click": "toggle()", "keydown": "onKeyDown($event)" }, properties: { "attr.tabindex": "tabindex()", "class.wui-toggle-checked": "checked()", "attr.disabled": "disabled() ? \"\" : null" } }, providers: [
|
|
1804
|
+
{
|
|
1805
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1806
|
+
multi: true,
|
|
1807
|
+
useExisting: ToggleComponent
|
|
1808
|
+
}
|
|
1809
|
+
], ngImport: i0, template: "<div class=\"wui-toggle-switch-outer\">\n <div class=\"wui-toggle-switch-track\">\n <div class=\"wui-toggle-switch\"></div>\n </div>\n</div>\n<div><ng-content class=\"wui-toggle-label\"></ng-content></div>", styles: [""] });
|
|
1810
|
+
}
|
|
1811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
1812
|
+
type: Component,
|
|
1813
|
+
args: [{ selector: 'wui-toggle', standalone: true, providers: [
|
|
1814
|
+
{
|
|
1815
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1816
|
+
multi: true,
|
|
1817
|
+
useExisting: ToggleComponent
|
|
1818
|
+
}
|
|
1819
|
+
], host: {
|
|
1820
|
+
'[attr.tabindex]': 'tabindex()',
|
|
1821
|
+
'[class.wui-toggle-checked]': 'checked()',
|
|
1822
|
+
'[attr.disabled]': 'disabled() ? "" : null',
|
|
1823
|
+
'(click)': 'toggle()',
|
|
1824
|
+
'(keydown)': 'onKeyDown($event)'
|
|
1825
|
+
}, template: "<div class=\"wui-toggle-switch-outer\">\n <div class=\"wui-toggle-switch-track\">\n <div class=\"wui-toggle-switch\"></div>\n </div>\n</div>\n<div><ng-content class=\"wui-toggle-label\"></ng-content></div>" }]
|
|
1826
|
+
}], ctorParameters: () => [] });
|
|
1827
|
+
|
|
1828
|
+
/*
|
|
1829
|
+
* Public API Surface of wui
|
|
1830
|
+
*/
|
|
1831
|
+
|
|
1832
|
+
/*
|
|
1833
|
+
* Public API Surface of wui-single
|
|
1834
|
+
*/
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* Generated bundle index. Do not edit.
|
|
1838
|
+
*/
|
|
1839
|
+
|
|
1840
|
+
export { AppBarComponent, AppComponent, ContextMenuDirective, ContextMenuItemDirective, ContextMenuTriggerDirective, DialogComponent, DrawerComponent, DrawerItemComponent, DrawerTogglerDirective, FormFieldComponent, IconComponent, ListComponent, ListTileComponent, LoadingComponent, MenuComponent, MenuDirective, MenuItemComponent, MessageService, ModalComponent, ModalService, NavComponent, NavPopDirective, NavPushDirective, NavRootDirective, NavService, NumInputDirective, PageComponent, PageHeaderDirective, PageService, RippleDirective, RouterService, ScrollEndDirective, SnackbarComponent, SortableDirective, ToggleComponent, WuiInputDirective, WuiService, WuiSingleComponent, provideWui };
|
|
1841
|
+
//# sourceMappingURL=kusena-wui-single.mjs.map
|