This commit is contained in:
2023-08-11 10:45:20 +08:00
commit 161ca982f3
31850 changed files with 2706500 additions and 0 deletions

52
node_modules/@vue/babel-sugar-v-on/README.md generated vendored Normal file
View File

@ -0,0 +1,52 @@
## @vue/babel-sugar-v-on
Syntactic sugar for v-on in JSX.
### Babel Compatibility Notes
- This repo is only compatible with Babel 7.x, for 6.x please use [vuejs/babel-plugin-transform-vue-jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx)
### Usage
Install the dependencies:
```sh
# for yarn:
yarn add @vue/babel-sugar-v-on
# for npm:
npm install @vue/babel-sugar-v-on --save
```
In your `.babelrc`:
```json
{
"plugins": ["@vue/babel-sugar-v-on"]
}
```
However it is recommended to use the [configurable preset](../babel-preset-jsx/README.md) instead.
### Details
This plugin adds v-on to the JSX and tries to mirror the same behaviour as in vue-template-compiler, with a few differences:
1. You should use underscore (`_`) instead of dot (`.`) for modifiers (`vOn:click_prevent={this.test}`)
2. It is recommended to use camelCase version of it (`vOn`) in JSX, but you can use kebab-case too (`v-on`).
```js
export default {
methods: {
test() {
console.log('Hello World')
},
},
render(h) {
return (
<div>
<a href="https://vuejs.org" vOn:click={this.test}>Vue</a>
</div>
)
},
}
```

1
node_modules/@vue/babel-sugar-v-on/dist/plugin.js generated vendored Normal file
View File

@ -0,0 +1 @@
"use strict";function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var camelCase=_interopDefault(require("camelcase")),syntaxJsx=_interopDefault(require("@babel/plugin-syntax-jsx"));const cachedCamelCase=(()=>{const a=Object.create(null);return b=>(a[b]||(a[b]=camelCase(b)),a[b])})(),equalCamel=(a,b)=>a===b||a===cachedCamelCase(b),keyModifiers=["ctrl","shift","alt","meta"],keyCodes={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},keyNames={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:" ",up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete"]};function index(a){function b(a){return p.ifStatement(a,p.returnStatement(p.nullLiteral()))}function c(a,b=[]){return p.callExpression(a,b)}function d(a){return p.memberExpression(p.identifier("$event"),p.identifier(a))}function e(a){return p.unaryExpression("!",a)}function f(a,b){return p.binaryExpression("!==",a,b)}function g(a,b){return p.logicalExpression("&&",a,b)}function h(a,b){return p.logicalExpression("||",a,b)}function i(){return p.binaryExpression("in",p.stringLiteral("button"),p.identifier("$event"))}function j(a){return p.arrowFunctionExpression([p.identifier("$event")],p.blockStatement(a instanceof Array?a:[a]))}function k(a){const b=a.get("name");let c=p.isJSXNamespacedName(b)?`${b.get("namespace.name").node}:${b.get("name.name").node}`:b.get("name").node;camelCase(c);let d,e;if([c,...d]=c.split("_"),[c,e]=c.split(":"),!equalCamel(c,"v-on")||!e)return{isInvalid:!1};if(!p.isJSXExpressionContainer(a.get("value")))throw new Error("Only expression container is allowed on v-on directive.");const f=a.get("value.expression");return{expression:f.node,modifiers:d,event:e}}function l(a){let{modifiers:e,isInvalid:f,expression:g,event:i}=k(a);"click"===i&&e.includes("right")&&(e=e.filter(a=>"right"!==a),i="contextmenu"),"click"===i&&e.includes("middle")&&(i="mouseup");let l=!1;if(f)return;if(!e||0===e.length)return{event:i,expression:g,isNative:l};const n=[],o=[],r=[];for(const c of e)if(q[c]){const a=q[c]();o.push(p.isExpression(a)?p.expressionStatement(a):a),keyCodes[c]&&r.push(c)}else if("exact"===c)o.push(b(keyModifiers.filter(a=>!e.includes(a)).map(a=>d(a+"Key")).reduce((a,b)=>a?h(a,b):b)));else if("capture"===c||"once"===c||"passive"===c)continue;else"native"===c?l=!0:r.push(c);return(-1<e.indexOf("capture")&&(i="!"+i),-1<e.indexOf("once")&&(i="~"+i),-1<e.indexOf("passive")&&(i="&"+i),r.length&&n.push(m(r)),o.length&&n.push(...o),0===n.length)?{event:i,expression:g,isNative:l}:(n.push(p.returnStatement(c(g,[p.identifier("$event")]))),{event:i,expression:j(n),isNative:l})}function m(a){return b(a.map(n).reduce((a,b)=>g(a,b),e(i())))}function n(a){const b=parseInt(a,10);if(b)return f(d("keyCode"),p.numericLiteral(b));const c=keyCodes[a],e=keyNames[a];return p.callExpression(p.memberExpression(p.thisExpression(),p.identifier("_k")),[d("keyCode"),p.stringLiteral(`${a}`),c?Array.isArray(c)?p.arrayExpression(c.map(a=>p.numericLiteral(a))):p.numericLiteral(c):p.identifier("undefined"),d("key"),e?Array.isArray(e)?p.arrayExpression(e.map(a=>p.stringLiteral(a))):p.stringLiteral(`${e}`):p.identifier("undefined")])}function o(a,b,c,d){"~"!==a[0]&&"!"!==a[0]&&"&"!==a[0]?d.push(p.jSXAttribute(p.jSXIdentifier(`${c?"nativeOn":"on"}-${a}`),p.jSXExpressionContainer(b))):d.push(p.jSXSpreadAttribute(p.objectExpression([p.objectProperty(p.identifier("on"),p.objectExpression([p.objectProperty(p.stringLiteral(a),b)]))])))}const p=a.types,q={stop:()=>c(d("stopPropagation")),prevent:()=>c(d("preventDefault")),self:()=>b(f(d("target"),d("currentTarget"))),ctrl:()=>b(e(d("ctrlKey"))),shift:()=>b(e(d("shiftKey"))),alt:()=>b(e(d("altKey"))),meta:()=>b(e(d("metaKey"))),left:()=>b(g(i(),f(d("button"),p.numericLiteral(0)))),middle:()=>b(g(i(),f(d("button"),p.numericLiteral(1)))),right:()=>b(g(i(),f(d("button"),p.numericLiteral(2))))};return{inherits:syntaxJsx,visitor:{Program(a){a.traverse({JSXAttribute(a){const{event:b,expression:c,isNative:d}=l(a);b&&(a.remove(),o(b,c,d,a.parentPath.node.attributes))}})}}}}module.exports=index;

View File

@ -0,0 +1,63 @@
declare namespace camelcase {
interface Options {
/**
Uppercase the first character: `foo-bar` → `FooBar`.
@default false
*/
readonly pascalCase?: boolean;
}
}
declare const camelcase: {
/**
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
@param input - String to convert to camel case.
@example
```
import camelCase = require('camelcase');
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('Foo-Bar', {pascalCase: true});
//=> 'FooBar'
camelCase('--foo.bar', {pascalCase: false});
//=> 'fooBar'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase(['foo', 'bar']);
//=> 'fooBar'
camelCase(['__foo__', '--bar'], {pascalCase: true});
//=> 'FooBar'
```
*/
(input: string | ReadonlyArray<string>, options?: camelcase.Options): string;
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function camelcase(
// input: string | ReadonlyArray<string>,
// options?: camelcase.Options
// ): string;
// export = camelcase;
default: typeof camelcase;
};
export = camelcase;

View File

@ -0,0 +1,76 @@
'use strict';
const preserveCamelCase = string => {
let isLastCharLower = false;
let isLastCharUpper = false;
let isLastLastCharUpper = false;
for (let i = 0; i < string.length; i++) {
const character = string[i];
if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) {
string = string.slice(0, i) + '-' + string.slice(i);
isLastCharLower = false;
isLastLastCharUpper = isLastCharUpper;
isLastCharUpper = true;
i++;
} else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) {
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
isLastLastCharUpper = isLastCharUpper;
isLastCharUpper = false;
isLastCharLower = true;
} else {
isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character;
isLastLastCharUpper = isLastCharUpper;
isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character;
}
}
return string;
};
const camelCase = (input, options) => {
if (!(typeof input === 'string' || Array.isArray(input))) {
throw new TypeError('Expected the input to be `string | string[]`');
}
options = Object.assign({
pascalCase: false
}, options);
const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x;
if (Array.isArray(input)) {
input = input.map(x => x.trim())
.filter(x => x.length)
.join('-');
} else {
input = input.trim();
}
if (input.length === 0) {
return '';
}
if (input.length === 1) {
return options.pascalCase ? input.toUpperCase() : input.toLowerCase();
}
const hasUpperCase = input !== input.toLowerCase();
if (hasUpperCase) {
input = preserveCamelCase(input);
}
input = input
.replace(/^[_.\- ]+/, '')
.toLowerCase()
.replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase())
.replace(/\d+(\w|$)/g, m => m.toUpperCase());
return postProcess(input);
};
module.exports = camelCase;
// TODO: Remove this for the next major release
module.exports.default = camelCase;

View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.

View File

@ -0,0 +1,75 @@
{
"_from": "camelcase@^5.0.0",
"_id": "camelcase@5.3.1",
"_inBundle": false,
"_integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"_location": "/@vue/babel-sugar-v-on/camelcase",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "camelcase@^5.0.0",
"name": "camelcase",
"escapedName": "camelcase",
"rawSpec": "^5.0.0",
"saveSpec": null,
"fetchSpec": "^5.0.0"
},
"_requiredBy": [
"/@vue/babel-sugar-v-on"
],
"_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"_shasum": "e3c9b31569e106811df242f715725a1f4c494320",
"_spec": "camelcase@^5.0.0",
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-sugar-v-on",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/camelcase/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`",
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
},
"engines": {
"node": ">=6"
},
"files": [
"index.js",
"index.d.ts"
],
"homepage": "https://github.com/sindresorhus/camelcase#readme",
"keywords": [
"camelcase",
"camel-case",
"camel",
"case",
"dash",
"hyphen",
"dot",
"underscore",
"separator",
"string",
"text",
"convert",
"pascalcase",
"pascal-case"
],
"license": "MIT",
"name": "camelcase",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/camelcase.git"
},
"scripts": {
"test": "xo && ava && tsd"
},
"version": "5.3.1"
}

View File

@ -0,0 +1,99 @@
# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=readme">Get professional support for 'camelcase' with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
---
## Install
```
$ npm install camelcase
```
## Usage
```js
const camelCase = require('camelcase');
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('Foo-Bar', {pascalCase: true});
//=> 'FooBar'
camelCase('--foo.bar', {pascalCase: false});
//=> 'fooBar'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase(['foo', 'bar']);
//=> 'fooBar'
camelCase(['__foo__', '--bar'], {pascalCase: true});
//=> 'FooBar'
```
## API
### camelCase(input, [options])
#### input
Type: `string` `string[]`
String to convert to camel case.
#### options
Type: `Object`
##### pascalCase
Type: `boolean`<br>
Default: `false`
Uppercase the first character: `foo-bar``FooBar`
## Security
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

90
node_modules/@vue/babel-sugar-v-on/package.json generated vendored Normal file
View File

@ -0,0 +1,90 @@
{
"_from": "@vue/babel-sugar-v-on@^1.4.0",
"_id": "@vue/babel-sugar-v-on@1.4.0",
"_inBundle": false,
"_integrity": "sha512-m+zud4wKLzSKgQrWwhqRObWzmTuyzl6vOP7024lrpeJM4x2UhQtRDLgYjXAw9xBXjCwS0pP9kXjg91F9ZNo9JA==",
"_location": "/@vue/babel-sugar-v-on",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@vue/babel-sugar-v-on@^1.4.0",
"name": "@vue/babel-sugar-v-on",
"escapedName": "@vue%2fbabel-sugar-v-on",
"scope": "@vue",
"rawSpec": "^1.4.0",
"saveSpec": null,
"fetchSpec": "^1.4.0"
},
"_requiredBy": [
"/@vue/babel-preset-jsx"
],
"_resolved": "https://registry.npmjs.org/@vue/babel-sugar-v-on/-/babel-sugar-v-on-1.4.0.tgz",
"_shasum": "43b7106a9672d8cbeefc0eb8afe1d376edc6166e",
"_spec": "@vue/babel-sugar-v-on@^1.4.0",
"_where": "C:\\Users\\zhouxueli\\Desktop\\scheduling-app\\node_modules\\@vue\\babel-preset-jsx",
"author": {
"name": "Nick Messing",
"email": "dot.nick.dot.messing@gmail.com"
},
"bundleDependencies": false,
"dependencies": {
"@babel/plugin-syntax-jsx": "^7.2.0",
"@vue/babel-plugin-transform-vue-jsx": "^1.4.0",
"camelcase": "^5.0.0"
},
"deprecated": false,
"description": "Babel syntactic sugar for v-model support in Vue JSX",
"devDependencies": {
"@babel/cli": "^7.2.0",
"@babel/core": "^7.2.0",
"@babel/plugin-transform-arrow-functions": "^7.12.1",
"@babel/preset-env": "^7.2.0",
"@vue/test-utils": "1.0.0-beta.26",
"ava": "^0.25.0",
"jsdom": "^13.0.0",
"jsdom-global": "^3.0.2",
"ninos": "^2.0.2",
"nyc": "^13.1.0",
"rollup": "^0.67.4",
"rollup-plugin-babel": "4.0.3",
"rollup-plugin-babel-minify": "^6.2.0",
"rollup-plugin-istanbul": "^2.0.1",
"vue": "^2.5.17",
"vue-template-compiler": "^2.5.17"
},
"files": [],
"gitHead": "6566e12067f5d6c02d3849b574a1b84de5634008",
"license": "MIT",
"main": "dist/plugin.js",
"name": "@vue/babel-sugar-v-on",
"nyc": {
"exclude": [
"dist",
"test"
]
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"private": false,
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/vuejs/jsx/tree/master/packages/babel-sugar-v-on"
},
"scripts": {
"build": "rollup -c",
"build:dependency": "cd ../babel-plugin-transform-vue-jsx && yarn build",
"build:test": "rollup -c rollup.config.testing.js",
"prepublish": "yarn build",
"pretest:functional": "yarn build:dependency && yarn build:test && nyc --reporter=html --reporter=text-summary babel test/functional.js --plugins ./dist/plugin.testing.js,../babel-plugin-transform-vue-jsx/dist/plugin.js,@babel/plugin-transform-arrow-functions --out-file test/functional-compiled.js",
"pretest:snapshot": "yarn build:test",
"test": "rm -rf coverage* && yarn test:snapshot && mv coverage coverage-snapshot && yarn test:functional && mv coverage coverage-functional",
"test:functional": "ava -v test/functional-compiled.js",
"test:snapshot": "nyc --reporter=html --reporter=text-summary ava -v test/snapshot.js"
},
"version": "1.4.0"
}