@jobber/components 6.103.2-JOB-140609-8386817.45 → 6.103.2-JOB-141426-ee803fd.19
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/Autocomplete/Autocomplete.types.d.ts +1 -12
- package/dist/Autocomplete/components/MenuList.d.ts +2 -1
- package/dist/Autocomplete/components/PersistentRegion.d.ts +2 -1
- package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +2 -1
- package/dist/Autocomplete/index.cjs +85 -35
- package/dist/Autocomplete/index.mjs +86 -36
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +13 -0
- package/dist/Autocomplete/useAutocomplete.d.ts +1 -0
- package/dist/Checkbox/Checkbox.types.d.ts +9 -2
- package/dist/Checkbox/index.cjs +2 -4
- package/dist/Checkbox/index.mjs +2 -4
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
- package/dist/Chips/index.cjs +2 -2
- package/dist/Chips/index.mjs +2 -2
- package/dist/DataList/components/DataListSearch/index.cjs +12 -1
- package/dist/DataList/components/DataListSearch/index.mjs +12 -1
- package/dist/DataList/index.cjs +8 -0
- package/dist/DataList/index.mjs +8 -0
- package/dist/DataTable/index.cjs +2 -2
- package/dist/DataTable/index.mjs +2 -2
- package/dist/DatePicker/index.cjs +2 -2
- package/dist/DatePicker/index.mjs +2 -2
- package/dist/DatePicker-es.js +1 -1
- package/dist/FormField/FormFieldTypes.d.ts +2 -0
- package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +2 -7
- package/dist/FormField-cjs.js +6 -1
- package/dist/FormField-es.js +6 -2
- package/dist/InputDate/index.cjs +9 -5
- package/dist/InputDate/index.mjs +9 -5
- package/dist/InputDate/useInputDateActivatorActions.d.ts +8 -4
- package/dist/InputEmail/InputEmail.types.d.ts +20 -12
- package/dist/InputEmail/hooks/useInputEmailActions.d.ts +1 -1
- package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +32 -0
- package/dist/InputEmail/index.cjs +44 -8
- package/dist/InputEmail/index.mjs +44 -8
- package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +3 -20
- package/dist/InputNumber/index.cjs +3 -3
- package/dist/InputNumber/index.mjs +3 -3
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +27 -13
- package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +1 -1
- package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +71 -0
- package/dist/InputPhoneNumber/index.cjs +34 -17
- package/dist/InputPhoneNumber/index.mjs +34 -17
- package/dist/InputText/InputText.types.d.ts +24 -24
- package/dist/InputText/index.cjs +54 -54
- package/dist/InputText/index.mjs +55 -55
- package/dist/InputText/useInputTextActions.d.ts +1 -1
- package/dist/InputText/useInputTextFormField.d.ts +352 -0
- package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
- package/dist/InputTime/InputTime.types.d.ts +1 -21
- package/dist/InputTime/index.cjs +33 -63
- package/dist/InputTime/index.d.ts +1 -1
- package/dist/InputTime/index.mjs +36 -66
- package/dist/List/index.cjs +2 -2
- package/dist/List/index.mjs +2 -2
- package/dist/RecurringSelect/index.cjs +2 -2
- package/dist/RecurringSelect/index.mjs +2 -2
- package/dist/Select/Select.rebuilt.d.ts +1 -1
- package/dist/Select/Select.types.d.ts +1 -14
- package/dist/Select/hooks/useSelectActions.d.ts +5 -5
- package/dist/Select/hooks/useSelectFormField.d.ts +34 -0
- package/dist/Select/index.cjs +41 -28
- package/dist/Select/index.d.ts +5 -7
- package/dist/Select/index.mjs +43 -30
- package/dist/Tabs-es.js +1 -1
- package/dist/_baseEach-cjs.js +12 -12
- package/dist/_baseEach-es.js +1 -1
- package/dist/_baseFlatten-cjs.js +2 -2
- package/dist/_baseFlatten-es.js +1 -1
- package/dist/{_getAllKeys-cjs.js → _baseGet-cjs.js} +181 -181
- package/dist/{_getAllKeys-es.js → _baseGet-es.js} +182 -182
- package/dist/debounce-es.js +1 -1
- package/dist/floating-ui.react-cjs.js +115 -0
- package/dist/floating-ui.react-es.js +115 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/omit-cjs.js +14 -14
- package/dist/omit-es.js +1 -1
- package/dist/sharedHelpers/types.d.ts +0 -235
- package/dist/styles.css +3 -0
- package/dist/useScrollToActive-cjs.js +3 -3
- package/dist/useScrollToActive-es.js +2 -2
- package/package.json +2 -2
- package/dist/InputTime/hooks/useInputTimeActions.d.ts +0 -16
package/dist/Select/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React__default, {
|
|
1
|
+
import React__default, { useRef, useId } from 'react';
|
|
2
2
|
import { o as omit } from '../omit-es.js';
|
|
3
|
-
import { k as FormField, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix
|
|
3
|
+
import { k as FormField, j as useFormFieldWrapperStyles, b as useAtlantisFormFieldName, f as FormFieldWrapper, l as FormFieldPostFix } from '../FormField-es.js';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import '../tslib.es6-es.js';
|
|
6
6
|
import 'react-hook-form';
|
|
@@ -9,12 +9,12 @@ import 'framer-motion';
|
|
|
9
9
|
import '@jobber/design';
|
|
10
10
|
import '../Button-es.js';
|
|
11
11
|
import '../_commonjsHelpers-es.js';
|
|
12
|
-
import '../
|
|
12
|
+
import '../_baseGet-es.js';
|
|
13
13
|
import '../isTypedArray-es.js';
|
|
14
14
|
import '../isObjectLike-es.js';
|
|
15
|
-
import '../isSymbol-es.js';
|
|
16
15
|
import '../identity-es.js';
|
|
17
16
|
import '../_getTag-es.js';
|
|
17
|
+
import '../isSymbol-es.js';
|
|
18
18
|
import '../keysIn-es.js';
|
|
19
19
|
import '../_baseAssignValue-es.js';
|
|
20
20
|
import '../_baseFlatten-es.js';
|
|
@@ -40,11 +40,11 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
40
40
|
const newValue = event.currentTarget.value;
|
|
41
41
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue, event);
|
|
42
42
|
}
|
|
43
|
-
function handleBlur(
|
|
44
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(
|
|
43
|
+
function handleBlur() {
|
|
44
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
45
45
|
}
|
|
46
|
-
function handleFocus(
|
|
47
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(
|
|
46
|
+
function handleFocus() {
|
|
47
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
50
|
handleChange,
|
|
@@ -53,22 +53,27 @@ function useSelectActions({ onChange, onBlur, onFocus, }) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Hook for managing the props of a Select component.
|
|
58
|
+
* Extracted from FormField's useAtlantisFormField.
|
|
59
|
+
*/
|
|
60
|
+
function useSelectFormField({ id, name, disabled, autofocus, description, inline, value, handleChange, handleBlur, handleFocus, }) {
|
|
61
|
+
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
62
|
+
const fieldProps = Object.assign({ id,
|
|
63
|
+
name,
|
|
64
|
+
disabled, autoFocus: autofocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, value }, (description &&
|
|
65
|
+
!inline && { "aria-describedby": descriptionIdentifier }));
|
|
66
|
+
return { fieldProps, descriptionIdentifier };
|
|
67
|
+
}
|
|
68
|
+
|
|
56
69
|
var styles = {"select":"-hmXAsAfH9U-","selectPostfix":"_5ST4c1fXDYU-","spinning":"oOACJmrVDf0-"};
|
|
57
70
|
|
|
58
|
-
|
|
59
|
-
var _a;
|
|
60
|
-
|
|
61
|
-
const { inputRef: deprecatedInputRef } = props;
|
|
62
|
-
const internalRef = useRef(null);
|
|
63
|
-
const mergedRef = mergeRefs([
|
|
64
|
-
internalRef,
|
|
65
|
-
deprecatedInputRef,
|
|
66
|
-
forwardedRef,
|
|
67
|
-
]);
|
|
71
|
+
function SelectRebuilt(props) {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const selectRef = (_a = props.inputRef) !== null && _a !== void 0 ? _a : useRef(null);
|
|
68
74
|
const wrapperRef = useRef(null);
|
|
69
75
|
const { inputStyle } = useFormFieldWrapperStyles(Object.assign({}, omit(props, ["version"])));
|
|
70
76
|
const id = useSelectId(props);
|
|
71
|
-
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
72
77
|
const { name } = useAtlantisFormFieldName({
|
|
73
78
|
nameProp: props.name,
|
|
74
79
|
id: id,
|
|
@@ -78,15 +83,24 @@ const SelectRebuilt = forwardRef(function SelectRebuilt(props, forwardedRef) {
|
|
|
78
83
|
onBlur: props.onBlur,
|
|
79
84
|
onFocus: props.onFocus,
|
|
80
85
|
});
|
|
81
|
-
const
|
|
82
|
-
|
|
86
|
+
const inputProps = omit(props, [
|
|
87
|
+
"onChange",
|
|
88
|
+
"onBlur",
|
|
89
|
+
"onFocus",
|
|
90
|
+
"size",
|
|
91
|
+
"placeholder",
|
|
92
|
+
"version",
|
|
93
|
+
]);
|
|
94
|
+
const { fieldProps, descriptionIdentifier } = useSelectFormField(Object.assign(Object.assign({}, inputProps), { id,
|
|
95
|
+
name,
|
|
96
|
+
handleChange,
|
|
97
|
+
handleBlur,
|
|
98
|
+
handleFocus }));
|
|
99
|
+
return (React__default.createElement(FormFieldWrapper, { disabled: props.disabled, size: props.size, align: props.align, inline: props.inline, autofocus: props.autofocus, name: name, wrapperRef: wrapperRef, error: (_b = props.error) !== null && _b !== void 0 ? _b : "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, description: props.description, type: "select", placeholder: props.placeholder, value: props.value, prefix: props.prefix, suffix: props.suffix, clearable: "never", maxLength: props.maxLength },
|
|
83
100
|
React__default.createElement(React__default.Fragment, null,
|
|
84
|
-
React__default.createElement("select", {
|
|
85
|
-
(props.description && !props.inline
|
|
86
|
-
? descriptionIdentifier
|
|
87
|
-
: undefined), "aria-invalid": isInvalid ? true : undefined, "aria-required": props.ariaRequired, ref: mergedRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }, props.children),
|
|
101
|
+
React__default.createElement("select", Object.assign({}, fieldProps, { ref: selectRef, className: classnames(inputStyle, props.UNSAFE_experimentalStyles && styles.select) }), props.children),
|
|
88
102
|
React__default.createElement(FormFieldPostFix, { variation: "select", className: styles.selectPostfix }))));
|
|
89
|
-
}
|
|
103
|
+
}
|
|
90
104
|
function useSelectId(props) {
|
|
91
105
|
const generatedId = useId();
|
|
92
106
|
return props.id || generatedId;
|
|
@@ -103,15 +117,14 @@ function OptionGroup({ children, label, disabled, UNSAFE_className, UNSAFE_style
|
|
|
103
117
|
function isNewSelectProps(props) {
|
|
104
118
|
return props.version === 2;
|
|
105
119
|
}
|
|
106
|
-
|
|
120
|
+
function Select(props) {
|
|
107
121
|
if (isNewSelectProps(props)) {
|
|
108
|
-
return React__default.createElement(SelectRebuilt, Object.assign({}, props
|
|
122
|
+
return React__default.createElement(SelectRebuilt, Object.assign({}, props));
|
|
109
123
|
}
|
|
110
124
|
else {
|
|
111
125
|
return React__default.createElement(Select$1, Object.assign({}, props));
|
|
112
126
|
}
|
|
113
|
-
}
|
|
114
|
-
const Select = SelectBase;
|
|
127
|
+
}
|
|
115
128
|
Select.Option = SelectOption;
|
|
116
129
|
Select.OptionGroup = OptionGroup;
|
|
117
130
|
|
package/dist/Tabs-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
|
4
|
-
import {
|
|
4
|
+
import { a as debounce_1 } from './debounce-es.js';
|
|
5
5
|
import { a as isObject_1 } from './isObjectLike-es.js';
|
|
6
6
|
import { T as Typography } from './Typography-es.js';
|
|
7
7
|
|
package/dist/_baseEach-cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var identity$1 = require('./identity-cjs.js');
|
|
4
4
|
var isObjectLike$1 = require('./isObjectLike-cjs.js');
|
|
5
|
-
var
|
|
5
|
+
var _baseGet = require('./_baseGet-cjs.js');
|
|
6
6
|
var _getTag = require('./_getTag-cjs.js');
|
|
7
7
|
var isTypedArray$1 = require('./isTypedArray-cjs.js');
|
|
8
8
|
var _commonjsHelpers = require('./_commonjsHelpers-cjs.js');
|
|
@@ -351,7 +351,7 @@ function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack)
|
|
|
351
351
|
|
|
352
352
|
var _equalByTag = equalByTag$1;
|
|
353
353
|
|
|
354
|
-
var getAllKeys =
|
|
354
|
+
var getAllKeys = _baseGet._getAllKeys;
|
|
355
355
|
|
|
356
356
|
/** Used to compose bitmasks for value comparisons. */
|
|
357
357
|
var COMPARE_PARTIAL_FLAG$3 = 1;
|
|
@@ -635,7 +635,7 @@ function isStrictComparable$2(value) {
|
|
|
635
635
|
var _isStrictComparable = isStrictComparable$2;
|
|
636
636
|
|
|
637
637
|
var isStrictComparable$1 = _isStrictComparable,
|
|
638
|
-
keys$1 =
|
|
638
|
+
keys$1 = _baseGet.keys_1;
|
|
639
639
|
|
|
640
640
|
/**
|
|
641
641
|
* Gets the property names, values, and compare flags of `object`.
|
|
@@ -704,7 +704,7 @@ function baseMatches$1(source) {
|
|
|
704
704
|
|
|
705
705
|
var _baseMatches = baseMatches$1;
|
|
706
706
|
|
|
707
|
-
var baseGet$1 =
|
|
707
|
+
var baseGet$1 = _baseGet._baseGet;
|
|
708
708
|
|
|
709
709
|
/**
|
|
710
710
|
* Gets the value at `path` of `object`. If the resolved value is
|
|
@@ -755,12 +755,12 @@ function baseHasIn$1(object, key) {
|
|
|
755
755
|
|
|
756
756
|
var _baseHasIn = baseHasIn$1;
|
|
757
757
|
|
|
758
|
-
var castPath =
|
|
758
|
+
var castPath = _baseGet._castPath,
|
|
759
759
|
isArguments = isTypedArray$1.isArguments_1,
|
|
760
760
|
isArray$1 = isTypedArray$1.isArray_1,
|
|
761
761
|
isIndex = identity$1._isIndex,
|
|
762
762
|
isLength = isTypedArray$1.isLength_1,
|
|
763
|
-
toKey$2 =
|
|
763
|
+
toKey$2 = _baseGet._toKey;
|
|
764
764
|
|
|
765
765
|
/**
|
|
766
766
|
* Checks if `path` exists on `object`.
|
|
@@ -833,10 +833,10 @@ var hasIn_1 = hasIn$1;
|
|
|
833
833
|
var baseIsEqual = _baseIsEqual,
|
|
834
834
|
get = get_1,
|
|
835
835
|
hasIn = hasIn_1,
|
|
836
|
-
isKey$1 =
|
|
836
|
+
isKey$1 = _baseGet._isKey,
|
|
837
837
|
isStrictComparable = _isStrictComparable,
|
|
838
838
|
matchesStrictComparable = _matchesStrictComparable,
|
|
839
|
-
toKey$1 =
|
|
839
|
+
toKey$1 = _baseGet._toKey;
|
|
840
840
|
|
|
841
841
|
/** Used to compose bitmasks for value comparisons. */
|
|
842
842
|
var COMPARE_PARTIAL_FLAG = 1,
|
|
@@ -880,7 +880,7 @@ function baseProperty$1(key) {
|
|
|
880
880
|
|
|
881
881
|
var _baseProperty = baseProperty$1;
|
|
882
882
|
|
|
883
|
-
var baseGet =
|
|
883
|
+
var baseGet = _baseGet._baseGet;
|
|
884
884
|
|
|
885
885
|
/**
|
|
886
886
|
* A specialized version of `baseProperty` which supports deep paths.
|
|
@@ -899,8 +899,8 @@ var _basePropertyDeep = basePropertyDeep$1;
|
|
|
899
899
|
|
|
900
900
|
var baseProperty = _baseProperty,
|
|
901
901
|
basePropertyDeep = _basePropertyDeep,
|
|
902
|
-
isKey =
|
|
903
|
-
toKey =
|
|
902
|
+
isKey = _baseGet._isKey,
|
|
903
|
+
toKey = _baseGet._toKey;
|
|
904
904
|
|
|
905
905
|
/**
|
|
906
906
|
* Creates a function that returns the value at `path` of a given object.
|
|
@@ -963,7 +963,7 @@ function baseIteratee(value) {
|
|
|
963
963
|
var _baseIteratee = baseIteratee;
|
|
964
964
|
|
|
965
965
|
var baseFor = _baseFor._baseFor,
|
|
966
|
-
keys =
|
|
966
|
+
keys = _baseGet.keys_1;
|
|
967
967
|
|
|
968
968
|
/**
|
|
969
969
|
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
package/dist/_baseEach-es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as _MapCache, d as _Uint8Array, e as eq_1, c as _Stack, a as _isIndex, i as identity_1 } from './identity-es.js';
|
|
2
2
|
import { b as _Symbol, i as isObjectLike_1, a as isObject_1 } from './isObjectLike-es.js';
|
|
3
|
-
import { e as _getAllKeys, k as keys_1, b as _baseGet, f as _castPath, g as _toKey, h as _isKey } from './
|
|
3
|
+
import { e as _getAllKeys, k as keys_1, b as _baseGet, f as _castPath, g as _toKey, h as _isKey } from './_baseGet-es.js';
|
|
4
4
|
import { a as _getTag } from './_getTag-es.js';
|
|
5
5
|
import { c as isBufferExports, d as isTypedArray_1, a as isArray_1, i as isArguments_1, m as isLength_1, b as isArrayLike_1 } from './isTypedArray-es.js';
|
|
6
6
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-es.js';
|
package/dist/_baseFlatten-cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _baseGet = require('./_baseGet-cjs.js');
|
|
4
4
|
var isObjectLike = require('./isObjectLike-cjs.js');
|
|
5
5
|
var isTypedArray = require('./isTypedArray-cjs.js');
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ function isFlattenable$1(value) {
|
|
|
25
25
|
|
|
26
26
|
var _isFlattenable = isFlattenable$1;
|
|
27
27
|
|
|
28
|
-
var arrayPush =
|
|
28
|
+
var arrayPush = _baseGet._arrayPush,
|
|
29
29
|
isFlattenable = _isFlattenable;
|
|
30
30
|
|
|
31
31
|
/**
|
package/dist/_baseFlatten-es.js
CHANGED
|
@@ -1,10 +1,154 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var isTypedArray = require('./isTypedArray-cjs.js');
|
|
4
|
-
var isSymbol$3 = require('./isSymbol-cjs.js');
|
|
5
4
|
var identity = require('./identity-cjs.js');
|
|
6
|
-
var isObjectLike = require('./isObjectLike-cjs.js');
|
|
7
5
|
var _getTag = require('./_getTag-cjs.js');
|
|
6
|
+
var isSymbol$3 = require('./isSymbol-cjs.js');
|
|
7
|
+
var isObjectLike = require('./isObjectLike-cjs.js');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A specialized version of `_.map` for arrays without support for iteratee
|
|
11
|
+
* shorthands.
|
|
12
|
+
*
|
|
13
|
+
* @private
|
|
14
|
+
* @param {Array} [array] The array to iterate over.
|
|
15
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
16
|
+
* @returns {Array} Returns the new mapped array.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function arrayMap$1(array, iteratee) {
|
|
20
|
+
var index = -1,
|
|
21
|
+
length = array == null ? 0 : array.length,
|
|
22
|
+
result = Array(length);
|
|
23
|
+
|
|
24
|
+
while (++index < length) {
|
|
25
|
+
result[index] = iteratee(array[index], index, array);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var _arrayMap = arrayMap$1;
|
|
31
|
+
|
|
32
|
+
var arrayLikeKeys = identity._arrayLikeKeys,
|
|
33
|
+
baseKeys = _getTag._baseKeys,
|
|
34
|
+
isArrayLike = isTypedArray.isArrayLike_1;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Creates an array of the own enumerable property names of `object`.
|
|
38
|
+
*
|
|
39
|
+
* **Note:** Non-object values are coerced to objects. See the
|
|
40
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
41
|
+
* for more details.
|
|
42
|
+
*
|
|
43
|
+
* @static
|
|
44
|
+
* @since 0.1.0
|
|
45
|
+
* @memberOf _
|
|
46
|
+
* @category Object
|
|
47
|
+
* @param {Object} object The object to query.
|
|
48
|
+
* @returns {Array} Returns the array of property names.
|
|
49
|
+
* @example
|
|
50
|
+
*
|
|
51
|
+
* function Foo() {
|
|
52
|
+
* this.a = 1;
|
|
53
|
+
* this.b = 2;
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* Foo.prototype.c = 3;
|
|
57
|
+
*
|
|
58
|
+
* _.keys(new Foo);
|
|
59
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
60
|
+
*
|
|
61
|
+
* _.keys('hi');
|
|
62
|
+
* // => ['0', '1']
|
|
63
|
+
*/
|
|
64
|
+
function keys$1(object) {
|
|
65
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var keys_1 = keys$1;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A specialized version of `_.filter` for arrays without support for
|
|
72
|
+
* iteratee shorthands.
|
|
73
|
+
*
|
|
74
|
+
* @private
|
|
75
|
+
* @param {Array} [array] The array to iterate over.
|
|
76
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
77
|
+
* @returns {Array} Returns the new filtered array.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
function arrayFilter$1(array, predicate) {
|
|
81
|
+
var index = -1,
|
|
82
|
+
length = array == null ? 0 : array.length,
|
|
83
|
+
resIndex = 0,
|
|
84
|
+
result = [];
|
|
85
|
+
|
|
86
|
+
while (++index < length) {
|
|
87
|
+
var value = array[index];
|
|
88
|
+
if (predicate(value, index, array)) {
|
|
89
|
+
result[resIndex++] = value;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var _arrayFilter = arrayFilter$1;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* This method returns a new empty array.
|
|
99
|
+
*
|
|
100
|
+
* @static
|
|
101
|
+
* @memberOf _
|
|
102
|
+
* @since 4.13.0
|
|
103
|
+
* @category Util
|
|
104
|
+
* @returns {Array} Returns the new empty array.
|
|
105
|
+
* @example
|
|
106
|
+
*
|
|
107
|
+
* var arrays = _.times(2, _.stubArray);
|
|
108
|
+
*
|
|
109
|
+
* console.log(arrays);
|
|
110
|
+
* // => [[], []]
|
|
111
|
+
*
|
|
112
|
+
* console.log(arrays[0] === arrays[1]);
|
|
113
|
+
* // => false
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
function stubArray$1() {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
var stubArray_1 = stubArray$1;
|
|
121
|
+
|
|
122
|
+
var arrayFilter = _arrayFilter,
|
|
123
|
+
stubArray = stubArray_1;
|
|
124
|
+
|
|
125
|
+
/** Used for built-in method references. */
|
|
126
|
+
var objectProto = Object.prototype;
|
|
127
|
+
|
|
128
|
+
/** Built-in value references. */
|
|
129
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
130
|
+
|
|
131
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
132
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Creates an array of the own enumerable symbols of `object`.
|
|
136
|
+
*
|
|
137
|
+
* @private
|
|
138
|
+
* @param {Object} object The object to query.
|
|
139
|
+
* @returns {Array} Returns the array of symbols.
|
|
140
|
+
*/
|
|
141
|
+
var getSymbols$1 = !nativeGetSymbols ? stubArray : function(object) {
|
|
142
|
+
if (object == null) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
object = Object(object);
|
|
146
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
147
|
+
return propertyIsEnumerable.call(object, symbol);
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
var _getSymbols = getSymbols$1;
|
|
8
152
|
|
|
9
153
|
/**
|
|
10
154
|
* Appends the elements of `values` to `array`.
|
|
@@ -28,30 +172,45 @@ function arrayPush$1(array, values) {
|
|
|
28
172
|
|
|
29
173
|
var _arrayPush = arrayPush$1;
|
|
30
174
|
|
|
175
|
+
var arrayPush = _arrayPush,
|
|
176
|
+
isArray$3 = isTypedArray.isArray_1;
|
|
177
|
+
|
|
31
178
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
179
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
180
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
181
|
+
* symbols of `object`.
|
|
34
182
|
*
|
|
35
183
|
* @private
|
|
36
|
-
* @param {
|
|
37
|
-
* @param {Function}
|
|
38
|
-
* @
|
|
184
|
+
* @param {Object} object The object to query.
|
|
185
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
186
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
187
|
+
* @returns {Array} Returns the array of property names and symbols.
|
|
39
188
|
*/
|
|
189
|
+
function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
|
|
190
|
+
var result = keysFunc(object);
|
|
191
|
+
return isArray$3(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
192
|
+
}
|
|
40
193
|
|
|
41
|
-
|
|
42
|
-
var index = -1,
|
|
43
|
-
length = array == null ? 0 : array.length,
|
|
44
|
-
result = Array(length);
|
|
194
|
+
var _baseGetAllKeys = baseGetAllKeys$1;
|
|
45
195
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
196
|
+
var baseGetAllKeys = _baseGetAllKeys,
|
|
197
|
+
getSymbols = _getSymbols,
|
|
198
|
+
keys = keys_1;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Creates an array of own enumerable property names and symbols of `object`.
|
|
202
|
+
*
|
|
203
|
+
* @private
|
|
204
|
+
* @param {Object} object The object to query.
|
|
205
|
+
* @returns {Array} Returns the array of property names and symbols.
|
|
206
|
+
*/
|
|
207
|
+
function getAllKeys(object) {
|
|
208
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
|
50
209
|
}
|
|
51
210
|
|
|
52
|
-
var
|
|
211
|
+
var _getAllKeys = getAllKeys;
|
|
53
212
|
|
|
54
|
-
var isArray$
|
|
213
|
+
var isArray$2 = isTypedArray.isArray_1,
|
|
55
214
|
isSymbol$2 = isSymbol$3.isSymbol_1;
|
|
56
215
|
|
|
57
216
|
/** Used to match property names within property paths. */
|
|
@@ -67,7 +226,7 @@ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
|
67
226
|
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
68
227
|
*/
|
|
69
228
|
function isKey$1(value, object) {
|
|
70
|
-
if (isArray$
|
|
229
|
+
if (isArray$2(value)) {
|
|
71
230
|
return false;
|
|
72
231
|
}
|
|
73
232
|
var type = typeof value;
|
|
@@ -212,7 +371,7 @@ var _stringToPath = stringToPath$1;
|
|
|
212
371
|
|
|
213
372
|
var Symbol = isObjectLike._Symbol,
|
|
214
373
|
arrayMap = _arrayMap,
|
|
215
|
-
isArray$
|
|
374
|
+
isArray$1 = isTypedArray.isArray_1,
|
|
216
375
|
isSymbol$1 = isSymbol$3.isSymbol_1;
|
|
217
376
|
|
|
218
377
|
/** Used as references for various `Number` constants. */
|
|
@@ -235,7 +394,7 @@ function baseToString$1(value) {
|
|
|
235
394
|
if (typeof value == 'string') {
|
|
236
395
|
return value;
|
|
237
396
|
}
|
|
238
|
-
if (isArray$
|
|
397
|
+
if (isArray$1(value)) {
|
|
239
398
|
// Recursively convert values (susceptible to call stack limits).
|
|
240
399
|
return arrayMap(value, baseToString$1) + '';
|
|
241
400
|
}
|
|
@@ -277,7 +436,7 @@ function toString$1(value) {
|
|
|
277
436
|
|
|
278
437
|
var toString_1 = toString$1;
|
|
279
438
|
|
|
280
|
-
var isArray
|
|
439
|
+
var isArray = isTypedArray.isArray_1,
|
|
281
440
|
isKey = _isKey,
|
|
282
441
|
stringToPath = _stringToPath,
|
|
283
442
|
toString = toString_1;
|
|
@@ -291,7 +450,7 @@ var isArray$1 = isTypedArray.isArray_1,
|
|
|
291
450
|
* @returns {Array} Returns the cast property path array.
|
|
292
451
|
*/
|
|
293
452
|
function castPath$1(value, object) {
|
|
294
|
-
if (isArray
|
|
453
|
+
if (isArray(value)) {
|
|
295
454
|
return value;
|
|
296
455
|
}
|
|
297
456
|
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
@@ -346,165 +505,6 @@ function baseGet(object, path) {
|
|
|
346
505
|
|
|
347
506
|
var _baseGet = baseGet;
|
|
348
507
|
|
|
349
|
-
var arrayPush = _arrayPush,
|
|
350
|
-
isArray = isTypedArray.isArray_1;
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
354
|
-
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
355
|
-
* symbols of `object`.
|
|
356
|
-
*
|
|
357
|
-
* @private
|
|
358
|
-
* @param {Object} object The object to query.
|
|
359
|
-
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
360
|
-
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
361
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
362
|
-
*/
|
|
363
|
-
function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
|
|
364
|
-
var result = keysFunc(object);
|
|
365
|
-
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
var _baseGetAllKeys = baseGetAllKeys$1;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* A specialized version of `_.filter` for arrays without support for
|
|
372
|
-
* iteratee shorthands.
|
|
373
|
-
*
|
|
374
|
-
* @private
|
|
375
|
-
* @param {Array} [array] The array to iterate over.
|
|
376
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
377
|
-
* @returns {Array} Returns the new filtered array.
|
|
378
|
-
*/
|
|
379
|
-
|
|
380
|
-
function arrayFilter$1(array, predicate) {
|
|
381
|
-
var index = -1,
|
|
382
|
-
length = array == null ? 0 : array.length,
|
|
383
|
-
resIndex = 0,
|
|
384
|
-
result = [];
|
|
385
|
-
|
|
386
|
-
while (++index < length) {
|
|
387
|
-
var value = array[index];
|
|
388
|
-
if (predicate(value, index, array)) {
|
|
389
|
-
result[resIndex++] = value;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return result;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
var _arrayFilter = arrayFilter$1;
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* This method returns a new empty array.
|
|
399
|
-
*
|
|
400
|
-
* @static
|
|
401
|
-
* @memberOf _
|
|
402
|
-
* @since 4.13.0
|
|
403
|
-
* @category Util
|
|
404
|
-
* @returns {Array} Returns the new empty array.
|
|
405
|
-
* @example
|
|
406
|
-
*
|
|
407
|
-
* var arrays = _.times(2, _.stubArray);
|
|
408
|
-
*
|
|
409
|
-
* console.log(arrays);
|
|
410
|
-
* // => [[], []]
|
|
411
|
-
*
|
|
412
|
-
* console.log(arrays[0] === arrays[1]);
|
|
413
|
-
* // => false
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
function stubArray$1() {
|
|
417
|
-
return [];
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
var stubArray_1 = stubArray$1;
|
|
421
|
-
|
|
422
|
-
var arrayFilter = _arrayFilter,
|
|
423
|
-
stubArray = stubArray_1;
|
|
424
|
-
|
|
425
|
-
/** Used for built-in method references. */
|
|
426
|
-
var objectProto = Object.prototype;
|
|
427
|
-
|
|
428
|
-
/** Built-in value references. */
|
|
429
|
-
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
430
|
-
|
|
431
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
432
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Creates an array of the own enumerable symbols of `object`.
|
|
436
|
-
*
|
|
437
|
-
* @private
|
|
438
|
-
* @param {Object} object The object to query.
|
|
439
|
-
* @returns {Array} Returns the array of symbols.
|
|
440
|
-
*/
|
|
441
|
-
var getSymbols$1 = !nativeGetSymbols ? stubArray : function(object) {
|
|
442
|
-
if (object == null) {
|
|
443
|
-
return [];
|
|
444
|
-
}
|
|
445
|
-
object = Object(object);
|
|
446
|
-
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
447
|
-
return propertyIsEnumerable.call(object, symbol);
|
|
448
|
-
});
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
var _getSymbols = getSymbols$1;
|
|
452
|
-
|
|
453
|
-
var arrayLikeKeys = identity._arrayLikeKeys,
|
|
454
|
-
baseKeys = _getTag._baseKeys,
|
|
455
|
-
isArrayLike = isTypedArray.isArrayLike_1;
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
* Creates an array of the own enumerable property names of `object`.
|
|
459
|
-
*
|
|
460
|
-
* **Note:** Non-object values are coerced to objects. See the
|
|
461
|
-
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
462
|
-
* for more details.
|
|
463
|
-
*
|
|
464
|
-
* @static
|
|
465
|
-
* @since 0.1.0
|
|
466
|
-
* @memberOf _
|
|
467
|
-
* @category Object
|
|
468
|
-
* @param {Object} object The object to query.
|
|
469
|
-
* @returns {Array} Returns the array of property names.
|
|
470
|
-
* @example
|
|
471
|
-
*
|
|
472
|
-
* function Foo() {
|
|
473
|
-
* this.a = 1;
|
|
474
|
-
* this.b = 2;
|
|
475
|
-
* }
|
|
476
|
-
*
|
|
477
|
-
* Foo.prototype.c = 3;
|
|
478
|
-
*
|
|
479
|
-
* _.keys(new Foo);
|
|
480
|
-
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
481
|
-
*
|
|
482
|
-
* _.keys('hi');
|
|
483
|
-
* // => ['0', '1']
|
|
484
|
-
*/
|
|
485
|
-
function keys$1(object) {
|
|
486
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
var keys_1 = keys$1;
|
|
490
|
-
|
|
491
|
-
var baseGetAllKeys = _baseGetAllKeys,
|
|
492
|
-
getSymbols = _getSymbols,
|
|
493
|
-
keys = keys_1;
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Creates an array of own enumerable property names and symbols of `object`.
|
|
497
|
-
*
|
|
498
|
-
* @private
|
|
499
|
-
* @param {Object} object The object to query.
|
|
500
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
501
|
-
*/
|
|
502
|
-
function getAllKeys(object) {
|
|
503
|
-
return baseGetAllKeys(object, keys, getSymbols);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
var _getAllKeys = getAllKeys;
|
|
507
|
-
|
|
508
508
|
exports._arrayMap = _arrayMap;
|
|
509
509
|
exports._arrayPush = _arrayPush;
|
|
510
510
|
exports._baseGet = _baseGet;
|