@iowas/toolpad 1.0.3 → 1.0.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/dist/AppProvider-CIyOzZv_.d.mts +201 -0
- package/dist/AppProvider-CIyOzZv_.d.ts +201 -0
- package/dist/{chunk-6JQJK2JX.mjs → chunk-3JWXE2JW.mjs} +5 -26
- package/dist/chunk-5B2NQDIH.js +145 -0
- package/dist/chunk-BN55HN4U.js +12 -0
- package/dist/chunk-F6JD4MSY.mjs +10 -0
- package/dist/chunk-LUTZBKSG.mjs +636 -0
- package/dist/chunk-PMIWCP25.mjs +4 -19
- package/dist/chunk-SITC3EZQ.js +2225 -0
- package/dist/chunk-SWAF5R4Y.js +686 -0
- package/dist/chunk-VMBNHIHN.js +84 -0
- package/dist/{chunk-IDMYUY7L.mjs → chunk-ZXM3V5SD.mjs} +456 -1325
- package/dist/core.d.mts +4 -198
- package/dist/core.d.ts +4 -198
- package/dist/core.js +126 -3100
- package/dist/core.mjs +4 -69
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +195 -3260
- package/dist/index.mjs +5 -106
- package/dist/nextjs.d.mts +3 -157
- package/dist/nextjs.d.ts +3 -157
- package/dist/nextjs.js +38 -772
- package/dist/nextjs.mjs +15 -747
- package/dist/utils.js +71 -213
- package/dist/utils.mjs +3 -40
- package/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -1,218 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
asArray: () => asArray,
|
|
34
|
-
createGlobalState: () => createGlobalState,
|
|
35
|
-
createProvidedContext: () => createProvidedContext,
|
|
36
|
-
equalProperties: () => equalProperties,
|
|
37
|
-
filterKeys: () => filterKeys,
|
|
38
|
-
filterValues: () => filterValues,
|
|
39
|
-
hasOwnProperty: () => hasOwnProperty,
|
|
40
|
-
interleave: () => interleave,
|
|
41
|
-
mapKeys: () => mapKeys,
|
|
42
|
-
mapProperties: () => mapProperties,
|
|
43
|
-
mapValues: () => mapValues,
|
|
44
|
-
useAssertedContext: () => useAssertedContext,
|
|
45
|
-
useBoolean: () => useBoolean,
|
|
46
|
-
useNonNullableContext: () => useNonNullableContext,
|
|
47
|
-
usePageTitle: () => usePageTitle,
|
|
48
|
-
useTraceUpdates: () => useTraceUpdates,
|
|
49
|
-
warnOnce: () => warnOnce
|
|
50
|
-
});
|
|
51
|
-
module.exports = __toCommonJS(utils_exports);
|
|
3
|
+
var chunkVMBNHIHN_js = require('./chunk-VMBNHIHN.js');
|
|
4
|
+
var chunkBN55HN4U_js = require('./chunk-BN55HN4U.js');
|
|
5
|
+
var chunk5B2NQDIH_js = require('./chunk-5B2NQDIH.js');
|
|
52
6
|
|
|
53
|
-
// src/toolpad-utils/collections.ts
|
|
54
|
-
function asArray(maybeArray) {
|
|
55
|
-
return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
|
|
56
|
-
}
|
|
57
|
-
function hasOwnProperty(obj, prop) {
|
|
58
|
-
return obj.hasOwnProperty(prop);
|
|
59
|
-
}
|
|
60
|
-
function mapProperties(obj, mapper) {
|
|
61
|
-
return Object.fromEntries(
|
|
62
|
-
Object.entries(obj).flatMap((entry) => {
|
|
63
|
-
const mapped = mapper(entry);
|
|
64
|
-
return mapped ? [mapped] : [];
|
|
65
|
-
})
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
function mapKeys(obj, mapper) {
|
|
69
|
-
return mapProperties(obj, ([key, value]) => [mapper(key), value]);
|
|
70
|
-
}
|
|
71
|
-
function mapValues(obj, mapper) {
|
|
72
|
-
return mapProperties(obj, ([key, value]) => [key, mapper(value, key)]);
|
|
73
|
-
}
|
|
74
|
-
function filterValues(obj, filter) {
|
|
75
|
-
return mapProperties(obj, ([key, value]) => filter(value) ? [key, value] : null);
|
|
76
|
-
}
|
|
77
|
-
function filterKeys(obj, filter) {
|
|
78
|
-
return mapProperties(obj, ([key, value]) => filter(key) ? [key, value] : null);
|
|
79
|
-
}
|
|
80
|
-
function equalProperties(obj1, obj2, subset) {
|
|
81
|
-
const keysToCheck = new Set(
|
|
82
|
-
subset != null ? subset : [...Object.keys(obj1), ...Object.keys(obj2)]
|
|
83
|
-
);
|
|
84
|
-
return Array.from(keysToCheck).every((key) => Object.is(obj1[key], obj2[key]));
|
|
85
|
-
}
|
|
86
7
|
|
|
87
|
-
// src/toolpad-utils/react.tsx
|
|
88
|
-
var React = __toESM(require("react"));
|
|
89
|
-
var ReactIs = __toESM(require("react-is"));
|
|
90
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
91
|
-
function interleave(items, separator) {
|
|
92
|
-
const result = [];
|
|
93
|
-
for (let i = 0; i < items.length; i += 1) {
|
|
94
|
-
if (i > 0) {
|
|
95
|
-
if (ReactIs.isElement(separator)) {
|
|
96
|
-
result.push(React.cloneElement(separator, { key: `separator-${i}` }));
|
|
97
|
-
} else {
|
|
98
|
-
result.push(separator);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const item = items[i];
|
|
102
|
-
result.push(item);
|
|
103
|
-
}
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(React.Fragment, { children: result });
|
|
105
|
-
}
|
|
106
|
-
function useNonNullableContext(context, name) {
|
|
107
|
-
const maybeContext = React.useContext(context);
|
|
108
|
-
if (maybeContext === null || maybeContext === void 0) {
|
|
109
|
-
throw new Error(`context "${name}" was used without a Provider`);
|
|
110
|
-
}
|
|
111
|
-
return maybeContext;
|
|
112
|
-
}
|
|
113
|
-
function createProvidedContext(name) {
|
|
114
|
-
const context = React.createContext(void 0);
|
|
115
|
-
const useContext2 = () => useNonNullableContext(context, name);
|
|
116
|
-
return [useContext2, context.Provider];
|
|
117
|
-
}
|
|
118
|
-
function useAssertedContext(context) {
|
|
119
|
-
const value = React.useContext(context);
|
|
120
|
-
if (value === void 0) {
|
|
121
|
-
throw new Error("context was used without a Provider");
|
|
122
|
-
}
|
|
123
|
-
return value;
|
|
124
|
-
}
|
|
125
|
-
function useTraceUpdates(prefix, props) {
|
|
126
|
-
const prev = React.useRef(props);
|
|
127
|
-
React.useEffect(() => {
|
|
128
|
-
const changedProps = {};
|
|
129
|
-
for (const key of Object.keys(props)) {
|
|
130
|
-
if (!Object.is(prev.current[key], props[key])) {
|
|
131
|
-
changedProps[key] = props[key];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (Object.keys(changedProps).length > 0) {
|
|
135
|
-
console.log(`${prefix} changed props:`, changedProps);
|
|
136
|
-
}
|
|
137
|
-
prev.current = props;
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
function createGlobalState(initialState) {
|
|
141
|
-
let state = initialState;
|
|
142
|
-
const listeners = [];
|
|
143
|
-
const subscribe = (cb) => {
|
|
144
|
-
listeners.push(cb);
|
|
145
|
-
return () => {
|
|
146
|
-
const index = listeners.indexOf(cb);
|
|
147
|
-
listeners.splice(index, 1);
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
const getState = () => state;
|
|
151
|
-
const setState = (newState) => {
|
|
152
|
-
state = typeof newState === "function" ? newState(state) : newState;
|
|
153
|
-
listeners.forEach((cb) => cb(state));
|
|
154
|
-
};
|
|
155
|
-
const useValue = () => React.useSyncExternalStore(subscribe, getState, getState);
|
|
156
|
-
const useState2 = () => {
|
|
157
|
-
const value = useValue();
|
|
158
|
-
return [value, setState];
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
getState,
|
|
162
|
-
setState,
|
|
163
|
-
useValue,
|
|
164
|
-
useState: useState2,
|
|
165
|
-
subscribe
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
8
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
function
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
9
|
+
Object.defineProperty(exports, "asArray", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkVMBNHIHN_js.asArray; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "equalProperties", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkVMBNHIHN_js.equalProperties; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "filterKeys", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkVMBNHIHN_js.filterKeys; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "filterValues", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkVMBNHIHN_js.filterValues; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "hasOwnProperty", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkVMBNHIHN_js.hasOwnProperty; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "mapKeys", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkVMBNHIHN_js.mapKeys; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "mapProperties", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkVMBNHIHN_js.mapProperties; }
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "mapValues", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () { return chunkVMBNHIHN_js.mapValues; }
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "useBoolean", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () { return chunkVMBNHIHN_js.useBoolean; }
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "usePageTitle", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () { return chunkVMBNHIHN_js.usePageTitle; }
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "warnOnce", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () { return chunkBN55HN4U_js.warnOnce; }
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "createGlobalState", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: function () { return chunk5B2NQDIH_js.createGlobalState; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "createProvidedContext", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return chunk5B2NQDIH_js.createProvidedContext; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "interleave", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return chunk5B2NQDIH_js.interleave; }
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "useAssertedContext", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () { return chunk5B2NQDIH_js.useAssertedContext; }
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "useNonNullableContext", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () { return chunk5B2NQDIH_js.useNonNullableContext; }
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "useTraceUpdates", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return chunk5B2NQDIH_js.useTraceUpdates; }
|
|
218
76
|
});
|
package/dist/utils.mjs
CHANGED
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
filterKeys,
|
|
5
|
-
filterValues,
|
|
6
|
-
hasOwnProperty,
|
|
7
|
-
mapKeys,
|
|
8
|
-
mapProperties,
|
|
9
|
-
mapValues,
|
|
10
|
-
useBoolean,
|
|
11
|
-
usePageTitle
|
|
12
|
-
} from "./chunk-PMIWCP25.mjs";
|
|
13
|
-
import {
|
|
14
|
-
createGlobalState,
|
|
15
|
-
createProvidedContext,
|
|
16
|
-
interleave,
|
|
17
|
-
useAssertedContext,
|
|
18
|
-
useNonNullableContext,
|
|
19
|
-
useTraceUpdates,
|
|
20
|
-
warnOnce
|
|
21
|
-
} from "./chunk-6JQJK2JX.mjs";
|
|
22
|
-
export {
|
|
23
|
-
asArray,
|
|
24
|
-
createGlobalState,
|
|
25
|
-
createProvidedContext,
|
|
26
|
-
equalProperties,
|
|
27
|
-
filterKeys,
|
|
28
|
-
filterValues,
|
|
29
|
-
hasOwnProperty,
|
|
30
|
-
interleave,
|
|
31
|
-
mapKeys,
|
|
32
|
-
mapProperties,
|
|
33
|
-
mapValues,
|
|
34
|
-
useAssertedContext,
|
|
35
|
-
useBoolean,
|
|
36
|
-
useNonNullableContext,
|
|
37
|
-
usePageTitle,
|
|
38
|
-
useTraceUpdates,
|
|
39
|
-
warnOnce
|
|
40
|
-
};
|
|
1
|
+
export { asArray, equalProperties, filterKeys, filterValues, hasOwnProperty, mapKeys, mapProperties, mapValues, useBoolean, usePageTitle } from './chunk-PMIWCP25.mjs';
|
|
2
|
+
export { warnOnce } from './chunk-F6JD4MSY.mjs';
|
|
3
|
+
export { createGlobalState, createProvidedContext, interleave, useAssertedContext, useNonNullableContext, useTraceUpdates } from './chunk-3JWXE2JW.mjs';
|