@nettyapps/ntyux 21.0.0 → 21.0.2

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, NgModule, inject, Injectable, input, output, ViewContainerRef, ViewChild, Input, ViewEncapsulation, signal, effect, computed, forwardRef, ChangeDetectionStrategy, ElementRef, model } from '@angular/core';
2
+ import { Component, NgModule, inject, Injectable, input, output, ViewContainerRef, ViewChild, Input, ViewEncapsulation, signal, effect, computed, forwardRef, ChangeDetectionStrategy, model, viewChild, ElementRef } from '@angular/core';
3
3
  import * as i1$1 from '@angular/material/form-field';
4
4
  import { MatFormFieldModule } from '@angular/material/form-field';
5
5
  import * as i2$1 from '@angular/material/autocomplete';
@@ -11,7 +11,7 @@ import * as i4 from '@angular/material/input';
11
11
  import { MatInputModule } from '@angular/material/input';
12
12
  import * as i2 from '@angular/material/icon';
13
13
  import { MatIconModule } from '@angular/material/icon';
14
- import { UiBase, NettyUISearchInput } from '@nettyapps/ntyui';
14
+ import { UiBase, NettyUINumberInput, NettyUISearchInput } from '@nettyapps/ntyui';
15
15
  import { HttpClient } from '@angular/common/http';
16
16
  import { EnvironmentProxy } from '@nettyapps/ntycontract';
17
17
  import { MAT_DIALOG_DATA, MatDialog, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
@@ -601,6 +601,120 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
601
601
  args: ['autoCompleteInput']
602
602
  }] } });
603
603
 
604
+ class NettyFilter {
605
+ value;
606
+ text;
607
+ }
608
+
609
+ class NtyAutoCompleteFilterFields {
610
+ fieldName = null;
611
+ fieldValue = null;
612
+ numeric = false;
613
+ equalitySign = '=';
614
+ }
615
+
616
+ class ValueUnitInput extends UiBase {
617
+ name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
618
+ // Number input
619
+ min = input(null, ...(ngDevMode ? [{ debugName: "min" }] : []));
620
+ max = input(null, ...(ngDevMode ? [{ debugName: "max" }] : []));
621
+ step = input(1, ...(ngDevMode ? [{ debugName: "step" }] : []));
622
+ precision = input(2, ...(ngDevMode ? [{ debugName: "precision" }] : []));
623
+ // AutoComplete
624
+ tableName = input('', ...(ngDevMode ? [{ debugName: "tableName" }] : []));
625
+ searchAfter = input(3, ...(ngDevMode ? [{ debugName: "searchAfter" }] : []));
626
+ fieldCode = input(null, ...(ngDevMode ? [{ debugName: "fieldCode" }] : []));
627
+ fieldName = input(null, ...(ngDevMode ? [{ debugName: "fieldName" }] : []));
628
+ lookupComponent = input(null, ...(ngDevMode ? [{ debugName: "lookupComponent" }] : []));
629
+ lookupComponentPath = input(null, ...(ngDevMode ? [{ debugName: "lookupComponentPath" }] : []));
630
+ filterField = input(null, ...(ngDevMode ? [{ debugName: "filterField" }] : []));
631
+ filterFieldValue = input(null, ...(ngDevMode ? [{ debugName: "filterFieldValue" }] : []));
632
+ filterFieldNumeric = input(false, ...(ngDevMode ? [{ debugName: "filterFieldNumeric" }] : []));
633
+ filterFieldEquality = input('=', ...(ngDevMode ? [{ debugName: "filterFieldEquality" }] : []));
634
+ debounceTime = input(500, ...(ngDevMode ? [{ debugName: "debounceTime" }] : []));
635
+ value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
636
+ quantityModel = viewChild('quantityModel', ...(ngDevMode ? [{ debugName: "quantityModel" }] : []));
637
+ unitModel = viewChild('unitModel', ...(ngDevMode ? [{ debugName: "unitModel" }] : []));
638
+ internalValue = {
639
+ quantity: null,
640
+ unit: null,
641
+ };
642
+ constructor() {
643
+ super();
644
+ effect(() => {
645
+ const currentValue = this.value();
646
+ if (currentValue !== null && currentValue !== this.internalValue) {
647
+ this.updateInternalValue(currentValue);
648
+ }
649
+ });
650
+ }
651
+ updateInternalValue(value) {
652
+ if (value && typeof value === 'object') {
653
+ this.internalValue = {
654
+ quantity: value.quantity || null,
655
+ unit: value.unit || null,
656
+ };
657
+ }
658
+ else {
659
+ this.internalValue = { quantity: null, unit: null };
660
+ }
661
+ }
662
+ // Quantity changed
663
+ onQuantityChange(quantity) {
664
+ this.internalValue.quantity = quantity;
665
+ this.updateValue();
666
+ this.onTouched();
667
+ }
668
+ // Unit changed
669
+ onUnitChange(unit) {
670
+ this.internalValue.unit = unit;
671
+ this.updateValue();
672
+ this.onTouched();
673
+ }
674
+ updateValue() {
675
+ const newValue = {
676
+ quantity: this.internalValue.quantity,
677
+ unit: this.internalValue.unit,
678
+ };
679
+ this.value.set(newValue);
680
+ this.onChange(newValue);
681
+ }
682
+ writeValue(value) {
683
+ if (value) {
684
+ this.updateInternalValue(value);
685
+ this.value.set(value);
686
+ }
687
+ else {
688
+ this.internalValue = { quantity: null, unit: null };
689
+ this.value.set(null);
690
+ }
691
+ }
692
+ clearAll() {
693
+ this.internalValue = { quantity: null, unit: null };
694
+ this.value.set(null);
695
+ this.onChange(null);
696
+ this.onTouched();
697
+ }
698
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ValueUnitInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
699
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.3", type: ValueUnitInput, isStandalone: true, selector: "lib-value-unit-input", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, precision: { classPropertyName: "precision", publicName: "precision", isSignal: true, isRequired: false, transformFunction: null }, tableName: { classPropertyName: "tableName", publicName: "tableName", isSignal: true, isRequired: false, transformFunction: null }, searchAfter: { classPropertyName: "searchAfter", publicName: "searchAfter", isSignal: true, isRequired: false, transformFunction: null }, fieldCode: { classPropertyName: "fieldCode", publicName: "fieldCode", isSignal: true, isRequired: false, transformFunction: null }, fieldName: { classPropertyName: "fieldName", publicName: "fieldName", isSignal: true, isRequired: false, transformFunction: null }, lookupComponent: { classPropertyName: "lookupComponent", publicName: "lookupComponent", isSignal: true, isRequired: false, transformFunction: null }, lookupComponentPath: { classPropertyName: "lookupComponentPath", publicName: "lookupComponentPath", isSignal: true, isRequired: false, transformFunction: null }, filterField: { classPropertyName: "filterField", publicName: "filterField", isSignal: true, isRequired: false, transformFunction: null }, filterFieldValue: { classPropertyName: "filterFieldValue", publicName: "filterFieldValue", isSignal: true, isRequired: false, transformFunction: null }, filterFieldNumeric: { classPropertyName: "filterFieldNumeric", publicName: "filterFieldNumeric", isSignal: true, isRequired: false, transformFunction: null }, filterFieldEquality: { classPropertyName: "filterFieldEquality", publicName: "filterFieldEquality", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
700
+ {
701
+ provide: NG_VALUE_ACCESSOR,
702
+ useExisting: forwardRef(() => ValueUnitInput),
703
+ multi: true,
704
+ },
705
+ ], viewQueries: [{ propertyName: "quantityModel", first: true, predicate: ["quantityModel"], descendants: true, isSignal: true }, { propertyName: "unitModel", first: true, predicate: ["unitModel"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"value-unit-container\">\n <!-- Number Input -->\n <ntyui-number-input\n #quantityModel=\"ngModel\"\n [label]=\"label()\"\n [appearance]=\"appearance()\"\n [name]=\"name() + '_quantity'\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onQuantityChange($event)\"\n class=\"quantity-input\"\n >\n </ntyui-number-input>\n\n <!-- AutoComplete for Unit -->\n <ntybase-auto-complete\n #unitModel=\"ngModel\"\n [label]=\"'Birim'\"\n [appearance]=\"appearance()\"\n [name]=\"name() + '_unit'\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n [tableName]=\"tableName()\"\n [searchAfter]=\"searchAfter()\"\n [fieldCode]=\"fieldCode()\"\n [fieldName]=\"fieldName()\"\n [lookupComponent]=\"lookupComponent()\"\n [lookupComponentPath]=\"lookupComponentPath()\"\n [filterField]=\"filterField()\"\n [filterFieldValue]=\"filterFieldValue()\"\n [filterFieldNumeric]=\"filterFieldNumeric()\"\n [filterFieldEquality]=\"filterFieldEquality()\"\n [debounceTime]=\"debounceTime()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onUnitChange($event)\"\n class=\"unit-input\"\n >\n </ntybase-auto-complete>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: NettyUINumberInput, selector: "ntyui-number-input" }, { kind: "component", type: AutoComplete, selector: "ntybase-auto-complete", inputs: ["tableName", "searchAfter", "fieldCode", "fieldName", "lookupComponent", "lookupComponentPath", "filterField", "filterFieldValue", "filterFieldNumeric", "filterFieldEquality", "debounceTime"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
706
+ }
707
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: ValueUnitInput, decorators: [{
708
+ type: Component,
709
+ args: [{ selector: 'lib-value-unit-input', imports: [NettyUINumberInput, AutoComplete, FormsModule], providers: [
710
+ {
711
+ provide: NG_VALUE_ACCESSOR,
712
+ useExisting: forwardRef(() => ValueUnitInput),
713
+ multi: true,
714
+ },
715
+ ], template: "<div class=\"value-unit-container\">\n <!-- Number Input -->\n <ntyui-number-input\n #quantityModel=\"ngModel\"\n [label]=\"label()\"\n [appearance]=\"appearance()\"\n [name]=\"name() + '_quantity'\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onQuantityChange($event)\"\n class=\"quantity-input\"\n >\n </ntyui-number-input>\n\n <!-- AutoComplete for Unit -->\n <ntybase-auto-complete\n #unitModel=\"ngModel\"\n [label]=\"'Birim'\"\n [appearance]=\"appearance()\"\n [name]=\"name() + '_unit'\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n [tableName]=\"tableName()\"\n [searchAfter]=\"searchAfter()\"\n [fieldCode]=\"fieldCode()\"\n [fieldName]=\"fieldName()\"\n [lookupComponent]=\"lookupComponent()\"\n [lookupComponentPath]=\"lookupComponentPath()\"\n [filterField]=\"filterField()\"\n [filterFieldValue]=\"filterFieldValue()\"\n [filterFieldNumeric]=\"filterFieldNumeric()\"\n [filterFieldEquality]=\"filterFieldEquality()\"\n [debounceTime]=\"debounceTime()\"\n [(ngModel)]=\"value\"\n (ngModelChange)=\"onUnitChange($event)\"\n class=\"unit-input\"\n >\n </ntybase-auto-complete>\n</div>\n" }]
716
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], precision: [{ type: i0.Input, args: [{ isSignal: true, alias: "precision", required: false }] }], tableName: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableName", required: false }] }], searchAfter: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchAfter", required: false }] }], fieldCode: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldCode", required: false }] }], fieldName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldName", required: false }] }], lookupComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookupComponent", required: false }] }], lookupComponentPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookupComponentPath", required: false }] }], filterField: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterField", required: false }] }], filterFieldValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterFieldValue", required: false }] }], filterFieldNumeric: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterFieldNumeric", required: false }] }], filterFieldEquality: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterFieldEquality", required: false }] }], debounceTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceTime", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], quantityModel: [{ type: i0.ViewChild, args: ['quantityModel', { isSignal: true }] }], unitModel: [{ type: i0.ViewChild, args: ['unitModel', { isSignal: true }] }] } });
717
+
604
718
  class HttpError403 {
605
719
  attemptedUrl = '';
606
720
  routeSubscription;
@@ -1079,5 +1193,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
1079
1193
  * Generated bundle index. Do not edit.
1080
1194
  */
1081
1195
 
1082
- export { AutoComplete, ColorPalette, HttpError403, HttpError404, LeftSidenav, Ntyux, NtyuxModule, SelectionItem, Theme, Toolbar };
1196
+ export { AutoComplete, ColorPalette, Guid, HttpError403, HttpError404, LeftSidenav, NettyFilter, NtyAutoCompleteFilter, NtyAutoCompleteFilterFields, Ntyux, NtyuxModule, SelectionItem, Theme, Toolbar, ValueUnitInput };
1083
1197
  //# sourceMappingURL=nettyapps-ntyux.mjs.map