first commit

This commit is contained in:
monjack
2025-06-20 18:01:48 +08:00
commit 6daa6d65c1
24611 changed files with 2512443 additions and 0 deletions

13
app_vue/node_modules/debounce/CONTRIBUTORS generated vendored Normal file
View File

@ -0,0 +1,13 @@
Ben Carpenter
Billy Moon
Josh Goldberg
Julian Gruber
Kristofer Selbekk
Matt Mueller
Matthew Mueller
Nathan Rajlich
Oleg Pudeyev
Stephen Mathieson
TJ Holowaychuk
suhaotian
ven

55
app_vue/node_modules/debounce/History.md generated vendored Normal file
View File

@ -0,0 +1,55 @@
1.2.1 / 2021-03-09
==================
* Add CONTRIBUTORS and MIT LICENSE file. (#28)
1.2.0 / 2018-08-14
==================
* Added a .debounce member to debounce (#21)
1.1.0 / 2017-10-30
==================
* Ability to force execution (#16)
1.0.2 / 2017-04-21
==================
* Fixes #3 - Debounced function executing early? (#15)
* Merge pull request #13 from selbekk/master
* Remove date-now from package.json
* Remove date-now dependency from component.json
* Remove date-now usage
1.0.1 / 2016-07-25
==================
* add ability to clear timer (#10)
1.0.0 / 2014-06-21
==================
* Readme: attribute underscore.js in the License section
* index: rewrite to use underscore.js' implementation (#2, @TooTallNate)
* component, package: add "date-now" as a dependency
* test: fix test
* component, package: add "keywords" array
* package: adjust "description"
* package: added "repository" field (#1, @juliangruber)
0.0.3 / 2013-08-21
==================
* immediate now defaults to `false`
0.0.2 / 2013-07-27
==================
* consolidated with TJ's debounce
0.0.1 / 2012-11-5
==================
* Initial release

21
app_vue/node_modules/debounce/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2018 The Debounce Contributors. See CONTRIBUTORS.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

11
app_vue/node_modules/debounce/Makefile generated vendored Normal file
View File

@ -0,0 +1,11 @@
build: components index.js
@component build --dev
components: component.json
@component install --dev
clean:
rm -fr build components template.js
.PHONY: clean

69
app_vue/node_modules/debounce/Readme.md generated vendored Normal file
View File

@ -0,0 +1,69 @@
# debounce
Useful for implementing behavior that should only happen after a repeated
action has completed.
## Installation
$ component install component/debounce
Or in node:
$ npm install debounce
## Example
```js
var debounce = require('debounce');
window.onresize = debounce(resize, 200);
function resize(e) {
console.log('height', window.innerHeight);
console.log('width', window.innerWidth);
}
```
To later clear the timer and cancel currently scheduled executions:
```
window.onresize.clear();
```
To execute any pending invocations and reset the timer:
```
window.onresize.flush();
```
Alternately, if using newer syntax:
```js
import { debounce } from "debounce";
```
## API
### debounce(fn, wait, [ immediate || false ])
Creates and returns a new debounced version of the passed function that
will postpone its execution until after wait milliseconds have elapsed
since the last time it was invoked.
Pass `true` for the `immediate` parameter to cause debounce to trigger
the function on the leading edge instead of the trailing edge of the wait
interval. Useful in circumstances like preventing accidental double-clicks
on a "submit" button from firing a second time.
The debounced function returned has a property 'clear' that is a
function that will clear any scheduled future executions of your function.
The debounced function returned has a property 'flush' that is a
function that will immediately execute the function if and only if execution is scheduled,
and reset the execution timer for subsequent invocations of the debounced
function.
## License
MIT
Original implementation is from [`underscore.js`](http://underscorejs.org/)
which also has an MIT license.

18
app_vue/node_modules/debounce/component.json generated vendored Normal file
View File

@ -0,0 +1,18 @@
{
"name": "debounce",
"repo": "component/debounce",
"description": "Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked",
"version": "1.2.1",
"main": "index.js",
"scripts": [
"index.js"
],
"keywords": [
"function",
"throttle",
"invoke"
],
"dependencies": {},
"development": {},
"license": "MIT"
}

70
app_vue/node_modules/debounce/index.js generated vendored Normal file
View File

@ -0,0 +1,70 @@
/**
* Returns a function, that, as long as it continues to be invoked, will not
* be triggered. The function will be called after it stops being called for
* N milliseconds. If `immediate` is passed, trigger the function on the
* leading edge, instead of the trailing. The function also has a property 'clear'
* that is a function which will clear the timer to prevent previously scheduled executions.
*
* @source underscore.js
* @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/
* @param {Function} function to wrap
* @param {Number} timeout in ms (`100`)
* @param {Boolean} whether to execute at the beginning (`false`)
* @api public
*/
function debounce(func, wait, immediate){
var timeout, args, context, timestamp, result;
if (null == wait) wait = 100;
function later() {
var last = Date.now() - timestamp;
if (last < wait && last >= 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
context = args = null;
}
}
};
var debounced = function(){
context = this;
args = arguments;
timestamp = Date.now();
var callNow = immediate && !timeout;
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
};
debounced.clear = function() {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
};
debounced.flush = function() {
if (timeout) {
result = func.apply(context, args);
context = args = null;
clearTimeout(timeout);
timeout = null;
}
};
return debounced;
};
// Adds compatibility for ES modules
debounce.debounce = debounce;
module.exports = debounce;

27
app_vue/node_modules/debounce/package.json generated vendored Normal file
View File

@ -0,0 +1,27 @@
{
"name": "debounce",
"description": "Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked",
"version": "1.2.1",
"repository": "git://github.com/component/debounce",
"main": "index.js",
"scripts": {
"test": "minijasminenode test.js"
},
"license": "MIT",
"keywords": [
"function",
"throttle",
"invoke"
],
"devDependencies": {
"minijasminenode": "^1.1.1",
"sinon": "^1.17.7",
"mocha": "*",
"should": "*"
},
"component": {
"scripts": {
"debounce/index.js": "index.js"
}
}
}

32
app_vue/node_modules/debounce/test.html generated vendored Normal file
View File

@ -0,0 +1,32 @@
<html>
<head>
<title>Debounce Component</title>
</head>
<body>
Resize the window!
<br>
<a id='cancel' href='#'>Cancel Print</a>
<br>
<a id='now' href='#'>Print Now</a>
<script src="build/build.js" type="text/javascript"></script>
<script type="text/javascript">
var debounce = require('debounce');
window.onresize = debounce(resize, 2000);
document.getElementById('cancel').onclick = window.onresize.clear;
document.getElementById('now').onclick = printNow;
function resize(e) {
console.log('height', window.innerHeight);
console.log('width', window.innerWidth);
}
function printNow(e) {
window.onresize.clear();
resize();
}
</script>
</body>
</html>

170
app_vue/node_modules/debounce/test.js generated vendored Normal file
View File

@ -0,0 +1,170 @@
var debounce = require('.')
var sinon = require('sinon')
describe('housekeeping', function() {
it('should be defined as a function', function() {
expect(typeof debounce).toEqual('function')
})
})
describe('catch issue #3 - Debounced function executing early?', function() {
// use sinon to control the clock
var clock
beforeEach(function(){
clock = sinon.useFakeTimers()
})
afterEach(function(){
clock.restore()
})
it('should debounce with fast timeout', function() {
var callback = sinon.spy()
// set up debounced function with wait of 100
var fn = debounce(callback, 100)
// call debounced function at interval of 50
setTimeout(fn, 100)
setTimeout(fn, 150)
setTimeout(fn, 200)
setTimeout(fn, 250)
// set the clock to 100 (period of the wait) ticks after the last debounced call
clock.tick(350)
// the callback should have been triggered once
expect(callback.callCount).toEqual(1)
})
})
describe('forcing execution', function() {
// use sinon to control the clock
var clock
beforeEach(function(){
clock = sinon.useFakeTimers()
})
afterEach(function(){
clock.restore()
})
it('should not execute prior to timeout', function() {
var callback = sinon.spy()
// set up debounced function with wait of 100
var fn = debounce(callback, 100)
// call debounced function at interval of 50
setTimeout(fn, 100)
setTimeout(fn, 150)
// set the clock to 25 (period of the wait) ticks after the last debounced call
clock.tick(175)
// the callback should not have been called yet
expect(callback.callCount).toEqual(0)
})
it('should execute prior to timeout when flushed', function() {
var callback = sinon.spy()
// set up debounced function with wait of 100
var fn = debounce(callback, 100)
// call debounced function at interval of 50
setTimeout(fn, 100)
setTimeout(fn, 150)
// set the clock to 25 (period of the wait) ticks after the last debounced call
clock.tick(175)
fn.flush()
// the callback has been called
expect(callback.callCount).toEqual(1)
})
it('should not execute again after timeout when flushed before the timeout', function() {
var callback = sinon.spy()
// set up debounced function with wait of 100
var fn = debounce(callback, 100)
// call debounced function at interval of 50
setTimeout(fn, 100)
setTimeout(fn, 150)
// set the clock to 25 (period of the wait) ticks after the last debounced call
clock.tick(175)
fn.flush()
// the callback has been called here
expect(callback.callCount).toEqual(1)
// move to past the timeout
clock.tick(225)
// the callback should have only been called once
expect(callback.callCount).toEqual(1)
})
it('should not execute on a timer after being flushed', function() {
var callback = sinon.spy()
// set up debounced function with wait of 100
var fn = debounce(callback, 100)
// call debounced function at interval of 50
setTimeout(fn, 100)
setTimeout(fn, 150)
// set the clock to 25 (period of the wait) ticks after the last debounced call
clock.tick(175)
fn.flush()
// the callback has been called here
expect(callback.callCount).toEqual(1)
// schedule again
setTimeout(fn, 250)
// move to past the new timeout
clock.tick(400)
// the callback should have been called again
expect(callback.callCount).toEqual(2)
})
it('should not execute when flushed if nothing was scheduled', function() {
var callback = sinon.spy()
// set up debounced function with wait of 100
var fn = debounce(callback, 100)
fn.flush()
// the callback should not have been called
expect(callback.callCount).toEqual(0)
})
})