@progress/kendo-react-common 9.0.0-develop.1 → 9.0.0-develop.10
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/Draggable.mjs +16 -12
- package/README.md +25 -24
- package/apply-default-props.js +8 -0
- package/apply-default-props.mjs +17 -0
- package/clone.js +1 -1
- package/clone.mjs +23 -23
- package/constants/main.mjs +3 -1
- package/dist/cdn/js/kendo-react-common.js +1 -1
- package/hooks/useAsyncFocusBlur.mjs +6 -1
- package/hooks/useCollection.mjs +11 -14
- package/hooks/useDir.mjs +6 -9
- package/hooks/useDraggable.mjs +41 -89
- package/hooks/useDroppable.mjs +4 -12
- package/hooks/useInheritedState.mjs +3 -6
- package/hooks/useRtl.mjs +6 -9
- package/icons/Icon.mjs +2 -18
- package/icons/IconWrap.mjs +10 -8
- package/icons/SvgIcon.mjs +32 -41
- package/index.d.mts +16 -5
- package/index.d.ts +16 -5
- package/index.js +1 -1
- package/index.mjs +116 -114
- package/package.json +1 -1
- package/trappedFocus.mjs +2 -8
- package/tree-utils/itemIdUtils.js +1 -1
- package/tree-utils/itemIdUtils.mjs +15 -19
- package/tree-utils/itemUtils.mjs +67 -42
- package/treeDataOperations.js +1 -1
- package/treeDataOperations.mjs +16 -14
- package/typography/Typography.js +1 -1
- package/typography/Typography.mjs +10 -34
- package/unstyled/json-classes.mjs +1 -0
- package/watermark/WatermarkOverlay.js +1 -1
- package/watermark/WatermarkOverlay.mjs +83 -52
package/index.mjs
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as e from "./tree-utils/itemIdUtils.mjs";
|
|
10
10
|
import { ZIndexContext as t, useZIndexContext as p } from "./contexts/ZIndexContext.mjs";
|
|
11
|
-
import { BrowserSupportService as
|
|
11
|
+
import { BrowserSupportService as s } from "./browser-support.service.mjs";
|
|
12
12
|
import { canUseDOM as n } from "./canUseDOM.mjs";
|
|
13
13
|
import { canUseRef as x } from "./canUseRef.mjs";
|
|
14
14
|
import { classNames as l, strippedClassNames as u } from "./classNames.mjs";
|
|
15
15
|
import { clone as c, cloneArray as I, cloneDate as C, cloneObject as h, cloneValue as b } from "./clone.mjs";
|
|
16
|
-
import { applyTrappedFocus as
|
|
16
|
+
import { applyTrappedFocus as D, disableNavigatableContainer as E, enableNavigatableContainer as P, firstFocusableChild as A, focusFirstFocusableChild as S, focusLastFocusableChild as T, focusableChildren as B, keepFocusInContainer as v, lastFocusableChild as y } from "./trappedFocus.mjs";
|
|
17
17
|
import { FormComponent as L } from "./FormComponent.mjs";
|
|
18
18
|
import { getTabIndex as w } from "./getTabIndex.mjs";
|
|
19
19
|
import { getter as k } from "./getter.mjs";
|
|
@@ -24,18 +24,18 @@ import { getScrollbarWidth as j, setScrollbarWidth as z } from "./scrollbarWidth
|
|
|
24
24
|
import { setter as Z } from "./setter.mjs";
|
|
25
25
|
import { FIELD_REGEX as Y, FOCUSABLE_ELEMENTS as q, FOCUSABLE_ELEMENTS_BASE as J, TABBABLE_ELEMENTS as Q } from "./constants/main.mjs";
|
|
26
26
|
import { extendDataItem as ee, getItemPath as oe, mapTree as re, mapTreeItem as te } from "./treeDataOperations.mjs";
|
|
27
|
-
import { shouldShowValidationUI as
|
|
27
|
+
import { shouldShowValidationUI as ae, validatePackage as se } from "./validate-package.mjs";
|
|
28
28
|
import { hasRelativeStackingContext as ne } from "./hasRelativeStackingContext.mjs";
|
|
29
29
|
import { WatermarkOverlay as xe } from "./watermark/WatermarkOverlay.mjs";
|
|
30
30
|
import { dispatchEvent as le } from "./events/dispatchEvent.mjs";
|
|
31
31
|
import { AsyncFocusBlur as de } from "./hocs/AsyncFocusBlur.mjs";
|
|
32
32
|
import { createPropsContext as Ie, withPropsContext as Ce } from "./hocs/withPropsContext.mjs";
|
|
33
33
|
import { withIdHOC as be } from "./hocs/use-id-hoc.mjs";
|
|
34
|
-
import { withUnstyledHOC as
|
|
34
|
+
import { withUnstyledHOC as De } from "./hocs/use-unstyled-hoc.mjs";
|
|
35
35
|
import { useDir as Pe } from "./hooks/useDir.mjs";
|
|
36
36
|
import { useAsyncFocusBlur as Se } from "./hooks/useAsyncFocusBlur.mjs";
|
|
37
37
|
import { useRtl as Be } from "./hooks/useRtl.mjs";
|
|
38
|
-
import { useMouse as
|
|
38
|
+
import { useMouse as ye } from "./hooks/useMouse.mjs";
|
|
39
39
|
import { useCustomComponent as Le } from "./hooks/useCustomComponent.mjs";
|
|
40
40
|
import { usePropsContext as we } from "./hooks/usePropsContext.mjs";
|
|
41
41
|
import { COLLECTION_ACTION as ke, useCollection as Oe } from "./hooks/useCollection.mjs";
|
|
@@ -49,37 +49,38 @@ import { IconWrap as qe } from "./icons/IconWrap.mjs";
|
|
|
49
49
|
import { IconsContext as Qe } from "./icons/IconsContext.mjs";
|
|
50
50
|
import { svgIconPropType as eo, toIconClass as oo, toIconName as ro } from "./icons/utils.mjs";
|
|
51
51
|
import { Typography as po } from "./typography/Typography.mjs";
|
|
52
|
-
import { DragAndDrop as
|
|
52
|
+
import { DragAndDrop as so } from "./drag-n-drop/index.mjs";
|
|
53
53
|
import { Draggable as no } from "./Draggable.mjs";
|
|
54
54
|
import { Droppable as xo } from "./Droppable.mjs";
|
|
55
55
|
import { useDraggable as lo } from "./hooks/useDraggable.mjs";
|
|
56
56
|
import { useDroppable as co } from "./hooks/useDroppable.mjs";
|
|
57
57
|
import { kendoThemeMaps as Co } from "./theme.mjs";
|
|
58
58
|
import { memoizeOne as bo } from "./memoize.mjs";
|
|
59
|
-
import { Navigation as
|
|
59
|
+
import { Navigation as Do } from "./navigation.mjs";
|
|
60
60
|
import { getActiveElement as Po, getInnerActiveElement as Ao } from "./getActiveElement.mjs";
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
61
|
+
import { applyDefaultProps as To } from "./apply-default-props.mjs";
|
|
62
|
+
import { TreeFieldsService as vo } from "./tree-utils/FieldsService.mjs";
|
|
63
|
+
import { SortedPublicItemIds as Fo } from "./tree-utils/SortedPublicItemIds.mjs";
|
|
64
|
+
import { addItem as Mo, areAllDirectChildrenChecked as wo, getAllDirectIndirectChildrenIds as No, getAllParents as ko, hasChildren as Oo, isEnabledAndAllParentsEnabled as Uo, isItemExpandedAndWithChildren as Ro, removeItem as Wo, resolveItemId as _o, resolveItemsIds as Go, updateItem as Ho } from "./tree-utils/itemUtils.mjs";
|
|
65
|
+
import { getNestedValue as jo, isArray as zo } from "./tree-utils/misc.mjs";
|
|
66
|
+
import { RowHeightService as Zo } from "./rowHeightService.mjs";
|
|
67
|
+
import { UnstyledContext as Yo, useUnstyled as qo } from "./unstyled/main.mjs";
|
|
68
|
+
import { uAnimation as Qo } from "./unstyled/animations.mjs";
|
|
69
|
+
import { uSvgIcon as er } from "./unstyled/icons.mjs";
|
|
70
|
+
import { uButton as rr, uButtonGroup as tr, uDropDownButton as pr } from "./unstyled/buttons.mjs";
|
|
71
|
+
import { uComboBox as sr, uDropDownList as mr, uDropDownsActionSheet as nr, uDropDownsBase as ir } from "./unstyled/dropdowns.mjs";
|
|
72
|
+
import { uCalendar as fr, uDateInput as lr, uDateTimePicker as ur, uTime as dr, uTimePicker as cr } from "./unstyled/dateinputs.mjs";
|
|
73
|
+
import { radioButtonClasses as Cr, radioGroupClasses as hr, uInput as br, uMaskedTextBox as gr, uRadioButton as Dr, uRadioGroup as Er, uTextBox as Pr } from "./unstyled/inputs.mjs";
|
|
74
|
+
import { uError as Sr, uFloatingLabel as Tr, uHint as Br, uLabel as vr } from "./unstyled/labels.mjs";
|
|
75
|
+
import { uForm as Fr } from "./unstyled/form.mjs";
|
|
76
|
+
import { uPopup as Mr } from "./unstyled/popup.mjs";
|
|
77
|
+
import { uGrid as Nr } from "./unstyled/grid.mjs";
|
|
78
|
+
import { actions as Or, animationStyles as Ur, base as Rr, buttonPrefix as Wr, calendarPrefix as _r, comboBoxPrefix as Gr, components as Hr, containers as Vr, cssUtils as jr, cursor as zr, dateInputs as Kr, ddbPrefix as Zr, dimensions as Xr, directionMap as Yr, dropDownListPrefix as qr, elements as Jr, fillModeMap as Qr, forms as $r, grid as et, gridPrefix as ot, icon as rt, inputPrefix as tt, inputs as pt, jsonTheme as at, labels as st, maskedPrefix as mt, orientationMap as nt, pickerPrefix as it, popup as xt, radioPrefix as ft, roundedMap as lt, sizeMap as ut, states as dt, themeColorMap as ct } from "./unstyled/json-classes.mjs";
|
|
78
79
|
export {
|
|
79
80
|
de as AsyncFocusBlur,
|
|
80
|
-
|
|
81
|
+
s as BrowserSupportService,
|
|
81
82
|
ke as COLLECTION_ACTION,
|
|
82
|
-
|
|
83
|
+
so as DragAndDrop,
|
|
83
84
|
no as Draggable,
|
|
84
85
|
xo as Droppable,
|
|
85
86
|
Y as FIELD_REGEX,
|
|
@@ -91,24 +92,25 @@ export {
|
|
|
91
92
|
Qe as IconsContext,
|
|
92
93
|
W as KEYS,
|
|
93
94
|
_ as Keys,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
Do as Navigation,
|
|
96
|
+
Zo as RowHeightService,
|
|
97
|
+
Fo as SortedPublicItemIds,
|
|
97
98
|
Xe as SvgIcon,
|
|
98
99
|
Q as TABBABLE_ELEMENTS,
|
|
99
|
-
|
|
100
|
+
vo as TreeFieldsService,
|
|
100
101
|
po as Typography,
|
|
101
|
-
|
|
102
|
+
Yo as UnstyledContext,
|
|
102
103
|
xe as WatermarkOverlay,
|
|
103
104
|
t as ZIndexContext,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
Or as actions,
|
|
106
|
+
Mo as addItem,
|
|
107
|
+
Ur as animationStyles,
|
|
108
|
+
To as applyDefaultProps,
|
|
109
|
+
D as applyTrappedFocus,
|
|
110
|
+
wo as areAllDirectChildrenChecked,
|
|
111
|
+
Rr as base,
|
|
112
|
+
Wr as buttonPrefix,
|
|
113
|
+
_r as calendarPrefix,
|
|
112
114
|
n as canUseDOM,
|
|
113
115
|
x as canUseRef,
|
|
114
116
|
l as classNames,
|
|
@@ -117,106 +119,106 @@ export {
|
|
|
117
119
|
C as cloneDate,
|
|
118
120
|
h as cloneObject,
|
|
119
121
|
b as cloneValue,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
Gr as comboBoxPrefix,
|
|
123
|
+
Hr as components,
|
|
124
|
+
Vr as containers,
|
|
123
125
|
Ie as createPropsContext,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
jr as cssUtils,
|
|
127
|
+
zr as cursor,
|
|
128
|
+
Kr as dateInputs,
|
|
129
|
+
Zr as ddbPrefix,
|
|
130
|
+
Xr as dimensions,
|
|
131
|
+
Yr as directionMap,
|
|
132
|
+
E as disableNavigatableContainer,
|
|
131
133
|
le as dispatchEvent,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
qr as dropDownListPrefix,
|
|
135
|
+
Jr as elements,
|
|
134
136
|
P as enableNavigatableContainer,
|
|
135
137
|
ee as extendDataItem,
|
|
136
|
-
|
|
138
|
+
Qr as fillModeMap,
|
|
137
139
|
A as firstFocusableChild,
|
|
138
140
|
S as focusFirstFocusableChild,
|
|
139
141
|
T as focusLastFocusableChild,
|
|
140
142
|
B as focusableChildren,
|
|
141
|
-
|
|
143
|
+
$r as forms,
|
|
142
144
|
Po as getActiveElement,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
No as getAllDirectIndirectChildrenIds,
|
|
146
|
+
ko as getAllParents,
|
|
145
147
|
Ao as getInnerActiveElement,
|
|
146
148
|
oe as getItemPath,
|
|
147
|
-
|
|
149
|
+
jo as getNestedValue,
|
|
148
150
|
j as getScrollbarWidth,
|
|
149
151
|
w as getTabIndex,
|
|
150
152
|
k as getter,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
et as grid,
|
|
154
|
+
ot as gridPrefix,
|
|
153
155
|
U as guid,
|
|
154
|
-
|
|
156
|
+
Oo as hasChildren,
|
|
155
157
|
ne as hasRelativeStackingContext,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
rt as icon,
|
|
159
|
+
tt as inputPrefix,
|
|
160
|
+
pt as inputs,
|
|
161
|
+
zo as isArray,
|
|
162
|
+
Uo as isEnabledAndAllParentsEnabled,
|
|
163
|
+
Ro as isItemExpandedAndWithChildren,
|
|
164
|
+
at as jsonTheme,
|
|
163
165
|
v as keepFocusInContainer,
|
|
164
166
|
Co as kendoThemeMaps,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
st as labels,
|
|
168
|
+
y as lastFocusableChild,
|
|
167
169
|
re as mapTree,
|
|
168
170
|
te as mapTreeItem,
|
|
169
|
-
|
|
171
|
+
mt as maskedPrefix,
|
|
170
172
|
bo as memoizeOne,
|
|
171
173
|
H as noop,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
nt as orientationMap,
|
|
175
|
+
it as pickerPrefix,
|
|
176
|
+
xt as popup,
|
|
177
|
+
Cr as radioButtonClasses,
|
|
178
|
+
hr as radioGroupClasses,
|
|
179
|
+
ft as radioPrefix,
|
|
180
|
+
Wo as removeItem,
|
|
181
|
+
_o as resolveItemId,
|
|
182
|
+
Go as resolveItemsIds,
|
|
183
|
+
lt as roundedMap,
|
|
182
184
|
z as setScrollbarWidth,
|
|
183
185
|
Z as setter,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
ae as shouldShowValidationUI,
|
|
187
|
+
ut as sizeMap,
|
|
188
|
+
dt as states,
|
|
187
189
|
u as strippedClassNames,
|
|
188
190
|
eo as svgIconPropType,
|
|
189
|
-
|
|
191
|
+
ct as themeColorMap,
|
|
190
192
|
oo as toIconClass,
|
|
191
193
|
ro as toIconName,
|
|
192
194
|
e as treeIdUtils,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
195
|
+
Qo as uAnimation,
|
|
196
|
+
rr as uButton,
|
|
197
|
+
tr as uButtonGroup,
|
|
198
|
+
fr as uCalendar,
|
|
199
|
+
sr as uComboBox,
|
|
200
|
+
lr as uDateInput,
|
|
201
|
+
ur as uDateTimePicker,
|
|
202
|
+
pr as uDropDownButton,
|
|
203
|
+
mr as uDropDownList,
|
|
204
|
+
nr as uDropDownsActionSheet,
|
|
205
|
+
ir as uDropDownsBase,
|
|
206
|
+
Sr as uError,
|
|
207
|
+
Tr as uFloatingLabel,
|
|
208
|
+
Fr as uForm,
|
|
209
|
+
Nr as uGrid,
|
|
210
|
+
Br as uHint,
|
|
211
|
+
br as uInput,
|
|
212
|
+
vr as uLabel,
|
|
213
|
+
gr as uMaskedTextBox,
|
|
214
|
+
Mr as uPopup,
|
|
215
|
+
Dr as uRadioButton,
|
|
216
|
+
Er as uRadioGroup,
|
|
217
|
+
er as uSvgIcon,
|
|
218
|
+
Pr as uTextBox,
|
|
219
|
+
dr as uTime,
|
|
220
|
+
cr as uTimePicker,
|
|
221
|
+
Ho as updateItem,
|
|
220
222
|
Se as useAsyncFocusBlur,
|
|
221
223
|
Oe as useCollection,
|
|
222
224
|
Le as useCustomComponent,
|
|
@@ -226,14 +228,14 @@ export {
|
|
|
226
228
|
co as useDroppable,
|
|
227
229
|
He as useId,
|
|
228
230
|
je as useIsomorphicLayoutEffect,
|
|
229
|
-
|
|
231
|
+
ye as useMouse,
|
|
230
232
|
we as usePropsContext,
|
|
231
233
|
Be as useRtl,
|
|
232
|
-
|
|
234
|
+
qo as useUnstyled,
|
|
233
235
|
_e as useWindow,
|
|
234
236
|
p as useZIndexContext,
|
|
235
|
-
|
|
237
|
+
se as validatePackage,
|
|
236
238
|
be as withIdHOC,
|
|
237
239
|
Ce as withPropsContext,
|
|
238
|
-
|
|
240
|
+
De as withUnstyledHOC
|
|
239
241
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-common",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.10",
|
|
4
4
|
"description": "React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/trappedFocus.mjs
CHANGED
|
@@ -45,18 +45,12 @@ const c = (s, f = u) => s.querySelectorAll(f.join(",")), l = (s, f = u) => {
|
|
|
45
45
|
e(f, o);
|
|
46
46
|
}, 1)) : s.keyCode === r.esc ? (i = !1, f.focus()) : n(s, f, o), t && t(i);
|
|
47
47
|
}, g = (s, f) => {
|
|
48
|
-
const t = c(
|
|
49
|
-
s,
|
|
50
|
-
f
|
|
51
|
-
);
|
|
48
|
+
const t = c(s, f);
|
|
52
49
|
t && t.forEach((o) => {
|
|
53
50
|
o.tabIndex = 0;
|
|
54
51
|
});
|
|
55
52
|
}, y = (s, f) => {
|
|
56
|
-
const t = c(
|
|
57
|
-
s,
|
|
58
|
-
f
|
|
59
|
-
);
|
|
53
|
+
const t = c(s, f);
|
|
60
54
|
t && t.forEach((o) => {
|
|
61
55
|
o.tabIndex = -1;
|
|
62
56
|
});
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u="",l="0",
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u="",l="0",e="_";function I(t,r,s){if(E(t))return r[Number(t)];const n=r[Number(c(t))],o=n&&n[s]||[];return o.length?I(g(t),o,s):void 0}function c(t){return a(t)?t:t.split(e)[0]}function g(t){if(a(t))return t;const r=t.indexOf(e);return t.substring(r+1)}function d(t){return S("0",t)}function S(t,r){return t=t.toString(),r?r+e+t:t}function b(t){const r=t.lastIndexOf(e);return r<0?u:t.substring(0,r)}function a(t){return t===u||t.indexOf(e)<0}function E(t){return t!==u&&t.indexOf(e)<0}function P(t){return t.split(e)}function f(t){const r=t.lastIndexOf(e);return r<0?t:t.substring(r+1)}function R(t){return f(t)===l}function h(t,r){const s=r;t="r"+e+t,r="r"+e+r;const n=b(t)+e;if(r.startsWith(n)){const o=r.substring(n.length);if(o){const i=c(o);if(Number(f(t))<Number(i)){const O=n+(Number(i)-1).toString()+o.substring(i.length);return g(O)}}}return s}exports.EMPTY_ID=u;exports.SEPARATOR=e;exports.ZERO_LEVEL_ZERO_NODE_ID=l;exports.createId=S;exports.getAllShortIds=P;exports.getDecrementedItemIdAfterRemoval=h;exports.getDirectParentId=b;exports.getFirstChildId=d;exports.getIdWithoutRootParentId=g;exports.getItemById=I;exports.getRootParentId=c;exports.getShortId=f;exports.isIdEmptyOrZeroLevel=a;exports.isIdZeroLevel=E;exports.isItemFirstFromSiblings=R;
|
|
@@ -6,14 +6,12 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
const c = "",
|
|
10
|
-
function S(t, n,
|
|
9
|
+
const c = "", l = "0", r = "_";
|
|
10
|
+
function S(t, n, s) {
|
|
11
11
|
if (x(t))
|
|
12
12
|
return n[Number(t)];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return s.length ? S(i(t), s, o) : void 0;
|
|
16
|
-
}
|
|
13
|
+
const e = n[Number(f(t))], o = e && e[s] || [];
|
|
14
|
+
return o.length ? S(i(t), o, s) : void 0;
|
|
17
15
|
}
|
|
18
16
|
function f(t) {
|
|
19
17
|
return a(t) ? t : t.split(r)[0];
|
|
@@ -21,10 +19,8 @@ function f(t) {
|
|
|
21
19
|
function i(t) {
|
|
22
20
|
if (a(t))
|
|
23
21
|
return t;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return t.substring(n + 1);
|
|
27
|
-
}
|
|
22
|
+
const n = t.indexOf(r);
|
|
23
|
+
return t.substring(n + 1);
|
|
28
24
|
}
|
|
29
25
|
function E(t) {
|
|
30
26
|
return O("0", t);
|
|
@@ -50,28 +46,28 @@ function g(t) {
|
|
|
50
46
|
return n < 0 ? t : t.substring(n + 1);
|
|
51
47
|
}
|
|
52
48
|
function p(t) {
|
|
53
|
-
return g(t) ===
|
|
49
|
+
return g(t) === l;
|
|
54
50
|
}
|
|
55
51
|
function N(t, n) {
|
|
56
|
-
const
|
|
52
|
+
const s = n;
|
|
57
53
|
t = "r" + r + t, n = "r" + r + n;
|
|
58
54
|
const e = h(t) + r;
|
|
59
55
|
if (n.startsWith(e)) {
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
const u = f(
|
|
56
|
+
const o = n.substring(e.length);
|
|
57
|
+
if (o) {
|
|
58
|
+
const u = f(o);
|
|
63
59
|
if (Number(g(t)) < Number(u)) {
|
|
64
|
-
const
|
|
65
|
-
return i(
|
|
60
|
+
const b = e + (Number(u) - 1).toString() + o.substring(u.length);
|
|
61
|
+
return i(b);
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
|
-
return
|
|
65
|
+
return s;
|
|
70
66
|
}
|
|
71
67
|
export {
|
|
72
68
|
c as EMPTY_ID,
|
|
73
69
|
r as SEPARATOR,
|
|
74
|
-
|
|
70
|
+
l as ZERO_LEVEL_ZERO_NODE_ID,
|
|
75
71
|
O as createId,
|
|
76
72
|
P as getAllShortIds,
|
|
77
73
|
N as getDecrementedItemIdAfterRemoval,
|
package/tree-utils/itemUtils.mjs
CHANGED
|
@@ -9,98 +9,123 @@
|
|
|
9
9
|
import { getRootParentId as h, isIdZeroLevel as I, getIdWithoutRootParentId as b, getAllShortIds as p, createId as g, EMPTY_ID as C } from "./itemIdUtils.mjs";
|
|
10
10
|
import { SortedPublicItemIds as x } from "./SortedPublicItemIds.mjs";
|
|
11
11
|
import { getNestedValue as i } from "./misc.mjs";
|
|
12
|
-
function P(t,
|
|
13
|
-
const e = i(
|
|
12
|
+
function P(t, o) {
|
|
13
|
+
const e = i(o, t);
|
|
14
14
|
return !!(e && e.length);
|
|
15
15
|
}
|
|
16
|
-
function O(t,
|
|
17
|
-
return
|
|
16
|
+
function O(t, o) {
|
|
17
|
+
return o.expanded(t) && P(t, o.getChildrenField());
|
|
18
18
|
}
|
|
19
|
-
function R(t,
|
|
20
|
-
const u = A([t],
|
|
19
|
+
function R(t, o, e, n) {
|
|
20
|
+
const u = A([t], o, e, n);
|
|
21
21
|
return u.length ? u[0] : void 0;
|
|
22
22
|
}
|
|
23
|
-
function A(t,
|
|
23
|
+
function A(t, o, e, n) {
|
|
24
24
|
const u = [], r = new x();
|
|
25
|
-
return r.init(t), N(r,
|
|
25
|
+
return r.init(t), N(r, o, e, C, u, n), u;
|
|
26
26
|
}
|
|
27
|
-
function d(t,
|
|
28
|
-
const r = Number(h(
|
|
27
|
+
function d(t, o, e, n, u) {
|
|
28
|
+
const r = Number(h(o));
|
|
29
29
|
if (r >= t.length)
|
|
30
30
|
return t;
|
|
31
|
-
let
|
|
32
|
-
return c[n] || (
|
|
31
|
+
let s = t, c = t[r];
|
|
32
|
+
return c[n] || (s = t.slice(), c = s[r] = Object.assign({}, c, { [n]: !0 })), I(o) ? e(c) : c[u] && (c[u] = d(
|
|
33
|
+
c[u],
|
|
34
|
+
b(o),
|
|
35
|
+
e,
|
|
36
|
+
n,
|
|
37
|
+
u
|
|
38
|
+
)), s;
|
|
33
39
|
}
|
|
34
|
-
function W(t,
|
|
40
|
+
function W(t, o, e) {
|
|
35
41
|
const n = p(t);
|
|
36
|
-
let u =
|
|
42
|
+
let u = o;
|
|
37
43
|
for (let r = 0; r < n.length; r++) {
|
|
38
|
-
const
|
|
39
|
-
if (e.disabled(
|
|
44
|
+
const s = u[Number(n[r])];
|
|
45
|
+
if (e.disabled(s))
|
|
40
46
|
return !1;
|
|
41
|
-
u =
|
|
47
|
+
u = s[e.getChildrenField()];
|
|
42
48
|
}
|
|
43
49
|
return !0;
|
|
44
50
|
}
|
|
45
|
-
function j(t,
|
|
46
|
-
return n ? r(t) : u(t,
|
|
47
|
-
function u(
|
|
51
|
+
function j(t, o, e, n) {
|
|
52
|
+
return n ? r(t) : u(t, o);
|
|
53
|
+
function u(s, c) {
|
|
48
54
|
let l = [];
|
|
49
|
-
const f =
|
|
55
|
+
const f = s[e] || [];
|
|
50
56
|
for (let a = 0; a < f.length; a++) {
|
|
51
57
|
const m = g(a, c);
|
|
52
58
|
l.push(m), l = l.concat(u(f[a], m));
|
|
53
59
|
}
|
|
54
60
|
return l;
|
|
55
61
|
}
|
|
56
|
-
function r(
|
|
62
|
+
function r(s) {
|
|
57
63
|
let c = [];
|
|
58
|
-
const l =
|
|
64
|
+
const l = s[e] || [];
|
|
59
65
|
for (let f = 0; f < l.length; f++)
|
|
60
66
|
c.push(i(n, l[f])), c = c.concat(r(l[f]));
|
|
61
67
|
return c;
|
|
62
68
|
}
|
|
63
69
|
}
|
|
64
|
-
function w(t,
|
|
65
|
-
return (t[n] || []).every(
|
|
70
|
+
function w(t, o, e, n, u) {
|
|
71
|
+
return (t[n] || []).every(
|
|
72
|
+
(s, c) => u.indexOf(e ? i(e, s) : g(c, o)) > -1
|
|
73
|
+
);
|
|
66
74
|
}
|
|
67
|
-
function y(t,
|
|
75
|
+
function y(t, o, e) {
|
|
68
76
|
const n = [], u = p(t);
|
|
69
77
|
let r = e;
|
|
70
|
-
for (let
|
|
71
|
-
const c = r[Number(u[
|
|
72
|
-
n.push(c), r = c[
|
|
78
|
+
for (let s = 0; s < u.length - 1 && r; s++) {
|
|
79
|
+
const c = r[Number(u[s])];
|
|
80
|
+
n.push(c), r = c[o];
|
|
73
81
|
}
|
|
74
82
|
return n;
|
|
75
83
|
}
|
|
76
|
-
function v(t,
|
|
84
|
+
function v(t, o, e) {
|
|
77
85
|
const n = e.slice();
|
|
78
86
|
if (I(t))
|
|
79
87
|
n.splice(Number(t), 1);
|
|
80
88
|
else {
|
|
81
89
|
const u = Number(h(t)), r = n[u] = { ...n[u] };
|
|
82
|
-
r[
|
|
90
|
+
r[o] = v(
|
|
91
|
+
b(t),
|
|
92
|
+
o,
|
|
93
|
+
r[o]
|
|
94
|
+
);
|
|
83
95
|
}
|
|
84
96
|
return n;
|
|
85
97
|
}
|
|
86
|
-
function E(t,
|
|
98
|
+
function E(t, o, e, n, u) {
|
|
87
99
|
const r = u.slice();
|
|
88
100
|
if (I(n))
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
101
|
+
if (o === "child") {
|
|
102
|
+
const s = r[Number(n)] = { ...r[Number(n)] };
|
|
103
|
+
s[e] ? (s[e] = s[e].slice(), s[e].push(t)) : s[e] = [t];
|
|
92
104
|
} else
|
|
93
|
-
r.splice(Number(n) + (
|
|
105
|
+
r.splice(Number(n) + (o === "after" ? 1 : 0), 0, t);
|
|
94
106
|
else {
|
|
95
|
-
const
|
|
96
|
-
c[e] = E(
|
|
107
|
+
const s = Number(h(n)), c = r[s] = { ...r[s] };
|
|
108
|
+
c[e] = E(
|
|
109
|
+
t,
|
|
110
|
+
o,
|
|
111
|
+
e,
|
|
112
|
+
b(n),
|
|
113
|
+
c[e]
|
|
114
|
+
);
|
|
97
115
|
}
|
|
98
116
|
return r;
|
|
99
117
|
}
|
|
100
|
-
function N(t,
|
|
101
|
-
for (let
|
|
102
|
-
const c = e[
|
|
103
|
-
t.hasId(i(
|
|
118
|
+
function N(t, o, e, n, u, r) {
|
|
119
|
+
for (let s = 0; s < e.length; s++) {
|
|
120
|
+
const c = e[s], l = g(s, n);
|
|
121
|
+
t.hasId(i(o, c)) && u.push(l), P(c, r) && N(
|
|
122
|
+
t,
|
|
123
|
+
o,
|
|
124
|
+
i(r, c),
|
|
125
|
+
l,
|
|
126
|
+
u,
|
|
127
|
+
r
|
|
128
|
+
);
|
|
104
129
|
}
|
|
105
130
|
}
|
|
106
131
|
export {
|
package/treeDataOperations.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(n,
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function g(t,n,e){return e?{...t,[n]:e.length?[...e]:void 0}:t&&t[n]?[...t[n]]:[]}function s(t,n,e){if(t[n]){const o=g(t,n).map(r=>s(r,n,e));return e(g(t,n,o))}return e(t)}const i=(t,n,e)=>[...t.map(o=>s(o,n,e))],u=(t,n,e,o)=>{let r=t;const c=[];for(let h=0;h<n.length;h++)r=r[n[h]],r=Array.isArray(r)?r:r[e],c.push(r);const p=c.length>1?c[c.length-2]:t,a=n[n.length-1],f=o(p[a]);p.splice(a,1,f)},T=(t,n,e)=>Object.assign({},t,t[n]?{[n]:t[n].slice()}:{},e||{}),y=(t,n,e)=>{const o=[],r=[...n];if(r.length){let c=t[r.shift()||0];for(o.push(c);r.length&&e;)c=c[e][r.shift()||0],o.push(c)}return o};exports.extendDataItem=T;exports.getItemPath=y;exports.mapTree=i;exports.mapTreeItem=u;
|