身体数据完成
This commit is contained in:
commit
d19b762e58
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
"app-plus" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"mp-weixin" : {
|
||||
"launchtype" : "local"
|
||||
},
|
||||
"type" : "uniCloud"
|
||||
},
|
||||
{
|
||||
"playground" : "custom",
|
||||
"type" : "uni-app:app-ios"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
// console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
// console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
@import url("@/uni.scss");
|
||||
@import url("@/assets/common.scss");
|
||||
@import url("@/assets/iconfont.css");
|
||||
@import url("@/assets/iconfont-weapp-icon.css");
|
||||
|
||||
.wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.edit {
|
||||
width: 15rem;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
margin: auto;
|
||||
z-index: 99999;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.editem {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
background: #eee;
|
||||
padding: 0px 10px;
|
||||
align-items: center;
|
||||
|
||||
.radioimg {
|
||||
font-size: 22px;
|
||||
color: $btncolor;
|
||||
}
|
||||
|
||||
.radio {
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 4rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
input {
|
||||
margin-right: 10px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
picker {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.value {
|
||||
position: relative;
|
||||
z-index: 999;
|
||||
width: 3rem;
|
||||
text-align: center;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
margin-left: 10px;
|
||||
float: right;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 0.75rem;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,811 @@
|
|||
|
||||
body,html,* {
|
||||
font-family: "Microsoft YaHei";
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.text_l{
|
||||
text-align: left;
|
||||
}
|
||||
.text_r{
|
||||
text-align: right !important;
|
||||
}
|
||||
.text_c{
|
||||
text-align: center;
|
||||
}
|
||||
.f-r{
|
||||
float: right !important;
|
||||
}
|
||||
.bgfff{
|
||||
background: #fff !important;
|
||||
}
|
||||
.c666{
|
||||
color: #666 !important;
|
||||
}
|
||||
.c999{
|
||||
color: #999 !important;
|
||||
}
|
||||
.size12 {
|
||||
font-size: 24rpx !important
|
||||
}
|
||||
.size14 {
|
||||
font-size: 14rpx !important
|
||||
}
|
||||
.size16 {
|
||||
font-size: 32rpx !important
|
||||
}
|
||||
|
||||
.size18 {
|
||||
font-size: 36rpx !important
|
||||
}
|
||||
|
||||
.size20 {
|
||||
font-size: 40rpx !important
|
||||
}
|
||||
|
||||
.mt-5 {
|
||||
margin-top: 5px !important;
|
||||
}
|
||||
|
||||
.mt-10 {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
|
||||
.mt-15 {
|
||||
margin-top: 15px !important;
|
||||
}
|
||||
|
||||
.mb-5 {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
|
||||
.mb-10 {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.mr-5 {
|
||||
margin-right: 5px !important;
|
||||
}
|
||||
|
||||
.mr-10 {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.ml-5 {
|
||||
margin-left: 5px !important;
|
||||
}
|
||||
|
||||
.ml-10 {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
.ml-15 {
|
||||
margin-left: 15px !important;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.overflow {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.box_shadow {
|
||||
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||
}
|
||||
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #f7f7f7;
|
||||
}
|
||||
.borderR {
|
||||
border-right: 1px solid #f7f7f7;
|
||||
}
|
||||
|
||||
.nolist {
|
||||
margin-top: 40%;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
text {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.btn {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.endtext {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
padding: 15px 0;
|
||||
}
|
||||
//
|
||||
.groupBtn {
|
||||
display: flex;
|
||||
|
||||
.del {
|
||||
color: $btncolor !important;
|
||||
background-color: #ffe4b8 !important;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background-color: $btncolor;
|
||||
width: 45%;
|
||||
margin: 10px auto 15px;
|
||||
text-align: center;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
//
|
||||
.wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
// 信息
|
||||
.edit {
|
||||
width: 15rem;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
margin: auto;
|
||||
z-index: 99999;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.editem {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
background: #eee;
|
||||
padding: 0px 10px;
|
||||
align-items: center;
|
||||
|
||||
.radioimg {
|
||||
font-size: 22px;
|
||||
color: $btncolor;
|
||||
}
|
||||
|
||||
.radio {
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 4rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
input {
|
||||
margin-right: 10px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
picker {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.value {
|
||||
position: relative;
|
||||
z-index: 999;
|
||||
width: 3rem;
|
||||
text-align: center;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
margin-left: 10px;
|
||||
float: right;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 0.75rem;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 报告页
|
||||
.myinfoPage {
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
margin-top: 10px;
|
||||
padding-bottom: 15px;
|
||||
border-radius: 10px;
|
||||
|
||||
.box1 {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
border-radius: 10px;
|
||||
font-size: 14px;
|
||||
position: relative;
|
||||
margin: 0px 15px 0;
|
||||
padding-bottom: 10px;
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: #666;
|
||||
padding: 0;
|
||||
line-height: 50px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
image,
|
||||
.t-icon {
|
||||
width: 18px !important;
|
||||
height: 18px;
|
||||
border: 2px solid #c7c7c7;
|
||||
background-color: #c7c7c7;
|
||||
border-radius: 50%;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.block {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
position: relative;
|
||||
|
||||
.level,
|
||||
.val {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 40%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 20px;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
|
||||
image {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
line-height: 20px;
|
||||
text-align: left;
|
||||
width: calc(100% - 20px);
|
||||
height: auto;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
padding: 10px;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
}
|
||||
|
||||
.statuevue {
|
||||
height: 35px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
margin: 20px auto 10px;
|
||||
|
||||
.bi {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: auto;
|
||||
padding-top: 10px;
|
||||
|
||||
.peobox {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: -1px;
|
||||
|
||||
.xx {
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
z-index: 9;
|
||||
border: 2px solid #1b2086;
|
||||
top: 9px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
flex: 1;
|
||||
height: 5px;
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
|
||||
.span1 {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: -23px;
|
||||
}
|
||||
|
||||
.span {
|
||||
margin-top: 8px;
|
||||
position: absolute;
|
||||
right: -8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.yuanxing {
|
||||
display: inline-block;
|
||||
background: #f19601;
|
||||
width: 8px;
|
||||
height: 12px;
|
||||
margin-right: 5px;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.btnf {
|
||||
font-size: 13px;
|
||||
border-radius: 5px;
|
||||
height: 22px;
|
||||
margin: 0 10px 0 0;
|
||||
line-height: 22px;
|
||||
color: #fff;
|
||||
font-weight: 400;
|
||||
width: 44px !important;
|
||||
text-align: center !important;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.tivon {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
|
||||
.bianji {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.box1 :last-child.list {
|
||||
.val {
|
||||
width: 25% !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.kcalClass {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
line-height: 55px;
|
||||
margin: -20px auto;
|
||||
}
|
||||
|
||||
.yichang {
|
||||
background: #ffe4be;
|
||||
color: #ff4239;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
border-radius: 5px;
|
||||
margin: 0 15px 10px;
|
||||
}
|
||||
}
|
||||
//选择对比
|
||||
.calendar {
|
||||
background: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
|
||||
.box {
|
||||
margin-bottom: 305px;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin: 15px;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
padding: 10px 15px;
|
||||
border-radius: 10px;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
|
||||
view {
|
||||
width: 32%;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
text {
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
display: block;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.check {
|
||||
width: 35px !important;
|
||||
|
||||
.icon-kongradio {
|
||||
font-size: 22px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.icon-radio {
|
||||
font-size: 22px;
|
||||
color: #FCA82D;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
text {
|
||||
font-size: 14px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
margin: 0;
|
||||
width: auto;
|
||||
position: fixed;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
z-index: 9;
|
||||
padding: 0 10px 10px;
|
||||
background: #fff;
|
||||
border-radius: 0;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
|
||||
.btn {
|
||||
width: auto;
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin: 10px 0;
|
||||
height: 120rpx;
|
||||
position: relative;
|
||||
|
||||
.item {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.time {
|
||||
float: left;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
color: #fea82d;
|
||||
font-weight: 700;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.check {
|
||||
position: absolute;
|
||||
right: -5px;
|
||||
top: -5px;
|
||||
width: 25px;
|
||||
|
||||
.icon-quxiao {
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.pkclass {
|
||||
position: absolute;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: $greencolor;
|
||||
border-radius: 50%;
|
||||
line-height: 27px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 19px;
|
||||
left: 30px;
|
||||
top: 120rpx;
|
||||
}
|
||||
|
||||
.btn.active {
|
||||
border: none;
|
||||
color: #333 !important;
|
||||
background-color: #DFDFDF !important;
|
||||
display: block;
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
// 对比详情
|
||||
.pkconp {
|
||||
background: #f7f7f7;
|
||||
min-height: 100vh;
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
padding: 15px 15px 10px;
|
||||
margin: 15px;
|
||||
border-radius: 10px 10px 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.name {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 55px;
|
||||
height: 55px;
|
||||
border-radius: 50%;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.pkclass {
|
||||
position: absolute;
|
||||
background: linear-gradient(to right, #ff99ae, #ffb2c2);
|
||||
right: 15px;
|
||||
padding: 0px 10px;
|
||||
border-radius: 10px;
|
||||
color: #fff;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
color: #999;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
background: #ffff;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
padding: 15px 0;
|
||||
margin: 15px;
|
||||
border-radius: 0 0 10px 10px;
|
||||
|
||||
.item {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
width: 33.3%;
|
||||
line-height: 26px;
|
||||
border-right: 1px solid #f7f7f7;
|
||||
box-sizing: border-box;
|
||||
|
||||
view {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.control {
|
||||
background: #fff;
|
||||
margin: 15px;
|
||||
display: flex;
|
||||
border: 1px solid #F0F0F0;
|
||||
border-radius: 10px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
view {
|
||||
width: 22%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 33%;
|
||||
}
|
||||
}
|
||||
|
||||
.li {
|
||||
display: flex;
|
||||
margin: 0 10px;
|
||||
justify-content: space-between;
|
||||
height: 54px;
|
||||
border-top: 1px solid #eee;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
.name {
|
||||
width: 33%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
width: 22%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.f,
|
||||
.f0 {
|
||||
width: 22%;
|
||||
text-align: center;
|
||||
|
||||
text {
|
||||
display: block;
|
||||
width: 100%;
|
||||
color: #999999;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
.f0 {
|
||||
text {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
border-top: 1px solid #f0f0f0;
|
||||
width: 100%;
|
||||
padding: 15px 15px 0;
|
||||
margin-top: 5px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.yuanxing {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,497 @@
|
|||
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* Project id 4167504 */
|
||||
src:
|
||||
url('https://at.alicdn.com/t/c/font_4167504_bg5bsdomfp.woff2?t=1704421191438') format('woff2'),
|
||||
url('https://at.alicdn.com/t/c/font_4167504_bg5bsdomfp.woff?t=1704421191438') format('woff'),
|
||||
url('https://at.alicdn.com/t/c/font_4167504_bg5bsdomfp.ttf?t=1704421191438') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-beibu:before {
|
||||
content: "\e611";
|
||||
}
|
||||
|
||||
.icon-yaotunbizice:before {
|
||||
content: "\e684";
|
||||
}
|
||||
|
||||
.icon-xiongwaike:before {
|
||||
content: "\e67e";
|
||||
}
|
||||
|
||||
.icon-fat:before {
|
||||
content: "\e63d";
|
||||
}
|
||||
|
||||
.icon-lbm:before {
|
||||
content: "\e62a";
|
||||
}
|
||||
|
||||
.icon-fat_r:before {
|
||||
content: "\e62c";
|
||||
}
|
||||
|
||||
.icon-fat_w:before {
|
||||
content: "\e78e";
|
||||
}
|
||||
|
||||
.icon-bone:before {
|
||||
content: "\e610";
|
||||
}
|
||||
|
||||
.icon-weight:before {
|
||||
content: "\e60a";
|
||||
}
|
||||
|
||||
.icon-bmi:before {
|
||||
content: "\e785";
|
||||
}
|
||||
|
||||
.icon-cellin:before {
|
||||
content: "\e7a9";
|
||||
}
|
||||
|
||||
.icon-kcal:before {
|
||||
content: "\e607";
|
||||
}
|
||||
|
||||
.icon-visceral:before {
|
||||
content: "\e60b";
|
||||
}
|
||||
|
||||
.icon-muscle:before {
|
||||
content: "\e60c";
|
||||
}
|
||||
|
||||
.icon-body:before {
|
||||
content: "\e639";
|
||||
}
|
||||
|
||||
.icon-water:before {
|
||||
content: "\e651";
|
||||
}
|
||||
|
||||
.icon-age:before {
|
||||
content: "\e60f";
|
||||
}
|
||||
|
||||
.icon-muscleval:before {
|
||||
content: "\e949";
|
||||
}
|
||||
|
||||
.icon-protein:before {
|
||||
content: "\e94a";
|
||||
}
|
||||
|
||||
.icon-proteinval:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.icon-bodyage:before {
|
||||
content: "\e6b2";
|
||||
}
|
||||
|
||||
.icon-cellout:before {
|
||||
content: "\e68f";
|
||||
}
|
||||
|
||||
.icon-height:before {
|
||||
content: "\e6eb";
|
||||
}
|
||||
|
||||
.icon-sfrval:before {
|
||||
content: "\e652";
|
||||
}
|
||||
|
||||
.icon-sfr:before {
|
||||
content: "\e617";
|
||||
}
|
||||
|
||||
.icon-skeletalmuscle:before {
|
||||
content: "\e6af";
|
||||
}
|
||||
|
||||
.icon-inorganic:before {
|
||||
content: "\e61c";
|
||||
}
|
||||
|
||||
.icon-yiqingjia-:before {
|
||||
content: "\e6a4";
|
||||
}
|
||||
|
||||
.icon-yidongjie:before {
|
||||
content: "\e632";
|
||||
}
|
||||
|
||||
.icon-zu:before {
|
||||
content: "\e630";
|
||||
}
|
||||
|
||||
.icon-yidaodian:before {
|
||||
content: "\e6d2";
|
||||
}
|
||||
|
||||
.icon-weidaodian:before {
|
||||
content: "\e6d4";
|
||||
}
|
||||
|
||||
.icon-yiwancheng:before {
|
||||
content: "\e68c";
|
||||
}
|
||||
|
||||
.icon-icon-test-copy:before {
|
||||
content: "\fbdf";
|
||||
}
|
||||
|
||||
.icon-icon-test:before {
|
||||
content: "\e664";
|
||||
}
|
||||
|
||||
.icon-icon-test1:before {
|
||||
content: "\e668";
|
||||
}
|
||||
|
||||
.icon-icon-test1-copy:before {
|
||||
content: "\fbe0";
|
||||
}
|
||||
|
||||
.icon-huangguan:before {
|
||||
content: "\e61a";
|
||||
}
|
||||
|
||||
.icon-huangguan1:before {
|
||||
content: "\e682";
|
||||
}
|
||||
|
||||
.icon-zanwushuju:before {
|
||||
content: "\e606";
|
||||
}
|
||||
|
||||
.icon-hexiao1:before {
|
||||
content: "\e85b";
|
||||
}
|
||||
|
||||
.icon-huiyuankabao:before {
|
||||
content: "\e63b";
|
||||
}
|
||||
|
||||
.icon-huizonganniu1:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.icon-yunying-zhuandian:before {
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
.icon-erweima:before {
|
||||
content: "\e7cb";
|
||||
}
|
||||
|
||||
.icon-fuzerenbaobiao:before {
|
||||
content: "\e626";
|
||||
}
|
||||
|
||||
.icon-shaixuan2:before {
|
||||
content: "\e647";
|
||||
}
|
||||
|
||||
.icon-zhihanghuizong:before {
|
||||
content: "\e60e";
|
||||
}
|
||||
|
||||
.icon-paihangbang:before {
|
||||
content: "\ed68";
|
||||
}
|
||||
|
||||
.icon-huiyuan_cika:before {
|
||||
content: "\e624";
|
||||
}
|
||||
|
||||
.icon-huiyuanzhongxin-shouye:before {
|
||||
content: "\e66d";
|
||||
}
|
||||
|
||||
.icon-biaoshi:before {
|
||||
content: "\e60d";
|
||||
}
|
||||
|
||||
.icon-huiyuanka:before {
|
||||
content: "\e618";
|
||||
}
|
||||
|
||||
.icon-shishiyujing-changgui:before {
|
||||
content: "\e62f";
|
||||
}
|
||||
|
||||
.icon-yujing1:before {
|
||||
content: "\e69d";
|
||||
}
|
||||
|
||||
.icon-yujingshezhi:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.icon-tongpai1:before {
|
||||
content: "\e7c8";
|
||||
}
|
||||
|
||||
.icon-lilunzhongliang:before {
|
||||
content: "\e759";
|
||||
}
|
||||
|
||||
.icon-huiyuan:before {
|
||||
content: "\e8b1";
|
||||
}
|
||||
|
||||
.icon-loudoutu-junyun:before {
|
||||
content: "\e6d3";
|
||||
}
|
||||
|
||||
.icon-yinpai:before {
|
||||
content: "\e600";
|
||||
}
|
||||
|
||||
.icon-zhuandian:before {
|
||||
content: "\e608";
|
||||
}
|
||||
|
||||
.icon-kechengzhouqi:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-qingjia:before {
|
||||
content: "\e7d8";
|
||||
}
|
||||
|
||||
.icon-disanming1:before {
|
||||
content: "\e64a";
|
||||
}
|
||||
|
||||
.icon-jianzhishoushen:before {
|
||||
content: "\e6b3";
|
||||
}
|
||||
|
||||
.icon-diyiming:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
||||
.icon-diyiming1:before {
|
||||
content: "\e613";
|
||||
}
|
||||
|
||||
.icon-a-zu8272:before {
|
||||
content: "\e619";
|
||||
}
|
||||
|
||||
.icon-adduser:before {
|
||||
content: "\e7ae";
|
||||
}
|
||||
|
||||
.icon-shang:before {
|
||||
content: "\fbde";
|
||||
}
|
||||
|
||||
.icon-chuangzuo:before {
|
||||
content: "\e8ad";
|
||||
}
|
||||
|
||||
.icon-nan:before {
|
||||
content: "\e8b3";
|
||||
}
|
||||
|
||||
.icon-nv:before {
|
||||
content: "\e8b4";
|
||||
}
|
||||
|
||||
.icon-wodeguanzhu:before {
|
||||
content: "\e8bc";
|
||||
}
|
||||
|
||||
.icon-chuangzuo1:before {
|
||||
content: "\e8ca";
|
||||
}
|
||||
|
||||
.icon-meh:before {
|
||||
content: "\e677";
|
||||
}
|
||||
|
||||
.icon-meh-filling:before {
|
||||
content: "\e68b";
|
||||
}
|
||||
|
||||
.icon-sorting:before {
|
||||
content: "\e68d";
|
||||
}
|
||||
|
||||
.icon-fubu:before {
|
||||
content: "\e81f";
|
||||
}
|
||||
|
||||
.icon-a-dingwei2:before {
|
||||
content: "\e61e";
|
||||
}
|
||||
|
||||
.icon-bianji:before {
|
||||
content: "\e622";
|
||||
}
|
||||
|
||||
.icon-xiala:before {
|
||||
content: "\e623";
|
||||
}
|
||||
|
||||
.icon-error:before {
|
||||
content: "\e839";
|
||||
}
|
||||
|
||||
.icon-delete-fill:before {
|
||||
content: "\e83a";
|
||||
}
|
||||
|
||||
.icon-calendar:before {
|
||||
content: "\e83b";
|
||||
}
|
||||
|
||||
.icon-cry-fill:before {
|
||||
content: "\e83c";
|
||||
}
|
||||
|
||||
.icon-error-fill:before {
|
||||
content: "\e83d";
|
||||
}
|
||||
|
||||
.icon-favorites-fill:before {
|
||||
content: "\e83e";
|
||||
}
|
||||
|
||||
.icon-calendar-fill:before {
|
||||
content: "\e83f";
|
||||
}
|
||||
|
||||
.icon-favorites:before {
|
||||
content: "\e840";
|
||||
}
|
||||
|
||||
.icon-down:before {
|
||||
content: "\e841";
|
||||
}
|
||||
|
||||
.icon-close:before {
|
||||
content: "\e842";
|
||||
}
|
||||
|
||||
.icon-delete:before {
|
||||
content: "\e843";
|
||||
}
|
||||
|
||||
.icon-follow:before {
|
||||
content: "\e844";
|
||||
}
|
||||
|
||||
.icon-follow-fill:before {
|
||||
content: "\e845";
|
||||
}
|
||||
|
||||
.icon-left:before {
|
||||
content: "\e846";
|
||||
}
|
||||
|
||||
.icon-info-fill:before {
|
||||
content: "\e847";
|
||||
}
|
||||
|
||||
.icon-info:before {
|
||||
content: "\e848";
|
||||
}
|
||||
|
||||
.icon-location-fill:before {
|
||||
content: "\e849";
|
||||
}
|
||||
|
||||
.icon-right:before {
|
||||
content: "\e84a";
|
||||
}
|
||||
|
||||
.icon-selected:before {
|
||||
content: "\e84b";
|
||||
}
|
||||
|
||||
.icon-remind-fill:before {
|
||||
content: "\e84c";
|
||||
}
|
||||
|
||||
.icon-return:before {
|
||||
content: "\e84d";
|
||||
}
|
||||
|
||||
.icon-search:before {
|
||||
content: "\e84e";
|
||||
}
|
||||
|
||||
.icon-scan:before {
|
||||
content: "\e84f";
|
||||
}
|
||||
|
||||
.icon-smile-fill:before {
|
||||
content: "\e850";
|
||||
}
|
||||
|
||||
.icon-settings-fill:before {
|
||||
content: "\e851";
|
||||
}
|
||||
|
||||
.icon-up:before {
|
||||
content: "\e852";
|
||||
}
|
||||
|
||||
.icon-warning-fill:before {
|
||||
content: "\e853";
|
||||
}
|
||||
|
||||
.icon-phone-fill:before {
|
||||
content: "\e85f";
|
||||
}
|
||||
|
||||
.icon-phone:before {
|
||||
content: "\e860";
|
||||
}
|
||||
|
||||
.icon-quick-fill:before {
|
||||
content: "\e863";
|
||||
}
|
||||
|
||||
.icon-quick:before {
|
||||
content: "\e864";
|
||||
}
|
||||
|
||||
.icon-abdomen:before {
|
||||
content: "\e670";
|
||||
}
|
||||
|
||||
.icon-lower-leg:before {
|
||||
content: "\e671";
|
||||
}
|
||||
|
||||
.icon-ram:before {
|
||||
content: "\e672";
|
||||
}
|
||||
|
||||
.icon-datui:before {
|
||||
content: "\e638";
|
||||
}
|
||||
|
||||
.icon-yujing:before {
|
||||
content: "\e726";
|
||||
}
|
||||
|
||||
.icon-jisuanqi:before {
|
||||
content: "\fbdd";
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,396 @@
|
|||
{
|
||||
"selectllist": [{
|
||||
"id": "1",
|
||||
"size": "big",
|
||||
"unit": "个",
|
||||
"name": "跳绳数据",
|
||||
"time": "2024/2/29",
|
||||
"taketime": "00:05:03",
|
||||
"cnt": "20",
|
||||
"averagecnt": "48",
|
||||
"kcal": "4250",
|
||||
"detailurl": "/pages/skipping/skipping",
|
||||
"Tutorialurl": "",
|
||||
"standardtext": "达标",
|
||||
"standardcolor": "#4DA2CA"
|
||||
}],
|
||||
"addlist": [{
|
||||
"id": "2",
|
||||
"size": "small",
|
||||
"name": "肺活量",
|
||||
"unit": "ml",
|
||||
"time": "2024/2/29",
|
||||
"taketime": "00:05:03",
|
||||
"cnt": "20",
|
||||
"averagecnt": "48",
|
||||
"kcal": "4250",
|
||||
"detailurl": "",
|
||||
"Tutorialurl": "",
|
||||
"standardtext": "达标",
|
||||
"standardcolor": "#EC808D"
|
||||
}],
|
||||
"TrendList": [{
|
||||
"id": "08dbd378-27d1-42d2-87fc-dca513adb60f",
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"createtime": "2023-10-23",
|
||||
"bmi": 24.60,
|
||||
"weight": 78.00,
|
||||
"height": 178.00,
|
||||
"time": "2023-10-23 11:28"
|
||||
}, {
|
||||
"id": "08dbd378-20a5-4991-84f4-a9702018f416",
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"createtime": "2023-10-23",
|
||||
"bmi": 23.60,
|
||||
"weight": 75.00,
|
||||
"height": 178.00,
|
||||
"time": "2023-10-23 11:28"
|
||||
}, {
|
||||
"id": "08dbd378-1992-47be-8971-a99543d68e26",
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"createtime": "2023-10-23",
|
||||
"bmi": 25.20,
|
||||
"weight": 80.00,
|
||||
"height": 178.00,
|
||||
"time": "2023-10-23 11:28"
|
||||
}, {
|
||||
"id": "08dbd377-eb1c-426c-8ceb-294f45773aca",
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"createtime": "2023-10-23",
|
||||
"bmi": 26.80,
|
||||
"weight": 85.00,
|
||||
"height": 178.00,
|
||||
"time": "2023-10-23 11:27"
|
||||
}, {
|
||||
"id": "08dbd377-a553-4543-8231-086b3a71ed0a",
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"createtime": "2023-10-23",
|
||||
"bmi": 22.00,
|
||||
"weight": 70.00,
|
||||
"height": 178.00,
|
||||
"time": "2023-10-23 11:25"
|
||||
}],
|
||||
"historylist": [{
|
||||
"createtime": "2023-10-23 11:28:42.0000000",
|
||||
"month": 0,
|
||||
"id": "08dbd378-27d1-42d2-87fc-dca513adb60f",
|
||||
"height": 178.00,
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"water": 0.00,
|
||||
"bone": 0.00,
|
||||
"kcal": 0.00,
|
||||
"fat_w": 0.00,
|
||||
"visceral": 0.00,
|
||||
"protein": 0.00,
|
||||
"bodyage": 0,
|
||||
"bmi": 24.60,
|
||||
"cmi": 87.80,
|
||||
"sfr": 0.00,
|
||||
"sfrval": 0.0,
|
||||
"muscleval": 0.00,
|
||||
"proteinval": 0.00,
|
||||
"lbm": 78.00,
|
||||
"body": "异常",
|
||||
"fatlevel": "偏重",
|
||||
"weight": 78.00,
|
||||
"age": "28岁",
|
||||
"idealweight": 0.0,
|
||||
"skeletalmuscle": 0.0
|
||||
}, {
|
||||
"createtime": "2023-10-23 11:28:30.0000000",
|
||||
"month": 0,
|
||||
"id": "08dbd378-20a5-4991-84f4-a9702018f416",
|
||||
"height": 178.00,
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"water": 0.00,
|
||||
"bone": 0.00,
|
||||
"kcal": 0.00,
|
||||
"fat_w": 0.00,
|
||||
"visceral": 0.00,
|
||||
"protein": 0.00,
|
||||
"bodyage": 0,
|
||||
"bmi": 23.60,
|
||||
"cmi": 91.50,
|
||||
"sfr": 0.00,
|
||||
"sfrval": 0.0,
|
||||
"muscleval": 0.00,
|
||||
"proteinval": 0.00,
|
||||
"lbm": 75.00,
|
||||
"body": "异常",
|
||||
"fatlevel": "标准",
|
||||
"weight": 75.00,
|
||||
"age": "28岁",
|
||||
"idealweight": 0.0,
|
||||
"skeletalmuscle": 0.0
|
||||
}, {
|
||||
"createtime": "2023-10-23 11:28:18.0000000",
|
||||
"month": 0,
|
||||
"id": "08dbd378-1992-47be-8971-a99543d68e26",
|
||||
"height": 178.00,
|
||||
"fat_r": 0.00,
|
||||
"muscle": 0.00,
|
||||
"water": 0.00,
|
||||
"bone": 0.00,
|
||||
"kcal": 0.00,
|
||||
"fat_w": 0.00,
|
||||
"visceral": 0.00,
|
||||
"protein": 0.00,
|
||||
"bodyage": 0,
|
||||
"bmi": 25.20,
|
||||
"cmi": 85.70,
|
||||
"sfr": 0.00,
|
||||
"sfrval": 0.0,
|
||||
"muscleval": 0.00,
|
||||
"proteinval": 0.00,
|
||||
"lbm": 80.00,
|
||||
"body": "异常",
|
||||
"fatlevel": "偏重",
|
||||
"weight": 80.00,
|
||||
"age": "28岁",
|
||||
"idealweight": 0.0,
|
||||
"skeletalmuscle": 0.0
|
||||
}, {
|
||||
"createtime": "2023-09-26 15:03:12.3740116",
|
||||
"month": 0,
|
||||
"id": "08dbbe5e-a5f7-4ca0-8b44-0ddd8f7f15cd",
|
||||
"height": 162.50,
|
||||
"fat_r": 23.60,
|
||||
"muscle": 72.40,
|
||||
"water": 59.20,
|
||||
"bone": 2.40,
|
||||
"kcal": 1227.00,
|
||||
"fat_w": 11.63,
|
||||
"visceral": 2.00,
|
||||
"protein": 12.90,
|
||||
"bodyage": 26,
|
||||
"bmi": 18.60,
|
||||
"cmi": 86.10,
|
||||
"sfr": 22.30,
|
||||
"sfrval": 0.0,
|
||||
"muscleval": 35.69,
|
||||
"proteinval": 6.35,
|
||||
"lbm": 37.66,
|
||||
"body": "标准肌肉型",
|
||||
"fatlevel": "偏瘦",
|
||||
"weight": 49.30,
|
||||
"age": "28岁",
|
||||
"idealweight": 0.0,
|
||||
"skeletalmuscle": 0.0
|
||||
}],
|
||||
"infoList": [{
|
||||
"value": 163.00,
|
||||
"desc": "人体纵向部分的长度,源于人体的纵向生长,受遗传因素的影响较大",
|
||||
"offset": "0",
|
||||
"color": "",
|
||||
"scale": 0,
|
||||
"ishasscale": false,
|
||||
"level": "",
|
||||
"list": [],
|
||||
"title": "身高",
|
||||
"unit": "cm",
|
||||
"name": "height"
|
||||
}, {
|
||||
"value": 50.23,
|
||||
"desc": "反映和衡量一个人健康状况的重要标志之一",
|
||||
"offset": "0",
|
||||
"color": "",
|
||||
"scale": 0,
|
||||
"ishasscale": false,
|
||||
"level": "",
|
||||
"list": [],
|
||||
"title": "体重",
|
||||
"unit": "kg",
|
||||
"name": "weight"
|
||||
}, {
|
||||
"value": 18.90,
|
||||
"desc": "BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准。",
|
||||
"offset": "26.5",
|
||||
"color": "#5ad06d",
|
||||
"scale": 0,
|
||||
"ishasscale": false,
|
||||
"level": "正常",
|
||||
"name": "bmi",
|
||||
"title": "BMI",
|
||||
"list": [{
|
||||
"maxvalue": 18.5,
|
||||
"minvalue": 0.0,
|
||||
"text": "消瘦",
|
||||
"color": "#ffda69",
|
||||
"level": 0
|
||||
}, {
|
||||
"maxvalue": 25.0,
|
||||
"minvalue": 18.5,
|
||||
"text": "正常",
|
||||
"color": "#5ad06d",
|
||||
"level": 0
|
||||
}, {
|
||||
"maxvalue": 30.0,
|
||||
"minvalue": 25.0,
|
||||
"text": "偏重",
|
||||
"color": "#ffab00",
|
||||
"level": 0
|
||||
}, {
|
||||
"maxvalue": 50.0,
|
||||
"minvalue": 30.0,
|
||||
"text": "肥胖",
|
||||
"color": "#ff5656",
|
||||
"level": 0
|
||||
}]
|
||||
}],
|
||||
"contrastList": [{
|
||||
"height": 165.00,
|
||||
"weight": 52.70,
|
||||
"head": 0.00,
|
||||
"sex": 1,
|
||||
"age": "29岁",
|
||||
"fat_r": 14.10,
|
||||
"muscle": 81.35,
|
||||
"water": 34.17,
|
||||
"bone": 2.40,
|
||||
"kcal": 1311.00,
|
||||
"fat_w": 7.43,
|
||||
"visceral": 2.00,
|
||||
"protein": 16.50,
|
||||
"bodyage": 28,
|
||||
"bmi": 19.30,
|
||||
"cmi": 89.35,
|
||||
"sfr": 12.70,
|
||||
"muscleval": 42.87,
|
||||
"proteinval": 8.70,
|
||||
"lbm": 45.27,
|
||||
"body": "标准肌肉型",
|
||||
"fatlevel": "偏瘦",
|
||||
"skeletalmuscle": 0.00,
|
||||
"createtime": "2024/03/24",
|
||||
"yeartime": "2024/03/24",
|
||||
"id": "08dc4e20-f1c5-416c-84ca-5aa26925eb81"
|
||||
}, {
|
||||
"height": 175.90,
|
||||
"weight": 64.50,
|
||||
"head": 0.00,
|
||||
"sex": 1,
|
||||
"age": "29岁",
|
||||
"fat_r": 18.00,
|
||||
"muscle": 77.66,
|
||||
"water": 39.90,
|
||||
"bone": 2.80,
|
||||
"kcal": 1514.00,
|
||||
"fat_w": 11.61,
|
||||
"visceral": 3.00,
|
||||
"protein": 15.80,
|
||||
"bodyage": 28,
|
||||
"bmi": 21.00,
|
||||
"cmi": 97.22,
|
||||
"sfr": 16.10,
|
||||
"muscleval": 50.09,
|
||||
"proteinval": 10.19,
|
||||
"lbm": 52.89,
|
||||
"body": "标准肌肉型",
|
||||
"fatlevel": "标准",
|
||||
"skeletalmuscle": 0.00,
|
||||
"createtime": "2023/04/04",
|
||||
"yeartime": "2023/04/04",
|
||||
"id": "08db34b7-60c0-4571-8e66-29157695b9a9"
|
||||
}],
|
||||
"contrastDetail": {
|
||||
"time": "2023/04/04-2024/03/24",
|
||||
"headimg": "https://klcz.pcxbc.com/image/adult_male.png",
|
||||
"name": "成人",
|
||||
"gender": 1,
|
||||
"day": 355,
|
||||
"weightdiff": -11.80,
|
||||
"heightdiff": -10.90,
|
||||
"fat_wdiff": -3.90,
|
||||
"firstresult": {
|
||||
"age": "1994-04-04 00:00:00",
|
||||
"height": 175.90,
|
||||
"head": 0.00,
|
||||
"weight": 64.50,
|
||||
"fat_r": 18.00,
|
||||
"muscle": 77.66,
|
||||
"water": 39.90,
|
||||
"bone": 2.80,
|
||||
"kcal": 1514.00,
|
||||
"fat_w": 11.61,
|
||||
"visceral": 3.00,
|
||||
"protein": 15.80,
|
||||
"bodyage": 28,
|
||||
"bmi": 21.00,
|
||||
"cmi": 97.22,
|
||||
"sfr": 16.10,
|
||||
"muscleval": 50.09,
|
||||
"proteinval": 10.19,
|
||||
"lbm": 52.89,
|
||||
"body": "标准肌肉型",
|
||||
"fatlevel": "标准",
|
||||
"skeletalmuscle": 0.00,
|
||||
"createtime": "2023-04-04 00:00:00",
|
||||
"heightlevel": "",
|
||||
"headlevel": null,
|
||||
"weightlevel": "",
|
||||
"fat_rlevel": "标准",
|
||||
"musclelevel": "优秀",
|
||||
"waterlevel": "不足",
|
||||
"bonelevel": "不足",
|
||||
"kcallevel": "偏低",
|
||||
"fat_wlevel": "标准",
|
||||
"viscerallevel": "标准",
|
||||
"proteinlevel": "异常",
|
||||
"bodyagelevel": "优秀",
|
||||
"bmilevel": "正常",
|
||||
"musulevallevel": "优秀",
|
||||
"proteinvallevel": "不足",
|
||||
"sfrlevel": "异常",
|
||||
"bodylevel": "标准肌肉型"
|
||||
},
|
||||
"secondresult": {
|
||||
"age": "1994-04-04 00:00:00",
|
||||
"height": 165.00,
|
||||
"head": 0.00,
|
||||
"weight": 52.70,
|
||||
"fat_r": 14.10,
|
||||
"muscle": 81.35,
|
||||
"water": 34.17,
|
||||
"bone": 2.40,
|
||||
"kcal": 1311.00,
|
||||
"fat_w": 7.43,
|
||||
"visceral": 2.00,
|
||||
"protein": 16.50,
|
||||
"bodyage": 28,
|
||||
"bmi": 19.30,
|
||||
"cmi": 89.35,
|
||||
"sfr": 12.70,
|
||||
"muscleval": 42.87,
|
||||
"proteinval": 8.70,
|
||||
"lbm": 45.27,
|
||||
"body": "标准肌肉型",
|
||||
"fatlevel": "偏瘦",
|
||||
"skeletalmuscle": 0.00,
|
||||
"createtime": "2024-03-24 00:00:00",
|
||||
"heightlevel": "",
|
||||
"headlevel": null,
|
||||
"weightlevel": "",
|
||||
"fat_rlevel": "标准",
|
||||
"musclelevel": "优秀",
|
||||
"waterlevel": "不足",
|
||||
"bonelevel": "标准",
|
||||
"kcallevel": "偏低",
|
||||
"fat_wlevel": "标准",
|
||||
"viscerallevel": "标准",
|
||||
"proteinlevel": "异常",
|
||||
"bodyagelevel": "优秀",
|
||||
"bmilevel": "正常",
|
||||
"musulevallevel": "优秀",
|
||||
"proteinvallevel": "标准",
|
||||
"sfrlevel": "异常",
|
||||
"bodylevel": "标准肌肉型"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,402 @@
|
|||
<template>
|
||||
<view class="rpickerBox" v-if="show">
|
||||
<view class="pickerMask" @click="maskClick">
|
||||
<view class="r-dtpicker r-dtpicker-show" @click.stop>
|
||||
<view class="rdtBtn">
|
||||
<view @click="pickerCancel">取消</view>
|
||||
<view>选择日期</view>
|
||||
<view class="bluecolor" @click="pickerConfirm">确定</view>
|
||||
</view>
|
||||
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view" :value="startValue"
|
||||
@change="startChangeMul" :style="{'width':type==2?'calc(50% - 1px)':'100%'}">
|
||||
<block>
|
||||
<picker-view-column>
|
||||
<view class="picker-item" v-for="(item,index) in startyearArr" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column v-if="fields!='year'">
|
||||
<view class="picker-item" v-for="(item,index) in startmonthArr" :key="index">{{item}}月
|
||||
</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column v-if="fields=='day'">
|
||||
<view class="picker-item" v-for="(item,index) in startdayArr" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
</block>
|
||||
</picker-view>
|
||||
<picker-view indicator-style="height: 40px;" class="mpvue-picker-view mpvue-picker-view2"
|
||||
:value="endValue" @change="endChangeMul" v-if="type==2">
|
||||
<block>
|
||||
<picker-view-column>
|
||||
<view class="picker-item" v-for="(item,index) in endyearArr" :key="index">{{item}}年</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="picker-item" v-for="(item,index) in endmonthArr" :key="index">{{item}}月</view>
|
||||
</picker-view-column>
|
||||
<picker-view-column>
|
||||
<view class="picker-item" v-for="(item,index) in enddayArr" :key="index">{{item}}日</view>
|
||||
</picker-view-column>
|
||||
</block>
|
||||
</picker-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
nextTick
|
||||
} from "vue";
|
||||
export default {
|
||||
name: 'range-dtpicker',
|
||||
props: {
|
||||
fields: {
|
||||
type: String,
|
||||
default: 'day'
|
||||
},
|
||||
value: {
|
||||
type: Array,
|
||||
default () {
|
||||
return [0, 0]
|
||||
}
|
||||
},
|
||||
//是否显示
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
// 单双排日历显示
|
||||
type: {
|
||||
type: Number,
|
||||
default: 1 //1单2双
|
||||
},
|
||||
//服务日期/成交日期
|
||||
name: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
end: {
|
||||
type: String,
|
||||
default: ""
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
startValue: this.fields == 'year' ? [0] : this.fields == 'month' ? [0, 0] : [0, 0, 0], //开始日期数组下标
|
||||
endValue: this.fields == 'year' ? [0] : this.fields == 'month' ? [0, 0] : [0, 0, 0], //结束日期数组下标
|
||||
startDate: '', //开始日期字符
|
||||
endDate: "", //结束日期字符
|
||||
start: "1873-01-01", //日历起始日期
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(value) {
|
||||
this.value = value;
|
||||
this.init()
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
getStart() {
|
||||
return this.end ? this.end : this.$tools.getDate('start')
|
||||
},
|
||||
startyearArr() {
|
||||
let that = this
|
||||
return that.yearArr(parseInt(that.start.slice(0, 4)), parseInt(that.getStart.slice(0, 4)))
|
||||
},
|
||||
endyearArr() {
|
||||
let that = this
|
||||
return that.type == 2 ? that.yearArr(parseInt(that.start.slice(0, 4)), parseInt(that.getStart.slice(0,
|
||||
4))) : []
|
||||
},
|
||||
|
||||
startmonthArr() {
|
||||
let that = this
|
||||
return that.monthArr(that.getStart.slice(0, 4) == that.startDate.slice(0, 4) ? that.getStart.slice(5, 7) :
|
||||
12)
|
||||
},
|
||||
endmonthArr() {
|
||||
let that = this
|
||||
return that.type == 2 ? that.monthArr(that.getStart.slice(0, 4) == that.endDate.slice(0, 4) ? that.getStart
|
||||
.slice(5, 7) : 12) : []
|
||||
},
|
||||
|
||||
startdayArr() {
|
||||
let that = this
|
||||
let isstart = (that.getStart.slice(0, 4) == that.startDate.slice(0, 4) && that.startDate.slice(5, 7) ==
|
||||
that.getStart.slice(5, 7)) ? true : false
|
||||
return that.dayArr(that.value[0].slice(0, 4), that.startDate.slice(5, 7), isstart, that.getStart.slice(8,
|
||||
10))
|
||||
},
|
||||
enddayArr() {
|
||||
let that = this
|
||||
let isend = (that.type == 2 && that.getStart.slice(0, 4) == that.endDate.slice(0, 4) && that.endDate.slice(
|
||||
5, 7) ==
|
||||
that.getStart.slice(5, 7)) ? true : false
|
||||
|
||||
return that.type == 2 ? that.dayArr(that.value[1].slice(0, 4), that.endDate.slice(5, 7), isend, that
|
||||
.getStart.slice(8, 10)) : []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 初始化
|
||||
init() {
|
||||
var that = this,
|
||||
endVal = "",
|
||||
startVal = "";
|
||||
that.startDate = that.value[0];
|
||||
that.endDate = that.value[1];
|
||||
startVal = this.getIndex(this.value[0], 'start');
|
||||
endVal = that.type == 2 ? this.getIndex(this.value[1], 'end') : [];
|
||||
// console.log("init", this.value[0], this.value[1], startVal, endVal)
|
||||
if (startVal) setTimeout(function() {
|
||||
that.startValue = startVal
|
||||
that.endValue = endVal
|
||||
}, 20)
|
||||
},
|
||||
// 开始日期滑动
|
||||
startChangeMul(e) {
|
||||
let that = this
|
||||
const val = e.detail.value
|
||||
let year = that.startyearArr[val[0]]
|
||||
let month = that.startmonthArr[val[1]]
|
||||
let day = that.startdayArr[val[2]]
|
||||
that.startValue = e.detail.value
|
||||
that.startDate = this.fields == 'year' ? year : this.fields == 'month' ? year + '/' + month : year + '/' +
|
||||
month + '/' + day
|
||||
// console.log("开始", e.detail.value, that.startDate)
|
||||
},
|
||||
// 结束日期滑动
|
||||
endChangeMul(e) {
|
||||
let that = this
|
||||
const val = e.detail.value
|
||||
let year = that.endyearArr[val[0]]
|
||||
let month = that.endmonthArr[val[1]]
|
||||
let day = that.enddayArr[val[2]]
|
||||
that.endtValue = e.detail.value
|
||||
that.endDate = this.fields == 'year' ? year : this.fields == 'month' ? year + '/' + month : year + '/' +
|
||||
month + '/' + day
|
||||
// console.log("结束", e.detail.value, that.endDate)
|
||||
},
|
||||
// 确定选择
|
||||
pickerConfirm() {
|
||||
if (this.endDate < this.startDate) {
|
||||
uni.showToast({
|
||||
title: "结束时间不得小于开始时间",
|
||||
icon: "none",
|
||||
mask: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.$emit("change", [this.startDate, this.endDate], this.name);
|
||||
this.$emit("showchange", false);
|
||||
},
|
||||
// 取消设置
|
||||
pickerCancel() {
|
||||
this.$emit("cancel");
|
||||
this.$emit("showchange", false);
|
||||
},
|
||||
// 点击其他位置关闭弹框
|
||||
maskClick() {
|
||||
this.$emit("showchange", false);
|
||||
},
|
||||
// 年
|
||||
yearArr(start, end) {
|
||||
var arr = []
|
||||
for (var i = 0; i <= end - start; i++) {
|
||||
arr.push(start + i)
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 月
|
||||
monthArr(num) {
|
||||
var arr = [];
|
||||
for (var i = 1; i <= num; i++) {
|
||||
var v = i;
|
||||
if (v < 10) v = "0" + v;
|
||||
arr.push(v.toString())
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 日
|
||||
dayArr(year, month, isNew, day) {
|
||||
var arr = [],
|
||||
start = 1,
|
||||
end = 30,
|
||||
array = [],
|
||||
flag = year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)
|
||||
if (isNew) {
|
||||
end = day
|
||||
} else if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" ||
|
||||
month ==
|
||||
"10" || month == "12") {
|
||||
end = 31
|
||||
} else if (month == "04" || month == "06" || month == "09" || month == "11") {
|
||||
end = 30
|
||||
} else {
|
||||
if (flag) {
|
||||
end = 29
|
||||
|
||||
} else {
|
||||
end = 28
|
||||
}
|
||||
}
|
||||
for (var i = start; i <= end; i++) {
|
||||
array.push(i < 10 ? '0' + i : '' + i);
|
||||
}
|
||||
return array;
|
||||
},
|
||||
// 获取年月日的下标
|
||||
getIndex(value, type) {
|
||||
// console.log("index", value)
|
||||
var year = value.slice(0, 4),
|
||||
month = value.slice(5, 7),
|
||||
day = value.slice(8, 10),
|
||||
y = 0,
|
||||
m = 0,
|
||||
d = 0;
|
||||
|
||||
let yearArr = type == 'start' ? this.startyearArr : this.endyearArr,
|
||||
monthArr = type == 'start' ? this.startmonthArr : this.endmonthArr,
|
||||
dayArr = type == 'start' ? this.startdayArr : this.enddayArr;
|
||||
for (var i in yearArr) {
|
||||
if (year == yearArr[i]) {
|
||||
y = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i in monthArr) {
|
||||
if (month == monthArr[i]) {
|
||||
m = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (var i in dayArr) {
|
||||
if (day == dayArr[i]) {
|
||||
d = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var value = [];
|
||||
switch (this.fields) {
|
||||
case 'year':
|
||||
value = [Number(y)]
|
||||
break;
|
||||
case 'month':
|
||||
value = [Number(y), Number(m)]
|
||||
break;
|
||||
default:
|
||||
value = [Number(y), Number(m), Number(d)]
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.pickerMask {
|
||||
position: fixed;
|
||||
z-index: 999998;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.r-dtpicker {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
transition: all 0.3s ease;
|
||||
transform: translateY(100%);
|
||||
z-index: 999998;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.r-dtpicker-show {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.rdtBtn {
|
||||
display: flex;
|
||||
padding: 9px 15px;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.rdtBtn:after {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
height: 1px;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
color: #e5e5e5;
|
||||
transform-origin: 0 100%;
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
|
||||
.rdtBtn view {
|
||||
display: block;
|
||||
flex: 1;
|
||||
color: #1aad19;
|
||||
}
|
||||
|
||||
.rdtBtn view:first-child {
|
||||
text-align: left;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.rdtBtn view:last-child {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.picker-item {
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.mpvue-picker-view {
|
||||
position: relative;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: calc(50% - 1px);
|
||||
height: 238px;
|
||||
float: left;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.mpvue-picker-view2 {
|
||||
left: 1px;
|
||||
width: 50%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.rangeBox {
|
||||
background: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 15px 0;
|
||||
font-size: 16px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.rangeBox input {
|
||||
width: 180upx;
|
||||
margin: 0 10px;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
min-height: auto;
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,434 @@
|
|||
<template>
|
||||
<view class="calendar-wrapper">
|
||||
<view class="header">
|
||||
<view class="pre" @click="changeMonth('pre')">
|
||||
<uni-icons type="back"></uni-icons>
|
||||
</view>
|
||||
<view>{{y+'年'+formatNum(m)+'月'}}</view>
|
||||
<view class="next" @click="changeMonth('next')">
|
||||
<uni-icons type="forward"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="week">
|
||||
<view class="week-day" v-for="(item, index) in weekDay" :key="index">{{ item }}</view>
|
||||
</view>
|
||||
<view :class="{ hide: !monthOpen }" class="content0" :style="{ height: height }">
|
||||
<view :style="{ top: positionTop + 'rpx' }" class="days">
|
||||
<view class="item" v-for="(item, index) in dates" :key="index">
|
||||
<view class="day" @click="selectOne(item, $event)" :class="{
|
||||
choose: choose == `${item.year}-${item.month}-${item.date}`&&item.isCurM,
|
||||
nolm: !item.isCurM,
|
||||
today: isToday(item.year, item.month, item.date),
|
||||
isWorkDay: isWorkDay(item.year, item.month, item.date)
|
||||
}">
|
||||
{{ Number(item.date) }}
|
||||
</view>
|
||||
<view class="markDay" v-if="isMarkDay(item.year, item.month, item.date)&&item.isCurM"></view>
|
||||
<!-- <view class="today-text" v-if="isToday(item.year, item.month, item.date)">今</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<image src="https://i.loli.net/2020/07/16/2MmZsucVTlRjSwK.png" mode="scaleToFill" v-if="collapsible"
|
||||
@click="toggle" class="weektoggle" :class="{ down: monthOpen }"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ren-calendar',
|
||||
props: {
|
||||
// 星期几为第一天(0为星期日)
|
||||
weekstart: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
// 标记的日期
|
||||
markDays: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
//是否展示月份切换按钮
|
||||
headerBar: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 是否展开
|
||||
open: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
//是否可收缩
|
||||
collapsible: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
//未来日期是否不可点击
|
||||
disabledAfter: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
weektext: ['日', '一', '二', '三', '四', '五', '六'],
|
||||
y: new Date().getFullYear(), // 年
|
||||
m: new Date().getMonth() + 1, // 月
|
||||
dates: [], // 当前月的日期数据
|
||||
positionTop: 0,
|
||||
monthOpen: true,
|
||||
choose: '',
|
||||
month: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.dates = this.monthDay(this.y, this.m);
|
||||
!this.open && this.toggle();
|
||||
},
|
||||
mounted() {
|
||||
this.y = new Date().getFullYear()
|
||||
this.m = new Date().getMonth() + 1
|
||||
this.month = this.$tools.getDate("m")
|
||||
this.choose = this.getToday().date;
|
||||
},
|
||||
computed: {
|
||||
// 顶部星期栏
|
||||
weekDay() {
|
||||
return this.weektext.slice(this.weekstart).concat(this.weektext.slice(0, this.weekstart));
|
||||
},
|
||||
height() {
|
||||
return (this.dates.length / 7) * 80 + 'rpx';
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
formatNum(num) {
|
||||
let res = Number(num);
|
||||
return res < 10 ? '0' + res : res;
|
||||
},
|
||||
getToday() {
|
||||
let date = new Date();
|
||||
let y = date.getFullYear();
|
||||
let m = date.getMonth();
|
||||
let d = date.getDate();
|
||||
let week = new Date().getDay();
|
||||
let weekText = ['日', '一', '二', '三', '四', '五', '六'];
|
||||
let formatWeek = '星期' + weekText[week];
|
||||
let today = {
|
||||
date: y + '-' + this.formatNum(m + 1) + '-' + this.formatNum(d),
|
||||
week: formatWeek
|
||||
};
|
||||
return today;
|
||||
},
|
||||
// 获取当前月份数据
|
||||
monthDay(y, month) {
|
||||
let dates = [];
|
||||
let m = Number(month);
|
||||
let firstDayOfMonth = new Date(y, m - 1, 1).getDay(); // 当月第一天星期几
|
||||
let lastDateOfMonth = new Date(y, m, 0).getDate(); // 当月最后一天
|
||||
let lastDayOfLastMonth = new Date(y, m - 1, 0).getDate(); // 上一月的最后一天
|
||||
let weekstart = this.weekstart == 7 ? 0 : this.weekstart;
|
||||
let startDay = (() => {
|
||||
// 周初有几天是上个月的
|
||||
if (firstDayOfMonth == weekstart) {
|
||||
return 0;
|
||||
} else if (firstDayOfMonth > weekstart) {
|
||||
return firstDayOfMonth - weekstart;
|
||||
} else {
|
||||
return 7 - weekstart + firstDayOfMonth;
|
||||
}
|
||||
})();
|
||||
let endDay = 7 - ((startDay + lastDateOfMonth) % 7); // 结束还有几天是下个月的
|
||||
if (endDay == 7) {
|
||||
endDay = 0;
|
||||
}
|
||||
for (let i = 1; i <= startDay; i++) {
|
||||
dates.push({
|
||||
date: this.formatNum(lastDayOfLastMonth - startDay + i),
|
||||
day: weekstart + i - 1 || 7,
|
||||
month: m - 1 >= 0 ? this.formatNum(m - 1) : 12,
|
||||
year: m - 1 >= 0 ? y : y - 1
|
||||
});
|
||||
}
|
||||
for (let j = 1; j <= lastDateOfMonth; j++) {
|
||||
dates.push({
|
||||
date: this.formatNum(j),
|
||||
day: (j % 7) + firstDayOfMonth - 1 || 7,
|
||||
month: this.formatNum(m),
|
||||
year: y,
|
||||
isCurM: true //是否当前月份
|
||||
});
|
||||
}
|
||||
for (let k = 1; k <= endDay; k++) {
|
||||
dates.push({
|
||||
date: this.formatNum(k),
|
||||
day: (lastDateOfMonth + startDay + weekstart + k - 1) % 7 || 7,
|
||||
month: m + 1 <= 11 ? this.formatNum(m + 1) : 0,
|
||||
year: m + 1 <= 11 ? y : y + 1
|
||||
});
|
||||
}
|
||||
return dates;
|
||||
},
|
||||
isWorkDay(y, m, d) {
|
||||
//是否工作日
|
||||
let ymd = `${y}/${m}/${d}`;
|
||||
let formatDY = new Date(ymd.replace(/-/g, '/'));
|
||||
let week = formatDY.getDay();
|
||||
if (week == 0 || week == 6) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
isFutureDay(y, m, d) {
|
||||
//是否未来日期
|
||||
let ymd = `${y}/${m}/${d}`;
|
||||
let formatDY = new Date(ymd.replace(/-/g, '/'));
|
||||
let showTime = formatDY.getTime();
|
||||
let curTime = new Date().getTime();
|
||||
if (showTime > curTime) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// 标记日期
|
||||
isMarkDay(y, m, d) {
|
||||
let flag = false;
|
||||
for (let i = 0; i < this.markDays.length; i++) {
|
||||
let dy = `${y}-${m}-${d}`;
|
||||
if (this.markDays[i] == dy) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
},
|
||||
isToday(y, m, d) {
|
||||
let checkD = y + '-' + m + '-' + d;
|
||||
let today = this.getToday().date;
|
||||
if (checkD == today) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// 展开收起
|
||||
toggle() {
|
||||
this.monthOpen = !this.monthOpen;
|
||||
if (this.monthOpen) {
|
||||
this.positionTop = 0;
|
||||
} else {
|
||||
let index = -1;
|
||||
this.dates.forEach((i, x) => {
|
||||
this.isToday(i.year, i.month, i.date) && (index = x);
|
||||
});
|
||||
this.positionTop = -((Math.ceil((index + 1) / 7) || 1) - 1) * 80;
|
||||
}
|
||||
},
|
||||
// 点击回调
|
||||
selectOne(i, event) {
|
||||
let date = `${i.year}-${i.month}-${i.date}`;
|
||||
let selectD = new Date(date).getTime();
|
||||
let curTime = new Date().getTime();
|
||||
let week = new Date(date).getDay();
|
||||
let weekText = ['日', '一', '二', '三', '四', '五', '六'];
|
||||
let formatWeek = '星期' + weekText[week];
|
||||
let response = {
|
||||
date: date,
|
||||
week: formatWeek
|
||||
};
|
||||
if (!i.isCurM) {
|
||||
// console.log('不在当前月范围内');
|
||||
return false;
|
||||
}
|
||||
if (selectD > curTime) {
|
||||
if (this.disabledAfter) {
|
||||
console.log('未来日期不可选');
|
||||
return false;
|
||||
} else {
|
||||
this.choose = date;
|
||||
this.$emit('onDayClick', response);
|
||||
}
|
||||
} else {
|
||||
this.choose = date;
|
||||
this.$emit('onDayClick', response);
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
//改变年月
|
||||
changYearMonth(y, m) {
|
||||
this.dates = this.monthDay(y, m);
|
||||
this.y = y;
|
||||
this.m = m;
|
||||
},
|
||||
changeMonth(type) {
|
||||
let that = this
|
||||
if (type == 'pre') {
|
||||
if (that.m + 1 == 2) {
|
||||
that.m = 12;
|
||||
that.y = that.y - 1;
|
||||
} else {
|
||||
that.m = that.m - 1;
|
||||
}
|
||||
that.month = this.$tools.getMonth(that.month, -1)
|
||||
that.$emit('onMonthClickPre', that.month)
|
||||
} else {
|
||||
if (this.m + 1 == 13) {
|
||||
this.m = 1;
|
||||
this.y = this.y + 1;
|
||||
} else {
|
||||
this.m = this.m + 1;
|
||||
}
|
||||
that.month = this.$tools.getMonth(that.month, +1)
|
||||
that.$emit('onMonthClickPre', that.month)
|
||||
}
|
||||
this.dates = this.monthDay(this.y, this.m);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.calendar-wrapper {
|
||||
color: #bbb7b7;
|
||||
border-radius: 10px;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
background-color: #fff;
|
||||
padding-bottom: 10rpx;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 88rpx;
|
||||
color: #42464A;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
justify-content: space-around;
|
||||
|
||||
.pre,
|
||||
.next {
|
||||
color: $btncolor;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.week {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-bottom: 1rpx solid rgba(255, 255, 255, 0.2);
|
||||
|
||||
view {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.content0 {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: height 0.4s ease;
|
||||
|
||||
.days {
|
||||
transition: top 0.3s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
display: block;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: calc(100% / 7);
|
||||
|
||||
.day {
|
||||
font-style: normal;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
overflow: hidden;
|
||||
border-radius: 60rpx;
|
||||
|
||||
&.choose {
|
||||
background-color: $btncolor;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&.nolm {
|
||||
color: #fff;
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
.isWorkDay {
|
||||
color: #42464a;
|
||||
}
|
||||
|
||||
.notSigned {
|
||||
font-style: normal;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
background: #fa7268;
|
||||
border-radius: 10rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.today {
|
||||
color: #fff;
|
||||
background-color: #a8c0ff;
|
||||
}
|
||||
|
||||
.workDay {
|
||||
font-style: normal;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
background: #4d7df9;
|
||||
border-radius: 10rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.markDay {
|
||||
font-style: normal;
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
background: #fa7268;
|
||||
border-radius: 10rpx;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hide {
|
||||
height: 80rpx !important;
|
||||
}
|
||||
|
||||
.weektoggle {
|
||||
width: 85rpx;
|
||||
height: 32rpx;
|
||||
position: relative;
|
||||
bottom: -42rpx;
|
||||
|
||||
&.down {
|
||||
transform: rotate(180deg);
|
||||
bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
<template>
|
||||
<view v-if="isFirst" class="wrapper">
|
||||
<view class="bg" @click="onTap">
|
||||
<view class="edit" @click.stop>
|
||||
<view class="title">初始体重</view>
|
||||
<view class="editem" @click="hideKeyboard">
|
||||
<view class="name">日期</view>
|
||||
<view class="right">
|
||||
<picker mode="date" :value="regTime?regTime:user.firstresulttime" :end="endDate" @change="bindDateChange">
|
||||
<view class="text">{{regTime?regTime:user.firstresulttime?user.firstresulttime:"请选择"}}
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="editem">
|
||||
<view class="name">体重</view>
|
||||
<view class="right">
|
||||
<input v-model="weight" type="digit" placeholder="请输入" />kg
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn close" @click="onTap()">取消</view>
|
||||
<view class="btn" @click="handleTarget">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
regTime: "",
|
||||
weight: "",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user", "isFirst"]),
|
||||
endDate() {
|
||||
return this.$tools.getDate("start")
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 初始体重
|
||||
handleTarget() {
|
||||
let that = this
|
||||
if (!that.user.firstresulttime) {
|
||||
that.$tools.msg("请选择测量日期")
|
||||
return
|
||||
}
|
||||
if (!that.weight) {
|
||||
that.$tools.msg("请输入测量体重")
|
||||
return
|
||||
}
|
||||
that.$model.getfirstweight({
|
||||
familyid: that.user.familyid,
|
||||
time: that.regTime ? that.regTime : that.user.firstresulttime,
|
||||
weight: that.weight,
|
||||
}).then(res => {
|
||||
that.$tools.msg(res.message)
|
||||
if (res.code == 0) {
|
||||
that.$store.commit("changeFirst", false);
|
||||
that.$store.dispatch("getUserInfo", {
|
||||
familyid: that.user.familyid,
|
||||
})
|
||||
that.regTime = ""
|
||||
that.weight = ""
|
||||
}
|
||||
})
|
||||
},
|
||||
//
|
||||
bindDateChange(e) {
|
||||
this.regTime = e.target.value
|
||||
},
|
||||
onTap() {
|
||||
this.weight = ""
|
||||
this.regTime = ""
|
||||
this.$store.commit("changeFirst", false);
|
||||
},
|
||||
hideKeyboard() {
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.edit {
|
||||
width: 15rem;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
margin: auto;
|
||||
z-index: 99999;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.editem {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
background: #eee;
|
||||
padding: 0px 10px;
|
||||
align-items: center;
|
||||
|
||||
.radioimg {
|
||||
font-size: 22px;
|
||||
color: $btncolor;
|
||||
}
|
||||
|
||||
.radio {
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 4rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
input {
|
||||
margin-right: 10px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
picker {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.value {
|
||||
position: relative;
|
||||
z-index: 999;
|
||||
width: 3rem;
|
||||
text-align: center;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
margin-left: 10px;
|
||||
float: right;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 0.75rem;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 40%;
|
||||
float: right;
|
||||
margin-top: 15px;
|
||||
background: $maincolor !important;
|
||||
}
|
||||
|
||||
.edit {
|
||||
top: 20%
|
||||
}
|
||||
|
||||
.close {
|
||||
background: #dfdfdf !important;
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,242 @@
|
|||
<template>
|
||||
<view v-if="isRecord" class="wrapper">
|
||||
<view class="bg" @click="onTap">
|
||||
<view class="edit" @click.stop>
|
||||
<view class="title">手动记录</view>
|
||||
<view class="editem" @click="hideKeyboard">
|
||||
<view class="left">日期</view>
|
||||
<view class="right">
|
||||
<picker mode="date" :value="regTime" :end="endDate" @change="bindDateChange">
|
||||
<view class="text">{{regTime?regTime:"请选择"}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<view class="editem">
|
||||
<view class="left">体重</view>
|
||||
<view class="right">
|
||||
<input v-model="weight" type="digit" placeholder="请输入" />kg
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn close" @click="onTap()">取消</view>
|
||||
<view class="btn" @click="handleTarget">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
regTime: "",
|
||||
weight: "",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user", "isRecord"]),
|
||||
endDate() {
|
||||
return this.$tools.getDate("start")
|
||||
},
|
||||
startDate() {
|
||||
return this.$tools.GetDateStr(-90);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 手动记录
|
||||
handleTarget() {
|
||||
let that = this
|
||||
if (!that.regTime) {
|
||||
that.$tools.msg("请选择测量日期")
|
||||
return
|
||||
}
|
||||
if (!that.weight) {
|
||||
that.$tools.msg("请输入测量体重")
|
||||
return
|
||||
}
|
||||
that.$model.getinsertmeasure({
|
||||
familyid: that.user.familyid,
|
||||
time: that.regTime,
|
||||
weight: that.weight,
|
||||
}).then(res => {
|
||||
if (res.code != 0) return
|
||||
that.$tools.msg(res.message)
|
||||
that.$store.commit("changeRecord", false);
|
||||
that.$store.dispatch("getResult", {
|
||||
birthday: that.user.birthday,
|
||||
familyid: that.user.familyid,
|
||||
height: that.user.height,
|
||||
sex: that.user.sex,
|
||||
})
|
||||
that.$store.dispatch("getUserInfo", {
|
||||
familyid: that.user.familyid,
|
||||
})
|
||||
that.$emit("getList", this.startDate, this.endDate)
|
||||
that.regTime = ""
|
||||
that.weight = ""
|
||||
})
|
||||
},
|
||||
//
|
||||
bindDateChange(e) {
|
||||
this.regTime = e.target.value
|
||||
},
|
||||
onTap() {
|
||||
this.regTime = ""
|
||||
this.weight = ""
|
||||
this.$store.commit("changeRecord", false);
|
||||
},
|
||||
hideKeyboard() {
|
||||
uni.hideKeyboard()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.edit {
|
||||
width: 15rem;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
margin: auto;
|
||||
z-index: 99999;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.editem {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
background: #eee;
|
||||
padding: 0px 10px;
|
||||
align-items: center;
|
||||
|
||||
.radioimg {
|
||||
font-size: 22px;
|
||||
color: $btncolor;
|
||||
}
|
||||
|
||||
.radio {
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 4rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
input {
|
||||
margin-right: 10px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
picker {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.value {
|
||||
position: relative;
|
||||
z-index: 999;
|
||||
width: 3rem;
|
||||
text-align: center;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
margin-left: 10px;
|
||||
float: right;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 0.75rem;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 40%;
|
||||
float: right;
|
||||
margin-top: 15px;
|
||||
background: $maincolor !important;
|
||||
}
|
||||
|
||||
.edit {
|
||||
top: 20%
|
||||
}
|
||||
|
||||
.close {
|
||||
background: #dfdfdf !important;
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
<template>
|
||||
<view v-if="isTarget" class="wrapper">
|
||||
<view class="bg" @click="onTap">
|
||||
<view class="edit" @click.stop>
|
||||
<view class="title">目标体重</view>
|
||||
<view class="editem">
|
||||
<view class="left">目标体重</view>
|
||||
<view class="right">
|
||||
<input class="text" type="digit" placeholder="请输入" v-model="inputvalue" />kg
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn close" @click="onTap()">取消</view>
|
||||
<view class="btn" @click="handleWeight">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState
|
||||
} from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inputvalue: "",
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(["user", "isTarget"]),
|
||||
startDate() {
|
||||
return this.$tools.getDate('start');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 目标体重
|
||||
handleWeight() {
|
||||
let that = this
|
||||
console.log("startDate", that.startDate)
|
||||
if (!that.inputvalue) {
|
||||
that.$tools.msg("请输入目标体重")
|
||||
return
|
||||
}
|
||||
that.$model.setTarget({
|
||||
familyid: that.user.familyid,
|
||||
time: that.startDate,
|
||||
weight: that.inputvalue,
|
||||
}).then(res => {
|
||||
if (res.code != 0) return
|
||||
that.$tools.msg(res.message)
|
||||
that.$store.commit("changeTarget", false);
|
||||
that.$store.dispatch("getUserInfo", {
|
||||
familyid: that.user.familyid,
|
||||
})
|
||||
})
|
||||
},
|
||||
onTap() {
|
||||
this.inputvalue = ""
|
||||
this.$store.commit("changeTarget", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.wrapper {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 999;
|
||||
|
||||
.bg {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.edit {
|
||||
width: 15rem;
|
||||
height: auto;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 15px;
|
||||
position: relative;
|
||||
top: 15%;
|
||||
margin: auto;
|
||||
z-index: 99999;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #333;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.editem {
|
||||
position: relative;
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
border-radius: 10px;
|
||||
margin-top: 15px;
|
||||
height: 40px;
|
||||
justify-content: space-between;
|
||||
background: #eee;
|
||||
padding: 0px 10px;
|
||||
align-items: center;
|
||||
|
||||
.radioimg {
|
||||
font-size: 22px;
|
||||
color: $btncolor;
|
||||
}
|
||||
|
||||
.radio {
|
||||
width: 50%;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.name {
|
||||
width: 4rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 60%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
|
||||
input {
|
||||
margin-right: 10px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
picker {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: right;
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.value {
|
||||
position: relative;
|
||||
z-index: 999;
|
||||
width: 3rem;
|
||||
text-align: center;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
margin-left: 10px;
|
||||
float: right;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
font-size: 0.75rem;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 40%;
|
||||
float: right;
|
||||
margin-top: 15px;
|
||||
background: $maincolor !important;
|
||||
}
|
||||
|
||||
.edit {
|
||||
top: 20%
|
||||
}
|
||||
|
||||
.close {
|
||||
background: #dfdfdf !important;
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -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>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"index.title": "Hello i18n",
|
||||
"index.home": "Home",
|
||||
"index.component": "Component",
|
||||
"index.api": "API",
|
||||
"index.schema": "Schema",
|
||||
"index.demo": "uni-app globalization",
|
||||
"index.demo-description": "Include uni-framework, manifest.json, pages.json, tabbar, Page, Component, API, Schema",
|
||||
"index.detail": "Detail",
|
||||
"index.language": "Language",
|
||||
"index.language-info": "Settings",
|
||||
"index.system-language": "System language",
|
||||
"index.application-language": "Application language",
|
||||
"index.language-change-confirm": "Applying this setting will restart the app"
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import en from './en.json'
|
||||
import zhHans from './zh-Hans.json'
|
||||
import zhHant from './zh-Hant.json'
|
||||
import ja from './ja.json'
|
||||
export default {
|
||||
en, // 中文
|
||||
'zh-Hans': zhHans,//简体
|
||||
'zh-Hant': zhHant, //繁体
|
||||
ja //日语
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"index.title": "Hello i18n",
|
||||
"index.home": "ホーム",
|
||||
"index.component": "コンポーネント",
|
||||
"index.api": "API",
|
||||
"index.schema": "Schema",
|
||||
"index.demo": "uni-app globalization",
|
||||
"index.demo-description": "ユニフレームワーク、manifest.json、pages.json、タブバー、ページ、コンポーネント、APIを含める、Schema",
|
||||
"index.detail": "詳細",
|
||||
"index.language": "言語",
|
||||
"index.language-info": "設定",
|
||||
"index.system-language": "システム言語",
|
||||
"index.application-language": "アプリケーション言語",
|
||||
"index.language-change-confirm": "この設定を適用すると、アプリが再起動します"
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"common": {
|
||||
"uni.app.quit": "もう一度押すと、アプリケーションが終了します",
|
||||
"uni.async.error": "サーバーへの接続がタイムアウトしました。画面をクリックして再試行してください",
|
||||
"uni.showActionSheet.cancel": "キャンセル",
|
||||
"uni.showToast.unpaired": "使用するには、showToastとhideToastをペアにする必要があることに注意してください",
|
||||
"uni.showLoading.unpaired": "使用するには、showLoadingとhideLoadingをペアにする必要があることに注意してください",
|
||||
"uni.showModal.cancel": "キャンセル",
|
||||
"uni.showModal.confirm": "OK",
|
||||
"uni.chooseImage.cancel": "キャンセル",
|
||||
"uni.chooseImage.sourceType.album": "アルバムから選択",
|
||||
"uni.chooseImage.sourceType.camera": "カメラ",
|
||||
"uni.chooseVideo.cancel": "キャンセル",
|
||||
"uni.chooseVideo.sourceType.album": "アルバムから選択",
|
||||
"uni.chooseVideo.sourceType.camera": "カメラ",
|
||||
"uni.previewImage.cancel": "キャンセル",
|
||||
"uni.previewImage.button.save": "画像を保存",
|
||||
"uni.previewImage.save.success": "画像をアルバムに正常に保存します",
|
||||
"uni.previewImage.save.fail": "画像をアルバムに保存できませんでした",
|
||||
"uni.setClipboardData.success": "コンテンツがコピーされました",
|
||||
"uni.scanCode.title": "スキャンコード",
|
||||
"uni.scanCode.album": "アルバム",
|
||||
"uni.scanCode.fail": "認識に失敗しました",
|
||||
"uni.scanCode.flash.on": "タッチして点灯",
|
||||
"uni.scanCode.flash.off": "タップして閉じる",
|
||||
"uni.startSoterAuthentication.authContent": "指紋認識...",
|
||||
"uni.picker.done": "完了",
|
||||
"uni.picker.cancel": "キャンセル",
|
||||
"uni.video.danmu": "「弾幕」",
|
||||
"uni.video.volume": "ボリューム",
|
||||
"uni.button.feedback.title": "質問のフィードバック",
|
||||
"uni.button.feedback.send": "送信"
|
||||
},
|
||||
"ios": {},
|
||||
"android": {}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"login.title": "登录",
|
||||
"login.phone": "手机号/邮箱",
|
||||
"login.code": "验证码",
|
||||
"login.sendcode": "发送验证码",
|
||||
"login.agreement": "我已阅读并授权",
|
||||
"login.agreementContnt": "《中招体测用户隐私协议》",
|
||||
"login.btn": "登录",
|
||||
"login.ForgotPassword": "忘记密码",
|
||||
"login.register": "马上注册",
|
||||
"login.valtips": "请勾选同意《中招体测用户隐私协议》",
|
||||
"login.phonetip": "请输入手机号码",
|
||||
"login.phonetipsTwo": "请输入正确的手机号码",
|
||||
"login.codeTips": "请输入验证码",
|
||||
"index.home": "主页",
|
||||
"index.age": "年龄",
|
||||
"index.birthday": "出生日期",
|
||||
"index.region": "当前地区",
|
||||
"index.body": "身体数据",
|
||||
"index.height": "身高",
|
||||
"index.weight": "体重",
|
||||
"index.BMI": "BMI",
|
||||
"index.none": "暂无",
|
||||
"index.look": "查看详情"
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"index.title": "Hello i18n",
|
||||
"index.home": "主頁",
|
||||
"index.component": "組件",
|
||||
"index.api": "API",
|
||||
"index.schema": "Schema",
|
||||
"index.demo": "uni-app 國際化演示",
|
||||
"index.demo-description": "包含 uni-framework、manifest.json、pages.json、tabbar、頁面、組件、API、Schema",
|
||||
"index.detail": "詳情",
|
||||
"index.language": "語言",
|
||||
"index.language-info": "語言信息",
|
||||
"index.system-language": "系統語言",
|
||||
"index.application-language": "應用語言",
|
||||
"index.language-change-confirm": "應用此設置將重啟App"
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
import App from './App'
|
||||
// vuex
|
||||
import store from './store'
|
||||
Vue.prototype.$store = store;
|
||||
// 公共js
|
||||
import tools from '@/tools/tools.js'
|
||||
Vue.prototype.$tools = tools;
|
||||
//请求
|
||||
import http from '@/tools/https.js'
|
||||
Vue.prototype.$http = http;
|
||||
//接口
|
||||
import model from '@/tools/model.js'
|
||||
Vue.prototype.$model = model;
|
||||
// 语言
|
||||
import messages from './locale/index'
|
||||
|
||||
//首页卡片列表
|
||||
import json from '@/cardlist.json'
|
||||
Vue.prototype.$json = json;
|
||||
|
||||
let i18nConfig = {
|
||||
locale: uni.getLocale(),
|
||||
messages
|
||||
}
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
Vue.use(VueI18n)
|
||||
const i18n = new VueI18n(i18nConfig)
|
||||
Vue.config.productionTip = false
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
i18n,
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import {
|
||||
createSSRApp
|
||||
} from 'vue'
|
||||
import {
|
||||
createI18n
|
||||
} from 'vue-i18n'
|
||||
const i18n = createI18n(i18nConfig)
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
app.use(i18n)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
{
|
||||
"name" : "examTeamApp",
|
||||
"appid" : "__UNI__E0E1A21",
|
||||
"description" : "",
|
||||
"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" : {
|
||||
"Bluetooth" : {},
|
||||
"Camera" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"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\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {
|
||||
"share" : {}
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2"
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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" %*
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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" %*
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,271 @@
|
|||
{
|
||||
"name": "examTeamApp",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.24.0",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.0.tgz",
|
||||
"integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@intlify/core-base": {
|
||||
"version": "9.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.10.2.tgz",
|
||||
"integrity": "sha512-HGStVnKobsJL0DoYIyRCGXBH63DMQqEZxDUGrkNI05FuTcruYUtOAxyL3zoAZu/uDGO6mcUvm3VXBaHG2GdZCg==",
|
||||
"dependencies": {
|
||||
"@intlify/message-compiler": "9.10.2",
|
||||
"@intlify/shared": "9.10.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
}
|
||||
},
|
||||
"node_modules/@intlify/message-compiler": {
|
||||
"version": "9.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.10.2.tgz",
|
||||
"integrity": "sha512-ntY/kfBwQRtX5Zh6wL8cSATujPzWW2ZQd1QwKyWwAy5fMqJyyixHMeovN4fmEyCqSu+hFfYOE63nU94evsy4YA==",
|
||||
"dependencies": {
|
||||
"@intlify/shared": "9.10.2",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
}
|
||||
},
|
||||
"node_modules/@intlify/shared": {
|
||||
"version": "9.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.10.2.tgz",
|
||||
"integrity": "sha512-ttHCAJkRy7R5W2S9RVnN9KYQYPIpV2+GiS79T4EE37nrPyH6/1SrOh3bmdCRC1T3ocL8qCDx7x2lBJ0xaITU7Q==",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.15",
|
||||
"resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
|
||||
"integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.21.tgz",
|
||||
"integrity": "sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.23.9",
|
||||
"@vue/shared": "3.4.21",
|
||||
"entities": "^4.5.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-dom": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.21.tgz",
|
||||
"integrity": "sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.4.21",
|
||||
"@vue/shared": "3.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-sfc": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.21.tgz",
|
||||
"integrity": "sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.23.9",
|
||||
"@vue/compiler-core": "3.4.21",
|
||||
"@vue/compiler-dom": "3.4.21",
|
||||
"@vue/compiler-ssr": "3.4.21",
|
||||
"@vue/shared": "3.4.21",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.7",
|
||||
"postcss": "^8.4.35",
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-ssr": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.21.tgz",
|
||||
"integrity": "sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.4.21",
|
||||
"@vue/shared": "3.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/devtools-api": {
|
||||
"version": "6.6.1",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.1.tgz",
|
||||
"integrity": "sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA=="
|
||||
},
|
||||
"node_modules/@vue/reactivity": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.21.tgz",
|
||||
"integrity": "sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-core": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.21.tgz",
|
||||
"integrity": "sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.4.21",
|
||||
"@vue/shared": "3.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-dom": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.21.tgz",
|
||||
"integrity": "sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/runtime-core": "3.4.21",
|
||||
"@vue/shared": "3.4.21",
|
||||
"csstype": "^3.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/server-renderer": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.21.tgz",
|
||||
"integrity": "sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-ssr": "3.4.21",
|
||||
"@vue/shared": "3.4.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "3.4.21"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.21.tgz",
|
||||
"integrity": "sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/csstype": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
|
||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
|
||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
}
|
||||
},
|
||||
"node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/magic-string": {
|
||||
"version": "0.30.8",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.8.tgz",
|
||||
"integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/sourcemap-codec": "^1.4.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"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.36",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.36.tgz",
|
||||
"integrity": "sha512-/n7eumA6ZjFHAsbX30yhHup/IMkOmlmvtEi7P+6RMYf+bGJSUHc3geH4a0NSZxAz/RJfiS9tooCTs9LAVYUZKw==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.7",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.1.0.tgz",
|
||||
"integrity": "sha512-9vC2SfsJzlej6MAaMPLu8HiBSHGdRAJ9hVFYN1ibZoNkeanmDmLUcIrj6G9DGL7XMJ54AKg/G75akXl1/izTOw==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "3.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.21.tgz",
|
||||
"integrity": "sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.4.21",
|
||||
"@vue/compiler-sfc": "3.4.21",
|
||||
"@vue/runtime-dom": "3.4.21",
|
||||
"@vue/server-renderer": "3.4.21",
|
||||
"@vue/shared": "3.4.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vue-i18n": {
|
||||
"version": "9.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.10.2.tgz",
|
||||
"integrity": "sha512-ECJ8RIFd+3c1d3m1pctQ6ywG5Yj8Efy1oYoAKQ9neRdkLbuKLVeW4gaY5HPkD/9ssf1pOnUrmIFjx2/gkGxmEw==",
|
||||
"dependencies": {
|
||||
"@intlify/core-base": "9.10.2",
|
||||
"@intlify/shared": "9.10.2",
|
||||
"@vue/devtools-api": "^6.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -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.
|
||||
|
|
@ -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
|
||||
```
|
||||
|
|
@ -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, " "));
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
try {
|
||||
module.exports = require("./lib/index.cjs");
|
||||
} catch {
|
||||
module.exports = require("./lib/index.js");
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.24.0",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "The Babel Team (https://babel.dev/team)",
|
||||
"homepage": "https://babel.dev/docs/en/next/babel-parser",
|
||||
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
"javascript",
|
||||
"parser",
|
||||
"tc39",
|
||||
"ecmascript",
|
||||
"@babel/parser"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel.git",
|
||||
"directory": "packages/babel-parser"
|
||||
},
|
||||
"main": "./lib/index.js",
|
||||
"types": "./typings/babel-parser.d.ts",
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"typings/babel-parser.d.ts",
|
||||
"index.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.23.5",
|
||||
"@babel/helper-check-duplicate-nodes": "^7.22.5",
|
||||
"@babel/helper-fixtures": "^7.24.0",
|
||||
"@babel/helper-string-parser": "^7.23.4",
|
||||
"@babel/helper-validator-identifier": "^7.22.20",
|
||||
"charcodes": "^0.2.0"
|
||||
},
|
||||
"bin": "./bin/babel-parser.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
// This file is auto-generated! Do not modify it directly.
|
||||
/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */
|
||||
import * as _babel_types from '@babel/types';
|
||||
|
||||
type Plugin =
|
||||
| "asyncDoExpressions"
|
||||
| "asyncGenerators"
|
||||
| "bigInt"
|
||||
| "classPrivateMethods"
|
||||
| "classPrivateProperties"
|
||||
| "classProperties"
|
||||
| "classStaticBlock" // Enabled by default
|
||||
| "decimal"
|
||||
| "decorators-legacy"
|
||||
| "deferredImportEvaluation"
|
||||
| "decoratorAutoAccessors"
|
||||
| "destructuringPrivate"
|
||||
| "doExpressions"
|
||||
| "dynamicImport"
|
||||
| "explicitResourceManagement"
|
||||
| "exportDefaultFrom"
|
||||
| "exportNamespaceFrom" // deprecated
|
||||
| "flow"
|
||||
| "flowComments"
|
||||
| "functionBind"
|
||||
| "functionSent"
|
||||
| "importMeta"
|
||||
| "jsx"
|
||||
| "logicalAssignment"
|
||||
| "importAssertions" // deprecated
|
||||
| "importAttributes"
|
||||
| "importReflection"
|
||||
| "moduleBlocks"
|
||||
| "moduleStringNames"
|
||||
| "nullishCoalescingOperator"
|
||||
| "numericSeparator"
|
||||
| "objectRestSpread"
|
||||
| "optionalCatchBinding"
|
||||
| "optionalChaining"
|
||||
| "partialApplication"
|
||||
| "placeholders"
|
||||
| "privateIn" // Enabled by default
|
||||
| "regexpUnicodeSets" // Enabled by default
|
||||
| "sourcePhaseImports"
|
||||
| "throwExpressions"
|
||||
| "topLevelAwait"
|
||||
| "v8intrinsic"
|
||||
| ParserPluginWithOptions[0];
|
||||
|
||||
type ParserPluginWithOptions =
|
||||
| ["decorators", DecoratorsPluginOptions]
|
||||
| ["estree", { classFeatures?: boolean }]
|
||||
| ["importAttributes", { deprecatedAssertSyntax: boolean }]
|
||||
// @deprecated
|
||||
| ["moduleAttributes", { version: "may-2020" }]
|
||||
| ["optionalChainingAssign", { version: "2023-07" }]
|
||||
| ["pipelineOperator", PipelineOperatorPluginOptions]
|
||||
| ["recordAndTuple", RecordAndTuplePluginOptions]
|
||||
| ["flow", FlowPluginOptions]
|
||||
| ["typescript", TypeScriptPluginOptions];
|
||||
|
||||
type PluginConfig = Plugin | ParserPluginWithOptions;
|
||||
|
||||
interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
allowCallParenthesized?: boolean;
|
||||
}
|
||||
|
||||
interface PipelineOperatorPluginOptions {
|
||||
proposal: "minimal" | "fsharp" | "hack" | "smart";
|
||||
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
||||
}
|
||||
|
||||
interface RecordAndTuplePluginOptions {
|
||||
syntaxType: "bar" | "hash";
|
||||
}
|
||||
|
||||
interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
enums?: boolean;
|
||||
}
|
||||
|
||||
interface TypeScriptPluginOptions {
|
||||
dts?: boolean;
|
||||
disallowAmbiguousJSXLike?: boolean;
|
||||
}
|
||||
|
||||
// Type definitions for @babel/parser
|
||||
// Project: https://github.com/babel/babel/tree/main/packages/babel-parser
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Avi Vahl <https://github.com/AviVahl>
|
||||
// TypeScript Version: 2.9
|
||||
|
||||
/**
|
||||
* Parse the provided code as an entire ECMAScript program.
|
||||
*/
|
||||
declare function parse(
|
||||
input: string,
|
||||
options?: ParserOptions
|
||||
): ParseResult<_babel_types.File>;
|
||||
|
||||
/**
|
||||
* Parse the provided code as a single expression.
|
||||
*/
|
||||
declare function parseExpression(
|
||||
input: string,
|
||||
options?: ParserOptions
|
||||
): ParseResult<_babel_types.Expression>;
|
||||
|
||||
interface ParserOptions {
|
||||
/**
|
||||
* By default, import and export declarations can only appear at a program's top level.
|
||||
* Setting this option to true allows them anywhere where a statement is allowed.
|
||||
*/
|
||||
allowImportExportEverywhere?: boolean;
|
||||
|
||||
/**
|
||||
* By default, await use is not allowed outside of an async function.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowAwaitOutsideFunction?: boolean;
|
||||
|
||||
/**
|
||||
* By default, a return statement at the top level raises an error.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowReturnOutsideFunction?: boolean;
|
||||
|
||||
/**
|
||||
* By default, new.target use is not allowed outside of a function or class.
|
||||
* Set this to true to accept such code.
|
||||
*/
|
||||
allowNewTargetOutsideFunction?: boolean;
|
||||
|
||||
allowSuperOutsideMethod?: boolean;
|
||||
|
||||
/**
|
||||
* By default, exported identifiers must refer to a declared variable.
|
||||
* Set this to true to allow export statements to reference undeclared variables.
|
||||
*/
|
||||
allowUndeclaredExports?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel parser JavaScript code according to Annex B syntax.
|
||||
* Set this to `false` to disable such behavior.
|
||||
*/
|
||||
annexB?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel attaches comments to adjacent AST nodes.
|
||||
* When this option is set to false, comments are not attached.
|
||||
* It can provide up to 30% performance improvement when the input code has many comments.
|
||||
* @babel/eslint-parser will set it for you.
|
||||
* It is not recommended to use attachComment: false with Babel transform,
|
||||
* as doing so removes all the comments in output code, and renders annotations such as
|
||||
* /* istanbul ignore next *\/ nonfunctional.
|
||||
*/
|
||||
attachComment?: boolean;
|
||||
|
||||
/**
|
||||
* By default, Babel always throws an error when it finds some invalid code.
|
||||
* When this option is set to true, it will store the parsing error and
|
||||
* try to continue parsing the invalid input file.
|
||||
*/
|
||||
errorRecovery?: boolean;
|
||||
|
||||
/**
|
||||
* Indicate the mode the code should be parsed in.
|
||||
* Can be one of "script", "module", or "unambiguous". Defaults to "script".
|
||||
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
||||
* of ES6 import or export statements.
|
||||
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
||||
*/
|
||||
sourceType?: "script" | "module" | "unambiguous";
|
||||
|
||||
/**
|
||||
* Correlate output AST nodes with their source filename.
|
||||
* Useful when generating code and source maps from the ASTs of multiple input files.
|
||||
*/
|
||||
sourceFilename?: string;
|
||||
|
||||
/**
|
||||
* By default, the first line of code parsed is treated as line 1.
|
||||
* You can provide a line number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startLine?: number;
|
||||
|
||||
/**
|
||||
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
||||
* You can provide a column number to alternatively start with.
|
||||
* Useful for integration with other source tools.
|
||||
*/
|
||||
startColumn?: number;
|
||||
|
||||
/**
|
||||
* Array containing the plugins that you want to enable.
|
||||
*/
|
||||
plugins?: ParserPlugin[];
|
||||
|
||||
/**
|
||||
* Should the parser work in strict mode.
|
||||
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
||||
*/
|
||||
strictMode?: boolean;
|
||||
|
||||
/**
|
||||
* Adds a ranges property to each node: [node.start, node.end]
|
||||
*/
|
||||
ranges?: boolean;
|
||||
|
||||
/**
|
||||
* Adds all parsed tokens to a tokens property on the File node.
|
||||
*/
|
||||
tokens?: boolean;
|
||||
|
||||
/**
|
||||
* By default, the parser adds information about parentheses by setting
|
||||
* `extra.parenthesized` to `true` as needed.
|
||||
* When this option is `true` the parser creates `ParenthesizedExpression`
|
||||
* AST nodes instead of using the `extra` property.
|
||||
*/
|
||||
createParenthesizedExpressions?: boolean;
|
||||
|
||||
/**
|
||||
* The default is false in Babel 7 and true in Babel 8
|
||||
* Set this to true to parse it as an `ImportExpression` node.
|
||||
* Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
|
||||
*/
|
||||
createImportExpressions?: boolean;
|
||||
}
|
||||
|
||||
type ParserPlugin = PluginConfig;
|
||||
|
||||
|
||||
declare const tokTypes: {
|
||||
// todo(flow->ts) real token type
|
||||
[name: string]: any;
|
||||
};
|
||||
|
||||
interface ParseError {
|
||||
code: string;
|
||||
reasonCode: string;
|
||||
}
|
||||
|
||||
type ParseResult<Result> = Result & {
|
||||
errors: ParseError[];
|
||||
};
|
||||
|
||||
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 kazuya kawaguchi
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# @intlify/core-base
|
||||
|
||||
The intlify core base module
|
||||
|
||||
## :copyright: License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('../dist/core-base.cjs')
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('../dist/core-base.prod.cjs')
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
export * from '../dist/core-base.mjs'
|
||||
File diff suppressed because it is too large
Load Diff
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 it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/core-base.prod.cjs')
|
||||
} else {
|
||||
module.exports = require('./dist/core-base.cjs')
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
"name": "@intlify/core-base",
|
||||
"version": "9.10.2",
|
||||
"description": "@intlify/core-base",
|
||||
"keywords": [
|
||||
"core",
|
||||
"fundamental",
|
||||
"i18n",
|
||||
"internationalization",
|
||||
"intlify"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "kazuya kawaguchi",
|
||||
"email": "kawakazu80@gmail.com"
|
||||
},
|
||||
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/core-base#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/intlify/vue-i18n-next.git",
|
||||
"directory": "packages/core"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/intlify/vue-i18n-next/issues"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"main": "index.js",
|
||||
"module": "dist/core-base.mjs",
|
||||
"unpkg": "dist/core-base.global.js",
|
||||
"jsdelivr": "dist/core-base.global.js",
|
||||
"types": "dist/core-base.d.ts",
|
||||
"dependencies": {
|
||||
"@intlify/shared": "9.10.2",
|
||||
"@intlify/message-compiler": "9.10.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@intlify/vue-devtools": "9.10.2",
|
||||
"@intlify/devtools-if": "9.10.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "IntlifyCoreBase",
|
||||
"formats": [
|
||||
"mjs",
|
||||
"browser",
|
||||
"cjs",
|
||||
"global"
|
||||
]
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/core-base.d.ts",
|
||||
"import": "./dist/core-base.mjs",
|
||||
"browser": "./dist/core-base.esm-browser.js",
|
||||
"node": {
|
||||
"import": {
|
||||
"production": "./dist/core-base.prod.cjs",
|
||||
"development": "./dist/core-base.mjs",
|
||||
"default": "./dist/core-base.mjs"
|
||||
},
|
||||
"require": {
|
||||
"production": "./dist/core-base.prod.cjs",
|
||||
"development": "./dist/core-base.cjs",
|
||||
"default": "./index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"./dist/*": "./dist/*",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"funding": "https://github.com/sponsors/kazupon",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 kazuya kawaguchi
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# @intlify/message-compiler
|
||||
|
||||
The message compiler for intlify project
|
||||
|
||||
## :copyright: License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
1617
node_modules/@intlify/message-compiler/dist/message-compiler.cjs
generated
vendored
Normal file
1617
node_modules/@intlify/message-compiler/dist/message-compiler.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/@intlify/message-compiler/dist/message-compiler.cjs.js
generated
vendored
Normal file
1
node_modules/@intlify/message-compiler/dist/message-compiler.cjs.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('../dist/message-compiler.cjs')
|
||||
1
node_modules/@intlify/message-compiler/dist/message-compiler.cjs.prod.js
generated
vendored
Normal file
1
node_modules/@intlify/message-compiler/dist/message-compiler.cjs.prod.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('../dist/message-compiler.prod.cjs')
|
||||
224
node_modules/@intlify/message-compiler/dist/message-compiler.d.ts
generated
vendored
Normal file
224
node_modules/@intlify/message-compiler/dist/message-compiler.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
import type { BaseError } from '@intlify/shared';
|
||||
import type { RawSourceMap } from 'source-map-js';
|
||||
|
||||
export declare function baseCompile(source: string, options?: CompileOptions): CompilerResult;
|
||||
|
||||
export declare type CacheKeyHandler = (source: string) => string;
|
||||
|
||||
export declare interface CodeGenOptions {
|
||||
location?: boolean;
|
||||
mode?: 'normal' | 'arrow';
|
||||
breakLineCode?: '\n' | ';';
|
||||
needIndent?: boolean;
|
||||
onError?: CompileErrorHandler;
|
||||
sourceMap?: boolean;
|
||||
filename?: string;
|
||||
}
|
||||
|
||||
declare interface CodeGenResult {
|
||||
code: string;
|
||||
ast: ResourceNode;
|
||||
map?: RawSourceMap;
|
||||
}
|
||||
|
||||
export declare type CompileDomain = 'tokenizer' | 'parser' | 'generator' | 'transformer' | 'optimizer' | 'minifier';
|
||||
|
||||
export declare interface CompileError extends BaseError, SyntaxError {
|
||||
domain?: CompileDomain;
|
||||
location?: SourceLocation;
|
||||
}
|
||||
|
||||
export declare const CompileErrorCodes: {
|
||||
readonly EXPECTED_TOKEN: 1;
|
||||
readonly INVALID_TOKEN_IN_PLACEHOLDER: 2;
|
||||
readonly UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3;
|
||||
readonly UNKNOWN_ESCAPE_SEQUENCE: 4;
|
||||
readonly INVALID_UNICODE_ESCAPE_SEQUENCE: 5;
|
||||
readonly UNBALANCED_CLOSING_BRACE: 6;
|
||||
readonly UNTERMINATED_CLOSING_BRACE: 7;
|
||||
readonly EMPTY_PLACEHOLDER: 8;
|
||||
readonly NOT_ALLOW_NEST_PLACEHOLDER: 9;
|
||||
readonly INVALID_LINKED_FORMAT: 10;
|
||||
readonly MUST_HAVE_MESSAGES_IN_PLURAL: 11;
|
||||
readonly UNEXPECTED_EMPTY_LINKED_MODIFIER: 12;
|
||||
readonly UNEXPECTED_EMPTY_LINKED_KEY: 13;
|
||||
readonly UNEXPECTED_LEXICAL_ANALYSIS: 14;
|
||||
readonly UNHANDLED_CODEGEN_NODE_TYPE: 15;
|
||||
readonly UNHANDLED_MINIFIER_NODE_TYPE: 16;
|
||||
readonly __EXTEND_POINT__: 17;
|
||||
};
|
||||
|
||||
export declare type CompileErrorCodes = (typeof CompileErrorCodes)[keyof typeof CompileErrorCodes];
|
||||
|
||||
export declare type CompileErrorHandler = (error: CompileError) => void;
|
||||
|
||||
export declare interface CompileErrorOptions {
|
||||
domain?: CompileDomain;
|
||||
messages?: {
|
||||
[code: number]: string;
|
||||
};
|
||||
args?: unknown[];
|
||||
}
|
||||
|
||||
export declare type CompileOptions = {
|
||||
optimize?: boolean;
|
||||
minify?: boolean;
|
||||
jit?: boolean;
|
||||
} & TransformOptions & CodeGenOptions & ParserOptions & TokenizeOptions;
|
||||
|
||||
export declare type CompilerResult = CodeGenResult;
|
||||
|
||||
export declare function createCompileError<T extends number>(code: T, loc: SourceLocation | null, options?: CompileErrorOptions): CompileError;
|
||||
|
||||
export declare function createLocation(start: Position, end: Position, source?: string): SourceLocation;
|
||||
|
||||
export declare function createParser(options?: ParserOptions): Parser;
|
||||
|
||||
export declare function createPosition(line: number, column: number, offset: number): Position;
|
||||
|
||||
/* Excluded from this release type: defaultOnError */
|
||||
|
||||
export declare const detectHtmlTag: (source: string) => boolean;
|
||||
|
||||
export declare const ERROR_DOMAIN = "parser";
|
||||
|
||||
/* Excluded from this release type: errorMessages */
|
||||
|
||||
export declare const enum HelperNameMap {
|
||||
LIST = "list",
|
||||
NAMED = "named",
|
||||
PLURAL = "plural",
|
||||
LINKED = "linked",
|
||||
MESSAGE = "message",
|
||||
TYPE = "type",
|
||||
INTERPOLATE = "interpolate",
|
||||
NORMALIZE = "normalize",
|
||||
VALUES = "values"
|
||||
}
|
||||
|
||||
export declare type Identifier = string;
|
||||
|
||||
export declare interface LinkedKeyNode extends Node_2 {
|
||||
type: NodeTypes.LinkedKey;
|
||||
value: string;
|
||||
/* Excluded from this release type: v */
|
||||
}
|
||||
|
||||
export declare interface LinkedModifierNode extends Node_2 {
|
||||
type: NodeTypes.LinkedModifier;
|
||||
value: Identifier;
|
||||
/* Excluded from this release type: v */
|
||||
}
|
||||
|
||||
export declare interface LinkedNode extends Node_2 {
|
||||
type: NodeTypes.Linked;
|
||||
modifier?: LinkedModifierNode;
|
||||
/* Excluded from this release type: m */
|
||||
key: LinkedKeyNode | NamedNode | ListNode | LiteralNode;
|
||||
/* Excluded from this release type: k */
|
||||
}
|
||||
|
||||
export declare interface ListNode extends Node_2 {
|
||||
type: NodeTypes.List;
|
||||
index: number;
|
||||
/* Excluded from this release type: i */
|
||||
}
|
||||
|
||||
export declare interface LiteralNode extends Node_2 {
|
||||
type: NodeTypes.Literal;
|
||||
value?: string;
|
||||
/* Excluded from this release type: v */
|
||||
}
|
||||
|
||||
export declare const LOCATION_STUB: SourceLocation;
|
||||
|
||||
declare type MessageElementNode = TextNode | NamedNode | ListNode | LiteralNode | LinkedNode;
|
||||
|
||||
export declare interface MessageNode extends Node_2 {
|
||||
type: NodeTypes.Message;
|
||||
static?: string;
|
||||
/* Excluded from this release type: s */
|
||||
items: MessageElementNode[];
|
||||
/* Excluded from this release type: i */
|
||||
}
|
||||
|
||||
export declare interface NamedNode extends Node_2 {
|
||||
type: NodeTypes.Named;
|
||||
key: Identifier;
|
||||
/* Excluded from this release type: k */
|
||||
}
|
||||
|
||||
declare interface Node_2 {
|
||||
type: NodeTypes;
|
||||
/* Excluded from this release type: t */
|
||||
start?: number;
|
||||
end?: number;
|
||||
loc?: SourceLocation;
|
||||
}
|
||||
export { Node_2 as Node }
|
||||
|
||||
export declare const enum NodeTypes {
|
||||
Resource = 0,// 0
|
||||
Plural = 1,
|
||||
Message = 2,
|
||||
Text = 3,
|
||||
Named = 4,
|
||||
List = 5,// 5
|
||||
Linked = 6,
|
||||
LinkedKey = 7,
|
||||
LinkedModifier = 8,
|
||||
Literal = 9
|
||||
}
|
||||
|
||||
export declare interface Parser {
|
||||
parse(source: string): ResourceNode;
|
||||
}
|
||||
|
||||
export declare interface ParserOptions {
|
||||
location?: boolean;
|
||||
onCacheKey?: (source: string) => string;
|
||||
onError?: CompileErrorHandler;
|
||||
}
|
||||
|
||||
export declare interface PluralNode extends Node_2 {
|
||||
type: NodeTypes.Plural;
|
||||
cases: MessageNode[];
|
||||
/* Excluded from this release type: c */
|
||||
}
|
||||
|
||||
export declare interface Position {
|
||||
offset: number;
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export declare interface ResourceNode extends Node_2 {
|
||||
type: NodeTypes.Resource;
|
||||
body: MessageNode | PluralNode;
|
||||
/* Excluded from this release type: b */
|
||||
cacheKey?: string;
|
||||
helpers?: string[];
|
||||
}
|
||||
|
||||
export declare interface SourceLocation {
|
||||
start: Position;
|
||||
end: Position;
|
||||
source?: string;
|
||||
}
|
||||
|
||||
export declare interface TextNode extends Node_2 {
|
||||
type: NodeTypes.Text;
|
||||
value?: string;
|
||||
/* Excluded from this release type: v */
|
||||
}
|
||||
|
||||
export declare interface TokenizeOptions {
|
||||
location?: boolean;
|
||||
onError?: CompileErrorHandler;
|
||||
}
|
||||
|
||||
export declare interface TransformOptions {
|
||||
onError?: CompileErrorHandler;
|
||||
}
|
||||
|
||||
export { }
|
||||
1571
node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.js
generated
vendored
Normal file
1571
node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.prod.js
generated
vendored
Normal file
6
node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.prod.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js
generated
vendored
Normal file
1
node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from '../dist/message-compiler.mjs'
|
||||
1588
node_modules/@intlify/message-compiler/dist/message-compiler.global.js
generated
vendored
Normal file
1588
node_modules/@intlify/message-compiler/dist/message-compiler.global.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
node_modules/@intlify/message-compiler/dist/message-compiler.global.prod.js
generated
vendored
Normal file
6
node_modules/@intlify/message-compiler/dist/message-compiler.global.prod.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1549
node_modules/@intlify/message-compiler/dist/message-compiler.mjs
generated
vendored
Normal file
1549
node_modules/@intlify/message-compiler/dist/message-compiler.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1606
node_modules/@intlify/message-compiler/dist/message-compiler.node.mjs
generated
vendored
Normal file
1606
node_modules/@intlify/message-compiler/dist/message-compiler.node.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1600
node_modules/@intlify/message-compiler/dist/message-compiler.prod.cjs
generated
vendored
Normal file
1600
node_modules/@intlify/message-compiler/dist/message-compiler.prod.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/message-compiler.prod.cjs')
|
||||
} else {
|
||||
module.exports = require('./dist/message-compiler.cjs')
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
"name": "@intlify/message-compiler",
|
||||
"version": "9.10.2",
|
||||
"description": "@intlify/message-compiler",
|
||||
"keywords": [
|
||||
"compiler",
|
||||
"i18n",
|
||||
"internationalization",
|
||||
"intlify",
|
||||
"message-format"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "kazuya kawaguchi",
|
||||
"email": "kawakazu80@gmail.com"
|
||||
},
|
||||
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/message-compiler#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/intlify/vue-i18n-next.git",
|
||||
"directory": "packages/message-compiler"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/intlify/vue-i18n-next/issues"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"main": "index.js",
|
||||
"module": "dist/message-compiler.mjs",
|
||||
"unpkg": "dist/message-compiler.global.js",
|
||||
"jsdelivr": "dist/message-compiler.global.js",
|
||||
"types": "dist/message-compiler.d.ts",
|
||||
"dependencies": {
|
||||
"source-map-js": "^1.0.2",
|
||||
"@intlify/shared": "9.10.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "IntlifyMessageCompiler",
|
||||
"formats": [
|
||||
"mjs",
|
||||
"mjs-node",
|
||||
"browser",
|
||||
"cjs",
|
||||
"global"
|
||||
],
|
||||
"enableFullBundleForEsmBrowser": true
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/message-compiler.d.ts",
|
||||
"browser": "./dist/message-compiler.esm-browser.js",
|
||||
"node": {
|
||||
"import": {
|
||||
"production": "./dist/message-compiler.node.mjs",
|
||||
"development": "./dist/message-compiler.node.mjs",
|
||||
"default": "./dist/message-compiler.node.mjs"
|
||||
},
|
||||
"require": {
|
||||
"production": "./dist/message-compiler.prod.cjs",
|
||||
"development": "./dist/message-compiler.cjs",
|
||||
"default": "./index.js"
|
||||
}
|
||||
},
|
||||
"import": "./dist/message-compiler.mjs"
|
||||
},
|
||||
"./dist/*": "./dist/*",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"funding": "https://github.com/sponsors/kazupon",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 kazuya kawaguchi
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# @intlify/shared
|
||||
|
||||
The shared utility package for intlify project
|
||||
|
||||
## Forks
|
||||
The implementation of this module is contains code forked from other packages or projects:
|
||||
|
||||
- [@vue/shared](https://github.com/vuejs/vue-next/tree/master/packages/shared)
|
||||
- Useful Utilities at `utils.ts`
|
||||
- Author: Evan You
|
||||
- License: MIT
|
||||
- Event Emitter at `emitter.ts` and `emittable.ts`
|
||||
- Author: Jason Miller
|
||||
- License: MIT
|
||||
|
||||
## :copyright: License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
|
|
@ -0,0 +1,272 @@
|
|||
/*!
|
||||
* shared v9.10.2
|
||||
* (c) 2024 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Original Utilities
|
||||
* written by kazuya kawaguchi
|
||||
*/
|
||||
const inBrowser = typeof window !== 'undefined';
|
||||
exports.mark = void 0;
|
||||
exports.measure = void 0;
|
||||
{
|
||||
const perf = inBrowser && window.performance;
|
||||
if (perf &&
|
||||
perf.mark &&
|
||||
perf.measure &&
|
||||
perf.clearMarks &&
|
||||
// @ts-ignore browser compat
|
||||
perf.clearMeasures) {
|
||||
exports.mark = (tag) => {
|
||||
perf.mark(tag);
|
||||
};
|
||||
exports.measure = (name, startTag, endTag) => {
|
||||
perf.measure(name, startTag, endTag);
|
||||
perf.clearMarks(startTag);
|
||||
perf.clearMarks(endTag);
|
||||
};
|
||||
}
|
||||
}
|
||||
const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
|
||||
/* eslint-disable */
|
||||
function format(message, ...args) {
|
||||
if (args.length === 1 && isObject(args[0])) {
|
||||
args = args[0];
|
||||
}
|
||||
if (!args || !args.hasOwnProperty) {
|
||||
args = {};
|
||||
}
|
||||
return message.replace(RE_ARGS, (match, identifier) => {
|
||||
return args.hasOwnProperty(identifier) ? args[identifier] : '';
|
||||
});
|
||||
}
|
||||
const makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name);
|
||||
const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
|
||||
const friendlyJSONstringify = (json) => JSON.stringify(json)
|
||||
.replace(/\u2028/g, '\\u2028')
|
||||
.replace(/\u2029/g, '\\u2029')
|
||||
.replace(/\u0027/g, '\\u0027');
|
||||
const isNumber = (val) => typeof val === 'number' && isFinite(val);
|
||||
const isDate = (val) => toTypeString(val) === '[object Date]';
|
||||
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
||||
const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
|
||||
const assign = Object.assign;
|
||||
let _globalThis;
|
||||
const getGlobalThis = () => {
|
||||
// prettier-ignore
|
||||
return (_globalThis ||
|
||||
(_globalThis =
|
||||
typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: {}));
|
||||
};
|
||||
function escapeHtml(rawText) {
|
||||
return rawText
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
function hasOwn(obj, key) {
|
||||
return hasOwnProperty.call(obj, key);
|
||||
}
|
||||
/* eslint-enable */
|
||||
/**
|
||||
* Useful Utilities By Evan you
|
||||
* Modified by kazuya kawaguchi
|
||||
* MIT License
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts
|
||||
*/
|
||||
const isArray = Array.isArray;
|
||||
const isFunction = (val) => typeof val === 'function';
|
||||
const isString = (val) => typeof val === 'string';
|
||||
const isBoolean = (val) => typeof val === 'boolean';
|
||||
const isSymbol = (val) => typeof val === 'symbol';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isObject = (val) => val !== null && typeof val === 'object';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isPromise = (val) => {
|
||||
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
||||
};
|
||||
const objectToString = Object.prototype.toString;
|
||||
const toTypeString = (value) => objectToString.call(value);
|
||||
const isPlainObject = (val) => {
|
||||
if (!isObject(val))
|
||||
return false;
|
||||
const proto = Object.getPrototypeOf(val);
|
||||
return proto === null || proto.constructor === Object;
|
||||
};
|
||||
// for converting list and named values to displayed strings.
|
||||
const toDisplayString = (val) => {
|
||||
return val == null
|
||||
? ''
|
||||
: isArray(val) || (isPlainObject(val) && val.toString === objectToString)
|
||||
? JSON.stringify(val, null, 2)
|
||||
: String(val);
|
||||
};
|
||||
function join(items, separator = '') {
|
||||
return items.reduce((str, item, index) => (index === 0 ? str + item : str + separator + item), '');
|
||||
}
|
||||
const RANGE = 2;
|
||||
function generateCodeFrame(source, start = 0, end = source.length) {
|
||||
const lines = source.split(/\r?\n/);
|
||||
let count = 0;
|
||||
const res = [];
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
count += lines[i].length + 1;
|
||||
if (count >= start) {
|
||||
for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {
|
||||
if (j < 0 || j >= lines.length)
|
||||
continue;
|
||||
const line = j + 1;
|
||||
res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);
|
||||
const lineLength = lines[j].length;
|
||||
if (j === i) {
|
||||
// push underline
|
||||
const pad = start - (count - lineLength) + 1;
|
||||
const length = Math.max(1, end > count ? lineLength - pad : end - start);
|
||||
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
|
||||
}
|
||||
else if (j > i) {
|
||||
if (end > count) {
|
||||
const length = Math.max(Math.min(end - count, lineLength), 1);
|
||||
res.push(` | ` + '^'.repeat(length));
|
||||
}
|
||||
count += lineLength + 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res.join('\n');
|
||||
}
|
||||
function incrementer(code) {
|
||||
let current = code;
|
||||
return () => ++current;
|
||||
}
|
||||
|
||||
function warn(msg, err) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(`[intlify] ` + msg);
|
||||
/* istanbul ignore if */
|
||||
if (err) {
|
||||
console.warn(err.stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
const hasWarned = {};
|
||||
function warnOnce(msg) {
|
||||
if (!hasWarned[msg]) {
|
||||
hasWarned[msg] = true;
|
||||
warn(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event emitter, forked from the below:
|
||||
* - original repository url: https://github.com/developit/mitt
|
||||
* - code url: https://github.com/developit/mitt/blob/master/src/index.ts
|
||||
* - author: Jason Miller (https://github.com/developit)
|
||||
* - license: MIT
|
||||
*/
|
||||
/**
|
||||
* Create a event emitter
|
||||
*
|
||||
* @returns An event emitter
|
||||
*/
|
||||
function createEmitter() {
|
||||
const events = new Map();
|
||||
const emitter = {
|
||||
events,
|
||||
on(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
const added = handlers && handlers.push(handler);
|
||||
if (!added) {
|
||||
events.set(event, [handler]);
|
||||
}
|
||||
},
|
||||
off(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
if (handlers) {
|
||||
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
},
|
||||
emit(event, payload) {
|
||||
(events.get(event) || [])
|
||||
.slice()
|
||||
.map(handler => handler(payload));
|
||||
(events.get('*') || [])
|
||||
.slice()
|
||||
.map(handler => handler(event, payload));
|
||||
}
|
||||
};
|
||||
return emitter;
|
||||
}
|
||||
|
||||
const isNotObjectOrIsArray = (val) => !isObject(val) || isArray(val);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
function deepCopy(src, des) {
|
||||
// src and des should both be objects, and none of them can be a array
|
||||
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
|
||||
throw new Error('Invalid value');
|
||||
}
|
||||
const stack = [{ src, des }];
|
||||
while (stack.length) {
|
||||
const { src, des } = stack.pop();
|
||||
Object.keys(src).forEach(key => {
|
||||
if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
|
||||
// replace with src[key] when:
|
||||
// src[key] or des[key] is not an object, or
|
||||
// src[key] or des[key] is an array
|
||||
des[key] = src[key];
|
||||
}
|
||||
else {
|
||||
// src[key] and des[key] are both objects, merge them
|
||||
stack.push({ src: src[key], des: des[key] });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
exports.assign = assign;
|
||||
exports.createEmitter = createEmitter;
|
||||
exports.deepCopy = deepCopy;
|
||||
exports.escapeHtml = escapeHtml;
|
||||
exports.format = format;
|
||||
exports.friendlyJSONstringify = friendlyJSONstringify;
|
||||
exports.generateCodeFrame = generateCodeFrame;
|
||||
exports.generateFormatCacheKey = generateFormatCacheKey;
|
||||
exports.getGlobalThis = getGlobalThis;
|
||||
exports.hasOwn = hasOwn;
|
||||
exports.inBrowser = inBrowser;
|
||||
exports.incrementer = incrementer;
|
||||
exports.isArray = isArray;
|
||||
exports.isBoolean = isBoolean;
|
||||
exports.isDate = isDate;
|
||||
exports.isEmptyObject = isEmptyObject;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isNumber = isNumber;
|
||||
exports.isObject = isObject;
|
||||
exports.isPlainObject = isPlainObject;
|
||||
exports.isPromise = isPromise;
|
||||
exports.isRegExp = isRegExp;
|
||||
exports.isString = isString;
|
||||
exports.isSymbol = isSymbol;
|
||||
exports.join = join;
|
||||
exports.makeSymbol = makeSymbol;
|
||||
exports.objectToString = objectToString;
|
||||
exports.toDisplayString = toDisplayString;
|
||||
exports.toTypeString = toTypeString;
|
||||
exports.warn = warn;
|
||||
exports.warnOnce = warnOnce;
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('../dist/shared.cjs')
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports = require('../dist/shared.prod.cjs')
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
|
||||
export declare const assign: {
|
||||
<T extends {}, U>(target: T, source: U): T & U;
|
||||
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
||||
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
||||
(target: object, ...sources: any[]): any;
|
||||
};
|
||||
|
||||
export declare interface BaseError {
|
||||
code: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a event emitter
|
||||
*
|
||||
* @returns An event emitter
|
||||
*/
|
||||
export declare function createEmitter<Events extends Record<EventType, unknown>>(): Emittable<Events>;
|
||||
|
||||
export declare function deepCopy(src: any, des: any): void;
|
||||
|
||||
/**
|
||||
* Event emitter interface
|
||||
*/
|
||||
export declare interface Emittable<Events extends Record<EventType, unknown> = {}> {
|
||||
/**
|
||||
* A map of event names of registered event handlers
|
||||
*/
|
||||
events: EventHandlerMap<Events>;
|
||||
/**
|
||||
* Register an event handler with the event type
|
||||
*
|
||||
* @param event - An {@link EventType}
|
||||
* @param handler - An {@link EventHandler}, or a {@link WildcardEventHandler} if you are specified "*"
|
||||
*/
|
||||
on<Key extends keyof Events>(event: Key | '*', handler: EventHandler<Events[keyof Events]> | WildcardEventHandler<Events>): void;
|
||||
/**
|
||||
* Unregister an event handler for the event type
|
||||
*
|
||||
* @param event - An {@link EventType}
|
||||
* @param handler - An {@link EventHandler}, or a {@link WildcardEventHandler} if you are specified "*"
|
||||
*/
|
||||
off<Key extends keyof Events>(event: Key | '*', handler: EventHandler<Events[keyof Events]> | WildcardEventHandler<Events>): void;
|
||||
/**
|
||||
* Invoke all handlers with the event type
|
||||
*
|
||||
* @remarks
|
||||
* Note Manually firing "*" handlers should be not supported
|
||||
*
|
||||
* @param event - An {@link EventType}
|
||||
* @param payload - An event payload, optional
|
||||
*/
|
||||
emit<Key extends keyof Events>(event: Key, payload?: Events[keyof Events]): void;
|
||||
}
|
||||
|
||||
export declare function escapeHtml(rawText: string): string;
|
||||
|
||||
/**
|
||||
* Event handler
|
||||
*/
|
||||
export declare type EventHandler<T = unknown> = (payload?: T) => void;
|
||||
|
||||
/**
|
||||
* Event handler list
|
||||
*/
|
||||
export declare type EventHandlerList<T = unknown> = Array<EventHandler<T>>;
|
||||
|
||||
/**
|
||||
* Event handler map
|
||||
*/
|
||||
export declare type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildcardEventHandlerList<Events>>;
|
||||
|
||||
/**
|
||||
* Event type
|
||||
*/
|
||||
export declare type EventType = string | symbol;
|
||||
|
||||
export declare function format(message: string, ...args: any): string;
|
||||
|
||||
export declare const friendlyJSONstringify: (json: unknown) => string;
|
||||
|
||||
export declare function generateCodeFrame(source: string, start?: number, end?: number): string;
|
||||
|
||||
export declare const generateFormatCacheKey: (locale: string, key: string, source: string) => string;
|
||||
|
||||
export declare const getGlobalThis: () => any;
|
||||
|
||||
export declare function hasOwn(obj: object | Array<any>, key: string): boolean;
|
||||
|
||||
/**
|
||||
* Original Utilities
|
||||
* written by kazuya kawaguchi
|
||||
*/
|
||||
export declare const inBrowser: boolean;
|
||||
|
||||
export declare function incrementer(code: number): () => number;
|
||||
|
||||
/**
|
||||
* Useful Utilities By Evan you
|
||||
* Modified by kazuya kawaguchi
|
||||
* MIT License
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts
|
||||
*/
|
||||
export declare const isArray: (arg: any) => arg is any[];
|
||||
|
||||
export declare const isBoolean: (val: unknown) => val is boolean;
|
||||
|
||||
export declare const isDate: (val: unknown) => val is Date;
|
||||
|
||||
export declare const isEmptyObject: (val: unknown) => val is boolean;
|
||||
|
||||
export declare const isFunction: (val: unknown) => val is Function;
|
||||
|
||||
export declare const isNumber: (val: unknown) => val is number;
|
||||
|
||||
export declare const isObject: (val: unknown) => val is Record<any, any>;
|
||||
|
||||
export declare const isPlainObject: (val: unknown) => val is object;
|
||||
|
||||
export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
||||
|
||||
export declare const isRegExp: (val: unknown) => val is RegExp;
|
||||
|
||||
export declare const isString: (val: unknown) => val is string;
|
||||
|
||||
export declare const isSymbol: (val: unknown) => val is symbol;
|
||||
|
||||
export declare function join(items: string[], separator?: string): string;
|
||||
|
||||
export declare const makeSymbol: (name: string, shareable?: boolean) => symbol;
|
||||
|
||||
export declare let mark: (tag: string) => void | undefined;
|
||||
|
||||
export declare let measure: (name: string, startTag: string, endTag: string) => void | undefined;
|
||||
|
||||
export declare const objectToString: () => string;
|
||||
|
||||
export declare const toDisplayString: (val: unknown) => string;
|
||||
|
||||
export declare const toTypeString: (value: unknown) => string;
|
||||
|
||||
export declare function warn(msg: string, err?: Error): void;
|
||||
|
||||
export declare function warnOnce(msg: string): void;
|
||||
|
||||
/**
|
||||
* Wildcard event handler
|
||||
*/
|
||||
export declare type WildcardEventHandler<T = Record<string, unknown>> = (event: keyof T, payload?: T[keyof T]) => void;
|
||||
|
||||
/**
|
||||
* Wildcard event handler list
|
||||
*/
|
||||
export declare type WildcardEventHandlerList<T = Record<string, unknown>> = Array<WildcardEventHandler<T>>;
|
||||
|
||||
export { }
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
/*!
|
||||
* shared v9.10.2
|
||||
* (c) 2024 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Original Utilities
|
||||
* written by kazuya kawaguchi
|
||||
*/
|
||||
const inBrowser = typeof window !== 'undefined';
|
||||
let mark;
|
||||
let measure;
|
||||
{
|
||||
const perf = inBrowser && window.performance;
|
||||
if (perf &&
|
||||
perf.mark &&
|
||||
perf.measure &&
|
||||
perf.clearMarks &&
|
||||
// @ts-ignore browser compat
|
||||
perf.clearMeasures) {
|
||||
mark = (tag) => {
|
||||
perf.mark(tag);
|
||||
};
|
||||
measure = (name, startTag, endTag) => {
|
||||
perf.measure(name, startTag, endTag);
|
||||
perf.clearMarks(startTag);
|
||||
perf.clearMarks(endTag);
|
||||
};
|
||||
}
|
||||
}
|
||||
const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
|
||||
/* eslint-disable */
|
||||
function format(message, ...args) {
|
||||
if (args.length === 1 && isObject(args[0])) {
|
||||
args = args[0];
|
||||
}
|
||||
if (!args || !args.hasOwnProperty) {
|
||||
args = {};
|
||||
}
|
||||
return message.replace(RE_ARGS, (match, identifier) => {
|
||||
return args.hasOwnProperty(identifier) ? args[identifier] : '';
|
||||
});
|
||||
}
|
||||
const makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name);
|
||||
const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
|
||||
const friendlyJSONstringify = (json) => JSON.stringify(json)
|
||||
.replace(/\u2028/g, '\\u2028')
|
||||
.replace(/\u2029/g, '\\u2029')
|
||||
.replace(/\u0027/g, '\\u0027');
|
||||
const isNumber = (val) => typeof val === 'number' && isFinite(val);
|
||||
const isDate = (val) => toTypeString(val) === '[object Date]';
|
||||
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
||||
const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
|
||||
const assign = Object.assign;
|
||||
let _globalThis;
|
||||
const getGlobalThis = () => {
|
||||
// prettier-ignore
|
||||
return (_globalThis ||
|
||||
(_globalThis =
|
||||
typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: {}));
|
||||
};
|
||||
function escapeHtml(rawText) {
|
||||
return rawText
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
function hasOwn(obj, key) {
|
||||
return hasOwnProperty.call(obj, key);
|
||||
}
|
||||
/* eslint-enable */
|
||||
/**
|
||||
* Useful Utilities By Evan you
|
||||
* Modified by kazuya kawaguchi
|
||||
* MIT License
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts
|
||||
*/
|
||||
const isArray = Array.isArray;
|
||||
const isFunction = (val) => typeof val === 'function';
|
||||
const isString = (val) => typeof val === 'string';
|
||||
const isBoolean = (val) => typeof val === 'boolean';
|
||||
const isSymbol = (val) => typeof val === 'symbol';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isObject = (val) => val !== null && typeof val === 'object';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isPromise = (val) => {
|
||||
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
||||
};
|
||||
const objectToString = Object.prototype.toString;
|
||||
const toTypeString = (value) => objectToString.call(value);
|
||||
const isPlainObject = (val) => {
|
||||
if (!isObject(val))
|
||||
return false;
|
||||
const proto = Object.getPrototypeOf(val);
|
||||
return proto === null || proto.constructor === Object;
|
||||
};
|
||||
// for converting list and named values to displayed strings.
|
||||
const toDisplayString = (val) => {
|
||||
return val == null
|
||||
? ''
|
||||
: isArray(val) || (isPlainObject(val) && val.toString === objectToString)
|
||||
? JSON.stringify(val, null, 2)
|
||||
: String(val);
|
||||
};
|
||||
function join(items, separator = '') {
|
||||
return items.reduce((str, item, index) => (index === 0 ? str + item : str + separator + item), '');
|
||||
}
|
||||
const RANGE = 2;
|
||||
function generateCodeFrame(source, start = 0, end = source.length) {
|
||||
const lines = source.split(/\r?\n/);
|
||||
let count = 0;
|
||||
const res = [];
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
count += lines[i].length + 1;
|
||||
if (count >= start) {
|
||||
for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {
|
||||
if (j < 0 || j >= lines.length)
|
||||
continue;
|
||||
const line = j + 1;
|
||||
res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);
|
||||
const lineLength = lines[j].length;
|
||||
if (j === i) {
|
||||
// push underline
|
||||
const pad = start - (count - lineLength) + 1;
|
||||
const length = Math.max(1, end > count ? lineLength - pad : end - start);
|
||||
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
|
||||
}
|
||||
else if (j > i) {
|
||||
if (end > count) {
|
||||
const length = Math.max(Math.min(end - count, lineLength), 1);
|
||||
res.push(` | ` + '^'.repeat(length));
|
||||
}
|
||||
count += lineLength + 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res.join('\n');
|
||||
}
|
||||
function incrementer(code) {
|
||||
let current = code;
|
||||
return () => ++current;
|
||||
}
|
||||
|
||||
function warn(msg, err) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(`[intlify] ` + msg);
|
||||
/* istanbul ignore if */
|
||||
if (err) {
|
||||
console.warn(err.stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
const hasWarned = {};
|
||||
function warnOnce(msg) {
|
||||
if (!hasWarned[msg]) {
|
||||
hasWarned[msg] = true;
|
||||
warn(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event emitter, forked from the below:
|
||||
* - original repository url: https://github.com/developit/mitt
|
||||
* - code url: https://github.com/developit/mitt/blob/master/src/index.ts
|
||||
* - author: Jason Miller (https://github.com/developit)
|
||||
* - license: MIT
|
||||
*/
|
||||
/**
|
||||
* Create a event emitter
|
||||
*
|
||||
* @returns An event emitter
|
||||
*/
|
||||
function createEmitter() {
|
||||
const events = new Map();
|
||||
const emitter = {
|
||||
events,
|
||||
on(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
const added = handlers && handlers.push(handler);
|
||||
if (!added) {
|
||||
events.set(event, [handler]);
|
||||
}
|
||||
},
|
||||
off(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
if (handlers) {
|
||||
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
},
|
||||
emit(event, payload) {
|
||||
(events.get(event) || [])
|
||||
.slice()
|
||||
.map(handler => handler(payload));
|
||||
(events.get('*') || [])
|
||||
.slice()
|
||||
.map(handler => handler(event, payload));
|
||||
}
|
||||
};
|
||||
return emitter;
|
||||
}
|
||||
|
||||
const isNotObjectOrIsArray = (val) => !isObject(val) || isArray(val);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
function deepCopy(src, des) {
|
||||
// src and des should both be objects, and none of them can be a array
|
||||
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
|
||||
throw new Error('Invalid value');
|
||||
}
|
||||
const stack = [{ src, des }];
|
||||
while (stack.length) {
|
||||
const { src, des } = stack.pop();
|
||||
Object.keys(src).forEach(key => {
|
||||
if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
|
||||
// replace with src[key] when:
|
||||
// src[key] or des[key] is not an object, or
|
||||
// src[key] or des[key] is an array
|
||||
des[key] = src[key];
|
||||
}
|
||||
else {
|
||||
// src[key] and des[key] are both objects, merge them
|
||||
stack.push({ src: src[key], des: des[key] });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { assign, createEmitter, deepCopy, escapeHtml, format, friendlyJSONstringify, generateCodeFrame, generateFormatCacheKey, getGlobalThis, hasOwn, inBrowser, incrementer, isArray, isBoolean, isDate, isEmptyObject, isFunction, isNumber, isObject, isPlainObject, isPromise, isRegExp, isString, isSymbol, join, makeSymbol, mark, measure, objectToString, toDisplayString, toTypeString, warn, warnOnce };
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
/*!
|
||||
* shared v9.10.2
|
||||
* (c) 2024 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
const inBrowser="undefined"!=typeof window;let mark,measure;const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}const makeSymbol=(e,t=!1)=>t?Symbol.for(e):Symbol(e),generateFormatCacheKey=(e,t,n)=>friendlyJSONstringify({l:e,k:t,s:n}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign;let _globalThis;const getGlobalThis=()=>_globalThis||(_globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(e,t){return hasOwnProperty.call(e,t)}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isSymbol=e=>"symbol"==typeof e,isObject=e=>null!==e&&"object"==typeof e,isPromise=e=>isObject(e)&&isFunction(e.then)&&isFunction(e.catch),objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>{if(!isObject(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object},toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}const RANGE=2;function generateCodeFrame(e,t=0,n=e.length){const r=e.split(/\r?\n/);let o=0;const i=[];for(let s=0;s<r.length;s++)if(o+=r[s].length+1,o>=t){for(let e=s-2;e<=s+2||n>o;e++){if(e<0||e>=r.length)continue;const a=e+1;i.push(`${a}${" ".repeat(3-String(a).length)}| ${r[e]}`);const c=r[e].length;if(e===s){const e=t-(o-c)+1,r=Math.max(1,n>o?c-e:n-t);i.push(" | "+" ".repeat(e)+"^".repeat(r))}else if(e>s){if(n>o){const e=Math.max(Math.min(n-o,c),1);i.push(" | "+"^".repeat(e))}o+=c+1}}break}return i.join("\n")}function incrementer(e){let t=e;return()=>++t}function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const hasWarned={};function warnOnce(e){hasWarned[e]||(hasWarned[e]=!0,warn(e))}function createEmitter(){const e=new Map;return{events:e,on(t,n){const r=e.get(t);r&&r.push(n)||e.set(t,[n])},off(t,n){const r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit(t,n){(e.get(t)||[]).slice().map((e=>e(n))),(e.get("*")||[]).slice().map((e=>e(t,n)))}}}const isNotObjectOrIsArray=e=>!isObject(e)||isArray(e);function deepCopy(e,t){if(isNotObjectOrIsArray(e)||isNotObjectOrIsArray(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:e,des:t}=n.pop();Object.keys(e).forEach((r=>{isNotObjectOrIsArray(e[r])||isNotObjectOrIsArray(t[r])?t[r]=e[r]:n.push({src:e[r],des:t[r]})}))}}export{assign,createEmitter,deepCopy,escapeHtml,format,friendlyJSONstringify,generateCodeFrame,generateFormatCacheKey,getGlobalThis,hasOwn,inBrowser,incrementer,isArray,isBoolean,isDate,isEmptyObject,isFunction,isNumber,isObject,isPlainObject,isPromise,isRegExp,isString,isSymbol,join,makeSymbol,mark,measure,objectToString,toDisplayString,toTypeString,warn,warnOnce};
|
||||
|
|
@ -0,0 +1 @@
|
|||
export * from '../dist/shared.mjs'
|
||||
|
|
@ -0,0 +1,240 @@
|
|||
/*!
|
||||
* shared v9.10.2
|
||||
* (c) 2024 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Original Utilities
|
||||
* written by kazuya kawaguchi
|
||||
*/
|
||||
const inBrowser = typeof window !== 'undefined';
|
||||
let mark;
|
||||
let measure;
|
||||
if ((process.env.NODE_ENV !== 'production')) {
|
||||
const perf = inBrowser && window.performance;
|
||||
if (perf &&
|
||||
perf.mark &&
|
||||
perf.measure &&
|
||||
perf.clearMarks &&
|
||||
// @ts-ignore browser compat
|
||||
perf.clearMeasures) {
|
||||
mark = (tag) => {
|
||||
perf.mark(tag);
|
||||
};
|
||||
measure = (name, startTag, endTag) => {
|
||||
perf.measure(name, startTag, endTag);
|
||||
perf.clearMarks(startTag);
|
||||
perf.clearMarks(endTag);
|
||||
};
|
||||
}
|
||||
}
|
||||
const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
|
||||
/* eslint-disable */
|
||||
function format(message, ...args) {
|
||||
if (args.length === 1 && isObject(args[0])) {
|
||||
args = args[0];
|
||||
}
|
||||
if (!args || !args.hasOwnProperty) {
|
||||
args = {};
|
||||
}
|
||||
return message.replace(RE_ARGS, (match, identifier) => {
|
||||
return args.hasOwnProperty(identifier) ? args[identifier] : '';
|
||||
});
|
||||
}
|
||||
const makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name);
|
||||
const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
|
||||
const friendlyJSONstringify = (json) => JSON.stringify(json)
|
||||
.replace(/\u2028/g, '\\u2028')
|
||||
.replace(/\u2029/g, '\\u2029')
|
||||
.replace(/\u0027/g, '\\u0027');
|
||||
const isNumber = (val) => typeof val === 'number' && isFinite(val);
|
||||
const isDate = (val) => toTypeString(val) === '[object Date]';
|
||||
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
||||
const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
|
||||
const assign = Object.assign;
|
||||
let _globalThis;
|
||||
const getGlobalThis = () => {
|
||||
// prettier-ignore
|
||||
return (_globalThis ||
|
||||
(_globalThis =
|
||||
typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: {}));
|
||||
};
|
||||
function escapeHtml(rawText) {
|
||||
return rawText
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
function hasOwn(obj, key) {
|
||||
return hasOwnProperty.call(obj, key);
|
||||
}
|
||||
/* eslint-enable */
|
||||
/**
|
||||
* Useful Utilities By Evan you
|
||||
* Modified by kazuya kawaguchi
|
||||
* MIT License
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts
|
||||
*/
|
||||
const isArray = Array.isArray;
|
||||
const isFunction = (val) => typeof val === 'function';
|
||||
const isString = (val) => typeof val === 'string';
|
||||
const isBoolean = (val) => typeof val === 'boolean';
|
||||
const isSymbol = (val) => typeof val === 'symbol';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isObject = (val) => val !== null && typeof val === 'object';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isPromise = (val) => {
|
||||
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
||||
};
|
||||
const objectToString = Object.prototype.toString;
|
||||
const toTypeString = (value) => objectToString.call(value);
|
||||
const isPlainObject = (val) => {
|
||||
if (!isObject(val))
|
||||
return false;
|
||||
const proto = Object.getPrototypeOf(val);
|
||||
return proto === null || proto.constructor === Object;
|
||||
};
|
||||
// for converting list and named values to displayed strings.
|
||||
const toDisplayString = (val) => {
|
||||
return val == null
|
||||
? ''
|
||||
: isArray(val) || (isPlainObject(val) && val.toString === objectToString)
|
||||
? JSON.stringify(val, null, 2)
|
||||
: String(val);
|
||||
};
|
||||
function join(items, separator = '') {
|
||||
return items.reduce((str, item, index) => (index === 0 ? str + item : str + separator + item), '');
|
||||
}
|
||||
const RANGE = 2;
|
||||
function generateCodeFrame(source, start = 0, end = source.length) {
|
||||
const lines = source.split(/\r?\n/);
|
||||
let count = 0;
|
||||
const res = [];
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
count += lines[i].length + 1;
|
||||
if (count >= start) {
|
||||
for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {
|
||||
if (j < 0 || j >= lines.length)
|
||||
continue;
|
||||
const line = j + 1;
|
||||
res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);
|
||||
const lineLength = lines[j].length;
|
||||
if (j === i) {
|
||||
// push underline
|
||||
const pad = start - (count - lineLength) + 1;
|
||||
const length = Math.max(1, end > count ? lineLength - pad : end - start);
|
||||
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
|
||||
}
|
||||
else if (j > i) {
|
||||
if (end > count) {
|
||||
const length = Math.max(Math.min(end - count, lineLength), 1);
|
||||
res.push(` | ` + '^'.repeat(length));
|
||||
}
|
||||
count += lineLength + 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res.join('\n');
|
||||
}
|
||||
function incrementer(code) {
|
||||
let current = code;
|
||||
return () => ++current;
|
||||
}
|
||||
|
||||
function warn(msg, err) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(`[intlify] ` + msg);
|
||||
/* istanbul ignore if */
|
||||
if (err) {
|
||||
console.warn(err.stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
const hasWarned = {};
|
||||
function warnOnce(msg) {
|
||||
if (!hasWarned[msg]) {
|
||||
hasWarned[msg] = true;
|
||||
warn(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event emitter, forked from the below:
|
||||
* - original repository url: https://github.com/developit/mitt
|
||||
* - code url: https://github.com/developit/mitt/blob/master/src/index.ts
|
||||
* - author: Jason Miller (https://github.com/developit)
|
||||
* - license: MIT
|
||||
*/
|
||||
/**
|
||||
* Create a event emitter
|
||||
*
|
||||
* @returns An event emitter
|
||||
*/
|
||||
function createEmitter() {
|
||||
const events = new Map();
|
||||
const emitter = {
|
||||
events,
|
||||
on(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
const added = handlers && handlers.push(handler);
|
||||
if (!added) {
|
||||
events.set(event, [handler]);
|
||||
}
|
||||
},
|
||||
off(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
if (handlers) {
|
||||
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
},
|
||||
emit(event, payload) {
|
||||
(events.get(event) || [])
|
||||
.slice()
|
||||
.map(handler => handler(payload));
|
||||
(events.get('*') || [])
|
||||
.slice()
|
||||
.map(handler => handler(event, payload));
|
||||
}
|
||||
};
|
||||
return emitter;
|
||||
}
|
||||
|
||||
const isNotObjectOrIsArray = (val) => !isObject(val) || isArray(val);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
function deepCopy(src, des) {
|
||||
// src and des should both be objects, and none of them can be a array
|
||||
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
|
||||
throw new Error('Invalid value');
|
||||
}
|
||||
const stack = [{ src, des }];
|
||||
while (stack.length) {
|
||||
const { src, des } = stack.pop();
|
||||
Object.keys(src).forEach(key => {
|
||||
if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
|
||||
// replace with src[key] when:
|
||||
// src[key] or des[key] is not an object, or
|
||||
// src[key] or des[key] is an array
|
||||
des[key] = src[key];
|
||||
}
|
||||
else {
|
||||
// src[key] and des[key] are both objects, merge them
|
||||
stack.push({ src: src[key], des: des[key] });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export { assign, createEmitter, deepCopy, escapeHtml, format, friendlyJSONstringify, generateCodeFrame, generateFormatCacheKey, getGlobalThis, hasOwn, inBrowser, incrementer, isArray, isBoolean, isDate, isEmptyObject, isFunction, isNumber, isObject, isPlainObject, isPromise, isRegExp, isString, isSymbol, join, makeSymbol, mark, measure, objectToString, toDisplayString, toTypeString, warn, warnOnce };
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
/*!
|
||||
* shared v9.10.2
|
||||
* (c) 2024 kazuya kawaguchi
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Original Utilities
|
||||
* written by kazuya kawaguchi
|
||||
*/
|
||||
const inBrowser = typeof window !== 'undefined';
|
||||
let mark;
|
||||
let measure;
|
||||
const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g;
|
||||
/* eslint-disable */
|
||||
function format(message, ...args) {
|
||||
if (args.length === 1 && isObject(args[0])) {
|
||||
args = args[0];
|
||||
}
|
||||
if (!args || !args.hasOwnProperty) {
|
||||
args = {};
|
||||
}
|
||||
return message.replace(RE_ARGS, (match, identifier) => {
|
||||
return args.hasOwnProperty(identifier) ? args[identifier] : '';
|
||||
});
|
||||
}
|
||||
const makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name);
|
||||
const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
|
||||
const friendlyJSONstringify = (json) => JSON.stringify(json)
|
||||
.replace(/\u2028/g, '\\u2028')
|
||||
.replace(/\u2029/g, '\\u2029')
|
||||
.replace(/\u0027/g, '\\u0027');
|
||||
const isNumber = (val) => typeof val === 'number' && isFinite(val);
|
||||
const isDate = (val) => toTypeString(val) === '[object Date]';
|
||||
const isRegExp = (val) => toTypeString(val) === '[object RegExp]';
|
||||
const isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;
|
||||
const assign = Object.assign;
|
||||
let _globalThis;
|
||||
const getGlobalThis = () => {
|
||||
// prettier-ignore
|
||||
return (_globalThis ||
|
||||
(_globalThis =
|
||||
typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: typeof self !== 'undefined'
|
||||
? self
|
||||
: typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof global !== 'undefined'
|
||||
? global
|
||||
: {}));
|
||||
};
|
||||
function escapeHtml(rawText) {
|
||||
return rawText
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
}
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
function hasOwn(obj, key) {
|
||||
return hasOwnProperty.call(obj, key);
|
||||
}
|
||||
/* eslint-enable */
|
||||
/**
|
||||
* Useful Utilities By Evan you
|
||||
* Modified by kazuya kawaguchi
|
||||
* MIT License
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts
|
||||
* https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts
|
||||
*/
|
||||
const isArray = Array.isArray;
|
||||
const isFunction = (val) => typeof val === 'function';
|
||||
const isString = (val) => typeof val === 'string';
|
||||
const isBoolean = (val) => typeof val === 'boolean';
|
||||
const isSymbol = (val) => typeof val === 'symbol';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isObject = (val) => val !== null && typeof val === 'object';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isPromise = (val) => {
|
||||
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
||||
};
|
||||
const objectToString = Object.prototype.toString;
|
||||
const toTypeString = (value) => objectToString.call(value);
|
||||
const isPlainObject = (val) => {
|
||||
if (!isObject(val))
|
||||
return false;
|
||||
const proto = Object.getPrototypeOf(val);
|
||||
return proto === null || proto.constructor === Object;
|
||||
};
|
||||
// for converting list and named values to displayed strings.
|
||||
const toDisplayString = (val) => {
|
||||
return val == null
|
||||
? ''
|
||||
: isArray(val) || (isPlainObject(val) && val.toString === objectToString)
|
||||
? JSON.stringify(val, null, 2)
|
||||
: String(val);
|
||||
};
|
||||
function join(items, separator = '') {
|
||||
return items.reduce((str, item, index) => (index === 0 ? str + item : str + separator + item), '');
|
||||
}
|
||||
const RANGE = 2;
|
||||
function generateCodeFrame(source, start = 0, end = source.length) {
|
||||
const lines = source.split(/\r?\n/);
|
||||
let count = 0;
|
||||
const res = [];
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
count += lines[i].length + 1;
|
||||
if (count >= start) {
|
||||
for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {
|
||||
if (j < 0 || j >= lines.length)
|
||||
continue;
|
||||
const line = j + 1;
|
||||
res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);
|
||||
const lineLength = lines[j].length;
|
||||
if (j === i) {
|
||||
// push underline
|
||||
const pad = start - (count - lineLength) + 1;
|
||||
const length = Math.max(1, end > count ? lineLength - pad : end - start);
|
||||
res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));
|
||||
}
|
||||
else if (j > i) {
|
||||
if (end > count) {
|
||||
const length = Math.max(Math.min(end - count, lineLength), 1);
|
||||
res.push(` | ` + '^'.repeat(length));
|
||||
}
|
||||
count += lineLength + 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res.join('\n');
|
||||
}
|
||||
function incrementer(code) {
|
||||
let current = code;
|
||||
return () => ++current;
|
||||
}
|
||||
|
||||
function warn(msg, err) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(`[intlify] ` + msg);
|
||||
/* istanbul ignore if */
|
||||
if (err) {
|
||||
console.warn(err.stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
const hasWarned = {};
|
||||
function warnOnce(msg) {
|
||||
if (!hasWarned[msg]) {
|
||||
hasWarned[msg] = true;
|
||||
warn(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event emitter, forked from the below:
|
||||
* - original repository url: https://github.com/developit/mitt
|
||||
* - code url: https://github.com/developit/mitt/blob/master/src/index.ts
|
||||
* - author: Jason Miller (https://github.com/developit)
|
||||
* - license: MIT
|
||||
*/
|
||||
/**
|
||||
* Create a event emitter
|
||||
*
|
||||
* @returns An event emitter
|
||||
*/
|
||||
function createEmitter() {
|
||||
const events = new Map();
|
||||
const emitter = {
|
||||
events,
|
||||
on(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
const added = handlers && handlers.push(handler);
|
||||
if (!added) {
|
||||
events.set(event, [handler]);
|
||||
}
|
||||
},
|
||||
off(event, handler) {
|
||||
const handlers = events.get(event);
|
||||
if (handlers) {
|
||||
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
||||
}
|
||||
},
|
||||
emit(event, payload) {
|
||||
(events.get(event) || [])
|
||||
.slice()
|
||||
.map(handler => handler(payload));
|
||||
(events.get('*') || [])
|
||||
.slice()
|
||||
.map(handler => handler(event, payload));
|
||||
}
|
||||
};
|
||||
return emitter;
|
||||
}
|
||||
|
||||
const isNotObjectOrIsArray = (val) => !isObject(val) || isArray(val);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
||||
function deepCopy(src, des) {
|
||||
// src and des should both be objects, and none of them can be a array
|
||||
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
|
||||
throw new Error('Invalid value');
|
||||
}
|
||||
const stack = [{ src, des }];
|
||||
while (stack.length) {
|
||||
const { src, des } = stack.pop();
|
||||
Object.keys(src).forEach(key => {
|
||||
if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
|
||||
// replace with src[key] when:
|
||||
// src[key] or des[key] is not an object, or
|
||||
// src[key] or des[key] is an array
|
||||
des[key] = src[key];
|
||||
}
|
||||
else {
|
||||
// src[key] and des[key] are both objects, merge them
|
||||
stack.push({ src: src[key], des: des[key] });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
exports.assign = assign;
|
||||
exports.createEmitter = createEmitter;
|
||||
exports.deepCopy = deepCopy;
|
||||
exports.escapeHtml = escapeHtml;
|
||||
exports.format = format;
|
||||
exports.friendlyJSONstringify = friendlyJSONstringify;
|
||||
exports.generateCodeFrame = generateCodeFrame;
|
||||
exports.generateFormatCacheKey = generateFormatCacheKey;
|
||||
exports.getGlobalThis = getGlobalThis;
|
||||
exports.hasOwn = hasOwn;
|
||||
exports.inBrowser = inBrowser;
|
||||
exports.incrementer = incrementer;
|
||||
exports.isArray = isArray;
|
||||
exports.isBoolean = isBoolean;
|
||||
exports.isDate = isDate;
|
||||
exports.isEmptyObject = isEmptyObject;
|
||||
exports.isFunction = isFunction;
|
||||
exports.isNumber = isNumber;
|
||||
exports.isObject = isObject;
|
||||
exports.isPlainObject = isPlainObject;
|
||||
exports.isPromise = isPromise;
|
||||
exports.isRegExp = isRegExp;
|
||||
exports.isString = isString;
|
||||
exports.isSymbol = isSymbol;
|
||||
exports.join = join;
|
||||
exports.makeSymbol = makeSymbol;
|
||||
exports.mark = mark;
|
||||
exports.measure = measure;
|
||||
exports.objectToString = objectToString;
|
||||
exports.toDisplayString = toDisplayString;
|
||||
exports.toTypeString = toTypeString;
|
||||
exports.warn = warn;
|
||||
exports.warnOnce = warnOnce;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/shared.prod.cjs')
|
||||
} else {
|
||||
module.exports = require('./dist/shared.cjs')
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"name": "@intlify/shared",
|
||||
"version": "9.10.2",
|
||||
"description": "@intlify/shared",
|
||||
"keywords": [
|
||||
"i18n",
|
||||
"internationalization",
|
||||
"intlify",
|
||||
"utitlity"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "kazuya kawaguchi",
|
||||
"email": "kawakazu80@gmail.com"
|
||||
},
|
||||
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/shared#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/intlify/vue-i18n-next.git",
|
||||
"directory": "packages/shared"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/intlify/vue-i18n-next/issues"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"main": "index.js",
|
||||
"module": "dist/shared.mjs",
|
||||
"types": "dist/shared.d.ts",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "IntlifyShared",
|
||||
"formats": [
|
||||
"mjs",
|
||||
"browser",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/shared.d.ts",
|
||||
"import": "./dist/shared.mjs",
|
||||
"browser": "./dist/shared.esm-browser.js",
|
||||
"node": {
|
||||
"import": {
|
||||
"production": "./dist/shared.prod.cjs",
|
||||
"development": "./dist/shared.mjs",
|
||||
"default": "./dist/shared.mjs"
|
||||
},
|
||||
"require": {
|
||||
"production": "./dist/shared.prod.cjs",
|
||||
"development": "./dist/shared.cjs",
|
||||
"default": "./index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"./dist/*": "./dist/*",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"funding": "https://github.com/sponsors/kazupon",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2015 Rich Harris
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1,200 @@
|
|||
# @jridgewell/sourcemap-codec
|
||||
|
||||
Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit).
|
||||
|
||||
|
||||
## Why?
|
||||
|
||||
Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap.
|
||||
|
||||
This package makes the process slightly easier.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @jridgewell/sourcemap-codec
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { encode, decode } from '@jridgewell/sourcemap-codec';
|
||||
|
||||
var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );
|
||||
|
||||
assert.deepEqual( decoded, [
|
||||
// the first line (of the generated code) has no mappings,
|
||||
// as shown by the starting semi-colon (which separates lines)
|
||||
[],
|
||||
|
||||
// the second line contains four (comma-separated) segments
|
||||
[
|
||||
// segments are encoded as you'd expect:
|
||||
// [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ]
|
||||
|
||||
// i.e. the first segment begins at column 2, and maps back to the second column
|
||||
// of the second line (both zero-based) of the 0th source, and uses the 0th
|
||||
// name in the `map.names` array
|
||||
[ 2, 0, 2, 2, 0 ],
|
||||
|
||||
// the remaining segments are 4-length rather than 5-length,
|
||||
// because they don't map a name
|
||||
[ 4, 0, 2, 4 ],
|
||||
[ 6, 0, 2, 5 ],
|
||||
[ 7, 0, 2, 7 ]
|
||||
],
|
||||
|
||||
// the final line contains two segments
|
||||
[
|
||||
[ 2, 1, 10, 19 ],
|
||||
[ 12, 1, 11, 20 ]
|
||||
]
|
||||
]);
|
||||
|
||||
var encoded = encode( decoded );
|
||||
assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' );
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
```
|
||||
node v18.0.0
|
||||
|
||||
amp.js.map - 45120 segments
|
||||
|
||||
Decode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 5479160 bytes
|
||||
sourcemap-codec 5659336 bytes
|
||||
source-map-0.6.1 17144440 bytes
|
||||
source-map-0.8.0 6867424 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Decode speed:
|
||||
decode: @jridgewell/sourcemap-codec x 502 ops/sec ±1.03% (90 runs sampled)
|
||||
decode: sourcemap-codec x 445 ops/sec ±0.97% (92 runs sampled)
|
||||
decode: source-map-0.6.1 x 36.01 ops/sec ±1.64% (49 runs sampled)
|
||||
decode: source-map-0.8.0 x 367 ops/sec ±0.04% (95 runs sampled)
|
||||
Fastest is decode: @jridgewell/sourcemap-codec
|
||||
|
||||
Encode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 1261620 bytes
|
||||
sourcemap-codec 9119248 bytes
|
||||
source-map-0.6.1 8968560 bytes
|
||||
source-map-0.8.0 8952952 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Encode speed:
|
||||
encode: @jridgewell/sourcemap-codec x 738 ops/sec ±0.42% (98 runs sampled)
|
||||
encode: sourcemap-codec x 238 ops/sec ±0.73% (88 runs sampled)
|
||||
encode: source-map-0.6.1 x 162 ops/sec ±0.43% (84 runs sampled)
|
||||
encode: source-map-0.8.0 x 191 ops/sec ±0.34% (90 runs sampled)
|
||||
Fastest is encode: @jridgewell/sourcemap-codec
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
babel.min.js.map - 347793 segments
|
||||
|
||||
Decode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 35338184 bytes
|
||||
sourcemap-codec 35922736 bytes
|
||||
source-map-0.6.1 62366360 bytes
|
||||
source-map-0.8.0 44337416 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Decode speed:
|
||||
decode: @jridgewell/sourcemap-codec x 40.35 ops/sec ±4.47% (54 runs sampled)
|
||||
decode: sourcemap-codec x 36.76 ops/sec ±3.67% (51 runs sampled)
|
||||
decode: source-map-0.6.1 x 4.44 ops/sec ±2.15% (16 runs sampled)
|
||||
decode: source-map-0.8.0 x 59.35 ops/sec ±0.05% (78 runs sampled)
|
||||
Fastest is decode: source-map-0.8.0
|
||||
|
||||
Encode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 7212604 bytes
|
||||
sourcemap-codec 21421456 bytes
|
||||
source-map-0.6.1 25286888 bytes
|
||||
source-map-0.8.0 25498744 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Encode speed:
|
||||
encode: @jridgewell/sourcemap-codec x 112 ops/sec ±0.13% (84 runs sampled)
|
||||
encode: sourcemap-codec x 30.23 ops/sec ±2.76% (53 runs sampled)
|
||||
encode: source-map-0.6.1 x 19.43 ops/sec ±3.70% (37 runs sampled)
|
||||
encode: source-map-0.8.0 x 19.40 ops/sec ±3.26% (37 runs sampled)
|
||||
Fastest is encode: @jridgewell/sourcemap-codec
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
preact.js.map - 1992 segments
|
||||
|
||||
Decode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 500272 bytes
|
||||
sourcemap-codec 516864 bytes
|
||||
source-map-0.6.1 1596672 bytes
|
||||
source-map-0.8.0 517272 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Decode speed:
|
||||
decode: @jridgewell/sourcemap-codec x 16,137 ops/sec ±0.17% (99 runs sampled)
|
||||
decode: sourcemap-codec x 12,139 ops/sec ±0.13% (99 runs sampled)
|
||||
decode: source-map-0.6.1 x 1,264 ops/sec ±0.12% (100 runs sampled)
|
||||
decode: source-map-0.8.0 x 9,894 ops/sec ±0.08% (101 runs sampled)
|
||||
Fastest is decode: @jridgewell/sourcemap-codec
|
||||
|
||||
Encode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 321026 bytes
|
||||
sourcemap-codec 830832 bytes
|
||||
source-map-0.6.1 586608 bytes
|
||||
source-map-0.8.0 586680 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Encode speed:
|
||||
encode: @jridgewell/sourcemap-codec x 19,876 ops/sec ±0.78% (95 runs sampled)
|
||||
encode: sourcemap-codec x 6,983 ops/sec ±0.15% (100 runs sampled)
|
||||
encode: source-map-0.6.1 x 5,070 ops/sec ±0.12% (102 runs sampled)
|
||||
encode: source-map-0.8.0 x 5,641 ops/sec ±0.17% (100 runs sampled)
|
||||
Fastest is encode: @jridgewell/sourcemap-codec
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
react.js.map - 5726 segments
|
||||
|
||||
Decode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 734848 bytes
|
||||
sourcemap-codec 954200 bytes
|
||||
source-map-0.6.1 2276432 bytes
|
||||
source-map-0.8.0 955488 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Decode speed:
|
||||
decode: @jridgewell/sourcemap-codec x 5,723 ops/sec ±0.12% (98 runs sampled)
|
||||
decode: sourcemap-codec x 4,555 ops/sec ±0.09% (101 runs sampled)
|
||||
decode: source-map-0.6.1 x 437 ops/sec ±0.11% (93 runs sampled)
|
||||
decode: source-map-0.8.0 x 3,441 ops/sec ±0.15% (100 runs sampled)
|
||||
Fastest is decode: @jridgewell/sourcemap-codec
|
||||
|
||||
Encode Memory Usage:
|
||||
@jridgewell/sourcemap-codec 638672 bytes
|
||||
sourcemap-codec 1109840 bytes
|
||||
source-map-0.6.1 1321224 bytes
|
||||
source-map-0.8.0 1324448 bytes
|
||||
Smallest memory usage is @jridgewell/sourcemap-codec
|
||||
|
||||
Encode speed:
|
||||
encode: @jridgewell/sourcemap-codec x 6,801 ops/sec ±0.48% (98 runs sampled)
|
||||
encode: sourcemap-codec x 2,533 ops/sec ±0.13% (101 runs sampled)
|
||||
encode: source-map-0.6.1 x 2,248 ops/sec ±0.08% (100 runs sampled)
|
||||
encode: source-map-0.8.0 x 2,303 ops/sec ±0.15% (100 runs sampled)
|
||||
Fastest is encode: @jridgewell/sourcemap-codec
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
MIT
|
||||
164
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
generated
vendored
Normal file
164
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
const comma = ','.charCodeAt(0);
|
||||
const semicolon = ';'.charCodeAt(0);
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
const intToChar = new Uint8Array(64); // 64 possible chars.
|
||||
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
||||
for (let i = 0; i < chars.length; i++) {
|
||||
const c = chars.charCodeAt(i);
|
||||
intToChar[i] = c;
|
||||
charToInt[c] = i;
|
||||
}
|
||||
// Provide a fallback for older environments.
|
||||
const td = typeof TextDecoder !== 'undefined'
|
||||
? /* #__PURE__ */ new TextDecoder()
|
||||
: typeof Buffer !== 'undefined'
|
||||
? {
|
||||
decode(buf) {
|
||||
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
||||
return out.toString();
|
||||
},
|
||||
}
|
||||
: {
|
||||
decode(buf) {
|
||||
let out = '';
|
||||
for (let i = 0; i < buf.length; i++) {
|
||||
out += String.fromCharCode(buf[i]);
|
||||
}
|
||||
return out;
|
||||
},
|
||||
};
|
||||
function decode(mappings) {
|
||||
const state = new Int32Array(5);
|
||||
const decoded = [];
|
||||
let index = 0;
|
||||
do {
|
||||
const semi = indexOf(mappings, index);
|
||||
const line = [];
|
||||
let sorted = true;
|
||||
let lastCol = 0;
|
||||
state[0] = 0;
|
||||
for (let i = index; i < semi; i++) {
|
||||
let seg;
|
||||
i = decodeInteger(mappings, i, state, 0); // genColumn
|
||||
const col = state[0];
|
||||
if (col < lastCol)
|
||||
sorted = false;
|
||||
lastCol = col;
|
||||
if (hasMoreVlq(mappings, i, semi)) {
|
||||
i = decodeInteger(mappings, i, state, 1); // sourcesIndex
|
||||
i = decodeInteger(mappings, i, state, 2); // sourceLine
|
||||
i = decodeInteger(mappings, i, state, 3); // sourceColumn
|
||||
if (hasMoreVlq(mappings, i, semi)) {
|
||||
i = decodeInteger(mappings, i, state, 4); // namesIndex
|
||||
seg = [col, state[1], state[2], state[3], state[4]];
|
||||
}
|
||||
else {
|
||||
seg = [col, state[1], state[2], state[3]];
|
||||
}
|
||||
}
|
||||
else {
|
||||
seg = [col];
|
||||
}
|
||||
line.push(seg);
|
||||
}
|
||||
if (!sorted)
|
||||
sort(line);
|
||||
decoded.push(line);
|
||||
index = semi + 1;
|
||||
} while (index <= mappings.length);
|
||||
return decoded;
|
||||
}
|
||||
function indexOf(mappings, index) {
|
||||
const idx = mappings.indexOf(';', index);
|
||||
return idx === -1 ? mappings.length : idx;
|
||||
}
|
||||
function decodeInteger(mappings, pos, state, j) {
|
||||
let value = 0;
|
||||
let shift = 0;
|
||||
let integer = 0;
|
||||
do {
|
||||
const c = mappings.charCodeAt(pos++);
|
||||
integer = charToInt[c];
|
||||
value |= (integer & 31) << shift;
|
||||
shift += 5;
|
||||
} while (integer & 32);
|
||||
const shouldNegate = value & 1;
|
||||
value >>>= 1;
|
||||
if (shouldNegate) {
|
||||
value = -0x80000000 | -value;
|
||||
}
|
||||
state[j] += value;
|
||||
return pos;
|
||||
}
|
||||
function hasMoreVlq(mappings, i, length) {
|
||||
if (i >= length)
|
||||
return false;
|
||||
return mappings.charCodeAt(i) !== comma;
|
||||
}
|
||||
function sort(line) {
|
||||
line.sort(sortComparator);
|
||||
}
|
||||
function sortComparator(a, b) {
|
||||
return a[0] - b[0];
|
||||
}
|
||||
function encode(decoded) {
|
||||
const state = new Int32Array(5);
|
||||
const bufLength = 1024 * 16;
|
||||
const subLength = bufLength - 36;
|
||||
const buf = new Uint8Array(bufLength);
|
||||
const sub = buf.subarray(0, subLength);
|
||||
let pos = 0;
|
||||
let out = '';
|
||||
for (let i = 0; i < decoded.length; i++) {
|
||||
const line = decoded[i];
|
||||
if (i > 0) {
|
||||
if (pos === bufLength) {
|
||||
out += td.decode(buf);
|
||||
pos = 0;
|
||||
}
|
||||
buf[pos++] = semicolon;
|
||||
}
|
||||
if (line.length === 0)
|
||||
continue;
|
||||
state[0] = 0;
|
||||
for (let j = 0; j < line.length; j++) {
|
||||
const segment = line[j];
|
||||
// We can push up to 5 ints, each int can take at most 7 chars, and we
|
||||
// may push a comma.
|
||||
if (pos > subLength) {
|
||||
out += td.decode(sub);
|
||||
buf.copyWithin(0, subLength, pos);
|
||||
pos -= subLength;
|
||||
}
|
||||
if (j > 0)
|
||||
buf[pos++] = comma;
|
||||
pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
|
||||
if (segment.length === 1)
|
||||
continue;
|
||||
pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
|
||||
pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
|
||||
pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
|
||||
if (segment.length === 4)
|
||||
continue;
|
||||
pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
|
||||
}
|
||||
}
|
||||
return out + td.decode(buf.subarray(0, pos));
|
||||
}
|
||||
function encodeInteger(buf, pos, state, segment, j) {
|
||||
const next = segment[j];
|
||||
let num = next - state[j];
|
||||
state[j] = next;
|
||||
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
||||
do {
|
||||
let clamped = num & 0b011111;
|
||||
num >>>= 5;
|
||||
if (num > 0)
|
||||
clamped |= 0b100000;
|
||||
buf[pos++] = intToChar[clamped];
|
||||
} while (num > 0);
|
||||
return pos;
|
||||
}
|
||||
|
||||
export { decode, encode };
|
||||
//# sourceMappingURL=sourcemap-codec.mjs.map
|
||||
1
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map
generated
vendored
Normal file
1
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
175
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
generated
vendored
Normal file
175
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
generated
vendored
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sourcemapCodec = {}));
|
||||
})(this, (function (exports) { 'use strict';
|
||||
|
||||
const comma = ','.charCodeAt(0);
|
||||
const semicolon = ';'.charCodeAt(0);
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
const intToChar = new Uint8Array(64); // 64 possible chars.
|
||||
const charToInt = new Uint8Array(128); // z is 122 in ASCII
|
||||
for (let i = 0; i < chars.length; i++) {
|
||||
const c = chars.charCodeAt(i);
|
||||
intToChar[i] = c;
|
||||
charToInt[c] = i;
|
||||
}
|
||||
// Provide a fallback for older environments.
|
||||
const td = typeof TextDecoder !== 'undefined'
|
||||
? /* #__PURE__ */ new TextDecoder()
|
||||
: typeof Buffer !== 'undefined'
|
||||
? {
|
||||
decode(buf) {
|
||||
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
||||
return out.toString();
|
||||
},
|
||||
}
|
||||
: {
|
||||
decode(buf) {
|
||||
let out = '';
|
||||
for (let i = 0; i < buf.length; i++) {
|
||||
out += String.fromCharCode(buf[i]);
|
||||
}
|
||||
return out;
|
||||
},
|
||||
};
|
||||
function decode(mappings) {
|
||||
const state = new Int32Array(5);
|
||||
const decoded = [];
|
||||
let index = 0;
|
||||
do {
|
||||
const semi = indexOf(mappings, index);
|
||||
const line = [];
|
||||
let sorted = true;
|
||||
let lastCol = 0;
|
||||
state[0] = 0;
|
||||
for (let i = index; i < semi; i++) {
|
||||
let seg;
|
||||
i = decodeInteger(mappings, i, state, 0); // genColumn
|
||||
const col = state[0];
|
||||
if (col < lastCol)
|
||||
sorted = false;
|
||||
lastCol = col;
|
||||
if (hasMoreVlq(mappings, i, semi)) {
|
||||
i = decodeInteger(mappings, i, state, 1); // sourcesIndex
|
||||
i = decodeInteger(mappings, i, state, 2); // sourceLine
|
||||
i = decodeInteger(mappings, i, state, 3); // sourceColumn
|
||||
if (hasMoreVlq(mappings, i, semi)) {
|
||||
i = decodeInteger(mappings, i, state, 4); // namesIndex
|
||||
seg = [col, state[1], state[2], state[3], state[4]];
|
||||
}
|
||||
else {
|
||||
seg = [col, state[1], state[2], state[3]];
|
||||
}
|
||||
}
|
||||
else {
|
||||
seg = [col];
|
||||
}
|
||||
line.push(seg);
|
||||
}
|
||||
if (!sorted)
|
||||
sort(line);
|
||||
decoded.push(line);
|
||||
index = semi + 1;
|
||||
} while (index <= mappings.length);
|
||||
return decoded;
|
||||
}
|
||||
function indexOf(mappings, index) {
|
||||
const idx = mappings.indexOf(';', index);
|
||||
return idx === -1 ? mappings.length : idx;
|
||||
}
|
||||
function decodeInteger(mappings, pos, state, j) {
|
||||
let value = 0;
|
||||
let shift = 0;
|
||||
let integer = 0;
|
||||
do {
|
||||
const c = mappings.charCodeAt(pos++);
|
||||
integer = charToInt[c];
|
||||
value |= (integer & 31) << shift;
|
||||
shift += 5;
|
||||
} while (integer & 32);
|
||||
const shouldNegate = value & 1;
|
||||
value >>>= 1;
|
||||
if (shouldNegate) {
|
||||
value = -0x80000000 | -value;
|
||||
}
|
||||
state[j] += value;
|
||||
return pos;
|
||||
}
|
||||
function hasMoreVlq(mappings, i, length) {
|
||||
if (i >= length)
|
||||
return false;
|
||||
return mappings.charCodeAt(i) !== comma;
|
||||
}
|
||||
function sort(line) {
|
||||
line.sort(sortComparator);
|
||||
}
|
||||
function sortComparator(a, b) {
|
||||
return a[0] - b[0];
|
||||
}
|
||||
function encode(decoded) {
|
||||
const state = new Int32Array(5);
|
||||
const bufLength = 1024 * 16;
|
||||
const subLength = bufLength - 36;
|
||||
const buf = new Uint8Array(bufLength);
|
||||
const sub = buf.subarray(0, subLength);
|
||||
let pos = 0;
|
||||
let out = '';
|
||||
for (let i = 0; i < decoded.length; i++) {
|
||||
const line = decoded[i];
|
||||
if (i > 0) {
|
||||
if (pos === bufLength) {
|
||||
out += td.decode(buf);
|
||||
pos = 0;
|
||||
}
|
||||
buf[pos++] = semicolon;
|
||||
}
|
||||
if (line.length === 0)
|
||||
continue;
|
||||
state[0] = 0;
|
||||
for (let j = 0; j < line.length; j++) {
|
||||
const segment = line[j];
|
||||
// We can push up to 5 ints, each int can take at most 7 chars, and we
|
||||
// may push a comma.
|
||||
if (pos > subLength) {
|
||||
out += td.decode(sub);
|
||||
buf.copyWithin(0, subLength, pos);
|
||||
pos -= subLength;
|
||||
}
|
||||
if (j > 0)
|
||||
buf[pos++] = comma;
|
||||
pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
|
||||
if (segment.length === 1)
|
||||
continue;
|
||||
pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
|
||||
pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
|
||||
pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
|
||||
if (segment.length === 4)
|
||||
continue;
|
||||
pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
|
||||
}
|
||||
}
|
||||
return out + td.decode(buf.subarray(0, pos));
|
||||
}
|
||||
function encodeInteger(buf, pos, state, segment, j) {
|
||||
const next = segment[j];
|
||||
let num = next - state[j];
|
||||
state[j] = next;
|
||||
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
||||
do {
|
||||
let clamped = num & 0b011111;
|
||||
num >>>= 5;
|
||||
if (num > 0)
|
||||
clamped |= 0b100000;
|
||||
buf[pos++] = intToChar[clamped];
|
||||
} while (num > 0);
|
||||
return pos;
|
||||
}
|
||||
|
||||
exports.decode = decode;
|
||||
exports.encode = encode;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
//# sourceMappingURL=sourcemap-codec.umd.js.map
|
||||
1
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map
generated
vendored
Normal file
1
node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts
generated
vendored
Normal file
6
node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export declare type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number];
|
||||
export declare type SourceMapLine = SourceMapSegment[];
|
||||
export declare type SourceMapMappings = SourceMapLine[];
|
||||
export declare function decode(mappings: string): SourceMapMappings;
|
||||
export declare function encode(decoded: SourceMapMappings): string;
|
||||
export declare function encode(decoded: Readonly<SourceMapMappings>): string;
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"name": "@jridgewell/sourcemap-codec",
|
||||
"version": "1.4.15",
|
||||
"description": "Encode/decode sourcemap mappings",
|
||||
"keywords": [
|
||||
"sourcemap",
|
||||
"vlq"
|
||||
],
|
||||
"main": "dist/sourcemap-codec.umd.js",
|
||||
"module": "dist/sourcemap-codec.mjs",
|
||||
"types": "dist/types/sourcemap-codec.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"types": "./dist/types/sourcemap-codec.d.ts",
|
||||
"browser": "./dist/sourcemap-codec.umd.js",
|
||||
"require": "./dist/sourcemap-codec.umd.js",
|
||||
"import": "./dist/sourcemap-codec.mjs"
|
||||
},
|
||||
"./dist/sourcemap-codec.umd.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"benchmark": "run-s build:rollup benchmark:*",
|
||||
"benchmark:install": "cd benchmark && npm install",
|
||||
"benchmark:only": "node --expose-gc benchmark/index.js",
|
||||
"build": "run-s -n build:*",
|
||||
"build:rollup": "rollup -c rollup.config.js",
|
||||
"build:ts": "tsc --project tsconfig.build.json",
|
||||
"lint": "run-s -n lint:*",
|
||||
"lint:prettier": "npm run test:lint:prettier -- --write",
|
||||
"lint:ts": "npm run test:lint:ts -- --fix",
|
||||
"prebuild": "rm -rf dist",
|
||||
"prepublishOnly": "npm run preversion",
|
||||
"preversion": "run-s test build",
|
||||
"pretest": "run-s build:rollup",
|
||||
"test": "run-s -n test:lint test:only",
|
||||
"test:debug": "mocha --inspect-brk",
|
||||
"test:lint": "run-s -n test:lint:*",
|
||||
"test:lint:prettier": "prettier --check '{src,test}/**/*.ts'",
|
||||
"test:lint:ts": "eslint '{src,test}/**/*.ts'",
|
||||
"test:only": "mocha",
|
||||
"test:coverage": "c8 mocha",
|
||||
"test:watch": "mocha --watch"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jridgewell/sourcemap-codec.git"
|
||||
},
|
||||
"author": "Rich Harris",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-typescript": "8.3.0",
|
||||
"@types/node": "17.0.15",
|
||||
"@typescript-eslint/eslint-plugin": "5.10.0",
|
||||
"@typescript-eslint/parser": "5.10.0",
|
||||
"benchmark": "2.1.4",
|
||||
"c8": "7.11.2",
|
||||
"eslint": "8.7.0",
|
||||
"eslint-config-prettier": "8.3.0",
|
||||
"mocha": "9.2.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.5.1",
|
||||
"rollup": "2.64.0",
|
||||
"source-map": "0.6.1",
|
||||
"source-map-js": "1.0.2",
|
||||
"sourcemap-codec": "1.4.8",
|
||||
"typescript": "4.5.4"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018-present, Yuxi (Evan) You
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1 @@
|
|||
# @vue/compiler-core
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
5676
node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js
generated
vendored
Normal file
5676
node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/compiler-core.cjs.prod.js')
|
||||
} else {
|
||||
module.exports = require('./dist/compiler-core.cjs.js')
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"name": "@vue/compiler-core",
|
||||
"version": "3.4.21",
|
||||
"description": "@vue/compiler-core",
|
||||
"main": "index.js",
|
||||
"module": "dist/compiler-core.esm-bundler.js",
|
||||
"types": "dist/compiler-core.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/compiler-core.d.ts",
|
||||
"node": {
|
||||
"production": "./dist/compiler-core.cjs.prod.js",
|
||||
"development": "./dist/compiler-core.cjs.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"module": "./dist/compiler-core.esm-bundler.js",
|
||||
"import": "./dist/compiler-core.esm-bundler.js",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./*": "./*"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueCompilerCore",
|
||||
"compat": true,
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vuejs/core.git",
|
||||
"directory": "packages/compiler-core"
|
||||
},
|
||||
"keywords": [
|
||||
"vue"
|
||||
],
|
||||
"author": "Evan You",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vuejs/core/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.23.9",
|
||||
"entities": "^4.5.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.0.2",
|
||||
"@vue/shared": "3.4.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/types": "^7.23.9"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018-present, Yuxi (Evan) You
|
||||
|
||||
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.
|
||||
|
|
@ -0,0 +1 @@
|
|||
# @vue/compiler-dom
|
||||
|
|
@ -0,0 +1,727 @@
|
|||
/**
|
||||
* @vue/compiler-dom v3.4.21
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var compilerCore = require('@vue/compiler-core');
|
||||
var shared = require('@vue/shared');
|
||||
|
||||
const V_MODEL_RADIO = Symbol(`vModelRadio` );
|
||||
const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
|
||||
const V_MODEL_TEXT = Symbol(`vModelText` );
|
||||
const V_MODEL_SELECT = Symbol(`vModelSelect` );
|
||||
const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
|
||||
const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
|
||||
const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
|
||||
const V_SHOW = Symbol(`vShow` );
|
||||
const TRANSITION = Symbol(`Transition` );
|
||||
const TRANSITION_GROUP = Symbol(`TransitionGroup` );
|
||||
compilerCore.registerRuntimeHelpers({
|
||||
[V_MODEL_RADIO]: `vModelRadio`,
|
||||
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
|
||||
[V_MODEL_TEXT]: `vModelText`,
|
||||
[V_MODEL_SELECT]: `vModelSelect`,
|
||||
[V_MODEL_DYNAMIC]: `vModelDynamic`,
|
||||
[V_ON_WITH_MODIFIERS]: `withModifiers`,
|
||||
[V_ON_WITH_KEYS]: `withKeys`,
|
||||
[V_SHOW]: `vShow`,
|
||||
[TRANSITION]: `Transition`,
|
||||
[TRANSITION_GROUP]: `TransitionGroup`
|
||||
});
|
||||
|
||||
const parserOptions = {
|
||||
parseMode: "html",
|
||||
isVoidTag: shared.isVoidTag,
|
||||
isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag),
|
||||
isPreTag: (tag) => tag === "pre",
|
||||
decodeEntities: void 0,
|
||||
isBuiltInComponent: (tag) => {
|
||||
if (tag === "Transition" || tag === "transition") {
|
||||
return TRANSITION;
|
||||
} else if (tag === "TransitionGroup" || tag === "transition-group") {
|
||||
return TRANSITION_GROUP;
|
||||
}
|
||||
},
|
||||
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
|
||||
getNamespace(tag, parent, rootNamespace) {
|
||||
let ns = parent ? parent.ns : rootNamespace;
|
||||
if (parent && ns === 2) {
|
||||
if (parent.tag === "annotation-xml") {
|
||||
if (tag === "svg") {
|
||||
return 1;
|
||||
}
|
||||
if (parent.props.some(
|
||||
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
|
||||
)) {
|
||||
ns = 0;
|
||||
}
|
||||
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
|
||||
ns = 0;
|
||||
}
|
||||
} else if (parent && ns === 1) {
|
||||
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
|
||||
ns = 0;
|
||||
}
|
||||
}
|
||||
if (ns === 0) {
|
||||
if (tag === "svg") {
|
||||
return 1;
|
||||
}
|
||||
if (tag === "math") {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return ns;
|
||||
}
|
||||
};
|
||||
|
||||
const transformStyle = (node) => {
|
||||
if (node.type === 1) {
|
||||
node.props.forEach((p, i) => {
|
||||
if (p.type === 6 && p.name === "style" && p.value) {
|
||||
node.props[i] = {
|
||||
type: 7,
|
||||
name: `bind`,
|
||||
arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
|
||||
exp: parseInlineCSS(p.value.content, p.loc),
|
||||
modifiers: [],
|
||||
loc: p.loc
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const parseInlineCSS = (cssText, loc) => {
|
||||
const normalized = shared.parseStringStyle(cssText);
|
||||
return compilerCore.createSimpleExpression(
|
||||
JSON.stringify(normalized),
|
||||
false,
|
||||
loc,
|
||||
3
|
||||
);
|
||||
};
|
||||
|
||||
function createDOMCompilerError(code, loc) {
|
||||
return compilerCore.createCompilerError(
|
||||
code,
|
||||
loc,
|
||||
DOMErrorMessages
|
||||
);
|
||||
}
|
||||
const DOMErrorCodes = {
|
||||
"X_V_HTML_NO_EXPRESSION": 53,
|
||||
"53": "X_V_HTML_NO_EXPRESSION",
|
||||
"X_V_HTML_WITH_CHILDREN": 54,
|
||||
"54": "X_V_HTML_WITH_CHILDREN",
|
||||
"X_V_TEXT_NO_EXPRESSION": 55,
|
||||
"55": "X_V_TEXT_NO_EXPRESSION",
|
||||
"X_V_TEXT_WITH_CHILDREN": 56,
|
||||
"56": "X_V_TEXT_WITH_CHILDREN",
|
||||
"X_V_MODEL_ON_INVALID_ELEMENT": 57,
|
||||
"57": "X_V_MODEL_ON_INVALID_ELEMENT",
|
||||
"X_V_MODEL_ARG_ON_ELEMENT": 58,
|
||||
"58": "X_V_MODEL_ARG_ON_ELEMENT",
|
||||
"X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59,
|
||||
"59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
|
||||
"X_V_MODEL_UNNECESSARY_VALUE": 60,
|
||||
"60": "X_V_MODEL_UNNECESSARY_VALUE",
|
||||
"X_V_SHOW_NO_EXPRESSION": 61,
|
||||
"61": "X_V_SHOW_NO_EXPRESSION",
|
||||
"X_TRANSITION_INVALID_CHILDREN": 62,
|
||||
"62": "X_TRANSITION_INVALID_CHILDREN",
|
||||
"X_IGNORED_SIDE_EFFECT_TAG": 63,
|
||||
"63": "X_IGNORED_SIDE_EFFECT_TAG",
|
||||
"__EXTEND_POINT__": 64,
|
||||
"64": "__EXTEND_POINT__"
|
||||
};
|
||||
const DOMErrorMessages = {
|
||||
[53]: `v-html is missing expression.`,
|
||||
[54]: `v-html will override element children.`,
|
||||
[55]: `v-text is missing expression.`,
|
||||
[56]: `v-text will override element children.`,
|
||||
[57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
|
||||
[58]: `v-model argument is not supported on plain elements.`,
|
||||
[59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
|
||||
[60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
|
||||
[61]: `v-show is missing expression.`,
|
||||
[62]: `<Transition> expects exactly one child element or component.`,
|
||||
[63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
|
||||
};
|
||||
|
||||
const transformVHtml = (dir, node, context) => {
|
||||
const { exp, loc } = dir;
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(53, loc)
|
||||
);
|
||||
}
|
||||
if (node.children.length) {
|
||||
context.onError(
|
||||
createDOMCompilerError(54, loc)
|
||||
);
|
||||
node.children.length = 0;
|
||||
}
|
||||
return {
|
||||
props: [
|
||||
compilerCore.createObjectProperty(
|
||||
compilerCore.createSimpleExpression(`innerHTML`, true, loc),
|
||||
exp || compilerCore.createSimpleExpression("", true)
|
||||
)
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
const transformVText = (dir, node, context) => {
|
||||
const { exp, loc } = dir;
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(55, loc)
|
||||
);
|
||||
}
|
||||
if (node.children.length) {
|
||||
context.onError(
|
||||
createDOMCompilerError(56, loc)
|
||||
);
|
||||
node.children.length = 0;
|
||||
}
|
||||
return {
|
||||
props: [
|
||||
compilerCore.createObjectProperty(
|
||||
compilerCore.createSimpleExpression(`textContent`, true),
|
||||
exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression(
|
||||
context.helperString(compilerCore.TO_DISPLAY_STRING),
|
||||
[exp],
|
||||
loc
|
||||
) : compilerCore.createSimpleExpression("", true)
|
||||
)
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
const transformModel = (dir, node, context) => {
|
||||
const baseResult = compilerCore.transformModel(dir, node, context);
|
||||
if (!baseResult.props.length || node.tagType === 1) {
|
||||
return baseResult;
|
||||
}
|
||||
if (dir.arg) {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
58,
|
||||
dir.arg.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
function checkDuplicatedValue() {
|
||||
const value = compilerCore.findDir(node, "bind");
|
||||
if (value && compilerCore.isStaticArgOf(value.arg, "value")) {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
60,
|
||||
value.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
const { tag } = node;
|
||||
const isCustomElement = context.isCustomElement(tag);
|
||||
if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
|
||||
let directiveToUse = V_MODEL_TEXT;
|
||||
let isInvalidType = false;
|
||||
if (tag === "input" || isCustomElement) {
|
||||
const type = compilerCore.findProp(node, `type`);
|
||||
if (type) {
|
||||
if (type.type === 7) {
|
||||
directiveToUse = V_MODEL_DYNAMIC;
|
||||
} else if (type.value) {
|
||||
switch (type.value.content) {
|
||||
case "radio":
|
||||
directiveToUse = V_MODEL_RADIO;
|
||||
break;
|
||||
case "checkbox":
|
||||
directiveToUse = V_MODEL_CHECKBOX;
|
||||
break;
|
||||
case "file":
|
||||
isInvalidType = true;
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
59,
|
||||
dir.loc
|
||||
)
|
||||
);
|
||||
break;
|
||||
default:
|
||||
checkDuplicatedValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (compilerCore.hasDynamicKeyVBind(node)) {
|
||||
directiveToUse = V_MODEL_DYNAMIC;
|
||||
} else {
|
||||
checkDuplicatedValue();
|
||||
}
|
||||
} else if (tag === "select") {
|
||||
directiveToUse = V_MODEL_SELECT;
|
||||
} else {
|
||||
checkDuplicatedValue();
|
||||
}
|
||||
if (!isInvalidType) {
|
||||
baseResult.needRuntime = context.helper(directiveToUse);
|
||||
}
|
||||
} else {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
57,
|
||||
dir.loc
|
||||
)
|
||||
);
|
||||
}
|
||||
baseResult.props = baseResult.props.filter(
|
||||
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
|
||||
);
|
||||
return baseResult;
|
||||
};
|
||||
|
||||
const isEventOptionModifier = /* @__PURE__ */ shared.makeMap(`passive,once,capture`);
|
||||
const isNonKeyModifier = /* @__PURE__ */ shared.makeMap(
|
||||
// event propagation management
|
||||
`stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
|
||||
);
|
||||
const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right");
|
||||
const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(
|
||||
`onkeyup,onkeydown,onkeypress`,
|
||||
true
|
||||
);
|
||||
const resolveModifiers = (key, modifiers, context, loc) => {
|
||||
const keyModifiers = [];
|
||||
const nonKeyModifiers = [];
|
||||
const eventOptionModifiers = [];
|
||||
for (let i = 0; i < modifiers.length; i++) {
|
||||
const modifier = modifiers[i];
|
||||
if (modifier === "native" && compilerCore.checkCompatEnabled(
|
||||
"COMPILER_V_ON_NATIVE",
|
||||
context,
|
||||
loc
|
||||
)) {
|
||||
eventOptionModifiers.push(modifier);
|
||||
} else if (isEventOptionModifier(modifier)) {
|
||||
eventOptionModifiers.push(modifier);
|
||||
} else {
|
||||
if (maybeKeyModifier(modifier)) {
|
||||
if (compilerCore.isStaticExp(key)) {
|
||||
if (isKeyboardEvent(key.content)) {
|
||||
keyModifiers.push(modifier);
|
||||
} else {
|
||||
nonKeyModifiers.push(modifier);
|
||||
}
|
||||
} else {
|
||||
keyModifiers.push(modifier);
|
||||
nonKeyModifiers.push(modifier);
|
||||
}
|
||||
} else {
|
||||
if (isNonKeyModifier(modifier)) {
|
||||
nonKeyModifiers.push(modifier);
|
||||
} else {
|
||||
keyModifiers.push(modifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
keyModifiers,
|
||||
nonKeyModifiers,
|
||||
eventOptionModifiers
|
||||
};
|
||||
};
|
||||
const transformClick = (key, event) => {
|
||||
const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === "onclick";
|
||||
return isStaticClick ? compilerCore.createSimpleExpression(event, true) : key.type !== 4 ? compilerCore.createCompoundExpression([
|
||||
`(`,
|
||||
key,
|
||||
`) === "onClick" ? "${event}" : (`,
|
||||
key,
|
||||
`)`
|
||||
]) : key;
|
||||
};
|
||||
const transformOn = (dir, node, context) => {
|
||||
return compilerCore.transformOn(dir, node, context, (baseResult) => {
|
||||
const { modifiers } = dir;
|
||||
if (!modifiers.length)
|
||||
return baseResult;
|
||||
let { key, value: handlerExp } = baseResult.props[0];
|
||||
const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
|
||||
if (nonKeyModifiers.includes("right")) {
|
||||
key = transformClick(key, `onContextmenu`);
|
||||
}
|
||||
if (nonKeyModifiers.includes("middle")) {
|
||||
key = transformClick(key, `onMouseup`);
|
||||
}
|
||||
if (nonKeyModifiers.length) {
|
||||
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
|
||||
handlerExp,
|
||||
JSON.stringify(nonKeyModifiers)
|
||||
]);
|
||||
}
|
||||
if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
|
||||
(!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
|
||||
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
|
||||
handlerExp,
|
||||
JSON.stringify(keyModifiers)
|
||||
]);
|
||||
}
|
||||
if (eventOptionModifiers.length) {
|
||||
const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join("");
|
||||
key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
|
||||
}
|
||||
return {
|
||||
props: [compilerCore.createObjectProperty(key, handlerExp)]
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
const transformShow = (dir, node, context) => {
|
||||
const { exp, loc } = dir;
|
||||
if (!exp) {
|
||||
context.onError(
|
||||
createDOMCompilerError(61, loc)
|
||||
);
|
||||
}
|
||||
return {
|
||||
props: [],
|
||||
needRuntime: context.helper(V_SHOW)
|
||||
};
|
||||
};
|
||||
|
||||
const transformTransition = (node, context) => {
|
||||
if (node.type === 1 && node.tagType === 1) {
|
||||
const component = context.isBuiltInComponent(node.tag);
|
||||
if (component === TRANSITION) {
|
||||
return () => {
|
||||
if (!node.children.length) {
|
||||
return;
|
||||
}
|
||||
if (hasMultipleChildren(node)) {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
62,
|
||||
{
|
||||
start: node.children[0].loc.start,
|
||||
end: node.children[node.children.length - 1].loc.end,
|
||||
source: ""
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
const child = node.children[0];
|
||||
if (child.type === 1) {
|
||||
for (const p of child.props) {
|
||||
if (p.type === 7 && p.name === "show") {
|
||||
node.props.push({
|
||||
type: 6,
|
||||
name: "persisted",
|
||||
nameLoc: node.loc,
|
||||
value: void 0,
|
||||
loc: node.loc
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
function hasMultipleChildren(node) {
|
||||
const children = node.children = node.children.filter(
|
||||
(c) => c.type !== 3 && !(c.type === 2 && !c.content.trim())
|
||||
);
|
||||
const child = children[0];
|
||||
return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(hasMultipleChildren);
|
||||
}
|
||||
|
||||
const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
|
||||
const stringifyStatic = (children, context, parent) => {
|
||||
if (context.scopes.vSlot > 0) {
|
||||
return;
|
||||
}
|
||||
let nc = 0;
|
||||
let ec = 0;
|
||||
const currentChunk = [];
|
||||
const stringifyCurrentChunk = (currentIndex) => {
|
||||
if (nc >= 20 || ec >= 5) {
|
||||
const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
|
||||
JSON.stringify(
|
||||
currentChunk.map((node) => stringifyNode(node, context)).join("")
|
||||
).replace(expReplaceRE, `" + $1 + "`),
|
||||
// the 2nd argument indicates the number of DOM nodes this static vnode
|
||||
// will insert / hydrate
|
||||
String(currentChunk.length)
|
||||
]);
|
||||
replaceHoist(currentChunk[0], staticCall, context);
|
||||
if (currentChunk.length > 1) {
|
||||
for (let i2 = 1; i2 < currentChunk.length; i2++) {
|
||||
replaceHoist(currentChunk[i2], null, context);
|
||||
}
|
||||
const deleteCount = currentChunk.length - 1;
|
||||
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
|
||||
return deleteCount;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
let i = 0;
|
||||
for (; i < children.length; i++) {
|
||||
const child = children[i];
|
||||
const hoisted = getHoistedNode(child);
|
||||
if (hoisted) {
|
||||
const node = child;
|
||||
const result = analyzeNode(node);
|
||||
if (result) {
|
||||
nc += result[0];
|
||||
ec += result[1];
|
||||
currentChunk.push(node);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
i -= stringifyCurrentChunk(i);
|
||||
nc = 0;
|
||||
ec = 0;
|
||||
currentChunk.length = 0;
|
||||
}
|
||||
stringifyCurrentChunk(i);
|
||||
};
|
||||
const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted;
|
||||
const dataAriaRE = /^(data|aria)-/;
|
||||
const isStringifiableAttr = (name, ns) => {
|
||||
return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
|
||||
};
|
||||
const replaceHoist = (node, replacement, context) => {
|
||||
const hoistToReplace = node.codegenNode.hoisted;
|
||||
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
|
||||
};
|
||||
const isNonStringifiable = /* @__PURE__ */ shared.makeMap(
|
||||
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
|
||||
);
|
||||
function analyzeNode(node) {
|
||||
if (node.type === 1 && isNonStringifiable(node.tag)) {
|
||||
return false;
|
||||
}
|
||||
if (node.type === 12) {
|
||||
return [1, 0];
|
||||
}
|
||||
let nc = 1;
|
||||
let ec = node.props.length > 0 ? 1 : 0;
|
||||
let bailed = false;
|
||||
const bail = () => {
|
||||
bailed = true;
|
||||
return false;
|
||||
};
|
||||
function walk(node2) {
|
||||
for (let i = 0; i < node2.props.length; i++) {
|
||||
const p = node2.props[i];
|
||||
if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
|
||||
return bail();
|
||||
}
|
||||
if (p.type === 7 && p.name === "bind") {
|
||||
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
|
||||
return bail();
|
||||
}
|
||||
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
|
||||
return bail();
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < node2.children.length; i++) {
|
||||
nc++;
|
||||
const child = node2.children[i];
|
||||
if (child.type === 1) {
|
||||
if (child.props.length > 0) {
|
||||
ec++;
|
||||
}
|
||||
walk(child);
|
||||
if (bailed) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return walk(node) ? [nc, ec] : false;
|
||||
}
|
||||
function stringifyNode(node, context) {
|
||||
if (shared.isString(node)) {
|
||||
return node;
|
||||
}
|
||||
if (shared.isSymbol(node)) {
|
||||
return ``;
|
||||
}
|
||||
switch (node.type) {
|
||||
case 1:
|
||||
return stringifyElement(node, context);
|
||||
case 2:
|
||||
return shared.escapeHtml(node.content);
|
||||
case 3:
|
||||
return `<!--${shared.escapeHtml(node.content)}-->`;
|
||||
case 5:
|
||||
return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
|
||||
case 8:
|
||||
return shared.escapeHtml(evaluateConstant(node));
|
||||
case 12:
|
||||
return stringifyNode(node.content, context);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
function stringifyElement(node, context) {
|
||||
let res = `<${node.tag}`;
|
||||
let innerHTML = "";
|
||||
for (let i = 0; i < node.props.length; i++) {
|
||||
const p = node.props[i];
|
||||
if (p.type === 6) {
|
||||
res += ` ${p.name}`;
|
||||
if (p.value) {
|
||||
res += `="${shared.escapeHtml(p.value.content)}"`;
|
||||
}
|
||||
} else if (p.type === 7) {
|
||||
if (p.name === "bind") {
|
||||
const exp = p.exp;
|
||||
if (exp.content[0] === "_") {
|
||||
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
|
||||
continue;
|
||||
}
|
||||
if (shared.isBooleanAttr(p.arg.content) && exp.content === "false") {
|
||||
continue;
|
||||
}
|
||||
let evaluated = evaluateConstant(exp);
|
||||
if (evaluated != null) {
|
||||
const arg = p.arg && p.arg.content;
|
||||
if (arg === "class") {
|
||||
evaluated = shared.normalizeClass(evaluated);
|
||||
} else if (arg === "style") {
|
||||
evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
|
||||
}
|
||||
res += ` ${p.arg.content}="${shared.escapeHtml(
|
||||
evaluated
|
||||
)}"`;
|
||||
}
|
||||
} else if (p.name === "html") {
|
||||
innerHTML = evaluateConstant(p.exp);
|
||||
} else if (p.name === "text") {
|
||||
innerHTML = shared.escapeHtml(
|
||||
shared.toDisplayString(evaluateConstant(p.exp))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (context.scopeId) {
|
||||
res += ` ${context.scopeId}`;
|
||||
}
|
||||
res += `>`;
|
||||
if (innerHTML) {
|
||||
res += innerHTML;
|
||||
} else {
|
||||
for (let i = 0; i < node.children.length; i++) {
|
||||
res += stringifyNode(node.children[i], context);
|
||||
}
|
||||
}
|
||||
if (!shared.isVoidTag(node.tag)) {
|
||||
res += `</${node.tag}>`;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
function evaluateConstant(exp) {
|
||||
if (exp.type === 4) {
|
||||
return new Function(`return (${exp.content})`)();
|
||||
} else {
|
||||
let res = ``;
|
||||
exp.children.forEach((c) => {
|
||||
if (shared.isString(c) || shared.isSymbol(c)) {
|
||||
return;
|
||||
}
|
||||
if (c.type === 2) {
|
||||
res += c.content;
|
||||
} else if (c.type === 5) {
|
||||
res += shared.toDisplayString(evaluateConstant(c.content));
|
||||
} else {
|
||||
res += evaluateConstant(c);
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
const ignoreSideEffectTags = (node, context) => {
|
||||
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
|
||||
context.onError(
|
||||
createDOMCompilerError(
|
||||
63,
|
||||
node.loc
|
||||
)
|
||||
);
|
||||
context.removeNode();
|
||||
}
|
||||
};
|
||||
|
||||
const DOMNodeTransforms = [
|
||||
transformStyle,
|
||||
...[transformTransition]
|
||||
];
|
||||
const DOMDirectiveTransforms = {
|
||||
cloak: compilerCore.noopDirectiveTransform,
|
||||
html: transformVHtml,
|
||||
text: transformVText,
|
||||
model: transformModel,
|
||||
// override compiler-core
|
||||
on: transformOn,
|
||||
// override compiler-core
|
||||
show: transformShow
|
||||
};
|
||||
function compile(src, options = {}) {
|
||||
return compilerCore.baseCompile(
|
||||
src,
|
||||
shared.extend({}, parserOptions, options, {
|
||||
nodeTransforms: [
|
||||
// ignore <script> and <tag>
|
||||
// this is not put inside DOMNodeTransforms because that list is used
|
||||
// by compiler-ssr to generate vnode fallback branches
|
||||
ignoreSideEffectTags,
|
||||
...DOMNodeTransforms,
|
||||
...options.nodeTransforms || []
|
||||
],
|
||||
directiveTransforms: shared.extend(
|
||||
{},
|
||||
DOMDirectiveTransforms,
|
||||
options.directiveTransforms || {}
|
||||
),
|
||||
transformHoist: stringifyStatic
|
||||
})
|
||||
);
|
||||
}
|
||||
function parse(template, options = {}) {
|
||||
return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
|
||||
}
|
||||
|
||||
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
|
||||
exports.DOMErrorCodes = DOMErrorCodes;
|
||||
exports.DOMErrorMessages = DOMErrorMessages;
|
||||
exports.DOMNodeTransforms = DOMNodeTransforms;
|
||||
exports.TRANSITION = TRANSITION;
|
||||
exports.TRANSITION_GROUP = TRANSITION_GROUP;
|
||||
exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
|
||||
exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
|
||||
exports.V_MODEL_RADIO = V_MODEL_RADIO;
|
||||
exports.V_MODEL_SELECT = V_MODEL_SELECT;
|
||||
exports.V_MODEL_TEXT = V_MODEL_TEXT;
|
||||
exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
|
||||
exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
|
||||
exports.V_SHOW = V_SHOW;
|
||||
exports.compile = compile;
|
||||
exports.createDOMCompilerError = createDOMCompilerError;
|
||||
exports.parse = parse;
|
||||
exports.parserOptions = parserOptions;
|
||||
exports.transformStyle = transformStyle;
|
||||
Object.keys(compilerCore).forEach(function (k) {
|
||||
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = compilerCore[k];
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue