@limetech/lime-elements 40.5.1 → 40.5.4
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 +21 -0
- package/dist/cjs/{_baseEach-Bygi-un6.js → _baseForOwn-8jMPwf3X.js} +1 -43
- package/dist/cjs/{_baseIsEqual-CQZKiKbe.js → _baseIsEqual-zzV9DKMv.js} +0 -1
- package/dist/cjs/{_baseIteratee-DDklwtn9.js → _baseIteratee-BIMRm4nq.js} +1 -3
- package/dist/cjs/_baseSet-DykMx7uF.js +92 -0
- package/dist/cjs/_getPrototype-CCLHkBHj.js +8 -0
- package/dist/cjs/{cloneDeep-hE40Q8aw.js → cloneDeep-D2immmwT.js} +16 -160
- package/dist/cjs/{difference-B543MGsY.js → isArrayLikeObject-U2Ddbw4n.js} +5 -93
- package/dist/cjs/{isEqual-Cd9J8a5-.js → isEqual-D3eFkhqd.js} +1 -1
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +2 -2
- package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +45 -6
- package/dist/cjs/limel-file-viewer.cjs.entry.js +510 -70
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +73 -11
- package/dist/cjs/limel-form.cjs.entry.js +5985 -3415
- package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +326 -262
- package/dist/cjs/limel-tab-bar.cjs.entry.js +83 -4
- package/dist/cjs/limel-table.cjs.entry.js +598 -199
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +1 -1
- package/dist/collection/components/form/fields/schema-field.js +8 -0
- package/dist/collection/components/form/form.js +1 -0
- package/dist/collection/components/form/form.test-schemas.js +47 -0
- package/dist/collection/components/form/templates/array-field-collapsible-item.js +38 -11
- package/dist/collection/components/popover-surface/popover-surface.css +1 -0
- package/dist/collection/components/table/table.css +1 -2
- package/dist/esm/{_baseEach-lvj-g1Zj.js → _baseForOwn-D5j7fHlv.js} +2 -42
- package/dist/esm/{_baseIsEqual-B6bIeexY.js → _baseIsEqual-CyF4P8uM.js} +2 -2
- package/dist/esm/{_baseIteratee-CEZRuq23.js → _baseIteratee-CpbczHY1.js} +3 -3
- package/dist/esm/_baseSet-Cw2IE6ZF.js +89 -0
- package/dist/esm/_getPrototype-B0kMNv1F.js +6 -0
- package/dist/esm/{_getTag-CMJL-6hk.js → _getTag-BiAaLWvH.js} +1 -1
- package/dist/esm/{cloneDeep-CL7UD3mR.js → cloneDeep-DAbOtbs8.js} +18 -154
- package/dist/esm/{difference-DND5tWiA.js → isArrayLikeObject-CJB8HbtH.js} +7 -91
- package/dist/esm/{isEmpty-DHgukT5k.js → isEmpty-BGVZ12Ea.js} +1 -1
- package/dist/esm/{isEqual-4tbMaaf_.js → isEqual-CE83yS8T.js} +1 -1
- package/dist/esm/limel-action-bar_3.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +3 -3
- package/dist/esm/limel-chip_2.entry.js +2 -2
- package/dist/esm/limel-dialog.entry.js +3 -3
- package/dist/esm/limel-file-dropzone_2.entry.js +45 -6
- package/dist/esm/limel-file-viewer.entry.js +510 -70
- package/dist/esm/limel-flatpickr-adapter.entry.js +69 -7
- package/dist/esm/limel-form.entry.js +5982 -3412
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +327 -263
- package/dist/esm/limel-tab-bar.entry.js +83 -4
- package/dist/esm/limel-table.entry.js +595 -196
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-05afb316.entry.js +1 -0
- package/dist/lime-elements/p-0fba64eb.entry.js +16 -0
- package/dist/lime-elements/p-10594468.entry.js +1 -0
- package/dist/lime-elements/p-19344984.entry.js +13 -0
- package/dist/lime-elements/p-26c5c6b9.entry.js +1 -0
- package/dist/lime-elements/{p-11a96a8c.entry.js → p-36ce4fbc.entry.js} +1 -1
- package/dist/lime-elements/{p-955292eb.entry.js → p-4aae63bd.entry.js} +1 -1
- package/dist/lime-elements/{p-b8c76487.entry.js → p-5d974afa.entry.js} +1 -1
- package/dist/lime-elements/p-B6-3WXAv.js +1 -0
- package/dist/lime-elements/p-BQeIv4aA.js +1 -0
- package/dist/lime-elements/p-BY5NjPj8.js +1 -0
- package/dist/lime-elements/p-COdirXg1.js +1 -0
- package/dist/lime-elements/p-CW2-jhzP.js +1 -0
- package/dist/lime-elements/p-D2VFSWDU.js +1 -0
- package/dist/lime-elements/{p-D4RdItCq.js → p-DK0pjX-Y.js} +1 -1
- package/dist/lime-elements/p-ORUNaKm-.js +1 -0
- package/dist/lime-elements/{p-5b371d6b.entry.js → p-a71f6e87.entry.js} +4 -4
- package/dist/lime-elements/{p-1dd86ad4.entry.js → p-bd7b3f8e.entry.js} +1 -1
- package/dist/lime-elements/p-cef66e53.entry.js +1 -0
- package/dist/lime-elements/{p-02812dc8.entry.js → p-d3bd4b80.entry.js} +1 -1
- package/dist/lime-elements/p-nVemxylR.js +1 -0
- package/dist/lime-elements/p-pk5KIdKH.js +1 -0
- package/dist/types/components/form/form.test-schemas.d.ts +3 -0
- package/dist/types/components/form/templates/array-field-collapsible-item.d.ts +0 -1
- package/package.json +16 -16
- package/dist/cjs/_getAllKeysIn-BJsgUTAt.js +0 -119
- package/dist/cjs/_isIterateeCall-BUGt9SrH.js +0 -73
- package/dist/cjs/pickBy-D-X6S5kg.js +0 -201
- package/dist/esm/_getAllKeysIn-kT3KizYN.js +0 -114
- package/dist/esm/_isIterateeCall-Bb4gUZLK.js +0 -70
- package/dist/esm/pickBy-C4C3CM4m.js +0 -195
- package/dist/lime-elements/p-055b11f7.entry.js +0 -13
- package/dist/lime-elements/p-56bkn1D-.js +0 -1
- package/dist/lime-elements/p-67f02b69.entry.js +0 -1
- package/dist/lime-elements/p-867681aa.entry.js +0 -1
- package/dist/lime-elements/p-9d3437ac.entry.js +0 -16
- package/dist/lime-elements/p-B8yl2MCT.js +0 -1
- package/dist/lime-elements/p-BAR6am-7.js +0 -1
- package/dist/lime-elements/p-BE1Efiuj.js +0 -1
- package/dist/lime-elements/p-BsX7ma3n.js +0 -1
- package/dist/lime-elements/p-CR7u-m0b.js +0 -1
- package/dist/lime-elements/p-CVzgpz9P.js +0 -1
- package/dist/lime-elements/p-D8H5afYg.js +0 -1
- package/dist/lime-elements/p-DtrvybFR.js +0 -1
- package/dist/lime-elements/p-f309ceb8.entry.js +0 -1
- package/dist/lime-elements/p-f3c108c9.entry.js +0 -1
- package/dist/lime-elements/p-mmkVLOjW.js +0 -1
|
@@ -128,7 +128,7 @@ button:not([disabled]) {
|
|
|
128
128
|
transition: color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);
|
|
129
129
|
cursor: pointer;
|
|
130
130
|
color: var(--limel-action-bar-item-text-color);
|
|
131
|
-
background-color:
|
|
131
|
+
background-color: transparent;
|
|
132
132
|
}
|
|
133
133
|
button:not([disabled]):hover, button:not([disabled]):focus, button:not([disabled]):focus-visible {
|
|
134
134
|
will-change: color, background-color, box-shadow, transform;
|
|
@@ -6,6 +6,7 @@ import { resetDependentFields, schemaAllowsNull } from "./field-helpers";
|
|
|
6
6
|
import { FieldTemplate } from "../templates";
|
|
7
7
|
import { getHelpComponent } from "../help";
|
|
8
8
|
import { TimePicker } from "../widgets/time-picker";
|
|
9
|
+
import { isIntegerType, isNumberType } from "../schema";
|
|
9
10
|
import { RowLayoutContext } from "../row/row-context";
|
|
10
11
|
const { fields: defaultFields } = getDefaultRegistry();
|
|
11
12
|
const BaseSchemaField = defaultFields.SchemaField;
|
|
@@ -172,6 +173,7 @@ export class SchemaField extends React.Component {
|
|
|
172
173
|
}
|
|
173
174
|
render() {
|
|
174
175
|
var _a;
|
|
176
|
+
const schema = this.props.schema;
|
|
175
177
|
if ((_a = this.props.schema.lime) === null || _a === void 0 ? void 0 : _a.hidden) {
|
|
176
178
|
return null;
|
|
177
179
|
}
|
|
@@ -182,6 +184,12 @@ export class SchemaField extends React.Component {
|
|
|
182
184
|
if (this.props.schema.format === 'time') {
|
|
183
185
|
fieldProps.uiSchema = Object.assign({ 'ui:widget': TimePicker }, fieldProps.uiSchema);
|
|
184
186
|
}
|
|
187
|
+
// Our text widget renders a native `<input type="number">` for numeric
|
|
188
|
+
// schemas. `@rjsf/core` otherwise rewrites the value to the locale's
|
|
189
|
+
// decimal separator, which such an input cannot display.
|
|
190
|
+
if (isNumberType(schema) || isIntegerType(schema)) {
|
|
191
|
+
fieldProps.uiSchema = Object.assign({ 'ui:inputType': 'number' }, fieldProps.uiSchema);
|
|
192
|
+
}
|
|
185
193
|
return React.createElement(BaseSchemaField, fieldProps);
|
|
186
194
|
}
|
|
187
195
|
}
|
|
@@ -112,6 +112,7 @@ export class Form {
|
|
|
112
112
|
// `default` values, matching the pre-v6 behavior.
|
|
113
113
|
experimental_defaultFormStateBehavior: {
|
|
114
114
|
constAsDefaults: 'skipOneOf',
|
|
115
|
+
requiredBooleanDefault: 'skip',
|
|
115
116
|
},
|
|
116
117
|
showErrorList: false,
|
|
117
118
|
extraErrors: this.getExtraErrors(this.errors),
|
|
@@ -601,3 +601,50 @@ export const nestedLayoutSchemaPathSchema = {
|
|
|
601
601
|
},
|
|
602
602
|
},
|
|
603
603
|
};
|
|
604
|
+
export const getConditionalCustomComponentSchema = (value) => ({
|
|
605
|
+
type: 'object',
|
|
606
|
+
properties: Object.assign({ trigger: { type: 'string', title: 'Trigger' } }, ((value === null || value === void 0 ? void 0 : value.trigger) === 'show'
|
|
607
|
+
? {
|
|
608
|
+
color: {
|
|
609
|
+
type: 'string',
|
|
610
|
+
title: 'Color',
|
|
611
|
+
default: 'rgb(0, 0, 0)',
|
|
612
|
+
lime: { component: { name: 'limel-color-picker' } },
|
|
613
|
+
},
|
|
614
|
+
}
|
|
615
|
+
: {})),
|
|
616
|
+
});
|
|
617
|
+
export const arrayItemWithEnumAndDefaultSchema = {
|
|
618
|
+
type: 'object',
|
|
619
|
+
properties: {
|
|
620
|
+
entries: {
|
|
621
|
+
type: 'array',
|
|
622
|
+
title: 'Entries',
|
|
623
|
+
items: {
|
|
624
|
+
type: 'object',
|
|
625
|
+
properties: {
|
|
626
|
+
mode: {
|
|
627
|
+
type: 'string',
|
|
628
|
+
title: 'Mode',
|
|
629
|
+
oneOf: [
|
|
630
|
+
{ const: 'a', title: 'A', type: 'string' },
|
|
631
|
+
{ const: 'b', title: 'B', type: 'string' },
|
|
632
|
+
],
|
|
633
|
+
},
|
|
634
|
+
plain: {
|
|
635
|
+
type: 'string',
|
|
636
|
+
title: 'Plain',
|
|
637
|
+
default: 'preset',
|
|
638
|
+
},
|
|
639
|
+
},
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
};
|
|
644
|
+
export const requiredCheckboxSchema = {
|
|
645
|
+
type: 'object',
|
|
646
|
+
properties: {
|
|
647
|
+
accept: { type: 'boolean', title: 'I accept the terms' },
|
|
648
|
+
},
|
|
649
|
+
required: ['accept'],
|
|
650
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { findTitle, hasNestedErrors } from "./common";
|
|
3
|
-
import {
|
|
3
|
+
import { getDefaultFormState, } from "@rjsf/utils";
|
|
4
|
+
import { isEmpty, isEqual } from "lodash-es";
|
|
5
|
+
import { rjsfValidator } from "../validator";
|
|
4
6
|
export class CollapsibleItemTemplate extends React.Component {
|
|
5
7
|
constructor(props) {
|
|
6
8
|
super(props);
|
|
@@ -14,9 +16,8 @@ export class CollapsibleItemTemplate extends React.Component {
|
|
|
14
16
|
});
|
|
15
17
|
};
|
|
16
18
|
this.handleAction = this.handleAction.bind(this);
|
|
17
|
-
this.isDeepEmpty = this.isDeepEmpty.bind(this);
|
|
18
19
|
this.state = {
|
|
19
|
-
isOpen:
|
|
20
|
+
isOpen: isNewItem(props),
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
componentDidMount() {
|
|
@@ -77,13 +78,39 @@ export class CollapsibleItemTemplate extends React.Component {
|
|
|
77
78
|
event.stopPropagation();
|
|
78
79
|
event.detail.run(event);
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* An item counts as new while it holds nothing the user entered. Since
|
|
84
|
+
* `@rjsf/core` 6.10 fills a required property with its default as soon as the
|
|
85
|
+
* item exists, "nothing entered" means empty data *or* data equal to what the
|
|
86
|
+
* schema produces on its own.
|
|
87
|
+
*
|
|
88
|
+
* @param props - the props of the item being rendered
|
|
89
|
+
*/
|
|
90
|
+
function isNewItem(props) {
|
|
91
|
+
if (isDeepEmpty(props.data)) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
return isEqual(props.data, getItemDefaults(props));
|
|
95
|
+
}
|
|
96
|
+
function getItemDefaults(props) {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const items = (_a = props.schema) === null || _a === void 0 ? void 0 : _a.items;
|
|
99
|
+
const itemSchema = (Array.isArray(items) ? items[props.index] : items);
|
|
100
|
+
if (!itemSchema) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// Must match the `experimental_defaultFormStateBehavior` that `limel-form`
|
|
104
|
+
// passes to `@rjsf/core`. Computing defaults under different options gives
|
|
105
|
+
// data the form never writes, and the comparison above then fails.
|
|
106
|
+
return getDefaultFormState(rjsfValidator, itemSchema, undefined, ((_b = props.formSchema) !== null && _b !== void 0 ? _b : itemSchema), false, { constAsDefaults: 'skipOneOf', requiredBooleanDefault: 'skip' });
|
|
107
|
+
}
|
|
108
|
+
function isDeepEmpty(data) {
|
|
109
|
+
if (typeof data !== 'object') {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (isEmpty(data)) {
|
|
113
|
+
return true;
|
|
88
114
|
}
|
|
115
|
+
return Object.values(data).every(isDeepEmpty);
|
|
89
116
|
}
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
min-height: 0;
|
|
120
120
|
border-radius: var(--popover-border-radius, 0.75rem);
|
|
121
121
|
box-shadow: var(--popover-box-shadow, var(--shadow-depth-16));
|
|
122
|
+
border: 1px solid rgb(var(--contrast-1200), 0.1);
|
|
122
123
|
backdrop-filter: blur(0.3125rem);
|
|
123
124
|
-webkit-backdrop-filter: blur(0.3125rem);
|
|
124
125
|
}
|
|
@@ -355,7 +355,6 @@
|
|
|
355
355
|
display: none;
|
|
356
356
|
}
|
|
357
357
|
.tabulator .tabulator-header .tabulator-frozen-rows-holder {
|
|
358
|
-
padding-top: 1em;
|
|
359
358
|
display: inline-block;
|
|
360
359
|
}
|
|
361
360
|
.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty {
|
|
@@ -412,7 +411,7 @@
|
|
|
412
411
|
.tabulator .tabulator-tableholder .tabulator-range-overlay {
|
|
413
412
|
position: absolute;
|
|
414
413
|
inset: 0;
|
|
415
|
-
z-index:
|
|
414
|
+
z-index: 11;
|
|
416
415
|
pointer-events: none;
|
|
417
416
|
}
|
|
418
417
|
.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { k as keys } from './_baseIsEqual-
|
|
2
|
-
import { i as isArrayLike } from './isArrayLike-CyVGB489.js';
|
|
1
|
+
import { k as keys } from './_baseIsEqual-CyF4P8uM.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
@@ -50,43 +49,4 @@ function baseForOwn(object, iteratee) {
|
|
|
50
49
|
return object && baseFor(object, iteratee, keys);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
* Creates a `baseEach` or `baseEachRight` function.
|
|
55
|
-
*
|
|
56
|
-
* @private
|
|
57
|
-
* @param {Function} eachFunc The function to iterate over a collection.
|
|
58
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
59
|
-
* @returns {Function} Returns the new base function.
|
|
60
|
-
*/
|
|
61
|
-
function createBaseEach(eachFunc, fromRight) {
|
|
62
|
-
return function(collection, iteratee) {
|
|
63
|
-
if (collection == null) {
|
|
64
|
-
return collection;
|
|
65
|
-
}
|
|
66
|
-
if (!isArrayLike(collection)) {
|
|
67
|
-
return eachFunc(collection, iteratee);
|
|
68
|
-
}
|
|
69
|
-
var length = collection.length,
|
|
70
|
-
index = -1,
|
|
71
|
-
iterable = Object(collection);
|
|
72
|
-
|
|
73
|
-
while ((++index < length)) {
|
|
74
|
-
if (iteratee(iterable[index], index, iterable) === false) {
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return collection;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* The base implementation of `_.forEach` without support for iteratee shorthands.
|
|
84
|
-
*
|
|
85
|
-
* @private
|
|
86
|
-
* @param {Array|Object} collection The collection to iterate over.
|
|
87
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
88
|
-
* @returns {Array|Object} Returns `collection`.
|
|
89
|
-
*/
|
|
90
|
-
var baseEach = createBaseEach(baseForOwn);
|
|
91
|
-
|
|
92
|
-
export { baseEach as a, baseFor as b, baseForOwn as c };
|
|
52
|
+
export { baseForOwn as b };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { e as eq } from './eq-CZ30nDJE.js';
|
|
2
|
-
import {
|
|
2
|
+
import { i as isArguments, a as isBuffer, b as isTypedArray, c as baseKeys, M as Map, g as getTag } from './_getTag-BiAaLWvH.js';
|
|
3
3
|
import { g as getNative } from './_getNative-COawFdVX.js';
|
|
4
4
|
import { r as root, S as Symbol } from './isObject-BJQylLSL.js';
|
|
5
5
|
import { i as isArray } from './isArray-B8VKuhvH.js';
|
|
@@ -1203,4 +1203,4 @@ function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
|
1203
1203
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
-
export { MapCache as M,
|
|
1206
|
+
export { MapCache as M, SetCache as S, Uint8Array as U, Stack as a, baseIsEqual as b, cacheHas as c, arrayPush as d, arrayLikeKeys as e, stubArray as f, getAllKeys as g, getSymbols as h, baseGetAllKeys as i, keys as k, setToArray as s };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { M as MapCache,
|
|
1
|
+
import { M as MapCache, a as Stack, b as baseIsEqual, k as keys } from './_baseIsEqual-CyF4P8uM.js';
|
|
2
2
|
import { S as Symbol, i as isObject } from './isObject-BJQylLSL.js';
|
|
3
3
|
import { i as isArray } from './isArray-B8VKuhvH.js';
|
|
4
4
|
import { i as isSymbol } from './isSymbol-ClAke5ga.js';
|
|
5
|
-
import {
|
|
5
|
+
import { i as isArguments } from './_getTag-BiAaLWvH.js';
|
|
6
6
|
import { i as isIndex } from './_isIndex-B--C3qwe.js';
|
|
7
7
|
import { a as isLength } from './isArrayLike-CyVGB489.js';
|
|
8
8
|
import { i as identity } from './identity-CK4jS9_E.js';
|
|
@@ -598,4 +598,4 @@ function baseIteratee(value) {
|
|
|
598
598
|
return property(value);
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
-
export {
|
|
601
|
+
export { toKey as a, baseIteratee as b, castPath as c, baseGet as d, arrayMap as e, get as g, hasPath as h, toString as t };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { a as assignValue } from './_assignValue-CEFvyZxO.js';
|
|
2
|
+
import { c as castPath, a as toKey } from './_baseIteratee-CpbczHY1.js';
|
|
3
|
+
import { i as isIndex } from './_isIndex-B--C3qwe.js';
|
|
4
|
+
import { i as isObject } from './isObject-BJQylLSL.js';
|
|
5
|
+
|
|
6
|
+
/** Error message constants. */
|
|
7
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Creates a function that negates the result of the predicate `func`. The
|
|
11
|
+
* `func` predicate is invoked with the `this` binding and arguments of the
|
|
12
|
+
* created function.
|
|
13
|
+
*
|
|
14
|
+
* @static
|
|
15
|
+
* @memberOf _
|
|
16
|
+
* @since 3.0.0
|
|
17
|
+
* @category Function
|
|
18
|
+
* @param {Function} predicate The predicate to negate.
|
|
19
|
+
* @returns {Function} Returns the new negated function.
|
|
20
|
+
* @example
|
|
21
|
+
*
|
|
22
|
+
* function isEven(n) {
|
|
23
|
+
* return n % 2 == 0;
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
|
|
27
|
+
* // => [1, 3, 5]
|
|
28
|
+
*/
|
|
29
|
+
function negate(predicate) {
|
|
30
|
+
if (typeof predicate != 'function') {
|
|
31
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
32
|
+
}
|
|
33
|
+
return function() {
|
|
34
|
+
var args = arguments;
|
|
35
|
+
switch (args.length) {
|
|
36
|
+
case 0: return !predicate.call(this);
|
|
37
|
+
case 1: return !predicate.call(this, args[0]);
|
|
38
|
+
case 2: return !predicate.call(this, args[0], args[1]);
|
|
39
|
+
case 3: return !predicate.call(this, args[0], args[1], args[2]);
|
|
40
|
+
}
|
|
41
|
+
return !predicate.apply(this, args);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The base implementation of `_.set`.
|
|
47
|
+
*
|
|
48
|
+
* @private
|
|
49
|
+
* @param {Object} object The object to modify.
|
|
50
|
+
* @param {Array|string} path The path of the property to set.
|
|
51
|
+
* @param {*} value The value to set.
|
|
52
|
+
* @param {Function} [customizer] The function to customize path creation.
|
|
53
|
+
* @returns {Object} Returns `object`.
|
|
54
|
+
*/
|
|
55
|
+
function baseSet(object, path, value, customizer) {
|
|
56
|
+
if (!isObject(object)) {
|
|
57
|
+
return object;
|
|
58
|
+
}
|
|
59
|
+
path = castPath(path, object);
|
|
60
|
+
|
|
61
|
+
var index = -1,
|
|
62
|
+
length = path.length,
|
|
63
|
+
lastIndex = length - 1,
|
|
64
|
+
nested = object;
|
|
65
|
+
|
|
66
|
+
while (nested != null && ++index < length) {
|
|
67
|
+
var key = toKey(path[index]),
|
|
68
|
+
newValue = value;
|
|
69
|
+
|
|
70
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
71
|
+
return object;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (index != lastIndex) {
|
|
75
|
+
var objValue = nested[key];
|
|
76
|
+
newValue = undefined;
|
|
77
|
+
if (newValue === undefined) {
|
|
78
|
+
newValue = isObject(objValue)
|
|
79
|
+
? objValue
|
|
80
|
+
: (isIndex(path[index + 1]) ? [] : {});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
assignValue(nested, key, newValue);
|
|
84
|
+
nested = nested[key];
|
|
85
|
+
}
|
|
86
|
+
return object;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { baseSet as b, negate as n };
|
|
@@ -341,4 +341,4 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
export { Map as M, Set as S,
|
|
344
|
+
export { Map as M, Set as S, isBuffer as a, isTypedArray as b, baseKeys as c, isPrototype as d, baseUnary as e, getTag as g, isArguments as i, nodeUtil as n, overArg as o };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as isObject,
|
|
5
|
-
import {
|
|
1
|
+
import { U as Uint8Array, a as Stack, g as getAllKeys } from './_baseIsEqual-CyF4P8uM.js';
|
|
2
|
+
import { a as assignValue } from './_assignValue-CEFvyZxO.js';
|
|
3
|
+
import { d as isPrototype, g as getTag, e as baseUnary, n as nodeUtil, a as isBuffer } from './_getTag-BiAaLWvH.js';
|
|
4
|
+
import { i as isObject, S as Symbol } from './isObject-BJQylLSL.js';
|
|
5
|
+
import { g as getPrototype } from './_getPrototype-B0kMNv1F.js';
|
|
6
6
|
import { i as isArray } from './isArray-B8VKuhvH.js';
|
|
7
7
|
import { i as isObjectLike } from './isObjectLike-oiMYqRQ0.js';
|
|
8
8
|
|
|
@@ -33,25 +33,6 @@ var baseCreate = (function() {
|
|
|
33
33
|
};
|
|
34
34
|
}());
|
|
35
35
|
|
|
36
|
-
/**
|
|
37
|
-
* Copies the values of `source` to `array`.
|
|
38
|
-
*
|
|
39
|
-
* @private
|
|
40
|
-
* @param {Array} source The array to copy values from.
|
|
41
|
-
* @param {Array} [array=[]] The array to copy values to.
|
|
42
|
-
* @returns {Array} Returns `array`.
|
|
43
|
-
*/
|
|
44
|
-
function copyArray(source, array) {
|
|
45
|
-
var index = -1,
|
|
46
|
-
length = source.length;
|
|
47
|
-
|
|
48
|
-
array || (array = Array(length));
|
|
49
|
-
while (++index < length) {
|
|
50
|
-
array[index] = source[index];
|
|
51
|
-
}
|
|
52
|
-
return array;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
36
|
/**
|
|
56
37
|
* A specialized version of `_.forEach` for arrays without support for
|
|
57
38
|
* iteratee shorthands.
|
|
@@ -73,78 +54,11 @@ function arrayEach(array, iteratee) {
|
|
|
73
54
|
return array;
|
|
74
55
|
}
|
|
75
56
|
|
|
76
|
-
/**
|
|
77
|
-
* Copies properties of `source` to `object`.
|
|
78
|
-
*
|
|
79
|
-
* @private
|
|
80
|
-
* @param {Object} source The object to copy properties from.
|
|
81
|
-
* @param {Array} props The property identifiers to copy.
|
|
82
|
-
* @param {Object} [object={}] The object to copy properties to.
|
|
83
|
-
* @param {Function} [customizer] The function to customize copied values.
|
|
84
|
-
* @returns {Object} Returns `object`.
|
|
85
|
-
*/
|
|
86
|
-
function copyObject(source, props, object, customizer) {
|
|
87
|
-
var isNew = !object;
|
|
88
|
-
object || (object = {});
|
|
89
|
-
|
|
90
|
-
var index = -1,
|
|
91
|
-
length = props.length;
|
|
92
|
-
|
|
93
|
-
while (++index < length) {
|
|
94
|
-
var key = props[index];
|
|
95
|
-
|
|
96
|
-
var newValue = undefined;
|
|
97
|
-
|
|
98
|
-
if (newValue === undefined) {
|
|
99
|
-
newValue = source[key];
|
|
100
|
-
}
|
|
101
|
-
if (isNew) {
|
|
102
|
-
baseAssignValue(object, key, newValue);
|
|
103
|
-
} else {
|
|
104
|
-
assignValue(object, key, newValue);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return object;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The base implementation of `_.assign` without support for multiple sources
|
|
112
|
-
* or `customizer` functions.
|
|
113
|
-
*
|
|
114
|
-
* @private
|
|
115
|
-
* @param {Object} object The destination object.
|
|
116
|
-
* @param {Object} source The source object.
|
|
117
|
-
* @returns {Object} Returns `object`.
|
|
118
|
-
*/
|
|
119
|
-
function baseAssign(object, source) {
|
|
120
|
-
return object && copyObject(source, keys(source), object);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The base implementation of `_.assignIn` without support for multiple sources
|
|
125
|
-
* or `customizer` functions.
|
|
126
|
-
*
|
|
127
|
-
* @private
|
|
128
|
-
* @param {Object} object The destination object.
|
|
129
|
-
* @param {Object} source The source object.
|
|
130
|
-
* @returns {Object} Returns `object`.
|
|
131
|
-
*/
|
|
132
|
-
function baseAssignIn(object, source) {
|
|
133
|
-
return object && copyObject(source, keysIn(source), object);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
57
|
/** Detect free variable `exports`. */
|
|
137
58
|
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
138
59
|
|
|
139
60
|
/** Detect free variable `module`. */
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
143
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
144
|
-
|
|
145
|
-
/** Built-in value references. */
|
|
146
|
-
var Buffer = moduleExports ? root.Buffer : undefined,
|
|
147
|
-
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
61
|
+
freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
|
148
62
|
|
|
149
63
|
/**
|
|
150
64
|
* Creates a clone of `buffer`.
|
|
@@ -155,38 +69,9 @@ var Buffer = moduleExports ? root.Buffer : undefined,
|
|
|
155
69
|
* @returns {Buffer} Returns the cloned buffer.
|
|
156
70
|
*/
|
|
157
71
|
function cloneBuffer(buffer, isDeep) {
|
|
158
|
-
|
|
72
|
+
{
|
|
159
73
|
return buffer.slice();
|
|
160
74
|
}
|
|
161
|
-
var length = buffer.length,
|
|
162
|
-
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
163
|
-
|
|
164
|
-
buffer.copy(result);
|
|
165
|
-
return result;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Copies own symbols of `source` to `object`.
|
|
170
|
-
*
|
|
171
|
-
* @private
|
|
172
|
-
* @param {Object} source The object to copy symbols from.
|
|
173
|
-
* @param {Object} [object={}] The object to copy symbols to.
|
|
174
|
-
* @returns {Object} Returns `object`.
|
|
175
|
-
*/
|
|
176
|
-
function copySymbols(source, object) {
|
|
177
|
-
return copyObject(source, getSymbols(source), object);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Copies own and inherited symbols of `source` to `object`.
|
|
182
|
-
*
|
|
183
|
-
* @private
|
|
184
|
-
* @param {Object} source The object to copy symbols from.
|
|
185
|
-
* @param {Object} [object={}] The object to copy symbols to.
|
|
186
|
-
* @returns {Object} Returns `object`.
|
|
187
|
-
*/
|
|
188
|
-
function copySymbolsIn(source, object) {
|
|
189
|
-
return copyObject(source, getSymbolsIn(source), object);
|
|
190
75
|
}
|
|
191
76
|
|
|
192
77
|
/** Used for built-in method references. */
|
|
@@ -236,7 +121,7 @@ function cloneArrayBuffer(arrayBuffer) {
|
|
|
236
121
|
* @returns {Object} Returns the cloned data view.
|
|
237
122
|
*/
|
|
238
123
|
function cloneDataView(dataView, isDeep) {
|
|
239
|
-
var buffer =
|
|
124
|
+
var buffer = cloneArrayBuffer(dataView.buffer) ;
|
|
240
125
|
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
241
126
|
}
|
|
242
127
|
|
|
@@ -280,7 +165,7 @@ function cloneSymbol(symbol) {
|
|
|
280
165
|
* @returns {Object} Returns the cloned typed array.
|
|
281
166
|
*/
|
|
282
167
|
function cloneTypedArray(typedArray, isDeep) {
|
|
283
|
-
var buffer =
|
|
168
|
+
var buffer = cloneArrayBuffer(typedArray.buffer) ;
|
|
284
169
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
285
170
|
}
|
|
286
171
|
|
|
@@ -329,12 +214,12 @@ function initCloneByTag(object, tag, isDeep) {
|
|
|
329
214
|
return new Ctor(+object);
|
|
330
215
|
|
|
331
216
|
case dataViewTag$1:
|
|
332
|
-
return cloneDataView(object
|
|
217
|
+
return cloneDataView(object);
|
|
333
218
|
|
|
334
219
|
case float32Tag$1: case float64Tag$1:
|
|
335
220
|
case int8Tag$1: case int16Tag$1: case int32Tag$1:
|
|
336
221
|
case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
|
|
337
|
-
return cloneTypedArray(object
|
|
222
|
+
return cloneTypedArray(object);
|
|
338
223
|
|
|
339
224
|
case mapTag$2:
|
|
340
225
|
return new Ctor;
|
|
@@ -439,11 +324,6 @@ var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
|
439
324
|
*/
|
|
440
325
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
441
326
|
|
|
442
|
-
/** Used to compose bitmasks for cloning. */
|
|
443
|
-
var CLONE_DEEP_FLAG$1 = 1,
|
|
444
|
-
CLONE_FLAT_FLAG = 2,
|
|
445
|
-
CLONE_SYMBOLS_FLAG$1 = 4;
|
|
446
|
-
|
|
447
327
|
/** `Object#toString` result references. */
|
|
448
328
|
var argsTag = '[object Arguments]',
|
|
449
329
|
arrayTag = '[object Array]',
|
|
@@ -506,14 +386,7 @@ cloneableTags[weakMapTag] = false;
|
|
|
506
386
|
* @returns {*} Returns the cloned value.
|
|
507
387
|
*/
|
|
508
388
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
509
|
-
var result
|
|
510
|
-
isDeep = bitmask & CLONE_DEEP_FLAG$1,
|
|
511
|
-
isFlat = bitmask & CLONE_FLAT_FLAG,
|
|
512
|
-
isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
|
|
513
|
-
|
|
514
|
-
if (customizer) {
|
|
515
|
-
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
516
|
-
}
|
|
389
|
+
var result;
|
|
517
390
|
if (result !== undefined) {
|
|
518
391
|
return result;
|
|
519
392
|
}
|
|
@@ -523,28 +396,20 @@ function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
|
523
396
|
var isArr = isArray(value);
|
|
524
397
|
if (isArr) {
|
|
525
398
|
result = initCloneArray(value);
|
|
526
|
-
if (!isDeep) {
|
|
527
|
-
return copyArray(value, result);
|
|
528
|
-
}
|
|
529
399
|
} else {
|
|
530
400
|
var tag = getTag(value),
|
|
531
401
|
isFunc = tag == funcTag || tag == genTag;
|
|
532
402
|
|
|
533
403
|
if (isBuffer(value)) {
|
|
534
|
-
return cloneBuffer(value
|
|
404
|
+
return cloneBuffer(value);
|
|
535
405
|
}
|
|
536
406
|
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
|
|
537
|
-
result = (
|
|
538
|
-
if (!isDeep) {
|
|
539
|
-
return isFlat
|
|
540
|
-
? copySymbolsIn(value, baseAssignIn(result, value))
|
|
541
|
-
: copySymbols(value, baseAssign(result, value));
|
|
542
|
-
}
|
|
407
|
+
result = (isFunc) ? {} : initCloneObject(value);
|
|
543
408
|
} else {
|
|
544
409
|
if (!cloneableTags[tag]) {
|
|
545
410
|
return object ? value : {};
|
|
546
411
|
}
|
|
547
|
-
result = initCloneByTag(value, tag
|
|
412
|
+
result = initCloneByTag(value, tag);
|
|
548
413
|
}
|
|
549
414
|
}
|
|
550
415
|
// Check for circular references and return its corresponding clone.
|
|
@@ -565,9 +430,8 @@ function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
|
565
430
|
});
|
|
566
431
|
}
|
|
567
432
|
|
|
568
|
-
var keysFunc =
|
|
569
|
-
|
|
570
|
-
: (isFlat ? keysIn : keys);
|
|
433
|
+
var keysFunc = (getAllKeys)
|
|
434
|
+
;
|
|
571
435
|
|
|
572
436
|
var props = isArr ? undefined : keysFunc(value);
|
|
573
437
|
arrayEach(props || value, function(subValue, key) {
|
|
@@ -607,4 +471,4 @@ function cloneDeep(value) {
|
|
|
607
471
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
608
472
|
}
|
|
609
473
|
|
|
610
|
-
export {
|
|
474
|
+
export { cloneDeep as c };
|