dynamic-mui 2.1.0 → 2.2.0
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/README.md +218 -37
- package/dist/AxisSharedComponents-BbsKw1BT.js +3 -0
- package/dist/AxisSharedComponents-xLtpOLH_.mjs +605 -0
- package/dist/ChartsAxis-CANvBdY9.mjs +47 -0
- package/dist/ChartsAxis-EZ7m_KrU.js +1 -0
- package/dist/ChartsGrid-BCRTvNTr.js +3 -0
- package/dist/ChartsGrid-C_HT7qpL.mjs +381 -0
- package/dist/ChartsWrapper-CM7EDyAK.js +5 -0
- package/dist/ChartsWrapper-CO5_Z6BD.mjs +1878 -0
- package/dist/ChartsXAxis-CPmuCRhq.mjs +487 -0
- package/dist/ChartsXAxis-DFFY1sPg.js +3 -0
- package/dist/ChartsYAxis-DLUMr9vG.mjs +392 -0
- package/dist/ChartsYAxis-fpevi1sP.js +1 -0
- package/dist/clampAngle-BvZjnf53.mjs +11 -0
- package/dist/clampAngle-DpAsDoeT.js +1 -0
- package/dist/components/FormGenerator.d.ts +33 -1
- package/dist/components/controls/AsyncAutocomplete/asyncautocomplete.d.ts +9 -0
- package/dist/components/controls/CheckBox/checkbox.d.ts +1 -1
- package/dist/components/controls/ChipSelect/chipselect.d.ts +1 -1
- package/dist/components/controls/EditableTable/editabletable.d.ts +2 -0
- package/dist/components/controls/IntlPhone/intlphone.d.ts +2 -0
- package/dist/components/controls/LocationField/locationfield.d.ts +1 -1
- package/dist/components/controls/MultiTextbox/multitextbox.d.ts +1 -1
- package/dist/components/controls/NpsScale/npsscale.d.ts +3 -0
- package/dist/components/controls/NumberField/numberfield.d.ts +1 -1
- package/dist/components/controls/PasswordField/passwordfield.d.ts +1 -1
- package/dist/components/controls/Radio/radio.d.ts +1 -1
- package/dist/components/controls/RichTextEditor/richtexteditor.d.ts +3 -0
- package/dist/components/controls/Select/select.d.ts +1 -1
- package/dist/components/controls/Switch/switch.d.ts +1 -1
- package/dist/components/controls/TextField/textfield.d.ts +1 -1
- package/dist/components/controls/index.d.ts +10 -0
- package/dist/createSelector-B-9FwV16.mjs +430 -0
- package/dist/createSelector-f0oqn8Lr.js +7 -0
- package/dist/dynamic-mui.cjs.js +1 -469
- package/dist/dynamic-mui.es.js +20 -102548
- package/dist/index--8Zky9Oh.js +299 -0
- package/dist/index-6WTs1Xy_.js +1 -0
- package/dist/index-B1R1akM2.js +1 -0
- package/dist/index-B_KNUTjy.js +1 -0
- package/dist/index-BhaKvHkU.mjs +62051 -0
- package/dist/index-Bif92ima.js +1 -0
- package/dist/index-BnZOu8CL.js +1 -0
- package/dist/index-CDxpgRlR.mjs +7 -0
- package/dist/index-CThMfvtJ.mjs +2555 -0
- package/dist/index-CodJBIn6.mjs +1665 -0
- package/dist/index-CslPwsrf.mjs +4 -0
- package/dist/index-CuV0MQzZ.mjs +1173 -0
- package/dist/index-DSkYYZuW.mjs +4 -0
- package/dist/index-DU78_FiA.js +1 -0
- package/dist/index-D_mYhgJ0.js +10 -0
- package/dist/index-Dlimbnxj.mjs +2965 -0
- package/dist/index-in5z9hUb.js +133 -0
- package/dist/index-qUW7FnZ-.mjs +20540 -0
- package/dist/index.d.ts +3 -1
- package/dist/isDeepEqual-BHfPvf9U.mjs +393 -0
- package/dist/isDeepEqual-CqxZGVRk.js +1 -0
- package/dist/playground/DemoGallery.d.ts +6 -0
- package/dist/playground/Sidebar.d.ts +9 -1
- package/dist/playground/demoForms.d.ts +3 -0
- package/dist/playground/demoRecipes.d.ts +15 -0
- package/dist/playground/demoVariants.d.ts +11 -0
- package/dist/schema.d.ts +404 -0
- package/dist/theme/theme.d.ts +5 -0
- package/dist/types.d.ts +16 -0
- package/dist/useAxis-DSbfEtO7.js +3 -0
- package/dist/useAxis-SiNBMMWq.mjs +3010 -0
- package/dist/useChartContainerProps-Bl3hO-r1.mjs +5418 -0
- package/dist/useChartContainerProps-C_C_PZoi.js +12 -0
- package/dist/useItemHighlightedGetter-9CIwqsGj.js +1 -0
- package/dist/useItemHighlightedGetter-CTISrNdV.mjs +88 -0
- package/package.json +1 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
var x = (e, n, r) => {
|
|
2
|
+
if (n.length === 1 && n[0] === r) {
|
|
3
|
+
let u = !1;
|
|
4
|
+
try {
|
|
5
|
+
const i = {};
|
|
6
|
+
e(i) === i && (u = !0);
|
|
7
|
+
} catch {
|
|
8
|
+
}
|
|
9
|
+
if (u) {
|
|
10
|
+
let i;
|
|
11
|
+
try {
|
|
12
|
+
throw new Error();
|
|
13
|
+
} catch (p) {
|
|
14
|
+
({ stack: i } = p);
|
|
15
|
+
}
|
|
16
|
+
console.warn(
|
|
17
|
+
`The result function returned its own inputs without modification. e.g
|
|
18
|
+
\`createSelector([state => state.todos], todos => todos)\`
|
|
19
|
+
This could lead to inefficient memoization and unnecessary re-renders.
|
|
20
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,
|
|
21
|
+
{ stack: i }
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, F = (e, n, r) => {
|
|
26
|
+
const { memoize: u, memoizeOptions: i } = n, { inputSelectorResults: p, inputSelectorResultsCopy: d } = e, f = u(() => ({}), ...i);
|
|
27
|
+
if (!(f.apply(null, p) === f.apply(null, d))) {
|
|
28
|
+
let l;
|
|
29
|
+
try {
|
|
30
|
+
throw new Error();
|
|
31
|
+
} catch (o) {
|
|
32
|
+
({ stack: l } = o);
|
|
33
|
+
}
|
|
34
|
+
console.warn(
|
|
35
|
+
`An input selector returned a different result when passed same arguments.
|
|
36
|
+
This means your output selector will likely run more frequently than intended.
|
|
37
|
+
Avoid returning a new reference inside your input selector, e.g.
|
|
38
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,
|
|
39
|
+
{
|
|
40
|
+
arguments: r,
|
|
41
|
+
firstInputs: p,
|
|
42
|
+
secondInputs: d,
|
|
43
|
+
stack: l
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}, _ = {
|
|
48
|
+
inputStabilityCheck: "once",
|
|
49
|
+
identityFunctionCheck: "once"
|
|
50
|
+
}, R = /* @__PURE__ */ Symbol("NOT_FOUND");
|
|
51
|
+
function D(e, n = `expected a function, instead received ${typeof e}`) {
|
|
52
|
+
if (typeof e != "function")
|
|
53
|
+
throw new TypeError(n);
|
|
54
|
+
}
|
|
55
|
+
function q(e, n = `expected an object, instead received ${typeof e}`) {
|
|
56
|
+
if (typeof e != "object")
|
|
57
|
+
throw new TypeError(n);
|
|
58
|
+
}
|
|
59
|
+
function W(e, n = "expected all items to be functions, instead received the following types: ") {
|
|
60
|
+
if (!e.every((r) => typeof r == "function")) {
|
|
61
|
+
const r = e.map(
|
|
62
|
+
(u) => typeof u == "function" ? `function ${u.name || "unnamed"}()` : typeof u
|
|
63
|
+
).join(", ");
|
|
64
|
+
throw new TypeError(`${n}[${r}]`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var z = (e) => Array.isArray(e) ? e : [e];
|
|
68
|
+
function $(e) {
|
|
69
|
+
const n = Array.isArray(e[0]) ? e[0] : e;
|
|
70
|
+
return W(
|
|
71
|
+
n,
|
|
72
|
+
"createSelector expects all input-selectors to be functions, but received the following types: "
|
|
73
|
+
), n;
|
|
74
|
+
}
|
|
75
|
+
function I(e, n) {
|
|
76
|
+
const r = [], { length: u } = e;
|
|
77
|
+
for (let i = 0; i < u; i++)
|
|
78
|
+
r.push(e[i].apply(null, n));
|
|
79
|
+
return r;
|
|
80
|
+
}
|
|
81
|
+
var U = (e, n) => {
|
|
82
|
+
const { identityFunctionCheck: r, inputStabilityCheck: u } = {
|
|
83
|
+
..._,
|
|
84
|
+
...n
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
identityFunctionCheck: {
|
|
88
|
+
shouldRun: r === "always" || r === "once" && e,
|
|
89
|
+
run: x
|
|
90
|
+
},
|
|
91
|
+
inputStabilityCheck: {
|
|
92
|
+
shouldRun: u === "always" || u === "once" && e,
|
|
93
|
+
run: F
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
function K(e) {
|
|
98
|
+
let n;
|
|
99
|
+
return {
|
|
100
|
+
get(r) {
|
|
101
|
+
return n && e(n.key, r) ? n.value : R;
|
|
102
|
+
},
|
|
103
|
+
put(r, u) {
|
|
104
|
+
n = { key: r, value: u };
|
|
105
|
+
},
|
|
106
|
+
getEntries() {
|
|
107
|
+
return n ? [n] : [];
|
|
108
|
+
},
|
|
109
|
+
clear() {
|
|
110
|
+
n = void 0;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function L(e, n) {
|
|
115
|
+
let r = [];
|
|
116
|
+
function u(f) {
|
|
117
|
+
const h = r.findIndex((l) => n(f, l.key));
|
|
118
|
+
if (h > -1) {
|
|
119
|
+
const l = r[h];
|
|
120
|
+
return h > 0 && (r.splice(h, 1), r.unshift(l)), l.value;
|
|
121
|
+
}
|
|
122
|
+
return R;
|
|
123
|
+
}
|
|
124
|
+
function i(f, h) {
|
|
125
|
+
u(f) === R && (r.unshift({ key: f, value: h }), r.length > e && r.pop());
|
|
126
|
+
}
|
|
127
|
+
function p() {
|
|
128
|
+
return r;
|
|
129
|
+
}
|
|
130
|
+
function d() {
|
|
131
|
+
r = [];
|
|
132
|
+
}
|
|
133
|
+
return { get: u, put: i, getEntries: p, clear: d };
|
|
134
|
+
}
|
|
135
|
+
var V = (e, n) => e === n;
|
|
136
|
+
function P(e) {
|
|
137
|
+
return function(r, u) {
|
|
138
|
+
if (r === null || u === null || r.length !== u.length)
|
|
139
|
+
return !1;
|
|
140
|
+
const { length: i } = r;
|
|
141
|
+
for (let p = 0; p < i; p++)
|
|
142
|
+
if (!e(r[p], u[p]))
|
|
143
|
+
return !1;
|
|
144
|
+
return !0;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function B(e, n) {
|
|
148
|
+
const r = typeof n == "object" ? n : { equalityCheck: n }, {
|
|
149
|
+
equalityCheck: u = V,
|
|
150
|
+
maxSize: i = 1,
|
|
151
|
+
resultEqualityCheck: p
|
|
152
|
+
} = r, d = P(u);
|
|
153
|
+
let f = 0;
|
|
154
|
+
const h = i <= 1 ? K(d) : L(i, d);
|
|
155
|
+
function l() {
|
|
156
|
+
let o = h.get(arguments);
|
|
157
|
+
if (o === R) {
|
|
158
|
+
if (o = e.apply(null, arguments), f++, p) {
|
|
159
|
+
const c = h.getEntries().find(
|
|
160
|
+
(t) => p(t.value, o)
|
|
161
|
+
);
|
|
162
|
+
c && (o = c.value, f !== 0 && f--);
|
|
163
|
+
}
|
|
164
|
+
h.put(arguments, o);
|
|
165
|
+
}
|
|
166
|
+
return o;
|
|
167
|
+
}
|
|
168
|
+
return l.clearCache = () => {
|
|
169
|
+
h.clear(), l.resetResultsCount();
|
|
170
|
+
}, l.resultsCount = () => f, l.resetResultsCount = () => {
|
|
171
|
+
f = 0;
|
|
172
|
+
}, l;
|
|
173
|
+
}
|
|
174
|
+
var G = class {
|
|
175
|
+
constructor(e) {
|
|
176
|
+
this.value = e;
|
|
177
|
+
}
|
|
178
|
+
deref() {
|
|
179
|
+
return this.value;
|
|
180
|
+
}
|
|
181
|
+
}, H = typeof WeakRef < "u" ? WeakRef : G, J = 0, M = 1;
|
|
182
|
+
function k() {
|
|
183
|
+
return {
|
|
184
|
+
s: J,
|
|
185
|
+
v: void 0,
|
|
186
|
+
o: null,
|
|
187
|
+
p: null
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
function O(e, n = {}) {
|
|
191
|
+
let r = k();
|
|
192
|
+
const { resultEqualityCheck: u } = n;
|
|
193
|
+
let i, p = 0;
|
|
194
|
+
function d() {
|
|
195
|
+
let f = r;
|
|
196
|
+
const { length: h } = arguments;
|
|
197
|
+
for (let s = 0, c = h; s < c; s++) {
|
|
198
|
+
const t = arguments[s];
|
|
199
|
+
if (typeof t == "function" || typeof t == "object" && t !== null) {
|
|
200
|
+
let a = f.o;
|
|
201
|
+
a === null && (f.o = a = /* @__PURE__ */ new WeakMap());
|
|
202
|
+
const y = a.get(t);
|
|
203
|
+
y === void 0 ? (f = k(), a.set(t, f)) : f = y;
|
|
204
|
+
} else {
|
|
205
|
+
let a = f.p;
|
|
206
|
+
a === null && (f.p = a = /* @__PURE__ */ new Map());
|
|
207
|
+
const y = a.get(t);
|
|
208
|
+
y === void 0 ? (f = k(), a.set(t, f)) : f = y;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const l = f;
|
|
212
|
+
let o;
|
|
213
|
+
if (f.s === M)
|
|
214
|
+
o = f.v;
|
|
215
|
+
else if (o = e.apply(null, arguments), p++, u) {
|
|
216
|
+
const s = i?.deref?.() ?? i;
|
|
217
|
+
s != null && u(s, o) && (o = s, p !== 0 && p--), i = typeof o == "object" && o !== null || typeof o == "function" ? new H(o) : o;
|
|
218
|
+
}
|
|
219
|
+
return l.s = M, l.v = o, o;
|
|
220
|
+
}
|
|
221
|
+
return d.clearCache = () => {
|
|
222
|
+
r = k(), d.resetResultsCount();
|
|
223
|
+
}, d.resultsCount = () => p, d.resetResultsCount = () => {
|
|
224
|
+
p = 0;
|
|
225
|
+
}, d;
|
|
226
|
+
}
|
|
227
|
+
function A(e, ...n) {
|
|
228
|
+
const r = typeof e == "function" ? {
|
|
229
|
+
memoize: e,
|
|
230
|
+
memoizeOptions: n
|
|
231
|
+
} : e, u = (...i) => {
|
|
232
|
+
let p = 0, d = 0, f, h = {}, l = i.pop();
|
|
233
|
+
typeof l == "object" && (h = l, l = i.pop()), D(
|
|
234
|
+
l,
|
|
235
|
+
`createSelector expects an output function after the inputs, but received: [${typeof l}]`
|
|
236
|
+
);
|
|
237
|
+
const o = {
|
|
238
|
+
...r,
|
|
239
|
+
...h
|
|
240
|
+
}, {
|
|
241
|
+
memoize: s,
|
|
242
|
+
memoizeOptions: c = [],
|
|
243
|
+
argsMemoize: t = O,
|
|
244
|
+
argsMemoizeOptions: a = [],
|
|
245
|
+
devModeChecks: y = {}
|
|
246
|
+
} = o, m = z(c), v = z(a), g = $(i), w = s(function() {
|
|
247
|
+
return p++, l.apply(
|
|
248
|
+
null,
|
|
249
|
+
arguments
|
|
250
|
+
);
|
|
251
|
+
}, ...m);
|
|
252
|
+
let C = !0;
|
|
253
|
+
const N = t(function() {
|
|
254
|
+
d++;
|
|
255
|
+
const S = I(
|
|
256
|
+
g,
|
|
257
|
+
arguments
|
|
258
|
+
);
|
|
259
|
+
if (f = w.apply(null, S), process.env.NODE_ENV !== "production") {
|
|
260
|
+
const { identityFunctionCheck: b, inputStabilityCheck: E } = U(C, y);
|
|
261
|
+
if (b.shouldRun && b.run(
|
|
262
|
+
l,
|
|
263
|
+
S,
|
|
264
|
+
f
|
|
265
|
+
), E.shouldRun) {
|
|
266
|
+
const j = I(
|
|
267
|
+
g,
|
|
268
|
+
arguments
|
|
269
|
+
);
|
|
270
|
+
E.run(
|
|
271
|
+
{ inputSelectorResults: S, inputSelectorResultsCopy: j },
|
|
272
|
+
{ memoize: s, memoizeOptions: m },
|
|
273
|
+
arguments
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
C && (C = !1);
|
|
277
|
+
}
|
|
278
|
+
return f;
|
|
279
|
+
}, ...v);
|
|
280
|
+
return Object.assign(N, {
|
|
281
|
+
resultFunc: l,
|
|
282
|
+
memoizedResultFunc: w,
|
|
283
|
+
dependencies: g,
|
|
284
|
+
dependencyRecomputations: () => d,
|
|
285
|
+
resetDependencyRecomputations: () => {
|
|
286
|
+
d = 0;
|
|
287
|
+
},
|
|
288
|
+
lastResult: () => f,
|
|
289
|
+
recomputations: () => p,
|
|
290
|
+
resetRecomputations: () => {
|
|
291
|
+
p = 0;
|
|
292
|
+
},
|
|
293
|
+
memoize: s,
|
|
294
|
+
argsMemoize: t
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
return Object.assign(u, {
|
|
298
|
+
withTypes: () => u
|
|
299
|
+
}), u;
|
|
300
|
+
}
|
|
301
|
+
var Q = /* @__PURE__ */ A(O), X = Object.assign(
|
|
302
|
+
(e, n = Q) => {
|
|
303
|
+
q(
|
|
304
|
+
e,
|
|
305
|
+
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`
|
|
306
|
+
);
|
|
307
|
+
const r = Object.keys(e), u = r.map(
|
|
308
|
+
(p) => e[p]
|
|
309
|
+
);
|
|
310
|
+
return n(
|
|
311
|
+
u,
|
|
312
|
+
(...p) => p.reduce((d, f, h) => (d[r[h]] = f, d), {})
|
|
313
|
+
);
|
|
314
|
+
},
|
|
315
|
+
{ withTypes: () => X }
|
|
316
|
+
);
|
|
317
|
+
const Y = A({
|
|
318
|
+
memoize: B,
|
|
319
|
+
memoizeOptions: {
|
|
320
|
+
maxSize: 1,
|
|
321
|
+
equalityCheck: Object.is
|
|
322
|
+
}
|
|
323
|
+
}), ee = (e, n, r, u, i, p, d, f, ...h) => {
|
|
324
|
+
if (h.length > 0)
|
|
325
|
+
throw new Error("Unsupported number of selectors");
|
|
326
|
+
let l;
|
|
327
|
+
if (e && n && r && u && i && p && d && f)
|
|
328
|
+
l = (o, s, c, t) => {
|
|
329
|
+
const a = e(o, s, c, t), y = n(o, s, c, t), m = r(o, s, c, t), v = u(o, s, c, t), g = i(o, s, c, t), w = p(o, s, c, t), C = d(o, s, c, t);
|
|
330
|
+
return f(a, y, m, v, g, w, C, s, c, t);
|
|
331
|
+
};
|
|
332
|
+
else if (e && n && r && u && i && p && d)
|
|
333
|
+
l = (o, s, c, t) => {
|
|
334
|
+
const a = e(o, s, c, t), y = n(o, s, c, t), m = r(o, s, c, t), v = u(o, s, c, t), g = i(o, s, c, t), w = p(o, s, c, t);
|
|
335
|
+
return d(a, y, m, v, g, w, s, c, t);
|
|
336
|
+
};
|
|
337
|
+
else if (e && n && r && u && i && p)
|
|
338
|
+
l = (o, s, c, t) => {
|
|
339
|
+
const a = e(o, s, c, t), y = n(o, s, c, t), m = r(o, s, c, t), v = u(o, s, c, t), g = i(o, s, c, t);
|
|
340
|
+
return p(a, y, m, v, g, s, c, t);
|
|
341
|
+
};
|
|
342
|
+
else if (e && n && r && u && i)
|
|
343
|
+
l = (o, s, c, t) => {
|
|
344
|
+
const a = e(o, s, c, t), y = n(o, s, c, t), m = r(o, s, c, t), v = u(o, s, c, t);
|
|
345
|
+
return i(a, y, m, v, s, c, t);
|
|
346
|
+
};
|
|
347
|
+
else if (e && n && r && u)
|
|
348
|
+
l = (o, s, c, t) => {
|
|
349
|
+
const a = e(o, s, c, t), y = n(o, s, c, t), m = r(o, s, c, t);
|
|
350
|
+
return u(a, y, m, s, c, t);
|
|
351
|
+
};
|
|
352
|
+
else if (e && n && r)
|
|
353
|
+
l = (o, s, c, t) => {
|
|
354
|
+
const a = e(o, s, c, t), y = n(o, s, c, t);
|
|
355
|
+
return r(a, y, s, c, t);
|
|
356
|
+
};
|
|
357
|
+
else if (e && n)
|
|
358
|
+
l = (o, s, c, t) => {
|
|
359
|
+
const a = e(o, s, c, t);
|
|
360
|
+
return n(a, s, c, t);
|
|
361
|
+
};
|
|
362
|
+
else if (e)
|
|
363
|
+
l = e;
|
|
364
|
+
else
|
|
365
|
+
throw new Error("Missing arguments");
|
|
366
|
+
return l;
|
|
367
|
+
}, Z = (e) => (...n) => {
|
|
368
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
369
|
+
let u = 1;
|
|
370
|
+
const i = n[n.length - 1], p = n.length - 1 || 1, d = Math.max(i.length - p, 0);
|
|
371
|
+
if (d > 3)
|
|
372
|
+
throw new Error("Unsupported number of arguments");
|
|
373
|
+
return (h, l, o, s) => {
|
|
374
|
+
let c = h.__cacheKey__;
|
|
375
|
+
c || (c = {
|
|
376
|
+
id: u
|
|
377
|
+
}, h.__cacheKey__ = c, u += 1);
|
|
378
|
+
let t = r.get(c);
|
|
379
|
+
if (!t) {
|
|
380
|
+
const a = n.length === 1 ? [(v) => v, i] : n;
|
|
381
|
+
let y = n;
|
|
382
|
+
const m = [void 0, void 0, void 0];
|
|
383
|
+
switch (d) {
|
|
384
|
+
case 0:
|
|
385
|
+
break;
|
|
386
|
+
case 1: {
|
|
387
|
+
y = [...a.slice(0, -1), () => m[0], i];
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
case 2: {
|
|
391
|
+
y = [...a.slice(0, -1), () => m[0], () => m[1], i];
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
case 3: {
|
|
395
|
+
y = [...a.slice(0, -1), () => m[0], () => m[1], () => m[2], i];
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
default:
|
|
399
|
+
throw new Error("Unsupported number of arguments");
|
|
400
|
+
}
|
|
401
|
+
e && (y = [...y, e]), t = Y(...y), t.selectorArgs = m, r.set(c, t);
|
|
402
|
+
}
|
|
403
|
+
switch (d) {
|
|
404
|
+
case 3:
|
|
405
|
+
t.selectorArgs[2] = s;
|
|
406
|
+
case 2:
|
|
407
|
+
t.selectorArgs[1] = o;
|
|
408
|
+
case 1:
|
|
409
|
+
t.selectorArgs[0] = l;
|
|
410
|
+
}
|
|
411
|
+
switch (d) {
|
|
412
|
+
case 0:
|
|
413
|
+
return t(h);
|
|
414
|
+
case 1:
|
|
415
|
+
return t(h, l);
|
|
416
|
+
case 2:
|
|
417
|
+
return t(h, l, o);
|
|
418
|
+
case 3:
|
|
419
|
+
return t(h, l, o, s);
|
|
420
|
+
default:
|
|
421
|
+
throw new Error("unreachable");
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
}, te = Z();
|
|
425
|
+
export {
|
|
426
|
+
ee as a,
|
|
427
|
+
Z as b,
|
|
428
|
+
te as c,
|
|
429
|
+
B as l
|
|
430
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";var _=(e,n,o)=>{if(n.length===1&&n[0]===o){let i=!1;try{const u={};e(u)===u&&(i=!0)}catch{}if(i){let u;try{throw new Error}catch(p){({stack:u}=p)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
2
|
+
\`createSelector([state => state.todos], todos => todos)\`
|
|
3
|
+
This could lead to inefficient memoization and unnecessary re-renders.
|
|
4
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:u})}}},D=(e,n,o)=>{const{memoize:i,memoizeOptions:u}=n,{inputSelectorResults:p,inputSelectorResultsCopy:d}=e,f=i(()=>({}),...u);if(!(f.apply(null,p)===f.apply(null,d))){let l;try{throw new Error}catch(r){({stack:l}=r)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
5
|
+
This means your output selector will likely run more frequently than intended.
|
|
6
|
+
Avoid returning a new reference inside your input selector, e.g.
|
|
7
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:o,firstInputs:p,secondInputs:d,stack:l})}},W={inputStabilityCheck:"once",identityFunctionCheck:"once"},k=Symbol("NOT_FOUND");function q(e,n=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(n)}function $(e,n=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(n)}function U(e,n="expected all items to be functions, instead received the following types: "){if(!e.every(o=>typeof o=="function")){const o=e.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${n}[${o}]`)}}var z=e=>Array.isArray(e)?e:[e];function K(e){const n=Array.isArray(e[0])?e[0]:e;return U(n,"createSelector expects all input-selectors to be functions, but received the following types: "),n}function M(e,n){const o=[],{length:i}=e;for(let u=0;u<i;u++)o.push(e[u].apply(null,n));return o}var L=(e,n)=>{const{identityFunctionCheck:o,inputStabilityCheck:i}={...W,...n};return{identityFunctionCheck:{shouldRun:o==="always"||o==="once"&&e,run:_},inputStabilityCheck:{shouldRun:i==="always"||i==="once"&&e,run:D}}};function V(e){let n;return{get(o){return n&&e(n.key,o)?n.value:k},put(o,i){n={key:o,value:i}},getEntries(){return n?[n]:[]},clear(){n=void 0}}}function P(e,n){let o=[];function i(f){const h=o.findIndex(l=>n(f,l.key));if(h>-1){const l=o[h];return h>0&&(o.splice(h,1),o.unshift(l)),l.value}return k}function u(f,h){i(f)===k&&(o.unshift({key:f,value:h}),o.length>e&&o.pop())}function p(){return o}function d(){o=[]}return{get:i,put:u,getEntries:p,clear:d}}var B=(e,n)=>e===n;function G(e){return function(o,i){if(o===null||i===null||o.length!==i.length)return!1;const{length:u}=o;for(let p=0;p<u;p++)if(!e(o[p],i[p]))return!1;return!0}}function O(e,n){const o=typeof n=="object"?n:{equalityCheck:n},{equalityCheck:i=B,maxSize:u=1,resultEqualityCheck:p}=o,d=G(i);let f=0;const h=u<=1?V(d):P(u,d);function l(){let r=h.get(arguments);if(r===k){if(r=e.apply(null,arguments),f++,p){const s=h.getEntries().find(t=>p(t.value,r));s&&(r=s.value,f!==0&&f--)}h.put(arguments,r)}return r}return l.clearCache=()=>{h.clear(),l.resetResultsCount()},l.resultsCount=()=>f,l.resetResultsCount=()=>{f=0},l}var H=class{constructor(e){this.value=e}deref(){return this.value}},J=typeof WeakRef<"u"?WeakRef:H,Q=0,I=1;function S(){return{s:Q,v:void 0,o:null,p:null}}function A(e,n={}){let o=S();const{resultEqualityCheck:i}=n;let u,p=0;function d(){let f=o;const{length:h}=arguments;for(let c=0,s=h;c<s;c++){const t=arguments[c];if(typeof t=="function"||typeof t=="object"&&t!==null){let a=f.o;a===null&&(f.o=a=new WeakMap);const y=a.get(t);y===void 0?(f=S(),a.set(t,f)):f=y}else{let a=f.p;a===null&&(f.p=a=new Map);const y=a.get(t);y===void 0?(f=S(),a.set(t,f)):f=y}}const l=f;let r;if(f.s===I)r=f.v;else if(r=e.apply(null,arguments),p++,i){const c=u?.deref?.()??u;c!=null&&i(c,r)&&(r=c,p!==0&&p--),u=typeof r=="object"&&r!==null||typeof r=="function"?new J(r):r}return l.s=I,l.v=r,r}return d.clearCache=()=>{o=S(),d.resetResultsCount()},d.resultsCount=()=>p,d.resetResultsCount=()=>{p=0},d}function N(e,...n){const o=typeof e=="function"?{memoize:e,memoizeOptions:n}:e,i=(...u)=>{let p=0,d=0,f,h={},l=u.pop();typeof l=="object"&&(h=l,l=u.pop()),q(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const r={...o,...h},{memoize:c,memoizeOptions:s=[],argsMemoize:t=A,argsMemoizeOptions:a=[],devModeChecks:y={}}=r,m=z(s),v=z(a),g=K(u),w=c(function(){return p++,l.apply(null,arguments)},...m);let C=!0;const j=t(function(){d++;const R=M(g,arguments);if(f=w.apply(null,R),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:E,inputStabilityCheck:b}=L(C,y);if(E.shouldRun&&E.run(l,R,f),b.shouldRun){const F=M(g,arguments);b.run({inputSelectorResults:R,inputSelectorResultsCopy:F},{memoize:c,memoizeOptions:m},arguments)}C&&(C=!1)}return f},...v);return Object.assign(j,{resultFunc:l,memoizedResultFunc:w,dependencies:g,dependencyRecomputations:()=>d,resetDependencyRecomputations:()=>{d=0},lastResult:()=>f,recomputations:()=>p,resetRecomputations:()=>{p=0},memoize:c,argsMemoize:t})};return Object.assign(i,{withTypes:()=>i}),i}var X=N(A),Y=Object.assign((e,n=X)=>{$(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const o=Object.keys(e),i=o.map(p=>e[p]);return n(i,(...p)=>p.reduce((d,f,h)=>(d[o[h]]=f,d),{}))},{withTypes:()=>Y});const Z=N({memoize:O,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),ee=(e,n,o,i,u,p,d,f,...h)=>{if(h.length>0)throw new Error("Unsupported number of selectors");let l;if(e&&n&&o&&i&&u&&p&&d&&f)l=(r,c,s,t)=>{const a=e(r,c,s,t),y=n(r,c,s,t),m=o(r,c,s,t),v=i(r,c,s,t),g=u(r,c,s,t),w=p(r,c,s,t),C=d(r,c,s,t);return f(a,y,m,v,g,w,C,c,s,t)};else if(e&&n&&o&&i&&u&&p&&d)l=(r,c,s,t)=>{const a=e(r,c,s,t),y=n(r,c,s,t),m=o(r,c,s,t),v=i(r,c,s,t),g=u(r,c,s,t),w=p(r,c,s,t);return d(a,y,m,v,g,w,c,s,t)};else if(e&&n&&o&&i&&u&&p)l=(r,c,s,t)=>{const a=e(r,c,s,t),y=n(r,c,s,t),m=o(r,c,s,t),v=i(r,c,s,t),g=u(r,c,s,t);return p(a,y,m,v,g,c,s,t)};else if(e&&n&&o&&i&&u)l=(r,c,s,t)=>{const a=e(r,c,s,t),y=n(r,c,s,t),m=o(r,c,s,t),v=i(r,c,s,t);return u(a,y,m,v,c,s,t)};else if(e&&n&&o&&i)l=(r,c,s,t)=>{const a=e(r,c,s,t),y=n(r,c,s,t),m=o(r,c,s,t);return i(a,y,m,c,s,t)};else if(e&&n&&o)l=(r,c,s,t)=>{const a=e(r,c,s,t),y=n(r,c,s,t);return o(a,y,c,s,t)};else if(e&&n)l=(r,c,s,t)=>{const a=e(r,c,s,t);return n(a,c,s,t)};else if(e)l=e;else throw new Error("Missing arguments");return l},T=e=>(...n)=>{const o=new WeakMap;let i=1;const u=n[n.length-1],p=n.length-1||1,d=Math.max(u.length-p,0);if(d>3)throw new Error("Unsupported number of arguments");return(h,l,r,c)=>{let s=h.__cacheKey__;s||(s={id:i},h.__cacheKey__=s,i+=1);let t=o.get(s);if(!t){const a=n.length===1?[v=>v,u]:n;let y=n;const m=[void 0,void 0,void 0];switch(d){case 0:break;case 1:{y=[...a.slice(0,-1),()=>m[0],u];break}case 2:{y=[...a.slice(0,-1),()=>m[0],()=>m[1],u];break}case 3:{y=[...a.slice(0,-1),()=>m[0],()=>m[1],()=>m[2],u];break}default:throw new Error("Unsupported number of arguments")}e&&(y=[...y,e]),t=Z(...y),t.selectorArgs=m,o.set(s,t)}switch(d){case 3:t.selectorArgs[2]=c;case 2:t.selectorArgs[1]=r;case 1:t.selectorArgs[0]=l}switch(d){case 0:return t(h);case 1:return t(h,l);case 2:return t(h,l,r);case 3:return t(h,l,r,c);default:throw new Error("unreachable")}}},te=T();exports.createSelector=ee;exports.createSelectorMemoized=te;exports.createSelectorMemoizedWithOptions=T;exports.lruMemoize=O;
|