@singularsystems/neo-core 1.6.5 → 1.6.6
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 +5 -0
- package/dist/Components/FormOptions.d.ts +6 -0
- package/dist/Components/Modal/ModalHelper.js +3 -1
- package/dist/Components/Modal/ModalOptions.d.ts +6 -0
- package/dist/Components/Modal/ModalUtils.js +1 -1
- package/dist/DomUtils.d.ts +11 -0
- package/dist/DomUtils.js +30 -0
- package/dist/Settings.d.ts +2 -0
- package/dist/Settings.js +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Neo core changelog
|
|
2
2
|
|
|
3
|
+
## Version 1.6.6 (5 October 2026)
|
|
4
|
+
|
|
5
|
+
- Added `autoFocus` prop to form options.
|
|
6
|
+
- Added `autoFocusForm` setting to global modal options to allow modals to focus first input by default.
|
|
7
|
+
|
|
3
8
|
## Version 1.6.5 (28 September 2026)
|
|
4
9
|
|
|
5
10
|
- Fixed position helper not correctly positioning fixed elements that are within a fixed container.
|
|
@@ -34,4 +34,10 @@ export interface IFormOptions<T extends IModelBase> extends IFormContextOptions
|
|
|
34
34
|
* Text to show in summary modal title. Setting this prop infers showSummaryModal. Defaults to: Invalid data
|
|
35
35
|
*/
|
|
36
36
|
invalidSummaryTitle?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Causes the form to automatically focus an element when it is rendered.
|
|
39
|
+
* If set to true, the first input will be focused.
|
|
40
|
+
* If set to a string, it should be a CSS selector for the element to focus.
|
|
41
|
+
*/
|
|
42
|
+
autoFocus?: boolean | string;
|
|
37
43
|
}
|
|
@@ -164,8 +164,10 @@ var ModalHelper = /** @class */ (function () {
|
|
|
164
164
|
if (this.modals.length == 1) {
|
|
165
165
|
var modal = this.modals[this.modals.length - 1];
|
|
166
166
|
if (e.target == this.modalsContainer || e.target == modal.container) {
|
|
167
|
-
if (modal.onDismiss)
|
|
167
|
+
if (modal.onDismiss) {
|
|
168
|
+
e.preventDefault();
|
|
168
169
|
modal.onDismiss(e);
|
|
170
|
+
}
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
};
|
|
@@ -29,6 +29,12 @@ export interface IModalOptionsBase {
|
|
|
29
29
|
onClose?: (event: any) => void;
|
|
30
30
|
/** Called after the modal animation completes. */
|
|
31
31
|
afterClose?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Causes the inner form to automatically focus an element when it is opened.
|
|
34
|
+
* If set to true, the first input will be focused.
|
|
35
|
+
* If set to a string, it should be a CSS selector for the element to focus.
|
|
36
|
+
*/
|
|
37
|
+
autoFocusForm?: boolean | string;
|
|
32
38
|
}
|
|
33
39
|
export default interface IModalOptions extends IModalOptionsBase {
|
|
34
40
|
/** Controls the visibility of the modal. */
|
|
@@ -78,7 +78,7 @@ var ModalHelpers = /** @class */ (function () {
|
|
|
78
78
|
onClose: function () { return resolve(ModalResult.Cancel); },
|
|
79
79
|
acceptButton: { text: NeoStrings.modals.ok, onClick: function () { return resolve(ModalResult.Yes); } },
|
|
80
80
|
closeButton: __assign(__assign({}, Settings.modal.cancelButton), { text: NeoStrings.modals.cancel, onClick: function () { return resolve(ModalResult.Cancel); } }),
|
|
81
|
-
formProps: { model: model },
|
|
81
|
+
formProps: { model: model, autoFocus: true },
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default class DomUtils {
|
|
2
|
+
/** CSS selector for input, select, and textarea elements that are not disabled. Excludes buttons. */
|
|
3
|
+
static Selector_InputNonDisabled: string;
|
|
4
|
+
/**
|
|
5
|
+
* Focuses the next focusable element within the specified parent or the document body if no parent is provided.
|
|
6
|
+
* @param currentElement The current element from which to start searching for the next focusable element. Will use the current active element if not provided.
|
|
7
|
+
* @param parentOrSelector The parent element or selector within which to search for the next focusable element. If not provided, the document body is used.
|
|
8
|
+
* @param filter The CSS selector to filter the focusable elements. Defaults to DomUtils.Selector_Focusable.
|
|
9
|
+
*/
|
|
10
|
+
static focusNextElement(currentElement?: HTMLElement | null, parentOrSelector?: string | HTMLElement | null, filter?: string): void;
|
|
11
|
+
}
|
package/dist/DomUtils.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var DomUtils = /** @class */ (function () {
|
|
2
|
+
function DomUtils() {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Focuses the next focusable element within the specified parent or the document body if no parent is provided.
|
|
6
|
+
* @param currentElement The current element from which to start searching for the next focusable element. Will use the current active element if not provided.
|
|
7
|
+
* @param parentOrSelector The parent element or selector within which to search for the next focusable element. If not provided, the document body is used.
|
|
8
|
+
* @param filter The CSS selector to filter the focusable elements. Defaults to DomUtils.Selector_Focusable.
|
|
9
|
+
*/
|
|
10
|
+
DomUtils.focusNextElement = function (currentElement, parentOrSelector, filter) {
|
|
11
|
+
var parent = null;
|
|
12
|
+
if (parentOrSelector instanceof HTMLElement) {
|
|
13
|
+
parent = parentOrSelector;
|
|
14
|
+
}
|
|
15
|
+
else if (typeof parentOrSelector === "string") {
|
|
16
|
+
parent = document.querySelector(parentOrSelector);
|
|
17
|
+
}
|
|
18
|
+
parent !== null && parent !== void 0 ? parent : (parent = document.body);
|
|
19
|
+
currentElement !== null && currentElement !== void 0 ? currentElement : (currentElement = document.activeElement);
|
|
20
|
+
var focusableElements = parent.querySelectorAll(filter !== null && filter !== void 0 ? filter : DomUtils.Selector_InputNonDisabled);
|
|
21
|
+
var currentIndex = currentElement ? Array.from(focusableElements).indexOf(currentElement) : -1;
|
|
22
|
+
if (currentIndex < focusableElements.length - 1) {
|
|
23
|
+
focusableElements[currentIndex + 1].focus();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/** CSS selector for input, select, and textarea elements that are not disabled. Excludes buttons. */
|
|
27
|
+
DomUtils.Selector_InputNonDisabled = "input:not(:disabled), select:not(:disabled), textarea:not(:disabled)";
|
|
28
|
+
return DomUtils;
|
|
29
|
+
}());
|
|
30
|
+
export default DomUtils;
|
package/dist/Settings.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ export declare const Settings: {
|
|
|
86
86
|
closeButton: IButtonOptions;
|
|
87
87
|
/** Settings for cancel button shown in footer. */
|
|
88
88
|
cancelButton: IButtonOptions;
|
|
89
|
+
/** Causes modals to focus the first element in the form when opened. Will not apply if the form is suppressed. */
|
|
90
|
+
autoFocusForm: boolean;
|
|
89
91
|
};
|
|
90
92
|
pager: {
|
|
91
93
|
firstText: string;
|
package/dist/Settings.js
CHANGED
|
@@ -113,6 +113,8 @@ export var Settings = {
|
|
|
113
113
|
variant: "light",
|
|
114
114
|
isOutline: false,
|
|
115
115
|
},
|
|
116
|
+
/** Causes modals to focus the first element in the form when opened. Will not apply if the form is suppressed. */
|
|
117
|
+
autoFocusForm: false,
|
|
116
118
|
},
|
|
117
119
|
pager: {
|
|
118
120
|
firstText: "«",
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import AxiosUtils from "./AxiosUtils";
|
|
|
5
5
|
import List from './Model/List';
|
|
6
6
|
import NeoModel from './Model/NeoModel';
|
|
7
7
|
import DateUtils from './Dates/DateUtils';
|
|
8
|
+
import DomUtils from './DomUtils';
|
|
8
9
|
import NumberUtils from './NumberUtils';
|
|
9
10
|
import StringUtils from './StringUtils';
|
|
10
11
|
import { ModalUtils } from './Components/Modal/ModalUtils';
|
|
@@ -32,7 +33,7 @@ import * as SignalR from './SignalR';
|
|
|
32
33
|
import * as Validation from './Validation';
|
|
33
34
|
import * as Views from './Views/IViewBase';
|
|
34
35
|
declare const NotifyUtils: Components.INotificationHelper;
|
|
35
|
-
export { AbortHelper, AxiosUtils, AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, NeoStrings, Network, NotifyUtils, Numeric, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
36
|
+
export { AbortHelper, AxiosUtils, AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, DomUtils, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, NeoStrings, Network, NotifyUtils, Numeric, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
36
37
|
export { runInTask, createProperty };
|
|
37
38
|
export { default as ModelBase } from './Model/ModelBase';
|
|
38
39
|
export { default as ValueObject } from './Model/ValueObject';
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import AxiosUtils from "./AxiosUtils";
|
|
|
6
6
|
import List from './Model/List';
|
|
7
7
|
import NeoModel from './Model/NeoModel';
|
|
8
8
|
import DateUtils from './Dates/DateUtils';
|
|
9
|
+
import DomUtils from './DomUtils';
|
|
9
10
|
import NumberUtils from './NumberUtils';
|
|
10
11
|
import StringUtils from './StringUtils';
|
|
11
12
|
import { ModalUtils } from './Components/Modal/ModalUtils';
|
|
@@ -37,7 +38,7 @@ import * as Views from './Views/IViewBase';
|
|
|
37
38
|
import { NotificationHelper } from './Components/Notifications/NotificationHelper';
|
|
38
39
|
var NotifyUtils = new NotificationHelper();
|
|
39
40
|
// Types
|
|
40
|
-
export { AbortHelper, AxiosUtils, AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, NeoStrings, Network, NotifyUtils, Numeric, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
41
|
+
export { AbortHelper, AxiosUtils, AppServices, Attributes, Components, Data, DateUtils, DebounceHelper, DomUtils, EnumHelper, FileUtils, JsonSchema, Localisation, List, MenuUtils, Misc, ModalUtils, Model, NeoModel, NeoStrings, Network, NotifyUtils, Numeric, NumberUtils, Routing, Rules, Security, SignalR, StringUtils, Validation, Views, };
|
|
41
42
|
// Functions
|
|
42
43
|
export { runInTask, createProperty };
|
|
43
44
|
export { default as ModelBase } from './Model/ModelBase';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singularsystems/neo-core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Core functionality for the Neo client library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,23 +16,23 @@
|
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/jest": "30.0.0",
|
|
19
|
-
"@types/node": "
|
|
19
|
+
"@types/node": "26.6.4",
|
|
20
20
|
"decimal.js-light": "2.5.1",
|
|
21
|
-
"jest": "30.2
|
|
22
|
-
"jest-util": "30.
|
|
23
|
-
"ts-jest": "29.4.
|
|
21
|
+
"jest": "30.5.2",
|
|
22
|
+
"jest-util": "30.5.1",
|
|
23
|
+
"ts-jest": "29.4.14",
|
|
24
24
|
"typescript": "5.9.3"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@microsoft/signalr": "10.0.
|
|
28
|
-
"axios": "1.
|
|
27
|
+
"@microsoft/signalr": "10.0.11",
|
|
28
|
+
"axios": "1.20.0",
|
|
29
29
|
"inversify": "6.0.2",
|
|
30
30
|
"reflect-metadata": "0.2.2",
|
|
31
31
|
"tslib": "2.8.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"axios": ">=1.
|
|
35
|
-
"inversify": ">=
|
|
34
|
+
"axios": ">=1.20.0",
|
|
35
|
+
"inversify": ">=6.0.2"
|
|
36
36
|
},
|
|
37
37
|
"packageManager": "yarn@4.9.2"
|
|
38
38
|
}
|