osl-base-extended 2.0.27 → 2.0.29
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Inject, inject, Injector, Injectable, InjectionToken, PLATFORM_ID, Input, Optional, Directive, EventEmitter, Output, HostListener, ViewChild, NgModule, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { Component, Inject, inject, Injector, Injectable, InjectionToken, PLATFORM_ID, Input, Optional, Directive, EventEmitter, Output, HostListener, ViewChild, NgModule, ChangeDetectorRef, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/material/dialog';
|
|
4
4
|
import { MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
5
5
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
@@ -29,6 +29,9 @@ import { MatMenuModule } from '@angular/material/menu';
|
|
|
29
29
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
30
30
|
import * as i3$1 from '@angular/cdk/drag-drop';
|
|
31
31
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
32
|
+
import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
|
|
33
|
+
import * as i1$3 from '@angular/cdk/overlay';
|
|
34
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
32
35
|
|
|
33
36
|
class OslBaseExtended {
|
|
34
37
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OslBaseExtended, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -2479,6 +2482,7 @@ class OslDatetimepicker {
|
|
|
2479
2482
|
},
|
|
2480
2483
|
display: {
|
|
2481
2484
|
dateInput: 'DD-MMM-YYYY hh:mm a',
|
|
2485
|
+
monthYearLabel: 'MMM YYYY', dateA11yLabel: 'LL', monthYearA11yLabel: 'MMMM YYYY',
|
|
2482
2486
|
}
|
|
2483
2487
|
}
|
|
2484
2488
|
}
|
|
@@ -2495,6 +2499,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
2495
2499
|
},
|
|
2496
2500
|
display: {
|
|
2497
2501
|
dateInput: 'DD-MMM-YYYY hh:mm a',
|
|
2502
|
+
monthYearLabel: 'MMM YYYY', dateA11yLabel: 'LL', monthYearA11yLabel: 'MMMM YYYY',
|
|
2498
2503
|
}
|
|
2499
2504
|
}
|
|
2500
2505
|
}
|
|
@@ -5202,6 +5207,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5202
5207
|
args: ['document:click', ['$event']]
|
|
5203
5208
|
}] } });
|
|
5204
5209
|
|
|
5210
|
+
class OslMenu {
|
|
5211
|
+
position = 'auto';
|
|
5212
|
+
templateRef;
|
|
5213
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OslMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5214
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: OslMenu, isStandalone: false, selector: "osl-menu", inputs: { position: "position" }, host: { styleAttribute: "display: none" }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["panel"], descendants: true, static: true }], ngImport: i0, template: "<ng-template #panel>\n <div class=\"osl-menu-panel\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".osl-menu-panel{min-width:180px;background:#fff;border:1px solid #eaecf0;border-radius:12px;box-shadow:0 12px 32px #10182824,0 4px 12px #1018280f;overflow:hidden;animation:osl-menu-in .16s cubic-bezier(.16,1,.3,1)}@keyframes osl-menu-in{0%{opacity:0;transform:translateY(-8px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}.osl-menu-label{padding:10px 14px 7px;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#9ca3af;border-bottom:1px solid #f2f4f7;-webkit-user-select:none;user-select:none}.osl-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;background:transparent;border:none;border-left:3px solid transparent;border-bottom:1px solid #f9fafb;text-align:left;font-size:13px;font-weight:500;font-family:inherit;color:#374151;cursor:pointer;white-space:nowrap;transition:background .12s,color .12s,border-left-color .12s}.osl-menu-item:last-child{border-bottom:none}.osl-menu-item:hover{background:var(--osl-menu-accent-bg, #f5f3ff);color:var(--osl-menu-accent, var(--osl-primary, #6366f1));border-left-color:var(--osl-menu-accent, var(--osl-primary, #6366f1))}.osl-menu-item:disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.osl-menu-divider{height:1px;background:#f2f4f7;margin:4px 0;border:none}.osl-menu-backdrop{background:transparent}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
5215
|
+
}
|
|
5216
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OslMenu, decorators: [{
|
|
5217
|
+
type: Component,
|
|
5218
|
+
args: [{ selector: 'osl-menu', standalone: false, encapsulation: ViewEncapsulation.None, host: { style: 'display: none' }, template: "<ng-template #panel>\n <div class=\"osl-menu-panel\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".osl-menu-panel{min-width:180px;background:#fff;border:1px solid #eaecf0;border-radius:12px;box-shadow:0 12px 32px #10182824,0 4px 12px #1018280f;overflow:hidden;animation:osl-menu-in .16s cubic-bezier(.16,1,.3,1)}@keyframes osl-menu-in{0%{opacity:0;transform:translateY(-8px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}.osl-menu-label{padding:10px 14px 7px;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#9ca3af;border-bottom:1px solid #f2f4f7;-webkit-user-select:none;user-select:none}.osl-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:10px 14px;background:transparent;border:none;border-left:3px solid transparent;border-bottom:1px solid #f9fafb;text-align:left;font-size:13px;font-weight:500;font-family:inherit;color:#374151;cursor:pointer;white-space:nowrap;transition:background .12s,color .12s,border-left-color .12s}.osl-menu-item:last-child{border-bottom:none}.osl-menu-item:hover{background:var(--osl-menu-accent-bg, #f5f3ff);color:var(--osl-menu-accent, var(--osl-primary, #6366f1));border-left-color:var(--osl-menu-accent, var(--osl-primary, #6366f1))}.osl-menu-item:disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.osl-menu-divider{height:1px;background:#f2f4f7;margin:4px 0;border:none}.osl-menu-backdrop{background:transparent}\n"] }]
|
|
5219
|
+
}], propDecorators: { position: [{
|
|
5220
|
+
type: Input
|
|
5221
|
+
}], templateRef: [{
|
|
5222
|
+
type: ViewChild,
|
|
5223
|
+
args: ['panel', { static: true }]
|
|
5224
|
+
}] } });
|
|
5225
|
+
class OslMenuTriggerFor {
|
|
5226
|
+
_el;
|
|
5227
|
+
_overlay;
|
|
5228
|
+
_vcr;
|
|
5229
|
+
menu;
|
|
5230
|
+
_ref = null;
|
|
5231
|
+
_subs = [];
|
|
5232
|
+
constructor(_el, _overlay, _vcr) {
|
|
5233
|
+
this._el = _el;
|
|
5234
|
+
this._overlay = _overlay;
|
|
5235
|
+
this._vcr = _vcr;
|
|
5236
|
+
}
|
|
5237
|
+
_onClick(event) {
|
|
5238
|
+
event.stopPropagation();
|
|
5239
|
+
this._ref ? this._close() : this._open();
|
|
5240
|
+
}
|
|
5241
|
+
_open() {
|
|
5242
|
+
if (!this.menu)
|
|
5243
|
+
return;
|
|
5244
|
+
this._ref = this._overlay.create({
|
|
5245
|
+
positionStrategy: this._overlay
|
|
5246
|
+
.position()
|
|
5247
|
+
.flexibleConnectedTo(this._el)
|
|
5248
|
+
.withPositions(this._positions())
|
|
5249
|
+
.withFlexibleDimensions(false)
|
|
5250
|
+
.withPush(true),
|
|
5251
|
+
scrollStrategy: this._overlay.scrollStrategies.close(),
|
|
5252
|
+
hasBackdrop: true,
|
|
5253
|
+
backdropClass: 'osl-menu-backdrop',
|
|
5254
|
+
});
|
|
5255
|
+
this._ref.attach(new TemplatePortal(this.menu.templateRef, this._vcr));
|
|
5256
|
+
this._subs = [
|
|
5257
|
+
this._ref.backdropClick().subscribe(() => this._close()),
|
|
5258
|
+
this._ref.keydownEvents().subscribe(e => { if (e.key === 'Escape')
|
|
5259
|
+
this._close(); }),
|
|
5260
|
+
];
|
|
5261
|
+
this._ref.overlayElement.addEventListener('click', () => this._close());
|
|
5262
|
+
}
|
|
5263
|
+
_close() {
|
|
5264
|
+
this._subs.forEach(s => s.unsubscribe());
|
|
5265
|
+
this._subs = [];
|
|
5266
|
+
const ref = this._ref;
|
|
5267
|
+
this._ref = null;
|
|
5268
|
+
ref?.dispose();
|
|
5269
|
+
}
|
|
5270
|
+
ngOnDestroy() {
|
|
5271
|
+
this._close();
|
|
5272
|
+
}
|
|
5273
|
+
_positions() {
|
|
5274
|
+
const pos = this.menu?.position ?? 'auto';
|
|
5275
|
+
const below = { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 };
|
|
5276
|
+
const above = { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 };
|
|
5277
|
+
const belowE = { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 };
|
|
5278
|
+
const aboveE = { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 };
|
|
5279
|
+
const after = { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 4 };
|
|
5280
|
+
const before = { originX: 'start', originY: 'top', overlayX: 'end', overlayY: 'top', offsetX: -4 };
|
|
5281
|
+
switch (pos) {
|
|
5282
|
+
case 'below': return [below, above];
|
|
5283
|
+
case 'above': return [above, below];
|
|
5284
|
+
case 'after': return [after, before];
|
|
5285
|
+
case 'before': return [before, after];
|
|
5286
|
+
default: return [below, belowE, above, aboveE];
|
|
5287
|
+
}
|
|
5288
|
+
}
|
|
5289
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OslMenuTriggerFor, deps: [{ token: i0.ElementRef }, { token: i1$3.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
5290
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: OslMenuTriggerFor, isStandalone: false, selector: "[oslMenuTriggerFor]", inputs: { menu: ["oslMenuTriggerFor", "menu"] }, host: { listeners: { "click": "_onClick($event)" } }, ngImport: i0 });
|
|
5291
|
+
}
|
|
5292
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: OslMenuTriggerFor, decorators: [{
|
|
5293
|
+
type: Directive,
|
|
5294
|
+
args: [{
|
|
5295
|
+
selector: '[oslMenuTriggerFor]',
|
|
5296
|
+
standalone: false,
|
|
5297
|
+
}]
|
|
5298
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$3.Overlay }, { type: i0.ViewContainerRef }], propDecorators: { menu: [{
|
|
5299
|
+
type: Input,
|
|
5300
|
+
args: ['oslMenuTriggerFor']
|
|
5301
|
+
}], _onClick: [{
|
|
5302
|
+
type: HostListener,
|
|
5303
|
+
args: ['click', ['$event']]
|
|
5304
|
+
}] } });
|
|
5305
|
+
|
|
5205
5306
|
class FormStructureModule {
|
|
5206
5307
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormStructureModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
5207
5308
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: FormStructureModule, declarations: [DynamicForm,
|
|
@@ -5223,7 +5324,9 @@ class FormStructureModule {
|
|
|
5223
5324
|
OslAutocompleteLister,
|
|
5224
5325
|
OslReportGrid,
|
|
5225
5326
|
OslReportForm,
|
|
5226
|
-
OslUserLog
|
|
5327
|
+
OslUserLog,
|
|
5328
|
+
OslMenu,
|
|
5329
|
+
OslMenuTriggerFor], imports: [NgTemplateOutlet,
|
|
5227
5330
|
NgStyle,
|
|
5228
5331
|
NgClass,
|
|
5229
5332
|
DatePipe,
|
|
@@ -5243,6 +5346,8 @@ class FormStructureModule {
|
|
|
5243
5346
|
ScrollingModule,
|
|
5244
5347
|
DragDropModule,
|
|
5245
5348
|
MatTooltipModule,
|
|
5349
|
+
OverlayModule,
|
|
5350
|
+
PortalModule,
|
|
5246
5351
|
NgxMatDatetimepicker,
|
|
5247
5352
|
NgxMatDatepickerInput], exports: [DynamicForm, OslSetup, OslGrid, OslFormGrid, Oslinput, OslUserLog,
|
|
5248
5353
|
Osltextarea,
|
|
@@ -5256,7 +5361,8 @@ class FormStructureModule {
|
|
|
5256
5361
|
OslCheckbox,
|
|
5257
5362
|
OslButton,
|
|
5258
5363
|
OslSetup,
|
|
5259
|
-
OslSearchbar, OslAutocompleteLister, OslReportGrid, OslReportForm
|
|
5364
|
+
OslSearchbar, OslAutocompleteLister, OslReportGrid, OslReportForm,
|
|
5365
|
+
OslMenu, OslMenuTriggerFor] });
|
|
5260
5366
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormStructureModule, providers: [
|
|
5261
5367
|
{ provide: AUTOCOMPLETE_LISTER_COMPONENT, useValue: OslAutocompleteLister },
|
|
5262
5368
|
], imports: [FormsModule,
|
|
@@ -5272,6 +5378,8 @@ class FormStructureModule {
|
|
|
5272
5378
|
ScrollingModule,
|
|
5273
5379
|
DragDropModule,
|
|
5274
5380
|
MatTooltipModule,
|
|
5381
|
+
OverlayModule,
|
|
5382
|
+
PortalModule,
|
|
5275
5383
|
NgxMatDatetimepicker] });
|
|
5276
5384
|
}
|
|
5277
5385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormStructureModule, decorators: [{
|
|
@@ -5298,6 +5406,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5298
5406
|
OslReportGrid,
|
|
5299
5407
|
OslReportForm,
|
|
5300
5408
|
OslUserLog,
|
|
5409
|
+
OslMenu,
|
|
5410
|
+
OslMenuTriggerFor,
|
|
5301
5411
|
],
|
|
5302
5412
|
imports: [
|
|
5303
5413
|
NgTemplateOutlet,
|
|
@@ -5320,6 +5430,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5320
5430
|
ScrollingModule,
|
|
5321
5431
|
DragDropModule,
|
|
5322
5432
|
MatTooltipModule,
|
|
5433
|
+
OverlayModule,
|
|
5434
|
+
PortalModule,
|
|
5323
5435
|
NgxMatDatetimepicker,
|
|
5324
5436
|
NgxMatDatepickerInput,
|
|
5325
5437
|
],
|
|
@@ -5335,7 +5447,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
5335
5447
|
OslCheckbox,
|
|
5336
5448
|
OslButton,
|
|
5337
5449
|
OslSetup,
|
|
5338
|
-
OslSearchbar, OslAutocompleteLister, OslReportGrid, OslReportForm
|
|
5450
|
+
OslSearchbar, OslAutocompleteLister, OslReportGrid, OslReportForm,
|
|
5451
|
+
OslMenu, OslMenuTriggerFor],
|
|
5339
5452
|
providers: [
|
|
5340
5453
|
{ provide: AUTOCOMPLETE_LISTER_COMPONENT, useValue: OslAutocompleteLister },
|
|
5341
5454
|
],
|
|
@@ -6600,5 +6713,5 @@ var validation_util = /*#__PURE__*/Object.freeze({
|
|
|
6600
6713
|
* Generated bundle index. Do not edit.
|
|
6601
6714
|
*/
|
|
6602
6715
|
|
|
6603
|
-
export { array_util as ArrayUtil, date_util as DateUtil, DeleteConfirmation, DeleteConfirmationData, Dialog, DialogWrapper, DynamicForm, FormStructureModule, Httpbase, number_util as NumberUtil, object_util as ObjectUtil, OslAutocomplete, OslAutocompleteLister, OslBaseExtended, OslButton, OslCheckbox, OslDatepicker, OslDatetimepicker, OslFileUpload, OslFormGrid, OslGrid, OslRadio, OslReportForm, OslReportGrid, OslSearchbar, OslSelect, OslSetup, OslSkeletonDirective, OslSkeletonModule, OslSkeletonThemeService, OslSlideToggle, OslUserLog, Oslinput, Osltextarea, storage_util as StorageUtil, string_util as StringUtil, validation_util as ValidationUtil, baseComponent };
|
|
6716
|
+
export { array_util as ArrayUtil, date_util as DateUtil, DeleteConfirmation, DeleteConfirmationData, Dialog, DialogWrapper, DynamicForm, FormStructureModule, Httpbase, number_util as NumberUtil, object_util as ObjectUtil, OslAutocomplete, OslAutocompleteLister, OslBaseExtended, OslButton, OslCheckbox, OslDatepicker, OslDatetimepicker, OslFileUpload, OslFormGrid, OslGrid, OslMenu, OslMenuTriggerFor, OslRadio, OslReportForm, OslReportGrid, OslSearchbar, OslSelect, OslSetup, OslSkeletonDirective, OslSkeletonModule, OslSkeletonThemeService, OslSlideToggle, OslUserLog, Oslinput, Osltextarea, storage_util as StorageUtil, string_util as StringUtil, validation_util as ValidationUtil, baseComponent };
|
|
6604
6717
|
//# sourceMappingURL=osl-base-extended.mjs.map
|