This commit is contained in:
yunkexin 2024-06-03 09:37:52 +08:00
commit 09440f41b2
2205 changed files with 687615 additions and 0 deletions

25
.hbuilderx/launch.json Normal file
View File

@ -0,0 +1,25 @@
{
"version" : "1.0",
"configurations" : [
{
"playground" : "standard",
"type" : "uni-app:app-android"
},
{
"app-plus" : {
"launchtype" : "local"
},
"h5" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"openVueDevtools" : true,
"type" : "uni-app:h5"
}
]
}

3
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

9
.idea/mh-safe-app.iml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/mh-safe-app.iml" filepath="$PROJECT_DIR$/.idea/mh-safe-app.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

257
App.vue Normal file
View File

@ -0,0 +1,257 @@
<script>
import {
getTasksUpdate
} from './services/app'
import {
initFilter
} from './utils/common'
import request from './utils/request'
import config from './config/common'
import checkappupdate from './utils/checkappupdate.js'
export default {
globalData: {
noticeAndTask: {
Task: 0,
Msg: 0
}
},
data() {
return {
getUpdateFn: undefined
}
},
onLaunch: function() {
const token = uni.getStorageSync('accessToken')
const orgId = uni.getStorageSync('orgId')
const Tenant = uni.getStorageSync('Tenant')
const appInfo = uni.getStorageSync('appInfo')
if (!token || !orgId || !Tenant || !appInfo) {
uni.reLaunch({
url: 'pages/login/index'
})
}
// checkappupdate.check({
// versionContent: '1.\n2.\n3.',
// versionNumber: '1.0.022',
// appurl: '',
// apk:'false',
// versionNow:'1.0.021'
// })
const store = this.$store
// #ifndef MP
uni.onTabBarMidButtonTap(function() {
uni.chooseImage({
count: 6, //9
sizeType: ['original', 'compressed'], //
sourceType: ['camera'],
success: (res) => {
const url = config.serviceHost('/PF/File/UploadFile')
request.upload(url, res.tempFilePaths).then((result) => {
if (result.IsSuccessful) {
// TODO:
store.commit('updateImageLists', [{
IMG_FILE_ID: result.Data.imgFileID,
IMG_FILE_PATH: result.Data.imgFilePath
}]);
uni.showActionSheet({
title: '选择上报类型',
itemList: ['随手拍', '隐患上报'],
success: (e) => {
if (e.tapIndex === 0) {
uni.navigateTo({
url: '/pages/camera/index'
})
} else {
uni.navigateTo({
url: '/pages/apply/subPages/riskReport'
})
}
}
})
}
}).catch((error) => {
console.log(error)
});
},
complete: function(com) {
console.log('choose image complete', com)
}
})
})
// #endif
//
// #ifdef APP-PLUS
if (this.judgeTabbar()) {
// tabbar
getTasksUpdate(json).then(res => {
if (res.Data.AppVersion) {
this.checkVersionUpdate(res.Data.AppVersion)
}
})
}
// #endif
},
onShow: function() {
console.log('App Show')
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId)
//
// #ifdef APP-PLUS
if (this.judgeTabbar()) {
// tabbar
getTasksUpdate(json).then(res => {
if (res.Data.AppVersion) {
this.checkVersionUpdate(res.Data.AppVersion)
}
})
}
// #endif
//
const timingUpdate = () => {
if (this.judgeTabbar()) {
getTasksUpdate(json).then(res => {
getApp().globalData.noticeAndTask = res.Data
if (res.Data) {
if (res.Data.Task > 0 || res.Data.Msg > 0) {
// tab
uni.showTabBarRedDot({
index: 0
})
} else {
uni.hideTabBarRedDot({
index: 0
})
}
}
})
}
}
setTimeout(timingUpdate, 1000)
this.getUpdateFn = setInterval(timingUpdate, 60000)
},
onHide: function() {
console.log('App Hide')
clearInterval(this.getUpdateFn)
},
onExit: function() {
console.log('App Exit')
clearInterval(this.getUpdateFn)
},
methods: {
judgeTabbar() {
let pages = getCurrentPages()
if (pages.length > 0) {
let prevPage = pages[pages.length - 1]
if (prevPage.route === 'pages/index/index2' || prevPage.route === 'pages/performance/index1' ||
prevPage.route === 'pages/my/index1' || prevPage.route === 'pages/apply/index') {
return true
}
}
},
checkVersionUpdate(versionInfo) {
const latestVersion = parseInt(versionInfo.Code.split('.').join(''))
// const localVersion = parseInt(plus.runtime.version.split('.').join(''))
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
const localVersion = parseInt(widgetInfo.version.split('.').join(''))
if (latestVersion > localVersion) {
if (versionInfo.Upgrade >= 0 && versionInfo.Url) {
if (versionInfo.Upgrade === 0) { //
checkappupdate.check({
versionContent: versionInfo.Desc,
versionNumber: versionInfo.Code,
versionNow: widgetInfo.version,
appurl: config.uni_app_web_source_url + versionInfo.Url,
apk: 'false'
})
// uni.showModal({
// title: "" + latestVersion + "",
// content: versionInfo.Desc,
// cancelText: '',
// confirmText: '',
// success: (res) => {
// if (res.confirm) {
// uni.showLoading({
// title: "",
// mask: true,
// })
// uni.downloadFile({ //
// url: config.uni_app_web_source_url +
// versionInfo.Url,
// success: (downloadResult) => {
// uni.hideLoading()
// if (downloadResult.statusCode ===
// 200) {
// plus.runtime.install(downloadResult
// .tempFilePath, { //
// force: false
// },
// function() {
// console.log(
// 'install success...'
// );
// plus.runtime
// .restart(); // APP
// },
// function(e) {
// console.error(e,
// 'install fail...'
// );
// })
// }
// }
// })
// } else if (res.cancel) {
// //
// }
// }
// })
} else if (versionInfo.Upgrade === 1) { //
checkappupdate.check({
versionContent: versionInfo.Desc,
versionNumber: versionInfo.Code,
versionNow: widgetInfo.version,
appurl: config.uni_app_web_source_url + versionInfo.Url,
apk: 'true'
})
// uni.showModal({
// title: "",
// content: '' + versionInfo.Desc,
// success: (res) => {
// if (res.confirm) {
// var appurl = ''
// if (plus.os.name === 'Android') {
// appurl = config.uni_app_web_source_url + versionInfo
// .Url;
// } else {
// //
// // appurl = versionInfo.pathIos;
// }
// plus.runtime.openURL(appurl); //
// }
// }
// })
}
}
}
})
}
}
}
</script>
<style lang="scss">
@import "/uni_modules/uview-ui/index.scss";
@import '/static/iconfont/iconfont.css';
/*每个页面公共css */
/* #ifdef MP */
page {
width: 100vw;
}
/* #endif */
</style>

View File

@ -0,0 +1,114 @@
<template>
<view class="audit-process">
<u-popup
:show="show"
mode="right"
@close="close"
:closeable="true">
<view class="title">
审批详情
</view>
<view class="wrap">
<u-steps v-for="(item, index) in dataSource" :key="index" :current="currentStep(item)" direction="column">
<u-steps-item v-for="(i, k) in subStep(item)" :key="k" :title="i.NAME">
<view slot="brief" class="brief">
<view class="row">
<text>审批人</text>
<text>{{i.Nav_ApproveUser.NAME}}</text>
</view>
<view class="row">
<text>审批时间</text>
<text>{{i.NODE_APPROVE_TIME === "0001-01-01 00:00:00" ? '' : i.NODE_APPROVE_TIME}}</text>
</view>
<view class="row">
<text>审批结论</text>
<text>{{auditResult(i)}}</text>
</view>
<view class="row">
<text>审批意见</text>
<text>{{i.CONTEXT || ''}}</text>
</view>
</view>
</u-steps-item>
</u-steps>
</view>
</u-popup>
</view>
</template>
<script>
export default {
props: {
show: {
type: Boolean,
default: false
},
dataSource: {
type: Array,
default() {
return []
}
}
},
data() {
return {
// currentStep: 0
}
},
methods: {
close() {
this.$emit('close')
},
auditResult(e) {
let result
if (e.NODE_APPROVE_STATUS === 10) {
result='同意';
} else if (e.NODE_APPROVE_STATUS === 20) {
result = '驳回';
}
return result
},
currentStep(e) {
const res = this.subStep(e)
let cur = res.length
res.forEach((o, k) => {
if (o.IS_CURRENT) {
cur = k
}
})
return cur
},
subStep(val) {
return val.Nav_ApproveDetails?.slice().sort((a, b) => a.NUM - b.NUM)
}
},
watch: {
},
computed: {
}
}
</script>
<style scoped>
.title {
height: 48px;
line-height: 48px;
font-weight: bold;
padding-left: 15px;
border-bottom: 1px solid #e5e5e5;
margin-bottom: 15px;
}
.wrap {
min-width: 200px;
max-width: 400px;
padding-left: 10px;
padding-right: 10px;
}
.brief {
font-size: 12px;
margin-top: 10px;
}
.brief .row {
margin-bottom: 6px;
}
</style>

View File

@ -0,0 +1,151 @@
<template>
<view class="check-action">
<view class="btn-wrap">
<view>
<u--textarea v-model="value" placeholder="请输入审批意见"></u--textarea>
</view>
<view class="buttons">
<u-button @click="handlePass" class="btn first-btn" type="primary" text="通过"></u-button>
<u-button @click="handleReject" :disabled="isBtnRefuseDisable" type="warning" text="驳回"></u-button>
</view>
</view>
</view>
</template>
<!-- <check-action v-if="isLoadOK && tableKey === '1' && isAudit === 'true'" @reject="handleReject"
@pass="handlePass" :okApi="okApi" :refuseApi="refuseApi"
:dataSource="$store.state.auditModel"></check-action>
-->
<!-- @reject="handleReject" @pass="handlePass" 如果调用页面需要对审批结束后继续处理 直接 在使用页面 写方法 -->
<script>
import {
handlePassAudit,
handleRejestAudit,
handlePassAuditCallBack
} from '../../services/apply/subPages/BS/notice'
import '@/utils/showMsg.js'
export default {
props: {
dataSource: {
type: Object,
default () {
return undefined
}
},
okApi: {
type: String,
default: ''
},
refuseApi: {
type: String,
default: ''
},
isBtnRefuseDisable: {
typeof: Boolean,
default: true
}
},
data() {
return {
value: ''
}
},
// beforeCreate() KO
// beforeMount() mounted() OK
created() {
//wyw
this.isBtnRefuseDisable = (this.__page__.options.refuseApi == null || this.__page__.options.refuseApi ==
undefined || this.__page__.options.refuseApi == 'undefined') ? true : false
},
methods: {
handlePass() {
const genParams = this.handleGenParams(10)
handlePassAudit(genParams, this.okApi).then(res => {
// this.$emit('pass', this.dataSource)
uni.$showMsgFunc('审批成功!', () => {
// if (this.tableKey == null || this.tableKey == 0) {
// uni.navigateTo({
// url: 'safeCheckIndex'
// })
// } else {
if (this.okApi == 'PF/Approve/Submit' && res.Data) {
//
handlePassAuditCallBack(res.Data + "?id=" + genParams.DATA_ID).then(
res2 => {
uni.navigateBack()
})
} else {
uni.navigateBack()
}
// }
}, 'success', 1000)
})
},
handleReject() {
if (this.value == undefined || this.value === '' || this.value.length < 1) {
uni.$showErrorInfo('请输入驳回意见!')
return false
}
const genParams = this.handleGenParams(20)
handleRejestAudit(genParams, this.refuseApi).then(res => {
// this.$emit('reject', this.dataSource)
uni.$showMsgFunc('驳回成功!', () => {
uni.navigateBack()
}, 'success', 1000)
})
},
handleGenParams(status) {
const appInfoData = uni.getStorageSync('appInfo')
const userId = appInfoData?.User?.ID || ''
this.dataSource.Nav_ApproveDetails.sort((a, b) => a.NUM - b.NUM);
let currentNodes = this.dataSource.Nav_ApproveDetails?.filter(v => v.IS_CURRENT == true);
let isCurrent = false;
if (currentNodes && currentNodes.length > 0) {
let currentUserNode = currentNodes.filter(v => v.APPROVE_USER_ID === userId);
if (currentUserNode != null) {
isCurrent = true;
this.dataSource.CurrentNode = currentUserNode[0];
} else {
this.dataSource.CurrentNode = currentNodes[0];
}
}
const params = {
...this.dataSource,
CurrentNode: {
...this.dataSource.CurrentNode,
NODE_APPROVE_STATUS: status,
CONTEXT: this.value
}
}
return params
}
}
}
</script>
<style scoped>
.btn-wrap {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 16px;
z-index: 1000;
background: #fff;
box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05);
}
.buttons {
margin-top: 5px;
display: flex;
justify-content: space-between;
}
.buttons .first-btn {
margin-right: 20px;
}
</style>

View File

@ -0,0 +1,89 @@
<!-- 使用审批的UI -->
<template>
<view class="check-action">
<view class="btn-wrap">
<u-form-item label="参会情况" label-width="80px">
<u-radio-group v-model="joinTypeDef" @change="groupChange">
<u-radio :customStyle="{margin: ' 0 20px 0 0' }" v-for="(item, index) in joinType" :key="index"
:label="item.name" :name="item.name" @change="radioChange">
</u-radio>
</u-radio-group>
</u-form-item>
<!-- 参会情况-->
<!-- <view>
<u-radio-group v-model="joinTypeDef" @change="groupChange">
<u-radio :customStyle="{margin: ' 0 20px 6px 0' }" v-for="(item, index) in joinType" :key="index"
:label="item.name" :name="item.name" @change="radioChange">
</u-radio>
</u-radio-group>
</view> -->
<view v-if="!isJoin">
<u--textarea v-model="opinions" placeholder="请输入请假原因"></u--textarea>
</view>
<view class="buttons">
<u-button @click="handleCheck" class="btn first-btn" type="primary" text="确认"></u-button>
</view>
</view>
</view>
</template>
<script>
export default {
props: {},
data() {
return {
opinions: '',
isJoin: true,
joinType: [{
name: '参加',
disabled: false
},
{
name: '请假',
disabled: false
}
],
// u-radio-groupv-modelradioname
joinTypeDef: '参加',
};
},
methods: {
radioChange() {
this.isJoin = !this.isJoin
},
handleCheck() {
if (!this.isJoin && this.opinions.length < 1) {
uni.$showErrorInfo('请输入请假原因!')
return false
} else if (this.isJoin && this.opinions.length > 1) {
this.opinions = ''
}
this.$emit('chilCheck', {
opinions: this.opinions,
isJoin: this.isJoin
}, function(res) {})
},
}
}
</script>
<style scoped>
.btn-wrap {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 12px;
z-index: 1000;
background: #fff;
box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05);
}
.buttons {
display: flex;
margin-top: 6px;
justify-content: space-between;
}
</style>

View File

@ -0,0 +1,62 @@
<!-- 使用审批的UI -->
<template>
<view class="check-action">
<view class="btn-wrap">
<view>
<u--textarea v-model="opinions" placeholder="请输入意见"></u--textarea>
</view>
<view class="buttons">
<u-button @click="handlePass" class="btn first-btn" type="primary" text="同意"></u-button>
<u-button @click="handleReject" type="warning" text="驳回"></u-button>
</view>
</view>
</view>
</template>
<script>
export default {
props: {},
data() {
return {
opinions: ''
}
},
methods: {
handlePass() {
this.$emit('chilPass', {
opinions: this.opinions
}, function(res) {})
},
handleReject() {
this.$emit('chilReject', {
opinions: this.opinions
}, function(res) {})
},
}
}
</script>
<style scoped>
.btn-wrap {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
box-sizing: border-box;
padding: 16px;
z-index: 1000;
background: #fff;
box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05);
}
.buttons {
margin-top: 5px;
display: flex;
justify-content: space-between;
}
.buttons .first-btn {
margin-right: 20px;
}
</style>

View File

@ -0,0 +1,200 @@
<template>
<view class="task-card" @click="handleClick">
<view class="card-body">
<view class="left" v-if="icon">
<image class="todo-icon" src="/static/icon_todo@2x.png" />
</view>
<view class="contain">
<view>
<view class="content">
<slot name="title">
<text class="content-text">
{{dataSource.title}}
</text>
</slot>
</view>
<view class="content-bottom">
<slot>
<view class="date-time">
<view class="start-time time">
<text class="green point"></text>
<text class="label">开始时间:</text>
<text class="value">{{dataSource.startTime}}</text>
</view>
<view class="end-time time">
<text class="red point"></text>
<text class="label">截止时间:</text>
<text class="value">{{dataSource.endTime}}</text>
</view>
</view>
<view class="content-status">
<text :class="dataSource.status === 0 ? 'status normal' : 'status warn'">{{dataSource.statusText}}</text>
</view>
</slot>
</view>
</view>
<view style="display: flex;align-items: center;" v-if="arrow===true">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
dataSource: {
type: Object,
default() {
return {}
}
},
icon: {
type: Boolean,
default: false
},
arrow: {
type: Boolean,
default: true
}
},
methods: {
handleClick() {
this.$emit('click', this.dataSource)
}
}
}
</script>
<style scoped>
.task-card {
border-radius: 8px;
margin-bottom: 12px;
font-size: 14px;
overflow: hidden;
/*display: flex;*/
/*flex-direction: row;*/
padding: 14px;
/*box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);*/
/*box-sizing: border-box;*/
/* #ifndef APP-NVUE */
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
/* #endif */
/*#ifdef APP-NVUE */
border: 1px solid rgba(0, 0, 0, 0.1);
/*#endif */
}
.task-card .card-body {
display: flex;
flex-direction: row;
align-items: flex-start;
}
.task-card .card-body .left {
margin-right: 4px;
width: 20px;
padding-top: 4px;
}
.task-card .card-body .left .todo-icon {
width: 16px;
height: 16px;
}
.task-card .card-body .contain {
flex: 1;
display:flex;
flex-direction: row;
justify-content:space-between
}
.task-card .card-body .content {
margin-bottom: 6px;
display: flex;
flex-direction: row;
align-items: center;
}
.task-card .card-body .content-text {
color: #333333;
line-height: 24px;
font-weight: bold;
font-size: 16px;
flex: 1;
/* #ifndef APP-NVUE */
display: block;
/* #endif */
}
.task-card .card-body .content-bottom {
display: flex;
flex-direction: row;
align-items: flex-end;
}
.task-card .card-body .date-time {
flex: 1
}
.task-card .card-body .content-status {
width: 56px;
}
.task-card .card-body .status {
background: rgba(255, 87, 51, 0.2);
color: rgba(255, 87, 51, 1);
text-align: center;
font-size: 12px;
width: 56px;
height: 18px;
line-height: 18px;
border-radius: 2px;
}
.task-card .card-body .status.normal {
background: rgba(0, 161, 64, 0.2);
color: rgba(0, 161, 64, 1);
}
.task-card .card-body .status.warn {
background: rgba(202, 158, 3, 0.2);
color: rgba(202, 158, 3, 1);
}
.task-card .card-body .time {
font-weight: 400;
line-height: 18px;
color: #333333;
display: flex;
flex-direction: row;
margin-top: 4px;
align-items: center;
}
.task-card .card-body .time .point {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 4px;
}
.task-card .card-body .time .point.green {
background: #00A140;
}
.task-card .card-body .time .point.red {
background: #EE0A24;
}
.task-card .card-body .label {
color: #666666;
font-size: 12px;
}
.task-card .card-body .value {
font-size: 12px;
}
</style>

View File

@ -0,0 +1,187 @@
<template>
<view class="task-card" @click="handleClick">
<view class="card-body">
<view class="left" v-if="icon">
<image class="todo-icon" src="/static/icon_todo@2x.png" />
</view>
<view class="contain">
<view class="content">
<text class="content-text">
{{dataSource.title}}
</text>
</view>
<view class="content-bottom">
<slot>
<view class="date-time">
<view class="start-time time">
<text class="green point"></text>
<text class="label">开始时间</text>
<text class="value">{{dataSource.startTime}}</text>
</view>
<view class="end-time time">
<text class="red point"></text>
<text class="label">截止时间</text>
<text class="value">{{dataSource.endTime}}</text>
</view>
</view>
<view class="content-status">
<!-- <text class="status">{{statusToText(dataSource.status)}}</text>-->
<text :class="dataSource.textStatus === '正常' ? 'status' : 'status warn'">{{dataSource.textStatus}}</text>
</view>
</slot>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
dataSource: {
type: Object,
default() {
return {}
}
},
icon: {
type: Boolean,
default: false
}
},
methods: {
statusToText(s) {
// TODO: 0-
switch (s) {
case 0:
return '待处理'
default:
return '已处理'
}
},
handleClick() {
this.$emit('click', this.dataSource)
}
}
}
</script>
<style scoped>
.task-card {
border-radius: 8px;
margin-bottom: 12px;
font-size: 14px;
overflow: hidden;
/*display: flex;*/
/*flex-direction: row;*/
padding: 14px;
/*box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);*/
/*box-sizing: border-box;*/
/* #ifndef APP-NVUE */
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
/* #endif */
/*#ifdef APP-NVUE */
border: 1px solid rgba(0, 0, 0, 0.1);
/*#endif */
}
.task-card .card-body {
display: flex;
flex-direction: row;
}
.task-card .card-body .left {
margin-right: 4px;
width: 20px;
padding-top: 4px;
}
.task-card .card-body .left .todo-icon {
width: 16px;
height: 16px;
}
.task-card .card-body .contain {
flex: 1;
}
.task-card .card-body .content {
margin-bottom: 6px;
display: flex;
flex-direction: row;
}
.task-card .card-body .content-text {
color: #333333;
line-height: 24px;
font-weight: bold;
font-size: 16px;
flex: 1;
}
.task-card .card-body .content-bottom {
display: flex;
flex-direction: row;
align-items: flex-end;
}
.task-card .card-body .date-time {
flex: 1
}
.task-card .card-body .content-status {
width: 56px;
}
.task-card .card-body .status {
background: rgba(255, 87, 51, 0.2);
color: rgba(255, 87, 51, 1);
text-align: center;
font-size: 12px;
width: 56px;
height: 18px;
line-height: 18px;
border-radius: 2px;
}
.task-card .card-body .status.normal {
background: rgba(0, 161, 64, 0.2);
color: rgba(0, 161, 64, 1);
}
.task-card .card-body .status.warn {
background: rgba(202, 158, 3, 0.2);
color: rgba(202, 158, 3, 1);
}
.task-card .card-body .time {
font-weight: 400;
line-height: 18px;
color: #333333;
display: flex;
flex-direction: row;
margin-top: 4px;
align-items: center;
}
.task-card .card-body .time .point {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 4px;
}
.task-card .card-body .time .point.green {
background: #00A140;
}
.task-card .card-body .time .point.red {
background: #EE0A24;
}
.task-card .card-body .label {
color: #666666;
font-size: 12px;
}
.task-card .card-body .value {
font-size: 12px;
}
</style>

View File

@ -0,0 +1,204 @@
<template>
<view class="task-card" @click="handleClick">
<view class="content-status">
<text :class="dataSource.status === 0 ? 'status normal' : 'status warn'">{{dataSource.statusText}}</text>
</view>
<view class="card-body">
<view class="left" v-if="icon">
<!-- <image class="todo-icon" src="/static/icon_todo@2x.png" /> -->
<u-icon name="list-dot"></u-icon>
</view>
<view class="contain">
<view class="content">
<slot name="title">
<text class="content-text">
{{dataSource.title}}
</text>
</slot>
</view>
<view class="content-bottom">
<slot>
<view class="date-time">
<view class="start-time time">
<text class="green point"></text>
<text class="label">开始时间:</text>
<text class="value">{{dataSource.startTime}}</text>
</view>
<view class="end-time time">
<text class="red point"></text>
<text class="label">截止时间:</text>
<text class="value">{{dataSource.endTime}}</text>
</view>
</view>
<!-- <view class="content-status">
<text :class="dataSource.status === 0 ? 'status normal' : 'status warn'">{{dataSource.statusText}}</text>
</view> -->
<view style="display: flex;flex-direction: row;justify-content: space-between;">
<!-- <view style="margin-right: 30px;">
<text :class="dataSource.status === 0 ? 'status normal' : 'status warn'">{{dataSource.statusText}}</text>
</view> -->
<u-icon name="arrow-right"></u-icon>
</view>
</slot>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
dataSource: {
type: Object,
default () {
return {}
}
},
icon: {
type: Boolean,
default: false
},
},
methods: {
handleClick() {
this.$emit('click', this.dataSource)
}
}
}
</script>
<style scoped>
.task-card {
border-radius: 8px;
margin-bottom: 12px;
font-size: 14px;
overflow: hidden;
/*display: flex;*/
/*flex-direction: row;*/
padding:10px 14px 14px 14px;
/*box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);*/
/*box-sizing: border-box;*/
/* #ifndef APP-NVUE */
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
/* #endif */
/*#ifdef APP-NVUE */
border: 1px solid rgba(0, 0, 0, 0.1);
/*#endif */
}
.task-card .card-body {
display: flex;
flex-direction: row;
align-items: flex-start;
}
.task-card .card-body .left {
margin-right: 4px;
width: 20px;
padding-top: 4px;
}
.task-card .card-body .left .todo-icon {
width: 16px;
height: 16px;
}
.task-card .card-body .contain {
flex: 1;
}
.task-card .card-body .content {
margin-bottom: 6px;
display: flex;
flex-direction: row;
align-items: center;
margin-right: 40px;
}
.task-card .card-body .content-text {
color: #333333;
line-height: 24px;
font-weight: bold;
font-size: 14px;
flex: 1;
/* #ifndef APP-NVUE */
display: block;
/* #endif */
}
.task-card .card-body .content-bottom {
display: flex;
flex-direction: row;
align-items: flex-start;
}
.task-card .card-body .date-time {
flex: 1
}
.content-status {
/* width: 56px; */
position: absolute;
top: 0;
right: 0;
}
.status {
background: rgba(255, 87, 51, 0.2);
color: rgba(255, 87, 51, 1);
text-align: center;
font-size: 12px;
/* width: 56px;
height: 20px; */
/* line-height: 18px; */
border-radius: 0px 8px 0px 8px;
}
.status.normal {
background: rgba(70, 188, 170, 1.0);
/* color: rgba(0, 161, 64, 1); */
color: #fff;
padding: 3px 14px;
}
.status.warn {
background: rgba(243, 121, 95, 1.0);
/* color: rgba(202, 158, 3, 1); */
color: #fff;
padding: 3px 14px;
}
.task-card .card-body .time {
font-weight: 400;
line-height: 18px;
color: #333333;
display: flex;
flex-direction: row;
margin-top: 4px;
align-items: center;
}
.task-card .card-body .time .point {
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
.task-card .card-body .time .point.green {
background: #3a9d8d;
}
.task-card .card-body .time .point.red {
background: #f34e16;
}
.task-card .card-body .label {
color: #666666;
font-size: 12px;
}
.task-card .card-body .value {
font-size: 12px;
}
</style>

View File

@ -0,0 +1,319 @@
<template>
<view class="full-upload" v-if="isShowBtn">
<view class="upload-plugin" v-if="isShowBlueButton">
<lsj-upload ref="fullUpload" childId="upload1" :option="option" :instantly="true" height="30px"
@change="change" @uploadEnd="onuploadEnd" :multiple="false"> <!-- @progress="onprogre" -->
<view class="row">
<view class="btn" @click="handleTap">
<u-button :loading="isLoading" :disabled="isLoading" type="primary" size="small" text="附件">
</u-button>
</view>
</view>
</lsj-upload>
</view>
<!-- 上传的另一种形式 isShowBlueButton为false-->
<view class="upload-plugin-info" v-else>
<lsj-upload ref="fullUpload" childId="upload1" :option="option" :instantly="true" height="82px"
@change="change" @uploadEnd="onuploadEnd" :multiple="false"> <!-- @progress="onprogre" -->
<view>
<view @click="handleTap">
<!-- <u-button :loading="isLoading" :disabled="isLoading" type="primary" size="small" text="附件">
</u-button> -->
<view class="plus-info">
<u-icon name="plus" color="#c8c7cc" size="20" v-if="!isLoading"></u-icon>
<u-loading-icon :show="isLoading" mode="circle" size="20"></u-loading-icon>
</view>
</view>
</view>
</lsj-upload>
</view>
<view class="list">
<u-cell-group :border="false">
<u-cell title="" v-for="(value, key) in uFiles.filter(i => !i.IS_DELETED)" :key="key">
<view slot="icon" style="font-size: 16px;color: #2797ff;" @click="preview(value)"
v-if="value.name.indexOf('png') > -1 || value.name.indexOf('jpg') > -1 || value.name.indexOf('jpeg') > -1|| value.name.indexOf('gif') > -1">
{{value.name}}
</view>
<u-link slot="icon" :href="baseUrl + ':3199' + value.remotePath" :text="value.name" color="#2797ff"
v-else></u-link>
<u-icon slot="right-icon" size="16" name="trash" @click="delFile(value, key)"></u-icon>
</u-cell>
</u-cell-group>
</view>
</view>
<view v-else>
<view class="list">
<u-cell-group>
<u-cell title="" v-for="(value, key) in uFiles" :key="key">
<view slot="icon" style="font-size: 16px;color: #2797ff;" @click="preview(value)"
v-if="value.name.indexOf('png') > -1 || value.name.indexOf('jpg') > -1 || value.name.indexOf('jpeg') > -1|| value.name.indexOf('gif') > -1">
{{value.name}}
</view>
<u-link slot="icon" :href="baseUrl + ':3199' + value.remotePath" :text="value.name" color="#2797ff"
v-else></u-link>
<!--wyw 兼顾图片和文件 -->
<!-- <u-link v-if="value.remotePath!=undefined&&value.remotePath.indexOf('.png')>-1" slot="icon"
:href="baseUrl + ':3199' + value.remotePath" :text="value.name"></u-link>
<image v-else slot="icon" style="width: 120px; height: 80px; background-color: #eeeeee;"
:src="'http://localhost:3199' + value.remotePath" ></image> -->
</u-cell>
</u-cell-group>
</view>
</view>
</template>
<script>
import UButton from '../../uni_modules/uview-ui/components/u-button/u-button.vue'
import config from '../../config/common'
import {
guid
} from '../../utils/common'
export default {
components: {
UButton
},
model: {
event: 'upload',
prop: 'value'
},
props: {
upload: {
type: Function,
default () {
return undefined
}
},
value: {
type: Array,
default () {
return undefined
}
},
isShowBtn: { //
type: Boolean,
default () {
return true
}
},
listProp: { //model
type: Array,
default () {
return undefined
}
},
listPropVal: { //model
type: Array,
default () {
return undefined
}
},
isShowBlueButton: {
type: Boolean,
default () {
return true
}
}
// IMG_FILE_ID: {
// type: String,
// default () {
// return guid()
// }
// },
},
data() {
return {
baseUrl: config.uni_app_web_api_url,
//
option: {
url: config.serviceHost('/PF/File/UploadFile'),
name: 'file',
header: {
Tenant: uni.getStorageSync('Tenant') || '',
userid: uni.getStorageSync('appInfo')?.User?.ID || ''
},
formData: {
OrgId: uni.getStorageSync('orgId'),
imgFileID: guid()
}
},
uFiles: [],
isLoading: false
}
},
beforeMount() {
//wyw
if (this.value && this.value.length > 0) {
this.uFiles = this.value
for (let i = 0; i < this.uFiles.length; i++) {
if (this.uFiles[i].Nav_ImgFile != undefined) {
this.uFiles[i].remotePath = this.uFiles[i].Nav_ImgFile.Nav_File.FILE_PATH
// this.uFiles[i].name = this.uFiles[i].Nav_ImgFile.Nav_File.FILE_NAME
this.uFiles[i].name = this.uFiles[i].Nav_ImgFile.FILE_NAME // wyw 2024-04-17
}
}
}
},
watch: {
value() {
if (this.value == null)
this.value = []
this.uFiles = this.value
if (this.uFiles && this.uFiles.length > 0) {
for (let i = 0; i < this.uFiles.length; i++) {
if (this.uFiles[i].Nav_ImgFile != undefined) {
this.uFiles[i].remotePath = this.uFiles[i].Nav_ImgFile.Nav_File.FILE_PATH
// this.uFiles[i].name = this.uFiles[i].Nav_ImgFile.Nav_File.FILE_NAME
this.uFiles[i].name = this.uFiles[i].Nav_ImgFile.FILE_NAME // wyw 2024-04-17
}
}
}
}
},
methods: {
preview(value) {
let urlshref = this.baseUrl + ':3199' + value.remotePath
uni.previewImage({
urls: [urlshref]
})
},
handleTap() {
this.$nextTick(() => {
this.$refs['fullUpload'].show()
})
},
onuploadEnd(item) {
//
this.$forceUpdate()
this.isLoading = false
// this.dataUpdate() //
if (item.responseText) {
item.responseText = JSON.parse(item.responseText).Data
item.remotePath = item.responseText.imgFilePath
// item.remoteId = item.responseText.imgFileID
// item.IMG_FILE_ID = item.responseText.imgFileID
item.remoteId = this.option.formData.imgFileID
item.IMG_FILE_ID = this.option.formData.imgFileID
item.ORG_ID = uni.getStorageSync('orgId')
item.ID = guid()
if (this.listProp != undefined && this.listProp.length > 0) {
for (let i = 0; i < this.listProp.length; i++) {
item[this.listProp[i]] = this.listPropVal[i]
}
}
if (!this.uFiles) {
this.uFiles = []
}
this.uFiles.push(item)
}
// this.option.formData.imgFileID = guid() //ykx guidimgfileid
this.$refs.fullUpload.setData('formData.imgFileID', guid())
},
change(files) {
// const allFiles = [...files.values()]
this.isLoading = true
// this.option.formData.imgFileID = guid()
// allFiles.forEach(e => {
// // IMG_FILE_ID null
// // debugger
// if (!e.IMG_FILE_ID) {
// e.IMG_FILE_ID = this.option.formData.imgFileID
// e.ORG_ID = uni.getStorageSync('orgId')
// e.ID = guid()
// if (this.listProp != undefined && this.listProp.length > 0) {
// for (let i = 0; i < this.listProp.length; i++) {
// e[this.listProp[i]] = this.listPropVal[i]
// }
// }
// if (!this.uFiles)
// this.uFiles = []
// this.uFiles.push(e)
// }
// })
// this.dataUpdate() //
// this.$emit('upload', allFiles)
this.$emit('upload', this.uFiles) //wyw
//
// this.$forceUpdate();
},
//
dataUpdate() {
this.uFiles.forEach(e => {
if (e.responseText && (!e.IMG_FILE_ID || !e.ORG_ID)) {
e.responseText = JSON.parse(e.responseText).Data
e.remotePath = e.responseText.imgFilePath
e.remoteId = e.responseText.imgFileID
// e.IMG_FILE_ID = e.responseText.imgFileID
// debugger
// e.ORG_ID = uni.getStorageSync('orgId')
// e.ID = guid()
// if (this.listProp != undefined && this.listProp.length > 0) {
// for (let i = 0; i < this.listProp.length; i++) {
// e[this.listProp[i]] = this.listPropVal[i]
// }
// }
}
// else {
// if (isReturn && !e.IMG_FILE_ID) {
// return false
// }
// }
})
},
delFile(val, key) {
// // bug
// this.uFiles.splice(key, 1)
// this.$refs['fullUpload'].clear(val.name)
// this.isLoading = false
//wyw 2024-04-17
//
// CREATER_ID CREATE_TIME
// IS_DELETED
if (val.CREATER_ID || val.CREATE_TIME) {
val.IS_DELETED = true
this.$refs['fullUpload'].clear(val.name)
this.isLoading = false
//线
} else {
this.uFiles.splice(key, 1)
this.$refs['fullUpload'].clear(val.name)
this.isLoading = false
}
}
}
}
</script>
<style scoped>
.upload-plugin {
width: 100px;
}
.upload-plugin-info {
width: 82px;
}
.plus-info {
border: 1px solid #c8c7cc;
display: flex;
align-items: center;
justify-content: center;
padding: 30px 0px;
border-radius: 4px;
}
</style>
<style>
.list>>>.u-cell__left-icon-wrap {
width: 100%;
word-break: break-all;
}
</style>

View File

@ -0,0 +1,89 @@
<template>
<!-- #ifndef H5 -->
<view class="nav-box" :style="{'height':height}">
<!-- 状态栏占位 -->
<view class="status_bar" :style="{'height':statusBarHeight}"></view>
<!-- 导航内容 -->
<view class="nav-main" :style="{'height': navBarHeight}" style="font-size: 16px;opacity: 1;">
<view class="title-info">{{title}}</view>
</view>
</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view style="background-color: #ffffff;" :style="{'height':statusBarHeight}"></view>
<!-- #endif -->
</template>
<script>
export default {
props: {
title: {
type: String,
default: ''
},
},
data() {
return {
//
height: 0,
//
statusBarHeight: 0,
//
navBarHeight: 0
}
},
created() {
let that = this;
uni.getSystemInfo({
success: function(res) {
if (res.model.indexOf('iPhone') !== -1) {
that.navBarHeight = 44 + 'px'
that.height = res.statusBarHeight + 44 + 'px'
} else {
that.navBarHeight = 48 + 'px'
that.height = res.statusBarHeight + 48 + 'px'
}
that.statusBarHeight = res.statusBarHeight + 'px';
}
})
},
methods: {
}
}
</script>
<style>
.nav-box {}
.status_bar {
/* width: 100%; */
background-color: #ffffff;
}
.nav-main {
/* position: fixed; */
padding: 7px 3px;
text-align: center;
overflow: hidden;
box-sizing: border-box;
z-index: 998;
background-color: #ffffff;
/* width: 100%; */
}
.title-info {
display: flex;
align-items: center;
justify-content: center;
color: #000;
text-align: center;
line-height: 30px;
/* font-weight: bold; */
}
.nav-main-title {
color: #000;
font-size: 32px;
}
</style>

View File

@ -0,0 +1,54 @@
<!-- wyw 显示人员签名 -->
<template>
<view class="image">
<image v-bind:style="{width: width+'px', height:height+'px'}" :src="urlResult">
</image>
</view>
</template>
<script>
import config from '@/config/common'
export default {
props: {
user: {
type: Object,
default () {
return {}
}
},
width: {
type: Int32Array,
default () {
return 150
}
},
height: {
type: Int32Array,
default () {
return 60
}
}
},
data() {
return {
baseUrl: config.uni_app_web_api_url,
urlResult: ''
}
},
beforeMount() {
if (this.user && this.user.Nav_UserSignFiles && this.user.Nav_UserSignFiles.length > 0 && this.user
.Nav_UserSignFiles[0].Nav_ImgFile && this.user.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File) {
this.urlResult = this.baseUrl + ':3199' + this.user.Nav_UserSignFiles[0].Nav_ImgFile.Nav_File.FILE_PATH
} else {
this.urlResult = ''
}
}
}
</script>
<style scoped>
/* .image {
width: 150px;
height: 100px;
} */
</style>

View File

@ -0,0 +1,123 @@
<template>
<view class="each-department">
<u-checkbox-group
:value="newChecked"
placement="column"
@change="e => checkboxChange(e, level)"
>
<view v-for="(item, key) in lists" :key="key">
<view class="box">
<view class="row">
<view><text v-for="i in (level - 1)" :key="i"></text></view>
<u-checkbox
:name="item.ID"
:key="item.ID"
></u-checkbox>
<text class="dep-name" @click="handleOpenCollapse(item, key)">{{item.NAME}}</text>
</view>
<view class="sub-box" :style="{height: item.isExpand ? 'auto' : 0}" v-if="item.departments || item.users">
<each-department
:level="level + 1"
:lists="item.departments"
:checkboxValueAll="checkboxValueAll"
@check="handleCheckAll"
@expand="handleSubOpenCollapse"></each-department>
<view class="row" v-for="(o, u) in item.users">
<view><text v-for="i in (level)" :key="i"></text></view>
<u-checkbox
:key="o.ID"
:name="o.ID"
:label="o.NAME"
></u-checkbox>
</view>
</view>
</view>
</view>
</u-checkbox-group>
</view>
</template>
<script>
export default {
name: 'EachDepartment',
props: {
lists: {
type: Array,
default() {
return []
}
},
level: {
type: Number
},
checkboxValueAll: {
type: Object,
default() {
return {}
}
}
},
data() {
return {
checkboxValueAllForObj: [],
checkboxValueForObj: [],
checkboxValue: []
}
},
mounted() {
},
methods: {
handleOpenCollapse(val) {
setTimeout(() => {
this.$forceUpdate()
}, 200)
this.$emit('expand', val)
},
handleSubOpenCollapse(val) {
setTimeout(() => {
this.$forceUpdate()
}, 200)
this.$emit('expand', val)
},
checkboxChange(e, n) {
this.$emit('check', {[n]: e})
},
handleCheckAll(res) {
this.$emit('check', res)
},
handleClick() {
this.$emit('click', this.dataSource)
}
},
computed: {
newChecked() {
const a = Object.keys(this.checkboxValueAll).map(i => this.checkboxValueAll[i])
let c = []
a.forEach(i => {c = c.concat(i)})
return c
},
},
watch: {
// checkboxValueAll(newVal, oldVal) {
// return newVal
// },
},
}
</script>
<style scoped>
.each-department {
}
.each-department .row {
display: flex;
align-items: center;
margin-bottom: 16px;
}
.each-department .row .dep-name {
color: #3c9cff;
}
.each-department .sub-box {
overflow: hidden;
}
</style>

View File

@ -0,0 +1,108 @@
<template>
<view class="each-department">
<view v-for="(item, key) in lists" :key="key">
<view class="box">
<view class="row" @click="handleOpenCollapse(item, key)">
<view><text v-for="i in (level - 1)" :key="i"></text></view>
<!-- <u-checkbox-->
<!-- labelColor="#3c9cff"-->
<!-- :name="item.ID"-->
<!-- :key="item.ID"-->
<!-- :label="item.NAME"-->
<!-- type="dep"-->
<!-- ></u-checkbox>-->
<text class="dep-name">{{item.NAME}}</text>
<u-icon class="expand-icon" v-if="!item.isExpand" name="arrow-down-fill" size="14"></u-icon>
<u-icon class="expand-icon" v-else name="arrow-up-fill" size="14"></u-icon>
</view>
<view class="sub-box" v-show="item.isExpand" v-if="item.departments || item.users">
<each-department
:level="level + 1"
:lists="item.departments"
@expand="handleSubOpenCollapse"></each-department>
<view class="row" v-for="(o, u) in item.users">
<view><text v-for="i in (level)" :key="i"></text></view>
<u-checkbox
:key="o.ID"
:name="o.ID"
:label="o.NAME"
></u-checkbox>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'EachDepartment',
props: {
lists: {
type: Array,
default() {
return []
}
},
level: {
type: Number
},
subKey: {
type: Number
}
},
data() {
return {
checkboxValueAllForObj: [],
checkboxValueForObj: [],
checkboxValue: []
}
},
mounted() {
},
methods: {
handleOpenCollapse(val) {
setTimeout(() => {
this.$forceUpdate()
}, 200)
this.$emit('expand', val)
},
handleSubOpenCollapse(val) {
setTimeout(() => {
this.$forceUpdate()
}, 200)
this.$emit('expand', val)
},
checkboxChange(e, n) {
this.$emit('check', {[n]: e})
},
handleClick() {
this.$emit('click', this.dataSource)
}
}
}
</script>
<style scoped>
.each-department {
}
.each-department .box {
margin-bottom: 16px;
}
.each-department .row {
display: flex;
align-items: center;
margin-bottom: 16px;
}
.each-department .row .dep-name {
color: #3c9cff;
margin-right: 6px;
}
.each-department .expand-icon {
margin-left: 10px;
}
.each-department .sub-box {
overflow: hidden;
}
</style>

View File

@ -0,0 +1,604 @@
<template>
<view class="people-selector">
<u-popup
:show="showComponent"
:round="10"
mode="bottom"
:closeable="true"
:customStyle="{paddingTop: '40px'}"
@open="onOpen"
@close="handleCloseComponet">
<u-list
:pagingEnabled="true"
>
<uni-search-bar
class="search-bar"
radius="100"
placeholder="搜索"
@confirm="manualSearch"
@cancel="cancelSearch"
@clear="clearSearch"
></uni-search-bar>
<view class="main">
<uni-card v-if="!!searchResult.length" margin="0" spacing="0" padding="8" style="margin-bottom: 16px">
<view>搜索结果</view>
<u-checkbox-group
:value="checkedSearchResult"
placement="column"
@change="handleCheckboxSearchResult"
>
<u-checkbox
:customStyle="{marginBottom: '18px'}"
v-for="(item, index) in searchResult"
:key="index"
:label="item.NAME"
:name="item.ID"
>
</u-checkbox>
</u-checkbox-group>
</uni-card>
<u-collapse
:border="false"
accordion
ref="collapseRef"
@open="handleOpenOrgCollapse"
:value="currExpand">
<uni-card margin="0" spacing="0" padding="0" style="margin-bottom: 16px">
<u-collapse-item
title="按组织架构选择"
name="org"
:duration="0"
icon="/static/ic_org@2x.png"
>
<!-- @open="handleOpenDepCollapse"-->
<!-- <text slot="icon"></text>-->
<!-- <view>面包屑/导航</view>-->
<view class="department">
<each-department
:level="1"
:lists="orgTree"
:checkboxValueAll="checkedAllForObj"
@check="handleCheckValue"
@expand="handleExpandOrg"></each-department>
</view>
<view class="user-list"></view>
</u-collapse-item>
</uni-card>
<uni-card margin="0" spacing="0" padding="0">
<u-collapse-item
title="本部门选择"
icon="/static/ic_cur_dep@2x.png"
:duration="0"
name="dep"
>
<u-checkbox-group
:value="allLocal"
placement="column"
@change="checkboxAllLocal"
>
<u-checkbox
:customStyle="{marginBottom: '18px'}"
label="全选"
name="all"
>
</u-checkbox>
</u-checkbox-group>
<u-checkbox-group
:value="selectedSelfDepartment"
placement="column"
@change="checkboxChange"
>
<u-checkbox
:customStyle="{marginBottom: '18px'}"
v-for="(item, index) in selfDepartmentUsers"
:key="index"
:label="item.NAME"
:name="item.ID"
>
</u-checkbox>
</u-checkbox-group>
</u-collapse-item>
</uni-card>
</u-collapse>
</view>
<view class="bottom-show">
<view class="user-names" @click="showPopup = true">
<view class="names">
已选中<text v-for="o in (checkedUsersInfo.concat(checkedDepsInfo, checkedUsersInfoLocal))">{{o.NAME}}</text>
</view>
<u-icon
class="expand-icon"
style="margin-left: 8px;"
color="#3b9dff"
name="arrow-up"
></u-icon>
</view>
<view class="handle-btn">
<u-button
@click="handleOkChecked"
type="primary">
确认({{checkedUsersInfo.length + checkedDepsInfo.length + checkedUsersInfoLocal.length}})
</u-button>
</view>
</view>
<u-popup
:show="showPopup"
:round="10"
mode="bottom"
@open="onOpenPopup"
@close="handleClosePopup">
<view class="popup-content">
<view class="head">
<view class="num">已选中({{checkedUsersInfo.length + checkedDepsInfo.length + checkedUsersInfoLocal.length}})</view>
<view class="ok" @click="okPopup">确认</view>
</view>
<view class="body">
<view class="list" v-for="n in (checkedUsersInfo.concat(checkedDepsInfo, checkedUsersInfoLocal))" :key="n.ID">
<view class="n">{{n.NAME}}</view>
<view class="d" @click="removeChecked(n)">移除</view>
</view>
</view>
</view>
</u-popup>
</u-list>
</u-popup>
</view>
</template>
<script>
import UButton from '../../../uni_modules/uview-ui/components/u-button/u-button.vue'
import EachDepartment from './each-department-old.vue'
import {
extendFilterGroup,
extendGroupRule,
extendInclude,
extendRule,
initFilter,
initFilterGroup
} from '../../../utils/common'
import { getDepartmentLists } from '../../../services/app'
import { getUserLists, getUserOrDepInfo } from '../../../services/common'
export default {
components: { UButton, EachDepartment },
props: {
show: {
type: Boolean,
default: false,
required: true
}
},
data() {
return {
showComponent: false,
currExpand: 'dep',
orgTree: [],
showPopup: false,
// selectedSelfDepartment: [],
// checkedSearchResult: [],
allLocal: [],
searchResult: [],
selfDepartmentUsers: [],
checkedAllForObj: {},
checkedAllInfo: [],
checkedUsersInfoLocal: [],
checkedUsersInfo: [],
checkedDepsInfo: [],
}
},
methods: {
onOpen() {
const appInfoData = uni.getStorageSync('appInfo')
const departmentId = appInfoData?.User?.DEPARTMENT_ID || ''
this.handleSearchUser(null, {ID: departmentId})
},
async manualSearch(e) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME")
extendInclude(json, "Nav_Person.Nav_Post")
extendRule(json, 'ENABLE_STATUS', 1, '0')
const tempGroup = initFilterGroup(false);
extendGroupRule(tempGroup, 'NAME', 9, e.value)
extendFilterGroup(json, tempGroup)
getUserLists(json).then(res => {
if (res.IsSuccessful) {
this.searchResult = res.Data
}
})
},
cancelSearch() {
this.searchResult = []
},
clearSearch() {
this.searchResult = []
},
handleSearchUser(userVal, depVal) {
const appInfoData = uni.getStorageSync('appInfo')
const departmentId = appInfoData?.User?.DEPARTMENT_ID || ''
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME")
extendInclude(json, "Nav_Person.Nav_Post")
extendRule(json, 'ENABLE_STATUS', 1, '0')
if (depVal) {
extendRule(json, 'DEPARTMENT_ID', 1, depVal.ID)
}
const tempGroup = initFilterGroup(false)
if (userVal) {
extendGroupRule(tempGroup, 'NAME', 9, userVal.NAME)
}
extendFilterGroup(json, tempGroup)
json.Limit = 100
const that = this
async function findAndAddUser(arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].ID === depVal.ID) {
if (!arr[i].users) {
await getUserLists(json).then(res => {
if (res.IsSuccessful) {
arr[i].users = res.Data
that.$nextTick(() => {
that.$refs.collapseRef.init()
})
}
})
}
} else if (arr[i].users) {
findAndAddUser(arr[i].departments);
}
}
}
if (depVal.ID === departmentId) {
getUserLists(json).then(res => {
if (res.IsSuccessful) {
this.selfDepartmentUsers = res.Data
this.$nextTick(() => {
this.$refs.collapseRef.init()
})
}
})
} else {
findAndAddUser(this.orgTree)
}
},
handleExpandOrg(val) {
this.$nextTick(() => {
setTimeout(() => {
this.$refs.collapseRef.init()
}, 200)
})
this.handleGetOrg(val.ID)
this.handleSearchUser(null, val)
},
handleGetOrg(id) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME")
extendRule(json, 'PARENT_ID', 1, id || null)
// const tempGroup = initFilterGroup(false)
// if (val) {
// extendGroupRule(tempGroup, 'NAME', 9, val)
// }
// extendFilterGroup(json, tempGroup)
json.Limit = 100
let that = this
async function findAndAddDep(arr) {
if (!id) {
await getDepartmentLists(json).then(res => {
if (res.IsSuccessful) {
that.orgTree = res.Data
// findAndAddDep(res.Data);
that.$nextTick(() => {
that.$refs.collapseRef.init()
})
}
})
}
for (let i = 0; i < arr.length; i++) {
if (arr[i].ID === id) {
if (!arr[i].isExpand) {
arr[i].isExpand = true
} else {
arr[i].isExpand = false
}
if (!arr[i].departments) {
await getDepartmentLists(json).then(res => {
if (res.IsSuccessful) {
arr[i].departments = res.Data
that.$nextTick(() => {
that.$refs.collapseRef.init()
})
}
})
}
} else if (arr[i].departments) {
findAndAddDep(arr[i].departments);
}
}
}
findAndAddDep(this.orgTree)
},
handleCheckValue(ob) {
this.checkedAllForObj = {...this.checkedAllForObj, ...ob}
const c = Object.keys(this.checkedAllForObj).filter(r => r != 0)
const d = c.reduce((a, b) => [...a, ...this.checkedAllForObj[b]], [])
const k = d.reduce((a, b) => { return [...a, b]}, [])
const checkedAllInfoArr = []
const checkedUsersInfoArr = []
const checkedDepsInfoArr = []
function findObjectsWithBValue(obj) {
if (Array.isArray(obj)) {
obj.forEach(findObjectsWithBValue);
return;
}
if (typeof obj === 'object' && obj !== null) {
if (obj.ID && k.includes(obj.ID)) {
if (obj.DEPARTMENT_ID) {
checkedUsersInfoArr.push(obj)
} else {
checkedDepsInfoArr.push(obj)
}
checkedAllInfoArr.push(obj)
}
Object.values(obj).forEach(findObjectsWithBValue);
return;
}
}
findObjectsWithBValue(this.orgTree)
this.checkedAllInfo = checkedAllInfoArr
this.checkedDepsInfo = checkedDepsInfoArr
this.checkedUsersInfo = checkedUsersInfoArr
},
async handleOkChecked() {
const orgId = uni.getStorageSync('orgId')
const userIds = this.checkedUsersInfo.map(i => i.ID)
const userIdsLocal = this.checkedUsersInfoLocal.map(i => i.ID)
const departmentIds = this.checkedDepsInfo.map(i => i.ID)
const params = {
UserIds: userIds.concat(userIdsLocal),
DepartmentIds: departmentIds,
OrgId: orgId
}
await getUserOrDepInfo(params).then(res => {
if (res.IsSuccessful) {
const data = res.Data
const userAndDepartment = {
allIds: userIds.concat(userIdsLocal, departmentIds),
userIds: userIds.concat(userIdsLocal),
departmentIds: departmentIds,
allUserIdWithName: data,
allUserInfos: this.checkedUsersInfoLocal.concat(this.checkedUsersInfo),
allDepartmentInfos: this.checkedDepsInfo,
allInfos: this.checkedUsersInfoLocal.concat(this.checkedUsersInfo, this.checkedDepsInfo)
}
this.$emit('select', data)
this.$emit('close', false)
// this.$store.commit('updateUserAndDepartment', userAndDepartment)
// uni.navigateBack(-1)
}
})
},
async handleChangeCollapse() {
this.handleGetOrg()
},
async handleOpenOrgCollapse(e) {
if (e === 'org') {
this.currExpand = 'org'
if (!this.orgTree.length) {
await this.handleGetOrg()
}
}
},
async handleOpenDepCollapse(e) {
if (e === 'org') {
await this.handleGetOrg()
}
},
checkboxAllLocal(e) {
if (e[0] === 'all') {
this.checkedUsersInfoLocal = this.selfDepartmentUsers
} else {
this.checkedUsersInfoLocal = []
}
},
handleCheckboxSearchResult(e) {
if (!this.checkedAllForObj['0']) {
this.checkedAllForObj['0'] = []
}
this.checkedAllForObj['0'].concat(e)
// this.checkedAllInfo.push(this.searchResult)
// this.checkedUsersInfo.push(this.searchResult)
// this.checkedDepsInfo.push(this.searchResult)
// TODO:
this.checkedUsersInfoLocal = this.checkedUsersInfoLocal.concat(this.searchResult)
},
checkboxChange(e) {
const userInfoArr = []
this.selfDepartmentUsers.forEach(item => {
if (e.includes(item.ID)) {
userInfoArr.push(item)
}
})
//
const deleted = []; // ['']
(this.checkedAllForObj['0'] || []).forEach(a => {
if (!(e.includes(a))) {
// a
deleted.push(a)
}
})
//
const addTo = []; // [{}]
userInfoArr.forEach(a => {
if (!((this.checkedAllForObj['0'] || []).includes(a.ID))) {
// a
addTo.push(a)
}
})
const afterDelete = []
this.checkedUsersInfoLocal.forEach(item => {
if (!(deleted.includes(item.ID))) {
//
afterDelete.push(item)
}
})
// addTo
const newCheckedUserInfoArr = afterDelete.concat(addTo)
this.checkedUsersInfoLocal = newCheckedUserInfoArr
this.checkedAllForObj['0'] = e
},
removeChecked(value) {
if (value.DEPARTMENT_ID) {
// ()
const removeAfterUserLocal = this.checkedUsersInfoLocal.filter(item => item.ID !== value.ID)
const removeAfterUser = this.checkedUsersInfo.filter(item => item.ID !== value.ID)
this.checkedUsersInfoLocal = removeAfterUserLocal
this.checkedUsersInfo = removeAfterUser
} else {
const removeAfterDep = this.checkedDepsInfo.filter(item => item.ID !== value.ID)
this.checkedDepsInfo = removeAfterDep
}
// (ID)
Object.keys(this.checkedAllForObj).forEach(i => {
this.checkedAllForObj[i].forEach((o, k) => {
if (value.ID === o) {
this.checkedAllForObj[i].splice(k, 1)
}
})
})
this.$forceUpdate()
},
onOpenPopup() {
},
okPopup() {
this.showPopup = false
this.$forceUpdate()
},
handleClosePopup() {
this.showPopup = false
},
handleCloseComponet() {
this.$emit('close', !this.showComponent)
}
},
computed: {
// ...mapState({
// username: state => state.homeModule.username,
// age: state => state.homeModule.age
// })
selectedSelfDepartment() {
return this.checkedUsersInfoLocal.map(i => i.ID)
},
checkedSearchResult() {
const a = Object.keys(this.checkedAllForObj).map(i => this.checkedAllForObj[i])
let c = []
a.forEach(i => {c = c.concat(i)})
return c
},
},
watch: {
show(n) {
this.showComponent = this.show
}
}
}
</script>
<style scoped>
.people-selector {
/*height: 100vh;*/
}
.people-selector .main {
padding: 6px 16px 70px;
}
.bottom-show {
height: 62px;
border-top: 1px solid #C9C9C9;
display: flex;
align-items: center;
position: fixed;
width: 100%;
bottom: 0;
left: 0;
padding: 0 16px;
box-sizing: border-box;
z-index: 10;
justify-content: space-between;
background: #fff;
}
.user-names {
color: #3b9dff;
font-size: 14px;
line-height: 18px;
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
width: calc(100% - 112px - 25px);
padding-right: 25px;
}
.user-names .names {
/*width: 184px;*/
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}
.user-names .expand-icon {
width: 16px;
height: 16px;
}
.handle-btn {
/*background: #fff;*/
}
.popup-content {
height: 400px;
}
.popup-content .head {
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #C9C9C9;
padding: 0 16px;
font-size: 14px;
}
.popup-content .head .num {
color: #333333;
}
.popup-content .head .ok {
color: #3b9dff;
}
.popup-content .body {
padding: 16px;
height: 350px;
overflow-y: auto;
}
.popup-content .body .list {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
font-size: 14px;
color: #333333;
line-height: 18px;
}
.popup-content .body .list .d {
width: 32px;
height: 18px;
line-height: 18px;
border: 1px solid #c9c9c9;
border-radius: 4px;
color: #999999;
font-size: 10px;
text-align: center;
}
</style>

View File

@ -0,0 +1,607 @@
<template>
<view class="people-selector">
<u-popup
:show="showComponent"
:round="10"
mode="bottom"
:closeable="true"
:customStyle="{paddingTop: '40px'}"
@open="onOpen"
@close="handleCloseComponet">
<u-list
:pagingEnabled="true"
>
<uni-search-bar
class="search-bar"
radius="100"
placeholder="搜索"
@confirm="manualSearch"
@cancel="cancelSearch"
@clear="clearSearch"
></uni-search-bar>
<view class="main">
<u-checkbox-group
:value="checkedForId"
placement="column"
@change="handleCheckboxAllResult"
@onchange="handleCheckboxCurr"
>
<uni-card v-if="!!searchResult.length" margin="0" spacing="0" padding="8" style="margin-bottom: 16px">
<view class="search-title">搜索结果</view>
<u-checkbox
:customStyle="{marginBottom: '18px'}"
v-for="(item, index) in searchResult"
:key="index"
:label="item.NAME"
:name="item.ID"
>
</u-checkbox>
</uni-card>
<uni-collapse
accordion
ref="collapse"
@change="handleOpenOrgCollapse"
:value="currExpand">
<uni-card margin="0" spacing="0" padding="0" style="margin-bottom: 16px">
<uni-collapse-item
title="按组织架构选择"
name="org"
thumb="/static/ic_org@2x.png"
:border="false"
:style="currExpand === 'org' ? {marginBottom: '16px'} : {}"
>
<!-- @open="handleOpenDepCollapse"-->
<!-- <text slot="icon"></text>-->
<!-- <view>面包屑/导航</view>-->
<view class="department">
<each-department
:level="1"
:key="subKey"
:lists="orgTree"
@expand="handleExpandOrg"></each-department>
</view>
<view class="user-list"></view>
</uni-collapse-item>
</uni-card>
<uni-card margin="0" spacing="0" padding="0">
<uni-collapse-item
title="本部门选择"
thumb="/static/ic_cur_dep@2x.png"
name="dep"
>
<view class="self">
<u-checkbox
:customStyle="{marginBottom: '18px'}"
label="全选"
name="all"
>
</u-checkbox>
<u-checkbox
:customStyle="{marginBottom: '18px'}"
v-for="(item, index) in selfDepartmentUsers"
:key="index"
:label="item.NAME"
:name="item.ID"
>
</u-checkbox>
</view>
</uni-collapse-item>
</uni-card>
</uni-collapse>
</u-checkbox-group>
</view>
</u-list>
<view class="bottom-show">
<view class="user-names" @click="showPopup = true">
<view class="names">
已选中<text v-for="o in checkedByAll.filter(i => !i.IS_DELETED)">{{o.NAME}}</text>
</view>
<u-icon
class="expand-icon"
style="margin-left: 8px;"
color="#3b9dff"
name="arrow-up"
></u-icon>
</view>
<view class="handle-btn">
<u-button
@click="handleOkChecked"
type="primary">
确认({{checkedForId.length}})
</u-button>
</view>
</view>
<u-popup
:show="showPopup"
:round="10"
mode="bottom"
@open="onOpenPopup"
@close="handleClosePopup">
<view class="popup-content">
<view class="head">
<view class="num">已选中({{checkedForId.length}})</view>
<view class="ok" @click="okPopup">确认</view>
</view>
<view class="body">
<view class="list" v-for="n in checkedByAll.filter(i => !i.IS_DELETED)" :key="n.ID">
<view class="n">{{n.NAME}}</view>
<view class="d" @click="removeChecked(n)">移除</view>
</view>
</view>
</view>
</u-popup>
</u-popup>
</view>
</template>
<script>
import UButton from '../../../uni_modules/uview-ui/components/u-button/u-button.vue'
import EachDepartment from './each-department.vue'
import {
extendFilterGroup,
extendGroupRule,
extendInclude,
extendRule,
initFilter,
initFilterGroup
} from '../../../utils/common'
import { getDepartmentLists } from '../../../services/app'
import { getUserLists, getUserOrDepInfo, getSubUserLists } from '../../../services/common'
export default {
components: { UButton, EachDepartment },
props: {
show: {
type: Boolean,
default: false,
required: true
},
defaultChecked: {
type: Array,
default() {
return []
}
}
},
data() {
return {
subKey: 1,
showComponent: false,
currExpand: 'dep',
orgTree: [],
checkedUsersInfoLocal: [], //
checkedByAll: [], //
dataByOrg: [], // orgTree
showPopup: false,
searchResult: [], //
selfDepartmentUsers: [], //
}
},
methods: {
onOpen() {
const appInfoData = uni.getStorageSync('appInfo')
const departmentId = appInfoData?.User?.DEPARTMENT_ID || ''
this.handleSearchUser(null, {ID: departmentId})
},
async manualSearch(e) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME")
extendInclude(json, "Nav_Person.Nav_Post")
extendRule(json, 'ENABLE_STATUS', 1, '0')
const tempGroup = initFilterGroup(false);
extendGroupRule(tempGroup, 'NAME', 9, e.value)
extendFilterGroup(json, tempGroup)
getUserLists(json).then(res => {
if (res.IsSuccessful) {
this.searchResult = res.Data
}
})
},
cancelSearch() {
this.searchResult = []
},
clearSearch() {
this.searchResult = []
},
getSubUsers(did) {
return new Promise((resolve, reject) => {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, did, "NAME")
getSubUserLists(json).then(res => {
if (res.IsSuccessful) {
resolve(res.Data)
}
})
})
},
handleSearchUser(userVal, depVal) {
const appInfoData = uni.getStorageSync('appInfo')
const departmentId = appInfoData?.User?.DEPARTMENT_ID || ''
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME")
extendInclude(json, "Nav_Person.Nav_Post")
extendRule(json, 'ENABLE_STATUS', 1, '0')
if (depVal) {
extendRule(json, 'DEPARTMENT_ID', 1, depVal.ID)
}
const tempGroup = initFilterGroup(false)
if (userVal) {
extendGroupRule(tempGroup, 'NAME', 9, userVal.NAME)
}
extendFilterGroup(json, tempGroup)
json.Limit = 100
const that = this
async function findAndAddUser(arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].ID === depVal.ID) {
if (!arr[i].users) {
await getUserLists(json).then(res => {
if (res.IsSuccessful) {
arr[i].users = res.Data
that.subKey++
}
})
}
} else if (arr[i].users) {
findAndAddUser(arr[i].departments);
}
}
}
if (depVal.ID === departmentId) {
getUserLists(json).then(res => {
if (res.IsSuccessful) {
this.selfDepartmentUsers = res.Data
}
})
} else {
findAndAddUser(this.orgTree)
}
this.checkedByAll = this.defaultChecked
},
handleExpandOrg(val) {
this.handleGetOrg(val.ID)
this.handleSearchUser(null, val)
},
handleGetOrg(id) {
const orgId = uni.getStorageSync('orgId')
const json = initFilter(orgId, "", "NAME")
extendRule(json, 'PARENT_ID', 1, id || null)
// const tempGroup = initFilterGroup(false)
// if (val) {
// extendGroupRule(tempGroup, 'NAME', 9, val)
// }
// extendFilterGroup(json, tempGroup)
json.Limit = 100
let that = this
async function findAndAddDep(arr) {
if (!id) {
await getDepartmentLists(json).then(res => {
if (res.IsSuccessful) {
that.orgTree = res.Data
// findAndAddDep(res.Data);
}
})
}
for (let i = 0; i < arr.length; i++) {
if (arr[i].ID === id) {
if (!arr[i].isExpand) {
arr[i].isExpand = true
} else {
arr[i].isExpand = false
}
if (!arr[i].departments) {
that.subKey++
await getDepartmentLists(json).then(res => {
if (res.IsSuccessful) {
arr[i].departments = res.Data
that.subKey++
}
})
}
} else if (arr[i].departments) {
findAndAddDep(arr[i].departments);
}
that.subKey++
}
}
findAndAddDep(this.orgTree)
this.$nextTick(() => {
setTimeout(() => {
this.$refs.collapse.resize()
this.dataByOrg = JSON.parse(JSON.stringify(this.orgTree))
}, 300)
})
},
async handleOkChecked() {
this.$emit('select', this.checkedByAll)
this.$emit('close', false)
return
// const uids = this.checkedByAll.filter(i => i.DEPARTMENT_ID).map(d => d.ID)
const uids = this.checkedByAll.filter(i => i.USER_ID).map(d => d.USER_ID)
// const dids = this.checkedByAll.filter(i => !i.DEPARTMENT_ID).map(d => d.ID)
const dids = this.checkedByAll.filter(i => i.DEPARTMENT_ID).map(d => d.DEPARTMENT_ID)
const orgId = uni.getStorageSync('orgId')
const params = {
UserIds: uids,
DepartmentIds: dids,
OrgId: orgId
}
await getUserOrDepInfo(params).then(res => {
if (res.IsSuccessful) {
const data = res.Data
let rdata = []
this.checkedByAll.forEach(item => {
rdata = data.map(d => {
if (d.UserId === item.USER_ID) {
// d.IS_DELETED = item.IS_DELETED
// d.NAME = item.NAME
// d.ID = item.ID
return {
...d,
...item
}
} else {
return {
...d,
IS_DELETED: false
}
}
})
})
this.$emit('select', rdata)
this.$emit('close', false)
}
})
},
async handleChangeCollapse() {
this.handleGetOrg()
},
async handleOpenOrgCollapse(e) {
if (e === 'org') {
this.currExpand = 'org'
if (!this.orgTree.length) {
await this.handleGetOrg()
}
} else {
this.currExpand = e
}
},
async handleOpenDepCollapse(e) {
if (e === 'org') {
await this.handleGetOrg()
}
},
handleCheckboxAllResult(e) {
},
handleCheckboxCurr(e) {
if (e.checked) {
if (e.id === 'all') {
// TODO:
} else {
if (e.type === 'dep') {
this.handleExpandOrg({ID: e.id})
this.getSubUsers(e.id).then(res => {
this.checkedByAll.forEach(a => {
res.forEach(b => {
if (a.USER_ID === b.ID) {
a.IS_DELETED = false
b.ID = a.ID
} else {
b.USER_ID = b.ID
}
})
})
this.checkedByAll = res.concat(this.checkedByAll)
// this.checkedByAll.push({
// NAME: e.name,
// IS_DELETED: false,
// DEPARTMENT_ID: e.id,
// // Nav_User: {
// // NAME: null
// // }
// })
})
} else {
this.checkedByAll.push({
NAME: e.name,
IS_DELETED: false,
USER_ID: e.id,
// Nav_User: {
// NAME: e.name
// }
})
}
}
} else {
if (e.id === 'all') {
// TODO:
} else {
if (e.type === 'dep') {
this.handleExpandOrg({ID: e.id})
this.checkedByAll.forEach(item => {
if (item.USER_ID === e.id || item.DEPARTMENT_ID === e.id) {
item.IS_DELETED = true
}
})
} else {
this.checkedByAll.forEach(item => {
if (item.USER_ID === e.id || item.DEPARTMENT_ID === e.id) {
item.IS_DELETED = true
}
})
}
}
}
},
removeChecked(value) {
this.checkedByAll.forEach(item => {
if (item.USER_ID === value.USER_ID) {
item.IS_DELETED = true
}
})
},
onOpenPopup() {
},
okPopup() {
this.showPopup = false
this.$forceUpdate()
},
handleClosePopup() {
this.showPopup = false
},
handleCloseComponet() {
this.$emit('close', !this.showComponent)
}
},
computed: {
checkedForId() {
const res = this.checkedByAll
.filter(i => !i.IS_DELETED)
.map(o => o.USER_ID || o.DEPARTMENT_ID)
return res
}
},
watch: {
show(n) {
this.showComponent = this.show
},
checkedByAllId: {
handler() {
function filterObjectsWithAValue(obj, aVal) {
if (Array.isArray(obj)) {
return obj.flatMap(item => filterObjectsWithAValue(item, aVal));
} else if (typeof obj === 'object' && obj !== null) {
if (obj.ID === aVal) {
return [obj];
} else {
return Object.values(obj).flatMap(value => filterObjectsWithAValue(value, aVal));
}
} else {
return [];
}
}
const orgList = this.checkedByAllId.reduce((acc, cur) => acc.concat(filterObjectsWithAValue(this.dataByOrg, cur)), []);
const result = []
this.searchResult.concat(this.selfDepartmentUsers, orgList).forEach(item => {
this.checkedByAllId.forEach(id => {
if (id === item.ID) {
result.push(item)
}
})
})
// this.checkedByAll = result
},
deep: true
},
}
}
</script>
<style scoped>
.people-selector {
/*height: 100vh;*/
}
.people-selector .main {
padding: 6px 16px 70px;
}
.bottom-show {
height: 62px;
border-top: 1px solid #C9C9C9;
display: flex;
align-items: center;
position: fixed;
width: 100%;
bottom: 0;
left: 0;
padding: 0 16px;
box-sizing: border-box;
z-index: 10;
justify-content: space-between;
background: #fff;
}
.user-names {
color: #3b9dff;
font-size: 14px;
line-height: 18px;
display: flex;
align-items: center;
justify-content: space-between;
flex: 1;
width: calc(100% - 112px - 25px);
padding-right: 25px;
}
.user-names .names {
/*width: 184px;*/
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}
.user-names .expand-icon {
width: 16px;
height: 16px;
}
.handle-btn {
/*background: #fff;*/
}
.popup-content {
height: 400px;
}
.popup-content .head {
height: 50px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #C9C9C9;
padding: 0 16px;
font-size: 14px;
}
.popup-content .head .num {
color: #333333;
}
.popup-content .head .ok {
color: #3b9dff;
}
.popup-content .body {
padding: 16px;
height: 350px;
overflow-y: auto;
}
.popup-content .body .list {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
font-size: 14px;
color: #333333;
line-height: 18px;
}
.popup-content .body .list .d {
width: 32px;
height: 18px;
line-height: 18px;
border: 1px solid #c9c9c9;
border-radius: 4px;
color: #999999;
font-size: 10px;
text-align: center;
}
.search-title {
margin-bottom: 10px;
}
.department,
.self {
padding: 0 16px;
}
</style>

View File

@ -0,0 +1,225 @@
<template>
<view class="auto-complete">
<u-popup
:show="show"
:round="10"
mode="bottom"
:closeable="true"
:closeIconPos="multiple ? 'top-left' : 'top-right'"
@open="onOpen"
@close="handleClosePopup">
<u--text
v-if="multiple"
text="确定"
type="primary"
bold
class="ok-button"
size="16"
@click="handleOk"
></u--text>
<u-list
@scrolltolower="scrolltolower"
:pagingEnabled="true"
>
<view class="head">
<view class="title">{{title}}</view>
</view>
<view class="search" style="padding-top: 6px">
<u-search
v-model="searchValue"
@search="handleSearch"
@custom="handleSearch"
:clearabled="true">
</u-search>
</view>
<view v-if="multiple" class="multi-checkbox" @click.stop="">
<u-checkbox-group
placement="column"
@onchange="onCheckboxChange"
>
<u-checkbox
:customStyle="checkboxStyle"
v-for="(item, index) in indexList"
:key="index"
:label="item.NAME"
:name="item.ID"
:checked="multipleSelect.map(i => i.ID).includes(item.ID)"
>
</u-checkbox>
</u-checkbox-group>
</view>
<u-list-item
v-else
v-for="(item, index) in indexList"
:key="index"
class="single-select"
>
<view @click="handleSelected(item)">
<u-cell
:title="`${item.name}`"
>
<text v-if="item.code" slot="right-icon">{{item.code}}</text>
</u-cell>
</view>
</u-list-item>
</u-list>
</u-popup>
</view>
</template>
<script>
import UText from '../../uni_modules/uview-ui/components/u-text/u-text.vue'
export default {
components: { UText },
props: {
show: {
type: Boolean,
default: false,
required: true
},
multiple: {
type: Boolean,
default: false
},
lists: {
type: Array,
default() {
return undefined
}
},
defaultValue: {
type: String,
default: null
},
defaultChecked: {
type: Array,
default() {
return []
}
},
title:{
type: String,
default: ''
},
total:{
type: Number,
default: 0
}
},
data() {
return {
searchValue: '',
indexList: [],
pageIndex: 1,
multipleSelect: [],
checkboxStyle: {
marginBottom: '8px',
padding: '10px 0',
borderBottom: '1px solid #e5e5e5'
}
}
},
methods: {
onCheckboxChange(e) {
if (e.checked) {
const obj = this.indexList.filter(i => i.ID === e.id)[0]
this.multipleSelect.push(obj)
} else {
this.multipleSelect.forEach(item => {
if (e.id === item.ID) {
this.multipleSelect = this.multipleSelect.filter(i => i.ID !== e.id)
}
})
}
},
onOpen() {
this.pageIndex = 1
if (this.defaultValue) {
this.searchValue = this.defaultValue
this.handleSearch(this.defaultValue)
} else {
this.searchValue = ''
// this.indexList = this.lists
}
this.multipleSelect = this.defaultChecked
},
handleClosePopup() {
this.searchValue = ''
this.indexList = []
this.multipleSelect = []
this.$emit('close')
},
handleSearch(val) {
this.searchValue = val
this.indexList = []
this.$emit('search', val, 1)
},
handleSelected(val) {
this.searchValue = ''
this.indexList = []
this.multipleSelect = []
this.$emit('select', val)
},
handleOk() {
this.searchValue = ''
this.indexList = []
this.$emit('select', this.multipleSelect)
},
scrolltolower() {
if (this.total > this.pageIndex * 20) {
this.pageIndex++
this.$emit('search', this.searchValue, this.pageIndex)
}
}
},
watch: {
lists(newLists) {
this.indexList = this.indexList.concat(newLists)
}
}
}
</script>
<style scoped>
.head {
height: 46px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.head .cancel,
.head .ok {
font-size: 15px;
padding: 0 15px;
}
.head .cancel {
color: rgb(144, 145, 147);
}
.head .ok {
color: rgb(60, 156, 255)
}
.head .title {
color: #303133;
padding: 0 22px;
font-size: 16px;
flex: 1;
text-align: center;
}
.search {
padding: 0 10px;
}
.multi-checkbox {
padding: 16px;
}
.single-select {
margin-right: 16px;
margin-left: 16px
}
.ok-button {
position: absolute;
top: 15px;
right: 15px;
width: max-content;
z-index: 10;
}
</style>

View File

@ -0,0 +1,46 @@
import Vuex from 'vuex'
export default function initToast(v) {
// 挂在store到全局Vue原型上
v.prototype.$toastStore = new Vuex.Store({
state: {
show: false,
icon: "success", //success:成功fail:失败
title: "标题",
content: '内容',
success: null,
},
mutations: {
hideToast(state) {
// 小程序导航条页面控制
// #ifndef H5
if (state.hideTabBar) {
wx.showTabBar();
}
// #endif
state.show = false
},
showToast(state, data) {
state = Object.assign(state, data)
state.show = true
setTimeout(() => {
state.show = false
return state.success(state.icon)
}, 2000)
},
}
})
// 注册$showToast到Vue原型上以方便全局调用
v.prototype.$showToast = function(option) {
if (typeof option === 'object') {
// #ifndef H5
if (option.hideTabBar) {
wx.hideTabBar();
}
// #endif
v.prototype.$toastStore.commit('showToast', option)
} else {
throw "配置项必须为对象传入的值为:" + typeof option;
}
}
}

View File

@ -0,0 +1,138 @@
<template>
<view class="_showToast" v-show="show">
<view class="_shade"></view>
<view class="_ToastBox">
<view class="Toast-box">
<!-- <view style="height: 10px;"></view> -->
<i class="iconfont icon-chenggong1" style="font-size: 60px;color: #6bc839;" v-if="icon=='success'"></i>
<text v-if="icon=='success'" class="Toast-title-success">{{title}}</text>
<i class="iconfont icon-cancel" style="font-size: 60px;color: #e94c4b;" v-if="icon=='fail'"></i>
<text v-if="icon=='fail'" class="Toast-title-fail">{{title}}</text>
<i class="iconfont icon-wen" style="font-size: 60px;color: #faad14;" v-if="icon=='issue'"></i>
<text v-if="icon=='issue'" class="Toast-title-fail">{{title}}</text>
<i class="iconfont icon-tishi" style="font-size: 60px;color: #ff9000;" v-if="icon=='warn'"></i>
<text v-if="icon=='warn'" class="Toast-title-fail">{{title}}</text>
<text class="Toast-subtitle">{{content}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
name:"show-toast",
data() {
return {
};
},
computed: {
show(){
return this.$toastStore.state.show;
},
title(){
return this.$toastStore.state.title;
},
content(){
return this.$toastStore.state.content;
},
icon(){
return this.$toastStore.state.icon;
}
},
mounted() {
setTimeout(()=>{
this.$toastStore.commit('hideToast')
this.$toastStore.commit('success',"confirm")
},3000)
},
methods:{
closeToast(){
this.$toastStore.commit('hideToast')
},
clickBtn(res){
this.$toastStore.commit('hideToast')
this.$toastStore.commit('success',res)
}
},
beforeDestroy(){
this.$toastStore.commit('hideToast')
},
}
</script>
<style lang="scss" scoped>
._showToast{
position: fixed;
top: 0;
left:0;
width: 100%;
height: 100%;
z-index:10000;
._shade{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: #000;
opacity: .6;
z-index:11000;
}
._ToastBox{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index:12000;
display: flex;
justify-content: center;
align-items: center;
.Toast-box{
position: absolute;
width: 238.5px;
min-height: 100px;
top:50%;
left: 50%;
transform: translate(-50%,-50%);
background: #FFFFFF;
box-shadow: 0px 10px 20px 0px rgba(28, 23, 47, 0.2);
border-radius: 20px;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 0px 0px 0px;
.Toast-icon{
width: 71px;
height: 71px;
display: block;
margin-top:17px;
}
.Toast-title-fail{
font-size: 16px;
// font-family: Source Han Sans CN;
// font-weight: bold;
// color: #EC4E4E;
margin-top: 10px;
}
.Toast-title-success{
font-size: 16px;
// font-family: Source Han Sans CN;
// font-weight: bold;
// color: #26B156;
margin-top: 10px;
}
.Toast-subtitle{
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin-top: 6px;
padding: 0 12px 12px 12px;
}
}
}
}
</style>

View File

@ -0,0 +1,151 @@
<template>
<view>
<view class="background"></view>
<view style="padding-top: 20px;" :class="stepText.length == 5?'step-load':'step-loadaf'">
<u-steps :current="stepPage" class="stepbox" active-color="#8d95a1" inactive-color="#d9e6f9">
<u-steps-item :title="stepText[0]">
<view class="slot-icon-ing" slot="icon" v-if="stepPage === 0">
<view class="slot-icon-dot"></view>
</view>
<view class="slot-icon-ed" slot="icon" v-if="stepPage > 0">
<u-icon name="checkbox-mark" color="#fff" size="14"></u-icon>
</view>
</u-steps-item>
<view v-for="(item,index) in stepText.slice(1,stepText.length - 1)" :key="index" style="flex: 1;">
<u-steps-item :title="item">
<view class="slot-icon-ing" slot="icon" v-if="stepPage === index+1">
<view class="slot-icon-dot"></view>
</view>
<view class="slot-icon-no" slot="icon" v-if="stepPage < index+1">{{index+2}}</view>
<view class="slot-icon-ed" slot="icon" v-if="stepPage > index+1">
<u-icon name="checkbox-mark" color="#fff" size="14"></u-icon>
</view>
</u-steps-item>
</view>
<u-steps-item :title="stepText[stepText.length - 1]">
<view class="slot-icon-ing" slot="icon" v-if="stepPage === stepText.length - 1">
<view class="slot-icon-dot"></view>
</view>
<view class="slot-icon-no" slot="icon" v-if="stepPage < stepText.length - 1">{{stepText.length}}</view>
</u-steps-item>
</u-steps>
</view>
</view>
</template>
<script>
export default {
props: {
stepPage: {
type: Number,
default: 0
},
stepText: {
type: Array,
default () {
return ['基本信息', '作业人员', '确认信息']
}
}
},
}
</script>
<style scoped>
.background {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #edf1fd;
z-index: -1;
}
.step-load>>>.u-steps-item__wrapper {
background-color: #edf1fd;
}
.step-load>>>.u-text__value--main {
color: #3d4b70;
font-weight: bold !important;
}
.step-load>>>.u-steps-item__line--row {
height: 4px;
width: 50px !important;
left: 55px !important;
border-radius: 500px;
}
.step-load>>>.u-steps-item__wrapper--row {
width: 42px;
}
.step-loadaf>>>.u-steps-item__wrapper {
background-color: #edf1fd;
}
.step-loadaf>>>.u-text__value--main {
color: #3d4b70;
font-weight: bold !important;
}
.step-loadaf>>>.u-steps-item__line--row {
height: 4px;
width: 119px !important;
left: 84px !important;
border-radius: 500px;
}
.step-loadaf>>>.u-steps-item__wrapper--row {
width: 62px;
}
.slot-icon-ed {
width: 24px;
height: 24px;
background-color: #3d4b70;
border-radius: 100px;
font-size: 12px;
color: #fff;
line-height: 24px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.slot-icon-ing {
width: 24px;
height: 24px;
background-color: #cceaff;
border-radius: 100px;
font-size: 12px;
color: #fff;
line-height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.slot-icon-no {
width: 24px;
height: 24px;
background-color: #7785a2;
border-radius: 100px;
font-size: 12px;
color: #fff;
line-height: 24px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.slot-icon-dot {
width: 12px;
height: 12px;
background-color: #3695ff;
border-radius: 100px;
color: #fff;
line-height: 10px;
}
</style>

View File

@ -0,0 +1,17 @@
<template>
<view style="margin: 0 0 2px 0;">
<text style="color: red; float: left;">*</text>
<view>{{title}}</view>
</view>
</template>
<script>
export default {
props: {
title: {
type: String,
default: null
}
},
}
</script>

View File

@ -0,0 +1,22 @@
## 1.3.52022-01-24
- 优化 size 属性可以传入不带单位的字符串数值
## 1.3.42022-01-24
- 优化 size 支持其他单位
## 1.3.32022-01-17
- 修复 nvue 有些图标不显示的bug兼容老版本图标
## 1.3.22021-12-01
- 优化 示例可复制图标名称
## 1.3.12021-11-23
- 优化 兼容旧组件 type 值
## 1.3.02021-11-19
- 新增 更多图标
- 优化 自定义图标使用方式
- 优化 组件UI并提供设计资源详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons)
## 1.1.72021-11-08
## 1.2.02021-07-30
- 组件兼容 vue3如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.52021-05-12
- 新增 组件示例地址
## 1.1.42021-02-05
- 调整为uni_modules目录规范

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,96 @@
<template>
<!-- #ifdef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
<!-- #endif -->
</template>
<script>
import icons from './icons.js';
const getVal = (val) => {
const reg = /^[0-9]*$/g
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
}
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import iconUrl from './uniicons.ttf'
domModule.addRule('fontFace', {
'fontFamily': "uniicons",
'src': "url('"+iconUrl+"')"
});
// #endif
/**
* Icons 图标
* @description 用于展示 icons 图标
* @tutorial https://ext.dcloud.net.cn/plugin?id=28
* @property {Number} size 图标大小
* @property {String} type 图标图案参考示例
* @property {String} color 图标颜色
* @property {String} customPrefix 自定义图标
* @event {Function} click 点击 Icon 触发事件
*/
export default {
name: 'UniIcons',
emits:['click'],
props: {
type: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 16
},
customPrefix:{
type: String,
default: ''
}
},
data() {
return {
icons: icons.glyphs
}
},
computed:{
unicode(){
let code = this.icons.find(v=>v.font_class === this.type)
if(code){
return unescape(`%u${code.unicode}`)
}
return ''
},
iconSize(){
return getVal(this.size)
}
},
methods: {
_onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss">
/* #ifndef APP-NVUE */
@import './uniicons.css';
@font-face {
font-family: uniicons;
src: url('./uniicons.ttf') format('truetype');
}
/* #endif */
.uni-icons {
font-family: uniicons;
text-decoration: none;
text-align: center;
}
</style>

View File

@ -0,0 +1,663 @@
.uniui-color:before {
content: "\e6cf";
}
.uniui-wallet:before {
content: "\e6b1";
}
.uniui-settings-filled:before {
content: "\e6ce";
}
.uniui-auth-filled:before {
content: "\e6cc";
}
.uniui-shop-filled:before {
content: "\e6cd";
}
.uniui-staff-filled:before {
content: "\e6cb";
}
.uniui-vip-filled:before {
content: "\e6c6";
}
.uniui-plus-filled:before {
content: "\e6c7";
}
.uniui-folder-add-filled:before {
content: "\e6c8";
}
.uniui-color-filled:before {
content: "\e6c9";
}
.uniui-tune-filled:before {
content: "\e6ca";
}
.uniui-calendar-filled:before {
content: "\e6c0";
}
.uniui-notification-filled:before {
content: "\e6c1";
}
.uniui-wallet-filled:before {
content: "\e6c2";
}
.uniui-medal-filled:before {
content: "\e6c3";
}
.uniui-gift-filled:before {
content: "\e6c4";
}
.uniui-fire-filled:before {
content: "\e6c5";
}
.uniui-refreshempty:before {
content: "\e6bf";
}
.uniui-location-filled:before {
content: "\e6af";
}
.uniui-person-filled:before {
content: "\e69d";
}
.uniui-personadd-filled:before {
content: "\e698";
}
.uniui-back:before {
content: "\e6b9";
}
.uniui-forward:before {
content: "\e6ba";
}
.uniui-arrow-right:before {
content: "\e6bb";
}
.uniui-arrowthinright:before {
content: "\e6bb";
}
.uniui-arrow-left:before {
content: "\e6bc";
}
.uniui-arrowthinleft:before {
content: "\e6bc";
}
.uniui-arrow-up:before {
content: "\e6bd";
}
.uniui-arrowthinup:before {
content: "\e6bd";
}
.uniui-arrow-down:before {
content: "\e6be";
}
.uniui-arrowthindown:before {
content: "\e6be";
}
.uniui-bottom:before {
content: "\e6b8";
}
.uniui-arrowdown:before {
content: "\e6b8";
}
.uniui-right:before {
content: "\e6b5";
}
.uniui-arrowright:before {
content: "\e6b5";
}
.uniui-top:before {
content: "\e6b6";
}
.uniui-arrowup:before {
content: "\e6b6";
}
.uniui-left:before {
content: "\e6b7";
}
.uniui-arrowleft:before {
content: "\e6b7";
}
.uniui-eye:before {
content: "\e651";
}
.uniui-eye-filled:before {
content: "\e66a";
}
.uniui-eye-slash:before {
content: "\e6b3";
}
.uniui-eye-slash-filled:before {
content: "\e6b4";
}
.uniui-info-filled:before {
content: "\e649";
}
.uniui-reload:before {
content: "\e6b2";
}
.uniui-micoff-filled:before {
content: "\e6b0";
}
.uniui-map-pin-ellipse:before {
content: "\e6ac";
}
.uniui-map-pin:before {
content: "\e6ad";
}
.uniui-location:before {
content: "\e6ae";
}
.uniui-starhalf:before {
content: "\e683";
}
.uniui-star:before {
content: "\e688";
}
.uniui-star-filled:before {
content: "\e68f";
}
.uniui-calendar:before {
content: "\e6a0";
}
.uniui-fire:before {
content: "\e6a1";
}
.uniui-medal:before {
content: "\e6a2";
}
.uniui-font:before {
content: "\e6a3";
}
.uniui-gift:before {
content: "\e6a4";
}
.uniui-link:before {
content: "\e6a5";
}
.uniui-notification:before {
content: "\e6a6";
}
.uniui-staff:before {
content: "\e6a7";
}
.uniui-vip:before {
content: "\e6a8";
}
.uniui-folder-add:before {
content: "\e6a9";
}
.uniui-tune:before {
content: "\e6aa";
}
.uniui-auth:before {
content: "\e6ab";
}
.uniui-person:before {
content: "\e699";
}
.uniui-email-filled:before {
content: "\e69a";
}
.uniui-phone-filled:before {
content: "\e69b";
}
.uniui-phone:before {
content: "\e69c";
}
.uniui-email:before {
content: "\e69e";
}
.uniui-personadd:before {
content: "\e69f";
}
.uniui-chatboxes-filled:before {
content: "\e692";
}
.uniui-contact:before {
content: "\e693";
}
.uniui-chatbubble-filled:before {
content: "\e694";
}
.uniui-contact-filled:before {
content: "\e695";
}
.uniui-chatboxes:before {
content: "\e696";
}
.uniui-chatbubble:before {
content: "\e697";
}
.uniui-upload-filled:before {
content: "\e68e";
}
.uniui-upload:before {
content: "\e690";
}
.uniui-weixin:before {
content: "\e691";
}
.uniui-compose:before {
content: "\e67f";
}
.uniui-qq:before {
content: "\e680";
}
.uniui-download-filled:before {
content: "\e681";
}
.uniui-pyq:before {
content: "\e682";
}
.uniui-sound:before {
content: "\e684";
}
.uniui-trash-filled:before {
content: "\e685";
}
.uniui-sound-filled:before {
content: "\e686";
}
.uniui-trash:before {
content: "\e687";
}
.uniui-videocam-filled:before {
content: "\e689";
}
.uniui-spinner-cycle:before {
content: "\e68a";
}
.uniui-weibo:before {
content: "\e68b";
}
.uniui-videocam:before {
content: "\e68c";
}
.uniui-download:before {
content: "\e68d";
}
.uniui-help:before {
content: "\e679";
}
.uniui-navigate-filled:before {
content: "\e67a";
}
.uniui-plusempty:before {
content: "\e67b";
}
.uniui-smallcircle:before {
content: "\e67c";
}
.uniui-minus-filled:before {
content: "\e67d";
}
.uniui-micoff:before {
content: "\e67e";
}
.uniui-closeempty:before {
content: "\e66c";
}
.uniui-clear:before {
content: "\e66d";
}
.uniui-navigate:before {
content: "\e66e";
}
.uniui-minus:before {
content: "\e66f";
}
.uniui-image:before {
content: "\e670";
}
.uniui-mic:before {
content: "\e671";
}
.uniui-paperplane:before {
content: "\e672";
}
.uniui-close:before {
content: "\e673";
}
.uniui-help-filled:before {
content: "\e674";
}
.uniui-paperplane-filled:before {
content: "\e675";
}
.uniui-plus:before {
content: "\e676";
}
.uniui-mic-filled:before {
content: "\e677";
}
.uniui-image-filled:before {
content: "\e678";
}
.uniui-locked-filled:before {
content: "\e668";
}
.uniui-info:before {
content: "\e669";
}
.uniui-locked:before {
content: "\e66b";
}
.uniui-camera-filled:before {
content: "\e658";
}
.uniui-chat-filled:before {
content: "\e659";
}
.uniui-camera:before {
content: "\e65a";
}
.uniui-circle:before {
content: "\e65b";
}
.uniui-checkmarkempty:before {
content: "\e65c";
}
.uniui-chat:before {
content: "\e65d";
}
.uniui-circle-filled:before {
content: "\e65e";
}
.uniui-flag:before {
content: "\e65f";
}
.uniui-flag-filled:before {
content: "\e660";
}
.uniui-gear-filled:before {
content: "\e661";
}
.uniui-home:before {
content: "\e662";
}
.uniui-home-filled:before {
content: "\e663";
}
.uniui-gear:before {
content: "\e664";
}
.uniui-smallcircle-filled:before {
content: "\e665";
}
.uniui-map-filled:before {
content: "\e666";
}
.uniui-map:before {
content: "\e667";
}
.uniui-refresh-filled:before {
content: "\e656";
}
.uniui-refresh:before {
content: "\e657";
}
.uniui-cloud-upload:before {
content: "\e645";
}
.uniui-cloud-download-filled:before {
content: "\e646";
}
.uniui-cloud-download:before {
content: "\e647";
}
.uniui-cloud-upload-filled:before {
content: "\e648";
}
.uniui-redo:before {
content: "\e64a";
}
.uniui-images-filled:before {
content: "\e64b";
}
.uniui-undo-filled:before {
content: "\e64c";
}
.uniui-more:before {
content: "\e64d";
}
.uniui-more-filled:before {
content: "\e64e";
}
.uniui-undo:before {
content: "\e64f";
}
.uniui-images:before {
content: "\e650";
}
.uniui-paperclip:before {
content: "\e652";
}
.uniui-settings:before {
content: "\e653";
}
.uniui-search:before {
content: "\e654";
}
.uniui-redo-filled:before {
content: "\e655";
}
.uniui-list:before {
content: "\e644";
}
.uniui-mail-open-filled:before {
content: "\e63a";
}
.uniui-hand-down-filled:before {
content: "\e63c";
}
.uniui-hand-down:before {
content: "\e63d";
}
.uniui-hand-up-filled:before {
content: "\e63e";
}
.uniui-hand-up:before {
content: "\e63f";
}
.uniui-heart-filled:before {
content: "\e641";
}
.uniui-mail-open:before {
content: "\e643";
}
.uniui-heart:before {
content: "\e639";
}
.uniui-loop:before {
content: "\e633";
}
.uniui-pulldown:before {
content: "\e632";
}
.uniui-scan:before {
content: "\e62a";
}
.uniui-bars:before {
content: "\e627";
}
.uniui-cart-filled:before {
content: "\e629";
}
.uniui-checkbox:before {
content: "\e62b";
}
.uniui-checkbox-filled:before {
content: "\e62c";
}
.uniui-shop:before {
content: "\e62f";
}
.uniui-headphones:before {
content: "\e630";
}
.uniui-cart:before {
content: "\e631";
}

Binary file not shown.

View File

@ -0,0 +1,86 @@
{
"id": "uni-icons",
"displayName": "uni-icons 图标",
"version": "1.3.5",
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
"keywords": [
"uni-ui",
"uniui",
"icon",
"图标"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": "^3.2.14"
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -0,0 +1,8 @@
## Icons 图标
> **组件名uni-icons**
> 代码块: `uIcons`
用于展示 icons 图标 。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839

133
config/common.js Normal file
View File

@ -0,0 +1,133 @@
const getServiceHost = api => {
const apimodules = [{
OP: 3116
}, {
BD: 3101
}, {
DD: 3102
}, {
EA: 3103
}, {
ED: 3104
}, {
EM: 3105
}, {
FC: 3106
},
{
FM: 3107
}, {
KR: 3108
}, {
LG: 3109
}, {
MR: 3110
}, {
NW: 3111
}, {
PF: 3112
}, {
PM: 3113
}, {
QC: 3114
}, {
FW: 3115
}, {
OP: 3116
},
{
HM: 3117
}, {
PP: 3118
}, {
FO: 3119
}, {
UT: 3177
}, {
BS: 3178
}, {
SC: 3179
}, {
TI: 3179
}, {
SE: 3179
}, {
AE: 3179
}, {
PT: 3179
}, {
LR: 3179
}, {
OG: 3179
}, {
PE: 3179
}, {
OH: 3179
}, {
CM: 3179
}, {
PR: 3179
}, {
DM: 3179
}, {
BI: 3179
}
]
let port = 3112
for (let i = 0; i < apimodules.length; i++) {
const apimodule = apimodules[i]
const key = Object.keys(apimodule)[0]
if (api.indexOf(`/${key}/`) > -1) {
port = apimodule[key]
break
}
}
return `${port}/api${api}`
}
// 发行APP前先确定要发布的版本
let APP_ENV = 'beta' // beta: 测试版release: 发行版
let configURL
if (process.env.CUSTOM_PLATFORM === "dev") {
//本地环境
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_api_url}:${apis}` //测试环境
},
uni_app_web_url: "", //
uni_app_web_api_url: "http://localhost", // 请求接口的地址
uni_app_web_source_url: "http://localhost:3199", // 资源地址
uni_app_web_local_api_url: "http://localhost", // 请求接口的地址
}
} else if (process.env.CUSTOM_PLATFORM === "test") {
//测试环境
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_api_url}:${apis}` //测试环境
},
uni_app_web_url: "", //
uni_app_web_api_url: "http://47.122.43.22", // 请求接口的地址
uni_app_web_source_url: "http://47.122.43.22:3199", // 资源地址
uni_app_web_local_api_url: "http://47.122.43.22", // 请求接口的地址
}
} else
//生产环境 发布等
configURL = {
web_name: "",
serviceHost(api) {
const apis = getServiceHost(api)
return `${this.uni_app_web_local_api_url}:${apis}`
},
uni_app_web_url: "",
uni_app_web_api_url: APP_ENV === 'release' ? "http://xmmhe.com" : "http://47.122.43.22",
uni_app_web_source_url: APP_ENV === 'release' ? "http://xmmhe.com:3199" : "http://47.122.43.22:3199",
uni_app_web_local_api_url: APP_ENV === 'release' ? "http://xmmhe.com" : "http://47.122.43.22" //打包测试: 47.122.43.22 开发可 localhost
}
export default configURL

20
index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

57
main.js Normal file
View File

@ -0,0 +1,57 @@
import App from './App'
import store from './store/index'
import uView from './uni_modules/uview-ui'
// #ifndef VUE3
import Vue from 'vue'
import './utils/showMsg.js'
import './uni.promisify.adaptor'
import CommonCard from 'components/custom/common-card.nvue'
import QuerySelector from 'components/custom/query-selector.vue'
import FullUpload from 'components/custom/full-upload.vue'
import CheckAction from 'components/custom/check-action.vue'
import PeopleSelector from 'components/custom/people-selector/index.vue'
import AuditProcess from 'components/custom/audit-process.vue'
import initToast from "@/components/custom/show-info/initToast.js"
import showToast from "@/components/custom/show-info/show-toast.vue"
// import "./uni_modules/uview-ui/index.scss"
Vue.component('common-card', CommonCard)
Vue.component('query-selector', QuerySelector)
Vue.component('full-upload', FullUpload)
Vue.component('check-action', CheckAction)
Vue.component('people-selector', PeopleSelector)
Vue.component('audit-process', AuditProcess)
initToast(Vue);
Vue.component('show-toast',showToast);
Vue.use(uView)
Vue.config.productionTip = false
// Vue.prototype.$store = store
App.mpType = 'app'
App.store = store
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import {
createSSRApp
} from 'vue'
export function createApp() {
const app = createSSRApp(App)
app.use(store)
// app.use(VueAxios)
return {
app
}
}
// #endif

129
manifest.json Normal file
View File

@ -0,0 +1,129 @@
{
"name" : "连锰矿山安全",
"appid" : "__UNI__A6AA052",
"description" : "连锰矿山安全app",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a" ,"arm64-v8a"]
},
/* ios */
"ios" : {
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"ad" : {},
"push" : {
"unipush" : {
"icons" : {
"small" : {
"xxhdpi" : "unpackage/res/icons/72x72.png",
"ldpi" : "unpackage/res/icons/18x18.png",
"mdpi" : "unpackage/res/icons/24x24.png",
"hdpi" : "unpackage/res/icons/36x36.png",
"xhdpi" : "unpackage/res/icons/48×48.png"
},
"push" : {
"xxhdpi" : "unpackage/res/icons/72x72.png",
"ldpi" : "unpackage/res/icons/18x18.png",
"mdpi" : "unpackage/res/icons/24x24.png",
"hdpi" : "unpackage/res/icons/36x36.png",
"xhdpi" : "unpackage/res/icons/48×48.png"
}
}
}
}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxdf9daae309e2a840",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}

12
node_modules/.bin/nanoid generated vendored Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
else
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
fi

17
node_modules/.bin/nanoid.cmd generated vendored Normal file
View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*

28
node_modules/.bin/nanoid.ps1 generated vendored Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
} else {
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
} else {
& "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
}
$ret=$LASTEXITCODE
}
exit $ret

12
node_modules/.bin/parser generated vendored Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
else
exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
fi

17
node_modules/.bin/parser.cmd generated vendored Normal file
View File

@ -0,0 +1,17 @@
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %*

28
node_modules/.bin/parser.ps1 generated vendored Normal file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
} else {
& "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
} else {
& "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret

136
node_modules/.package-lock.json generated vendored Normal file
View File

@ -0,0 +1,136 @@
{
"name": "mh-safe-app",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/@babel/parser": {
"version": "7.22.7",
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.22.7.tgz",
"integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==",
"peer": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@vue/compiler-sfc": {
"version": "2.7.14",
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz",
"integrity": "sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA==",
"peer": true,
"dependencies": {
"@babel/parser": "^7.18.4",
"postcss": "^8.4.14",
"source-map": "^0.6.1"
}
},
"node_modules/charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==",
"engines": {
"node": "*"
}
},
"node_modules/crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==",
"engines": {
"node": "*"
}
},
"node_modules/csstype": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.2.tgz",
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==",
"peer": true
},
"node_modules/is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmmirror.com/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"node_modules/md5": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/md5/-/md5-2.3.0.tgz",
"integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
"dependencies": {
"charenc": "0.0.2",
"crypt": "0.0.2",
"is-buffer": "~1.1.6"
}
},
"node_modules/nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"peer": true,
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"peer": true
},
"node_modules/postcss": {
"version": "8.4.27",
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.27.tgz",
"integrity": "sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==",
"peer": true,
"dependencies": {
"nanoid": "^3.3.6",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vue": {
"version": "2.7.14",
"resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.14.tgz",
"integrity": "sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ==",
"peer": true,
"dependencies": {
"@vue/compiler-sfc": "2.7.14",
"csstype": "^3.1.0"
}
},
"node_modules/vuex": {
"version": "3.6.2",
"resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
"peerDependencies": {
"vue": "^2.0.0"
}
}
}
}

1073
node_modules/@babel/parser/CHANGELOG.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

19
node_modules/@babel/parser/LICENSE generated vendored Normal file
View File

@ -0,0 +1,19 @@
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
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.

19
node_modules/@babel/parser/README.md generated vendored Normal file
View File

@ -0,0 +1,19 @@
# @babel/parser
> A JavaScript parser
See our website [@babel/parser](https://babeljs.io/docs/babel-parser) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20parser%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/parser
```
or using yarn:
```sh
yarn add @babel/parser --dev
```

15
node_modules/@babel/parser/bin/babel-parser.js generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env node
/* eslint no-var: 0 */
var parser = require("..");
var fs = require("fs");
var filename = process.argv[2];
if (!filename) {
console.error("no filename specified");
} else {
var file = fs.readFileSync(filename, "utf8");
var ast = parser.parse(file);
console.log(JSON.stringify(ast, null, " "));
}

5
node_modules/@babel/parser/index.cjs generated vendored Normal file
View File

@ -0,0 +1,5 @@
try {
module.exports = require("./lib/index.cjs");
} catch {
module.exports = require("./lib/index.js");
}

14429
node_modules/@babel/parser/lib/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/@babel/parser/lib/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

40
node_modules/@babel/parser/lib/options.js generated vendored Normal file
View File

@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultOptions = void 0;
exports.getOptions = getOptions;
const defaultOptions = {
sourceType: "script",
sourceFilename: undefined,
startColumn: 0,
startLine: 1,
allowAwaitOutsideFunction: false,
allowReturnOutsideFunction: false,
allowNewTargetOutsideFunction: false,
allowImportExportEverywhere: false,
allowSuperOutsideMethod: false,
allowUndeclaredExports: false,
plugins: [],
strictMode: null,
ranges: false,
tokens: false,
createParenthesizedExpressions: false,
errorRecovery: false,
attachComment: true,
annexB: true
};
exports.defaultOptions = defaultOptions;
function getOptions(opts) {
if (opts && opts.annexB != null && opts.annexB !== false) {
throw new Error("The `annexB` option can only be set to `false`.");
}
const options = {};
for (const key of Object.keys(defaultOptions)) {
options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
}
return options;
}
//# sourceMappingURL=options.js.map

1
node_modules/@babel/parser/lib/options.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

106
node_modules/@babel/parser/lib/parse-error.js generated vendored Normal file
View File

@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
ParseErrorEnum: true,
Errors: true
};
exports.Errors = void 0;
exports.ParseErrorEnum = ParseErrorEnum;
var _location = require("./util/location");
var _credentials = require("./parse-error/credentials");
Object.keys(_credentials).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _credentials[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _credentials[key];
}
});
});
var _moduleErrors = require("./parse-error/module-errors");
var _standardErrors = require("./parse-error/standard-errors");
var _strictModeErrors = require("./parse-error/strict-mode-errors");
var _pipelineOperatorErrors = require("./parse-error/pipeline-operator-errors");
const _excluded = ["toMessage"],
_excluded2 = ["message"];
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function toParseErrorConstructor(_ref) {
let {
toMessage
} = _ref,
properties = _objectWithoutPropertiesLoose(_ref, _excluded);
return function constructor({
loc,
details
}) {
return (0, _credentials.instantiate)(SyntaxError, Object.assign({}, properties, {
loc
}), {
clone(overrides = {}) {
const loc = overrides.loc || {};
return constructor({
loc: new _location.Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index),
details: Object.assign({}, this.details, overrides.details)
});
},
details: {
value: details,
enumerable: false
},
message: {
get() {
return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`;
},
set(value) {
Object.defineProperty(this, "message", {
value
});
}
},
pos: {
reflect: "loc.index",
enumerable: true
},
missingPlugin: "missingPlugin" in details && {
reflect: "details.missingPlugin",
enumerable: true
}
});
};
}
function ParseErrorEnum(argument, syntaxPlugin) {
if (Array.isArray(argument)) {
return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);
}
const ParseErrorConstructors = {};
for (const reasonCode of Object.keys(argument)) {
const template = argument[reasonCode];
const _ref2 = typeof template === "string" ? {
message: () => template
} : typeof template === "function" ? {
message: template
} : template,
{
message
} = _ref2,
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
const toMessage = typeof message === "string" ? () => message : message;
ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
code: _credentials.ParseErrorCode.SyntaxError,
reasonCode,
toMessage
}, syntaxPlugin ? {
syntaxPlugin
} : {}, rest));
}
return ParseErrorConstructors;
}
const Errors = Object.assign({}, ParseErrorEnum(_moduleErrors.default), ParseErrorEnum(_standardErrors.default), ParseErrorEnum(_strictModeErrors.default), ParseErrorEnum`pipelineOperator`(_pipelineOperatorErrors.default));
exports.Errors = Errors;
//# sourceMappingURL=parse-error.js.map

1
node_modules/@babel/parser/lib/parse-error.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.instantiate = exports.ParseErrorCode = void 0;
var ParseErrorCode = {
SyntaxError: "BABEL_PARSER_SYNTAX_ERROR",
SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
};
exports.ParseErrorCode = ParseErrorCode;
const reflect = (keys, last = keys.length - 1) => ({
get() {
return keys.reduce((object, key) => object[key], this);
},
set(value) {
keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this);
}
});
const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? {
value: descriptor,
enumerable: false
} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({
configurable: true
}, descriptor)), Object.assign(new constructor(), properties));
exports.instantiate = instantiate;
//# sourceMappingURL=credentials.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["ParseErrorCode","SyntaxError","SourceTypeModuleError","exports","reflect","keys","last","length","get","reduce","object","key","set","value","item","i","instantiate","constructor","properties","descriptors","Object","map","filter","descriptor","enumerable","assign","split","instance","defineProperty","configurable"],"sources":["../../src/parse-error/credentials.ts"],"sourcesContent":["export const enum ParseErrorCode {\n SyntaxError = \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n}\n\nexport type SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\nexport type ToMessage<ErrorDetails> = (self: ErrorDetails) => string;\n\nexport type ParseErrorCredentials<ErrorDetails> = {\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage<ErrorDetails>;\n};\n\nconst reflect = (keys: string[], last = keys.length - 1) => ({\n get(this: unknown): unknown {\n return keys.reduce(\n (object, key) =>\n // @ts-expect-error key should index object\n object[key],\n this,\n );\n },\n set(this: unknown, value: unknown) {\n keys.reduce(\n // @ts-expect-error key should index item\n (item, key, i) => (i === last ? (item[key] = value) : item[key]),\n this,\n );\n },\n});\n\nconst instantiate = <T>(\n constructor: new () => T,\n properties: any,\n descriptors: any,\n) =>\n Object.keys(descriptors)\n .map(key => [key, descriptors[key]])\n .filter(([, descriptor]) => !!descriptor)\n .map(([key, descriptor]) => [\n key,\n typeof descriptor === \"function\"\n ? { value: descriptor, enumerable: false }\n : typeof descriptor.reflect === \"string\"\n ? { ...descriptor, ...reflect(descriptor.reflect.split(\".\")) }\n : descriptor,\n ])\n .reduce(\n (instance, [key, descriptor]) =>\n Object.defineProperty(instance, key, {\n configurable: true,\n ...descriptor,\n }),\n Object.assign(new constructor(), properties),\n );\n\nexport { instantiate };\n"],"mappings":";;;;;;IAAkBA,cAAc;EAAAC,WAAA;EAAAC,qBAAA;AAAA;AAAAC,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAqBhC,MAAMI,OAAO,GAAGA,CAACC,IAAc,EAAEC,IAAI,GAAGD,IAAI,CAACE,MAAM,GAAG,CAAC,MAAM;EAC3DC,GAAGA,CAAA,EAAyB;IAC1B,OAAOH,IAAI,CAACI,MAAM,CAChB,CAACC,MAAM,EAAEC,GAAG,KAEVD,MAAM,CAACC,GAAG,CAAC,EACb,IACF,CAAC;EACH,CAAC;EACDC,GAAGA,CAAgBC,KAAc,EAAE;IACjCR,IAAI,CAACI,MAAM,CAET,CAACK,IAAI,EAAEH,GAAG,EAAEI,CAAC,KAAMA,CAAC,KAAKT,IAAI,GAAIQ,IAAI,CAACH,GAAG,CAAC,GAAGE,KAAK,GAAIC,IAAI,CAACH,GAAG,CAAE,EAChE,IACF,CAAC;EACH;AACF,CAAC,CAAC;AAEF,MAAMK,WAAW,GAAGA,CAClBC,WAAwB,EACxBC,UAAe,EACfC,WAAgB,KAEhBC,MAAM,CAACf,IAAI,CAACc,WAAW,CAAC,CACrBE,GAAG,CAACV,GAAG,IAAI,CAACA,GAAG,EAAEQ,WAAW,CAACR,GAAG,CAAC,CAAC,CAAC,CACnCW,MAAM,CAAC,CAAC,GAAGC,UAAU,CAAC,KAAK,CAAC,CAACA,UAAU,CAAC,CACxCF,GAAG,CAAC,CAAC,CAACV,GAAG,EAAEY,UAAU,CAAC,KAAK,CAC1BZ,GAAG,EACH,OAAOY,UAAU,KAAK,UAAU,GAC5B;EAAEV,KAAK,EAAEU,UAAU;EAAEC,UAAU,EAAE;AAAM,CAAC,GACxC,OAAOD,UAAU,CAACnB,OAAO,KAAK,QAAQ,GAAAgB,MAAA,CAAAK,MAAA,KACjCF,UAAU,EAAKnB,OAAO,CAACmB,UAAU,CAACnB,OAAO,CAACsB,KAAK,CAAC,GAAG,CAAC,CAAC,IAC1DH,UAAU,CACf,CAAC,CACDd,MAAM,CACL,CAACkB,QAAQ,EAAE,CAAChB,GAAG,EAAEY,UAAU,CAAC,KAC1BH,MAAM,CAACQ,cAAc,CAACD,QAAQ,EAAEhB,GAAG,EAAAS,MAAA,CAAAK,MAAA;EACjCI,YAAY,EAAE;AAAI,GACfN,UAAU,CACd,CAAC,EACJH,MAAM,CAACK,MAAM,CAAC,IAAIR,WAAW,CAAC,CAAC,EAAEC,UAAU,CAC7C,CAAC;AAACf,OAAA,CAAAa,WAAA,GAAAA,WAAA"}

View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _parseError = require("../parse-error");
var _default = {
ImportMetaOutsideModule: {
message: `import.meta may appear only with 'sourceType: "module"'`,
code: _parseError.ParseErrorCode.SourceTypeModuleError
},
ImportOutsideModule: {
message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
code: _parseError.ParseErrorCode.SourceTypeModuleError
}
};
exports.default = _default;
//# sourceMappingURL=module-errors.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_parseError","require","_default","ImportMetaOutsideModule","message","code","ParseErrorCode","SourceTypeModuleError","ImportOutsideModule","exports","default"],"sources":["../../src/parse-error/module-errors.ts"],"sourcesContent":["import { ParseErrorCode } from \"../parse-error\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAgD,IAAAC,QAAA,GAEjC;EACbC,uBAAuB,EAAE;IACvBC,OAAO,EAAG,yDAAwD;IAClEC,IAAI,EAAEC,0BAAc,CAACC;EACvB,CAAC;EACDC,mBAAmB,EAAE;IACnBJ,OAAO,EAAG,mEAAkE;IAC5EC,IAAI,EAAEC,0BAAc,CAACC;EACvB;AACF,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAR,QAAA"}

View File

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.UnparenthesizedPipeBodyDescriptions = void 0;
var _toNodeDescription = require("./to-node-description");
const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
exports.UnparenthesizedPipeBodyDescriptions = UnparenthesizedPipeBodyDescriptions;
var _default = {
PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
PipeTopicUnconfiguredToken: ({
token
}) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
PipeUnparenthesizedBody: ({
type
}) => `Hack-style pipe body cannot be an unparenthesized ${(0, _toNodeDescription.default)({
type
})}; please wrap it in parentheses.`,
PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
};
exports.default = _default;
//# sourceMappingURL=pipeline-operator-errors.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_toNodeDescription","require","UnparenthesizedPipeBodyDescriptions","Set","exports","_default","PipeBodyIsTighter","PipeTopicRequiresHackPipes","PipeTopicUnbound","PipeTopicUnconfiguredToken","token","PipeTopicUnused","PipeUnparenthesizedBody","type","toNodeDescription","PipelineBodyNoArrow","PipelineBodySequenceExpression","PipelineHeadSequenceExpression","PipelineTopicUnused","PrimaryTopicNotAllowed","PrimaryTopicRequiresSmartPipeline","default"],"sources":["../../src/parse-error/pipeline-operator-errors.ts"],"sourcesContent":["import toNodeDescription from \"./to-node-description\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType<T extends Set<any>> = T extends Set<infer M>\n ? M\n : unknown;\n\ntype UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,mCAAmC,GAAG,IAAIC,GAAG,CAAC,CACzD,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CACT,CAAC;AAACC,OAAA,CAAAF,mCAAA,GAAAA,mCAAA;AAAA,IAAAG,QAAA,GAUG;EAEbC,iBAAiB,EACf,uJAAuJ;EACzJC,0BAA0B,EACxB,iHAAiH;EACnHC,gBAAgB,EACd,4DAA4D;EAC9DC,0BAA0B,EAAEA,CAAC;IAAEC;EAAyB,CAAC,KACtD,uBAAsBA,KAAM,qBAAoBA,KAAM,mHAAkHA,KAAM,MAAK;EACtLC,eAAe,EACb,yGAAyG;EAC3GC,uBAAuB,EAAEA,CAAC;IAAEC;EAA6C,CAAC,KACvE,qDAAoD,IAAAC,0BAAiB,EAAC;IACrED;EACF,CAAC,CAAE,kCAAiC;EAMtCE,mBAAmB,EACjB,mGAAmG;EACrGC,8BAA8B,EAC5B,iEAAiE;EACnEC,8BAA8B,EAC5B,oEAAoE;EACtEC,mBAAmB,EACjB,8DAA8D;EAChEC,sBAAsB,EACpB,sEAAsE;EACxEC,iCAAiC,EAC/B;AACJ,CAAC;AAAAhB,OAAA,CAAAiB,OAAA,GAAAhB,QAAA"}

View File

@ -0,0 +1,220 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _toNodeDescription = require("./to-node-description");
var _default = {
AccessorIsGenerator: ({
kind
}) => `A ${kind}ter cannot be a generator.`,
ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
ConstructorClassField: "Classes may not have a field named 'constructor'.",
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
ConstructorIsAccessor: "Class constructor may not be an accessor.",
ConstructorIsAsync: "Constructor can't be an async function.",
ConstructorIsGenerator: "Constructor can't be a generator.",
DeclarationMissingInitializer: ({
kind
}) => `Missing initializer in ${kind} declaration.`,
DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
DecoratorStaticBlock: "Decorators can't be used with a static block.",
DeletePrivateField: "Deleting a private field is not allowed.",
DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
DuplicateConstructor: "Duplicate constructor in the same class.",
DuplicateDefaultExport: "Only one default export allowed per module.",
DuplicateExport: ({
exportName
}) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
DuplicateProto: "Redefinition of __proto__ property.",
DuplicateRegExpFlags: "Duplicate regular expression flag.",
ElementAfterRest: "Rest element must be last element.",
EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
ExportBindingIsString: ({
localName,
exportName
}) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
ForInOfLoopInitializer: ({
type
}) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
ForInUsing: "For-in loop may not start with 'using' declaration.",
ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
IllegalBreakContinue: ({
type
}) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`,
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
IllegalReturn: "'return' outside of function.",
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",
ImportBindingIsString: ({
importName
}) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`,
ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
ImportCallArity: ({
maxArgumentCount
}) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
ImportCallNotNewExpression: "Cannot use new with import(...).",
ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
ImportReflectionHasAssertion: "`import module x` cannot have assertions.",
ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
InvalidBigIntLiteral: "Invalid BigIntLiteral.",
InvalidCodePoint: "Code point out of bounds.",
InvalidCoverInitializedName: "Invalid shorthand property initializer.",
InvalidDecimal: "Invalid decimal.",
InvalidDigit: ({
radix
}) => `Expected number in radix ${radix}.`,
InvalidEscapeSequence: "Bad character escape sequence.",
InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
InvalidEscapedReservedWord: ({
reservedWord
}) => `Escape sequence in keyword ${reservedWord}.`,
InvalidIdentifier: ({
identifierName
}) => `Invalid identifier ${identifierName}.`,
InvalidLhs: ({
ancestor
}) => `Invalid left-hand side in ${(0, _toNodeDescription.default)(ancestor)}.`,
InvalidLhsBinding: ({
ancestor
}) => `Binding invalid left-hand side in ${(0, _toNodeDescription.default)(ancestor)}.`,
InvalidNumber: "Invalid number.",
InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
InvalidOrUnexpectedToken: ({
unexpected
}) => `Unexpected character '${unexpected}'.`,
InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
InvalidPrivateFieldResolution: ({
identifierName
}) => `Private name #${identifierName} is not defined.`,
InvalidPropertyBindingPattern: "Binding member expression.",
InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
LabelRedeclaration: ({
labelName
}) => `Label '${labelName}' is already declared.`,
LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
MalformedRegExpFlags: "Invalid regular expression flag.",
MissingClassName: "A class name is required.",
MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
MissingSemicolon: "Missing semicolon.",
MissingPlugin: ({
missingPlugin
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
MissingOneOfPlugins: ({
missingPlugin
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
ModuleAttributesWithDuplicateKeys: ({
key
}) => `Duplicate key "${key}" is not allowed in module attributes.`,
ModuleExportNameHasLoneSurrogate: ({
surrogateCharCode
}) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
ModuleExportUndefined: ({
localName
}) => `Export '${localName}' is not defined.`,
MultipleDefaultsInSwitch: "Multiple default clauses.",
NewlineAfterThrow: "Illegal newline after throw.",
NoCatchOrFinally: "Missing catch or finally clause.",
NumberIdentifier: "Identifier directly after number.",
NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
ParamDupe: "Argument name clash.",
PatternHasAccessor: "Object pattern can't contain getter or setter.",
PatternHasMethod: "Object pattern can't contain methods.",
PrivateInExpectedIn: ({
identifierName
}) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
PrivateNameRedeclaration: ({
identifierName
}) => `Duplicate private name #${identifierName}.`,
RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
RecordNoProto: "'__proto__' is not allowed in Record expressions.",
RestTrailingComma: "Unexpected trailing comma after rest element.",
SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.",
SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
StaticPrototype: "Classes may not have static property named prototype.",
SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
SuperPrivateField: "Private fields can't be accessed on super.",
TrailingDecorator: "Decorators must be attached to a class element.",
TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
UnexpectedKeyword: ({
keyword
}) => `Unexpected keyword '${keyword}'.`,
UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
UnexpectedPrivateField: "Unexpected private name.",
UnexpectedReservedWord: ({
reservedWord
}) => `Unexpected reserved word '${reservedWord}'.`,
UnexpectedSuper: "'super' is only allowed in object methods and classes.",
UnexpectedToken: ({
expected,
unexpected
}) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.",
UnsupportedBind: "Binding should be performed on object property.",
UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
UnsupportedMetaProperty: ({
target,
onlyValidPropertyName
}) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,
UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
UnterminatedComment: "Unterminated comment.",
UnterminatedRegExp: "Unterminated regular expression.",
UnterminatedString: "Unterminated string constant.",
UnterminatedTemplate: "Unterminated template.",
UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.",
VarRedeclaration: ({
identifierName
}) => `Identifier '${identifierName}' has already been declared.`,
YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
YieldInParameter: "Yield expression is not allowed in formal parameters.",
ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
};
exports.default = _default;
//# sourceMappingURL=standard-errors.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
StrictDelete: "Deleting local variable in strict mode.",
StrictEvalArguments: ({
referenceName
}) => `Assigning to '${referenceName}' in strict mode.`,
StrictEvalArgumentsBinding: ({
bindingName
}) => `Binding '${bindingName}' in strict mode.`,
StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
StrictWith: "'with' in strict mode."
};
exports.default = _default;
//# sourceMappingURL=strict-mode-errors.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["StrictDelete","StrictEvalArguments","referenceName","StrictEvalArgumentsBinding","bindingName","StrictFunction","StrictNumericEscape","StrictOctalLiteral","StrictWith","exports","default","_default"],"sources":["../../src/parse-error/strict-mode-errors.ts"],"sourcesContent":["export default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n};\n"],"mappings":";;;;;;eAAe;EACbA,YAAY,EAAE,yCAAyC;EAOvDC,mBAAmB,EAAEA,CAAC;IAAEC;EAAyC,CAAC,KAC/D,iBAAgBA,aAAc,mBAAkB;EAOnDC,0BAA0B,EAAEA,CAAC;IAAEC;EAAqC,CAAC,KAClE,YAAWA,WAAY,mBAAkB;EAE5CC,cAAc,EACZ,qFAAqF;EAEvFC,mBAAmB,EAAE,wDAAwD;EAE7EC,kBAAkB,EAAE,uDAAuD;EAE3EC,UAAU,EAAE;AACd,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAC,QAAA"}

View File

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const NodeDescriptions = {
ArrayPattern: "array destructuring pattern",
AssignmentExpression: "assignment expression",
AssignmentPattern: "assignment expression",
ArrowFunctionExpression: "arrow function expression",
ConditionalExpression: "conditional expression",
CatchClause: "catch clause",
ForOfStatement: "for-of statement",
ForInStatement: "for-in statement",
ForStatement: "for-loop",
FormalParameters: "function parameter list",
Identifier: "identifier",
ImportSpecifier: "import specifier",
ImportDefaultSpecifier: "import default specifier",
ImportNamespaceSpecifier: "import namespace specifier",
ObjectPattern: "object destructuring pattern",
ParenthesizedExpression: "parenthesized expression",
RestElement: "rest element",
UpdateExpression: {
true: "prefix operation",
false: "postfix operation"
},
VariableDeclarator: "variable declaration",
YieldExpression: "yield expression"
};
const toNodeDescription = ({
type,
prefix
}) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type];
var _default = toNodeDescription;
exports.default = _default;
//# sourceMappingURL=to-node-description.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["NodeDescriptions","ArrayPattern","AssignmentExpression","AssignmentPattern","ArrowFunctionExpression","ConditionalExpression","CatchClause","ForOfStatement","ForInStatement","ForStatement","FormalParameters","Identifier","ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier","ObjectPattern","ParenthesizedExpression","RestElement","UpdateExpression","true","false","VariableDeclarator","YieldExpression","toNodeDescription","type","prefix","String","_default","exports","default"],"sources":["../../src/parse-error/to-node-description.ts"],"sourcesContent":["const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// @ts-expect-error prefix is specified only when type is UpdateExpression\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix) as \"true\" | \"false\"]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n"],"mappings":";;;;;;AAAA,MAAMA,gBAAgB,GAAG;EACvBC,YAAY,EAAE,6BAA6B;EAC3CC,oBAAoB,EAAE,uBAAuB;EAC7CC,iBAAiB,EAAE,uBAAuB;EAC1CC,uBAAuB,EAAE,2BAA2B;EACpDC,qBAAqB,EAAE,wBAAwB;EAC/CC,WAAW,EAAE,cAAc;EAC3BC,cAAc,EAAE,kBAAkB;EAClCC,cAAc,EAAE,kBAAkB;EAClCC,YAAY,EAAE,UAAU;EACxBC,gBAAgB,EAAE,yBAAyB;EAC3CC,UAAU,EAAE,YAAY;EACxBC,eAAe,EAAE,kBAAkB;EACnCC,sBAAsB,EAAE,0BAA0B;EAClDC,wBAAwB,EAAE,4BAA4B;EACtDC,aAAa,EAAE,8BAA8B;EAC7CC,uBAAuB,EAAE,0BAA0B;EACnDC,WAAW,EAAE,cAAc;EAC3BC,gBAAgB,EAAE;IAChBC,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,kBAAkB,EAAE,sBAAsB;EAC1CC,eAAe,EAAE;AACnB,CAAC;AAkBD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAA4B,CAAC,KAC9DD,IAAI,KAAK,kBAAkB,GACvBxB,gBAAgB,CAACkB,gBAAgB,CAACQ,MAAM,CAACD,MAAM,CAAC,CAAqB,GACrEzB,gBAAgB,CAACwB,IAAI,CAAC;AAAC,IAAAG,QAAA,GAEdJ,iBAAiB;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

36
node_modules/@babel/parser/lib/parser/base.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class BaseParser {
constructor() {
this.sawUnambiguousESM = false;
this.ambiguousScriptDifferentAst = false;
}
hasPlugin(pluginConfig) {
if (typeof pluginConfig === "string") {
return this.plugins.has(pluginConfig);
} else {
const [pluginName, pluginOptions] = pluginConfig;
if (!this.hasPlugin(pluginName)) {
return false;
}
const actualOptions = this.plugins.get(pluginName);
for (const key of Object.keys(pluginOptions)) {
if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
return false;
}
}
return true;
}
}
getPluginOption(plugin, name) {
var _this$plugins$get;
return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];
}
}
exports.default = BaseParser;
//# sourceMappingURL=base.js.map

1
node_modules/@babel/parser/lib/parser/base.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"names":["BaseParser","constructor","sawUnambiguousESM","ambiguousScriptDifferentAst","hasPlugin","pluginConfig","plugins","has","pluginName","pluginOptions","actualOptions","get","key","Object","keys","getPluginOption","plugin","name","_this$plugins$get","exports","default"],"sources":["../../src/parser/base.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<any>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set<string>;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugins actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions<PluginName>,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions<PluginName>)?.[\n name\n ];\n }\n}\n"],"mappings":";;;;;;AAae,MAAMA,UAAU,CAAC;EAAAC,YAAA;IAAA,KAa9BC,iBAAiB,GAAY,KAAK;IAAA,KAClCC,2BAA2B,GAAY,KAAK;EAAA;EAa5CC,SAASA,CAACC,YAA0B,EAAW;IAC7C,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;MACpC,OAAO,IAAI,CAACC,OAAO,CAACC,GAAG,CAACF,YAAY,CAAC;IACvC,CAAC,MAAM;MACL,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAGJ,YAAY;MAChD,IAAI,CAAC,IAAI,CAACD,SAAS,CAACI,UAAU,CAAC,EAAE;QAC/B,OAAO,KAAK;MACd;MACA,MAAME,aAAa,GAAG,IAAI,CAACJ,OAAO,CAACK,GAAG,CAACH,UAAU,CAAC;MAClD,KAAK,MAAMI,GAAG,IAAIC,MAAM,CAACC,IAAI,CAC3BL,aACF,CAAC,EAAoC;QACnC,IAAI,CAAAC,aAAa,oBAAbA,aAAa,CAAGE,GAAG,CAAC,MAAKH,aAAa,CAACG,GAAG,CAAC,EAAE;UAC/C,OAAO,KAAK;QACd;MACF;MACA,OAAO,IAAI;IACb;EACF;EAEAG,eAAeA,CAGbC,MAAkB,EAAEC,IAAgB,EAAE;IAAA,IAAAC,iBAAA;IACtC,QAAAA,iBAAA,GAAQ,IAAI,CAACZ,OAAO,CAACK,GAAG,CAACK,MAAM,CAAC,qBAAzBE,iBAAA,CACLD,IAAI,CACL;EACH;AACF;AAACE,OAAA,CAAAC,OAAA,GAAApB,UAAA"}

190
node_modules/@babel/parser/lib/parser/comments.js generated vendored Normal file
View File

@ -0,0 +1,190 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.setInnerComments = setInnerComments;
var _base = require("./base");
function setTrailingComments(node, comments) {
if (node.trailingComments === undefined) {
node.trailingComments = comments;
} else {
node.trailingComments.unshift(...comments);
}
}
function setLeadingComments(node, comments) {
if (node.leadingComments === undefined) {
node.leadingComments = comments;
} else {
node.leadingComments.unshift(...comments);
}
}
function setInnerComments(node, comments) {
if (node.innerComments === undefined) {
node.innerComments = comments;
} else {
node.innerComments.unshift(...comments);
}
}
function adjustInnerComments(node, elements, commentWS) {
let lastElement = null;
let i = elements.length;
while (lastElement === null && i > 0) {
lastElement = elements[--i];
}
if (lastElement === null || lastElement.start > commentWS.start) {
setInnerComments(node, commentWS.comments);
} else {
setTrailingComments(lastElement, commentWS.comments);
}
}
class CommentsParser extends _base.default {
addComment(comment) {
if (this.filename) comment.loc.filename = this.filename;
this.state.comments.push(comment);
}
processComment(node) {
const {
commentStack
} = this.state;
const commentStackLength = commentStack.length;
if (commentStackLength === 0) return;
let i = commentStackLength - 1;
const lastCommentWS = commentStack[i];
if (lastCommentWS.start === node.end) {
lastCommentWS.leadingNode = node;
i--;
}
const {
start: nodeStart
} = node;
for (; i >= 0; i--) {
const commentWS = commentStack[i];
const commentEnd = commentWS.end;
if (commentEnd > nodeStart) {
commentWS.containingNode = node;
this.finalizeComment(commentWS);
commentStack.splice(i, 1);
} else {
if (commentEnd === nodeStart) {
commentWS.trailingNode = node;
}
break;
}
}
}
finalizeComment(commentWS) {
const {
comments
} = commentWS;
if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
if (commentWS.leadingNode !== null) {
setTrailingComments(commentWS.leadingNode, comments);
}
if (commentWS.trailingNode !== null) {
setLeadingComments(commentWS.trailingNode, comments);
}
} else {
const {
containingNode: node,
start: commentStart
} = commentWS;
if (this.input.charCodeAt(commentStart - 1) === 44) {
switch (node.type) {
case "ObjectExpression":
case "ObjectPattern":
case "RecordExpression":
adjustInnerComments(node, node.properties, commentWS);
break;
case "CallExpression":
case "OptionalCallExpression":
adjustInnerComments(node, node.arguments, commentWS);
break;
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression":
case "ObjectMethod":
case "ClassMethod":
case "ClassPrivateMethod":
adjustInnerComments(node, node.params, commentWS);
break;
case "ArrayExpression":
case "ArrayPattern":
case "TupleExpression":
adjustInnerComments(node, node.elements, commentWS);
break;
case "ExportNamedDeclaration":
case "ImportDeclaration":
adjustInnerComments(node, node.specifiers, commentWS);
break;
default:
{
setInnerComments(node, comments);
}
}
} else {
setInnerComments(node, comments);
}
}
}
finalizeRemainingComments() {
const {
commentStack
} = this.state;
for (let i = commentStack.length - 1; i >= 0; i--) {
this.finalizeComment(commentStack[i]);
}
this.state.commentStack = [];
}
resetPreviousNodeTrailingComments(node) {
const {
commentStack
} = this.state;
const {
length
} = commentStack;
if (length === 0) return;
const commentWS = commentStack[length - 1];
if (commentWS.leadingNode === node) {
commentWS.leadingNode = null;
}
}
resetPreviousIdentifierLeadingComments(node) {
const {
commentStack
} = this.state;
const {
length
} = commentStack;
if (length === 0) return;
if (commentStack[length - 1].trailingNode === node) {
commentStack[length - 1].trailingNode = null;
} else if (length >= 2 && commentStack[length - 2].trailingNode === node) {
commentStack[length - 2].trailingNode = null;
}
}
takeSurroundingComments(node, start, end) {
const {
commentStack
} = this.state;
const commentStackLength = commentStack.length;
if (commentStackLength === 0) return;
let i = commentStackLength - 1;
for (; i >= 0; i--) {
const commentWS = commentStack[i];
const commentEnd = commentWS.end;
const commentStart = commentWS.start;
if (commentStart === end) {
commentWS.leadingNode = node;
} else if (commentEnd === start) {
commentWS.trailingNode = node;
} else if (commentEnd < start) {
break;
}
}
}
}
exports.default = CommentsParser;
//# sourceMappingURL=comments.js.map

File diff suppressed because one or more lines are too long

1824
node_modules/@babel/parser/lib/parser/expression.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

43
node_modules/@babel/parser/lib/parser/index.js generated vendored Normal file
View File

@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _options = require("../options");
var _statement = require("./statement");
var _scope = require("../util/scope");
class Parser extends _statement.default {
constructor(options, input) {
options = (0, _options.getOptions)(options);
super(options, input);
this.options = options;
this.initializeScopes();
this.plugins = pluginsMap(this.options.plugins);
this.filename = options.sourceFilename;
}
getScopeHandler() {
return _scope.default;
}
parse() {
this.enterInitialScopes();
const file = this.startNode();
const program = this.startNode();
this.nextToken();
file.errors = null;
this.parseTopLevel(file, program);
file.errors = this.state.errors;
return file;
}
}
exports.default = Parser;
function pluginsMap(plugins) {
const pluginMap = new Map();
for (const plugin of plugins) {
const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
if (!pluginMap.has(name)) pluginMap.set(name, options || {});
}
return pluginMap;
}
//# sourceMappingURL=index.js.map

1
node_modules/@babel/parser/lib/parser/index.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"names":["_options","require","_statement","_scope","Parser","StatementParser","constructor","options","input","getOptions","initializeScopes","plugins","pluginsMap","filename","sourceFilename","getScopeHandler","ScopeHandler","parse","enterInitialScopes","file","startNode","program","nextToken","errors","parseTopLevel","state","exports","default","pluginMap","Map","plugin","name","Array","isArray","has","set"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type * as N from \"../types\";\nimport type { PluginList } from \"../plugin-utils\";\nimport { getOptions } from \"../options\";\nimport StatementParser from \"./statement\";\nimport ScopeHandler from \"../util/scope\";\n\nexport type PluginsMap = Map<\n string,\n {\n [x: string]: any;\n }\n>;\n\nexport default class Parser extends StatementParser {\n // Forward-declaration so typescript plugin can override jsx plugin\n // todo(flow->ts) - this probably can be removed\n // abstract jsxParseOpeningElementAfterName(\n // node: N.JSXOpeningElement,\n // ): N.JSXOpeningElement;\n\n constructor(options: Options | undefined | null, input: string) {\n options = getOptions(options);\n super(options, input);\n\n this.options = options;\n this.initializeScopes();\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n // This can be overwritten, for example, by the TypeScript plugin.\n getScopeHandler(): {\n new (...args: any): ScopeHandler;\n } {\n return ScopeHandler;\n }\n\n parse(): N.File {\n this.enterInitialScopes();\n const file = this.startNode() as N.File;\n const program = this.startNode() as N.Program;\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n}\n\nfunction pluginsMap(plugins: PluginList): PluginsMap {\n const pluginMap: PluginsMap = new Map();\n for (const plugin of plugins) {\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n return pluginMap;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AASe,MAAMG,MAAM,SAASC,kBAAe,CAAC;EAOlDC,WAAWA,CAACC,OAAmC,EAAEC,KAAa,EAAE;IAC9DD,OAAO,GAAG,IAAAE,mBAAU,EAACF,OAAO,CAAC;IAC7B,KAAK,CAACA,OAAO,EAAEC,KAAK,CAAC;IAErB,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACG,gBAAgB,CAAC,CAAC;IACvB,IAAI,CAACC,OAAO,GAAGC,UAAU,CAAC,IAAI,CAACL,OAAO,CAACI,OAAO,CAAC;IAC/C,IAAI,CAACE,QAAQ,GAAGN,OAAO,CAACO,cAAc;EACxC;EAGAC,eAAeA,CAAA,EAEb;IACA,OAAOC,cAAY;EACrB;EAEAC,KAAKA,CAAA,EAAW;IACd,IAAI,CAACC,kBAAkB,CAAC,CAAC;IACzB,MAAMC,IAAI,GAAG,IAAI,CAACC,SAAS,CAAC,CAAW;IACvC,MAAMC,OAAO,GAAG,IAAI,CAACD,SAAS,CAAC,CAAc;IAC7C,IAAI,CAACE,SAAS,CAAC,CAAC;IAChBH,IAAI,CAACI,MAAM,GAAG,IAAI;IAClB,IAAI,CAACC,aAAa,CAACL,IAAI,EAAEE,OAAO,CAAC;IACjCF,IAAI,CAACI,MAAM,GAAG,IAAI,CAACE,KAAK,CAACF,MAAM;IAC/B,OAAOJ,IAAI;EACb;AACF;AAACO,OAAA,CAAAC,OAAA,GAAAvB,MAAA;AAED,SAASQ,UAAUA,CAACD,OAAmB,EAAc;EACnD,MAAMiB,SAAqB,GAAG,IAAIC,GAAG,CAAC,CAAC;EACvC,KAAK,MAAMC,MAAM,IAAInB,OAAO,EAAE;IAC5B,MAAM,CAACoB,IAAI,EAAExB,OAAO,CAAC,GAAGyB,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,EAAE,CAAC,CAAC,CAAC;IACrE,IAAI,CAACF,SAAS,CAACM,GAAG,CAACH,IAAI,CAAC,EAAEH,SAAS,CAACO,GAAG,CAACJ,IAAI,EAAExB,OAAO,IAAI,CAAC,CAAC,CAAC;EAC9D;EACA,OAAOqB,SAAS;AAClB"}

421
node_modules/@babel/parser/lib/parser/lval.js generated vendored Normal file
View File

@ -0,0 +1,421 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ParseBindingListFlags = void 0;
var _types = require("../tokenizer/types");
var _identifier = require("../util/identifier");
var _node = require("./node");
var _scopeflags = require("../util/scopeflags");
var _parseError = require("../parse-error");
const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];
const unwrapParenthesizedExpression = node => {
return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
};
var ParseBindingListFlags = {
ALLOW_EMPTY: 1,
IS_FUNCTION_PARAMS: 2,
IS_CONSTRUCTOR_PARAMS: 4
};
exports.ParseBindingListFlags = ParseBindingListFlags;
class LValParser extends _node.NodeUtils {
toAssignable(node, isLHS = false) {
var _node$extra, _node$extra3;
let parenthesized = undefined;
if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
parenthesized = unwrapParenthesizedExpression(node);
if (isLHS) {
if (parenthesized.type === "Identifier") {
this.expressionScope.recordArrowParameterBindingError(_parseError.Errors.InvalidParenthesizedAssignment, {
at: node
});
} else if (parenthesized.type !== "MemberExpression") {
this.raise(_parseError.Errors.InvalidParenthesizedAssignment, {
at: node
});
}
} else {
this.raise(_parseError.Errors.InvalidParenthesizedAssignment, {
at: node
});
}
}
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
case "AssignmentPattern":
case "RestElement":
break;
case "ObjectExpression":
node.type = "ObjectPattern";
for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
var _node$extra2;
const prop = node.properties[i];
const isLast = i === last;
this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: node.extra.trailingCommaLoc
});
}
}
break;
case "ObjectProperty":
{
const {
key,
value
} = node;
if (this.isPrivateName(key)) {
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
}
this.toAssignable(value, isLHS);
break;
}
case "SpreadElement":
{
throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller.");
}
case "ArrayExpression":
node.type = "ArrayPattern";
this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
break;
case "AssignmentExpression":
if (node.operator !== "=") {
this.raise(_parseError.Errors.MissingEqInAssignment, {
at: node.left.loc.end
});
}
node.type = "AssignmentPattern";
delete node.operator;
this.toAssignable(node.left, isLHS);
break;
case "ParenthesizedExpression":
this.toAssignable(parenthesized, isLHS);
break;
default:
}
}
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
if (prop.type === "ObjectMethod") {
this.raise(prop.kind === "get" || prop.kind === "set" ? _parseError.Errors.PatternHasAccessor : _parseError.Errors.PatternHasMethod, {
at: prop.key
});
} else if (prop.type === "SpreadElement") {
prop.type = "RestElement";
const arg = prop.argument;
this.checkToRestConversion(arg, false);
this.toAssignable(arg, isLHS);
if (!isLast) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: prop
});
}
} else {
this.toAssignable(prop, isLHS);
}
}
toAssignableList(exprList, trailingCommaLoc, isLHS) {
const end = exprList.length - 1;
for (let i = 0; i <= end; i++) {
const elt = exprList[i];
if (!elt) continue;
if (elt.type === "SpreadElement") {
elt.type = "RestElement";
const arg = elt.argument;
this.checkToRestConversion(arg, true);
this.toAssignable(arg, isLHS);
} else {
this.toAssignable(elt, isLHS);
}
if (elt.type === "RestElement") {
if (i < end) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: elt
});
} else if (trailingCommaLoc) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: trailingCommaLoc
});
}
}
}
}
isAssignable(node, isBinding) {
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
case "AssignmentPattern":
case "RestElement":
return true;
case "ObjectExpression":
{
const last = node.properties.length - 1;
return node.properties.every((prop, i) => {
return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
});
}
case "ObjectProperty":
return this.isAssignable(node.value);
case "SpreadElement":
return this.isAssignable(node.argument);
case "ArrayExpression":
return node.elements.every(element => element === null || this.isAssignable(element));
case "AssignmentExpression":
return node.operator === "=";
case "ParenthesizedExpression":
return this.isAssignable(node.expression);
case "MemberExpression":
case "OptionalMemberExpression":
return !isBinding;
default:
return false;
}
}
toReferencedList(exprList, isParenthesizedExpr) {
return exprList;
}
toReferencedListDeep(exprList, isParenthesizedExpr) {
this.toReferencedList(exprList, isParenthesizedExpr);
for (const expr of exprList) {
if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
this.toReferencedListDeep(expr.elements);
}
}
}
parseSpread(refExpressionErrors) {
const node = this.startNode();
this.next();
node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);
return this.finishNode(node, "SpreadElement");
}
parseRestBinding() {
const node = this.startNode();
this.next();
node.argument = this.parseBindingAtom();
return this.finishNode(node, "RestElement");
}
parseBindingAtom() {
switch (this.state.type) {
case 0:
{
const node = this.startNode();
this.next();
node.elements = this.parseBindingList(3, 93, ParseBindingListFlags.ALLOW_EMPTY);
return this.finishNode(node, "ArrayPattern");
}
case 5:
return this.parseObjectLike(8, true);
}
return this.parseIdentifier();
}
parseBindingList(close, closeCharCode, flags) {
const allowEmpty = flags & ParseBindingListFlags.ALLOW_EMPTY;
const elts = [];
let first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(12);
}
if (allowEmpty && this.match(12)) {
elts.push(null);
} else if (this.eat(close)) {
break;
} else if (this.match(21)) {
elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags));
if (!this.checkCommaAfterRest(closeCharCode)) {
this.expect(close);
break;
}
} else {
const decorators = [];
if (this.match(26) && this.hasPlugin("decorators")) {
this.raise(_parseError.Errors.UnsupportedParameterDecorator, {
at: this.state.startLoc
});
}
while (this.match(26)) {
decorators.push(this.parseDecorator());
}
elts.push(this.parseAssignableListItem(flags, decorators));
}
}
return elts;
}
parseBindingRestProperty(prop) {
this.next();
prop.argument = this.parseIdentifier();
this.checkCommaAfterRest(125);
return this.finishNode(prop, "RestElement");
}
parseBindingProperty() {
const prop = this.startNode();
const {
type,
startLoc
} = this.state;
if (type === 21) {
return this.parseBindingRestProperty(prop);
} else if (type === 136) {
this.expectPlugin("destructuringPrivate", startLoc);
this.classScope.usePrivateName(this.state.value, startLoc);
prop.key = this.parsePrivateName();
} else {
this.parsePropertyName(prop);
}
prop.method = false;
return this.parseObjPropValue(prop, startLoc, false, false, true, false);
}
parseAssignableListItem(flags, decorators) {
const left = this.parseMaybeDefault();
this.parseAssignableListItemTypes(left, flags);
const elt = this.parseMaybeDefault(left.loc.start, left);
if (decorators.length) {
left.decorators = decorators;
}
return elt;
}
parseAssignableListItemTypes(param, flags) {
return param;
}
parseMaybeDefault(startLoc, left) {
var _startLoc, _left;
(_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
left = (_left = left) != null ? _left : this.parseBindingAtom();
if (!this.eat(29)) return left;
const node = this.startNodeAt(startLoc);
node.left = left;
node.right = this.parseMaybeAssignAllowIn();
return this.finishNode(node, "AssignmentPattern");
}
isValidLVal(type, isUnparenthesizedInAssign, binding) {
return getOwn({
AssignmentPattern: "left",
RestElement: "argument",
ObjectProperty: "value",
ParenthesizedExpression: "expression",
ArrayPattern: "elements",
ObjectPattern: "properties"
}, type);
}
checkLVal(expression, {
in: ancestor,
binding = _scopeflags.BIND_NONE,
checkClashes = false,
strictModeChanged = false,
hasParenthesizedAncestor = false
}) {
var _expression$extra;
const type = expression.type;
if (this.isObjectMethod(expression)) return;
if (type === "MemberExpression") {
if (binding !== _scopeflags.BIND_NONE) {
this.raise(_parseError.Errors.InvalidPropertyBindingPattern, {
at: expression
});
}
return;
}
if (type === "Identifier") {
this.checkIdentifier(expression, binding, strictModeChanged);
const {
name
} = expression;
if (checkClashes) {
if (checkClashes.has(name)) {
this.raise(_parseError.Errors.ParamDupe, {
at: expression
});
} else {
checkClashes.add(name);
}
}
return;
}
const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
if (validity === true) return;
if (validity === false) {
const ParseErrorClass = binding === _scopeflags.BIND_NONE ? _parseError.Errors.InvalidLhs : _parseError.Errors.InvalidLhsBinding;
this.raise(ParseErrorClass, {
at: expression,
ancestor
});
return;
}
const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"];
const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" || type === "ParenthesizedExpression" ? {
type
} : ancestor;
for (const child of [].concat(expression[key])) {
if (child) {
this.checkLVal(child, {
in: nextAncestor,
binding,
checkClashes,
strictModeChanged,
hasParenthesizedAncestor: isParenthesizedExpression
});
}
}
}
checkIdentifier(at, bindingType, strictModeChanged = false) {
if (this.state.strict && (strictModeChanged ? (0, _identifier.isStrictBindReservedWord)(at.name, this.inModule) : (0, _identifier.isStrictBindOnlyReservedWord)(at.name))) {
if (bindingType === _scopeflags.BIND_NONE) {
this.raise(_parseError.Errors.StrictEvalArguments, {
at,
referenceName: at.name
});
} else {
this.raise(_parseError.Errors.StrictEvalArgumentsBinding, {
at,
bindingName: at.name
});
}
}
if (bindingType & _scopeflags.BIND_FLAGS_NO_LET_IN_LEXICAL && at.name === "let") {
this.raise(_parseError.Errors.LetInLexicalBinding, {
at
});
}
if (!(bindingType & _scopeflags.BIND_NONE)) {
this.declareNameFromIdentifier(at, bindingType);
}
}
declareNameFromIdentifier(identifier, binding) {
this.scope.declareName(identifier.name, binding, identifier.loc.start);
}
checkToRestConversion(node, allowPattern) {
switch (node.type) {
case "ParenthesizedExpression":
this.checkToRestConversion(node.expression, allowPattern);
break;
case "Identifier":
case "MemberExpression":
break;
case "ArrayExpression":
case "ObjectExpression":
if (allowPattern) break;
default:
this.raise(_parseError.Errors.InvalidRestAssignmentPattern, {
at: node
});
}
}
checkCommaAfterRest(close) {
if (!this.match(12)) {
return false;
}
this.raise(this.lookaheadCharCode() === close ? _parseError.Errors.RestTrailingComma : _parseError.Errors.ElementAfterRest, {
at: this.state.startLoc
});
return true;
}
}
exports.default = LValParser;
//# sourceMappingURL=lval.js.map

1
node_modules/@babel/parser/lib/parser/lval.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

127
node_modules/@babel/parser/lib/parser/node.js generated vendored Normal file
View File

@ -0,0 +1,127 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NodeUtils = void 0;
exports.cloneIdentifier = cloneIdentifier;
exports.cloneStringLiteral = cloneStringLiteral;
var _util = require("./util");
var _location = require("../util/location");
class Node {
constructor(parser, pos, loc) {
this.type = "";
this.start = pos;
this.end = 0;
this.loc = new _location.SourceLocation(loc);
if (parser != null && parser.options.ranges) this.range = [pos, 0];
if (parser != null && parser.filename) this.loc.filename = parser.filename;
}
}
const NodePrototype = Node.prototype;
{
NodePrototype.__clone = function () {
const newNode = new Node(undefined, this.start, this.loc.start);
const keys = Object.keys(this);
for (let i = 0, length = keys.length; i < length; i++) {
const key = keys[i];
if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
newNode[key] = this[key];
}
}
return newNode;
};
}
function clonePlaceholder(node) {
return cloneIdentifier(node);
}
function cloneIdentifier(node) {
const {
type,
start,
end,
loc,
range,
extra,
name
} = node;
const cloned = Object.create(NodePrototype);
cloned.type = type;
cloned.start = start;
cloned.end = end;
cloned.loc = loc;
cloned.range = range;
cloned.extra = extra;
cloned.name = name;
if (type === "Placeholder") {
cloned.expectedNode = node.expectedNode;
}
return cloned;
}
function cloneStringLiteral(node) {
const {
type,
start,
end,
loc,
range,
extra
} = node;
if (type === "Placeholder") {
return clonePlaceholder(node);
}
const cloned = Object.create(NodePrototype);
cloned.type = type;
cloned.start = start;
cloned.end = end;
cloned.loc = loc;
cloned.range = range;
if (node.raw !== undefined) {
cloned.raw = node.raw;
} else {
cloned.extra = extra;
}
cloned.value = node.value;
return cloned;
}
class NodeUtils extends _util.default {
startNode() {
return new Node(this, this.state.start, this.state.startLoc);
}
startNodeAt(loc) {
return new Node(this, loc.index, loc);
}
startNodeAtNode(type) {
return this.startNodeAt(type.loc.start);
}
finishNode(node, type) {
return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
}
finishNodeAt(node, type, endLoc) {
if (process.env.NODE_ENV !== "production" && node.end > 0) {
throw new Error("Do not call finishNode*() twice on the same node." + " Instead use resetEndLocation() or change type directly.");
}
node.type = type;
node.end = endLoc.index;
node.loc.end = endLoc;
if (this.options.ranges) node.range[1] = endLoc.index;
if (this.options.attachComment) this.processComment(node);
return node;
}
resetStartLocation(node, startLoc) {
node.start = startLoc.index;
node.loc.start = startLoc;
if (this.options.ranges) node.range[0] = startLoc.index;
}
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
node.end = endLoc.index;
node.loc.end = endLoc;
if (this.options.ranges) node.range[1] = endLoc.index;
}
resetStartLocationFromNode(node, locationNode) {
this.resetStartLocation(node, locationNode.loc.start);
}
}
exports.NodeUtils = NodeUtils;
//# sourceMappingURL=node.js.map

1
node_modules/@babel/parser/lib/parser/node.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2032
node_modules/@babel/parser/lib/parser/statement.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

238
node_modules/@babel/parser/lib/parser/util.js generated vendored Normal file
View File

@ -0,0 +1,238 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ExpressionErrors = void 0;
var _types = require("../tokenizer/types");
var _tokenizer = require("../tokenizer");
var _whitespace = require("../util/whitespace");
var _identifier = require("../util/identifier");
var _classScope = require("../util/class-scope");
var _expressionScope = require("../util/expression-scope");
var _scopeflags = require("../util/scopeflags");
var _productionParameter = require("../util/production-parameter");
var _parseError = require("../parse-error");
class UtilParser extends _tokenizer.default {
addExtra(node, key, value, enumerable = true) {
if (!node) return;
const extra = node.extra = node.extra || {};
if (enumerable) {
extra[key] = value;
} else {
Object.defineProperty(extra, key, {
enumerable,
value
});
}
}
isContextual(token) {
return this.state.type === token && !this.state.containsEsc;
}
isUnparsedContextual(nameStart, name) {
const nameEnd = nameStart + name.length;
if (this.input.slice(nameStart, nameEnd) === name) {
const nextCh = this.input.charCodeAt(nameEnd);
return !((0, _identifier.isIdentifierChar)(nextCh) || (nextCh & 0xfc00) === 0xd800);
}
return false;
}
isLookaheadContextual(name) {
const next = this.nextTokenStart();
return this.isUnparsedContextual(next, name);
}
eatContextual(token) {
if (this.isContextual(token)) {
this.next();
return true;
}
return false;
}
expectContextual(token, toParseError) {
if (!this.eatContextual(token)) {
if (toParseError != null) {
throw this.raise(toParseError, {
at: this.state.startLoc
});
}
this.unexpected(null, token);
}
}
canInsertSemicolon() {
return this.match(137) || this.match(8) || this.hasPrecedingLineBreak();
}
hasPrecedingLineBreak() {
return _whitespace.lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start));
}
hasFollowingLineBreak() {
_whitespace.skipWhiteSpaceToLineBreak.lastIndex = this.state.end;
return _whitespace.skipWhiteSpaceToLineBreak.test(this.input);
}
isLineTerminator() {
return this.eat(13) || this.canInsertSemicolon();
}
semicolon(allowAsi = true) {
if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
this.raise(_parseError.Errors.MissingSemicolon, {
at: this.state.lastTokEndLoc
});
}
expect(type, loc) {
this.eat(type) || this.unexpected(loc, type);
}
tryParse(fn, oldState = this.state.clone()) {
const abortSignal = {
node: null
};
try {
const node = fn((node = null) => {
abortSignal.node = node;
throw abortSignal;
});
if (this.state.errors.length > oldState.errors.length) {
const failState = this.state;
this.state = oldState;
this.state.tokensLength = failState.tokensLength;
return {
node,
error: failState.errors[oldState.errors.length],
thrown: false,
aborted: false,
failState
};
}
return {
node,
error: null,
thrown: false,
aborted: false,
failState: null
};
} catch (error) {
const failState = this.state;
this.state = oldState;
if (error instanceof SyntaxError) {
return {
node: null,
error,
thrown: true,
aborted: false,
failState
};
}
if (error === abortSignal) {
return {
node: abortSignal.node,
error: null,
thrown: false,
aborted: true,
failState
};
}
throw error;
}
}
checkExpressionErrors(refExpressionErrors, andThrow) {
if (!refExpressionErrors) return false;
const {
shorthandAssignLoc,
doubleProtoLoc,
privateKeyLoc,
optionalParametersLoc
} = refExpressionErrors;
const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
if (!andThrow) {
return hasErrors;
}
if (shorthandAssignLoc != null) {
this.raise(_parseError.Errors.InvalidCoverInitializedName, {
at: shorthandAssignLoc
});
}
if (doubleProtoLoc != null) {
this.raise(_parseError.Errors.DuplicateProto, {
at: doubleProtoLoc
});
}
if (privateKeyLoc != null) {
this.raise(_parseError.Errors.UnexpectedPrivateField, {
at: privateKeyLoc
});
}
if (optionalParametersLoc != null) {
this.unexpected(optionalParametersLoc);
}
}
isLiteralPropertyName() {
return (0, _types.tokenIsLiteralPropertyName)(this.state.type);
}
isPrivateName(node) {
return node.type === "PrivateName";
}
getPrivateNameSV(node) {
return node.id.name;
}
hasPropertyAsPrivateName(node) {
return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
}
isObjectProperty(node) {
return node.type === "ObjectProperty";
}
isObjectMethod(node) {
return node.type === "ObjectMethod";
}
initializeScopes(inModule = this.options.sourceType === "module") {
const oldLabels = this.state.labels;
this.state.labels = [];
const oldExportedIdentifiers = this.exportedIdentifiers;
this.exportedIdentifiers = new Set();
const oldInModule = this.inModule;
this.inModule = inModule;
const oldScope = this.scope;
const ScopeHandler = this.getScopeHandler();
this.scope = new ScopeHandler(this, inModule);
const oldProdParam = this.prodParam;
this.prodParam = new _productionParameter.default();
const oldClassScope = this.classScope;
this.classScope = new _classScope.default(this);
const oldExpressionScope = this.expressionScope;
this.expressionScope = new _expressionScope.default(this);
return () => {
this.state.labels = oldLabels;
this.exportedIdentifiers = oldExportedIdentifiers;
this.inModule = oldInModule;
this.scope = oldScope;
this.prodParam = oldProdParam;
this.classScope = oldClassScope;
this.expressionScope = oldExpressionScope;
};
}
enterInitialScopes() {
let paramFlags = _productionParameter.PARAM;
if (this.inModule) {
paramFlags |= _productionParameter.PARAM_AWAIT;
}
this.scope.enter(_scopeflags.SCOPE_PROGRAM);
this.prodParam.enter(paramFlags);
}
checkDestructuringPrivate(refExpressionErrors) {
const {
privateKeyLoc
} = refExpressionErrors;
if (privateKeyLoc !== null) {
this.expectPlugin("destructuringPrivate", privateKeyLoc);
}
}
}
exports.default = UtilParser;
class ExpressionErrors {
constructor() {
this.shorthandAssignLoc = null;
this.doubleProtoLoc = null;
this.privateKeyLoc = null;
this.optionalParametersLoc = null;
}
}
exports.ExpressionErrors = ExpressionErrors;
//# sourceMappingURL=util.js.map

1
node_modules/@babel/parser/lib/parser/util.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

136
node_modules/@babel/parser/lib/plugin-utils.js generated vendored Normal file
View File

@ -0,0 +1,136 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPluginOption = getPluginOption;
exports.hasPlugin = hasPlugin;
exports.mixinPlugins = exports.mixinPluginNames = void 0;
exports.validatePlugins = validatePlugins;
var _estree = require("./plugins/estree");
var _flow = require("./plugins/flow");
var _jsx = require("./plugins/jsx");
var _typescript = require("./plugins/typescript");
var _placeholders = require("./plugins/placeholders");
var _v8intrinsic = require("./plugins/v8intrinsic");
function hasPlugin(plugins, expectedConfig) {
const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig;
const expectedKeys = Object.keys(expectedOptions);
const expectedOptionsIsEmpty = expectedKeys.length === 0;
return plugins.some(p => {
if (typeof p === "string") {
return expectedOptionsIsEmpty && p === expectedName;
} else {
const [pluginName, pluginOptions] = p;
if (pluginName !== expectedName) {
return false;
}
for (const key of expectedKeys) {
if (pluginOptions[key] !== expectedOptions[key]) {
return false;
}
}
return true;
}
});
}
function getPluginOption(plugins, name, option) {
const plugin = plugins.find(plugin => {
if (Array.isArray(plugin)) {
return plugin[0] === name;
} else {
return plugin === name;
}
});
if (plugin && Array.isArray(plugin) && plugin.length > 1) {
return plugin[1][option];
}
return null;
}
const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
function validatePlugins(plugins) {
if (hasPlugin(plugins, "decorators")) {
if (hasPlugin(plugins, "decorators-legacy")) {
throw new Error("Cannot use the decorators and decorators-legacy plugin together");
}
const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") {
throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");
}
const allowCallParenthesized = getPluginOption(plugins, "decorators", "allowCallParenthesized");
if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") {
throw new Error("'allowCallParenthesized' must be a boolean.");
}
}
if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
throw new Error("Cannot combine flow and typescript plugins.");
}
if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
}
if (hasPlugin(plugins, "pipelineOperator")) {
const proposal = getPluginOption(plugins, "pipelineOperator", "proposal");
if (!PIPELINE_PROPOSALS.includes(proposal)) {
const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
}
const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", {
syntaxType: "hash"
}]);
if (proposal === "hack") {
if (hasPlugin(plugins, "placeholders")) {
throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
}
if (hasPlugin(plugins, "v8intrinsic")) {
throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
}
const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken");
if (!TOPIC_TOKENS.includes(topicToken)) {
const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
}
if (topicToken === "#" && tupleSyntaxIsHash) {
throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
}
} else if (proposal === "smart" && tupleSyntaxIsHash) {
throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
}
}
if (hasPlugin(plugins, "moduleAttributes")) {
{
if (hasPlugin(plugins, "importAssertions") || hasPlugin(plugins, "importAttributes")) {
throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");
}
const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
if (moduleAttributesVersionPluginOption !== "may-2020") {
throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
}
}
}
if (hasPlugin(plugins, "importAssertions") && hasPlugin(plugins, "importAttributes")) {
throw new Error("Cannot combine importAssertions and importAttributes plugins.");
}
if (hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
}
if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) {
const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
error.missingPlugins = "doExpressions";
throw error;
}
}
const mixinPlugins = {
estree: _estree.default,
jsx: _jsx.default,
flow: _flow.default,
typescript: _typescript.default,
v8intrinsic: _v8intrinsic.default,
placeholders: _placeholders.default
};
exports.mixinPlugins = mixinPlugins;
const mixinPluginNames = Object.keys(mixinPlugins);
exports.mixinPluginNames = mixinPluginNames;
//# sourceMappingURL=plugin-utils.js.map

1
node_modules/@babel/parser/lib/plugin-utils.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

340
node_modules/@babel/parser/lib/plugins/estree.js generated vendored Normal file
View File

@ -0,0 +1,340 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _parseError = require("../parse-error");
const {
defineProperty
} = Object;
const toUnenumerable = (object, key) => defineProperty(object, key, {
enumerable: false,
value: object[key]
});
function toESTreeLocation(node) {
node.loc.start && toUnenumerable(node.loc.start, "index");
node.loc.end && toUnenumerable(node.loc.end, "index");
return node;
}
var _default = superClass => class ESTreeParserMixin extends superClass {
parse() {
const file = toESTreeLocation(super.parse());
if (this.options.tokens) {
file.tokens = file.tokens.map(toESTreeLocation);
}
return file;
}
parseRegExpLiteral({
pattern,
flags
}) {
let regex = null;
try {
regex = new RegExp(pattern, flags);
} catch (e) {}
const node = this.estreeParseLiteral(regex);
node.regex = {
pattern,
flags
};
return node;
}
parseBigIntLiteral(value) {
let bigInt;
try {
bigInt = BigInt(value);
} catch (_unused) {
bigInt = null;
}
const node = this.estreeParseLiteral(bigInt);
node.bigint = String(node.value || value);
return node;
}
parseDecimalLiteral(value) {
const decimal = null;
const node = this.estreeParseLiteral(decimal);
node.decimal = String(node.value || value);
return node;
}
estreeParseLiteral(value) {
return this.parseLiteral(value, "Literal");
}
parseStringLiteral(value) {
return this.estreeParseLiteral(value);
}
parseNumericLiteral(value) {
return this.estreeParseLiteral(value);
}
parseNullLiteral() {
return this.estreeParseLiteral(null);
}
parseBooleanLiteral(value) {
return this.estreeParseLiteral(value);
}
directiveToStmt(directive) {
const expression = directive.value;
delete directive.value;
expression.type = "Literal";
expression.raw = expression.extra.raw;
expression.value = expression.extra.expressionValue;
const stmt = directive;
stmt.type = "ExpressionStatement";
stmt.expression = expression;
stmt.directive = expression.extra.rawValue;
delete expression.extra;
return stmt;
}
initFunction(node, isAsync) {
super.initFunction(node, isAsync);
node.expression = false;
}
checkDeclaration(node) {
if (node != null && this.isObjectProperty(node)) {
this.checkDeclaration(node.value);
} else {
super.checkDeclaration(node);
}
}
getObjectOrClassMethodParams(method) {
return method.value.params;
}
isValidDirective(stmt) {
var _stmt$expression$extr;
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
}
parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);
const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
node.body = directiveStatements.concat(node.body);
delete node.directives;
}
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
if (method.typeParameters) {
method.value.typeParameters = method.typeParameters;
delete method.typeParameters;
}
classBody.body.push(method);
}
parsePrivateName() {
const node = super.parsePrivateName();
{
if (!this.getPluginOption("estree", "classFeatures")) {
return node;
}
}
return this.convertPrivateNameToPrivateIdentifier(node);
}
convertPrivateNameToPrivateIdentifier(node) {
const name = super.getPrivateNameSV(node);
node = node;
delete node.id;
node.name = name;
node.type = "PrivateIdentifier";
return node;
}
isPrivateName(node) {
{
if (!this.getPluginOption("estree", "classFeatures")) {
return super.isPrivateName(node);
}
}
return node.type === "PrivateIdentifier";
}
getPrivateNameSV(node) {
{
if (!this.getPluginOption("estree", "classFeatures")) {
return super.getPrivateNameSV(node);
}
}
return node.name;
}
parseLiteral(value, type) {
const node = super.parseLiteral(value, type);
node.raw = node.extra.raw;
delete node.extra;
return node;
}
parseFunctionBody(node, allowExpression, isMethod = false) {
super.parseFunctionBody(node, allowExpression, isMethod);
node.expression = node.body.type !== "BlockStatement";
}
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
let funcNode = this.startNode();
funcNode.kind = node.kind;
funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
funcNode.type = "FunctionExpression";
delete funcNode.kind;
node.value = funcNode;
if (type === "ClassPrivateMethod") {
node.computed = false;
}
return this.finishNode(node, "MethodDefinition");
}
parseClassProperty(...args) {
const propertyNode = super.parseClassProperty(...args);
{
if (!this.getPluginOption("estree", "classFeatures")) {
return propertyNode;
}
}
propertyNode.type = "PropertyDefinition";
return propertyNode;
}
parseClassPrivateProperty(...args) {
const propertyNode = super.parseClassPrivateProperty(...args);
{
if (!this.getPluginOption("estree", "classFeatures")) {
return propertyNode;
}
}
propertyNode.type = "PropertyDefinition";
propertyNode.computed = false;
return propertyNode;
}
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
if (node) {
node.type = "Property";
if (node.kind === "method") {
node.kind = "init";
}
node.shorthand = false;
}
return node;
}
parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
if (node) {
node.kind = "init";
node.type = "Property";
}
return node;
}
isValidLVal(type, isUnparenthesizedInAssign, binding) {
return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
}
isAssignable(node, isBinding) {
if (node != null && this.isObjectProperty(node)) {
return this.isAssignable(node.value, isBinding);
}
return super.isAssignable(node, isBinding);
}
toAssignable(node, isLHS = false) {
if (node != null && this.isObjectProperty(node)) {
const {
key,
value
} = node;
if (this.isPrivateName(key)) {
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
}
this.toAssignable(value, isLHS);
} else {
super.toAssignable(node, isLHS);
}
}
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
if (prop.kind === "get" || prop.kind === "set") {
this.raise(_parseError.Errors.PatternHasAccessor, {
at: prop.key
});
} else if (prop.method) {
this.raise(_parseError.Errors.PatternHasMethod, {
at: prop.key
});
} else {
super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
}
}
finishCallExpression(unfinished, optional) {
const node = super.finishCallExpression(unfinished, optional);
if (node.callee.type === "Import") {
node.type = "ImportExpression";
node.source = node.arguments[0];
if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
var _node$arguments$;
node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;
}
delete node.arguments;
delete node.callee;
}
return node;
}
toReferencedArguments(node) {
if (node.type === "ImportExpression") {
return;
}
super.toReferencedArguments(node);
}
parseExport(unfinished, decorators) {
const exportStartLoc = this.state.lastTokStartLoc;
const node = super.parseExport(unfinished, decorators);
switch (node.type) {
case "ExportAllDeclaration":
node.exported = null;
break;
case "ExportNamedDeclaration":
if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
node.type = "ExportAllDeclaration";
node.exported = node.specifiers[0].exported;
delete node.specifiers;
}
case "ExportDefaultDeclaration":
{
var _declaration$decorato;
const {
declaration
} = node;
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) {
this.resetStartLocation(node, exportStartLoc);
}
}
break;
}
return node;
}
parseSubscript(base, startLoc, noCalls, state) {
const node = super.parseSubscript(base, startLoc, noCalls, state);
if (state.optionalChainMember) {
if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
node.type = node.type.substring(8);
}
if (state.stop) {
const chain = this.startNodeAtNode(node);
chain.expression = node;
return this.finishNode(chain, "ChainExpression");
}
} else if (node.type === "MemberExpression" || node.type === "CallExpression") {
node.optional = false;
}
return node;
}
hasPropertyAsPrivateName(node) {
if (node.type === "ChainExpression") {
node = node.expression;
}
return super.hasPropertyAsPrivateName(node);
}
isObjectProperty(node) {
return node.type === "Property" && node.kind === "init" && !node.method;
}
isObjectMethod(node) {
return node.method || node.kind === "get" || node.kind === "set";
}
finishNodeAt(node, type, endLoc) {
return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
}
resetStartLocation(node, startLoc) {
super.resetStartLocation(node, startLoc);
toESTreeLocation(node);
}
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
super.resetEndLocation(node, endLoc);
toESTreeLocation(node);
}
};
exports.default = _default;
//# sourceMappingURL=estree.js.map

1
node_modules/@babel/parser/lib/plugins/estree.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2474
node_modules/@babel/parser/lib/plugins/flow/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

44
node_modules/@babel/parser/lib/plugins/flow/scope.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _scope = require("../../util/scope");
var _scopeflags = require("../../util/scopeflags");
class FlowScope extends _scope.Scope {
constructor(...args) {
super(...args);
this.declareFunctions = new Set();
}
}
class FlowScopeHandler extends _scope.default {
createScope(flags) {
return new FlowScope(flags);
}
declareName(name, bindingType, loc) {
const scope = this.currentScope();
if (bindingType & _scopeflags.BIND_FLAGS_FLOW_DECLARE_FN) {
this.checkRedeclarationInScope(scope, name, bindingType, loc);
this.maybeExportDefined(scope, name);
scope.declareFunctions.add(name);
return;
}
super.declareName(name, bindingType, loc);
}
isRedeclaredInScope(scope, name, bindingType) {
if (super.isRedeclaredInScope(scope, name, bindingType)) return true;
if (bindingType & _scopeflags.BIND_FLAGS_FLOW_DECLARE_FN) {
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
}
return false;
}
checkLocalExport(id) {
if (!this.scopeStack[0].declareFunctions.has(id.name)) {
super.checkLocalExport(id);
}
}
}
exports.default = FlowScopeHandler;
//# sourceMappingURL=scope.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_scope","require","_scopeflags","FlowScope","Scope","constructor","args","declareFunctions","Set","FlowScopeHandler","ScopeHandler","createScope","flags","declareName","name","bindingType","loc","scope","currentScope","BIND_FLAGS_FLOW_DECLARE_FN","checkRedeclarationInScope","maybeExportDefined","add","isRedeclaredInScope","has","lexical","functions","checkLocalExport","id","scopeStack","exports","default"],"sources":["../../../src/plugins/flow/scope.ts"],"sourcesContent":["import type { Position } from \"../../util/location\";\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_FLAGS_FLOW_DECLARE_FN,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport type * as N from \"../../types\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set<string> = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler<FlowScope> {\n createScope(flags: ScopeFlags): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (bindingType & BIND_FLAGS_FLOW_DECLARE_FN) {\n return (\n !scope.declareFunctions.has(name) &&\n (scope.lexical.has(name) || scope.functions.has(name))\n );\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,MAAME,SAAS,SAASC,YAAK,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,KAE5BC,gBAAgB,GAAgB,IAAIC,GAAG,CAAC,CAAC;EAAA;AAC3C;AAEe,MAAMC,gBAAgB,SAASC,cAAY,CAAY;EACpEC,WAAWA,CAACC,KAAiB,EAAa;IACxC,OAAO,IAAIT,SAAS,CAACS,KAAK,CAAC;EAC7B;EAEAC,WAAWA,CAACC,IAAY,EAAEC,WAAyB,EAAEC,GAAa,EAAE;IAClE,MAAMC,KAAK,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;IACjC,IAAIH,WAAW,GAAGI,sCAA0B,EAAE;MAC5C,IAAI,CAACC,yBAAyB,CAACH,KAAK,EAAEH,IAAI,EAAEC,WAAW,EAAEC,GAAG,CAAC;MAC7D,IAAI,CAACK,kBAAkB,CAACJ,KAAK,EAAEH,IAAI,CAAC;MACpCG,KAAK,CAACV,gBAAgB,CAACe,GAAG,CAACR,IAAI,CAAC;MAChC;IACF;IAEA,KAAK,CAACD,WAAW,CAACC,IAAI,EAAEC,WAAW,EAAEC,GAAG,CAAC;EAC3C;EAEAO,mBAAmBA,CACjBN,KAAgB,EAChBH,IAAY,EACZC,WAAyB,EAChB;IACT,IAAI,KAAK,CAACQ,mBAAmB,CAACN,KAAK,EAAEH,IAAI,EAAEC,WAAW,CAAC,EAAE,OAAO,IAAI;IAEpE,IAAIA,WAAW,GAAGI,sCAA0B,EAAE;MAC5C,OACE,CAACF,KAAK,CAACV,gBAAgB,CAACiB,GAAG,CAACV,IAAI,CAAC,KAChCG,KAAK,CAACQ,OAAO,CAACD,GAAG,CAACV,IAAI,CAAC,IAAIG,KAAK,CAACS,SAAS,CAACF,GAAG,CAACV,IAAI,CAAC,CAAC;IAE1D;IAEA,OAAO,KAAK;EACd;EAEAa,gBAAgBA,CAACC,EAAgB,EAAE;IACjC,IAAI,CAAC,IAAI,CAACC,UAAU,CAAC,CAAC,CAAC,CAACtB,gBAAgB,CAACiB,GAAG,CAACI,EAAE,CAACd,IAAI,CAAC,EAAE;MACrD,KAAK,CAACa,gBAAgB,CAACC,EAAE,CAAC;IAC5B;EACF;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAtB,gBAAA"}

444
node_modules/@babel/parser/lib/plugins/jsx/index.js generated vendored Normal file
View File

@ -0,0 +1,444 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _xhtml = require("./xhtml");
var _types = require("../../tokenizer/types");
var _context = require("../../tokenizer/context");
var _identifier = require("../../util/identifier");
var _whitespace = require("../../util/whitespace");
var _parseError = require("../../parse-error");
const JsxErrors = (0, _parseError.ParseErrorEnum)`jsx`({
AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
MissingClosingTagElement: ({
openingTagName
}) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,
MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
UnexpectedToken: ({
unexpected,
HTMLEntity
}) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`,
UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
UnterminatedJsxContent: "Unterminated JSX contents.",
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
});
function isFragment(object) {
return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
}
function getQualifiedJSXName(object) {
if (object.type === "JSXIdentifier") {
return object.name;
}
if (object.type === "JSXNamespacedName") {
return object.namespace.name + ":" + object.name.name;
}
if (object.type === "JSXMemberExpression") {
return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
}
throw new Error("Node had unexpected type: " + object.type);
}
var _default = superClass => class JSXParserMixin extends superClass {
jsxReadToken() {
let out = "";
let chunkStart = this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
throw this.raise(JsxErrors.UnterminatedJsxContent, {
at: this.state.startLoc
});
}
const ch = this.input.charCodeAt(this.state.pos);
switch (ch) {
case 60:
case 123:
if (this.state.pos === this.state.start) {
if (ch === 60 && this.state.canStartJSXElement) {
++this.state.pos;
this.finishToken(140);
} else {
super.getTokenFromCode(ch);
}
return;
}
out += this.input.slice(chunkStart, this.state.pos);
this.finishToken(139, out);
return;
case 38:
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
break;
case 62:
case 125:
;
default:
if ((0, _whitespace.isNewLine)(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(true);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
}
}
jsxReadNewLine(normalizeCRLF) {
const ch = this.input.charCodeAt(this.state.pos);
let out;
++this.state.pos;
if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
++this.state.pos;
out = normalizeCRLF ? "\n" : "\r\n";
} else {
out = String.fromCharCode(ch);
}
++this.state.curLine;
this.state.lineStart = this.state.pos;
return out;
}
jsxReadString(quote) {
let out = "";
let chunkStart = ++this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
throw this.raise(_parseError.Errors.UnterminatedString, {
at: this.state.startLoc
});
}
const ch = this.input.charCodeAt(this.state.pos);
if (ch === quote) break;
if (ch === 38) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
} else if ((0, _whitespace.isNewLine)(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(false);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
out += this.input.slice(chunkStart, this.state.pos++);
this.finishToken(131, out);
}
jsxReadEntity() {
const startPos = ++this.state.pos;
if (this.codePointAtPos(this.state.pos) === 35) {
++this.state.pos;
let radix = 10;
if (this.codePointAtPos(this.state.pos) === 120) {
radix = 16;
++this.state.pos;
}
const codePoint = this.readInt(radix, undefined, false, "bail");
if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {
++this.state.pos;
return String.fromCodePoint(codePoint);
}
} else {
let count = 0;
let semi = false;
while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) {
++this.state.pos;
}
if (semi) {
const desc = this.input.slice(startPos, this.state.pos);
const entity = _xhtml.default[desc];
++this.state.pos;
if (entity) {
return entity;
}
}
}
this.state.pos = startPos;
return "&";
}
jsxReadWord() {
let ch;
const start = this.state.pos;
do {
ch = this.input.charCodeAt(++this.state.pos);
} while ((0, _identifier.isIdentifierChar)(ch) || ch === 45);
this.finishToken(138, this.input.slice(start, this.state.pos));
}
jsxParseIdentifier() {
const node = this.startNode();
if (this.match(138)) {
node.name = this.state.value;
} else if ((0, _types.tokenIsKeyword)(this.state.type)) {
node.name = (0, _types.tokenLabelName)(this.state.type);
} else {
this.unexpected();
}
this.next();
return this.finishNode(node, "JSXIdentifier");
}
jsxParseNamespacedName() {
const startLoc = this.state.startLoc;
const name = this.jsxParseIdentifier();
if (!this.eat(14)) return name;
const node = this.startNodeAt(startLoc);
node.namespace = name;
node.name = this.jsxParseIdentifier();
return this.finishNode(node, "JSXNamespacedName");
}
jsxParseElementName() {
const startLoc = this.state.startLoc;
let node = this.jsxParseNamespacedName();
if (node.type === "JSXNamespacedName") {
return node;
}
while (this.eat(16)) {
const newNode = this.startNodeAt(startLoc);
newNode.object = node;
newNode.property = this.jsxParseIdentifier();
node = this.finishNode(newNode, "JSXMemberExpression");
}
return node;
}
jsxParseAttributeValue() {
let node;
switch (this.state.type) {
case 5:
node = this.startNode();
this.setContext(_context.types.brace);
this.next();
node = this.jsxParseExpressionContainer(node, _context.types.j_oTag);
if (node.expression.type === "JSXEmptyExpression") {
this.raise(JsxErrors.AttributeIsEmpty, {
at: node
});
}
return node;
case 140:
case 131:
return this.parseExprAtom();
default:
throw this.raise(JsxErrors.UnsupportedJsxValue, {
at: this.state.startLoc
});
}
}
jsxParseEmptyExpression() {
const node = this.startNodeAt(this.state.lastTokEndLoc);
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
}
jsxParseSpreadChild(node) {
this.next();
node.expression = this.parseExpression();
this.setContext(_context.types.j_expr);
this.state.canStartJSXElement = true;
this.expect(8);
return this.finishNode(node, "JSXSpreadChild");
}
jsxParseExpressionContainer(node, previousContext) {
if (this.match(8)) {
node.expression = this.jsxParseEmptyExpression();
} else {
const expression = this.parseExpression();
;
node.expression = expression;
}
this.setContext(previousContext);
this.state.canStartJSXElement = true;
this.expect(8);
return this.finishNode(node, "JSXExpressionContainer");
}
jsxParseAttribute() {
const node = this.startNode();
if (this.match(5)) {
this.setContext(_context.types.brace);
this.next();
this.expect(21);
node.argument = this.parseMaybeAssignAllowIn();
this.setContext(_context.types.j_oTag);
this.state.canStartJSXElement = true;
this.expect(8);
return this.finishNode(node, "JSXSpreadAttribute");
}
node.name = this.jsxParseNamespacedName();
node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
return this.finishNode(node, "JSXAttribute");
}
jsxParseOpeningElementAt(startLoc) {
const node = this.startNodeAt(startLoc);
if (this.eat(141)) {
return this.finishNode(node, "JSXOpeningFragment");
}
node.name = this.jsxParseElementName();
return this.jsxParseOpeningElementAfterName(node);
}
jsxParseOpeningElementAfterName(node) {
const attributes = [];
while (!this.match(56) && !this.match(141)) {
attributes.push(this.jsxParseAttribute());
}
node.attributes = attributes;
node.selfClosing = this.eat(56);
this.expect(141);
return this.finishNode(node, "JSXOpeningElement");
}
jsxParseClosingElementAt(startLoc) {
const node = this.startNodeAt(startLoc);
if (this.eat(141)) {
return this.finishNode(node, "JSXClosingFragment");
}
node.name = this.jsxParseElementName();
this.expect(141);
return this.finishNode(node, "JSXClosingElement");
}
jsxParseElementAt(startLoc) {
const node = this.startNodeAt(startLoc);
const children = [];
const openingElement = this.jsxParseOpeningElementAt(startLoc);
let closingElement = null;
if (!openingElement.selfClosing) {
contents: for (;;) {
switch (this.state.type) {
case 140:
startLoc = this.state.startLoc;
this.next();
if (this.eat(56)) {
closingElement = this.jsxParseClosingElementAt(startLoc);
break contents;
}
children.push(this.jsxParseElementAt(startLoc));
break;
case 139:
children.push(this.parseExprAtom());
break;
case 5:
{
const node = this.startNode();
this.setContext(_context.types.brace);
this.next();
if (this.match(21)) {
children.push(this.jsxParseSpreadChild(node));
} else {
children.push(this.jsxParseExpressionContainer(node, _context.types.j_expr));
}
break;
}
default:
this.unexpected();
}
}
if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
this.raise(JsxErrors.MissingClosingTagFragment, {
at: closingElement
});
} else if (!isFragment(openingElement) && isFragment(closingElement)) {
this.raise(JsxErrors.MissingClosingTagElement, {
at: closingElement,
openingTagName: getQualifiedJSXName(openingElement.name)
});
} else if (!isFragment(openingElement) && !isFragment(closingElement)) {
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(JsxErrors.MissingClosingTagElement, {
at: closingElement,
openingTagName: getQualifiedJSXName(openingElement.name)
});
}
}
}
if (isFragment(openingElement)) {
node.openingFragment = openingElement;
node.closingFragment = closingElement;
} else {
node.openingElement = openingElement;
node.closingElement = closingElement;
}
node.children = children;
if (this.match(47)) {
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {
at: this.state.startLoc
});
}
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
}
jsxParseElement() {
const startLoc = this.state.startLoc;
this.next();
return this.jsxParseElementAt(startLoc);
}
setContext(newContext) {
const {
context
} = this.state;
context[context.length - 1] = newContext;
}
parseExprAtom(refExpressionErrors) {
if (this.match(139)) {
return this.parseLiteral(this.state.value, "JSXText");
} else if (this.match(140)) {
return this.jsxParseElement();
} else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
this.replaceToken(140);
return this.jsxParseElement();
} else {
return super.parseExprAtom(refExpressionErrors);
}
}
skipSpace() {
const curContext = this.curContext();
if (!curContext.preserveSpace) super.skipSpace();
}
getTokenFromCode(code) {
const context = this.curContext();
if (context === _context.types.j_expr) {
this.jsxReadToken();
return;
}
if (context === _context.types.j_oTag || context === _context.types.j_cTag) {
if ((0, _identifier.isIdentifierStart)(code)) {
this.jsxReadWord();
return;
}
if (code === 62) {
++this.state.pos;
this.finishToken(141);
return;
}
if ((code === 34 || code === 39) && context === _context.types.j_oTag) {
this.jsxReadString(code);
return;
}
}
if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
++this.state.pos;
this.finishToken(140);
return;
}
super.getTokenFromCode(code);
}
updateContext(prevType) {
const {
context,
type
} = this.state;
if (type === 56 && prevType === 140) {
context.splice(-2, 2, _context.types.j_cTag);
this.state.canStartJSXElement = false;
} else if (type === 140) {
context.push(_context.types.j_oTag);
} else if (type === 141) {
const out = context[context.length - 1];
if (out === _context.types.j_oTag && prevType === 56 || out === _context.types.j_cTag) {
context.pop();
this.state.canStartJSXElement = context[context.length - 1] === _context.types.j_expr;
} else {
this.setContext(_context.types.j_expr);
this.state.canStartJSXElement = true;
}
} else {
this.state.canStartJSXElement = (0, _types.tokenComesBeforeExpression)(type);
}
}
};
exports.default = _default;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

266
node_modules/@babel/parser/lib/plugins/jsx/xhtml.js generated vendored Normal file
View File

@ -0,0 +1,266 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const entities = {
__proto__: null,
quot: "\u0022",
amp: "&",
apos: "\u0027",
lt: "<",
gt: ">",
nbsp: "\u00A0",
iexcl: "\u00A1",
cent: "\u00A2",
pound: "\u00A3",
curren: "\u00A4",
yen: "\u00A5",
brvbar: "\u00A6",
sect: "\u00A7",
uml: "\u00A8",
copy: "\u00A9",
ordf: "\u00AA",
laquo: "\u00AB",
not: "\u00AC",
shy: "\u00AD",
reg: "\u00AE",
macr: "\u00AF",
deg: "\u00B0",
plusmn: "\u00B1",
sup2: "\u00B2",
sup3: "\u00B3",
acute: "\u00B4",
micro: "\u00B5",
para: "\u00B6",
middot: "\u00B7",
cedil: "\u00B8",
sup1: "\u00B9",
ordm: "\u00BA",
raquo: "\u00BB",
frac14: "\u00BC",
frac12: "\u00BD",
frac34: "\u00BE",
iquest: "\u00BF",
Agrave: "\u00C0",
Aacute: "\u00C1",
Acirc: "\u00C2",
Atilde: "\u00C3",
Auml: "\u00C4",
Aring: "\u00C5",
AElig: "\u00C6",
Ccedil: "\u00C7",
Egrave: "\u00C8",
Eacute: "\u00C9",
Ecirc: "\u00CA",
Euml: "\u00CB",
Igrave: "\u00CC",
Iacute: "\u00CD",
Icirc: "\u00CE",
Iuml: "\u00CF",
ETH: "\u00D0",
Ntilde: "\u00D1",
Ograve: "\u00D2",
Oacute: "\u00D3",
Ocirc: "\u00D4",
Otilde: "\u00D5",
Ouml: "\u00D6",
times: "\u00D7",
Oslash: "\u00D8",
Ugrave: "\u00D9",
Uacute: "\u00DA",
Ucirc: "\u00DB",
Uuml: "\u00DC",
Yacute: "\u00DD",
THORN: "\u00DE",
szlig: "\u00DF",
agrave: "\u00E0",
aacute: "\u00E1",
acirc: "\u00E2",
atilde: "\u00E3",
auml: "\u00E4",
aring: "\u00E5",
aelig: "\u00E6",
ccedil: "\u00E7",
egrave: "\u00E8",
eacute: "\u00E9",
ecirc: "\u00EA",
euml: "\u00EB",
igrave: "\u00EC",
iacute: "\u00ED",
icirc: "\u00EE",
iuml: "\u00EF",
eth: "\u00F0",
ntilde: "\u00F1",
ograve: "\u00F2",
oacute: "\u00F3",
ocirc: "\u00F4",
otilde: "\u00F5",
ouml: "\u00F6",
divide: "\u00F7",
oslash: "\u00F8",
ugrave: "\u00F9",
uacute: "\u00FA",
ucirc: "\u00FB",
uuml: "\u00FC",
yacute: "\u00FD",
thorn: "\u00FE",
yuml: "\u00FF",
OElig: "\u0152",
oelig: "\u0153",
Scaron: "\u0160",
scaron: "\u0161",
Yuml: "\u0178",
fnof: "\u0192",
circ: "\u02C6",
tilde: "\u02DC",
Alpha: "\u0391",
Beta: "\u0392",
Gamma: "\u0393",
Delta: "\u0394",
Epsilon: "\u0395",
Zeta: "\u0396",
Eta: "\u0397",
Theta: "\u0398",
Iota: "\u0399",
Kappa: "\u039A",
Lambda: "\u039B",
Mu: "\u039C",
Nu: "\u039D",
Xi: "\u039E",
Omicron: "\u039F",
Pi: "\u03A0",
Rho: "\u03A1",
Sigma: "\u03A3",
Tau: "\u03A4",
Upsilon: "\u03A5",
Phi: "\u03A6",
Chi: "\u03A7",
Psi: "\u03A8",
Omega: "\u03A9",
alpha: "\u03B1",
beta: "\u03B2",
gamma: "\u03B3",
delta: "\u03B4",
epsilon: "\u03B5",
zeta: "\u03B6",
eta: "\u03B7",
theta: "\u03B8",
iota: "\u03B9",
kappa: "\u03BA",
lambda: "\u03BB",
mu: "\u03BC",
nu: "\u03BD",
xi: "\u03BE",
omicron: "\u03BF",
pi: "\u03C0",
rho: "\u03C1",
sigmaf: "\u03C2",
sigma: "\u03C3",
tau: "\u03C4",
upsilon: "\u03C5",
phi: "\u03C6",
chi: "\u03C7",
psi: "\u03C8",
omega: "\u03C9",
thetasym: "\u03D1",
upsih: "\u03D2",
piv: "\u03D6",
ensp: "\u2002",
emsp: "\u2003",
thinsp: "\u2009",
zwnj: "\u200C",
zwj: "\u200D",
lrm: "\u200E",
rlm: "\u200F",
ndash: "\u2013",
mdash: "\u2014",
lsquo: "\u2018",
rsquo: "\u2019",
sbquo: "\u201A",
ldquo: "\u201C",
rdquo: "\u201D",
bdquo: "\u201E",
dagger: "\u2020",
Dagger: "\u2021",
bull: "\u2022",
hellip: "\u2026",
permil: "\u2030",
prime: "\u2032",
Prime: "\u2033",
lsaquo: "\u2039",
rsaquo: "\u203A",
oline: "\u203E",
frasl: "\u2044",
euro: "\u20AC",
image: "\u2111",
weierp: "\u2118",
real: "\u211C",
trade: "\u2122",
alefsym: "\u2135",
larr: "\u2190",
uarr: "\u2191",
rarr: "\u2192",
darr: "\u2193",
harr: "\u2194",
crarr: "\u21B5",
lArr: "\u21D0",
uArr: "\u21D1",
rArr: "\u21D2",
dArr: "\u21D3",
hArr: "\u21D4",
forall: "\u2200",
part: "\u2202",
exist: "\u2203",
empty: "\u2205",
nabla: "\u2207",
isin: "\u2208",
notin: "\u2209",
ni: "\u220B",
prod: "\u220F",
sum: "\u2211",
minus: "\u2212",
lowast: "\u2217",
radic: "\u221A",
prop: "\u221D",
infin: "\u221E",
ang: "\u2220",
and: "\u2227",
or: "\u2228",
cap: "\u2229",
cup: "\u222A",
int: "\u222B",
there4: "\u2234",
sim: "\u223C",
cong: "\u2245",
asymp: "\u2248",
ne: "\u2260",
equiv: "\u2261",
le: "\u2264",
ge: "\u2265",
sub: "\u2282",
sup: "\u2283",
nsub: "\u2284",
sube: "\u2286",
supe: "\u2287",
oplus: "\u2295",
otimes: "\u2297",
perp: "\u22A5",
sdot: "\u22C5",
lceil: "\u2308",
rceil: "\u2309",
lfloor: "\u230A",
rfloor: "\u230B",
lang: "\u2329",
rang: "\u232A",
loz: "\u25CA",
spades: "\u2660",
clubs: "\u2663",
hearts: "\u2665",
diams: "\u2666"
};
var _default = entities;
exports.default = _default;
//# sourceMappingURL=xhtml.js.map

File diff suppressed because one or more lines are too long

197
node_modules/@babel/parser/lib/plugins/placeholders.js generated vendored Normal file
View File

@ -0,0 +1,197 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _types = require("../tokenizer/types");
var _parseError = require("../parse-error");
const PlaceholderErrors = (0, _parseError.ParseErrorEnum)`placeholders`({
ClassNameIsRequired: "A class name is required.",
UnexpectedSpace: "Unexpected space in placeholder."
});
var _default = superClass => class PlaceholdersParserMixin extends superClass {
parsePlaceholder(expectedNode) {
if (this.match(142)) {
const node = this.startNode();
this.next();
this.assertNoSpace();
node.name = super.parseIdentifier(true);
this.assertNoSpace();
this.expect(142);
return this.finishPlaceholder(node, expectedNode);
}
}
finishPlaceholder(node, expectedNode) {
const isFinished = !!(node.expectedNode && node.type === "Placeholder");
node.expectedNode = expectedNode;
return isFinished ? node : this.finishNode(node, "Placeholder");
}
getTokenFromCode(code) {
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
this.finishOp(142, 2);
} else {
super.getTokenFromCode(code);
}
}
parseExprAtom(refExpressionErrors) {
return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
}
parseIdentifier(liberal) {
return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal);
}
checkReservedWord(word, startLoc, checkKeywords, isBinding) {
if (word !== undefined) {
super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
}
}
parseBindingAtom() {
return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
}
isValidLVal(type, isParenthesized, binding) {
return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
}
toAssignable(node, isLHS) {
if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
node.expectedNode = "Pattern";
} else {
super.toAssignable(node, isLHS);
}
}
chStartsBindingIdentifier(ch, pos) {
if (super.chStartsBindingIdentifier(ch, pos)) {
return true;
}
const nextToken = this.lookahead();
if (nextToken.type === 142) {
return true;
}
return false;
}
verifyBreakContinue(node, isBreak) {
if (node.label && node.label.type === "Placeholder") return;
super.verifyBreakContinue(node, isBreak);
}
parseExpressionStatement(node, expr) {
if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
return super.parseExpressionStatement(node, expr);
}
if (this.match(14)) {
const stmt = node;
stmt.label = this.finishPlaceholder(expr, "Identifier");
this.next();
stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();
return this.finishNode(stmt, "LabeledStatement");
}
this.semicolon();
node.name = expr.name;
return this.finishPlaceholder(node, "Statement");
}
parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {
return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);
}
parseFunctionId(requireId) {
return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId);
}
parseClass(node, isStatement, optionalId) {
const type = isStatement ? "ClassDeclaration" : "ClassExpression";
this.next();
const oldStrict = this.state.strict;
const placeholder = this.parsePlaceholder("Identifier");
if (placeholder) {
if (this.match(81) || this.match(142) || this.match(5)) {
node.id = placeholder;
} else if (optionalId || !isStatement) {
node.id = null;
node.body = this.finishPlaceholder(placeholder, "ClassBody");
return this.finishNode(node, type);
} else {
throw this.raise(PlaceholderErrors.ClassNameIsRequired, {
at: this.state.startLoc
});
}
} else {
this.parseClassId(node, isStatement, optionalId);
}
super.parseClassSuper(node);
node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
return this.finishNode(node, type);
}
parseExport(node, decorators) {
const placeholder = this.parsePlaceholder("Identifier");
if (!placeholder) return super.parseExport(node, decorators);
if (!this.isContextual(97) && !this.match(12)) {
node.specifiers = [];
node.source = null;
node.declaration = this.finishPlaceholder(placeholder, "Declaration");
return this.finishNode(node, "ExportNamedDeclaration");
}
this.expectPlugin("exportDefaultFrom");
const specifier = this.startNode();
specifier.exported = placeholder;
node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
return super.parseExport(node, decorators);
}
isExportDefaultSpecifier() {
if (this.match(65)) {
const next = this.nextTokenStart();
if (this.isUnparsedContextual(next, "from")) {
if (this.input.startsWith((0, _types.tokenLabelName)(142), this.nextTokenStartSince(next + 4))) {
return true;
}
}
}
return super.isExportDefaultSpecifier();
}
maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
var _specifiers;
if ((_specifiers = node.specifiers) != null && _specifiers.length) {
return true;
}
return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
}
checkExport(node) {
const {
specifiers
} = node;
if (specifiers != null && specifiers.length) {
node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
}
super.checkExport(node);
node.specifiers = specifiers;
}
parseImport(node) {
const placeholder = this.parsePlaceholder("Identifier");
if (!placeholder) return super.parseImport(node);
node.specifiers = [];
if (!this.isContextual(97) && !this.match(12)) {
node.source = this.finishPlaceholder(placeholder, "StringLiteral");
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
}
const specifier = this.startNodeAtNode(placeholder);
specifier.local = placeholder;
node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
if (this.eat(12)) {
const hasStarImport = this.maybeParseStarImportSpecifier(node);
if (!hasStarImport) this.parseNamedImportSpecifiers(node);
}
this.expectContextual(97);
node.source = this.parseImportSource();
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
}
parseImportSource() {
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
}
assertNoSpace() {
if (this.state.start > this.state.lastTokEndLoc.index) {
this.raise(PlaceholderErrors.UnexpectedSpace, {
at: this.state.lastTokEndLoc
});
}
}
};
exports.default = _default;
//# sourceMappingURL=placeholders.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,119 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _scope = require("../../util/scope");
var _scopeflags = require("../../util/scopeflags");
var _parseError = require("../../parse-error");
class TypeScriptScope extends _scope.Scope {
constructor(...args) {
super(...args);
this.types = new Set();
this.enums = new Set();
this.constEnums = new Set();
this.classes = new Set();
this.exportOnlyBindings = new Set();
}
}
class TypeScriptScopeHandler extends _scope.default {
constructor(...args) {
super(...args);
this.importsStack = [];
}
createScope(flags) {
this.importsStack.push(new Set());
return new TypeScriptScope(flags);
}
enter(flags) {
if (flags == _scopeflags.SCOPE_TS_MODULE) {
this.importsStack.push(new Set());
}
super.enter(flags);
}
exit() {
const flags = super.exit();
if (flags == _scopeflags.SCOPE_TS_MODULE) {
this.importsStack.pop();
}
return flags;
}
hasImport(name, allowShadow) {
const len = this.importsStack.length;
if (this.importsStack[len - 1].has(name)) {
return true;
}
if (!allowShadow && len > 1) {
for (let i = 0; i < len - 1; i++) {
if (this.importsStack[i].has(name)) return true;
}
}
return false;
}
declareName(name, bindingType, loc) {
if (bindingType & _scopeflags.BIND_FLAGS_TS_IMPORT) {
if (this.hasImport(name, true)) {
this.parser.raise(_parseError.Errors.VarRedeclaration, {
at: loc,
identifierName: name
});
}
this.importsStack[this.importsStack.length - 1].add(name);
return;
}
const scope = this.currentScope();
if (bindingType & _scopeflags.BIND_FLAGS_TS_EXPORT_ONLY) {
this.maybeExportDefined(scope, name);
scope.exportOnlyBindings.add(name);
return;
}
super.declareName(name, bindingType, loc);
if (bindingType & _scopeflags.BIND_KIND_TYPE) {
if (!(bindingType & _scopeflags.BIND_KIND_VALUE)) {
this.checkRedeclarationInScope(scope, name, bindingType, loc);
this.maybeExportDefined(scope, name);
}
scope.types.add(name);
}
if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) scope.enums.add(name);
if (bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.add(name);
if (bindingType & _scopeflags.BIND_FLAGS_CLASS) scope.classes.add(name);
}
isRedeclaredInScope(scope, name, bindingType) {
if (scope.enums.has(name)) {
if (bindingType & _scopeflags.BIND_FLAGS_TS_ENUM) {
const isConst = !!(bindingType & _scopeflags.BIND_FLAGS_TS_CONST_ENUM);
const wasConst = scope.constEnums.has(name);
return isConst !== wasConst;
}
return true;
}
if (bindingType & _scopeflags.BIND_FLAGS_CLASS && scope.classes.has(name)) {
if (scope.lexical.has(name)) {
return !!(bindingType & _scopeflags.BIND_KIND_VALUE);
} else {
return false;
}
}
if (bindingType & _scopeflags.BIND_KIND_TYPE && scope.types.has(name)) {
return true;
}
return super.isRedeclaredInScope(scope, name, bindingType);
}
checkLocalExport(id) {
const {
name
} = id;
if (this.hasImport(name)) return;
const len = this.scopeStack.length;
for (let i = len - 1; i >= 0; i--) {
const scope = this.scopeStack[i];
if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return;
}
super.checkLocalExport(id);
}
}
exports.default = TypeScriptScopeHandler;
//# sourceMappingURL=scope.js.map

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More