@progress/kendo-angular-common 20.0.0-develop.3 → 20.0.0-develop.5

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/esm2022/index.mjs CHANGED
@@ -12,6 +12,8 @@ export * from './enums';
12
12
  export * from './utils/focusable-selectors';
13
13
  export * from './utils/ng-class-parser';
14
14
  export * from './utils/numpad-keys-normalizer';
15
+ export * from './utils/getter';
16
+ export * from './utils/setter';
15
17
  export * from './watermark';
16
18
  export * from './adornments';
17
19
  export { PreventableEvent } from './preventable-event';
@@ -0,0 +1,27 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ const FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
6
+ const getterCache = {};
7
+ getterCache['undefined'] = () => undefined;
8
+ /**
9
+ * @hidden
10
+ */
11
+ export function getter(field) {
12
+ if (getterCache[field]) {
13
+ return getterCache[field];
14
+ }
15
+ const fields = [];
16
+ field.replace(FIELD_REGEX, function (_match, index, indexAccessor, fieldName) {
17
+ fields.push(index !== undefined ? index : (indexAccessor || fieldName));
18
+ });
19
+ getterCache[field] = function (obj) {
20
+ let result = obj;
21
+ for (let idx = 0; idx < fields.length && result; idx++) {
22
+ result = result[fields[idx]];
23
+ }
24
+ return result;
25
+ };
26
+ return getterCache[field];
27
+ }
@@ -0,0 +1,28 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ const FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
6
+ const setterCache = {};
7
+ setterCache['undefined'] = (obj) => obj;
8
+ /**
9
+ * @hidden
10
+ */
11
+ export function setter(field) {
12
+ if (setterCache[field]) {
13
+ return setterCache[field];
14
+ }
15
+ const fields = [];
16
+ field.replace(FIELD_REGEX, function (_match, index, indexAccessor, fieldName) {
17
+ fields.push(index !== undefined ? index : (indexAccessor || fieldName));
18
+ });
19
+ setterCache[field] = function (obj, value) {
20
+ let root = obj;
21
+ const depth = fields.length - 1;
22
+ for (let idx = 0; idx < depth && root; idx++) {
23
+ root = root[fields[idx]] = root[fields[idx]] || {};
24
+ }
25
+ root[fields[depth]] = value;
26
+ };
27
+ return setterCache[field];
28
+ }
@@ -919,6 +919,55 @@ const normalizeNumpadKeys = (event) => {
919
919
  return event.code;
920
920
  };
921
921
 
922
+ const FIELD_REGEX$1 = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
923
+ const getterCache = {};
924
+ getterCache['undefined'] = () => undefined;
925
+ /**
926
+ * @hidden
927
+ */
928
+ function getter(field) {
929
+ if (getterCache[field]) {
930
+ return getterCache[field];
931
+ }
932
+ const fields = [];
933
+ field.replace(FIELD_REGEX$1, function (_match, index, indexAccessor, fieldName) {
934
+ fields.push(index !== undefined ? index : (indexAccessor || fieldName));
935
+ });
936
+ getterCache[field] = function (obj) {
937
+ let result = obj;
938
+ for (let idx = 0; idx < fields.length && result; idx++) {
939
+ result = result[fields[idx]];
940
+ }
941
+ return result;
942
+ };
943
+ return getterCache[field];
944
+ }
945
+
946
+ const FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;
947
+ const setterCache = {};
948
+ setterCache['undefined'] = (obj) => obj;
949
+ /**
950
+ * @hidden
951
+ */
952
+ function setter(field) {
953
+ if (setterCache[field]) {
954
+ return setterCache[field];
955
+ }
956
+ const fields = [];
957
+ field.replace(FIELD_REGEX, function (_match, index, indexAccessor, fieldName) {
958
+ fields.push(index !== undefined ? index : (indexAccessor || fieldName));
959
+ });
960
+ setterCache[field] = function (obj, value) {
961
+ let root = obj;
962
+ const depth = fields.length - 1;
963
+ for (let idx = 0; idx < depth && root; idx++) {
964
+ root = root[fields[idx]] = root[fields[idx]] || {};
965
+ }
966
+ root[fields[depth]] = value;
967
+ };
968
+ return setterCache[field];
969
+ }
970
+
922
971
  /**
923
972
  * @hidden
924
973
  */
@@ -1639,5 +1688,5 @@ const replaceMessagePlaceholder = (message, name, value) => (message ?? '').repl
1639
1688
  * Generated bundle index. Do not edit.
1640
1689
  */
1641
1690
 
1642
- export { DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarWidthService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, guid, hasClasses, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isString, isVisible, matchesClasses, matchesNodeName, normalizeNumpadKeys, parseAttributes, parseCSSClassNames, processCssValue, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, shouldShowValidationUI, splitStringToArray };
1691
+ export { DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarWidthService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isString, isVisible, matchesClasses, matchesNodeName, normalizeNumpadKeys, parseAttributes, parseCSSClassNames, processCssValue, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
1643
1692
 
package/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export * from './enums';
12
12
  export * from './utils/focusable-selectors';
13
13
  export * from './utils/ng-class-parser';
14
14
  export * from './utils/numpad-keys-normalizer';
15
+ export * from './utils/getter';
16
+ export * from './utils/setter';
15
17
  export * from './watermark';
16
18
  export * from './adornments';
17
19
  export { PreventableEvent } from './preventable-event';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-angular-common",
3
- "version": "20.0.0-develop.3",
3
+ "version": "20.0.0-develop.5",
4
4
  "description": "Kendo UI for Angular - Utility Package",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Progress",
@@ -23,7 +23,7 @@
23
23
  "@progress/kendo-common": "^1.0.1",
24
24
  "@progress/kendo-draggable": "^3.0.2",
25
25
  "tslib": "^2.3.1",
26
- "@progress/kendo-angular-schematics": "20.0.0-develop.3"
26
+ "@progress/kendo-angular-schematics": "20.0.0-develop.5"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare function getter(field: string): any;
@@ -0,0 +1,8 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ /**
6
+ * @hidden
7
+ */
8
+ export declare function setter(field: string): any;