@anglr/select 17.1.0 → 17.2.0-beta.20260804075102
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/changelog.md +16 -0
- package/es2022/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.js +15 -3
- package/es2022/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.js.map +1 -1
- package/es2022/src/directives/selectFormControl/selectFormControl.directive.js +15 -3
- package/es2022/src/directives/selectFormControl/selectFormControl.directive.js.map +1 -1
- package/es2022/src/directives/withDirectAccess/withDirectAccess.directive.js +16 -3
- package/es2022/src/directives/withDirectAccess/withDirectAccess.directive.js.map +1 -1
- package/es2022/src/interfaces/index.js +1 -0
- package/es2022/src/interfaces/index.js.map +1 -1
- package/es2022/src/interfaces/plugins/valueHandler/valueHandler.interface.js.map +1 -1
- package/es2022/src/interfaces/tempValue/tempValue.interface.js +2 -0
- package/es2022/src/interfaces/tempValue/tempValue.interface.js.map +1 -0
- package/es2022/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.js +2 -2
- package/es2022/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.js.map +1 -1
- package/package.json +1 -1
- package/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.d.ts +5 -0
- package/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.d.ts.map +1 -1
- package/src/directives/selectFormControl/selectFormControl.directive.d.ts +5 -0
- package/src/directives/selectFormControl/selectFormControl.directive.d.ts.map +1 -1
- package/src/directives/withDirectAccess/withDirectAccess.directive.d.ts +5 -0
- package/src/directives/withDirectAccess/withDirectAccess.directive.d.ts.map +1 -1
- package/src/interfaces/index.d.ts +1 -0
- package/src/interfaces/index.d.ts.map +1 -1
- package/src/interfaces/plugins/valueHandler/valueHandler.interface.d.ts +2 -1
- package/src/interfaces/plugins/valueHandler/valueHandler.interface.d.ts.map +1 -1
- package/src/interfaces/tempValue/tempValue.interface.d.ts +10 -0
- package/src/interfaces/tempValue/tempValue.interface.d.ts.map +1 -0
- package/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.d.ts +1 -1
- package/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.d.ts.map +1 -1
- package/version.bak +1 -1
package/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Version 17.2.0 (2026-08-04)
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
- fixed `SelectControlValueAccessor`, `SelectFormControl` and `WithDirectAccess` directives
|
|
8
|
+
- value now correctly reflects changes during *asynchronous* `setValue`, previously it could momentarily revert to previous value
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
- new `TempValue` interface, that is used for storing temporary value during async write
|
|
13
|
+
- **properties**
|
|
14
|
+
- `value` stored value
|
|
15
|
+
- updated `ValueHandler` interface
|
|
16
|
+
- **methods**
|
|
17
|
+
- `setValue` sets value for Select, now returns `PromiseOr<void>`, allowing asynchronous value writes
|
|
18
|
+
|
|
3
19
|
## Version 17.1.0 (2026-07-22)
|
|
4
20
|
|
|
5
21
|
### Features
|
package/es2022/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { forwardRef, Directive, signal, effect, untracked } from '@angular/core';
|
|
2
2
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
+
import { nameof } from '@jscrpt/common';
|
|
3
4
|
import { isEqual } from 'lodash-es';
|
|
4
5
|
import { Subscription } from 'rxjs';
|
|
5
6
|
import { SelectPluginType } from '../../misc/enums';
|
|
@@ -25,6 +26,10 @@ export class SelectControlValueAccessor {
|
|
|
25
26
|
* Subscriptions created during initialization
|
|
26
27
|
*/
|
|
27
28
|
this.initSubscriptions = new Subscription();
|
|
29
|
+
/**
|
|
30
|
+
* Temporary value used for storing value during async write
|
|
31
|
+
*/
|
|
32
|
+
this.tmpValue = {};
|
|
28
33
|
/**
|
|
29
34
|
* Last set value to this control
|
|
30
35
|
*/
|
|
@@ -35,14 +40,17 @@ export class SelectControlValueAccessor {
|
|
|
35
40
|
*/
|
|
36
41
|
this.disabled = signal(false, /* @ts-ignore */
|
|
37
42
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
43
|
+
//setting value
|
|
38
44
|
effect(() => {
|
|
39
45
|
if (!select.initialized()) {
|
|
40
46
|
return;
|
|
41
47
|
}
|
|
42
48
|
const value = this.value();
|
|
43
|
-
untracked(() => {
|
|
49
|
+
untracked(async () => {
|
|
44
50
|
if (!isEqual(value, select.getPlugin(SelectPluginType.ValueHandler).value())) {
|
|
45
|
-
|
|
51
|
+
this.tmpValue.value = value;
|
|
52
|
+
await select.getPlugin(SelectPluginType.ValueHandler).setValue(value);
|
|
53
|
+
delete this.tmpValue.value;
|
|
46
54
|
}
|
|
47
55
|
});
|
|
48
56
|
});
|
|
@@ -52,11 +60,15 @@ export class SelectControlValueAccessor {
|
|
|
52
60
|
}
|
|
53
61
|
select.selectOptions.readonly = this.disabled();
|
|
54
62
|
});
|
|
63
|
+
//getting value
|
|
55
64
|
effect(() => {
|
|
56
65
|
if (!select.initialized()) {
|
|
57
66
|
return;
|
|
58
67
|
}
|
|
59
|
-
|
|
68
|
+
let value = select.getPlugin(SelectPluginType.ValueHandler).value();
|
|
69
|
+
if (nameof('value') in this.tmpValue) {
|
|
70
|
+
value = this.tmpValue.value;
|
|
71
|
+
}
|
|
60
72
|
untracked(() => {
|
|
61
73
|
if (!isEqual(value, this.value())) {
|
|
62
74
|
this.value.set(value);
|
package/es2022/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoB,SAAS,EAA6B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"selectControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAoB,SAAS,EAA6B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAC,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAU,MAAM,EAAa,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;AAGhE;;GAEG;AACH,MAAM,qBAAqB,GAC3B;IACI,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;IACzD,KAAK,EAAE,IAAI;CACd,CAAC;AAEF;;GAEG;AAMH,MAAM,OAAO,0BAA0B;IAkCnC,iEAAiE;IACjE,YAAY,MAAoC;QAjChD,sEAAsE;QAEtE;;WAEG;QACO,sBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;QAE/D;;WAEG;QACO,aAAQ,GAA2C,EAAE,CAAC;QAEhE;;WAEG;QACO,UAAK,GAA+D,MAAM,CAAC,SAAS;kFAAC,CAAC;QAEhG;;WAEG;QACO,aAAQ,GAA4B,MAAM,CAAC,KAAK;qFAAC,CAAC;QAexD,eAAe;QACf,MAAM,CAAC,GAAG,EAAE;YAER,IAAG,CA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ACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;oBACtB,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;gBAC3B,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;IACxF,CAAC;IAED,6GAA6G;IAE7G;;OAEG;IACI,UAAU,CAAC,KAAiD;QAE/D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,EAA8D;QAElF,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,EAAc;QAEnC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,UAAmB;QAEvC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;8GA1IQ,0BAA0B;kGAA1B,0BAA0B,mHAFxB,CAAC,qBAAqB,CAAC;;2FAEzB,0BAA0B;kBALtC,SAAS;mBACV;oBACI,QAAQ,EAAE,sEAAsE;oBAChF,SAAS,EAAE,CAAC,qBAAqB,CAAC;iBACrC","sourcesContent":["import {forwardRef, ExistingProvider, Directive, OnDestroy, WritableSignal, signal, effect, untracked} from '@angular/core';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\nimport {Action1, nameof, NoopAction} from '@jscrpt/common';\nimport {isEqual} from 'lodash-es';\nimport {Subscription} from 'rxjs';\n\nimport {SelectPluginType} from '../../misc/enums';\nimport {Select} from '../../components/select/select.component';\nimport {TempValue} from '../../interfaces';\n\n/**\n * Provider for control value accessor\n */\nconst SELECT_VALUE_ACCESSOR: ExistingProvider =\n{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SelectControlValueAccessor),\n multi: true,\n};\n\n/**\n * Control value accessor for Select\n */\n@Directive(\n{\n selector: 'ng-select[formControlName],ng-select[formControl],ng-select[ngModel]',\n providers: [SELECT_VALUE_ACCESSOR],\n})\nexport class SelectControlValueAccessor<TValue = unknown, TPublicValue = TValue> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Temporary value used for storing value during async write\n */\n protected tmpValue: TempValue<TPublicValue|TPublicValue[]> = {};\n\n /**\n * Last set value to this control\n */\n protected value: WritableSignal<TPublicValue|TPublicValue[]|undefined|null> = signal(undefined);\n\n /**\n * Indication whether disable Select\n */\n protected disabled: WritableSignal<boolean> = signal(false);\n\n /**\n * On change callback for setting value back to control\n */\n protected onChange: Action1<TPublicValue|TPublicValue[]|undefined|null>|undefined|null;\n\n /**\n * On touched callback for setting touched back to control\n */\n protected onTouched: NoopAction|undefined|null;\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>)\n {\n //setting value\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = this.value();\n\n untracked(async () =>\n {\n if(!isEqual(value, select.getPlugin(SelectPluginType.ValueHandler).value()))\n {\n this.tmpValue.value = value;\n await select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n delete this.tmpValue.value;\n }\n });\n });\n\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n select.selectOptions.readonly = this.disabled();\n });\n\n //getting value\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n let value = select.getPlugin(SelectPluginType.ValueHandler).value();\n\n if(nameof<TempValue<TPublicValue|TPublicValue[]>>('value') in this.tmpValue)\n {\n value = this.tmpValue.value;\n }\n\n untracked(() =>\n {\n if(!isEqual(value, this.value()))\n {\n this.value.set(value);\n this.onChange?.(value);\n }\n });\n });\n\n this.initSubscriptions.add(select.events.focus.subscribe(() => this.onTouched?.()));\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: TPublicValue|TPublicValue[]|undefined|null): void\n {\n this.value.set(value);\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: TPublicValue|TPublicValue[]|undefined|null) => void): void\n {\n this.onChange = fn;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.onTouched = fn;\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.disabled.set(isDisabled);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy()\n {\n this.initSubscriptions.unsubscribe();\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Directive, effect, inject, input, model, untracked } from '@angular/core';
|
|
2
2
|
import { LOGGER } from '@anglr/common';
|
|
3
|
+
import { nameof } from '@jscrpt/common';
|
|
3
4
|
import { isEqual } from 'lodash-es';
|
|
4
5
|
import { Subscription } from 'rxjs';
|
|
5
6
|
import { Select } from '../../components/select/select.component';
|
|
@@ -22,6 +23,10 @@ export class SelectFormControl {
|
|
|
22
23
|
* Subscriptions created during initialization
|
|
23
24
|
*/
|
|
24
25
|
this.initSubscriptions = new Subscription();
|
|
26
|
+
/**
|
|
27
|
+
* Temporary value used for storing value during async write
|
|
28
|
+
*/
|
|
29
|
+
this.tmpValue = {};
|
|
25
30
|
//######################### public properties - implementation of FormValueControl #########################
|
|
26
31
|
/**
|
|
27
32
|
* @inheritdoc
|
|
@@ -45,25 +50,32 @@ export class SelectFormControl {
|
|
|
45
50
|
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
46
51
|
this.initSubscriptions.add(this.select.events.focus.subscribe(() => this.touched.set(true)));
|
|
47
52
|
effect(() => this.select.selectOptions.readonly = this.disabled() || this.readonly());
|
|
53
|
+
//setting value
|
|
48
54
|
effect(() => {
|
|
49
55
|
if (!this.select.initialized()) {
|
|
50
56
|
return;
|
|
51
57
|
}
|
|
52
58
|
const value = this.value();
|
|
53
59
|
this.logger.verbose('Select: Form control: control value changed "{{@(4)value}}"', { value });
|
|
54
|
-
untracked(() => {
|
|
60
|
+
untracked(async () => {
|
|
55
61
|
if (!isEqual(this.select.getPlugin(SelectPluginType.ValueHandler).value(), value)) {
|
|
62
|
+
this.tmpValue.value = value;
|
|
56
63
|
this.logger.verbose('Select: Form control: setting select value "{{@(4)value}}"', { value });
|
|
57
|
-
this.select.getPlugin(SelectPluginType.ValueHandler).setValue(value);
|
|
64
|
+
await this.select.getPlugin(SelectPluginType.ValueHandler).setValue(value);
|
|
65
|
+
delete this.tmpValue.value;
|
|
58
66
|
}
|
|
59
67
|
});
|
|
60
68
|
});
|
|
69
|
+
//getting value
|
|
61
70
|
effect(() => {
|
|
62
71
|
if (!this.select.initialized()) {
|
|
63
72
|
return;
|
|
64
73
|
}
|
|
65
|
-
|
|
74
|
+
let value = this.select.getPlugin(SelectPluginType.ValueHandler).value();
|
|
66
75
|
this.logger.verbose('Select: Form control: select value changed "{{@(4)value}}"', { value });
|
|
76
|
+
if (nameof('value') in this.tmpValue) {
|
|
77
|
+
value = this.tmpValue.value;
|
|
78
|
+
}
|
|
67
79
|
untracked(() => {
|
|
68
80
|
if (!isEqual(this.value(), value)) {
|
|
69
81
|
this.logger.verbose('Select: Form control: setting control value "{{@(4)value}}"', { value });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectFormControl.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectFormControl/selectFormControl.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAe,KAAK,EAA0B,SAAS,EAAC,MAAM,eAAe,CAAC;AAEtH,OAAO,EAAC,MAAM,EAAS,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;AAChE,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"selectFormControl.directive.js","sourceRoot":"","sources":["../../../../src/directives/selectFormControl/selectFormControl.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAe,KAAK,EAA0B,SAAS,EAAC,MAAM,eAAe,CAAC;AAEtH,OAAO,EAAC,MAAM,EAAS,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;AAChE,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;;;AAGlD;;GAEG;AAKH,MAAM,OAAO,iBAAiB;IA8C1B,iEAAiE;IACjE,YAAsB,MAAoC;QAApC,WAAM,GAAN,MAAM,CAA8B;QA7C1D,sEAAsE;QAEtE;;WAEG;QACO,WAAM,GAAW,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1C;;WAEG;QACO,sBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;QAE/D;;WAEG;QACO,aAAQ,GAA2C,EAAE,CAAC;QAEhE,4GAA4G;QAE5G;;WAEG;QACa,UAAK,GAA4D,KAAK,CAA6C,SAAS;kF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BACI,QAAQ,EAAE,sBAAsB;iBACnC","sourcesContent":["import {Directive, effect, inject, input, InputSignal, model, ModelSignal, OnDestroy, untracked} from '@angular/core';\nimport {FormValueControl} from '@angular/forms/signals';\nimport {LOGGER, Logger} from '@anglr/common';\nimport {nameof} from '@jscrpt/common';\nimport {isEqual} from 'lodash-es';\nimport {Subscription} from 'rxjs';\n\nimport {Select} from '../../components/select/select.component';\nimport {SelectPluginType} from '../../misc/enums';\nimport {TempValue} from '../../interfaces';\n\n/**\n * Form value control for Select\n */\n@Directive(\n{\n selector: 'ng-select[formField]',\n})\nexport class SelectFormControl<TValue = unknown, TPublicValue = TValue> implements FormValueControl<TPublicValue|TPublicValue[]|undefined|null>, OnDestroy\n{\n //######################### protected fields #########################\n\n /**\n * Instance of logger for logging purposes\n */\n protected logger: Logger = inject(LOGGER);\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Temporary value used for storing value during async write\n */\n protected tmpValue: TempValue<TPublicValue|TPublicValue[]> = {};\n\n //######################### public properties - implementation of FormValueControl #########################\n\n /**\n * @inheritdoc\n */\n public readonly value: ModelSignal<TPublicValue|TPublicValue[]|null|undefined> = model<TPublicValue|TPublicValue[]|null|undefined>(undefined);\n\n /**\n * @inheritdoc\n */\n public checked: undefined;\n\n /**\n * @inheritdoc\n */\n public readonly disabled: InputSignal<boolean> = input(false);\n\n /**\n * @inheritdoc\n */\n public readonly readonly: InputSignal<boolean> = input(false);\n\n /**\n * @inheritdoc\n */\n public readonly touched: ModelSignal<boolean> = model(false);\n\n //######################### constructor #########################\n constructor(protected select: Select<TValue, TPublicValue>)\n {\n this.initSubscriptions.add(this.select.events.focus.subscribe(() => this.touched.set(true)));\n\n effect(() => this.select.selectOptions.readonly = this.disabled() || this.readonly());\n\n //setting value\n effect(() =>\n {\n if(!this.select.initialized())\n {\n return;\n }\n\n const value = this.value();\n this.logger.verbose('Select: Form control: control value changed \"{{@(4)value}}\"', {value});\n\n untracked(async () =>\n {\n if(!isEqual(this.select.getPlugin(SelectPluginType.ValueHandler).value(), value))\n {\n this.tmpValue.value = value;\n this.logger.verbose('Select: Form control: setting select value \"{{@(4)value}}\"', {value});\n await this.select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n delete this.tmpValue.value;\n }\n });\n });\n\n //getting value\n effect(() =>\n {\n if(!this.select.initialized())\n {\n return;\n }\n\n let value = this.select.getPlugin(SelectPluginType.ValueHandler).value();\n this.logger.verbose('Select: Form control: select value changed \"{{@(4)value}}\"', {value});\n\n if(nameof<TempValue<TPublicValue|TPublicValue[]>>('value') in this.tmpValue)\n {\n value = this.tmpValue.value;\n }\n\n untracked(() =>\n {\n if(!isEqual(this.value(), value))\n {\n this.logger.verbose('Select: Form control: setting control value \"{{@(4)value}}\"', {value});\n this.value.set(value);\n }\n });\n });\n }\n\n //######################### public methods - implementation of FormValueControl #########################\n\n /**\n * @inheritdoc\n */\n public focus(): void\n {\n this.select.events.setFocus();\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n\n /**\n * @inheritdoc\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Directive, effect, model, untracked } from '@angular/core';
|
|
2
|
+
import { nameof } from '@jscrpt/common';
|
|
2
3
|
import { isEqual } from 'lodash-es';
|
|
3
4
|
import { SelectPluginType } from '../../misc/enums';
|
|
4
5
|
import { Select } from '../../components/select/select.component';
|
|
@@ -10,28 +11,40 @@ import * as i1 from "../../components/select/select.component";
|
|
|
10
11
|
export class WithDirectAccess {
|
|
11
12
|
//######################### constructor #########################
|
|
12
13
|
constructor(select) {
|
|
14
|
+
//######################### protected fields #########################
|
|
15
|
+
/**
|
|
16
|
+
* Temporary value used for storing value during async write
|
|
17
|
+
*/
|
|
18
|
+
this.tmpValue = {};
|
|
13
19
|
//######################### public properties - inputs/outputs #########################
|
|
14
20
|
/**
|
|
15
21
|
* Value of the Select to be set
|
|
16
22
|
*/
|
|
17
23
|
this.value = model(undefined, /* @ts-ignore */
|
|
18
24
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
25
|
+
//setting value
|
|
19
26
|
effect(() => {
|
|
20
27
|
if (!select.initialized()) {
|
|
21
28
|
return;
|
|
22
29
|
}
|
|
23
30
|
const value = this.value();
|
|
24
|
-
untracked(() => {
|
|
31
|
+
untracked(async () => {
|
|
25
32
|
if (!isEqual(select.getPlugin(SelectPluginType.ValueHandler).value(), value)) {
|
|
26
|
-
|
|
33
|
+
this.tmpValue.value = value;
|
|
34
|
+
await select.getPlugin(SelectPluginType.ValueHandler).setValue(value);
|
|
35
|
+
delete this.tmpValue.value;
|
|
27
36
|
}
|
|
28
37
|
});
|
|
29
38
|
});
|
|
39
|
+
//getting value
|
|
30
40
|
effect(() => {
|
|
31
41
|
if (!select.initialized()) {
|
|
32
42
|
return;
|
|
33
43
|
}
|
|
34
|
-
|
|
44
|
+
let value = select.getPlugin(SelectPluginType.ValueHandler).value();
|
|
45
|
+
if (nameof('value') in this.tmpValue) {
|
|
46
|
+
value = this.tmpValue.value;
|
|
47
|
+
}
|
|
35
48
|
untracked(() => {
|
|
36
49
|
if (!isEqual(this.value(), value)) {
|
|
37
50
|
this.value.set(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withDirectAccess.directive.js","sourceRoot":"","sources":["../../../../src/directives/withDirectAccess/withDirectAccess.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAe,SAAS,EAAC,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;;;
|
|
1
|
+
{"version":3,"file":"withDirectAccess.directive.js","sourceRoot":"","sources":["../../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AC,WAAW,EAAE,EACxB,CAAC;gBACG,OAAO;YACX,CAAC;YAED,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC;YAEpE,IAAG,MAAM,CAAyC,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,EAC3E,CAAC;gBACG,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAChC,CAAC;YAED,SAAS,CAAC,GAAG,EAAE;gBAEX,IAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,EAChC,CAAC;oBACG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;8GA/DQ,gBAAgB;kGAAhB,gBAAgB;;2FAAhB,gBAAgB;kBAJ5B,SAAS;mBACV;oBACI,QAAQ,EAAE,6BAA6B;iBAC1C","sourcesContent":["import {Directive, effect, model, ModelSignal, untracked} from '@angular/core';\nimport {nameof} from '@jscrpt/common';\nimport {isEqual} from 'lodash-es';\n\nimport {SelectPluginType} from '../../misc/enums';\nimport {Select} from '../../components/select/select.component';\nimport {TempValue} from '../../interfaces';\n\n/**\n * Directive that allows direct access to select properties using inputs, outputs\n */\n@Directive(\n{\n selector: 'ng-select[withDirectAccess]',\n})\nexport class WithDirectAccess<TValue = unknown, TPublicValue = TValue>\n{\n //######################### protected fields #########################\n\n /**\n * Temporary value used for storing value during async write\n */\n protected tmpValue: TempValue<TPublicValue|TPublicValue[]> = {};\n\n //######################### public properties - inputs/outputs #########################\n\n /**\n * Value of the Select to be set\n */\n public value: ModelSignal<TPublicValue|TPublicValue[]|undefined|null> = model<TPublicValue|TPublicValue[]|undefined|null>(undefined);\n\n //######################### constructor #########################\n constructor(select: Select<TValue, TPublicValue>,)\n {\n //setting value\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n const value = this.value();\n\n untracked(async () =>\n {\n if(!isEqual(select.getPlugin(SelectPluginType.ValueHandler).value(), value))\n {\n this.tmpValue.value = value;\n await select.getPlugin(SelectPluginType.ValueHandler).setValue(value);\n delete this.tmpValue.value;\n }\n });\n });\n\n //getting value\n effect(() =>\n {\n if(!select.initialized())\n {\n return;\n }\n\n let value = select.getPlugin(SelectPluginType.ValueHandler).value();\n\n if(nameof<TempValue<TPublicValue|TPublicValue[]>>('value') in this.tmpValue)\n {\n value = this.tmpValue.value;\n }\n\n untracked(() =>\n {\n if(!isEqual(this.value(), value))\n {\n this.value.set(value);\n }\n });\n });\n }\n}\n"]}
|
|
@@ -21,5 +21,6 @@ export * from './selectOptions/selectOptions.interface';
|
|
|
21
21
|
export * from './selectPlugin/selectPlugin.interface';
|
|
22
22
|
export * from './selectPluginTypes/selectPluginTypes.interface';
|
|
23
23
|
export * from './templateGatherer/templateGatherer.interface';
|
|
24
|
+
export * from './tempValue/tempValue.interface';
|
|
24
25
|
export * from './visualPluginOptions/visualPluginOptions.interface';
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,WAAW,CAAC;AAC1B,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,iEAAiE,CAAC;AAChF,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC","sourcesContent":["export * from './initState/initState.interface';\nexport * from './keyboardAction/keyboardAction.interface';\nexport * from './normalStateContext/normalStateContext.interface';\nexport * from './normalStateTagContext/normalStateTagContext.interface';\nexport * from './optionsGatherer/optionsGatherer.interface';\nexport * from './pluginDescription/pluginDescription.interface';\nexport * from './pluginOptions/pluginOptions.interface';\nexport * from './plugins';\nexport * from './popupContext/popupContext.interface';\nexport * from './selectApi/selectApi.interface';\nexport * from './selectBusOptions/selectBusOptions.interface';\nexport * from './selectCssClasses/selectCssClasses.interface';\nexport * from './selectEvent/selectEvent.interface';\nexport * from './selectEvents/selectEvents.interface';\nexport * from './selectOption/selectOption.interface';\nexport * from './selectOptionGroup/selectOptionGroup.interface';\nexport * from './selectOptions/selectOptions.interface';\nexport * from './selectOptionState/selectOptionState.interface';\nexport * from './selectOptionStateSyntetic/selectOptionStateSyntetic.interface';\nexport * from './selectOptions/selectOptions.interface';\nexport * from './selectPlugin/selectPlugin.interface';\nexport * from './selectPluginTypes/selectPluginTypes.interface';\nexport * from './templateGatherer/templateGatherer.interface';\nexport * from './visualPluginOptions/visualPluginOptions.interface';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,WAAW,CAAC;AAC1B,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,iEAAiE,CAAC;AAChF,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qDAAqD,CAAC","sourcesContent":["export * from './initState/initState.interface';\nexport * from './keyboardAction/keyboardAction.interface';\nexport * from './normalStateContext/normalStateContext.interface';\nexport * from './normalStateTagContext/normalStateTagContext.interface';\nexport * from './optionsGatherer/optionsGatherer.interface';\nexport * from './pluginDescription/pluginDescription.interface';\nexport * from './pluginOptions/pluginOptions.interface';\nexport * from './plugins';\nexport * from './popupContext/popupContext.interface';\nexport * from './selectApi/selectApi.interface';\nexport * from './selectBusOptions/selectBusOptions.interface';\nexport * from './selectCssClasses/selectCssClasses.interface';\nexport * from './selectEvent/selectEvent.interface';\nexport * from './selectEvents/selectEvents.interface';\nexport * from './selectOption/selectOption.interface';\nexport * from './selectOptionGroup/selectOptionGroup.interface';\nexport * from './selectOptions/selectOptions.interface';\nexport * from './selectOptionState/selectOptionState.interface';\nexport * from './selectOptionStateSyntetic/selectOptionStateSyntetic.interface';\nexport * from './selectOptions/selectOptions.interface';\nexport * from './selectPlugin/selectPlugin.interface';\nexport * from './selectPluginTypes/selectPluginTypes.interface';\nexport * from './templateGatherer/templateGatherer.interface';\nexport * from './tempValue/tempValue.interface';\nexport * from './visualPluginOptions/visualPluginOptions.interface';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueHandler.interface.js","sourceRoot":"","sources":["../../../../../src/interfaces/plugins/valueHandler/valueHandler.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Signal} from '@angular/core';\n\nimport {PluginOptions} from '../../pluginOptions/pluginOptions.interface';\nimport {SelectPlugin} from '../../selectPlugin/selectPlugin.interface';\n\n/**\n * Options for value handler plugin\n */\nexport interface ValueHandlerOptions extends PluginOptions\n{\n}\n\n/**\n * Value handler plugin interface\n */\nexport interface ValueHandler<TValue = unknown, TPublicValue = TValue, TOptions extends ValueHandlerOptions = ValueHandlerOptions> extends SelectPlugin<TOptions, TValue, TPublicValue>\n{\n //######################### properties #########################\n\n /**\n * Current selected value of Select\n */\n readonly value: Signal<TPublicValue|TPublicValue[]|undefined|null>;\n\n //######################### methods #########################\n\n /**\n * Sets value for Select\n * @param value - Value to be set\n */\n setValue(value: TPublicValue|TPublicValue[]|undefined|null): void
|
|
1
|
+
{"version":3,"file":"valueHandler.interface.js","sourceRoot":"","sources":["../../../../../src/interfaces/plugins/valueHandler/valueHandler.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Signal} from '@angular/core';\nimport {PromiseOr} from '@jscrpt/common';\n\nimport {PluginOptions} from '../../pluginOptions/pluginOptions.interface';\nimport {SelectPlugin} from '../../selectPlugin/selectPlugin.interface';\n\n/**\n * Options for value handler plugin\n */\nexport interface ValueHandlerOptions extends PluginOptions\n{\n}\n\n/**\n * Value handler plugin interface\n */\nexport interface ValueHandler<TValue = unknown, TPublicValue = TValue, TOptions extends ValueHandlerOptions = ValueHandlerOptions> extends SelectPlugin<TOptions, TValue, TPublicValue>\n{\n //######################### properties #########################\n\n /**\n * Current selected value of Select\n */\n readonly value: Signal<TPublicValue|TPublicValue[]|undefined|null>;\n\n //######################### methods #########################\n\n /**\n * Sets value for Select\n * @param value - Value to be set\n */\n setValue(value: TPublicValue|TPublicValue[]|undefined|null): PromiseOr<void>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempValue.interface.js","sourceRoot":"","sources":["../../../../src/interfaces/tempValue/tempValue.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Used for storing temporary value during async write\n */\nexport interface TempValue<TValue>\n{\n //######################### properties #########################\n\n /**\n * Stored value\n */\n value?: TValue|undefined|null;\n}\n"]}
|
package/es2022/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.js
CHANGED
|
@@ -46,8 +46,8 @@ export class DynamicValueHandler {
|
|
|
46
46
|
/**
|
|
47
47
|
* @inheritdoc
|
|
48
48
|
*/
|
|
49
|
-
setValue(value) {
|
|
50
|
-
untracked(async () => {
|
|
49
|
+
async setValue(value) {
|
|
50
|
+
await untracked(async () => {
|
|
51
51
|
const selected = this.selectBus.selectedOptions();
|
|
52
52
|
if (Array.isArray(selected)) {
|
|
53
53
|
for (const option of selected) {
|
package/es2022/src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicValueHandler.component.js","sourceRoot":"","sources":["../../../../../src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAU,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAC,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,qBAAqB,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;;AAGlD,MAAM,cAAc,GACpB;IACI,YAAY,EAAE,KAAK,CAAC,EAAE;QAElB,OAAO;YACH,IAAI,EAAE,MAAM,CAAC,kCAAkC,CAAC;YAChD,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;YACpB,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC;SAC3B,CAAC;IACN,CAAC;CACJ,CAAC;AAEF;;GAEG;AAOH,MAAM,OAAO,mBAAmB;IAgC5B,iEAAiE;IACjE,YAAuD,OAAiF;QAvBxI;;WAEG;QACI,kBAAa,GAAgD,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAElG;;WAEG;QACI,kBAAa,GAA4B,MAAM,CAAC,UAAU,CAAC,CAAC;QAEnE;;WAEG;QACI,cAAS,GAAoC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEtE,wGAAwG;QAExG;;WAEG;QACa,UAAK,GAAuD,QAAQ,CAAE,aAAiD,CAAC,IAAI,CAAC,IAAI,CAAC;kFAAC,CAAC;QAKhJ,IAAI,CAAC,OAAO,GAAG,yBAAyB,CAAC,cAAkE,EAClE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,qGAAqG;IAErG;;OAEG;IACI,QAAQ,CAAC,KAAiD;
|
|
1
|
+
{"version":3,"file":"dynamicValueHandler.component.js","sourceRoot":"","sources":["../../../../../src/plugins/valueHandler/dynamicValueHandler/dynamicValueHandler.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAU,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAC,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,qBAAqB,EAAC,M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AC,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;YACpD,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;8GAzGQ,mBAAmB,kBAiCR,qBAAqB;kGAjChC,mBAAmB,iFAHlB,EAAE;;AAWL;IADN,mBAAmB,EAAE;;oDAC2C;2FARxD,mBAAmB;kBAN/B,SAAS;mBACV;oBACI,QAAQ,EAAE,uBAAuB;oBACjC,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAClD;;0BAkCgB,MAAM;2BAAC,qBAAqB;;0BAAG,QAAQ","sourcesContent":["import {ChangeDetectionStrategy, Component, computed, ElementRef, Inject, inject, Optional, signal, Signal, untracked} from '@angular/core';\nimport {isPresent, RecursivePartial} from '@jscrpt/common';\nimport {deepCopyWithArrayOverride} from '@jscrpt/common/lodash';\n\nimport {ValueHandler, DynamicValueHandlerOptions, SelectOptionState} from '../../../interfaces';\nimport {SelectPluginInstances, SelectBus} from '../../../misc/classes';\nimport {CopyOptionsAsSignal} from '../../../decorators';\nimport {VALUE_HANDLER_OPTIONS} from '../../../misc/tokens';\nimport {computedValue} from '../../../misc/utils';\nimport {ValueComputedFunc} from '../../../misc/types';\n\nconst defaultOptions: DynamicValueHandlerOptions =\n{\n optionGetter: value =>\n {\n return {\n text: signal('please provide your optionGetter'),\n value: signal(value),\n group: signal(undefined),\n };\n },\n};\n\n/**\n * Value handler for dynamic values. That means that available values change.\n */\n@Component(\n{\n selector: 'dynamic-value-handler',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicValueHandler<TValue = unknown, TPublicValue = TValue> implements ValueHandler<TValue, TPublicValue, DynamicValueHandlerOptions<TValue, TPublicValue>>\n{\n //######################### public properties - implementation of SelectPlugin #########################\n\n /**\n * @inheritdoc\n */\n @CopyOptionsAsSignal()\n public options: DynamicValueHandlerOptions<TValue, TPublicValue>;\n\n /**\n * @inheritdoc\n */\n public selectPlugins: SelectPluginInstances<TValue, TPublicValue> = inject(SelectPluginInstances);\n\n /**\n * @inheritdoc\n */\n public pluginElement: ElementRef<HTMLElement> = inject(ElementRef);\n\n /**\n * @inheritdoc\n */\n public selectBus: SelectBus<TValue, TPublicValue> = inject(SelectBus);\n\n //######################### public properties - implementation of ValueHandler #########################\n\n /**\n * @inheritdoc\n */\n public readonly value: Signal<TPublicValue|TPublicValue[]|undefined|null> = computed((computedValue as ValueComputedFunc<TPublicValue>).bind(this));\n\n //######################### constructor #########################\n constructor(@Inject(VALUE_HANDLER_OPTIONS) @Optional() options?: RecursivePartial<DynamicValueHandlerOptions<TValue, TPublicValue>>|null,)\n {\n this.options = deepCopyWithArrayOverride(defaultOptions as DynamicValueHandlerOptions<TValue, TPublicValue>,\n options);\n }\n\n //######################### public methods - implementation of ValueHandler #########################\n\n /**\n * @inheritdoc\n */\n public async setValue(value: TPublicValue|TPublicValue[]|undefined|null): Promise<void>\n {\n await untracked(async () =>\n {\n const selected = this.selectBus.selectedOptions();\n\n if(Array.isArray(selected))\n {\n for(const option of selected)\n {\n option.selected.set(false);\n }\n }\n else if(isPresent(selected))\n {\n selected.selected.set(false);\n }\n\n if(this.selectBus.selectOptions().multiple)\n {\n if(!Array.isArray(value))\n {\n throw new Error('You have to provide an array of values if you set multiple!');\n }\n\n const selectedOptions: SelectOptionState<TValue>[] = [];\n\n for(const val of value)\n {\n const selectedOption = await this.options.optionGetter(val);\n\n if(!selectedOption)\n {\n continue;\n }\n\n const opt = selectedOption as SelectOptionState<TValue>;\n opt.active = signal(false);\n opt.selected = signal(true);\n opt.index = 0;\n\n selectedOptions.push(opt);\n }\n\n this.selectBus.selectedOptions.set(selectedOptions);\n }\n else\n {\n const selectedOption = await this.options.optionGetter(value as TPublicValue);\n const opt = selectedOption as SelectOptionState<TValue>|undefined|null;\n\n if(opt)\n {\n opt.active = signal(false);\n opt.selected = signal(true);\n opt.index = 0;\n }\n\n this.selectBus.selectedOptions.set(opt ?? null);\n }\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { ControlValueAccessor } from '@angular/forms';
|
|
|
3
3
|
import { Action1, NoopAction } from '@jscrpt/common';
|
|
4
4
|
import { Subscription } from 'rxjs';
|
|
5
5
|
import { Select } from '../../components/select/select.component';
|
|
6
|
+
import { TempValue } from '../../interfaces';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* Control value accessor for Select
|
|
@@ -12,6 +13,10 @@ export declare class SelectControlValueAccessor<TValue = unknown, TPublicValue =
|
|
|
12
13
|
* Subscriptions created during initialization
|
|
13
14
|
*/
|
|
14
15
|
protected initSubscriptions: Subscription;
|
|
16
|
+
/**
|
|
17
|
+
* Temporary value used for storing value during async write
|
|
18
|
+
*/
|
|
19
|
+
protected tmpValue: TempValue<TPublicValue | TPublicValue[]>;
|
|
15
20
|
/**
|
|
16
21
|
* Last set value to this control
|
|
17
22
|
*/
|
package/src/directives/selectControlValueAccessor/selectControlValueAccessor.directive.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectControlValueAccessor.directive.d.ts","sourceRoot":"","sources":["selectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,cAAc,EAA4B,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAoB,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"selectControlValueAccessor.directive.d.ts","sourceRoot":"","sources":["selectControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,SAAS,EAAE,cAAc,EAA4B,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAoB,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,OAAO,EAAU,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAGl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W;yCAvIT,0BAA0B;2CAA1B,0BAA0B;CA2ItC"}
|
|
@@ -3,6 +3,7 @@ import { FormValueControl } from '@angular/forms/signals';
|
|
|
3
3
|
import { Logger } from '@anglr/common';
|
|
4
4
|
import { Subscription } from 'rxjs';
|
|
5
5
|
import { Select } from '../../components/select/select.component';
|
|
6
|
+
import { TempValue } from '../../interfaces';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
/**
|
|
8
9
|
* Form value control for Select
|
|
@@ -17,6 +18,10 @@ export declare class SelectFormControl<TValue = unknown, TPublicValue = TValue>
|
|
|
17
18
|
* Subscriptions created during initialization
|
|
18
19
|
*/
|
|
19
20
|
protected initSubscriptions: Subscription;
|
|
21
|
+
/**
|
|
22
|
+
* Temporary value used for storing value during async write
|
|
23
|
+
*/
|
|
24
|
+
protected tmpValue: TempValue<TPublicValue | TPublicValue[]>;
|
|
20
25
|
/**
|
|
21
26
|
* @inheritdoc
|
|
22
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectFormControl.directive.d.ts","sourceRoot":"","sources":["selectFormControl.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAS,WAAW,EAAE,SAAS,EAAY,MAAM,eAAe,CAAC;AACtH,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAS,MAAM,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"selectFormControl.directive.d.ts","sourceRoot":"","sources":["selectFormControl.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,WAAW,EAAS,WAAW,EAAE,SAAS,EAAY,MAAM,eAAe,CAAC;AACtH,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAS,MAAM,EAAC,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAElC,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;AAEhE,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;;AAE3C;;GAEG;AACH,qBAIa,iBAAiB,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,GAAG,MAAM,CAAE,YAAW,gBAAgB,CAAC,YAAY,GAAC,YAAY,EAAE,GAAC,SAAS,GAAC,IAAI,CAAC,EAAE,SAAS;IA+C1I,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IA3C1D;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAkB;IAE1C;;OAEG;IACH,SAAS,CAAC,iBAAiB,EAAE,YAAY,CAAsB;IAE/D;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,YAAY,GAAC,YAAY,EAAE,CAAC,CAAM;IAIhE;;OAEG;IACH,SAAgB,KAAK,EAAE,WAAW,CAAC,YAAY,GAAC,YAAY,EAAE,GAAC,IAAI,GAAC,SAAS,CAAC,CAAgE;IAE9I;;OAEG;IACI,OAAO,EAAE,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAgB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAgB;IAE9D;;OAEG;IACH,SAAgB,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,CAAgB;IAE9D;;OAEG;IACH,SAAgB,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAgB;gBAGvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;IA0D1D;;OAEG;IACI,KAAK,IAAI,IAAI;IAOpB;;OAEG;IACI,WAAW,IAAI,IAAI;yCAtHjB,iBAAiB;2CAAjB,iBAAiB;CA0H7B"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ModelSignal } from '@angular/core';
|
|
2
2
|
import { Select } from '../../components/select/select.component';
|
|
3
|
+
import { TempValue } from '../../interfaces';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
5
6
|
* Directive that allows direct access to select properties using inputs, outputs
|
|
6
7
|
*/
|
|
7
8
|
export declare class WithDirectAccess<TValue = unknown, TPublicValue = TValue> {
|
|
9
|
+
/**
|
|
10
|
+
* Temporary value used for storing value during async write
|
|
11
|
+
*/
|
|
12
|
+
protected tmpValue: TempValue<TPublicValue | TPublicValue[]>;
|
|
8
13
|
/**
|
|
9
14
|
* Value of the Select to be set
|
|
10
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withDirectAccess.directive.d.ts","sourceRoot":"","sources":["withDirectAccess.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,WAAW,EAAY,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"withDirectAccess.directive.d.ts","sourceRoot":"","sources":["withDirectAccess.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,WAAW,EAAY,MAAM,eAAe,CAAC;AAK/E,OAAO,EAAC,MAAM,EAAC,MAAM,0CAA0C,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;;AAE3C;;GAEG;AACH,qBAIa,gBAAgB,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,GAAG,MAAM;IAIjE;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,YAAY,GAAC,YAAY,EAAE,CAAC,CAAM;IAIhE;;OAEG;IACI,KAAK,EAAE,WAAW,CAAC,YAAY,GAAC,YAAY,EAAE,GAAC,SAAS,GAAC,IAAI,CAAC,CAAgE;gBAGzH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;yCAjBvC,gBAAgB;2CAAhB,gBAAgB;CAgE5B"}
|
|
@@ -21,5 +21,6 @@ export * from './selectOptions/selectOptions.interface';
|
|
|
21
21
|
export * from './selectPlugin/selectPlugin.interface';
|
|
22
22
|
export * from './selectPluginTypes/selectPluginTypes.interface';
|
|
23
23
|
export * from './templateGatherer/templateGatherer.interface';
|
|
24
|
+
export * from './tempValue/tempValue.interface';
|
|
24
25
|
export * from './visualPluginOptions/visualPluginOptions.interface';
|
|
25
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,WAAW,CAAC;AAC1B,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,iEAAiE,CAAC;AAChF,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qDAAqD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,cAAc,yDAAyD,CAAC;AACxE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,WAAW,CAAC;AAC1B,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,yCAAyC,CAAC;AACxD,cAAc,iDAAiD,CAAC;AAChE,cAAc,iEAAiE,CAAC;AAChF,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iDAAiD,CAAC;AAChE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qDAAqD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Signal } from '@angular/core';
|
|
2
|
+
import { PromiseOr } from '@jscrpt/common';
|
|
2
3
|
import { PluginOptions } from '../../pluginOptions/pluginOptions.interface';
|
|
3
4
|
import { SelectPlugin } from '../../selectPlugin/selectPlugin.interface';
|
|
4
5
|
/**
|
|
@@ -18,6 +19,6 @@ export interface ValueHandler<TValue = unknown, TPublicValue = TValue, TOptions
|
|
|
18
19
|
* Sets value for Select
|
|
19
20
|
* @param value - Value to be set
|
|
20
21
|
*/
|
|
21
|
-
setValue(value: TPublicValue | TPublicValue[] | undefined | null): void
|
|
22
|
+
setValue(value: TPublicValue | TPublicValue[] | undefined | null): PromiseOr<void>;
|
|
22
23
|
}
|
|
23
24
|
//# sourceMappingURL=valueHandler.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valueHandler.interface.d.ts","sourceRoot":"","sources":["valueHandler.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"valueHandler.interface.d.ts","sourceRoot":"","sources":["valueHandler.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,aAAa,EAAC,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAC,YAAY,EAAC,MAAM,2CAA2C,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;CAEzD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,QAAQ,SAAS,mBAAmB,GAAG,mBAAmB,CAAE,SAAQ,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC;IAInL;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,GAAC,YAAY,EAAE,GAAC,SAAS,GAAC,IAAI,CAAC,CAAC;IAInE;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAC,YAAY,EAAE,GAAC,SAAS,GAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;CAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tempValue.interface.d.ts","sourceRoot":"","sources":["tempValue.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,MAAM;IAI7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAC,SAAS,GAAC,IAAI,CAAC;CACjC"}
|
|
@@ -31,7 +31,7 @@ export declare class DynamicValueHandler<TValue = unknown, TPublicValue = TValue
|
|
|
31
31
|
/**
|
|
32
32
|
* @inheritdoc
|
|
33
33
|
*/
|
|
34
|
-
setValue(value: TPublicValue | TPublicValue[] | undefined | null): void
|
|
34
|
+
setValue(value: TPublicValue | TPublicValue[] | undefined | null): Promise<void>;
|
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicValueHandler<any, any>, [{ optional: true; }]>;
|
|
36
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicValueHandler<any, any>, "dynamic-value-handler", never, {}, {}, never, never, true, never>;
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicValueHandler.component.d.ts","sourceRoot":"","sources":["dynamicValueHandler.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,UAAU,EAAoC,MAAM,EAAY,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAY,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAC,YAAY,EAAE,0BAA0B,EAAoB,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAC,qBAAqB,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;;AAkBvE;;GAEG;AACH,qBAMa,mBAAmB,CAAC,MAAM,GAAG,OAAO,EAAE,YAAY,GAAG,MAAM,CAAE,YAAW,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,0BAA0B,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAIrK;;OAEG;IAEI,OAAO,EAAE,0BAA0B,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAEjE;;OAEG;IACI,aAAa,EAAE,qBAAqB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAiC;IAElG;;OAEG;IACI,aAAa,EAAE,UAAU,CAAC,WAAW,CAAC,CAAsB;IAEnE;;OAEG;IACI,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAqB;IAItE;;OAEG;IACH,SAAgB,KAAK,EAAE,MAAM,CAAC,YAAY,GAAC,YAAY,EAAE,GAAC,SAAS,GAAC,IAAI,CAAC,CAA2E;gBAG7F,OAAO,CAAC,EAAE,gBAAgB,CAAC,0BAA0B,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,GAAC,IAAI;IAQxI;;OAEG;
|
|
1
|
+
{"version":3,"file":"dynamicValueHandler.component.d.ts","sourceRoot":"","sources":["dynamicValueHandler.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+C,UAAU,EAAoC,MAAM,EAAY,MAAM,eAAe,CAAC;AAC5I,OAAO,EAAY,gBAAgB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