@carbon/ibm-products 2.70.0 → 2.71.0-rc.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/css/carbon.css +317 -216
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +546 -270
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +387 -43
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +229 -54
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +242 -56
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_commonjsHelpers.js +1 -3
- package/es/_virtual/index2.js +2 -6
- package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +4 -0
- package/es/components/ActionSet/ActionSet.js +46 -44
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/Card/Card.d.ts +1 -0
- package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/es/components/Coachmark/CoachmarkTagline.js +2 -2
- package/es/components/Coachmark/utils/context.d.ts +28 -2
- package/es/components/Coachmark/utils/context.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/util.js +11 -4
- package/es/components/CreateModal/CreateModal.d.ts +4 -7
- package/es/components/CreateModal/CreateModal.js +4 -19
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/es/components/EmptyStates/EmptyState.js +0 -1
- package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/es/components/FilterSummary/FilterSummary.js +2 -1
- package/es/components/Guidebanner/Guidebanner.js +4 -20
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
- package/es/components/InterstitialScreen/index.d.ts +4 -1
- package/es/components/Nav/NavItemLink.js +1 -4
- package/es/components/NotificationsPanel/NotificationsPanel.js +11 -21
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/es/components/PageHeader/next/PageHeader.js +475 -0
- package/es/components/PageHeader/next/index.d.ts +8 -0
- package/es/components/ScrollGradient/ScrollGradient.js +4 -4
- package/es/components/SidePanel/SidePanel.js +25 -20
- package/es/components/StringFormatter/StringFormatter.js +3 -0
- package/es/components/Tearsheet/Tearsheet.js +4 -7
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/es/components/Tearsheet/TearsheetShell.js +1 -1
- package/es/components/UserAvatar/UserAvatar.js +5 -7
- package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/es/components/UserProfileImage/UserProfileImage.js +12 -6
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +3 -0
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/node_modules/prop-types/index.js +1 -1
- package/lib/_virtual/_commonjsHelpers.js +0 -3
- package/lib/_virtual/index2.js +2 -8
- package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
- package/lib/components/ActionSet/ActionSet.d.ts +4 -0
- package/lib/components/ActionSet/ActionSet.js +46 -43
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/Card/Card.d.ts +1 -0
- package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
- package/lib/components/Coachmark/utils/context.d.ts +28 -2
- package/lib/components/Coachmark/utils/context.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/util.js +11 -4
- package/lib/components/CreateModal/CreateModal.d.ts +4 -7
- package/lib/components/CreateModal/CreateModal.js +4 -19
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/lib/components/EmptyStates/EmptyState.js +0 -1
- package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/lib/components/FilterSummary/FilterSummary.js +2 -1
- package/lib/components/Guidebanner/Guidebanner.js +4 -20
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
- package/lib/components/InterstitialScreen/index.d.ts +4 -1
- package/lib/components/Nav/NavItemLink.js +1 -4
- package/lib/components/NotificationsPanel/NotificationsPanel.js +11 -21
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/lib/components/PageHeader/next/PageHeader.js +490 -0
- package/lib/components/PageHeader/next/index.d.ts +8 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
- package/lib/components/SidePanel/SidePanel.js +26 -21
- package/lib/components/StringFormatter/StringFormatter.js +3 -0
- package/lib/components/Tearsheet/Tearsheet.js +4 -7
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/lib/components/Tearsheet/TearsheetShell.js +1 -1
- package/lib/components/UserAvatar/UserAvatar.js +5 -7
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -2
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/package.json +22 -30
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
- package/scss/components/PageHeader/_page-header.scss +198 -0
- package/scss/components/SidePanel/_side-panel.scss +2 -52
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +12 -13
- package/es/_virtual/index3.js +0 -10
- package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/es/components/SidePanel/resizer/Resizer.js +0 -271
- package/es/node_modules/lodash.debounce/index.js +0 -367
- package/lib/_virtual/index3.js +0 -12
- package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/lib/components/SidePanel/resizer/Resizer.js +0 -277
- package/lib/node_modules/lodash.debounce/index.js +0 -369
- /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
- /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -1,369 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright IBM Corp. 2020, 2025
|
3
|
-
*
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
6
|
-
*/
|
7
|
-
|
8
|
-
'use strict';
|
9
|
-
|
10
|
-
var _commonjsHelpers = require('../../_virtual/_commonjsHelpers.js');
|
11
|
-
|
12
|
-
var lodash_debounce;
|
13
|
-
var hasRequiredLodash_debounce;
|
14
|
-
function requireLodash_debounce() {
|
15
|
-
if (hasRequiredLodash_debounce) return lodash_debounce;
|
16
|
-
hasRequiredLodash_debounce = 1;
|
17
|
-
/** Used as the `TypeError` message for "Functions" methods. */
|
18
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
19
|
-
|
20
|
-
/** Used as references for various `Number` constants. */
|
21
|
-
var NAN = 0 / 0;
|
22
|
-
|
23
|
-
/** `Object#toString` result references. */
|
24
|
-
var symbolTag = '[object Symbol]';
|
25
|
-
|
26
|
-
/** Used to match leading and trailing whitespace. */
|
27
|
-
var reTrim = /^\s+|\s+$/g;
|
28
|
-
|
29
|
-
/** Used to detect bad signed hexadecimal string values. */
|
30
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
31
|
-
|
32
|
-
/** Used to detect binary string values. */
|
33
|
-
var reIsBinary = /^0b[01]+$/i;
|
34
|
-
|
35
|
-
/** Used to detect octal string values. */
|
36
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
37
|
-
|
38
|
-
/** Built-in method references without a dependency on `root`. */
|
39
|
-
var freeParseInt = parseInt;
|
40
|
-
|
41
|
-
/** Detect free variable `global` from Node.js. */
|
42
|
-
var freeGlobal = typeof _commonjsHelpers.commonjsGlobal == 'object' && _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.Object === Object && _commonjsHelpers.commonjsGlobal;
|
43
|
-
|
44
|
-
/** Detect free variable `self`. */
|
45
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
46
|
-
|
47
|
-
/** Used as a reference to the global object. */
|
48
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
49
|
-
|
50
|
-
/** Used for built-in method references. */
|
51
|
-
var objectProto = Object.prototype;
|
52
|
-
|
53
|
-
/**
|
54
|
-
* Used to resolve the
|
55
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
56
|
-
* of values.
|
57
|
-
*/
|
58
|
-
var objectToString = objectProto.toString;
|
59
|
-
|
60
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
61
|
-
var nativeMax = Math.max,
|
62
|
-
nativeMin = Math.min;
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Gets the timestamp of the number of milliseconds that have elapsed since
|
66
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
67
|
-
*
|
68
|
-
* @static
|
69
|
-
* @memberOf _
|
70
|
-
* @since 2.4.0
|
71
|
-
* @category Date
|
72
|
-
* @returns {number} Returns the timestamp.
|
73
|
-
* @example
|
74
|
-
*
|
75
|
-
* _.defer(function(stamp) {
|
76
|
-
* console.log(_.now() - stamp);
|
77
|
-
* }, _.now());
|
78
|
-
* // => Logs the number of milliseconds it took for the deferred invocation.
|
79
|
-
*/
|
80
|
-
var now = function () {
|
81
|
-
return root.Date.now();
|
82
|
-
};
|
83
|
-
|
84
|
-
/**
|
85
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
86
|
-
* milliseconds have elapsed since the last time the debounced function was
|
87
|
-
* invoked. The debounced function comes with a `cancel` method to cancel
|
88
|
-
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
89
|
-
* Provide `options` to indicate whether `func` should be invoked on the
|
90
|
-
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
91
|
-
* with the last arguments provided to the debounced function. Subsequent
|
92
|
-
* calls to the debounced function return the result of the last `func`
|
93
|
-
* invocation.
|
94
|
-
*
|
95
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
96
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
97
|
-
* is invoked more than once during the `wait` timeout.
|
98
|
-
*
|
99
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
100
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
101
|
-
*
|
102
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
103
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
104
|
-
*
|
105
|
-
* @static
|
106
|
-
* @memberOf _
|
107
|
-
* @since 0.1.0
|
108
|
-
* @category Function
|
109
|
-
* @param {Function} func The function to debounce.
|
110
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
111
|
-
* @param {Object} [options={}] The options object.
|
112
|
-
* @param {boolean} [options.leading=false]
|
113
|
-
* Specify invoking on the leading edge of the timeout.
|
114
|
-
* @param {number} [options.maxWait]
|
115
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
116
|
-
* @param {boolean} [options.trailing=true]
|
117
|
-
* Specify invoking on the trailing edge of the timeout.
|
118
|
-
* @returns {Function} Returns the new debounced function.
|
119
|
-
* @example
|
120
|
-
*
|
121
|
-
* // Avoid costly calculations while the window size is in flux.
|
122
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
123
|
-
*
|
124
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
125
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
126
|
-
* 'leading': true,
|
127
|
-
* 'trailing': false
|
128
|
-
* }));
|
129
|
-
*
|
130
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
131
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
132
|
-
* var source = new EventSource('/stream');
|
133
|
-
* jQuery(source).on('message', debounced);
|
134
|
-
*
|
135
|
-
* // Cancel the trailing debounced invocation.
|
136
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
137
|
-
*/
|
138
|
-
function debounce(func, wait, options) {
|
139
|
-
var lastArgs,
|
140
|
-
lastThis,
|
141
|
-
maxWait,
|
142
|
-
result,
|
143
|
-
timerId,
|
144
|
-
lastCallTime,
|
145
|
-
lastInvokeTime = 0,
|
146
|
-
leading = false,
|
147
|
-
maxing = false,
|
148
|
-
trailing = true;
|
149
|
-
if (typeof func != 'function') {
|
150
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
151
|
-
}
|
152
|
-
wait = toNumber(wait) || 0;
|
153
|
-
if (isObject(options)) {
|
154
|
-
leading = !!options.leading;
|
155
|
-
maxing = 'maxWait' in options;
|
156
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
157
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
158
|
-
}
|
159
|
-
function invokeFunc(time) {
|
160
|
-
var args = lastArgs,
|
161
|
-
thisArg = lastThis;
|
162
|
-
lastArgs = lastThis = undefined;
|
163
|
-
lastInvokeTime = time;
|
164
|
-
result = func.apply(thisArg, args);
|
165
|
-
return result;
|
166
|
-
}
|
167
|
-
function leadingEdge(time) {
|
168
|
-
// Reset any `maxWait` timer.
|
169
|
-
lastInvokeTime = time;
|
170
|
-
// Start the timer for the trailing edge.
|
171
|
-
timerId = setTimeout(timerExpired, wait);
|
172
|
-
// Invoke the leading edge.
|
173
|
-
return leading ? invokeFunc(time) : result;
|
174
|
-
}
|
175
|
-
function remainingWait(time) {
|
176
|
-
var timeSinceLastCall = time - lastCallTime,
|
177
|
-
timeSinceLastInvoke = time - lastInvokeTime,
|
178
|
-
result = wait - timeSinceLastCall;
|
179
|
-
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
180
|
-
}
|
181
|
-
function shouldInvoke(time) {
|
182
|
-
var timeSinceLastCall = time - lastCallTime,
|
183
|
-
timeSinceLastInvoke = time - lastInvokeTime;
|
184
|
-
|
185
|
-
// Either this is the first call, activity has stopped and we're at the
|
186
|
-
// trailing edge, the system time has gone backwards and we're treating
|
187
|
-
// it as the trailing edge, or we've hit the `maxWait` limit.
|
188
|
-
return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
189
|
-
}
|
190
|
-
function timerExpired() {
|
191
|
-
var time = now();
|
192
|
-
if (shouldInvoke(time)) {
|
193
|
-
return trailingEdge(time);
|
194
|
-
}
|
195
|
-
// Restart the timer.
|
196
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
197
|
-
}
|
198
|
-
function trailingEdge(time) {
|
199
|
-
timerId = undefined;
|
200
|
-
|
201
|
-
// Only invoke if we have `lastArgs` which means `func` has been
|
202
|
-
// debounced at least once.
|
203
|
-
if (trailing && lastArgs) {
|
204
|
-
return invokeFunc(time);
|
205
|
-
}
|
206
|
-
lastArgs = lastThis = undefined;
|
207
|
-
return result;
|
208
|
-
}
|
209
|
-
function cancel() {
|
210
|
-
if (timerId !== undefined) {
|
211
|
-
clearTimeout(timerId);
|
212
|
-
}
|
213
|
-
lastInvokeTime = 0;
|
214
|
-
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
215
|
-
}
|
216
|
-
function flush() {
|
217
|
-
return timerId === undefined ? result : trailingEdge(now());
|
218
|
-
}
|
219
|
-
function debounced() {
|
220
|
-
var time = now(),
|
221
|
-
isInvoking = shouldInvoke(time);
|
222
|
-
lastArgs = arguments;
|
223
|
-
lastThis = this;
|
224
|
-
lastCallTime = time;
|
225
|
-
if (isInvoking) {
|
226
|
-
if (timerId === undefined) {
|
227
|
-
return leadingEdge(lastCallTime);
|
228
|
-
}
|
229
|
-
if (maxing) {
|
230
|
-
// Handle invocations in a tight loop.
|
231
|
-
timerId = setTimeout(timerExpired, wait);
|
232
|
-
return invokeFunc(lastCallTime);
|
233
|
-
}
|
234
|
-
}
|
235
|
-
if (timerId === undefined) {
|
236
|
-
timerId = setTimeout(timerExpired, wait);
|
237
|
-
}
|
238
|
-
return result;
|
239
|
-
}
|
240
|
-
debounced.cancel = cancel;
|
241
|
-
debounced.flush = flush;
|
242
|
-
return debounced;
|
243
|
-
}
|
244
|
-
|
245
|
-
/**
|
246
|
-
* Checks if `value` is the
|
247
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
248
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
249
|
-
*
|
250
|
-
* @static
|
251
|
-
* @memberOf _
|
252
|
-
* @since 0.1.0
|
253
|
-
* @category Lang
|
254
|
-
* @param {*} value The value to check.
|
255
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
256
|
-
* @example
|
257
|
-
*
|
258
|
-
* _.isObject({});
|
259
|
-
* // => true
|
260
|
-
*
|
261
|
-
* _.isObject([1, 2, 3]);
|
262
|
-
* // => true
|
263
|
-
*
|
264
|
-
* _.isObject(_.noop);
|
265
|
-
* // => true
|
266
|
-
*
|
267
|
-
* _.isObject(null);
|
268
|
-
* // => false
|
269
|
-
*/
|
270
|
-
function isObject(value) {
|
271
|
-
var type = typeof value;
|
272
|
-
return !!value && (type == 'object' || type == 'function');
|
273
|
-
}
|
274
|
-
|
275
|
-
/**
|
276
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
277
|
-
* and has a `typeof` result of "object".
|
278
|
-
*
|
279
|
-
* @static
|
280
|
-
* @memberOf _
|
281
|
-
* @since 4.0.0
|
282
|
-
* @category Lang
|
283
|
-
* @param {*} value The value to check.
|
284
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
285
|
-
* @example
|
286
|
-
*
|
287
|
-
* _.isObjectLike({});
|
288
|
-
* // => true
|
289
|
-
*
|
290
|
-
* _.isObjectLike([1, 2, 3]);
|
291
|
-
* // => true
|
292
|
-
*
|
293
|
-
* _.isObjectLike(_.noop);
|
294
|
-
* // => false
|
295
|
-
*
|
296
|
-
* _.isObjectLike(null);
|
297
|
-
* // => false
|
298
|
-
*/
|
299
|
-
function isObjectLike(value) {
|
300
|
-
return !!value && typeof value == 'object';
|
301
|
-
}
|
302
|
-
|
303
|
-
/**
|
304
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
305
|
-
*
|
306
|
-
* @static
|
307
|
-
* @memberOf _
|
308
|
-
* @since 4.0.0
|
309
|
-
* @category Lang
|
310
|
-
* @param {*} value The value to check.
|
311
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
312
|
-
* @example
|
313
|
-
*
|
314
|
-
* _.isSymbol(Symbol.iterator);
|
315
|
-
* // => true
|
316
|
-
*
|
317
|
-
* _.isSymbol('abc');
|
318
|
-
* // => false
|
319
|
-
*/
|
320
|
-
function isSymbol(value) {
|
321
|
-
return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
|
322
|
-
}
|
323
|
-
|
324
|
-
/**
|
325
|
-
* Converts `value` to a number.
|
326
|
-
*
|
327
|
-
* @static
|
328
|
-
* @memberOf _
|
329
|
-
* @since 4.0.0
|
330
|
-
* @category Lang
|
331
|
-
* @param {*} value The value to process.
|
332
|
-
* @returns {number} Returns the number.
|
333
|
-
* @example
|
334
|
-
*
|
335
|
-
* _.toNumber(3.2);
|
336
|
-
* // => 3.2
|
337
|
-
*
|
338
|
-
* _.toNumber(Number.MIN_VALUE);
|
339
|
-
* // => 5e-324
|
340
|
-
*
|
341
|
-
* _.toNumber(Infinity);
|
342
|
-
* // => Infinity
|
343
|
-
*
|
344
|
-
* _.toNumber('3.2');
|
345
|
-
* // => 3.2
|
346
|
-
*/
|
347
|
-
function toNumber(value) {
|
348
|
-
if (typeof value == 'number') {
|
349
|
-
return value;
|
350
|
-
}
|
351
|
-
if (isSymbol(value)) {
|
352
|
-
return NAN;
|
353
|
-
}
|
354
|
-
if (isObject(value)) {
|
355
|
-
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
356
|
-
value = isObject(other) ? other + '' : other;
|
357
|
-
}
|
358
|
-
if (typeof value != 'string') {
|
359
|
-
return value === 0 ? value : +value;
|
360
|
-
}
|
361
|
-
value = value.replace(reTrim, '');
|
362
|
-
var isBinary = reIsBinary.test(value);
|
363
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
364
|
-
}
|
365
|
-
lodash_debounce = debounce;
|
366
|
-
return lodash_debounce;
|
367
|
-
}
|
368
|
-
|
369
|
-
exports.__require = requireLodash_debounce;
|
File without changes
|
File without changes
|