diff --git a/.env.development b/.env.development new file mode 100644 index 00000000..da8a02c3 --- /dev/null +++ b/.env.development @@ -0,0 +1,6 @@ +# 开发环境 +ENV = 'development' +# 'development' + +# base api +VITE_APP_BASE_API_Url = 'http://25.18.122.66:9786' diff --git a/.env.production b/.env.production new file mode 100644 index 00000000..3226c14b --- /dev/null +++ b/.env.production @@ -0,0 +1,7 @@ +# 生产环境 +ENV = 'production' + +# base api + +VITE_APP_BASE_API_Url = 'http://61.158.134.148:9908' + diff --git a/App.vue b/App.vue index 48ee8b9b..75a4a4f3 100644 --- a/App.vue +++ b/App.vue @@ -12,7 +12,49 @@ } + + // @import "@/uni_modules/uview-ui/index.scss"; + + @font-face { + font-family: "PingFangSC"; + src: url('@/static/font/PingFang-SC.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + // 解决uview离线环境下没有图标 + @font-face { + font-family: "uicon-iconfont"; + src: url('@/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + .max_page{ + height: 100vh; + } + .w_100 { + width: 100%; + } + + .h_100 { + height: 100%; + } + + .flex { + display: flex; + } + + .img_100 { + width: 100%; + height: 100%; + } + + .fl1 { + flex: 1; + } + + .font_pf { + font-family: "PingFangSC"; + } + \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 7c4a013e..00000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -aaa \ No newline at end of file diff --git a/api/common.js b/api/common.js new file mode 100644 index 00000000..e5b6355f --- /dev/null +++ b/api/common.js @@ -0,0 +1,42 @@ +import { + get_base_url +} from '@/api/request' +import { + getToken +} from '@/common/common.js' + + +export const uploadFile = (file, data) => { + + + const url = '/plimg/fileUpload/stuMgrUploadImg'; + const base_url = get_base_url(url); + const token = getToken(); + const header = {}; + if (token) + header['summary'] = token + return new Promise((resolve, reject) => { + uni.uploadFile({ + url: `${base_url}${url}`, + header: header, + filePath: file, + name: 'file', + formData: data, + success(result) { + try { + const res = JSON.parse(result.data); + if (res.rtnCode === '0000') { + resolve(res.body); + } else { + reject(new Error(res.msg)); + } + } catch (error) { + reject(new Error('Failed to parse response')); + } + }, + fail(error) { + reject(new Error('Upload failed')); + } + }); + }); +}; \ No newline at end of file diff --git a/api/login/login.js b/api/login/login.js new file mode 100644 index 00000000..e79b40c3 --- /dev/null +++ b/api/login/login.js @@ -0,0 +1,26 @@ +import request from '@/api/request' +import common from "../../common/common"; + +const setToken = data => uni.setStorageSync('token', data) +const setUserInfo = data => uni.setStorageSync('userInfo', data) + +// 账号登录接口 +export const useAccountLoginApp = (data) => request({ + url: '/access/userLogin', + method: 'post', + data +}).then(({ rtnCode, body }) => { + if (rtnCode === '0000') { + setToken(body.sessionKeyEncry) + setUserInfo(body.userInfo) + return body + } + return Promise.reject({ rtnCode, body }) +}) + +// 获取验证码(作废) +export const getLoginAppCheckCode = (data) => request({ + url: '/access/checkCode', + method: 'get', + data +}) \ No newline at end of file diff --git a/api/request.js b/api/request.js new file mode 100644 index 00000000..908e74c6 --- /dev/null +++ b/api/request.js @@ -0,0 +1,70 @@ +import { + getToken +} from '@/common/common.js' +import common from '@/common/common.js' + +const ENV = import.meta.env + +export const get_base_url = url => { + if (process.env.NODE_ENV === 'development') { + // 开发环境 + return ENV.VITE_APP_BASE_API_Url + "/traapp" + } else if (process.env.NODE_ENV === 'production') { + // 生产环境 + return ENV.VITE_APP_BASE_API_Url + "/traapp" + } +} + +export default function request({ + url, + method, + data, + meta, + isStream, +}) { + const base_url = get_base_url(url); + + const header = { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + } + + let token = getToken() + if (token) { + header['summary'] = token // 让每个请求携带令牌 + } + let that = this + return new Promise((resolve, reject) => { + uni.request({ + url: `${base_url}${url}`, + data: data, + method: method, + header: header, + success: (response) => { + if (isStream) { // 流式传输,直接返回 + return resolve(response); + } + + // 模拟拦截器功能 + const res = response.data + if (!res) { + common.msg("系统异常.") + return reject() + } + if (res.rtnCode === '0000'){ + return resolve(res) + } + if (res.rtnCode === '0005') { + common.msg(res.message || 'Error') + } else if (res.rtnCode !== '0000') { + if (res.rtnCode !== '0002') { // 0002 报错 这里不拦截,和后端约定好的 + common.msg(res.rtnCode == "9999" ? "系统异常" : res.message || 'Error') + return reject(res) + } + return resolve(res) + } else { + return resolve(res) + } + } + }); + }) +}; \ No newline at end of file diff --git a/api/user/user.js b/api/user/user.js new file mode 100644 index 00000000..6441cf86 --- /dev/null +++ b/api/user/user.js @@ -0,0 +1,11 @@ +import request from '@/api/request' + + +// 获取列表接口 +export const process_listPage = (data) => { + return request({ + url: '/plappro/process/queryProcessList', + method: 'post', + data + }); +}; \ No newline at end of file diff --git a/common/common.js b/common/common.js new file mode 100644 index 00000000..557a6ed5 --- /dev/null +++ b/common/common.js @@ -0,0 +1,163 @@ + +function msg(title, duration = 1000) { + uni.showToast({ + title: title, + duration: duration, + icon: 'none', + mask: true, + }); +} + +function show(title, msg, showCancel = true) { + let res = new Promise((resolve, reject) => { + uni.showModal({ + title: title, + content: msg, + showCancel: showCancel, + success: function(res) { + resolve(res.confirm) + }, + fail: function(res) { + reject(false) + }, + }); + }) + return res; +} + +const loading = (title = '加载中', mask = true) => uni.showLoading({ + title: title, + mask: mask +}) +const hideLoading = () => uni.hideLoading() + +// 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。 +const navigateTo = url => uni.navigateTo({ + url: url +}); +// 关闭所有页面,打开到应用内的某个页面。 +const reLaunch = url => { + uni.reLaunch({ + url: url + }); +} +// 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。 +const switchTab = url => { + uni.switchTab({ + url: url + }); +} +// 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages() 获取当前的页面栈,决定需要返回几层。 +const navigateBack = (delta = 1, fun = () => {}) => { + uni.navigateBack({ + delta: delta, + success() { + fun() + } + }) +} + +//关闭当前页面,跳转到应用内的某个页面。 +const redirectTo = url => uni.redirectTo({ + url: url +}); + +// 时间转换时间戳 +const dateToTime = (dateString) => { + let date = new Date(dateString); + let timestamp = date.getTime(); + return timestamp +} + +// 数字格式化 +const formatDate2 = (timestamp, format = 'yyyy-MM-dd HH:mm:ss') => { + if (!timestamp) + return '' + let date + try { + if (timestamp) { + if (typeof timestamp == 'number' && timestamp <= 9999999999) { + timestamp *= 1000 + } + date = new Date(timestamp) + } else { + date = new Date() + } + } catch (e) { + return '' + } + let day = date.getDate() + let month = date.getMonth() + 1 + let year = date.getFullYear() + let hours = date.getHours() + let minutes = date.getMinutes() + let seconds = date.getSeconds() + + // 替换日期格式中的占位符 + return format + .replace('yyyy', year) + .replace('MM', month.toString().padStart(2, '0')) + .replace('dd', day.toString().padStart(2, '0')) + .replace('HH', hours.toString().padStart(2, '0')) + .replace('mm', minutes.toString().padStart(2, '0')) + .replace('ss', seconds.toString().padStart(2, '0')) +} + +// 获取token +export const getToken = () => uni.getStorageSync('token') + +export const getUserInfo = (key = '') => { + const userInfo = uni.getStorageSync('userInfo') + return '' === key ? userInfo : userInfo[key]; +} + + + +// 将对象和字符串相互转换 +export const objToJson = obj => encodeURLComponent('page_data', obj) +export const jsonToObj = () => uni.getStorageSync('page_data') + +// 将对象存入缓存 +export const setPageCache = (name, obj) => { + uni.setStorageSync(name, obj) +} + +// 将对象取出并且删除缓存 +export const getPageCache = name => { + const cache = uni.getStorageSync(name) + uni.removeStorageSync(name) + return cache +} + +function setValue(key, value) { + uni.setStorageSync(key, value); +} + +function getValue(key) { + return uni.getStorageSync(key) +} + +function isLogin() { + return !!getToken(); +} + +export default { + getPageCache, + setPageCache, + objToJson, + jsonToObj, + hideLoading, + loading, + msg, + show, + redirectTo, + navigateTo, + navigateBack, + formatDate2, + setValue, + getValue, + isLogin, + reLaunch, + switchTab, + dateToTime, +} \ No newline at end of file diff --git a/common/regex.js b/common/regex.js new file mode 100644 index 00000000..0d4ce6cf --- /dev/null +++ b/common/regex.js @@ -0,0 +1,174 @@ +// 定义正则表达式 +const regexes = { + email: /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/, + phone: /^(?:(?:\+|00)86)?1\d{10}$/, + url: /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/, + ip: /^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))$/, + uuid: /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/, + required: /^.+$/, + is_number: /^\d+(\.\d+)?$/, + is_chinese: /^[\u4e00-\u9fa5]+$/, + is_realname: /^(?:[\u4e00-\u9fa5·]{2,50})$/, + is_english: /^[A-Za-z]+$/, + is_id_card: /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/, + is_bank_card: /^[1-9]\d{9,29}$/, + is_car_id: /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/, + is_username: /^.{5,18}$/, + is_password: /^.{4,18}$/, + is_email: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/ +}; + +// 邮箱 +export const checkEmail = (rule, sId, callback) => { + let _idRe = regexes.is_usis_emailername + if (!_idRe.test(sId)) { + callback(new Error('邮箱格式不正确')); + } + callback(); +} + +// 用户名 +export const checkUserName = (rule, sId, callback) => { + let _idRe = regexes.is_username + if (!_idRe.test(sId)) { + callback(new Error('用户名格式不正确')); + } + callback(); +} +// 密码 +export const checkPassword = (rule, sId, callback) => { + let _idRe = regexes.is_password + if (!_idRe.test(sId)) { + callback(new Error('密码格式不正确')); + } + callback(); +} + +// 车牌号 +export const checkCarId = (rule, sId, callback) => { + let _idRe = regexes.is_car_id + if (!_idRe.test(sId)) { + callback(new Error('车牌号格式不正确')); + } + callback(); +} +// 银行卡 +export const checkBankCard = (rule, sId, callback) => { + let _idRe = regexes.is_bank_card + if (!_idRe.test(sId)) { + callback(new Error('银行卡号格式不正确')); + } + callback(); +} + +// 验证手机号 +export const checkPhone = (rule, sId, callback) => { + let _idRe = regexes.phone + if (!_idRe.test(sId)) { + callback(new Error('手机号不正确')); + } + callback(); +} + +// 验证姓名 +export const checkName = (rule, sId, callback) => { + let _idRe = regexes.is_chinese + if (!_idRe.test(sId)) { + callback(new Error('姓名不正确')); + } + callback(); +} +export const checkRealName = (rule, sId, callback) => { + let _idRe = regexes.is_realname + if (!_idRe.test(sId)) { + callback(new Error('姓名不正确')); + } + callback(); +} + +// 验证身份证号 +export const checkIdCard = (rule, sId, callback) => { + if (!sId) { + return callback(new Error('身份证号不能为空')); + } + let _idRe = + /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/ + if (!_idRe.test(sId)) { + callback(new Error('⾝份证长度或格式错误')); + } + //⾝份证城市 + const aCity = { + 11: "北京", + 12: "天津", + 13: "河北", + 14: "山西", + 15: "内蒙古", + 21: "辽宁", + 22: "吉林", + 23: "黑龙江", + 31: "上海", + 32: "江苏", + 33: "浙江", + 34: "安徽", + 35: "福建", + 36: "江西", + 37: "山东", + 41: "河南", + 42: "湖北", + 43: "湖南", + 44: "广东", + 45: "广西", + 46: "海南", + 50: "重庆", + 51: "四川", + 52: "贵州", + 53: "云南", + 54: "西藏", + 61: "陕西", + 62: "甘肃", + 63: "青海", + 64: "宁夏", + 65: "新疆", + 71: "台湾", + 81: "香港", + 82: "澳门", + 91: "国外" + }; + if (!aCity[parseInt(sId.substr(0, 2))]) { + callback(new Error('身份证地区有误')); + } + // 出生期验证 + const sBirthday = (sId.substr(6, 4) + "-" + Number(sId.substr(10, 2)) + "-" + Number(sId.substr(12, 2))) + .replace(/-/g, "/") + const d = new Date(sBirthday) + if (sBirthday != (d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate())) { + callback(new Error('出生日期有误')); + } + // ⾝份证号码校验 + if (sId.length == 18) { + let sum = 0 + const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], + codes = "10X98765432" + for (let i = 0; i < sId.length - 1; i++) { + sum += sId[i] * weights[i]; + } + const last = codes[sum % 11]; //计算出来的最后⼀位⾝份证号码 + if (sId[sId.length - 1] != last) { + callback(new Error('身份证号校验码有误')); + } + callback(); + } +}; + +export const validator = { + checkName, + checkIdCard, + checkPhone, + checkCarId, + checkBankCard, + checkUserName, + checkPassword, + checkEmail +} + +export default regexes; \ No newline at end of file diff --git a/components/nav-bar/nav-bar.vue b/components/nav-bar/nav-bar.vue new file mode 100644 index 00000000..d54d378c --- /dev/null +++ b/components/nav-bar/nav-bar.vue @@ -0,0 +1,48 @@ + + + + diff --git a/components/tabbar-shadow/tabbar-shadow.vue b/components/tabbar-shadow/tabbar-shadow.vue new file mode 100644 index 00000000..55624c94 --- /dev/null +++ b/components/tabbar-shadow/tabbar-shadow.vue @@ -0,0 +1,26 @@ + + + + \ No newline at end of file diff --git a/enum.js b/enum.js new file mode 100644 index 00000000..388dd752 --- /dev/null +++ b/enum.js @@ -0,0 +1,4 @@ + +MaxUploadPictureSize = 2048 // 最大图片上传限制 +MaxUploadDocumentMaxSize = 102400 // 最大文档上传限制 + diff --git a/main.js b/main.js index da244b6a..7225dce9 100644 --- a/main.js +++ b/main.js @@ -1,17 +1,6 @@ import App from './App' -// #ifndef VUE3 -import Vue from 'vue' -import './uni.promisify.adaptor' -Vue.config.productionTip = false -App.mpType = 'app' -const app = new Vue({ - ...App -}) -app.$mount() -// #endif -// #ifdef VUE3 import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) @@ -19,7 +8,3 @@ export function createApp() { app } } -// #endif -// main.js -import uView from '@/uni_modules/uview-ui' -Vue.use(uView) \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3dc7d032..f9918bf4 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "h5", + "name" : "tra-app", "appid" : "", "description" : "", "versionName" : "1.0.0", @@ -68,5 +68,5 @@ "uniStatistics" : { "enable" : false }, - "vueVersion" : "2" + "vueVersion" : "3" } diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid new file mode 100644 index 00000000..68602258 --- /dev/null +++ b/node_modules/.bin/uuid @@ -0,0 +1,15 @@ +#!/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 + "$basedir/node" "$basedir/../uuid/dist/esm/bin/uuid" "$@" + ret=$? +else + node "$basedir/../uuid/dist/esm/bin/uuid" "$@" + ret=$? +fi +exit $ret diff --git a/node_modules/.bin/uuid.cmd b/node_modules/.bin/uuid.cmd new file mode 100644 index 00000000..945d7a1a --- /dev/null +++ b/node_modules/.bin/uuid.cmd @@ -0,0 +1,17 @@ +@ECHO off +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +"%_prog%" "%dp0%\..\uuid\dist\esm\bin\uuid" %* +ENDLOCAL +EXIT /b %errorlevel% +:find_dp0 +SET dp0=%~dp0 +EXIT /b diff --git a/node_modules/.bin/uuid.ps1 b/node_modules/.bin/uuid.ps1 new file mode 100644 index 00000000..75476551 --- /dev/null +++ b/node_modules/.bin/uuid.ps1 @@ -0,0 +1,18 @@ +#!/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") { + & "$basedir/node$exe" "$basedir/../uuid/dist/esm/bin/uuid" $args + $ret=$LASTEXITCODE +} else { + & "node$exe" "$basedir/../uuid/dist/esm/bin/uuid" $args + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/uuid/LICENSE.md b/node_modules/uuid/LICENSE.md new file mode 100644 index 00000000..39341683 --- /dev/null +++ b/node_modules/uuid/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2010-2020 Robert Kieffer and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/uuid/README.md b/node_modules/uuid/README.md new file mode 100644 index 00000000..83ae737e --- /dev/null +++ b/node_modules/uuid/README.md @@ -0,0 +1,510 @@ + + +# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions/workflows/browser.yml) + +For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formerly [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs + +- **Complete** - Support for all RFC9562 UUID versions +- **Cross-platform** - Support for... + - ESM & Common JS + - [Typescript](#support) + - [Chrome, Safari, Firefox, and Edge](#support) + - [NodeJS](#support) + - [React Native / Expo](#react-native--expo) +- **Secure** - Uses modern `crypto` API for random values +- **Compact** - Zero-dependency, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) +- **CLI** - [`uuid` command line](#command-line) utility + + +> [!NOTE] +> `uuid@11` is now available: See the [CHANGELOG](./CHANGELOG.md) for details. TL;DR: +> * TypeScript support is now included (remove `@types/uuid` from your dependencies) +> * Subtle changes to how the `options` arg is interpreted for `v1()`, `v6()`, and `v7()`. [See details](#options-handling-for-timestamp-uuids) +> * Binary UUIDs are now `Uint8Array`s. (May impact callers of `parse()`, `stringify()`, or that pass an `option#buf` argument to `v1()`-`v7()`.) + +## Quickstart + +**1. Install** + +```shell +npm install uuid +``` + +**2. Create a UUID** + +ESM-syntax (must use named exports): + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' +``` + +... CommonJS: + +```javascript +const { v4: uuidv4 } = require('uuid'); +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` + +For timestamp UUIDs, namespace UUIDs, and other options read on ... + +## API Summary + +| | | | +| --- | --- | --- | +| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | +| [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) | New in `uuid@9.1` | +| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | +| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | +| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | +| [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Create a version 6 UUID from a version 1 UUID | New in `uuid@10` | +| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | +| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | +| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | +| [`uuid.v6()`](#uuidv6options-buffer-offset) | Create a version 6 (timestamp, reordered) UUID | New in `uuid@10` | +| [`uuid.v6ToV1()`](#uuidv6tov1uuid) | Create a version 1 UUID from a version 6 UUID | New in `uuid@10` | +| [`uuid.v7()`](#uuidv7options-buffer-offset) | Create a version 7 (Unix Epoch time-based) UUID | New in `uuid@10` | +| ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" | | +| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | +| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | + +## API + +### uuid.NIL + +The nil UUID string (all zeros). + +Example: + +```javascript +import { NIL as NIL_UUID } from 'uuid'; + +NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' +``` + +### uuid.MAX + +The max UUID string (all ones). + +Example: + +```javascript +import { MAX as MAX_UUID } from 'uuid'; + +MAX_UUID; // ⇨ 'ffffffff-ffff-ffff-ffff-ffffffffffff' +``` + +### uuid.parse(str) + +Convert UUID string to array of bytes + +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Uint8Array[16]` | +| _throws_ | `TypeError` if `str` is not a valid UUID | + + +> [!NOTE] +> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. + +Example: + +```javascript +import { parse as uuidParse } from 'uuid'; + +// Parse a UUID +uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ +// Uint8Array(16) [ +// 110, 192, 189, 127, 17, +// 192, 67, 218, 151, 94, +// 42, 138, 217, 235, 174, +// 11 +// ] +``` + +### uuid.stringify(arr[, offset]) + +Convert array of bytes to UUID string + +| | | +| -------------- | ---------------------------------------------------------------------------- | +| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. | +| [`offset` = 0] | `Number` Starting index in the Array | +| _returns_ | `String` | +| _throws_ | `TypeError` if a valid UUID string cannot be generated | + + +> [!NOTE] +> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. + +Example: + +```javascript +import { stringify as uuidStringify } from 'uuid'; + +const uuidBytes = Uint8Array.of( + 0x6e, + 0xc0, + 0xbd, + 0x7f, + 0x11, + 0xc0, + 0x43, + 0xda, + 0x97, + 0x5e, + 0x2a, + 0x8a, + 0xd9, + 0xeb, + 0xae, + 0x0b +); + +uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' +``` + +### uuid.v1([options[, buffer[, offset]]]) + +Create an RFC version 1 (timestamp) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.node = (random)` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | +| [`options.clockseq = (random)`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | +| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.nsecs = 0`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) | +| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | +| _throws_ | `Error` if more than 10M UUIDs/sec are requested | + + +> [!NOTE] +> The default [node id](https://datatracker.ietf.org/doc/html/rfc9562#section-5.1) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. + + +> [!NOTE] +> `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. + +Example: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-9bdd-2b0d7b3dcb6d' +``` + +Example using `options`: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +const options = { + node: Uint8Array.of(0x01, 0x23, 0x45, 0x67, 0x89, 0xab), + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678, +}; +uuidv1(options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' +``` + +### uuid.v1ToV6(uuid) + +Convert a UUID from version 1 to version 6 + +```javascript +import { v1ToV6 } from 'uuid'; + +v1ToV6('92f62d9e-22c4-11ef-97e9-325096b39f47'); // ⇨ '1ef22c49-2f62-6d9e-97e9-325096b39f47' +``` + +### uuid.v3(name, namespace[, buffer[, offset]]) + +Create an RFC version 3 (namespace w/ MD5) UUID + +API is identical to `v5()`, but uses "v3" instead. + + +> [!IMPORTANT] +> Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." + +### uuid.v4([options[, buffer[, offset]]]) + +Create an RFC version 4 (random) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + +Example: + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' +``` + +Example using predefined `random` values: + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +const v4options = { + random: Uint8Array.of( + 0x10, + 0x91, + 0x56, + 0xbe, + 0xc4, + 0xfb, + 0xc1, + 0xea, + 0x71, + 0xb4, + 0xef, + 0xe1, + 0x67, + 0x1c, + 0x58, + 0x36 + ), +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' +``` + +### uuid.v5(name, namespace[, buffer[, offset]]) + +Create an RFC version 5 (namespace w/ SHA-1) UUID + +| | | +| --- | --- | +| `name` | `String \| Array` | +| `namespace` | `String \| Array[16]` Namespace UUID | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + + +> [!NOTE] +> The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. + +Example with custom namespace: + +```javascript +import { v5 as uuidv5 } from 'uuid'; + +// Define a custom namespace. Readers, create your own using something like +// https://www.uuidgenerator.net/ +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; + +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' +``` + +Example with RFC `URL` namespace: + +```javascript +import { v5 as uuidv5 } from 'uuid'; + +uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' +``` + +### uuid.v6([options[, buffer[, offset]]]) + +Create an RFC version 6 (timestamp, reordered) UUID + +This method takes the same arguments as uuid.v1(). + +```javascript +import { v6 as uuidv6 } from 'uuid'; + +uuidv6(); // ⇨ '1e940672-c5ea-64c0-9b5d-ab8dfbbd4bed' +``` + +Example using `options`: + +```javascript +import { v6 as uuidv6 } from 'uuid'; + +const options = { + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678, +}; +uuidv6(options); // ⇨ '1e1041c7-10b9-662e-9234-0123456789ab' +``` + +### uuid.v6ToV1(uuid) + +Convert a UUID from version 6 to version 1 + +```javascript +import { v6ToV1 } from 'uuid'; + +v6ToV1('1ef22c49-2f62-6d9e-97e9-325096b39f47'); // ⇨ '92f62d9e-22c4-11ef-97e9-325096b39f47' +``` + +### uuid.v7([options[, buffer[, offset]]]) + +Create an RFC version 7 (random) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + +Example: + +```javascript +import { v7 as uuidv7 } from 'uuid'; + +uuidv7(); // ⇨ '01695553-c90c-705a-b56d-778dfbbd4bed' +``` + +### ~~uuid.v8()~~ + +**_"Intentionally left blank"_** + + +> [!NOTE] +> Version 8 (experimental) UUIDs are "[for experimental or vendor-specific use cases](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-8)". The RFC does not define a creation algorithm for them, which is why this package does not offer a `v8()` method. The `validate()` and `version()` methods do work with such UUIDs, however. + +### uuid.validate(str) + +Test a string to see if it is a valid UUID + +| | | +| --------- | --------------------------------------------------- | +| `str` | `String` to validate | +| _returns_ | `true` if string is a valid UUID, `false` otherwise | + +Example: + +```javascript +import { validate as uuidValidate } from 'uuid'; + +uuidValidate('not a UUID'); // ⇨ false +uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true +``` + +Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds. + +```javascript +import { version as uuidVersion } from 'uuid'; +import { validate as uuidValidate } from 'uuid'; + +function uuidValidateV4(uuid) { + return uuidValidate(uuid) && uuidVersion(uuid) === 4; +} + +const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210'; +const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836'; + +uuidValidateV4(v4Uuid); // ⇨ true +uuidValidateV4(v1Uuid); // ⇨ false +``` + +### uuid.version(str) + +Detect RFC version of a UUID + +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Number` The RFC version of the UUID | +| _throws_ | `TypeError` if `str` is not a valid UUID | + +Example: + +```javascript +import { version as uuidVersion } from 'uuid'; + +uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 +uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 +``` + + +> [!NOTE] +> This method returns `0` for the `NIL` UUID, and `15` for the `MAX` UUID. + +## Command Line + +UUIDs can be generated from the command line using `uuid`. + +```shell +$ npx uuid +ddeb27fb-d9a0-4624-be4d-4615062daed4 +``` + +The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: + +```shell +$ npx uuid --help + +Usage: + uuid + uuid v1 + uuid v3 + uuid v4 + uuid v5 + uuid v7 + uuid --help + +Note: may be "URL" or "DNS" to use the corresponding UUIDs +defined by RFC9562 +``` + +## `options` Handling for Timestamp UUIDs + +Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors: + +- Without `options`: Internal state is utilized to improve UUID uniqueness. +- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed. + +## Support + +**Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested. + +**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. `node@18` is in maintainence mode, and `node@22` is the current LTS release. So `uuid` supports `node@16`-`node@22`. + +**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715) + +## Known issues + + + +### "getRandomValues() not supported" + +This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: + +#### React Native / Expo + +1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) +1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: + +```javascript +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; +``` + +--- + +Markdown generated from [README_js.md](README_js.md) by diff --git a/node_modules/uuid/dist/cjs-browser/index.d.ts b/node_modules/uuid/dist/cjs-browser/index.d.ts new file mode 100644 index 00000000..d7d4edc3 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/node_modules/uuid/dist/cjs-browser/index.js b/node_modules/uuid/dist/cjs-browser/index.js new file mode 100644 index 00000000..6148ea47 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0; +var max_js_1 = require("./max.js"); +Object.defineProperty(exports, "MAX", { enumerable: true, get: function () { return max_js_1.default; } }); +var nil_js_1 = require("./nil.js"); +Object.defineProperty(exports, "NIL", { enumerable: true, get: function () { return nil_js_1.default; } }); +var parse_js_1 = require("./parse.js"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.default; } }); +var stringify_js_1 = require("./stringify.js"); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.default; } }); +var v1_js_1 = require("./v1.js"); +Object.defineProperty(exports, "v1", { enumerable: true, get: function () { return v1_js_1.default; } }); +var v1ToV6_js_1 = require("./v1ToV6.js"); +Object.defineProperty(exports, "v1ToV6", { enumerable: true, get: function () { return v1ToV6_js_1.default; } }); +var v3_js_1 = require("./v3.js"); +Object.defineProperty(exports, "v3", { enumerable: true, get: function () { return v3_js_1.default; } }); +var v4_js_1 = require("./v4.js"); +Object.defineProperty(exports, "v4", { enumerable: true, get: function () { return v4_js_1.default; } }); +var v5_js_1 = require("./v5.js"); +Object.defineProperty(exports, "v5", { enumerable: true, get: function () { return v5_js_1.default; } }); +var v6_js_1 = require("./v6.js"); +Object.defineProperty(exports, "v6", { enumerable: true, get: function () { return v6_js_1.default; } }); +var v6ToV1_js_1 = require("./v6ToV1.js"); +Object.defineProperty(exports, "v6ToV1", { enumerable: true, get: function () { return v6ToV1_js_1.default; } }); +var v7_js_1 = require("./v7.js"); +Object.defineProperty(exports, "v7", { enumerable: true, get: function () { return v7_js_1.default; } }); +var validate_js_1 = require("./validate.js"); +Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_js_1.default; } }); +var version_js_1 = require("./version.js"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.default; } }); diff --git a/node_modules/uuid/dist/cjs-browser/max.d.ts b/node_modules/uuid/dist/cjs-browser/max.d.ts new file mode 100644 index 00000000..7a1e972a --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/node_modules/uuid/dist/cjs-browser/max.js b/node_modules/uuid/dist/cjs-browser/max.js new file mode 100644 index 00000000..7ba71eff --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/max.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/node_modules/uuid/dist/cjs-browser/md5.d.ts b/node_modules/uuid/dist/cjs-browser/md5.d.ts new file mode 100644 index 00000000..5a55f51e --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/md5.d.ts @@ -0,0 +1,2 @@ +declare function md5(bytes: Uint8Array): Uint8Array; +export default md5; diff --git a/node_modules/uuid/dist/cjs-browser/md5.js b/node_modules/uuid/dist/cjs-browser/md5.js new file mode 100644 index 00000000..004b3d68 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/md5.js @@ -0,0 +1,137 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function md5(bytes) { + const words = uint8ToUint32(bytes); + const md5Bytes = wordsToMd5(words, bytes.length * 8); + return uint32ToUint8(md5Bytes); +} +function uint32ToUint8(input) { + const bytes = new Uint8Array(input.length * 4); + for (let i = 0; i < input.length * 4; i++) { + bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff; + } + return bytes; +} +function getOutputLength(inputLength8) { + return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1; +} +function wordsToMd5(x, len) { + const xpad = new Uint32Array(getOutputLength(len)).fill(0); + xpad.set(x); + xpad[len >> 5] |= 0x80 << len % 32; + xpad[xpad.length - 1] = len; + x = xpad; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + return Uint32Array.of(a, b, c, d); +} +function uint8ToUint32(input) { + if (input.length === 0) { + return new Uint32Array(); + } + const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0); + for (let i = 0; i < input.length; i++) { + output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8); + } + return output; +} +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); +} +function bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} +function md5ff(a, b, c, d, x, s, t) { + return md5cmn((b & c) | (~b & d), a, b, x, s, t); +} +function md5gg(a, b, c, d, x, s, t) { + return md5cmn((b & d) | (c & ~d), a, b, x, s, t); +} +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} +exports.default = md5; diff --git a/node_modules/uuid/dist/cjs-browser/native.d.ts b/node_modules/uuid/dist/cjs-browser/native.d.ts new file mode 100644 index 00000000..9418fd3a --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/native.d.ts @@ -0,0 +1,4 @@ +declare const _default: { + randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`); +}; +export default _default; diff --git a/node_modules/uuid/dist/cjs-browser/native.js b/node_modules/uuid/dist/cjs-browser/native.js new file mode 100644 index 00000000..7e31a2ad --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/native.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +exports.default = { randomUUID }; diff --git a/node_modules/uuid/dist/cjs-browser/nil.d.ts b/node_modules/uuid/dist/cjs-browser/nil.d.ts new file mode 100644 index 00000000..b03bb98e --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/node_modules/uuid/dist/cjs-browser/nil.js b/node_modules/uuid/dist/cjs-browser/nil.js new file mode 100644 index 00000000..5828aa4c --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/nil.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = '00000000-0000-0000-0000-000000000000'; diff --git a/node_modules/uuid/dist/cjs-browser/package.json b/node_modules/uuid/dist/cjs-browser/package.json new file mode 100644 index 00000000..729ac4d9 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} diff --git a/node_modules/uuid/dist/cjs-browser/parse.d.ts b/node_modules/uuid/dist/cjs-browser/parse.d.ts new file mode 100644 index 00000000..a316fb11 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/node_modules/uuid/dist/cjs-browser/parse.js b/node_modules/uuid/dist/cjs-browser/parse.js new file mode 100644 index 00000000..d2fa8cac --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/parse.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function parse(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +exports.default = parse; diff --git a/node_modules/uuid/dist/cjs-browser/regex.d.ts b/node_modules/uuid/dist/cjs-browser/regex.d.ts new file mode 100644 index 00000000..d39fa3f6 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/node_modules/uuid/dist/cjs-browser/regex.js b/node_modules/uuid/dist/cjs-browser/regex.js new file mode 100644 index 00000000..e3dde2ae --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/regex.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/node_modules/uuid/dist/cjs-browser/rng.d.ts b/node_modules/uuid/dist/cjs-browser/rng.d.ts new file mode 100644 index 00000000..73e60cf3 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/node_modules/uuid/dist/cjs-browser/rng.js b/node_modules/uuid/dist/cjs-browser/rng.js new file mode 100644 index 00000000..155bcd7d --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/rng.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +let getRandomValues; +const rnds8 = new Uint8Array(16); +function rng() { + if (!getRandomValues) { + if (typeof crypto === 'undefined' || !crypto.getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + getRandomValues = crypto.getRandomValues.bind(crypto); + } + return getRandomValues(rnds8); +} +exports.default = rng; diff --git a/node_modules/uuid/dist/cjs-browser/sha1.d.ts b/node_modules/uuid/dist/cjs-browser/sha1.d.ts new file mode 100644 index 00000000..a6552e5d --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/sha1.d.ts @@ -0,0 +1,2 @@ +declare function sha1(bytes: Uint8Array): Uint8Array; +export default sha1; diff --git a/node_modules/uuid/dist/cjs-browser/sha1.js b/node_modules/uuid/dist/cjs-browser/sha1.js new file mode 100644 index 00000000..031c42cc --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/sha1.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function f(s, x, y, z) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + } +} +function ROTL(x, n) { + return (x << n) | (x >>> (32 - n)); +} +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + const newBytes = new Uint8Array(bytes.length + 1); + newBytes.set(bytes); + newBytes[bytes.length] = 0x80; + bytes = newBytes; + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + for (let j = 0; j < 16; ++j) { + arr[j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + M[i] = arr; + } + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]); +} +exports.default = sha1; diff --git a/node_modules/uuid/dist/cjs-browser/stringify.d.ts b/node_modules/uuid/dist/cjs-browser/stringify.d.ts new file mode 100644 index 00000000..16cb0088 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/node_modules/uuid/dist/cjs-browser/stringify.js b/node_modules/uuid/dist/cjs-browser/stringify.js new file mode 100644 index 00000000..2ba27bbd --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/stringify.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unsafeStringify = void 0; +const validate_js_1 = require("./validate.js"); +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +exports.unsafeStringify = unsafeStringify; +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +exports.default = stringify; diff --git a/node_modules/uuid/dist/cjs-browser/types.d.ts b/node_modules/uuid/dist/cjs-browser/types.d.ts new file mode 100644 index 00000000..ecaed97c --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/node_modules/uuid/dist/cjs-browser/types.js b/node_modules/uuid/dist/cjs-browser/types.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts b/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/uuid/dist/cjs-browser/uuid-bin.js b/node_modules/uuid/dist/cjs-browser/uuid-bin.js new file mode 100644 index 00000000..d613137a --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/uuid-bin.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = require("assert"); +const v1_js_1 = require("./v1.js"); +const v3_js_1 = require("./v3.js"); +const v4_js_1 = require("./v4.js"); +const v5_js_1 = require("./v5.js"); +const v6_js_1 = require("./v6.js"); +const v7_js_1 = require("./v7.js"); +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log((0, v1_js_1.default)()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v3_js_1.default.DNS; + } + console.log((0, v3_js_1.default)(name, namespace)); + break; + } + case 'v4': + console.log((0, v4_js_1.default)()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v5_js_1.default.DNS; + } + console.log((0, v5_js_1.default)(name, namespace)); + break; + } + case 'v6': + console.log((0, v6_js_1.default)()); + break; + case 'v7': + console.log((0, v7_js_1.default)()); + break; + default: + usage(); + process.exit(1); +} diff --git a/node_modules/uuid/dist/cjs-browser/v1.d.ts b/node_modules/uuid/dist/cjs-browser/v1.d.ts new file mode 100644 index 00000000..d8ecee0c --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/node_modules/uuid/dist/cjs-browser/v1.js b/node_modules/uuid/dist/cjs-browser/v1.js new file mode 100644 index 00000000..155b80d0 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v1.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV1State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +exports.updateV1State = updateV1State; +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +exports.default = v1; diff --git a/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts b/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts new file mode 100644 index 00000000..38eaaf0c --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/cjs-browser/v1ToV6.js b/node_modules/uuid/dist/cjs-browser/v1ToV6.js new file mode 100644 index 00000000..daba2c32 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v1ToV6.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v6Bytes) : v6Bytes; +} +exports.default = v1ToV6; +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/node_modules/uuid/dist/cjs-browser/v3.d.ts b/node_modules/uuid/dist/cjs-browser/v3.d.ts new file mode 100644 index 00000000..5d1c434d --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/node_modules/uuid/dist/cjs-browser/v3.js b/node_modules/uuid/dist/cjs-browser/v3.js new file mode 100644 index 00000000..d318d2ab --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v3.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const md5_js_1 = require("./md5.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v3(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x30, md5_js_1.default, value, namespace, buf, offset); +} +v3.DNS = v35_js_1.DNS; +v3.URL = v35_js_1.URL; +exports.default = v3; diff --git a/node_modules/uuid/dist/cjs-browser/v35.d.ts b/node_modules/uuid/dist/cjs-browser/v35.d.ts new file mode 100644 index 00000000..4e6e9d59 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/node_modules/uuid/dist/cjs-browser/v35.js b/node_modules/uuid/dist/cjs-browser/v35.js new file mode 100644 index 00000000..a3712f2a --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v35.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = exports.stringToBytes = void 0; +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +exports.stringToBytes = stringToBytes; +exports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? (0, parse_js_1.default)(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = (0, parse_js_1.default)(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v35; diff --git a/node_modules/uuid/dist/cjs-browser/v4.d.ts b/node_modules/uuid/dist/cjs-browser/v4.d.ts new file mode 100644 index 00000000..8205333f --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/node_modules/uuid/dist/cjs-browser/v4.js b/node_modules/uuid/dist/cjs-browser/v4.js new file mode 100644 index 00000000..69c975e4 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v4.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const native_js_1 = require("./native.js"); +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +function v4(options, buf, offset) { + if (native_js_1.default.randomUUID && !buf && !options) { + return native_js_1.default.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? (0, rng_js_1.default)(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(rnds); +} +exports.default = v4; diff --git a/node_modules/uuid/dist/cjs-browser/v5.d.ts b/node_modules/uuid/dist/cjs-browser/v5.d.ts new file mode 100644 index 00000000..0e2ff2f3 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/node_modules/uuid/dist/cjs-browser/v5.js b/node_modules/uuid/dist/cjs-browser/v5.js new file mode 100644 index 00000000..c4239c2f --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v5.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const sha1_js_1 = require("./sha1.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v5(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x50, sha1_js_1.default, value, namespace, buf, offset); +} +v5.DNS = v35_js_1.DNS; +v5.URL = v35_js_1.URL; +exports.default = v5; diff --git a/node_modules/uuid/dist/cjs-browser/v6.d.ts b/node_modules/uuid/dist/cjs-browser/v6.d.ts new file mode 100644 index 00000000..cabf4a0d --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/node_modules/uuid/dist/cjs-browser/v6.js b/node_modules/uuid/dist/cjs-browser/v6.js new file mode 100644 index 00000000..b02748db --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v6.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stringify_js_1 = require("./stringify.js"); +const v1_js_1 = require("./v1.js"); +const v1ToV6_js_1 = require("./v1ToV6.js"); +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = (0, v1_js_1.default)({ ...options, _v6: true }, new Uint8Array(16)); + bytes = (0, v1ToV6_js_1.default)(bytes); + if (buf) { + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v6; diff --git a/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts b/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts new file mode 100644 index 00000000..3b3ffc21 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/cjs-browser/v6ToV1.js b/node_modules/uuid/dist/cjs-browser/v6ToV1.js new file mode 100644 index 00000000..9dcb6615 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v6ToV1.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes; +} +exports.default = v6ToV1; +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/node_modules/uuid/dist/cjs-browser/v7.d.ts b/node_modules/uuid/dist/cjs-browser/v7.d.ts new file mode 100644 index 00000000..f49b03d5 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/node_modules/uuid/dist/cjs-browser/v7.js b/node_modules/uuid/dist/cjs-browser/v7.js new file mode 100644 index 00000000..697fe342 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/v7.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV7State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +exports.updateV7State = updateV7State; +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +exports.default = v7; diff --git a/node_modules/uuid/dist/cjs-browser/validate.d.ts b/node_modules/uuid/dist/cjs-browser/validate.d.ts new file mode 100644 index 00000000..57da03d7 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/node_modules/uuid/dist/cjs-browser/validate.js b/node_modules/uuid/dist/cjs-browser/validate.js new file mode 100644 index 00000000..89733b06 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/validate.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const regex_js_1 = require("./regex.js"); +function validate(uuid) { + return typeof uuid === 'string' && regex_js_1.default.test(uuid); +} +exports.default = validate; diff --git a/node_modules/uuid/dist/cjs-browser/version.d.ts b/node_modules/uuid/dist/cjs-browser/version.d.ts new file mode 100644 index 00000000..f1948dc8 --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/node_modules/uuid/dist/cjs-browser/version.js b/node_modules/uuid/dist/cjs-browser/version.js new file mode 100644 index 00000000..05ecd00d --- /dev/null +++ b/node_modules/uuid/dist/cjs-browser/version.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function version(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +exports.default = version; diff --git a/node_modules/uuid/dist/cjs/index.d.ts b/node_modules/uuid/dist/cjs/index.d.ts new file mode 100644 index 00000000..d7d4edc3 --- /dev/null +++ b/node_modules/uuid/dist/cjs/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/node_modules/uuid/dist/cjs/index.js b/node_modules/uuid/dist/cjs/index.js new file mode 100644 index 00000000..6148ea47 --- /dev/null +++ b/node_modules/uuid/dist/cjs/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0; +var max_js_1 = require("./max.js"); +Object.defineProperty(exports, "MAX", { enumerable: true, get: function () { return max_js_1.default; } }); +var nil_js_1 = require("./nil.js"); +Object.defineProperty(exports, "NIL", { enumerable: true, get: function () { return nil_js_1.default; } }); +var parse_js_1 = require("./parse.js"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.default; } }); +var stringify_js_1 = require("./stringify.js"); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.default; } }); +var v1_js_1 = require("./v1.js"); +Object.defineProperty(exports, "v1", { enumerable: true, get: function () { return v1_js_1.default; } }); +var v1ToV6_js_1 = require("./v1ToV6.js"); +Object.defineProperty(exports, "v1ToV6", { enumerable: true, get: function () { return v1ToV6_js_1.default; } }); +var v3_js_1 = require("./v3.js"); +Object.defineProperty(exports, "v3", { enumerable: true, get: function () { return v3_js_1.default; } }); +var v4_js_1 = require("./v4.js"); +Object.defineProperty(exports, "v4", { enumerable: true, get: function () { return v4_js_1.default; } }); +var v5_js_1 = require("./v5.js"); +Object.defineProperty(exports, "v5", { enumerable: true, get: function () { return v5_js_1.default; } }); +var v6_js_1 = require("./v6.js"); +Object.defineProperty(exports, "v6", { enumerable: true, get: function () { return v6_js_1.default; } }); +var v6ToV1_js_1 = require("./v6ToV1.js"); +Object.defineProperty(exports, "v6ToV1", { enumerable: true, get: function () { return v6ToV1_js_1.default; } }); +var v7_js_1 = require("./v7.js"); +Object.defineProperty(exports, "v7", { enumerable: true, get: function () { return v7_js_1.default; } }); +var validate_js_1 = require("./validate.js"); +Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_js_1.default; } }); +var version_js_1 = require("./version.js"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.default; } }); diff --git a/node_modules/uuid/dist/cjs/max.d.ts b/node_modules/uuid/dist/cjs/max.d.ts new file mode 100644 index 00000000..7a1e972a --- /dev/null +++ b/node_modules/uuid/dist/cjs/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/node_modules/uuid/dist/cjs/max.js b/node_modules/uuid/dist/cjs/max.js new file mode 100644 index 00000000..7ba71eff --- /dev/null +++ b/node_modules/uuid/dist/cjs/max.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/node_modules/uuid/dist/cjs/md5.d.ts b/node_modules/uuid/dist/cjs/md5.d.ts new file mode 100644 index 00000000..f8f6ecf3 --- /dev/null +++ b/node_modules/uuid/dist/cjs/md5.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function md5(bytes: Uint8Array): Buffer; +export default md5; diff --git a/node_modules/uuid/dist/cjs/md5.js b/node_modules/uuid/dist/cjs/md5.js new file mode 100644 index 00000000..76650130 --- /dev/null +++ b/node_modules/uuid/dist/cjs/md5.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return (0, crypto_1.createHash)('md5').update(bytes).digest(); +} +exports.default = md5; diff --git a/node_modules/uuid/dist/cjs/native.d.ts b/node_modules/uuid/dist/cjs/native.d.ts new file mode 100644 index 00000000..2b6c756e --- /dev/null +++ b/node_modules/uuid/dist/cjs/native.d.ts @@ -0,0 +1,6 @@ +/// +import { randomUUID } from 'crypto'; +declare const _default: { + randomUUID: typeof randomUUID; +}; +export default _default; diff --git a/node_modules/uuid/dist/cjs/native.js b/node_modules/uuid/dist/cjs/native.js new file mode 100644 index 00000000..1013e98d --- /dev/null +++ b/node_modules/uuid/dist/cjs/native.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +exports.default = { randomUUID: crypto_1.randomUUID }; diff --git a/node_modules/uuid/dist/cjs/nil.d.ts b/node_modules/uuid/dist/cjs/nil.d.ts new file mode 100644 index 00000000..b03bb98e --- /dev/null +++ b/node_modules/uuid/dist/cjs/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/node_modules/uuid/dist/cjs/nil.js b/node_modules/uuid/dist/cjs/nil.js new file mode 100644 index 00000000..5828aa4c --- /dev/null +++ b/node_modules/uuid/dist/cjs/nil.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = '00000000-0000-0000-0000-000000000000'; diff --git a/node_modules/uuid/dist/cjs/package.json b/node_modules/uuid/dist/cjs/package.json new file mode 100644 index 00000000..729ac4d9 --- /dev/null +++ b/node_modules/uuid/dist/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} diff --git a/node_modules/uuid/dist/cjs/parse.d.ts b/node_modules/uuid/dist/cjs/parse.d.ts new file mode 100644 index 00000000..a316fb11 --- /dev/null +++ b/node_modules/uuid/dist/cjs/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/node_modules/uuid/dist/cjs/parse.js b/node_modules/uuid/dist/cjs/parse.js new file mode 100644 index 00000000..d2fa8cac --- /dev/null +++ b/node_modules/uuid/dist/cjs/parse.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function parse(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +exports.default = parse; diff --git a/node_modules/uuid/dist/cjs/regex.d.ts b/node_modules/uuid/dist/cjs/regex.d.ts new file mode 100644 index 00000000..d39fa3f6 --- /dev/null +++ b/node_modules/uuid/dist/cjs/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/node_modules/uuid/dist/cjs/regex.js b/node_modules/uuid/dist/cjs/regex.js new file mode 100644 index 00000000..e3dde2ae --- /dev/null +++ b/node_modules/uuid/dist/cjs/regex.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/node_modules/uuid/dist/cjs/rng.d.ts b/node_modules/uuid/dist/cjs/rng.d.ts new file mode 100644 index 00000000..73e60cf3 --- /dev/null +++ b/node_modules/uuid/dist/cjs/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/node_modules/uuid/dist/cjs/rng.js b/node_modules/uuid/dist/cjs/rng.js new file mode 100644 index 00000000..8f5458eb --- /dev/null +++ b/node_modules/uuid/dist/cjs/rng.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +const rnds8Pool = new Uint8Array(256); +let poolPtr = rnds8Pool.length; +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + (0, crypto_1.randomFillSync)(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); +} +exports.default = rng; diff --git a/node_modules/uuid/dist/cjs/sha1.d.ts b/node_modules/uuid/dist/cjs/sha1.d.ts new file mode 100644 index 00000000..dfdc2ea0 --- /dev/null +++ b/node_modules/uuid/dist/cjs/sha1.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function sha1(bytes: Uint8Array): Buffer; +export default sha1; diff --git a/node_modules/uuid/dist/cjs/sha1.js b/node_modules/uuid/dist/cjs/sha1.js new file mode 100644 index 00000000..dccedf58 --- /dev/null +++ b/node_modules/uuid/dist/cjs/sha1.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return (0, crypto_1.createHash)('sha1').update(bytes).digest(); +} +exports.default = sha1; diff --git a/node_modules/uuid/dist/cjs/stringify.d.ts b/node_modules/uuid/dist/cjs/stringify.d.ts new file mode 100644 index 00000000..16cb0088 --- /dev/null +++ b/node_modules/uuid/dist/cjs/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/node_modules/uuid/dist/cjs/stringify.js b/node_modules/uuid/dist/cjs/stringify.js new file mode 100644 index 00000000..2ba27bbd --- /dev/null +++ b/node_modules/uuid/dist/cjs/stringify.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unsafeStringify = void 0; +const validate_js_1 = require("./validate.js"); +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +exports.unsafeStringify = unsafeStringify; +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +exports.default = stringify; diff --git a/node_modules/uuid/dist/cjs/types.d.ts b/node_modules/uuid/dist/cjs/types.d.ts new file mode 100644 index 00000000..ecaed97c --- /dev/null +++ b/node_modules/uuid/dist/cjs/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/node_modules/uuid/dist/cjs/types.js b/node_modules/uuid/dist/cjs/types.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/node_modules/uuid/dist/cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/uuid/dist/cjs/uuid-bin.d.ts b/node_modules/uuid/dist/cjs/uuid-bin.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/uuid/dist/cjs/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/uuid/dist/cjs/uuid-bin.js b/node_modules/uuid/dist/cjs/uuid-bin.js new file mode 100644 index 00000000..d613137a --- /dev/null +++ b/node_modules/uuid/dist/cjs/uuid-bin.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = require("assert"); +const v1_js_1 = require("./v1.js"); +const v3_js_1 = require("./v3.js"); +const v4_js_1 = require("./v4.js"); +const v5_js_1 = require("./v5.js"); +const v6_js_1 = require("./v6.js"); +const v7_js_1 = require("./v7.js"); +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log((0, v1_js_1.default)()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v3_js_1.default.DNS; + } + console.log((0, v3_js_1.default)(name, namespace)); + break; + } + case 'v4': + console.log((0, v4_js_1.default)()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v5_js_1.default.DNS; + } + console.log((0, v5_js_1.default)(name, namespace)); + break; + } + case 'v6': + console.log((0, v6_js_1.default)()); + break; + case 'v7': + console.log((0, v7_js_1.default)()); + break; + default: + usage(); + process.exit(1); +} diff --git a/node_modules/uuid/dist/cjs/v1.d.ts b/node_modules/uuid/dist/cjs/v1.d.ts new file mode 100644 index 00000000..d8ecee0c --- /dev/null +++ b/node_modules/uuid/dist/cjs/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/node_modules/uuid/dist/cjs/v1.js b/node_modules/uuid/dist/cjs/v1.js new file mode 100644 index 00000000..155b80d0 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v1.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV1State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +exports.updateV1State = updateV1State; +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +exports.default = v1; diff --git a/node_modules/uuid/dist/cjs/v1ToV6.d.ts b/node_modules/uuid/dist/cjs/v1ToV6.d.ts new file mode 100644 index 00000000..38eaaf0c --- /dev/null +++ b/node_modules/uuid/dist/cjs/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/cjs/v1ToV6.js b/node_modules/uuid/dist/cjs/v1ToV6.js new file mode 100644 index 00000000..daba2c32 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v1ToV6.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v6Bytes) : v6Bytes; +} +exports.default = v1ToV6; +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/node_modules/uuid/dist/cjs/v3.d.ts b/node_modules/uuid/dist/cjs/v3.d.ts new file mode 100644 index 00000000..5d1c434d --- /dev/null +++ b/node_modules/uuid/dist/cjs/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/node_modules/uuid/dist/cjs/v3.js b/node_modules/uuid/dist/cjs/v3.js new file mode 100644 index 00000000..d318d2ab --- /dev/null +++ b/node_modules/uuid/dist/cjs/v3.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const md5_js_1 = require("./md5.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v3(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x30, md5_js_1.default, value, namespace, buf, offset); +} +v3.DNS = v35_js_1.DNS; +v3.URL = v35_js_1.URL; +exports.default = v3; diff --git a/node_modules/uuid/dist/cjs/v35.d.ts b/node_modules/uuid/dist/cjs/v35.d.ts new file mode 100644 index 00000000..4e6e9d59 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/node_modules/uuid/dist/cjs/v35.js b/node_modules/uuid/dist/cjs/v35.js new file mode 100644 index 00000000..a3712f2a --- /dev/null +++ b/node_modules/uuid/dist/cjs/v35.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = exports.stringToBytes = void 0; +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +exports.stringToBytes = stringToBytes; +exports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? (0, parse_js_1.default)(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = (0, parse_js_1.default)(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v35; diff --git a/node_modules/uuid/dist/cjs/v4.d.ts b/node_modules/uuid/dist/cjs/v4.d.ts new file mode 100644 index 00000000..8205333f --- /dev/null +++ b/node_modules/uuid/dist/cjs/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/node_modules/uuid/dist/cjs/v4.js b/node_modules/uuid/dist/cjs/v4.js new file mode 100644 index 00000000..69c975e4 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v4.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const native_js_1 = require("./native.js"); +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +function v4(options, buf, offset) { + if (native_js_1.default.randomUUID && !buf && !options) { + return native_js_1.default.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? (0, rng_js_1.default)(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(rnds); +} +exports.default = v4; diff --git a/node_modules/uuid/dist/cjs/v5.d.ts b/node_modules/uuid/dist/cjs/v5.d.ts new file mode 100644 index 00000000..0e2ff2f3 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/node_modules/uuid/dist/cjs/v5.js b/node_modules/uuid/dist/cjs/v5.js new file mode 100644 index 00000000..c4239c2f --- /dev/null +++ b/node_modules/uuid/dist/cjs/v5.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const sha1_js_1 = require("./sha1.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v5(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x50, sha1_js_1.default, value, namespace, buf, offset); +} +v5.DNS = v35_js_1.DNS; +v5.URL = v35_js_1.URL; +exports.default = v5; diff --git a/node_modules/uuid/dist/cjs/v6.d.ts b/node_modules/uuid/dist/cjs/v6.d.ts new file mode 100644 index 00000000..cabf4a0d --- /dev/null +++ b/node_modules/uuid/dist/cjs/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/node_modules/uuid/dist/cjs/v6.js b/node_modules/uuid/dist/cjs/v6.js new file mode 100644 index 00000000..b02748db --- /dev/null +++ b/node_modules/uuid/dist/cjs/v6.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stringify_js_1 = require("./stringify.js"); +const v1_js_1 = require("./v1.js"); +const v1ToV6_js_1 = require("./v1ToV6.js"); +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = (0, v1_js_1.default)({ ...options, _v6: true }, new Uint8Array(16)); + bytes = (0, v1ToV6_js_1.default)(bytes); + if (buf) { + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v6; diff --git a/node_modules/uuid/dist/cjs/v6ToV1.d.ts b/node_modules/uuid/dist/cjs/v6ToV1.d.ts new file mode 100644 index 00000000..3b3ffc21 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/cjs/v6ToV1.js b/node_modules/uuid/dist/cjs/v6ToV1.js new file mode 100644 index 00000000..9dcb6615 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v6ToV1.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes; +} +exports.default = v6ToV1; +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/node_modules/uuid/dist/cjs/v7.d.ts b/node_modules/uuid/dist/cjs/v7.d.ts new file mode 100644 index 00000000..f49b03d5 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/node_modules/uuid/dist/cjs/v7.js b/node_modules/uuid/dist/cjs/v7.js new file mode 100644 index 00000000..697fe342 --- /dev/null +++ b/node_modules/uuid/dist/cjs/v7.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV7State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +exports.updateV7State = updateV7State; +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +exports.default = v7; diff --git a/node_modules/uuid/dist/cjs/validate.d.ts b/node_modules/uuid/dist/cjs/validate.d.ts new file mode 100644 index 00000000..57da03d7 --- /dev/null +++ b/node_modules/uuid/dist/cjs/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/node_modules/uuid/dist/cjs/validate.js b/node_modules/uuid/dist/cjs/validate.js new file mode 100644 index 00000000..89733b06 --- /dev/null +++ b/node_modules/uuid/dist/cjs/validate.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const regex_js_1 = require("./regex.js"); +function validate(uuid) { + return typeof uuid === 'string' && regex_js_1.default.test(uuid); +} +exports.default = validate; diff --git a/node_modules/uuid/dist/cjs/version.d.ts b/node_modules/uuid/dist/cjs/version.d.ts new file mode 100644 index 00000000..f1948dc8 --- /dev/null +++ b/node_modules/uuid/dist/cjs/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/node_modules/uuid/dist/cjs/version.js b/node_modules/uuid/dist/cjs/version.js new file mode 100644 index 00000000..05ecd00d --- /dev/null +++ b/node_modules/uuid/dist/cjs/version.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function version(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +exports.default = version; diff --git a/node_modules/uuid/dist/esm-browser/index.d.ts b/node_modules/uuid/dist/esm-browser/index.d.ts new file mode 100644 index 00000000..d7d4edc3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/node_modules/uuid/dist/esm-browser/index.js b/node_modules/uuid/dist/esm-browser/index.js new file mode 100644 index 00000000..3193e9a3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/index.js @@ -0,0 +1,14 @@ +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/node_modules/uuid/dist/esm-browser/max.d.ts b/node_modules/uuid/dist/esm-browser/max.d.ts new file mode 100644 index 00000000..7a1e972a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/node_modules/uuid/dist/esm-browser/max.js b/node_modules/uuid/dist/esm-browser/max.js new file mode 100644 index 00000000..58951f65 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/max.js @@ -0,0 +1 @@ +export default 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/node_modules/uuid/dist/esm-browser/md5.d.ts b/node_modules/uuid/dist/esm-browser/md5.d.ts new file mode 100644 index 00000000..5a55f51e --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/md5.d.ts @@ -0,0 +1,2 @@ +declare function md5(bytes: Uint8Array): Uint8Array; +export default md5; diff --git a/node_modules/uuid/dist/esm-browser/md5.js b/node_modules/uuid/dist/esm-browser/md5.js new file mode 100644 index 00000000..918be8c9 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/md5.js @@ -0,0 +1,135 @@ +function md5(bytes) { + const words = uint8ToUint32(bytes); + const md5Bytes = wordsToMd5(words, bytes.length * 8); + return uint32ToUint8(md5Bytes); +} +function uint32ToUint8(input) { + const bytes = new Uint8Array(input.length * 4); + for (let i = 0; i < input.length * 4; i++) { + bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff; + } + return bytes; +} +function getOutputLength(inputLength8) { + return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1; +} +function wordsToMd5(x, len) { + const xpad = new Uint32Array(getOutputLength(len)).fill(0); + xpad.set(x); + xpad[len >> 5] |= 0x80 << len % 32; + xpad[xpad.length - 1] = len; + x = xpad; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + return Uint32Array.of(a, b, c, d); +} +function uint8ToUint32(input) { + if (input.length === 0) { + return new Uint32Array(); + } + const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0); + for (let i = 0; i < input.length; i++) { + output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8); + } + return output; +} +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); +} +function bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} +function md5ff(a, b, c, d, x, s, t) { + return md5cmn((b & c) | (~b & d), a, b, x, s, t); +} +function md5gg(a, b, c, d, x, s, t) { + return md5cmn((b & d) | (c & ~d), a, b, x, s, t); +} +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} +export default md5; diff --git a/node_modules/uuid/dist/esm-browser/native.d.ts b/node_modules/uuid/dist/esm-browser/native.d.ts new file mode 100644 index 00000000..9418fd3a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/native.d.ts @@ -0,0 +1,4 @@ +declare const _default: { + randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`); +}; +export default _default; diff --git a/node_modules/uuid/dist/esm-browser/native.js b/node_modules/uuid/dist/esm-browser/native.js new file mode 100644 index 00000000..76f44f91 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/native.js @@ -0,0 +1,2 @@ +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +export default { randomUUID }; diff --git a/node_modules/uuid/dist/esm-browser/nil.d.ts b/node_modules/uuid/dist/esm-browser/nil.d.ts new file mode 100644 index 00000000..b03bb98e --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/node_modules/uuid/dist/esm-browser/nil.js b/node_modules/uuid/dist/esm-browser/nil.js new file mode 100644 index 00000000..de6f830e --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; diff --git a/node_modules/uuid/dist/esm-browser/parse.d.ts b/node_modules/uuid/dist/esm-browser/parse.d.ts new file mode 100644 index 00000000..a316fb11 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/node_modules/uuid/dist/esm-browser/parse.js b/node_modules/uuid/dist/esm-browser/parse.js new file mode 100644 index 00000000..64ac401a --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/parse.js @@ -0,0 +1,9 @@ +import validate from './validate.js'; +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +export default parse; diff --git a/node_modules/uuid/dist/esm-browser/regex.d.ts b/node_modules/uuid/dist/esm-browser/regex.d.ts new file mode 100644 index 00000000..d39fa3f6 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/node_modules/uuid/dist/esm-browser/regex.js b/node_modules/uuid/dist/esm-browser/regex.js new file mode 100644 index 00000000..3e385919 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/node_modules/uuid/dist/esm-browser/rng.d.ts b/node_modules/uuid/dist/esm-browser/rng.d.ts new file mode 100644 index 00000000..73e60cf3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/node_modules/uuid/dist/esm-browser/rng.js b/node_modules/uuid/dist/esm-browser/rng.js new file mode 100644 index 00000000..770f2e27 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/rng.js @@ -0,0 +1,11 @@ +let getRandomValues; +const rnds8 = new Uint8Array(16); +export default function rng() { + if (!getRandomValues) { + if (typeof crypto === 'undefined' || !crypto.getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + getRandomValues = crypto.getRandomValues.bind(crypto); + } + return getRandomValues(rnds8); +} diff --git a/node_modules/uuid/dist/esm-browser/sha1.d.ts b/node_modules/uuid/dist/esm-browser/sha1.d.ts new file mode 100644 index 00000000..a6552e5d --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/sha1.d.ts @@ -0,0 +1,2 @@ +declare function sha1(bytes: Uint8Array): Uint8Array; +export default sha1; diff --git a/node_modules/uuid/dist/esm-browser/sha1.js b/node_modules/uuid/dist/esm-browser/sha1.js new file mode 100644 index 00000000..dbb78aea --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/sha1.js @@ -0,0 +1,70 @@ +function f(s, x, y, z) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + } +} +function ROTL(x, n) { + return (x << n) | (x >>> (32 - n)); +} +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + const newBytes = new Uint8Array(bytes.length + 1); + newBytes.set(bytes); + newBytes[bytes.length] = 0x80; + bytes = newBytes; + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + for (let j = 0; j < 16; ++j) { + arr[j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + M[i] = arr; + } + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]); +} +export default sha1; diff --git a/node_modules/uuid/dist/esm-browser/stringify.d.ts b/node_modules/uuid/dist/esm-browser/stringify.d.ts new file mode 100644 index 00000000..16cb0088 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/node_modules/uuid/dist/esm-browser/stringify.js b/node_modules/uuid/dist/esm-browser/stringify.js new file mode 100644 index 00000000..962738cb --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/stringify.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +export function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +export default stringify; diff --git a/node_modules/uuid/dist/esm-browser/types.d.ts b/node_modules/uuid/dist/esm-browser/types.d.ts new file mode 100644 index 00000000..ecaed97c --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/node_modules/uuid/dist/esm-browser/types.js b/node_modules/uuid/dist/esm-browser/types.js new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts b/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/uuid/dist/esm-browser/uuid-bin.js b/node_modules/uuid/dist/esm-browser/uuid-bin.js new file mode 100644 index 00000000..30766fe1 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/uuid-bin.js @@ -0,0 +1,70 @@ +import * as assert from 'assert'; +import v1 from './v1.js'; +import v3 from './v3.js'; +import v4 from './v4.js'; +import v5 from './v5.js'; +import v6 from './v6.js'; +import v7 from './v7.js'; +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log(v1()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3.URL; + } + if (namespace === 'DNS') { + namespace = v3.DNS; + } + console.log(v3(name, namespace)); + break; + } + case 'v4': + console.log(v4()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5.URL; + } + if (namespace === 'DNS') { + namespace = v5.DNS; + } + console.log(v5(name, namespace)); + break; + } + case 'v6': + console.log(v6()); + break; + case 'v7': + console.log(v7()); + break; + default: + usage(); + process.exit(1); +} diff --git a/node_modules/uuid/dist/esm-browser/v1.d.ts b/node_modules/uuid/dist/esm-browser/v1.d.ts new file mode 100644 index 00000000..d8ecee0c --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/node_modules/uuid/dist/esm-browser/v1.js b/node_modules/uuid/dist/esm-browser/v1.js new file mode 100644 index 00000000..65e3f68f --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v1.js @@ -0,0 +1,83 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +export default v1; diff --git a/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts b/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts new file mode 100644 index 00000000..38eaaf0c --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/esm-browser/v1ToV6.js b/node_modules/uuid/dist/esm-browser/v1ToV6.js new file mode 100644 index 00000000..da0f7634 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v1ToV6.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes; +} +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/node_modules/uuid/dist/esm-browser/v3.d.ts b/node_modules/uuid/dist/esm-browser/v3.d.ts new file mode 100644 index 00000000..5d1c434d --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/node_modules/uuid/dist/esm-browser/v3.js b/node_modules/uuid/dist/esm-browser/v3.js new file mode 100644 index 00000000..b5c3781d --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v3.js @@ -0,0 +1,9 @@ +import md5 from './md5.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v3(value, namespace, buf, offset) { + return v35(0x30, md5, value, namespace, buf, offset); +} +v3.DNS = DNS; +v3.URL = URL; +export default v3; diff --git a/node_modules/uuid/dist/esm-browser/v35.d.ts b/node_modules/uuid/dist/esm-browser/v35.d.ts new file mode 100644 index 00000000..4e6e9d59 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/node_modules/uuid/dist/esm-browser/v35.js b/node_modules/uuid/dist/esm-browser/v35.js new file mode 100644 index 00000000..3fe6573c --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v35.js @@ -0,0 +1,36 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} diff --git a/node_modules/uuid/dist/esm-browser/v4.d.ts b/node_modules/uuid/dist/esm-browser/v4.d.ts new file mode 100644 index 00000000..8205333f --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/node_modules/uuid/dist/esm-browser/v4.js b/node_modules/uuid/dist/esm-browser/v4.js new file mode 100644 index 00000000..dd9067a6 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v4.js @@ -0,0 +1,27 @@ +import native from './native.js'; +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +function v4(options, buf, offset) { + if (native.randomUUID && !buf && !options) { + return native.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +export default v4; diff --git a/node_modules/uuid/dist/esm-browser/v5.d.ts b/node_modules/uuid/dist/esm-browser/v5.d.ts new file mode 100644 index 00000000..0e2ff2f3 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/node_modules/uuid/dist/esm-browser/v5.js b/node_modules/uuid/dist/esm-browser/v5.js new file mode 100644 index 00000000..bd470a45 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v5.js @@ -0,0 +1,9 @@ +import sha1 from './sha1.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v5(value, namespace, buf, offset) { + return v35(0x50, sha1, value, namespace, buf, offset); +} +v5.DNS = DNS; +v5.URL = URL; +export default v5; diff --git a/node_modules/uuid/dist/esm-browser/v6.d.ts b/node_modules/uuid/dist/esm-browser/v6.d.ts new file mode 100644 index 00000000..cabf4a0d --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/node_modules/uuid/dist/esm-browser/v6.js b/node_modules/uuid/dist/esm-browser/v6.js new file mode 100644 index 00000000..278a3398 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v6.js @@ -0,0 +1,17 @@ +import { unsafeStringify } from './stringify.js'; +import v1 from './v1.js'; +import v1ToV6 from './v1ToV6.js'; +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = v1({ ...options, _v6: true }, new Uint8Array(16)); + bytes = v1ToV6(bytes); + if (buf) { + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} +export default v6; diff --git a/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts b/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts new file mode 100644 index 00000000..3b3ffc21 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/esm-browser/v6ToV1.js b/node_modules/uuid/dist/esm-browser/v6ToV1.js new file mode 100644 index 00000000..bfd942fd --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v6ToV1.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes; +} +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/node_modules/uuid/dist/esm-browser/v7.d.ts b/node_modules/uuid/dist/esm-browser/v7.d.ts new file mode 100644 index 00000000..f49b03d5 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/node_modules/uuid/dist/esm-browser/v7.js b/node_modules/uuid/dist/esm-browser/v7.js new file mode 100644 index 00000000..276c9bf6 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/v7.js @@ -0,0 +1,65 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +export default v7; diff --git a/node_modules/uuid/dist/esm-browser/validate.d.ts b/node_modules/uuid/dist/esm-browser/validate.d.ts new file mode 100644 index 00000000..57da03d7 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/node_modules/uuid/dist/esm-browser/validate.js b/node_modules/uuid/dist/esm-browser/validate.js new file mode 100644 index 00000000..444a1a2f --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/validate.js @@ -0,0 +1,5 @@ +import REGEX from './regex.js'; +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} +export default validate; diff --git a/node_modules/uuid/dist/esm-browser/version.d.ts b/node_modules/uuid/dist/esm-browser/version.d.ts new file mode 100644 index 00000000..f1948dc8 --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/node_modules/uuid/dist/esm-browser/version.js b/node_modules/uuid/dist/esm-browser/version.js new file mode 100644 index 00000000..bae91d3f --- /dev/null +++ b/node_modules/uuid/dist/esm-browser/version.js @@ -0,0 +1,8 @@ +import validate from './validate.js'; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +export default version; diff --git a/node_modules/uuid/dist/esm/bin/uuid b/node_modules/uuid/dist/esm/bin/uuid new file mode 100644 index 00000000..b4f612d4 --- /dev/null +++ b/node_modules/uuid/dist/esm/bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +import '../uuid-bin.js'; diff --git a/node_modules/uuid/dist/esm/index.d.ts b/node_modules/uuid/dist/esm/index.d.ts new file mode 100644 index 00000000..d7d4edc3 --- /dev/null +++ b/node_modules/uuid/dist/esm/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/node_modules/uuid/dist/esm/index.js b/node_modules/uuid/dist/esm/index.js new file mode 100644 index 00000000..3193e9a3 --- /dev/null +++ b/node_modules/uuid/dist/esm/index.js @@ -0,0 +1,14 @@ +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/node_modules/uuid/dist/esm/max.d.ts b/node_modules/uuid/dist/esm/max.d.ts new file mode 100644 index 00000000..7a1e972a --- /dev/null +++ b/node_modules/uuid/dist/esm/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/node_modules/uuid/dist/esm/max.js b/node_modules/uuid/dist/esm/max.js new file mode 100644 index 00000000..58951f65 --- /dev/null +++ b/node_modules/uuid/dist/esm/max.js @@ -0,0 +1 @@ +export default 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/node_modules/uuid/dist/esm/md5.d.ts b/node_modules/uuid/dist/esm/md5.d.ts new file mode 100644 index 00000000..7d60244b --- /dev/null +++ b/node_modules/uuid/dist/esm/md5.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function md5(bytes: Uint8Array): Buffer; +export default md5; diff --git a/node_modules/uuid/dist/esm/md5.js b/node_modules/uuid/dist/esm/md5.js new file mode 100644 index 00000000..b922d98d --- /dev/null +++ b/node_modules/uuid/dist/esm/md5.js @@ -0,0 +1,11 @@ +import { createHash } from 'crypto'; +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return createHash('md5').update(bytes).digest(); +} +export default md5; diff --git a/node_modules/uuid/dist/esm/native.d.ts b/node_modules/uuid/dist/esm/native.d.ts new file mode 100644 index 00000000..9e0d2ac5 --- /dev/null +++ b/node_modules/uuid/dist/esm/native.d.ts @@ -0,0 +1,6 @@ +/// +import { randomUUID } from 'crypto'; +declare const _default: { + randomUUID: typeof randomUUID; +}; +export default _default; diff --git a/node_modules/uuid/dist/esm/native.js b/node_modules/uuid/dist/esm/native.js new file mode 100644 index 00000000..ba74bcac --- /dev/null +++ b/node_modules/uuid/dist/esm/native.js @@ -0,0 +1,2 @@ +import { randomUUID } from 'crypto'; +export default { randomUUID }; diff --git a/node_modules/uuid/dist/esm/nil.d.ts b/node_modules/uuid/dist/esm/nil.d.ts new file mode 100644 index 00000000..b03bb98e --- /dev/null +++ b/node_modules/uuid/dist/esm/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/node_modules/uuid/dist/esm/nil.js b/node_modules/uuid/dist/esm/nil.js new file mode 100644 index 00000000..de6f830e --- /dev/null +++ b/node_modules/uuid/dist/esm/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; diff --git a/node_modules/uuid/dist/esm/parse.d.ts b/node_modules/uuid/dist/esm/parse.d.ts new file mode 100644 index 00000000..a316fb11 --- /dev/null +++ b/node_modules/uuid/dist/esm/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/node_modules/uuid/dist/esm/parse.js b/node_modules/uuid/dist/esm/parse.js new file mode 100644 index 00000000..64ac401a --- /dev/null +++ b/node_modules/uuid/dist/esm/parse.js @@ -0,0 +1,9 @@ +import validate from './validate.js'; +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +export default parse; diff --git a/node_modules/uuid/dist/esm/regex.d.ts b/node_modules/uuid/dist/esm/regex.d.ts new file mode 100644 index 00000000..d39fa3f6 --- /dev/null +++ b/node_modules/uuid/dist/esm/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/node_modules/uuid/dist/esm/regex.js b/node_modules/uuid/dist/esm/regex.js new file mode 100644 index 00000000..3e385919 --- /dev/null +++ b/node_modules/uuid/dist/esm/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/node_modules/uuid/dist/esm/rng.d.ts b/node_modules/uuid/dist/esm/rng.d.ts new file mode 100644 index 00000000..73e60cf3 --- /dev/null +++ b/node_modules/uuid/dist/esm/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/node_modules/uuid/dist/esm/rng.js b/node_modules/uuid/dist/esm/rng.js new file mode 100644 index 00000000..54c1cfe9 --- /dev/null +++ b/node_modules/uuid/dist/esm/rng.js @@ -0,0 +1,10 @@ +import { randomFillSync } from 'crypto'; +const rnds8Pool = new Uint8Array(256); +let poolPtr = rnds8Pool.length; +export default function rng() { + if (poolPtr > rnds8Pool.length - 16) { + randomFillSync(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); +} diff --git a/node_modules/uuid/dist/esm/sha1.d.ts b/node_modules/uuid/dist/esm/sha1.d.ts new file mode 100644 index 00000000..ebb14045 --- /dev/null +++ b/node_modules/uuid/dist/esm/sha1.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function sha1(bytes: Uint8Array): Buffer; +export default sha1; diff --git a/node_modules/uuid/dist/esm/sha1.js b/node_modules/uuid/dist/esm/sha1.js new file mode 100644 index 00000000..fda4aa35 --- /dev/null +++ b/node_modules/uuid/dist/esm/sha1.js @@ -0,0 +1,11 @@ +import { createHash } from 'crypto'; +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return createHash('sha1').update(bytes).digest(); +} +export default sha1; diff --git a/node_modules/uuid/dist/esm/stringify.d.ts b/node_modules/uuid/dist/esm/stringify.d.ts new file mode 100644 index 00000000..16cb0088 --- /dev/null +++ b/node_modules/uuid/dist/esm/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/node_modules/uuid/dist/esm/stringify.js b/node_modules/uuid/dist/esm/stringify.js new file mode 100644 index 00000000..962738cb --- /dev/null +++ b/node_modules/uuid/dist/esm/stringify.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +export function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +export default stringify; diff --git a/node_modules/uuid/dist/esm/types.d.ts b/node_modules/uuid/dist/esm/types.d.ts new file mode 100644 index 00000000..ecaed97c --- /dev/null +++ b/node_modules/uuid/dist/esm/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/node_modules/uuid/dist/esm/types.js b/node_modules/uuid/dist/esm/types.js new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/uuid/dist/esm/types.js @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/uuid/dist/esm/uuid-bin.d.ts b/node_modules/uuid/dist/esm/uuid-bin.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/node_modules/uuid/dist/esm/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/node_modules/uuid/dist/esm/uuid-bin.js b/node_modules/uuid/dist/esm/uuid-bin.js new file mode 100644 index 00000000..30766fe1 --- /dev/null +++ b/node_modules/uuid/dist/esm/uuid-bin.js @@ -0,0 +1,70 @@ +import * as assert from 'assert'; +import v1 from './v1.js'; +import v3 from './v3.js'; +import v4 from './v4.js'; +import v5 from './v5.js'; +import v6 from './v6.js'; +import v7 from './v7.js'; +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log(v1()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3.URL; + } + if (namespace === 'DNS') { + namespace = v3.DNS; + } + console.log(v3(name, namespace)); + break; + } + case 'v4': + console.log(v4()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5.URL; + } + if (namespace === 'DNS') { + namespace = v5.DNS; + } + console.log(v5(name, namespace)); + break; + } + case 'v6': + console.log(v6()); + break; + case 'v7': + console.log(v7()); + break; + default: + usage(); + process.exit(1); +} diff --git a/node_modules/uuid/dist/esm/v1.d.ts b/node_modules/uuid/dist/esm/v1.d.ts new file mode 100644 index 00000000..d8ecee0c --- /dev/null +++ b/node_modules/uuid/dist/esm/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/node_modules/uuid/dist/esm/v1.js b/node_modules/uuid/dist/esm/v1.js new file mode 100644 index 00000000..65e3f68f --- /dev/null +++ b/node_modules/uuid/dist/esm/v1.js @@ -0,0 +1,83 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +export default v1; diff --git a/node_modules/uuid/dist/esm/v1ToV6.d.ts b/node_modules/uuid/dist/esm/v1ToV6.d.ts new file mode 100644 index 00000000..38eaaf0c --- /dev/null +++ b/node_modules/uuid/dist/esm/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/esm/v1ToV6.js b/node_modules/uuid/dist/esm/v1ToV6.js new file mode 100644 index 00000000..da0f7634 --- /dev/null +++ b/node_modules/uuid/dist/esm/v1ToV6.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes; +} +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/node_modules/uuid/dist/esm/v3.d.ts b/node_modules/uuid/dist/esm/v3.d.ts new file mode 100644 index 00000000..5d1c434d --- /dev/null +++ b/node_modules/uuid/dist/esm/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/node_modules/uuid/dist/esm/v3.js b/node_modules/uuid/dist/esm/v3.js new file mode 100644 index 00000000..b5c3781d --- /dev/null +++ b/node_modules/uuid/dist/esm/v3.js @@ -0,0 +1,9 @@ +import md5 from './md5.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v3(value, namespace, buf, offset) { + return v35(0x30, md5, value, namespace, buf, offset); +} +v3.DNS = DNS; +v3.URL = URL; +export default v3; diff --git a/node_modules/uuid/dist/esm/v35.d.ts b/node_modules/uuid/dist/esm/v35.d.ts new file mode 100644 index 00000000..4e6e9d59 --- /dev/null +++ b/node_modules/uuid/dist/esm/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/node_modules/uuid/dist/esm/v35.js b/node_modules/uuid/dist/esm/v35.js new file mode 100644 index 00000000..3fe6573c --- /dev/null +++ b/node_modules/uuid/dist/esm/v35.js @@ -0,0 +1,36 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} diff --git a/node_modules/uuid/dist/esm/v4.d.ts b/node_modules/uuid/dist/esm/v4.d.ts new file mode 100644 index 00000000..8205333f --- /dev/null +++ b/node_modules/uuid/dist/esm/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/node_modules/uuid/dist/esm/v4.js b/node_modules/uuid/dist/esm/v4.js new file mode 100644 index 00000000..dd9067a6 --- /dev/null +++ b/node_modules/uuid/dist/esm/v4.js @@ -0,0 +1,27 @@ +import native from './native.js'; +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +function v4(options, buf, offset) { + if (native.randomUUID && !buf && !options) { + return native.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +export default v4; diff --git a/node_modules/uuid/dist/esm/v5.d.ts b/node_modules/uuid/dist/esm/v5.d.ts new file mode 100644 index 00000000..0e2ff2f3 --- /dev/null +++ b/node_modules/uuid/dist/esm/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/node_modules/uuid/dist/esm/v5.js b/node_modules/uuid/dist/esm/v5.js new file mode 100644 index 00000000..bd470a45 --- /dev/null +++ b/node_modules/uuid/dist/esm/v5.js @@ -0,0 +1,9 @@ +import sha1 from './sha1.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v5(value, namespace, buf, offset) { + return v35(0x50, sha1, value, namespace, buf, offset); +} +v5.DNS = DNS; +v5.URL = URL; +export default v5; diff --git a/node_modules/uuid/dist/esm/v6.d.ts b/node_modules/uuid/dist/esm/v6.d.ts new file mode 100644 index 00000000..cabf4a0d --- /dev/null +++ b/node_modules/uuid/dist/esm/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/node_modules/uuid/dist/esm/v6.js b/node_modules/uuid/dist/esm/v6.js new file mode 100644 index 00000000..278a3398 --- /dev/null +++ b/node_modules/uuid/dist/esm/v6.js @@ -0,0 +1,17 @@ +import { unsafeStringify } from './stringify.js'; +import v1 from './v1.js'; +import v1ToV6 from './v1ToV6.js'; +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = v1({ ...options, _v6: true }, new Uint8Array(16)); + bytes = v1ToV6(bytes); + if (buf) { + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} +export default v6; diff --git a/node_modules/uuid/dist/esm/v6ToV1.d.ts b/node_modules/uuid/dist/esm/v6ToV1.d.ts new file mode 100644 index 00000000..3b3ffc21 --- /dev/null +++ b/node_modules/uuid/dist/esm/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/node_modules/uuid/dist/esm/v6ToV1.js b/node_modules/uuid/dist/esm/v6ToV1.js new file mode 100644 index 00000000..bfd942fd --- /dev/null +++ b/node_modules/uuid/dist/esm/v6ToV1.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes; +} +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/node_modules/uuid/dist/esm/v7.d.ts b/node_modules/uuid/dist/esm/v7.d.ts new file mode 100644 index 00000000..f49b03d5 --- /dev/null +++ b/node_modules/uuid/dist/esm/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/node_modules/uuid/dist/esm/v7.js b/node_modules/uuid/dist/esm/v7.js new file mode 100644 index 00000000..276c9bf6 --- /dev/null +++ b/node_modules/uuid/dist/esm/v7.js @@ -0,0 +1,65 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +export default v7; diff --git a/node_modules/uuid/dist/esm/validate.d.ts b/node_modules/uuid/dist/esm/validate.d.ts new file mode 100644 index 00000000..57da03d7 --- /dev/null +++ b/node_modules/uuid/dist/esm/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/node_modules/uuid/dist/esm/validate.js b/node_modules/uuid/dist/esm/validate.js new file mode 100644 index 00000000..444a1a2f --- /dev/null +++ b/node_modules/uuid/dist/esm/validate.js @@ -0,0 +1,5 @@ +import REGEX from './regex.js'; +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} +export default validate; diff --git a/node_modules/uuid/dist/esm/version.d.ts b/node_modules/uuid/dist/esm/version.d.ts new file mode 100644 index 00000000..f1948dc8 --- /dev/null +++ b/node_modules/uuid/dist/esm/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/node_modules/uuid/dist/esm/version.js b/node_modules/uuid/dist/esm/version.js new file mode 100644 index 00000000..bae91d3f --- /dev/null +++ b/node_modules/uuid/dist/esm/version.js @@ -0,0 +1,8 @@ +import validate from './validate.js'; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +export default version; diff --git a/node_modules/uuid/package.json b/node_modules/uuid/package.json new file mode 100644 index 00000000..527c7a75 --- /dev/null +++ b/node_modules/uuid/package.json @@ -0,0 +1,162 @@ +{ + "_from": "uuid", + "_id": "uuid@11.1.0", + "_inBundle": false, + "_integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "_location": "/uuid", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "uuid", + "name": "uuid", + "escapedName": "uuid", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "http://25.12.10.69:8081/repository/aliyun-npm/uuid/-/uuid-11.1.0.tgz", + "_shasum": "9549028be1753bb934fc96e2bca09bb4105ae912", + "_spec": "uuid", + "_where": "E:\\jlyh\\tra-app", + "bin": { + "uuid": "dist/esm/bin/uuid" + }, + "browser": { + "./dist/esm/index.js": "./dist/esm-browser/index.js", + "./dist/cjs/index.js": "./dist/cjs-browser/index.js" + }, + "bugs": { + "url": "https://github.com/uuidjs/uuid/issues" + }, + "bundleDependencies": false, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "deprecated": false, + "description": "RFC9562 UUIDs", + "devDependencies": { + "@babel/eslint-parser": "7.25.9", + "@commitlint/cli": "19.6.1", + "@commitlint/config-conventional": "19.6.0", + "@eslint/js": "9.17.0", + "@types/eslint__js": "8.42.3", + "bundlewatch": "0.4.0", + "commander": "12.1.0", + "eslint": "9.17.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "globals": "15.14.0", + "husky": "9.1.7", + "jest": "29.7.0", + "lint-staged": "15.2.11", + "neostandard": "0.12.0", + "npm-run-all": "4.1.5", + "prettier": "3.4.2", + "release-please": "16.15.0", + "runmd": "1.4.1", + "standard-version": "9.5.0", + "typescript": "5.0.4", + "typescript-eslint": "8.18.2" + }, + "exports": { + ".": { + "node": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + }, + "browser": { + "import": "./dist/esm-browser/index.js", + "require": "./dist/cjs-browser/index.js" + }, + "default": "./dist/esm-browser/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist", + "!dist/**/test" + ], + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "homepage": "https://github.com/uuidjs/uuid#readme", + "keywords": [ + "uuid", + "guid", + "rfc4122", + "rfc9562" + ], + "license": "MIT", + "lint-staged": { + "*": [ + "prettier --no-error-on-unmatched-pattern --write" + ], + "*.{js,jsx}": [ + "eslint --no-error-on-unmatched-pattern --fix" + ] + }, + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "name": "uuid", + "optionalDevDependencies": { + "@wdio/browserstack-service": "9.2.1", + "@wdio/cli": "9.2.1", + "@wdio/jasmine-framework": "9.2.1", + "@wdio/local-runner": "9.2.1", + "@wdio/spec-reporter": "9.1.3", + "@wdio/static-server-service": "9.1.3" + }, + "packageManager": "npm@11.0.0", + "repository": { + "type": "git", + "url": "git+https://github.com/uuidjs/uuid.git" + }, + "scripts": { + "build": "./scripts/build.sh", + "build:watch": "tsc --watch -p tsconfig.esm.json", + "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", + "docs": "npm run build && npx runmd --output=README.md README_js.md", + "docs:diff": "npm run docs && git diff --quiet README.md", + "eslint:check": "eslint src/ test/ examples/ *.[jt]s", + "eslint:fix": "eslint --fix src/ test/ examples/ *.[jt]s", + "examples:browser:rollup:build": "cd examples/browser-rollup && npm run build", + "examples:browser:webpack:build": "cd examples/browser-webpack && npm run build", + "examples:node:commonjs:test": "cd examples/node-commonjs && npm test", + "examples:node:esmodules:test": "cd examples/node-esmodules && npm test", + "examples:node:jest:test": "cd examples/node-jest && npm test", + "examples:node:typescript:test": "cd examples/typescript && npm test", + "lint": "npm run eslint:check && npm run prettier:check", + "md": "runmd --watch --output=README.md README_js.md", + "prepack": "npm run build -- --no-pack", + "prepare": "husky", + "prepublishOnly": "npm run build", + "pretest": "npm run build", + "pretest:benchmark": "npm run build", + "pretest:browser": "./scripts/iodd && npm run build && npm-run-all --parallel examples:browser:**", + "pretest:node": "npm run build", + "prettier:check": "prettier --check .", + "prettier:fix": "prettier --write .", + "release": "standard-version --no-verify", + "test": "node --test --enable-source-maps dist/esm/test/*.js", + "test:benchmark": "cd examples/benchmark && npm test", + "test:browser": "wdio run ./wdio.conf.js", + "test:node": "npm-run-all --parallel examples:node:**", + "test:watch": "node --test --enable-source-maps --watch dist/esm/test/*.js" + }, + "sideEffects": false, + "standard-version": { + "scripts": { + "postchangelog": "prettier --write CHANGELOG.md" + } + }, + "type": "module", + "version": "11.1.0" +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..d0e3f413 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "tra-app", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "uuid": { + "version": "11.1.0", + "resolved": "http://25.12.10.69:8081/repository/aliyun-npm/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..80378891 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "tra-app", + "version": "1.0.0", + "description": "", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "http://25.13.9.101:9000/K17_AITS/tra-app.git" + }, + "author": "", + "license": "ISC", + "dependencies": { + "uuid": "^11.1.0" + } +} diff --git a/pages.json b/pages.json index f9d946a6..78a0f289 100644 --- a/pages.json +++ b/pages.json @@ -1,23 +1,112 @@ { - "easycom": { - "^u-(.*)": "@/uni_modules/uview-ui/components/u-$1/u-$1.vue" - }, "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { - "navigationBarTitleText": "uni-app", + "navigationBarTitleText": "首页", "app-plus": { "titleNView": false } } - } + }, + { + "path": "pages/study/index", + "style": { + "navigationBarTitleText": "学习", + "app-plus": { + "titleNView": false + } + } + }, + { + "path": "pages/intelligent_answering/index", + "style": { + "navigationBarTitleText": "智能问答", + "app-plus": { + "titleNView": false + } + } + }, + { + "path": "pages/scene/index", + "style": { + "navigationBarTitleText": "场景", + "app-plus": { + "titleNView": false + } + } + }, + { + "path": "pages/me/index", + "style": { + "navigationBarTitleText": "我的", + "app-plus": { + "titleNView": false + } + } + }, + { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "登录", + "app-plus": { + "titleNView": false + } + } + }, + { + "path": "pages/web_view/web_view", + "style": { + "navigationBarTitleText": "", + "app-plus": { + "titleNView": false + } + } + }, + ], + "tabBar": { + "list": [{ + "text": "首页", + "pagePath": "pages/index/index" + }, + { + "text": "学习", + "pagePath": "pages/study/index" + }, + { + "text": "场景", + "pagePath": "pages/scene/index" + }, + { + "text": "我的", + "pagePath": "pages/me/index" + } + ], + "color": "#666666", + "selectedColor": "#0066FF", + "fontSize": "16px", + "borderStyle": "white", + "borderColor": "#ffffff", + "height": "70px", + "spacing": "10px", + "midButton": { + "iconPath": "/static/images/icon/fawn.png", + "width": "86px", + "height": "86px", + "iconWidth": "90px" + } + }, "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", + "navigationBarTitleText": "AI智能培训", "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" + "backgroundColor": "#F8F8F8", + "navigationStyle": "custom", + "app-plus": { + "titleView": false, + "bounce": "none" + } }, "uniIdRouter": {} -} +} \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index c476d908..709593e3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,28 +1,330 @@ - - + + \ No newline at end of file diff --git a/pages/intelligent_answering/index.vue b/pages/intelligent_answering/index.vue new file mode 100644 index 00000000..e1e92243 --- /dev/null +++ b/pages/intelligent_answering/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue new file mode 100644 index 00000000..df758a74 --- /dev/null +++ b/pages/login/login.vue @@ -0,0 +1,248 @@ + + + + + \ No newline at end of file diff --git a/pages/login/login2.vue b/pages/login/login2.vue new file mode 100644 index 00000000..03deed52 --- /dev/null +++ b/pages/login/login2.vue @@ -0,0 +1,346 @@ + + + + + + \ No newline at end of file diff --git a/pages/login/login3.vue b/pages/login/login3.vue new file mode 100644 index 00000000..38381cd7 --- /dev/null +++ b/pages/login/login3.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/pages/me/index.vue b/pages/me/index.vue new file mode 100644 index 00000000..0e364050 --- /dev/null +++ b/pages/me/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/pages/scene/index.vue b/pages/scene/index.vue new file mode 100644 index 00000000..48be4949 --- /dev/null +++ b/pages/scene/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/pages/study/index.vue b/pages/study/index.vue new file mode 100644 index 00000000..ed6664fc --- /dev/null +++ b/pages/study/index.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/pages/web_view/web_view.vue b/pages/web_view/web_view.vue new file mode 100644 index 00000000..72b057f2 --- /dev/null +++ b/pages/web_view/web_view.vue @@ -0,0 +1,77 @@ + + + + + + diff --git a/static/font/PingFang-SC.ttf b/static/font/PingFang-SC.ttf new file mode 100644 index 00000000..b31eb2ac Binary files /dev/null and b/static/font/PingFang-SC.ttf differ diff --git a/static/font/font_2225171_8kdcwk4po24.ttf b/static/font/font_2225171_8kdcwk4po24.ttf new file mode 100644 index 00000000..befa24aa Binary files /dev/null and b/static/font/font_2225171_8kdcwk4po24.ttf differ diff --git a/static/images/icon/fawn.png b/static/images/icon/fawn.png new file mode 100644 index 00000000..9ce669ab Binary files /dev/null and b/static/images/icon/fawn.png differ diff --git a/static/images/index/111.png b/static/images/index/111.png new file mode 100644 index 00000000..4d8b776f Binary files /dev/null and b/static/images/index/111.png differ diff --git a/static/images/index/bg.png b/static/images/index/bg.png new file mode 100644 index 00000000..5bacd229 Binary files /dev/null and b/static/images/index/bg.png differ diff --git a/static/images/index/fttz.png b/static/images/index/fttz.png new file mode 100644 index 00000000..dd388656 Binary files /dev/null and b/static/images/index/fttz.png differ diff --git a/static/images/index/hot.png b/static/images/index/hot.png new file mode 100644 index 00000000..96790e74 Binary files /dev/null and b/static/images/index/hot.png differ diff --git a/static/images/index/logo_text.png b/static/images/index/logo_text.png new file mode 100644 index 00000000..6ae0ff2f Binary files /dev/null and b/static/images/index/logo_text.png differ diff --git a/static/images/index/navigation_ai.png b/static/images/index/navigation_ai.png new file mode 100644 index 00000000..2b58abd5 Binary files /dev/null and b/static/images/index/navigation_ai.png differ diff --git a/static/images/index/navigation_course.png b/static/images/index/navigation_course.png new file mode 100644 index 00000000..e8fabdd9 Binary files /dev/null and b/static/images/index/navigation_course.png differ diff --git a/static/images/index/navigation_examination.png b/static/images/index/navigation_examination.png new file mode 100644 index 00000000..dab97094 Binary files /dev/null and b/static/images/index/navigation_examination.png differ diff --git a/static/images/index/navigation_learning_analysis.png b/static/images/index/navigation_learning_analysis.png new file mode 100644 index 00000000..675a497a Binary files /dev/null and b/static/images/index/navigation_learning_analysis.png differ diff --git a/static/images/index/navigation_learning_tasks.png b/static/images/index/navigation_learning_tasks.png new file mode 100644 index 00000000..67170b6e Binary files /dev/null and b/static/images/index/navigation_learning_tasks.png differ diff --git a/static/images/index/navigation_practice.png b/static/images/index/navigation_practice.png new file mode 100644 index 00000000..470393e4 Binary files /dev/null and b/static/images/index/navigation_practice.png differ diff --git a/static/images/index/navigation_question_answering.png b/static/images/index/navigation_question_answering.png new file mode 100644 index 00000000..d6b47d78 Binary files /dev/null and b/static/images/index/navigation_question_answering.png differ diff --git a/static/images/index/navigation_wrong_question.png b/static/images/index/navigation_wrong_question.png new file mode 100644 index 00000000..4d8b776f Binary files /dev/null and b/static/images/index/navigation_wrong_question.png differ diff --git a/static/images/index/search.png b/static/images/index/search.png new file mode 100644 index 00000000..208799a6 Binary files /dev/null and b/static/images/index/search.png differ diff --git a/static/images/login/bg.png b/static/images/login/bg.png new file mode 100644 index 00000000..74ca5641 Binary files /dev/null and b/static/images/login/bg.png differ diff --git a/static/images/login/clap.png b/static/images/login/clap.png new file mode 100644 index 00000000..e569395e Binary files /dev/null and b/static/images/login/clap.png differ diff --git a/static/images/login/logo_text.png b/static/images/login/logo_text.png new file mode 100644 index 00000000..e1dd0f4e Binary files /dev/null and b/static/images/login/logo_text.png differ diff --git a/static/images/login/no_show.png b/static/images/login/no_show.png new file mode 100644 index 00000000..4598c7dd Binary files /dev/null and b/static/images/login/no_show.png differ diff --git a/static/images/login/profile.png b/static/images/login/profile.png new file mode 100644 index 00000000..897744b6 Binary files /dev/null and b/static/images/login/profile.png differ diff --git a/static/images/login/show.png b/static/images/login/show.png new file mode 100644 index 00000000..33a24bf1 Binary files /dev/null and b/static/images/login/show.png differ diff --git a/uni.scss b/uni.scss index fa3b7b92..b9249e9d 100644 --- a/uni.scss +++ b/uni.scss @@ -11,8 +11,7 @@ * * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 */ -/* uni.scss */ -@import '@/uni_modules/uview-ui/theme.scss'; + /* 颜色变量 */ /* 行为相关颜色 */ diff --git a/uni_modules/uv-button/changelog.md b/uni_modules/uv-button/changelog.md new file mode 100644 index 00000000..11e954e3 --- /dev/null +++ b/uni_modules/uv-button/changelog.md @@ -0,0 +1,33 @@ +## 1.0.15(2023-12-20) +1. 优化 +## 1.0.14(2023-12-06) +1. 优化 +## 1.0.13(2023-12-06) +1. 阻止事件冒泡处理 +## 1.0.12(2023-10-19) +1. 增加后置插槽 +## 1.0.11(2023-09-21) +1. 修复通过customStyle修改按钮宽度,组件中最外层节点不改变的问题 +## 1.0.10(2023-09-15) +1. 按钮支持open-type="agreePrivacyAuthorization" +## 1.0.9(2023-09-11) +1. 增加参数iconSize,用于控制图标的大小 +## 1.0.8(2023-09-10) +1. 修复多个按钮在一行宽度不正常的BUG +## 1.0.7(2023-09-07) +1. 修复warning颜色对应错误的BUG +## 1.0.6(2023-07-25) +1. 增加customTextStyle属性,方便自定义文字样式 +## 1.0.5(2023-07-20) +1. 解决微信小程序动态设置hover-class点击态不消失的BUG +## 1.0.4(2023-06-29) +1. 修改上次更新出现nvue报错异常 +## 1.0.3(2023-06-28) + 修复:设置open-type="chooseAvatar"等值不生效的BUG +## 1.0.2(2023-06-01) +1. 修复按钮点击触发两次的BUG +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +uv-button 按钮 diff --git a/uni_modules/uv-button/components/uv-button/nvue.scss b/uni_modules/uv-button/components/uv-button/nvue.scss new file mode 100644 index 00000000..be6c16e2 --- /dev/null +++ b/uni_modules/uv-button/components/uv-button/nvue.scss @@ -0,0 +1,46 @@ +$uv-button-active-opacity:0.75 !default; +$uv-button-loading-text-margin-left:4px !default; +$uv-button-text-color: #FFFFFF !default; +$uv-button-text-plain-error-color:$uv-error !default; +$uv-button-text-plain-warning-color:$uv-warning !default; +$uv-button-text-plain-success-color:$uv-success !default; +$uv-button-text-plain-info-color:$uv-info !default; +$uv-button-text-plain-primary-color:$uv-primary !default; +.uv-button { + &--active { + opacity: $uv-button-active-opacity; + } + + &--active--plain { + background-color: rgb(217, 217, 217); + } + + &__loading-text { + margin-left:$uv-button-loading-text-margin-left; + } + + &__text, + &__loading-text { + color:$uv-button-text-color; + } + + &__text--plain--error { + color:$uv-button-text-plain-error-color; + } + + &__text--plain--warning { + color:$uv-button-text-plain-warning-color; + } + + &__text--plain--success{ + color:$uv-button-text-plain-success-color; + } + + &__text--plain--info { + color:$uv-button-text-plain-info-color; + } + + &__text--plain--primary { + color:$uv-button-text-plain-primary-color; + } +} \ No newline at end of file diff --git a/uni_modules/uv-button/components/uv-button/props.js b/uni_modules/uv-button/components/uv-button/props.js new file mode 100644 index 00000000..6275ad56 --- /dev/null +++ b/uni_modules/uv-button/components/uv-button/props.js @@ -0,0 +1,163 @@ +export default { + props: { + // 是否细边框 + hairline: { + type: Boolean, + default: true + }, + // 按钮的预置样式,info,primary,error,warning,success + type: { + type: String, + default: 'info' + }, + // 按钮尺寸,large,normal,small,mini + size: { + type: String, + default: 'normal' + }, + // 按钮形状,circle(两边为半圆),square(带圆角) + shape: { + type: String, + default: 'square' + }, + // 按钮是否镂空 + plain: { + type: Boolean, + default: false + }, + // 是否禁止状态 + disabled: { + type: Boolean, + default: false + }, + // 是否加载中 + loading: { + type: Boolean, + default: false + }, + // 加载中提示文字 + loadingText: { + type: [String, Number], + default: '' + }, + // 加载状态图标类型 + loadingMode: { + type: String, + default: 'spinner' + }, + // 加载图标大小 + loadingSize: { + type: [String, Number], + default: 14 + }, + // 开放能力,具体请看uniapp稳定关于button组件部分说明 + // https://uniapp.dcloud.io/component/button + openType: { + type: String, + default: '' + }, + // 用于
组件,点击分别会触发 组件的 submit/reset 事件 + // 取值为submit(提交表单),reset(重置表单) + formType: { + type: String, + default: '' + }, + // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 + // 只微信小程序、QQ小程序有效 + appParameter: { + type: String, + default: '' + }, + // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 + hoverStopPropagation: { + type: Boolean, + default: true + }, + // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效 + lang: { + type: String, + default: 'en' + }, + // 会话来源,open-type="contact"时有效。只微信小程序有效 + sessionFrom: { + type: String, + default: '' + }, + // 会话内消息卡片标题,open-type="contact"时有效 + // 默认当前标题,只微信小程序有效 + sendMessageTitle: { + type: String, + default: '' + }, + // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 + // 默认当前分享路径,只微信小程序有效 + sendMessagePath: { + type: String, + default: '' + }, + // 会话内消息卡片图片,open-type="contact"时有效 + // 默认当前页面截图,只微信小程序有效 + sendMessageImg: { + type: String, + default: '' + }, + // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示, + // 用户点击后可以快速发送小程序消息,open-type="contact"时有效 + showMessageCard: { + type: Boolean, + default: true + }, + // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 + dataName: { + type: String, + default: '' + }, + // 节流,一定时间内只能触发一次 + throttleTime: { + type: [String, Number], + default: 0 + }, + // 按住后多久出现点击态,单位毫秒 + hoverStartTime: { + type: [String, Number], + default: 0 + }, + // 手指松开后点击态保留时间,单位毫秒 + hoverStayTime: { + type: [String, Number], + default: 200 + }, + // 按钮文字,之所以通过props传入,是因为slot传入的话 + // nvue中无法控制文字的样式 + text: { + type: [String, Number], + default: '' + }, + // 按钮图标 + icon: { + type: String, + default: '' + }, + // 按钮图标大小 + iconSize: { + type: [String, Number], + default: '' + }, + // 按钮图标颜色 + iconColor: { + type: String, + default: '#000000' + }, + // 按钮颜色,支持传入linear-gradient渐变色 + color: { + type: String, + default: '' + }, + // 自定义按钮文本样式 + customTextStyle: { + type: [Object,String], + default: '' + }, + ...uni.$uv?.props?.button + } +} diff --git a/uni_modules/uv-button/components/uv-button/uv-button.vue b/uni_modules/uv-button/components/uv-button/uv-button.vue new file mode 100644 index 00000000..3a2470a3 --- /dev/null +++ b/uni_modules/uv-button/components/uv-button/uv-button.vue @@ -0,0 +1,528 @@ + + + + + diff --git a/uni_modules/uv-button/components/uv-button/vue.scss b/uni_modules/uv-button/components/uv-button/vue.scss new file mode 100644 index 00000000..7a089be7 --- /dev/null +++ b/uni_modules/uv-button/components/uv-button/vue.scss @@ -0,0 +1,93 @@ +@import '@/uni_modules/uv-ui-tools/libs/css/color.scss'; +// nvue下hover-class无效 +$uv-button-before-top:50% !default; +$uv-button-before-left:50% !default; +$uv-button-before-width:100% !default; +$uv-button-before-height:100% !default; +$uv-button-before-transform:translate(-50%, -50%) !default; +$uv-button-before-opacity:0 !default; +$uv-button-before-background-color:#000 !default; +$uv-button-before-border-color:#000 !default; +$uv-button-active-before-opacity:.15 !default; +$uv-button-icon-margin-left:4px !default; +$uv-button-plain-uv-button-info-color:$uv-info; +$uv-button-plain-uv-button-success-color:$uv-success; +$uv-button-plain-uv-button-error-color:$uv-error; +$uv-button-plain-uv-button-warning-color:$uv-warning; + +.uv-button-wrapper { + position: relative; + &--dis { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 9; + } +} + +.uv-button { + width: 100%; + + &__text { + white-space: nowrap; + line-height: 1; + } + + &:before { + position: absolute; + top:$uv-button-before-top; + left:$uv-button-before-left; + width:$uv-button-before-width; + height:$uv-button-before-height; + border: inherit; + border-radius: inherit; + transform:$uv-button-before-transform; + opacity:$uv-button-before-opacity; + content: " "; + background-color:$uv-button-before-background-color; + border-color:$uv-button-before-border-color; + } + + &--active { + &:before { + opacity: .15 + } + } + + &__icon+&__text:not(:empty), + &__loading-text { + margin-left:$uv-button-icon-margin-left; + } + + &--plain { + &.uv-button--primary { + color: $uv-primary; + } + } + + &--plain { + &.uv-button--info { + color:$uv-button-plain-uv-button-info-color; + } + } + + &--plain { + &.uv-button--success { + color:$uv-button-plain-uv-button-success-color; + } + } + + &--plain { + &.uv-button--error { + color:$uv-button-plain-uv-button-error-color; + } + } + + &--plain { + &.uv-button--warning { + color:$uv-button-plain-uv-button-warning-color; + } + } +} diff --git a/uni_modules/uview-ui/package.json b/uni_modules/uv-button/package.json similarity index 53% rename from uni_modules/uview-ui/package.json rename to uni_modules/uv-button/package.json index 2be2fc83..c2a4a17c 100644 --- a/uni_modules/uview-ui/package.json +++ b/uni_modules/uv-button/package.json @@ -1,24 +1,22 @@ { - "id": "uview-ui", - "name": "uview-ui", - "displayName": "uView2.0重磅发布,利剑出鞘,一统江湖", - "version": "2.0.38", - "description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水", + "id": "uv-button", + "displayName": "uv-button 按钮 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.15", + "description": "按钮组件内部实现以uni-app的button组件为基础,进行二次封装,灵活配置,功能齐全,兼容全端。", "keywords": [ - "uview", - "uview", - "ui", - "ui", - "uni-app", - "uni-app", - "ui" + "uv-button", + "uvui", + "uv-ui", + "button", + "按钮" ], - "repository": "https://github.com/umicro/uView2.0", + "repository": "", "engines": { "HBuilderX": "^3.1.0" }, - "dcloudext": { - "sale": { + "dcloudext": { + "type": "component-vue", + "sale": { "regular": { "price": "0.00" }, @@ -27,29 +25,31 @@ } }, "contact": { - "qq": "1416956117" + "qq": "" }, "declaration": { "ads": "无", - "data": "无", + "data": "插件不采集任何数据", "permissions": "无" }, - "npmurl": "https://www.npmjs.com/package/uview-ui", - "type": "component-vue" + "npmurl": "" }, "uni_modules": { - "dependencies": [], + "dependencies": [ + "uv-ui-tools", + "uv-loading-icon", + "uv-icon" + ], "encrypt": [], "platforms": { "cloud": { "tcb": "y", - "aliyun": "y", - "alipay": "n" + "aliyun": "y" }, "client": { "Vue": { "vue2": "y", - "vue3": "n" + "vue3": "y" }, "App": { "app-vue": "y", @@ -73,13 +73,17 @@ "阿里": "y", "百度": "y", "字节跳动": "y", - "QQ": "y" + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" }, "快应用": { - "华为": "y", - "联盟": "y" + "华为": "u", + "联盟": "u" } } } } -} +} \ No newline at end of file diff --git a/uni_modules/uv-button/readme.md b/uni_modules/uv-button/readme.md new file mode 100644 index 00000000..124a7f47 --- /dev/null +++ b/uni_modules/uv-button/readme.md @@ -0,0 +1,19 @@ +## Button 按钮 + +> **组件名:uv-button** + +该组件内部实现以`uni-app`的`button`组件为基础,进行二次封装,灵活配置,功能齐全,兼容全端。灵活配置,内置状态设置,开箱即用。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file diff --git a/uni_modules/uv-checkbox/changelog.md b/uni_modules/uv-checkbox/changelog.md new file mode 100644 index 00000000..2a142ce7 --- /dev/null +++ b/uni_modules/uv-checkbox/changelog.md @@ -0,0 +1,34 @@ +## 1.0.14(2023-11-04) +1. 修复label文字较多不分行的问题 +## 1.0.13(2023-10-11) +1. 优化同类问题:https://gitee.com/climblee/uv-ui/issues/I872VD +## 1.0.12(2023-09-22) +1. 修复change回调中v-model值不更新的BUG +## 1.0.11(2023-09-01) +1. 修复点击空隙处无效的问题 +2. label支持插槽下可点击 +## 1.0.10(2023-08-27) +1. 修复label设置布尔值不生效的BUG +## 1.0.9(2023-08-16) +1. 解决数据多不换行的BUG +## 1.0.8(2023-07-13) +1. 修复 uv-checkbox设置value属性不生效的BUG +## 1.0.7(2023-07-05) +修复vue3模式下,动态修改v-model绑定的值无效的BUG +## 1.0.6(2023-06-29) +1. 增加label插槽,与radio保持一致 +2. 优化文档 +## 1.0.5(2023-06-12) +1. 修复1.0.4改出的问题 +## 1.0.4(2023-06-08) +1. 复选框修复全局设置不生效的BUG +## 1.0.3(2023-06-06) +1. uv-checkbox-group 兼容自定义样式customStyle,方便通过样式调整整体位置等; +2. .uv-checkbox-group--row增加flex-wrap: wrap;允许换行 +## 1.0.2(2023-05-30) +1. 修复error报错的BUG +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +uv-checkbox 复选框 diff --git a/uni_modules/uv-checkbox/components/uv-checkbox-group/props.js b/uni_modules/uv-checkbox/components/uv-checkbox-group/props.js new file mode 100644 index 00000000..47bf0053 --- /dev/null +++ b/uni_modules/uv-checkbox/components/uv-checkbox-group/props.js @@ -0,0 +1,84 @@ +export default { + props: { + // 绑定的值 + value: { + type: Array, + default: () => [] + }, + modelValue: { + type: Array, + default: () => [] + }, + // 标识符 + name: { + type: String, + default: '' + }, + // 形状,circle-圆形,square-方形 + shape: { + type: String, + default: 'square' + }, + // 是否禁用全部checkbox + disabled: { + type: Boolean, + default: false + }, + // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 + activeColor: { + type: String, + default: '#2979ff' + }, + // 未选中的颜色 + inactiveColor: { + type: String, + default: '#c8c9cc' + }, + // 整个组件的尺寸,默认px + size: { + type: [String, Number], + default: 18 + }, + // 布局方式,row-横向,column-纵向 + placement: { + type: String, + default: 'row' + }, + // label的字体大小,px单位 + labelSize: { + type: [String, Number], + default: 14 + }, + // label的字体颜色 + labelColor: { + type: [String], + default: '#303133' + }, + // 是否禁止点击文本操作 + labelDisabled: { + type: Boolean, + default: false + }, + // 图标颜色 + iconColor: { + type: String, + default: '#fff' + }, + // 图标的大小,单位px + iconSize: { + type: [String, Number], + default: 12 + }, + // 勾选图标的对齐方式,left-左边,right-右边 + iconPlacement: { + type: String, + default: 'left' + }, + // 竖向配列时,是否显示下划线 + borderBottom: { + type: Boolean, + default: false + }, + ...uni.$uv?.props?.checkboxGroup + } +} \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue b/uni_modules/uv-checkbox/components/uv-checkbox-group/uv-checkbox-group.vue similarity index 68% rename from uni_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue rename to uni_modules/uv-checkbox/components/uv-checkbox-group/uv-checkbox-group.vue index 7a6b4fa3..d5ea81f8 100644 --- a/uni_modules/uview-ui/components/u-checkbox-group/u-checkbox-group.vue +++ b/uni_modules/uv-checkbox/components/uv-checkbox-group/uv-checkbox-group.vue @@ -1,18 +1,21 @@ diff --git a/uni_modules/uv-checkbox/package.json b/uni_modules/uv-checkbox/package.json new file mode 100644 index 00000000..44944d9d --- /dev/null +++ b/uni_modules/uv-checkbox/package.json @@ -0,0 +1,88 @@ +{ + "id": "uv-checkbox", + "displayName": "uv-checkbox 复选框 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.14", + "description": "复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便。", + "keywords": [ + "uv-checkbox", + "uvui", + "uv-ui", + "checkbox", + "复选框" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools", + "uv-icon" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-checkbox/readme.md b/uni_modules/uv-checkbox/readme.md new file mode 100644 index 00000000..43b6f2e0 --- /dev/null +++ b/uni_modules/uv-checkbox/readme.md @@ -0,0 +1,19 @@ +## Checkbox 复选框 + +> **组件名:uv-checkbox** + +复选框组件一般用于需要多个选择的场景,该组件功能完整,使用方便。可配合 `uv-form` 组件进行表单验证等场景使用。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file diff --git a/uni_modules/uv-icon/changelog.md b/uni_modules/uv-icon/changelog.md new file mode 100644 index 00000000..c6108278 --- /dev/null +++ b/uni_modules/uv-icon/changelog.md @@ -0,0 +1,31 @@ +## 1.0.13(2023-12-06) +1. 优化 +## 1.0.12(2023-12-06) +1. 阻止事件冒泡处理 +## 1.0.11(2023-10-29) +1. imgMode默认值改成aspectFit +## 1.0.10(2023-08-13) +1. 优化nvue,方便自定义图标 +## 1.0.9(2023-07-28) +1. 修改几个对应错误图标的BUG +## 1.0.8(2023-07-24) +1. 优化 支持base64图片 +## 1.0.7(2023-07-17) +1. 修复 uv-icon 恢复uv-empty相关的图标 +## 1.0.6(2023-07-13) +1. 修复icon设置name属性对应图标错误的BUG +## 1.0.5(2023-07-04) +1. 更新图标,删除一些不常用的图标 +2. 删除base64,修改成ttf文件引入读取图标 +3. 自定义图标文档说明:https://www.uvui.cn/guide/customIcon.html +## 1.0.4(2023-07-03) +1. 修复主题颜色在APP不生效的BUG +## 1.0.3(2023-05-24) +1. 将线上ttf字体包替换成base64,避免加载时或者网络差时候显示白色方块 +## 1.0.2(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.1(2023-05-10) +1. 修复小程序中异常显示 +## 1.0.0(2023-05-04) +新发版 diff --git a/uni_modules/uv-icon/components/uv-icon/icons.js b/uni_modules/uv-icon/components/uv-icon/icons.js new file mode 100644 index 00000000..8469a2da --- /dev/null +++ b/uni_modules/uv-icon/components/uv-icon/icons.js @@ -0,0 +1,160 @@ +export default { + 'uvicon-level': 'e68f', + 'uvicon-checkbox-mark': 'e659', + 'uvicon-folder': 'e694', + 'uvicon-movie': 'e67c', + 'uvicon-star-fill': 'e61e', + 'uvicon-star': 'e618', + 'uvicon-phone-fill': 'e6ac', + 'uvicon-phone': 'e6ba', + 'uvicon-apple-fill': 'e635', + 'uvicon-backspace': 'e64d', + 'uvicon-attach': 'e640', + 'uvicon-empty-data': 'e671', + 'uvicon-empty-address': 'e68a', + 'uvicon-empty-favor': 'e662', + 'uvicon-empty-car': 'e657', + 'uvicon-empty-order': 'e66b', + 'uvicon-empty-list': 'e672', + 'uvicon-empty-search': 'e677', + 'uvicon-empty-permission': 'e67d', + 'uvicon-empty-news': 'e67e', + 'uvicon-empty-history': 'e685', + 'uvicon-empty-coupon': 'e69b', + 'uvicon-empty-page': 'e60e', + 'uvicon-empty-wifi-off': 'e6cc', + 'uvicon-reload': 'e627', + 'uvicon-order': 'e695', + 'uvicon-server-man': 'e601', + 'uvicon-search': 'e632', + 'uvicon-more-dot-fill': 'e66f', + 'uvicon-scan': 'e631', + 'uvicon-map': 'e665', + 'uvicon-map-fill': 'e6a8', + 'uvicon-tags': 'e621', + 'uvicon-tags-fill': 'e613', + 'uvicon-eye': 'e664', + 'uvicon-eye-fill': 'e697', + 'uvicon-eye-off': 'e69c', + 'uvicon-eye-off-outline': 'e688', + 'uvicon-mic': 'e66d', + 'uvicon-mic-off': 'e691', + 'uvicon-calendar': 'e65c', + 'uvicon-trash': 'e623', + 'uvicon-trash-fill': 'e6ce', + 'uvicon-play-left': 'e6bf', + 'uvicon-play-right': 'e6b3', + 'uvicon-minus': 'e614', + 'uvicon-plus': 'e625', + 'uvicon-info-circle': 'e69f', + 'uvicon-info-circle-fill': 'e6a7', + 'uvicon-question-circle': 'e622', + 'uvicon-question-circle-fill': 'e6bc', + 'uvicon-close': 'e65a', + 'uvicon-checkmark': 'e64a', + 'uvicon-checkmark-circle': 'e643', + 'uvicon-checkmark-circle-fill': 'e668', + 'uvicon-setting': 'e602', + 'uvicon-setting-fill': 'e6d0', + 'uvicon-heart': 'e6a2', + 'uvicon-heart-fill': 'e68b', + 'uvicon-camera': 'e642', + 'uvicon-camera-fill': 'e650', + 'uvicon-more-circle': 'e69e', + 'uvicon-more-circle-fill': 'e684', + 'uvicon-chat': 'e656', + 'uvicon-chat-fill': 'e63f', + 'uvicon-bag': 'e647', + 'uvicon-error-circle': 'e66e', + 'uvicon-error-circle-fill': 'e655', + 'uvicon-close-circle': 'e64e', + 'uvicon-close-circle-fill': 'e666', + 'uvicon-share': 'e629', + 'uvicon-share-fill': 'e6bb', + 'uvicon-share-square': 'e6c4', + 'uvicon-shopping-cart': 'e6cb', + 'uvicon-shopping-cart-fill': 'e630', + 'uvicon-bell': 'e651', + 'uvicon-bell-fill': 'e604', + 'uvicon-list': 'e690', + 'uvicon-list-dot': 'e6a9', + 'uvicon-zhifubao-circle-fill': 'e617', + 'uvicon-weixin-circle-fill': 'e6cd', + 'uvicon-weixin-fill': 'e620', + 'uvicon-qq-fill': 'e608', + 'uvicon-qq-circle-fill': 'e6b9', + 'uvicon-moments-circel-fill': 'e6c2', + 'uvicon-moments': 'e6a0', + 'uvicon-car': 'e64f', + 'uvicon-car-fill': 'e648', + 'uvicon-warning-fill': 'e6c7', + 'uvicon-warning': 'e6c1', + 'uvicon-clock-fill': 'e64b', + 'uvicon-clock': 'e66c', + 'uvicon-edit-pen': 'e65d', + 'uvicon-edit-pen-fill': 'e679', + 'uvicon-email': 'e673', + 'uvicon-email-fill': 'e683', + 'uvicon-minus-circle': 'e6a5', + 'uvicon-plus-circle': 'e603', + 'uvicon-plus-circle-fill': 'e611', + 'uvicon-file-text': 'e687', + 'uvicon-file-text-fill': 'e67f', + 'uvicon-pushpin': 'e6d1', + 'uvicon-pushpin-fill': 'e6b6', + 'uvicon-grid': 'e68c', + 'uvicon-grid-fill': 'e698', + 'uvicon-play-circle': 'e6af', + 'uvicon-play-circle-fill': 'e62a', + 'uvicon-pause-circle-fill': 'e60c', + 'uvicon-pause': 'e61c', + 'uvicon-pause-circle': 'e696', + 'uvicon-gift-fill': 'e6b0', + 'uvicon-gift': 'e680', + 'uvicon-kefu-ermai': 'e660', + 'uvicon-server-fill': 'e610', + 'uvicon-coupon-fill': 'e64c', + 'uvicon-coupon': 'e65f', + 'uvicon-integral': 'e693', + 'uvicon-integral-fill': 'e6b1', + 'uvicon-home-fill': 'e68e', + 'uvicon-home': 'e67b', + 'uvicon-account': 'e63a', + 'uvicon-account-fill': 'e653', + 'uvicon-thumb-down-fill': 'e628', + 'uvicon-thumb-down': 'e60a', + 'uvicon-thumb-up': 'e612', + 'uvicon-thumb-up-fill': 'e62c', + 'uvicon-lock-fill': 'e6a6', + 'uvicon-lock-open': 'e68d', + 'uvicon-lock-opened-fill': 'e6a1', + 'uvicon-lock': 'e69d', + 'uvicon-red-packet': 'e6c3', + 'uvicon-photo-fill': 'e6b4', + 'uvicon-photo': 'e60d', + 'uvicon-volume-off-fill': 'e6c8', + 'uvicon-volume-off': 'e6bd', + 'uvicon-volume-fill': 'e624', + 'uvicon-volume': 'e605', + 'uvicon-download': 'e670', + 'uvicon-arrow-up-fill': 'e636', + 'uvicon-arrow-down-fill': 'e638', + 'uvicon-play-left-fill': 'e6ae', + 'uvicon-play-right-fill': 'e6ad', + 'uvicon-arrow-downward': 'e634', + 'uvicon-arrow-leftward': 'e63b', + 'uvicon-arrow-rightward': 'e644', + 'uvicon-arrow-upward': 'e641', + 'uvicon-arrow-down': 'e63e', + 'uvicon-arrow-right': 'e63c', + 'uvicon-arrow-left': 'e646', + 'uvicon-arrow-up': 'e633', + 'uvicon-skip-back-left': 'e6c5', + 'uvicon-skip-forward-right': 'e61f', + 'uvicon-arrow-left-double': 'e637', + 'uvicon-man': 'e675', + 'uvicon-woman': 'e626', + 'uvicon-en': 'e6b8', + 'uvicon-twitte': 'e607', + 'uvicon-twitter-circle-fill': 'e6cf' +} \ No newline at end of file diff --git a/uni_modules/uv-icon/components/uv-icon/props.js b/uni_modules/uv-icon/components/uv-icon/props.js new file mode 100644 index 00000000..7668cf96 --- /dev/null +++ b/uni_modules/uv-icon/components/uv-icon/props.js @@ -0,0 +1,90 @@ +export default { + props: { + // 图标类名 + name: { + type: String, + default: '' + }, + // 图标颜色,可接受主题色 + color: { + type: String, + default: '#606266' + }, + // 字体大小,单位px + size: { + type: [String, Number], + default: '16px' + }, + // 是否显示粗体 + bold: { + type: Boolean, + default: false + }, + // 点击图标的时候传递事件出去的index(用于区分点击了哪一个) + index: { + type: [String, Number], + default: null + }, + // 触摸图标时的类名 + hoverClass: { + type: String, + default: '' + }, + // 自定义扩展前缀,方便用户扩展自己的图标库 + customPrefix: { + type: String, + default: 'uvicon' + }, + // 图标右边或者下面的文字 + label: { + type: [String, Number], + default: '' + }, + // label的位置,只能右边或者下边 + labelPos: { + type: String, + default: 'right' + }, + // label的大小 + labelSize: { + type: [String, Number], + default: '15px' + }, + // label的颜色 + labelColor: { + type: String, + default: '#606266' + }, + // label与图标的距离 + space: { + type: [String, Number], + default: '3px' + }, + // 图片的mode + imgMode: { + type: String, + default: 'aspectFit' + }, + // 用于显示图片小图标时,图片的宽度 + width: { + type: [String, Number], + default: '' + }, + // 用于显示图片小图标时,图片的高度 + height: { + type: [String, Number], + default: '' + }, + // 用于解决某些情况下,让图标垂直居中的用途 + top: { + type: [String, Number], + default: 0 + }, + // 是否阻止事件传播 + stop: { + type: Boolean, + default: false + }, + ...uni.$uv?.props?.icon + } +} \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u-icon/u-icon.vue b/uni_modules/uv-icon/components/uv-icon/uv-icon.vue similarity index 60% rename from uni_modules/uview-ui/components/u-icon/u-icon.vue rename to uni_modules/uv-icon/components/uv-icon/uv-icon.vue index 9340328e..d61c9e5b 100644 --- a/uni_modules/uview-ui/components/u-icon/u-icon.vue +++ b/uni_modules/uv-icon/components/uv-icon/uv-icon.vue @@ -1,62 +1,61 @@ + \ No newline at end of file diff --git a/uni_modules/uv-icon/components/uv-icon/uvicons.ttf b/uni_modules/uv-icon/components/uv-icon/uvicons.ttf new file mode 100644 index 00000000..9aedef86 Binary files /dev/null and b/uni_modules/uv-icon/components/uv-icon/uvicons.ttf differ diff --git a/uni_modules/uv-icon/package.json b/uni_modules/uv-icon/package.json new file mode 100644 index 00000000..0a838d5b --- /dev/null +++ b/uni_modules/uv-icon/package.json @@ -0,0 +1,83 @@ +{ + "id": "uv-icon", + "displayName": "uv-icon 图标 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.13", + "description": "基于字体的图标集,包含了大多数常见场景的图标,支持自定义,支持自定义图片图标等。可自定义颜色、大小。", + "keywords": [ + "uv-ui,uvui,uv-icon,icon,图标,字体图标" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-icon/readme.md b/uni_modules/uv-icon/readme.md new file mode 100644 index 00000000..d526e1a1 --- /dev/null +++ b/uni_modules/uv-icon/readme.md @@ -0,0 +1,15 @@ +## uv-icon 图标库 + +> **组件名:uv-icon** + +基于字体的图标集,包含了大多数常见场景的图标,支持自定义,支持自定义图片图标等。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 diff --git a/uni_modules/uv-input/changelog.md b/uni_modules/uv-input/changelog.md new file mode 100644 index 00000000..2b354d0c --- /dev/null +++ b/uni_modules/uv-input/changelog.md @@ -0,0 +1,29 @@ +## 1.0.13(2023-12-06) +1. 优化 +## 1.0.12(2023-12-06) +1. 阻止事件冒泡问题 +## 1.0.11(2023-11-10) +1. 调整清除按钮样式的marginLeft,避免微信上多数情况触发不了的BUG +## 1.0.10(2023-10-07) +1. 修复搜狗输入法下存在不可清空的情况 +## 1.0.9(2023-09-14) +1. 修复H5等情况设置禁用或可读情况下,点击事件无效的问题 +## 1.0.8(2023-08-22) +1. 修复无法@keyboardheightchange无法获取键盘高度的BUG +## 1.0.7(2023-08-18) +1. 修复ios端不能输入的BUG +## 1.0.6(2023-08-05) +1. 修复在vue2模式下,v-model设置为0时不生效的BUG +## 1.0.5(2023-07-18) +1. 修复在微信小程序端清除内容存在不能清除的BUG +## 1.0.4(2023-07-13) +1. 修复value/v-model更改不生效的BUG +## 1.0.3(2023-07-03) +去除插槽判断,避免某些平台不显示的BUG +## 1.0.2(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.1(2023-05-12) +1. 修复vue3双向绑定的BUG +## 1.0.0(2023-05-10) +uv-input 输入框 diff --git a/uni_modules/uview-ui/components/u-input/props.js b/uni_modules/uv-input/components/uv-input/props.js similarity index 65% rename from uni_modules/uview-ui/components/u-input/props.js rename to uni_modules/uv-input/components/uv-input/props.js index 2c508701..e9694939 100644 --- a/uni_modules/uview-ui/components/u-input/props.js +++ b/uni_modules/uv-input/components/uv-input/props.js @@ -1,9 +1,12 @@ export default { props: { - // 输入的值 value: { type: [String, Number], - default: uni.$u.props.input.value + default: '' + }, + modelValue: { + type: [String, Number], + default: '' }, // 输入框类型 // number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数 @@ -12,176 +15,161 @@ export default { // text-文本输入键盘 type: { type: String, - default: uni.$u.props.input.type - }, - // 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true, - // 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 - fixed: { - type: Boolean, - default: uni.$u.props.input.fixed + default: 'text' }, // 是否禁用输入框 disabled: { type: Boolean, - default: uni.$u.props.input.disabled + default: false }, // 禁用状态时的背景色 disabledColor: { type: String, - default: uni.$u.props.input.disabledColor + default: '#f5f7fa' }, // 是否显示清除控件 clearable: { type: Boolean, - default: uni.$u.props.input.clearable + default: false }, // 是否密码类型 password: { type: Boolean, - default: uni.$u.props.input.password + default: false }, // 最大输入长度,设置为 -1 的时候不限制最大长度 maxlength: { type: [String, Number], - default: uni.$u.props.input.maxlength + default: -1 }, // 输入框为空时的占位符 placeholder: { type: String, - default: uni.$u.props.input.placeholder + default: null }, // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ placeholderClass: { type: String, - default: uni.$u.props.input.placeholderClass + default: 'input-placeholder' }, // 指定placeholder的样式 placeholderStyle: { type: [String, Object], - default: uni.$u.props.input.placeholderStyle - }, - // 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效 - showWordLimit: { - type: Boolean, - default: uni.$u.props.input.showWordLimit + default: 'color: #c0c4cc' }, // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档 // https://uniapp.dcloud.io/component/input // https://uniapp.dcloud.io/component/textarea confirmType: { type: String, - default: uni.$u.props.input.confirmType + default: 'done' }, // 点击键盘右下角按钮时是否保持键盘不收起,H5无效 confirmHold: { type: Boolean, - default: uni.$u.props.input.confirmHold + default: false }, // focus时,点击页面的时候不收起键盘,微信小程序有效 holdKeyboard: { type: Boolean, - default: uni.$u.props.input.holdKeyboard + default: false }, // 自动获取焦点 // 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 focus: { type: Boolean, - default: uni.$u.props.input.focus + default: false }, // 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 autoBlur: { type: Boolean, - default: uni.$u.props.input.autoBlur - }, - // 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效 - disableDefaultPadding: { - type: Boolean, - default: uni.$u.props.input.disableDefaultPadding + default: false }, // 指定focus时光标的位置 cursor: { type: [String, Number], - default: uni.$u.props.input.cursor + default: -1 }, // 输入框聚焦时底部与键盘的距离 cursorSpacing: { type: [String, Number], - default: uni.$u.props.input.cursorSpacing + default: 30 }, // 光标起始位置,自动聚集时有效,需与selection-end搭配使用 selectionStart: { type: [String, Number], - default: uni.$u.props.input.selectionStart + default: -1 }, // 光标结束位置,自动聚集时有效,需与selection-start搭配使用 selectionEnd: { type: [String, Number], - default: uni.$u.props.input.selectionEnd + default: -1 }, // 键盘弹起时,是否自动上推页面 adjustPosition: { type: Boolean, - default: uni.$u.props.input.adjustPosition + default: true }, // 输入框内容对齐方式,可选值为:left|center|right inputAlign: { type: String, - default: uni.$u.props.input.inputAlign + default: 'left' }, // 输入框字体的大小 fontSize: { type: [String, Number], - default: uni.$u.props.input.fontSize + default: '14px' }, // 输入框字体颜色 color: { type: String, - default: uni.$u.props.input.color + default: '#303133' }, // 输入框前置图标 prefixIcon: { type: String, - default: uni.$u.props.input.prefixIcon + default: '' }, // 前置图标样式,对象或字符串 prefixIconStyle: { type: [String, Object], - default: uni.$u.props.input.prefixIconStyle + default: '' }, // 输入框后置图标 suffixIcon: { type: String, - default: uni.$u.props.input.suffixIcon + default: '' }, // 后置图标样式,对象或字符串 suffixIconStyle: { type: [String, Object], - default: uni.$u.props.input.suffixIconStyle + default: '' }, // 边框类型,surround-四周边框,bottom-底部边框,none-无边框 border: { type: String, - default: uni.$u.props.input.border + default: 'surround' }, // 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 readonly: { type: Boolean, - default: uni.$u.props.input.readonly + default: false }, // 输入框形状,circle-圆形,square-方形 shape: { type: String, - default: uni.$u.props.input.shape + default: 'square' }, // 用于处理或者过滤输入框内容的方法 formatter: { type: [Function, null], - default: uni.$u.props.input.formatter + default: null }, // 是否忽略组件内对文本合成系统事件的处理 ignoreCompositionEvent: { type: Boolean, default: true - } + }, + ...uni.$uv?.props?.input } -} +} \ No newline at end of file diff --git a/uni_modules/uv-input/components/uv-input/uv-input.vue b/uni_modules/uv-input/components/uv-input/uv-input.vue new file mode 100644 index 00000000..20c18010 --- /dev/null +++ b/uni_modules/uv-input/components/uv-input/uv-input.vue @@ -0,0 +1,348 @@ + + + + + \ No newline at end of file diff --git a/uni_modules/uv-input/package.json b/uni_modules/uv-input/package.json new file mode 100644 index 00000000..6981fa9e --- /dev/null +++ b/uni_modules/uv-input/package.json @@ -0,0 +1,88 @@ +{ + "id": "uv-input", + "displayName": "uv-input 输入框 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.13", + "description": "uv-input 该组件为一个输入框,默认没有边框和样式,是专门为配合表单组件uv-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。", + "keywords": [ + "uv-input", + "uvui", + "uv-ui", + "input", + "输入框" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools", + "uv-icon" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-input/readme.md b/uni_modules/uv-input/readme.md new file mode 100644 index 00000000..00f47e46 --- /dev/null +++ b/uni_modules/uv-input/readme.md @@ -0,0 +1,19 @@ +## Input 输入框 + +> **组件名:uv-input** + +此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件uv-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file diff --git a/uni_modules/uv-loading-icon/changelog.md b/uni_modules/uv-loading-icon/changelog.md new file mode 100644 index 00000000..f17e0744 --- /dev/null +++ b/uni_modules/uv-loading-icon/changelog.md @@ -0,0 +1,9 @@ +## 1.0.3(2023-08-14) +1. 新增参数textStyle,自定义文本样式 +## 1.0.2(2023-06-27) +优化 +## 1.0.1(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.0(2023-05-10) +1. 新增uv-loading-icon组件 diff --git a/uni_modules/uv-loading-icon/components/uv-loading-icon/props.js b/uni_modules/uv-loading-icon/components/uv-loading-icon/props.js new file mode 100644 index 00000000..4ef0e944 --- /dev/null +++ b/uni_modules/uv-loading-icon/components/uv-loading-icon/props.js @@ -0,0 +1,67 @@ +export default { + props: { + // 是否显示组件 + show: { + type: Boolean, + default: true + }, + // 颜色 + color: { + type: String, + default: '#909193' + }, + // 提示文字颜色 + textColor: { + type: String, + default: '#909193' + }, + // 文字和图标是否垂直排列 + vertical: { + type: Boolean, + default: false + }, + // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形 + mode: { + type: String, + default: 'spinner' + }, + // 图标大小,单位默认px + size: { + type: [String, Number], + default: 24 + }, + // 文字大小 + textSize: { + type: [String, Number], + default: 15 + }, + // 文字样式 + textStyle: { + type: Object, + default () { + return {} + } + }, + // 文字内容 + text: { + type: [String, Number], + default: '' + }, + // 动画模式 https://www.runoob.com/cssref/css3-pr-animation-timing-function.html + timingFunction: { + type: String, + default: 'linear' + }, + // 动画执行周期时间 + duration: { + type: [String, Number], + default: 1200 + }, + // mode=circle时的暗边颜色 + inactiveColor: { + type: String, + default: '' + }, + ...uni.$uv?.props?.loadingIcon + } +} \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u-loading-icon/u-loading-icon.vue b/uni_modules/uv-loading-icon/components/uv-loading-icon/uv-loading-icon.vue similarity index 52% rename from uni_modules/uview-ui/components/u-loading-icon/u-loading-icon.vue rename to uni_modules/uv-loading-icon/components/uv-loading-icon/uv-loading-icon.vue index 2ede5c3a..56504700 100644 --- a/uni_modules/uview-ui/components/u-loading-icon/u-loading-icon.vue +++ b/uni_modules/uv-loading-icon/components/uv-loading-icon/uv-loading-icon.vue @@ -1,19 +1,19 @@ diff --git a/uni_modules/uv-notice-bar/package.json b/uni_modules/uv-notice-bar/package.json new file mode 100644 index 00000000..f1bca296 --- /dev/null +++ b/uni_modules/uv-notice-bar/package.json @@ -0,0 +1,88 @@ +{ + "id": "uv-notice-bar", + "displayName": "uv-notice-bar 滚动通知 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.0.7", + "description": "uv-notice-bar 该组件用于滚动通告场景,有多种模式可供选择。", + "keywords": [ + "uv-notice-bar", + "uvui", + "uv-ui", + "notice", + "滚动公告" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [ + "uv-ui-tools", + "uv-icon" + ], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-notice-bar/readme.md b/uni_modules/uv-notice-bar/readme.md new file mode 100644 index 00000000..61eb1313 --- /dev/null +++ b/uni_modules/uv-notice-bar/readme.md @@ -0,0 +1,19 @@ +## NoticeBar 滚动通知 + +> **组件名:uv-notice-bar** + +该组件用于滚动通告场景,有多种模式可供选择。灵活配置,开箱即用。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/changelog.md b/uni_modules/uv-ui-tools/changelog.md new file mode 100644 index 00000000..17edb49d --- /dev/null +++ b/uni_modules/uv-ui-tools/changelog.md @@ -0,0 +1,74 @@ +## 1.1.24(2023-12-21) +1. luch-request更新 +## 1.1.23(2023-12-12) +1. 1.1.19版本 +## 1.1.22(2023-11-28) +1. 优化 +## 1.1.21(2023-11-10) +1. 1.1.17版本 +## 1.1.20(2023-10-30) +1. 1.1.16版本 +## 1.1.19(2023-10-13) +1. 兼容vue3 +## 1.1.18(2023-10-12) +1. 1.1.15版本 +## 1.1.17(2023-09-27) +1. 1.1.14版本发布 +## 1.1.16(2023-09-15) +1. 1.1.13版本发布 +## 1.1.15(2023-09-15) +1. 更新button.js相关按钮支持open-type="agreePrivacyAuthorization" +## 1.1.14(2023-09-14) +1. 优化dayjs +## 1.1.13(2023-09-13) +1. 优化,$uv中增加unit参数,方便组件中使用 +## 1.1.12(2023-09-10) +1. 升级版本 +## 1.1.11(2023-09-04) +1. 1.1.11版本 +## 1.1.10(2023-08-31) +1. 修复customStyle和customClass存在冲突的问题 +## 1.1.9(2023-08-27) +1. 版本升级 +2. 优化 +## 1.1.8(2023-08-24) +1. 版本升级 +## 1.1.7(2023-08-22) +1. 版本升级 +## 1.1.6(2023-08-18) +uvui版本:1.1.6 +## 1.0.15(2023-08-14) +1. 更新uvui版本号 +## 1.0.13(2023-08-06) +1. 优化 +## 1.0.12(2023-08-06) +1. 修改版本号 +## 1.0.11(2023-08-06) +1. 路由增加events参数 +2. 路由拦截修复 +## 1.0.10(2023-08-01) +1. 优化 +## 1.0.9(2023-06-28) +优化openType.js +## 1.0.8(2023-06-15) +1. 修改支付宝报错的BUG +## 1.0.7(2023-06-07) +1. 解决微信小程序使用uvui提示 Some selectors are not allowed in component wxss, including tag name selectors, ID selectors, and attribute selectors +2. 解决上述提示,需要在uni.scss配置$uvui-nvue-style: false; 然后在APP.vue下面引入uvui内置的基础样式:@import '@/uni_modules/uv-ui-tools/index.scss'; +## 1.0.6(2023-06-04) +1. uv-ui-tools 优化工具组件,兼容更多功能 +2. 小程序分享功能优化等 +## 1.0.5(2023-06-02) +1. 修改扩展使用mixin中方法的问题 +## 1.0.4(2023-05-23) +1. 兼容百度小程序修改bem函数 +## 1.0.3(2023-05-16) +1. 优化组件依赖,修改后无需全局引入,组件导入即可使用 +2. 优化部分功能 +## 1.0.2(2023-05-10) +1. 增加Http请求封装 +2. 优化 +## 1.0.1(2023-05-04) +1. 修改名称及备注 +## 1.0.0(2023-05-04) +1. uv-ui工具集首次发布 diff --git a/uni_modules/uv-ui-tools/components/uv-ui-tools/uv-ui-tools.vue b/uni_modules/uv-ui-tools/components/uv-ui-tools/uv-ui-tools.vue new file mode 100644 index 00000000..baf45e91 --- /dev/null +++ b/uni_modules/uv-ui-tools/components/uv-ui-tools/uv-ui-tools.vue @@ -0,0 +1,6 @@ + + + diff --git a/uni_modules/uv-ui-tools/index.js b/uni_modules/uv-ui-tools/index.js new file mode 100644 index 00000000..71a8b668 --- /dev/null +++ b/uni_modules/uv-ui-tools/index.js @@ -0,0 +1,79 @@ +// 全局挂载引入http相关请求拦截插件 +import Request from './libs/luch-request' + +// 引入全局mixin +import mixin from './libs/mixin/mixin.js' +// 小程序特有的mixin +import mpMixin from './libs/mixin/mpMixin.js' +// #ifdef MP +import mpShare from './libs/mixin/mpShare.js' +// #endif + +// 路由封装 +import route from './libs/util/route.js' +// 公共工具函数 +import * as index from './libs/function/index.js' +// 防抖方法 +import debounce from './libs/function/debounce.js' +// 节流方法 +import throttle from './libs/function/throttle.js' +// 规则检验 +import * as test from './libs/function/test.js' + +// 颜色渐变相关,colorGradient-颜色渐变,hexToRgb-十六进制颜色转rgb颜色,rgbToHex-rgb转十六进制 +import * as colorGradient from './libs/function/colorGradient.js' + +// 配置信息 +import config from './libs/config/config.js' +// 平台 +import platform from './libs/function/platform' + +const $uv = { + route, + config, + test, + date: index.timeFormat, // 另名date + ...index, + colorGradient: colorGradient.colorGradient, + hexToRgb: colorGradient.hexToRgb, + rgbToHex: colorGradient.rgbToHex, + colorToRgba: colorGradient.colorToRgba, + http: new Request(), + debounce, + throttle, + platform, + mixin, + mpMixin +} +uni.$uv = $uv; +const install = (Vue,options={}) => { + // #ifndef APP-NVUE + const cloneMixin = index.deepClone(mixin); + delete cloneMixin?.props?.customClass; + delete cloneMixin?.props?.customStyle; + Vue.mixin(cloneMixin); + // #ifdef MP + if(options.mpShare){ + Vue.mixin(mpShare); + } + // #endif + // #endif + // #ifdef VUE2 + // 时间格式化,同时两个名称,date和timeFormat + Vue.filter('timeFormat', (timestamp, format) => uni.$uv.timeFormat(timestamp, format)); + Vue.filter('date', (timestamp, format) => uni.$uv.timeFormat(timestamp, format)); + // 将多久以前的方法,注入到全局过滤器 + Vue.filter('timeFrom', (timestamp, format) => uni.$uv.timeFrom(timestamp, format)); + // 同时挂载到uni和Vue.prototype中 + // #ifndef APP-NVUE + // 只有vue,挂载到Vue.prototype才有意义,因为nvue中全局Vue.prototype和Vue.mixin是无效的 + Vue.prototype.$uv = $uv; + // #endif + // #endif + // #ifdef VUE3 + Vue.config.globalProperties.$uv = $uv; + // #endif +} +export default { + install +} \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/index.scss b/uni_modules/uv-ui-tools/index.scss new file mode 100644 index 00000000..8d05b8da --- /dev/null +++ b/uni_modules/uv-ui-tools/index.scss @@ -0,0 +1,7 @@ +// 引入公共基础类 +@import "./libs/css/common.scss"; + +// 非nvue的样式 +/* #ifndef APP-NVUE */ +@import "./libs/css/vue.scss"; +/* #endif */ \ No newline at end of file diff --git a/uni_modules/uview-ui/libs/config/config.js b/uni_modules/uv-ui-tools/libs/config/config.js similarity index 51% rename from uni_modules/uview-ui/libs/config/config.js rename to uni_modules/uv-ui-tools/libs/config/config.js index 82b3c696..f18ae740 100644 --- a/uni_modules/uview-ui/libs/config/config.js +++ b/uni_modules/uv-ui-tools/libs/config/config.js @@ -1,9 +1,9 @@ -// 此版本发布于2024-03-17 -const version = '2.0.37' +// 此版本发布于2024-01-20 +const version = '1.1.20' // 开发环境才提示,生产环境不会提示 if (process.env.NODE_ENV === 'development') { - console.log(`\n %c uView V${version} %c https://uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;'); + console.log(`\n %c uvui V${version} https://www.uvui.cn/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;'); } export default { @@ -19,15 +19,15 @@ export default { ], // 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持 color: { - 'u-primary': '#2979ff', - 'u-warning': '#ff9900', - 'u-success': '#19be6b', - 'u-error': '#fa3534', - 'u-info': '#909399', - 'u-main-color': '#303133', - 'u-content-color': '#606266', - 'u-tips-color': '#909399', - 'u-light-color': '#c0c4cc' + 'uv-primary': '#2979ff', + 'uv-warning': '#ff9900', + 'uv-success': '#19be6b', + 'uv-error': '#fa3534', + 'uv-info': '#909399', + 'uv-main-color': '#303133', + 'uv-content-color': '#606266', + 'uv-tips-color': '#909399', + 'uv-light-color': '#c0c4cc' }, // 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx unit: 'px' diff --git a/uni_modules/uv-ui-tools/libs/css/color.scss b/uni_modules/uv-ui-tools/libs/css/color.scss new file mode 100644 index 00000000..ce657434 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/css/color.scss @@ -0,0 +1,32 @@ +$uv-main-color: #303133 !default; +$uv-content-color: #606266 !default; +$uv-tips-color: #909193 !default; +$uv-light-color: #c0c4cc !default; +$uv-border-color: #dadbde !default; +$uv-bg-color: #f3f4f6 !default; +$uv-disabled-color: #c8c9cc !default; + +$uv-primary: #3c9cff !default; +$uv-primary-dark: #398ade !default; +$uv-primary-disabled: #9acafc !default; +$uv-primary-light: #ecf5ff !default; + +$uv-warning: #f9ae3d !default; +$uv-warning-dark: #f1a532 !default; +$uv-warning-disabled: #f9d39b !default; +$uv-warning-light: #fdf6ec !default; + +$uv-success: #5ac725 !default; +$uv-success-dark: #53c21d !default; +$uv-success-disabled: #a9e08f !default; +$uv-success-light: #f5fff0; + +$uv-error: #f56c6c !default; +$uv-error-dark: #e45656 !default; +$uv-error-disabled: #f7b2b2 !default; +$uv-error-light: #fef0f0 !default; + +$uv-info: #909399 !default; +$uv-info-dark: #767a82 !default; +$uv-info-disabled: #c4c6c9 !default; +$uv-info-light: #f4f4f5 !default; diff --git a/uni_modules/uview-ui/libs/css/common.scss b/uni_modules/uv-ui-tools/libs/css/common.scss similarity index 73% rename from uni_modules/uview-ui/libs/css/common.scss rename to uni_modules/uv-ui-tools/libs/css/common.scss index 11f1e531..7ab99f8e 100644 --- a/uni_modules/uview-ui/libs/css/common.scss +++ b/uni_modules/uv-ui-tools/libs/css/common.scss @@ -1,7 +1,7 @@ // 超出行数,自动显示行尾省略号,最多5行 -// 来自uView的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】 +// 来自uvui的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】 @for $i from 1 through 5 { - .u-line-#{$i} { + .uv-line-#{$i} { /* #ifdef APP-NVUE */ // nvue下,可以直接使用lines属性,这是weex特有样式 lines: $i; @@ -27,52 +27,55 @@ /* #endif */ } } - +$uv-bordercolor: #dadbde; +@if variable-exists(uv-border-color) { + $uv-bordercolor: $uv-border-color; +} // 此处加上!important并非随意乱用,而是因为目前*.nvue页面编译到H5时, // App.vue的样式会被uni-app的view元素的自带border属性覆盖,导致无效 // 综上,这是uni-app的缺陷导致我们为了多端兼容,而必须要加上!important // 移动端兼容性较好,直接使用0.5px去实现细边框,不使用伪元素形式实现 -.u-border { +.uv-border { border-width: 0.5px!important; - border-color: $u-border-color!important; + border-color: $uv-bordercolor!important; border-style: solid; } -.u-border-top { +.uv-border-top { border-top-width: 0.5px!important; - border-color: $u-border-color!important; + border-color: $uv-bordercolor!important; border-top-style: solid; } -.u-border-left { +.uv-border-left { border-left-width: 0.5px!important; - border-color: $u-border-color!important; + border-color: $uv-bordercolor!important; border-left-style: solid; } -.u-border-right { +.uv-border-right { border-right-width: 0.5px!important; - border-color: $u-border-color!important; + border-color: $uv-bordercolor!important; border-right-style: solid; } -.u-border-bottom { +.uv-border-bottom { border-bottom-width: 0.5px!important; - border-color: $u-border-color!important; + border-color: $uv-bordercolor!important; border-bottom-style: solid; } -.u-border-top-bottom { +.uv-border-top-bottom { border-top-width: 0.5px!important; border-bottom-width: 0.5px!important; - border-color: $u-border-color!important; + border-color: $uv-bordercolor!important; border-top-style: solid; border-bottom-style: solid; } // 去除button的所有默认样式,让其表现跟普通的view、text元素一样 -.u-reset-button { +.uv-reset-button { padding: 0; background-color: transparent; /* #ifndef APP-PLUS */ @@ -86,12 +89,12 @@ } /* #ifndef APP-NVUE */ -.u-reset-button::after { +.uv-reset-button::after { border: none; } /* #endif */ -.u-hover-class { +.uv-hover-class { opacity: 0.7; } diff --git a/uni_modules/uv-ui-tools/libs/css/components.scss b/uni_modules/uv-ui-tools/libs/css/components.scss new file mode 100644 index 00000000..81ce15d7 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/css/components.scss @@ -0,0 +1,23 @@ +@mixin flex($direction: row) { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: $direction; +} + +/* #ifndef APP-NVUE */ +// 由于uvui是基于nvue环境进行开发的,此环境中普通元素默认为flex-direction: column; +// 所以在非nvue中,需要对元素进行重置为flex-direction: column; 否则可能会表现异常 +$uvui-nvue-style: true !default; +@if $uvui-nvue-style == true { + view, scroll-view, swiper-item { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; + } +} +/* #endif */ diff --git a/uni_modules/uv-ui-tools/libs/css/variable.scss b/uni_modules/uv-ui-tools/libs/css/variable.scss new file mode 100644 index 00000000..63903c97 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/css/variable.scss @@ -0,0 +1,111 @@ +// 超出行数,自动显示行尾省略号,最多5行 +// 来自uvui的温馨提示:当您在控制台看到此报错,说明需要在App.vue的style标签加上【lang="scss"】 +@if variable-exists(show-lines) { + @for $i from 1 through 5 { + .uv-line-#{$i} { + /* #ifdef APP-NVUE */ + // nvue下,可以直接使用lines属性,这是weex特有样式 + lines: $i; + text-overflow: ellipsis; + overflow: hidden; + flex: 1; + /* #endif */ + + /* #ifndef APP-NVUE */ + // vue下,单行和多行显示省略号需要单独处理 + @if $i == '1' { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } @else { + display: -webkit-box!important; + overflow: hidden; + text-overflow: ellipsis; + word-break: break-all; + -webkit-line-clamp: $i; + -webkit-box-orient: vertical!important; + } + /* #endif */ + } + } +} +@if variable-exists(show-border) { + $uv-bordercolor: #dadbde; + @if variable-exists(uv-border-color) { + $uv-bordercolor: $uv-border-color; + } + // 此处加上!important并非随意乱用,而是因为目前*.nvue页面编译到H5时, + // App.vue的样式会被uni-app的view元素的自带border属性覆盖,导致无效 + // 综上,这是uni-app的缺陷导致我们为了多端兼容,而必须要加上!important + // 移动端兼容性较好,直接使用0.5px去实现细边框,不使用伪元素形式实现 + @if variable-exists(show-border-surround) { + .uv-border { + border-width: 0.5px!important; + border-color: $uv-bordercolor!important; + border-style: solid; + } + } + @if variable-exists(show-border-top) { + .uv-border-top { + border-top-width: 0.5px!important; + border-color: $uv-bordercolor!important; + border-top-style: solid; + } + } + @if variable-exists(show-border-left) { + .uv-border-left { + border-left-width: 0.5px!important; + border-color: $uv-bordercolor!important; + border-left-style: solid; + } + } + @if variable-exists(show-border-right) { + .uv-border-right { + border-right-width: 0.5px!important; + border-color: $uv-bordercolor!important; + border-right-style: solid; + } + } + @if variable-exists(show-border-bottom) { + .uv-border-bottom { + border-bottom-width: 0.5px!important; + border-color: $uv-bordercolor!important; + border-bottom-style: solid; + } + } + @if variable-exists(show-border-top-bottom) { + .uv-border-top-bottom { + border-top-width: 0.5px!important; + border-bottom-width: 0.5px!important; + border-color: $uv-bordercolor!important; + border-top-style: solid; + border-bottom-style: solid; + } + } +} +@if variable-exists(show-reset-button) { + // 去除button的所有默认样式,让其表现跟普通的view、text元素一样 + .uv-reset-button { + padding: 0; + background-color: transparent; + /* #ifndef APP-PLUS */ + font-size: inherit; + line-height: inherit; + color: inherit; + /* #endif */ + /* #ifdef APP-NVUE */ + border-width: 0; + /* #endif */ + } + + /* #ifndef APP-NVUE */ + .uv-reset-button::after { + border: none; + } + /* #endif */ +} +@if variable-exists(show-hover) { + .uv-hover-class { + opacity: 0.7; + } +} diff --git a/uni_modules/uview-ui/libs/css/vue.scss b/uni_modules/uv-ui-tools/libs/css/vue.scss similarity index 59% rename from uni_modules/uview-ui/libs/css/vue.scss rename to uni_modules/uv-ui-tools/libs/css/vue.scss index 3ae4d297..bdbefdda 100644 --- a/uni_modules/uview-ui/libs/css/vue.scss +++ b/uni_modules/uv-ui-tools/libs/css/vue.scss @@ -1,13 +1,13 @@ // 历遍生成4个方向的底部安全区 @each $d in top, right, bottom, left { - .u-safe-area-inset-#{$d} { + .uv-safe-area-inset-#{$d} { padding-#{$d}: 0; padding-#{$d}: constant(safe-area-inset-#{$d}); padding-#{$d}: env(safe-area-inset-#{$d}); } } -//提升H5端uni.toast()的层级,避免被uView的modal等遮盖 +//提升H5端uni.toast()的层级,避免被uvui的modal等遮盖 /* #ifdef H5 */ uni-toast { z-index: 10090; @@ -24,4 +24,17 @@ uni-toast .uni-toast { height: 0 !important; -webkit-appearance: none; background: transparent; -} \ No newline at end of file +} + +$uvui-nvue-style: true !default; +@if $uvui-nvue-style == false { + view, scroll-view, swiper-item { + display: flex; + flex-direction: column; + flex-shrink: 0; + flex-grow: 0; + flex-basis: auto; + align-items: stretch; + align-content: flex-start; + } +} diff --git a/uni_modules/uview-ui/libs/function/colorGradient.js b/uni_modules/uv-ui-tools/libs/function/colorGradient.js similarity index 99% rename from uni_modules/uview-ui/libs/function/colorGradient.js rename to uni_modules/uv-ui-tools/libs/function/colorGradient.js index 97277320..55c188fc 100644 --- a/uni_modules/uview-ui/libs/function/colorGradient.js +++ b/uni_modules/uv-ui-tools/libs/function/colorGradient.js @@ -126,7 +126,7 @@ function colorToRgba(color, alpha) { return sColor } -export default { +export { colorGradient, hexToRgb, rgbToHex, diff --git a/uni_modules/uview-ui/libs/function/debounce.js b/uni_modules/uv-ui-tools/libs/function/debounce.js similarity index 100% rename from uni_modules/uview-ui/libs/function/debounce.js rename to uni_modules/uv-ui-tools/libs/function/debounce.js diff --git a/uni_modules/uview-ui/libs/function/digit.js b/uni_modules/uv-ui-tools/libs/function/digit.js similarity index 100% rename from uni_modules/uview-ui/libs/function/digit.js rename to uni_modules/uv-ui-tools/libs/function/digit.js diff --git a/uni_modules/uview-ui/libs/function/index.js b/uni_modules/uv-ui-tools/libs/function/index.js similarity index 91% rename from uni_modules/uview-ui/libs/function/index.js rename to uni_modules/uv-ui-tools/libs/function/index.js index bd80ee7c..b35e0ab6 100644 --- a/uni_modules/uview-ui/libs/function/index.js +++ b/uni_modules/uv-ui-tools/libs/function/index.js @@ -1,4 +1,4 @@ -import test from './test.js' +import { number, empty } from './test.js' import { round } from './digit.js' /** * @description 如果value小于min,取min;如果value大于max,取max @@ -17,7 +17,7 @@ function range(min = 0, max = 0, value = 0) { * @returns {number|string} */ function getPx(value, unit = false) { - if (test.number(value)) { + if (number(value)) { return unit ? `${value}px` : Number(value) } // 如果带有rpx,先取出其数值部分,再转为px值 @@ -28,7 +28,7 @@ function getPx(value, unit = false) { } /** - * @description 进行延时,以达到可以简写代码的目的 比如: await uni.$u.sleep(20)将会阻塞20ms + * @description 进行延时,以达到可以简写代码的目的 比如: await uni.$uv.sleep(20)将会阻塞20ms * @param {number} value 堵塞时间 单位ms 毫秒 * @returns {Promise} 返回promise */ @@ -133,7 +133,7 @@ function $parent(name = undefined) { */ function addStyle(customStyle, target = 'object') { // 字符串转字符串,对象转对象情形,直接返回 - if (test.empty(customStyle) || typeof(customStyle) === 'object' && target === 'object' || target === 'string' && + if (empty(customStyle) || typeof(customStyle) === 'object' && target === 'object' || target === 'string' && typeof(customStyle) === 'string') { return customStyle } @@ -170,10 +170,10 @@ function addStyle(customStyle, target = 'object') { * @param {string|number} value 需要添加单位的值 * @param {string} unit 添加的单位名 比如px */ -function addUnit(value = 'auto', unit = uni?.$u?.config?.unit ?? 'px') { +function addUnit(value = 'auto', unit = uni?.$uv?.config?.unit ? uni?.$uv?.config?.unit : 'px') { value = String(value) - // 用uView内置验证规则中的number判断是否为数值 - return test.number(value) ? `${value}${unit}` : value + // 用uvui内置验证规则中的number判断是否为数值 + return number(value) ? `${value}${unit}` : value } /** @@ -247,7 +247,7 @@ function deepMerge(target = {}, source = {}) { function error(err) { // 开发环境才提示,生产环境不会提示 if (process.env.NODE_ENV === 'development') { - console.error(`uView提示:${err}`) + console.error(`uvui提示:${err}`) } } @@ -293,20 +293,20 @@ if (!String.prototype.padStart) { * @param {String} fmt 格式化规则 yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合 默认yyyy-mm-dd * @returns {string} 返回格式化后的字符串 */ - function timeFormat(dateTime = null, formatStr = 'yyyy-mm-dd') { - let date +function timeFormat(dateTime = null, formatStr = 'yyyy-mm-dd') { + let date // 若传入时间为假值,则取当前时间 - if (!dateTime) { - date = new Date() - } - // 若为unix秒时间戳,则转为毫秒时间戳(逻辑有点奇怪,但不敢改,以保证历史兼容) - else if (/^\d{10}$/.test(dateTime?.toString().trim())) { - date = new Date(dateTime * 1000) - } - // 若用户传入字符串格式时间戳,new Date无法解析,需做兼容 - else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) { - date = new Date(Number(dateTime)) - } + if (!dateTime) { + date = new Date() + } + // 若为unix秒时间戳,则转为毫秒时间戳(逻辑有点奇怪,但不敢改,以保证历史兼容) + else if (/^\d{10}$/.test(dateTime?.toString().trim())) { + date = new Date(dateTime * 1000) + } + // 若用户传入字符串格式时间戳,new Date无法解析,需做兼容 + else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) { + date = new Date(Number(dateTime)) + } // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间 // 处理 '2022-07-10 01:02:03',跳过 '2022-07-10T01:02:03' else if (typeof dateTime === 'string' && dateTime.includes('-') && !dateTime.includes('T')) { @@ -327,16 +327,16 @@ if (!String.prototype.padStart) { // 有其他格式化字符需求可以继续添加,必须转化成字符串 } - for (const key in timeSource) { - const [ret] = new RegExp(`${key}+`).exec(formatStr) || [] - if (ret) { - // 年可能只需展示两位 - const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0 - formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex)) - } - } + for (const key in timeSource) { + const [ret] = new RegExp(`${key}+`).exec(formatStr) || [] + if (ret) { + // 年可能只需展示两位 + const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0 + formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex)) + } + } - return formatStr + return formatStr } /** @@ -568,14 +568,14 @@ function padZero(value) { } /** - * @description 在u-form的子组件内容发生变化,或者失去焦点时,尝试通知u-form执行校验方法 + * @description 在uv-form的子组件内容发生变化,或者失去焦点时,尝试通知uv-form执行校验方法 * @param {*} instance * @param {*} event */ function formValidate(instance, event) { - const formItem = uni.$u.$parent.call(instance, 'u-form-item') - const form = uni.$u.$parent.call(instance, 'u-form') - // 如果发生变化的input或者textarea等,其父组件中有u-form-item或者u-form等,就执行form的validate方法 + const formItem = $parent.call(instance, 'uv-form-item') + const form = $parent.call(instance, 'uv-form') + // 如果发生变化的input或者textarea等,其父组件中有uv-form-item或者uv-form等,就执行form的validate方法 // 同时将form-item的pros传递给form,让其进行精确对象验证 if (formItem && form) { form.validateField(formItem.prop, () => {}, event) @@ -652,9 +652,10 @@ function setProperty(obj, key, value) { * @description 获取当前页面路径 */ function page() { - const pages = getCurrentPages() + const pages = getCurrentPages(); + const route = pages[pages.length - 1]?.route; // 某些特殊情况下(比如页面进行redirectTo时的一些时机),pages可能为空数组 - return `/${pages[pages.length - 1]?.route ?? ''}` + return `/${route ? route : ''}` } /** @@ -675,8 +676,10 @@ function getHistoryPage(back = 0) { return pages[len - 1 + back] } + + /** - * @description 修改uView内置属性值 + * @description 修改uvui内置属性值 * @param {object} props 修改内置props属性 * @param {object} config 修改内置config属性 * @param {object} color 修改内置color属性 @@ -690,14 +693,14 @@ function setConfig({ }) { const { deepMerge, - } = uni.$u - uni.$u.config = deepMerge(uni.$u.config, config) - uni.$u.props = deepMerge(uni.$u.props, props) - uni.$u.color = deepMerge(uni.$u.color, color) - uni.$u.zIndex = deepMerge(uni.$u.zIndex, zIndex) + } = uni.$uv + uni.$uv.config = deepMerge(uni.$uv.config, config) + uni.$uv.props = deepMerge(uni.$uv.props, props) + uni.$uv.color = deepMerge(uni.$uv.color, color) + uni.$uv.zIndex = deepMerge(uni.$uv.zIndex, zIndex) } -export default { +export { range, getPx, sleep, @@ -728,4 +731,4 @@ export default { pages, getHistoryPage, setConfig -} +} \ No newline at end of file diff --git a/uni_modules/uview-ui/libs/function/platform.js b/uni_modules/uv-ui-tools/libs/function/platform.js similarity index 100% rename from uni_modules/uview-ui/libs/function/platform.js rename to uni_modules/uv-ui-tools/libs/function/platform.js diff --git a/uni_modules/uview-ui/libs/function/test.js b/uni_modules/uv-ui-tools/libs/function/test.js similarity index 99% rename from uni_modules/uview-ui/libs/function/test.js rename to uni_modules/uv-ui-tools/libs/function/test.js index c7764371..7c8b7473 100644 --- a/uni_modules/uview-ui/libs/function/test.js +++ b/uni_modules/uv-ui-tools/libs/function/test.js @@ -255,7 +255,7 @@ function regExp(o) { return o && Object.prototype.toString.call(o) === '[object RegExp]' } -export default { +export { email, mobile, url, @@ -273,7 +273,6 @@ export default { range, rangeLength, empty, - isEmpty: empty, jsonString, landline, object, diff --git a/uni_modules/uview-ui/libs/function/throttle.js b/uni_modules/uv-ui-tools/libs/function/throttle.js similarity index 100% rename from uni_modules/uview-ui/libs/function/throttle.js rename to uni_modules/uv-ui-tools/libs/function/throttle.js diff --git a/uni_modules/uv-ui-tools/libs/luch-request/adapters/index.js b/uni_modules/uv-ui-tools/libs/luch-request/adapters/index.js new file mode 100644 index 00000000..31a5cfcf --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/adapters/index.js @@ -0,0 +1,132 @@ +import buildURL from '../helpers/buildURL' +import buildFullPath from '../core/buildFullPath' +import settle from '../core/settle' +import {isUndefined} from "../utils" + +/** + * 返回可选值存在的配置 + * @param {Array} keys - 可选值数组 + * @param {Object} config2 - 配置 + * @return {{}} - 存在的配置项 + */ +const mergeKeys = (keys, config2) => { + let config = {} + keys.forEach(prop => { + if (!isUndefined(config2[prop])) { + config[prop] = config2[prop] + } + }) + return config +} +export default (config) => { + return new Promise((resolve, reject) => { + let fullPath = buildURL(buildFullPath(config.baseURL, config.url), config.params, config.paramsSerializer) + const _config = { + url: fullPath, + header: config.header, + complete: (response) => { + config.fullPath = fullPath + response.config = config + response.rawData = response.data + try { + let jsonParseHandle = false + const forcedJSONParsingType = typeof config.forcedJSONParsing + if (forcedJSONParsingType === 'boolean') { + jsonParseHandle = config.forcedJSONParsing + } else if (forcedJSONParsingType === 'object') { + const includesMethod = config.forcedJSONParsing.include || [] + jsonParseHandle = includesMethod.includes(config.method) + } + + // 对可能字符串不是json 的情况容错 + if (jsonParseHandle && typeof response.data === 'string') { + response.data = JSON.parse(response.data) + } + // eslint-disable-next-line no-empty + } catch (e) { + } + settle(resolve, reject, response) + } + } + let requestTask + if (config.method === 'UPLOAD') { + delete _config.header['content-type'] + delete _config.header['Content-Type'] + let otherConfig = { + // #ifdef MP-ALIPAY + fileType: config.fileType, + // #endif + filePath: config.filePath, + name: config.name + } + const optionalKeys = [ + // #ifdef APP-PLUS || H5 + 'files', + // #endif + // #ifdef H5 + 'file', + // #endif + // #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU + 'timeout', + // #endif + 'formData' + ] + requestTask = uni.uploadFile({..._config, ...otherConfig, ...mergeKeys(optionalKeys, config)}) + } else if (config.method === 'DOWNLOAD') { + const optionalKeys = [ + // #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU + 'timeout', + // #endif + // #ifdef MP + 'filePath', + // #endif + ] + requestTask = uni.downloadFile({..._config, ...mergeKeys(optionalKeys, config)}) + } else { + const optionalKeys = [ + 'data', + 'method', + // #ifdef H5 || APP-PLUS || MP-ALIPAY || MP-WEIXIN + 'timeout', + // #endif + 'dataType', + // #ifndef MP-ALIPAY + 'responseType', + // #endif + // #ifdef APP-PLUS + 'sslVerify', + // #endif + // #ifdef H5 + 'withCredentials', + // #endif + // #ifdef APP-PLUS + 'firstIpv4', + // #endif + // #ifdef MP-WEIXIN + 'enableHttp2', + 'enableQuic', + // #endif + // #ifdef MP-TOUTIAO || MP-WEIXIN + 'enableCache', + // #endif + // #ifdef MP-WEIXIN + 'enableHttpDNS', + 'httpDNSServiceId', + 'enableChunked', + 'forceCellularNetwork', + // #endif + // #ifdef MP-ALIPAY + 'enableCookie', + // #endif + // #ifdef MP-BAIDU + 'cloudCache', + 'defer' + // #endif + ] + requestTask = uni.request({..._config, ...mergeKeys(optionalKeys, config)}) + } + if (config.getTask) { + config.getTask(requestTask, config) + } + }) +} diff --git a/uni_modules/uview-ui/libs/luch-request/core/InterceptorManager.js b/uni_modules/uv-ui-tools/libs/luch-request/core/InterceptorManager.js similarity index 76% rename from uni_modules/uview-ui/libs/luch-request/core/InterceptorManager.js rename to uni_modules/uv-ui-tools/libs/luch-request/core/InterceptorManager.js index 3e8728d4..3ea0d5e8 100644 --- a/uni_modules/uview-ui/libs/luch-request/core/InterceptorManager.js +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/InterceptorManager.js @@ -1,7 +1,8 @@ 'use strict' + function InterceptorManager() { - this.handlers = [] + this.handlers = [] } /** @@ -13,11 +14,11 @@ function InterceptorManager() { * @return {Number} An ID used to remove interceptor later */ InterceptorManager.prototype.use = function use(fulfilled, rejected) { - this.handlers.push({ - fulfilled, - rejected - }) - return this.handlers.length - 1 + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }) + return this.handlers.length - 1 } /** @@ -26,9 +27,9 @@ InterceptorManager.prototype.use = function use(fulfilled, rejected) { * @param {Number} id The ID that was returned by `use` */ InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null - } + if (this.handlers[id]) { + this.handlers[id] = null + } } /** @@ -40,11 +41,11 @@ InterceptorManager.prototype.eject = function eject(id) { * @param {Function} fn The function to call for each interceptor */ InterceptorManager.prototype.forEach = function forEach(fn) { - this.handlers.forEach((h) => { - if (h !== null) { - fn(h) - } - }) + this.handlers.forEach(h => { + if (h !== null) { + fn(h) + } + }) } export default InterceptorManager diff --git a/uni_modules/uv-ui-tools/libs/luch-request/core/Request.js b/uni_modules/uv-ui-tools/libs/luch-request/core/Request.js new file mode 100644 index 00000000..96c89a84 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/Request.js @@ -0,0 +1,201 @@ +/** + * @Class Request + * @description luch-request http请求插件 + * @Author lu-ch + * @Email webwork.s@qq.com + * 文档: https://www.quanzhan.co/luch-request/ + * github: https://github.com/lei-mu/luch-request + * DCloud: http://ext.dcloud.net.cn/plugin?id=392 + */ + + +import dispatchRequest from './dispatchRequest' +import InterceptorManager from './InterceptorManager' +import mergeConfig from './mergeConfig' +import defaults from './defaults' +import { isPlainObject } from '../utils' +import clone from '../utils/clone' + +export default class Request { + /** + * @param {Object} arg - 全局配置 + * @param {String} arg.baseURL - 全局根路径 + * @param {Object} arg.header - 全局header + * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式 + * @param {String} arg.dataType = [json] - 全局默认的dataType + * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。支付宝小程序不支持 + * @param {Object} arg.custom - 全局默认的自定义参数 + * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认60000。H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)、微信小程序(2.10.0)、支付宝小程序 + * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+) + * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+) + * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+) + * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300 + */ + constructor(arg = {}) { + if (!isPlainObject(arg)) { + arg = {} + console.warn('设置全局参数必须接收一个Object') + } + this.config = clone({...defaults, ...arg}) + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + } + } + + /** + * @Function + * @param {Request~setConfigCallback} f - 设置全局默认配置 + */ + setConfig(f) { + this.config = f(this.config) + } + + middleware(config) { + config = mergeConfig(this.config, config) + let chain = [dispatchRequest, undefined] + let promise = Promise.resolve(config) + + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected) + }) + + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected) + }) + + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()) + } + + return promise + } + + /** + * @Function + * @param {Object} config - 请求配置项 + * @prop {String} options.url - 请求路径 + * @prop {Object} options.data - 请求参数 + * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型 + * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse + * @prop {Object} [options.header = config.header] - 请求header + * @prop {Object} [options.method = config.method] - 请求方法 + * @returns {Promise} + */ + request(config = {}) { + return this.middleware(config) + } + + get(url, options = {}) { + return this.middleware({ + url, + method: 'GET', + ...options + }) + } + + post(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'POST', + ...options + }) + } + + // #ifndef MP-ALIPAY || MP-KUAISHOU || MP-JD + put(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'PUT', + ...options + }) + } + + // #endif + + // #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU + delete(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'DELETE', + ...options + }) + } + + // #endif + + // #ifdef H5 || MP-WEIXIN + connect(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'CONNECT', + ...options + }) + } + + // #endif + + // #ifdef H5 || MP-WEIXIN || MP-BAIDU + head(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'HEAD', + ...options + }) + } + + // #endif + + // #ifdef APP-PLUS || H5 || MP-WEIXIN || MP-BAIDU + options(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'OPTIONS', + ...options + }) + } + + // #endif + + // #ifdef H5 || MP-WEIXIN + trace(url, data, options = {}) { + return this.middleware({ + url, + data, + method: 'TRACE', + ...options + }) + } + + // #endif + + upload(url, config = {}) { + config.url = url + config.method = 'UPLOAD' + return this.middleware(config) + } + + download(url, config = {}) { + config.url = url + config.method = 'DOWNLOAD' + return this.middleware(config) + } + + get version () { + return '3.1.0' + } +} + + +/** + * setConfig回调 + * @return {Object} - 返回操作后的config + * @callback Request~setConfigCallback + * @param {Object} config - 全局默认config + */ diff --git a/uni_modules/uview-ui/libs/luch-request/core/buildFullPath.js b/uni_modules/uv-ui-tools/libs/luch-request/core/buildFullPath.js similarity index 81% rename from uni_modules/uview-ui/libs/luch-request/core/buildFullPath.js rename to uni_modules/uv-ui-tools/libs/luch-request/core/buildFullPath.js index 5eb8a177..f2852f46 100644 --- a/uni_modules/uview-ui/libs/luch-request/core/buildFullPath.js +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/buildFullPath.js @@ -13,8 +13,8 @@ import combineURLs from '../helpers/combineURLs' * @returns {string} The combined full path */ export default function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL) - } - return requestedURL + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL) + } + return requestedURL } diff --git a/uni_modules/uv-ui-tools/libs/luch-request/core/defaults.js b/uni_modules/uv-ui-tools/libs/luch-request/core/defaults.js new file mode 100644 index 00000000..db74609f --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/defaults.js @@ -0,0 +1,33 @@ +/** + * 默认的全局配置 + */ + + +export default { + baseURL: '', + header: {}, + method: 'GET', + dataType: 'json', + paramsSerializer: null, + // #ifndef MP-ALIPAY + responseType: 'text', + // #endif + custom: {}, + // #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU + timeout: 60000, + // #endif + // #ifdef APP-PLUS + sslVerify: true, + // #endif + // #ifdef H5 + withCredentials: false, + // #endif + // #ifdef APP-PLUS + firstIpv4: false, + // #endif + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300 + }, + // 是否尝试将响应数据json化 + forcedJSONParsing: true +} diff --git a/uni_modules/uv-ui-tools/libs/luch-request/core/dispatchRequest.js b/uni_modules/uv-ui-tools/libs/luch-request/core/dispatchRequest.js new file mode 100644 index 00000000..c5f2c85c --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/dispatchRequest.js @@ -0,0 +1,6 @@ +import adapter from '../adapters/index' + + +export default (config) => { + return adapter(config) +} diff --git a/uni_modules/uv-ui-tools/libs/luch-request/core/mergeConfig.js b/uni_modules/uv-ui-tools/libs/luch-request/core/mergeConfig.js new file mode 100644 index 00000000..99c8ecd9 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/mergeConfig.js @@ -0,0 +1,126 @@ +import {deepMerge, isUndefined} from '../utils' + +/** + * 合并局部配置优先的配置,如果局部有该配置项则用局部,如果全局有该配置项则用全局 + * @param {Array} keys - 配置项 + * @param {Object} globalsConfig - 当前的全局配置 + * @param {Object} config2 - 局部配置 + * @return {{}} + */ +const mergeKeys = (keys, globalsConfig, config2) => { + let config = {} + keys.forEach(prop => { + if (!isUndefined(config2[prop])) { + config[prop] = config2[prop] + } else if (!isUndefined(globalsConfig[prop])) { + config[prop] = globalsConfig[prop] + } + }) + return config +} +/** + * + * @param globalsConfig - 当前实例的全局配置 + * @param config2 - 当前的局部配置 + * @return - 合并后的配置 + */ +export default (globalsConfig, config2 = {}) => { + const method = config2.method || globalsConfig.method || 'GET' + let config = { + baseURL: config2.baseURL || globalsConfig.baseURL || '', + method: method, + url: config2.url || '', + params: config2.params || {}, + custom: {...(globalsConfig.custom || {}), ...(config2.custom || {})}, + header: deepMerge(globalsConfig.header || {}, config2.header || {}) + } + const defaultToConfig2Keys = ['getTask', 'validateStatus', 'paramsSerializer', 'forcedJSONParsing'] + config = {...config, ...mergeKeys(defaultToConfig2Keys, globalsConfig, config2)} + + // eslint-disable-next-line no-empty + if (method === 'DOWNLOAD') { + const downloadKeys = [ + // #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU + 'timeout', + // #endif + // #ifdef MP + 'filePath', + // #endif + ] + config = {...config, ...mergeKeys(downloadKeys, globalsConfig, config2)} + } else if (method === 'UPLOAD') { + delete config.header['content-type'] + delete config.header['Content-Type'] + const uploadKeys = [ + // #ifdef APP-PLUS || H5 + 'files', + // #endif + // #ifdef MP-ALIPAY + 'fileType', + // #endif + // #ifdef H5 + 'file', + // #endif + 'filePath', + 'name', + // #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU + 'timeout', + // #endif + 'formData', + ] + uploadKeys.forEach(prop => { + if (!isUndefined(config2[prop])) { + config[prop] = config2[prop] + } + }) + // #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU + if (isUndefined(config.timeout) && !isUndefined(globalsConfig.timeout)) { + config['timeout'] = globalsConfig['timeout'] + } + // #endif + } else { + const defaultsKeys = [ + 'data', + // #ifdef H5 || APP-PLUS || MP-ALIPAY || MP-WEIXIN + 'timeout', + // #endif + 'dataType', + // #ifndef MP-ALIPAY + 'responseType', + // #endif + // #ifdef APP-PLUS + 'sslVerify', + // #endif + // #ifdef H5 + 'withCredentials', + // #endif + // #ifdef APP-PLUS + 'firstIpv4', + // #endif + // #ifdef MP-WEIXIN + 'enableHttp2', + 'enableQuic', + // #endif + // #ifdef MP-TOUTIAO || MP-WEIXIN + 'enableCache', + // #endif + // #ifdef MP-WEIXIN + 'enableHttpDNS', + 'httpDNSServiceId', + 'enableChunked', + 'forceCellularNetwork', + // #endif + // #ifdef MP-ALIPAY + 'enableCookie', + // #endif + // #ifdef MP-BAIDU + 'cloudCache', + 'defer' + // #endif + + ] + config = {...config, ...mergeKeys(defaultsKeys, globalsConfig, config2)} + } + + return config +} diff --git a/uni_modules/uview-ui/libs/luch-request/core/settle.js b/uni_modules/uv-ui-tools/libs/luch-request/core/settle.js similarity index 57% rename from uni_modules/uview-ui/libs/luch-request/core/settle.js rename to uni_modules/uv-ui-tools/libs/luch-request/core/settle.js index 8d3638ff..b2f16592 100644 --- a/uni_modules/uview-ui/libs/luch-request/core/settle.js +++ b/uni_modules/uv-ui-tools/libs/luch-request/core/settle.js @@ -6,11 +6,11 @@ * @param {object} response The response. */ export default function settle(resolve, reject, response) { - const { validateStatus } = response.config - const status = response.statusCode - if (status && (!validateStatus || validateStatus(status))) { - resolve(response) - } else { - reject(response) - } + const validateStatus = response.config.validateStatus + const status = response.statusCode + if (status && (!validateStatus || validateStatus(status))) { + resolve(response) + } else { + reject(response) + } } diff --git a/uni_modules/uv-ui-tools/libs/luch-request/helpers/buildURL.js b/uni_modules/uv-ui-tools/libs/luch-request/helpers/buildURL.js new file mode 100644 index 00000000..e90b908e --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/helpers/buildURL.js @@ -0,0 +1,64 @@ +'use strict' + +import * as utils from './../utils' + +function encode(val) { + return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']') +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +export default function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url + } + + var serializedParams + if (paramsSerializer) { + serializedParams = paramsSerializer(params) + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString() + } else { + var parts = [] + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return + } + + if (utils.isArray(val)) { + key = key + '[]' + } else { + val = [val] + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString() + } else if (utils.isObject(v)) { + v = JSON.stringify(v) + } + parts.push(encode(key) + '=' + encode(v)) + }) + }) + + serializedParams = parts.join('&') + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#') + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex) + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams + } + + return url +} diff --git a/uni_modules/uview-ui/libs/luch-request/helpers/combineURLs.js b/uni_modules/uv-ui-tools/libs/luch-request/helpers/combineURLs.js similarity index 69% rename from uni_modules/uview-ui/libs/luch-request/helpers/combineURLs.js rename to uni_modules/uv-ui-tools/libs/luch-request/helpers/combineURLs.js index ac7c124c..7b9d1efd 100644 --- a/uni_modules/uview-ui/libs/luch-request/helpers/combineURLs.js +++ b/uni_modules/uv-ui-tools/libs/luch-request/helpers/combineURLs.js @@ -8,7 +8,7 @@ * @returns {string} The combined URL */ export default function combineURLs(baseURL, relativeURL) { - return relativeURL - ? `${baseURL.replace(/\/+$/, '')}/${relativeURL.replace(/^\/+/, '')}` - : baseURL + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL } diff --git a/uni_modules/uv-ui-tools/libs/luch-request/helpers/isAbsoluteURL.js b/uni_modules/uv-ui-tools/libs/luch-request/helpers/isAbsoluteURL.js new file mode 100644 index 00000000..2a82517d --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict' + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +export default function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url) +} diff --git a/uni_modules/uv-ui-tools/libs/luch-request/index.d.ts b/uni_modules/uv-ui-tools/libs/luch-request/index.d.ts new file mode 100644 index 00000000..62d3fb9e --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/luch-request/index.d.ts @@ -0,0 +1,197 @@ +export type HttpTask = UniApp.RequestTask | UniApp.UploadTask | UniApp.DownloadTask; + +export type HttpRequestTask = UniApp.RequestTask; + +export type HttpUploadTask = UniApp.UploadTask; + +export type HttpDownloadTask = UniApp.DownloadTask; + +export type HttpMethod = + "GET" + | "POST" + | "PUT" + | "DELETE" + | "CONNECT" + | "HEAD" + | "OPTIONS" + | "TRACE" + | "UPLOAD" + | "DOWNLOAD"; + +export type HttpRequestHeader = Record; + +export type HttpParams = Record; + +export type HttpData = Record; + +export type HttpResponseType = 'arraybuffer' | 'text'; + +export type HttpCustom = Record; + +export type HttpFileType = 'image' | 'video' | 'audio'; + +export type HttpFormData = Record; + +export type HttpResponseHeader = Record & { + "set-cookie"?: string[] +}; + +export interface HttpRequestConfig { + /** @desc 请求服务器接口地址 */ + url?: string; + /** @desc 请求方式,默认为 GET */ + method?: HttpMethod; + /** @desc 请求基地址 */ + baseURL?: string; + /** @desc 请求头信息,不能设置 Referer,App、H5 端会自动带上 cookie,且 H5 端不可手动修改 */ + header?: HttpRequestHeader; + /** @desc 请求查询参数,自动拼接为查询字符串 */ + params?: HttpParams; + /** @desc 请求体参数 */ + data?: HttpData; + /** @desc 超时时间,单位 ms,默认为 60000,仅 H5 (HBuilderX 2.9.9+)、APP (HBuilderX 2.9.9+)、微信小程序 (2.10.0)、支付宝小程序支持 */ + timeout?: number; + /** @desc 跨域请求时是否携带凭证 (cookies),默认为 false,仅 H5 (HBuilderX 2.6.15+) 支持 */ + withCredentials?: boolean; + /** @desc 设置响应的数据类型,支付宝小程序不支持 */ + responseType?: HttpResponseType; + /** @desc 全局自定义验证器 */ + validateStatus?: ((statusCode: number) => boolean) | null; + + + /** params 参数自定义处理 */ + paramsSerializer?: (params: AnyObject) => string | void; + + /** @desc 默认为 json,如果设为 json,会尝试对返回的数据做一次 JSON.parse */ + dataType?: string; + /** @desc DNS 解析时是否优先使用 ipv4,默认为 false,仅 App-Android (HBuilderX 2.8.0+) 支持 */ + firstIpv4?: boolean; + /** @desc 是否验证 SSL 证书,默认为 true,仅 App-Android (HBuilderX 2.3.3+) 支持 */ + sslVerify?: boolean; + + /** @desc 开启 http2;微信小程序 */ + enableHttp2?: boolean; + + /** @desc 开启 quic;微信小程序 */ + enableQuic?: boolean; + /** @desc 开启 cache;微信小程序、字节跳动小程序 2.31.0+ */ + enableCache?: boolean; + /** @desc 开启 httpDNS;微信小程序 */ + enableHttpDNS?: boolean; + /** @desc httpDNS 服务商;微信小程序 */ + httpDNSServiceId?: string; + /** @desc 开启 transfer-encoding chunked;微信小程序 */ + enableChunked?: boolean; + /** @desc wifi下使用移动网络发送请求;微信小程序 */ + forceCellularNetwork?: boolean; + /** @desc 开启后可在headers中编辑cookie;支付宝小程序 10.2.33+ */ + enableCookie?: boolean; + /** @desc 是否开启云加速;百度小程序 3.310.11+ */ + cloudCache?: boolean | object; + /** @desc 控制当前请求是否延时至首屏内容渲染后发送;百度小程序 3.310.11+ */ + defer?: boolean; + + /** @desc 自定义参数 */ + custom?: HttpCustom; + + /** @desc 返回当前请求的 task 和 options,不要在这里修改 options */ + getTask?: (task: T, options: HttpRequestConfig) => void; + + /** @desc 需要上传的文件列表,使用 files 时,filePath 和 name 不生效,仅支持 App、H5 (2.6.15+) */ + files?: { name?: string; file?: File; uri: string; }[]; + /** @desc 文件类型,仅支付宝小程序支持且为必填项 */ + fileType?: HttpFileType; + /** @desc 要上传的文件对象,仅 H5 (2.6.15+) 支持 */ + file?: File; + /** @desc 要上传文件资源的路径,使用 files 时,filePath 和 name 不生效 */ + filePath?: string; + /** @desc 文件对应的 key,开发者在服务器端通过这个 key 可以获取到文件二进制内容,使用 files 时,filePath 和 name 不生效 */ + name?: string; + /** @desc 请求中其他额外的 form data */ + formData?: HttpFormData; +} + +export interface HttpResponse { + data: T; + statusCode: number; + header: HttpResponseHeader; + config: HttpRequestConfig; + cookies: string[]; + errMsg: string; + rawData: any; +} + +export interface HttpUploadResponse { + data: T; + statusCode: number; + config: HttpRequestConfig; + errMsg: string; + rawData: any; +} + +export interface HttpDownloadResponse extends HttpResponse { + tempFilePath: string; + apFilePath?: string; + filePath?: string; + fileContent?: string; +} + +export interface HttpError { + data?: T; + statusCode?: number; + header?: HttpResponseHeader; + config: HttpRequestConfig; + cookies?: string[]; + errMsg: string; +} + +export interface HttpPromise extends Promise> { +} + +export interface HttpInterceptorManager { + use(onFulfilled?: (value: V) => V | Promise, onRejected?: (error: E) => T | Promise): void; + + eject(id: number): void; +} + +export abstract class HttpRequestAbstract { + constructor(config?: HttpRequestConfig); + + interceptors: { + request: HttpInterceptorManager; + response: HttpInterceptorManager; + } + + request, D = HttpRequestTask>(config: HttpRequestConfig): Promise; + + get, D = HttpRequestTask>(url: string, config?: HttpRequestConfig): Promise; + + delete, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + head, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + options, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + post, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + put, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + config: HttpRequestConfig; + + setConfig(onSend: (config: HttpRequestConfig) => HttpRequestConfig): void; + + connect, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + trace, D = HttpRequestTask>(url: string, data?: HttpData, config?: HttpRequestConfig): Promise; + + upload, D = HttpUploadTask>(url: string, config?: HttpRequestConfig): Promise; + + download, D = HttpDownloadTask>(url: string, config?: HttpRequestConfig): Promise; + + middleware, D = HttpTask>(config: HttpRequestConfig): Promise; +} + +declare class HttpRequest extends HttpRequestAbstract { +} + +export default HttpRequest; diff --git a/uni_modules/uview-ui/libs/luch-request/index.js b/uni_modules/uv-ui-tools/libs/luch-request/index.js similarity index 98% rename from uni_modules/uview-ui/libs/luch-request/index.js rename to uni_modules/uv-ui-tools/libs/luch-request/index.js index 8fb2b44c..d8fe348f 100644 --- a/uni_modules/uview-ui/libs/luch-request/index.js +++ b/uni_modules/uv-ui-tools/libs/luch-request/index.js @@ -1,3 +1,2 @@ import Request from './core/Request' - export default Request diff --git a/uni_modules/uview-ui/libs/luch-request/utils.js b/uni_modules/uv-ui-tools/libs/luch-request/utils.js similarity index 52% rename from uni_modules/uview-ui/libs/luch-request/utils.js rename to uni_modules/uv-ui-tools/libs/luch-request/utils.js index 847283d5..0b5bf210 100644 --- a/uni_modules/uview-ui/libs/luch-request/utils.js +++ b/uni_modules/uv-ui-tools/libs/luch-request/utils.js @@ -2,7 +2,7 @@ // utils is a library of generic helper functions non-specific to axios -const { toString } = Object.prototype +var toString = Object.prototype.toString /** * Determine if a value is an Array @@ -10,18 +10,19 @@ const { toString } = Object.prototype * @param {Object} val The value to test * @returns {boolean} True if value is an Array, otherwise false */ -export function isArray(val) { - return toString.call(val) === '[object Array]' +export function isArray (val) { + return toString.call(val) === '[object Array]' } + /** * Determine if a value is an Object * * @param {Object} val The value to test * @returns {boolean} True if value is an Object, otherwise false */ -export function isObject(val) { - return val !== null && typeof val === 'object' +export function isObject (val) { + return val !== null && typeof val === 'object' } /** @@ -30,8 +31,8 @@ export function isObject(val) { * @param {Object} val The value to test * @returns {boolean} True if value is a Date, otherwise false */ -export function isDate(val) { - return toString.call(val) === '[object Date]' +export function isDate (val) { + return toString.call(val) === '[object Date]' } /** @@ -40,10 +41,11 @@ export function isDate(val) { * @param {Object} val The value to test * @returns {boolean} True if value is a URLSearchParams object, otherwise false */ -export function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams +export function isURLSearchParams (val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams } + /** * Iterate over an Array or an Object invoking a function for each item. * @@ -56,31 +58,31 @@ export function isURLSearchParams(val) { * @param {Object|Array} obj The object to iterate * @param {Function} fn The callback to invoke for each item */ -export function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return - } +export function forEach (obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return + } - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /* eslint no-param-reassign:0 */ - obj = [obj] - } + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj] + } - if (isArray(obj)) { + if (isArray(obj)) { // Iterate over array values - for (let i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj) - } - } else { - // Iterate over object keys - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj) - } - } + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj) } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj) + } + } + } } /** @@ -89,7 +91,7 @@ export function forEach(obj, fn) { * @returns {boolean} */ export function isBoolean(val) { - return typeof val === 'boolean' + return typeof val === 'boolean' } /** @@ -98,9 +100,11 @@ export function isBoolean(val) { * @returns {boolean} */ export function isPlainObject(obj) { - return Object.prototype.toString.call(obj) === '[object Object]' + return Object.prototype.toString.call(obj) === '[object Object]' } + + /** * Function equal to merge with the difference being that no reference * to original objects is kept. @@ -110,22 +114,22 @@ export function isPlainObject(obj) { * @returns {Object} Result of all merge properties */ export function deepMerge(/* obj1, obj2, obj3, ... */) { - const result = {} - function assignValue(val, key) { - if (typeof result[key] === 'object' && typeof val === 'object') { - result[key] = deepMerge(result[key], val) - } else if (typeof val === 'object') { - result[key] = deepMerge({}, val) - } else { - result[key] = val - } + let result = {} + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = deepMerge(result[key], val) + } else if (typeof val === 'object') { + result[key] = deepMerge({}, val) + } else { + result[key] = val } - for (let i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue) - } - return result + } + for (let i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue) + } + return result } -export function isUndefined(val) { - return typeof val === 'undefined' +export function isUndefined (val) { + return typeof val === 'undefined' } diff --git a/uni_modules/uview-ui/libs/luch-request/utils/clone.js b/uni_modules/uv-ui-tools/libs/luch-request/utils/clone.js similarity index 100% rename from uni_modules/uview-ui/libs/luch-request/utils/clone.js rename to uni_modules/uv-ui-tools/libs/luch-request/utils/clone.js diff --git a/uni_modules/uview-ui/libs/mixin/button.js b/uni_modules/uv-ui-tools/libs/mixin/button.js similarity index 100% rename from uni_modules/uview-ui/libs/mixin/button.js rename to uni_modules/uv-ui-tools/libs/mixin/button.js diff --git a/uni_modules/uv-ui-tools/libs/mixin/mixin.js b/uni_modules/uv-ui-tools/libs/mixin/mixin.js new file mode 100644 index 00000000..0dd3b03b --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/mixin/mixin.js @@ -0,0 +1,172 @@ +import * as index from '../function/index.js'; +import * as test from '../function/test.js'; +import route from '../util/route.js'; +import debounce from '../function/debounce.js'; +import throttle from '../function/throttle.js'; +export default { + // 定义每个组件都可能需要用到的外部样式以及类名 + props: { + // 每个组件都有的父组件传递的样式,可以为字符串或者对象形式 + customStyle: { + type: [Object, String], + default: () => ({}) + }, + customClass: { + type: String, + default: '' + }, + // 跳转的页面路径 + url: { + type: String, + default: '' + }, + // 页面跳转的类型 + linkType: { + type: String, + default: 'navigateTo' + } + }, + data() { + return {} + }, + onLoad() { + // getRect挂载到$uv上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出 + this.$uv.getRect = this.$uvGetRect + }, + created() { + // 组件当中,只有created声明周期,为了能在组件使用,故也在created中将方法挂载到$uv + this.$uv.getRect = this.$uvGetRect + }, + computed: { + $uv() { + return { + ...index, + test, + route, + debounce, + throttle, + unit: uni?.$uv?.config?.unit + } + }, + /** + * 生成bem规则类名 + * 由于微信小程序,H5,nvue之间绑定class的差异,无法通过:class="[bem()]"的形式进行同用 + * 故采用如下折中做法,最后返回的是数组(一般平台)或字符串(支付宝和字节跳动平台),类似['a', 'b', 'c']或'a b c'的形式 + * @param {String} name 组件名称 + * @param {Array} fixed 一直会存在的类名 + * @param {Array} change 会根据变量值为true或者false而出现或者隐藏的类名 + * @returns {Array|string} + */ + bem() { + return function(name, fixed, change) { + // 类名前缀 + const prefix = `uv-${name}--` + const classes = {} + if (fixed) { + fixed.map((item) => { + // 这里的类名,会一直存在 + classes[prefix + this[item]] = true + }) + } + if (change) { + change.map((item) => { + // 这里的类名,会根据this[item]的值为true或者false,而进行添加或者移除某一个类 + this[item] ? (classes[prefix + item] = this[item]) : (delete classes[prefix + item]) + }) + } + return Object.keys(classes) + // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效 + // #ifdef MP-ALIPAY || MP-TOUTIAO || MP-LARK || MP-BAIDU + .join(' ') + // #endif + } + } + }, + methods: { + // 跳转某一个页面 + openPage(urlKey = 'url') { + const url = this[urlKey] + if (url) { + // 执行类似uni.navigateTo的方法 + uni[this.linkType]({ + url + }) + } + }, + // 查询节点信息 + // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21) + // 解决办法为在组件根部再套一个没有任何作用的view元素 + $uvGetRect(selector, all) { + return new Promise((resolve) => { + uni.createSelectorQuery() + .in(this)[all ? 'selectAll' : 'select'](selector) + .boundingClientRect((rect) => { + if (all && Array.isArray(rect) && rect.length) { + resolve(rect) + } + if (!all && rect) { + resolve(rect) + } + }) + .exec() + }) + }, + getParentData(parentName = '') { + // 避免在created中去定义parent变量 + if (!this.parent) this.parent = {} + // 这里的本质原理是,通过获取父组件实例(也即类似uv-radio的父组件uv-radio-group的this) + // 将父组件this中对应的参数,赋值给本组件(uv-radio的this)的parentData对象中对应的属性 + // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化 + // 此处并不会自动更新子组件的数据,而是依赖父组件uv-radio-group去监听data的变化,手动调用更新子组件的方法去重新获取 + this.parent = this.$uv.$parent.call(this, parentName) + if (this.parent.children) { + // 如果父组件的children不存在本组件的实例,才将本实例添加到父组件的children中 + this.parent.children.indexOf(this) === -1 && this.parent.children.push(this) + } + if (this.parent && this.parentData) { + // 历遍parentData中的属性,将parent中的同名属性赋值给parentData + Object.keys(this.parentData).map((key) => { + this.parentData[key] = this.parent[key] + }) + } + }, + // 阻止事件冒泡 + preventEvent(e) { + e && typeof(e.stopPropagation) === 'function' && e.stopPropagation() + }, + // 空操作 + noop(e) { + this.preventEvent(e) + } + }, + onReachBottom() { + uni.$emit('uvOnReachBottom') + }, + beforeDestroy() { + // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况 + // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱 + if (this.parent && test.array(this.parent.children)) { + // 组件销毁时,移除父组件中的children数组中对应的实例 + const childrenList = this.parent.children + childrenList.map((child, index) => { + // 如果相等,则移除 + if (child === this) { + childrenList.splice(index, 1) + } + }) + } + }, + // 兼容vue3 + unmounted() { + if (this.parent && test.array(this.parent.children)) { + // 组件销毁时,移除父组件中的children数组中对应的实例 + const childrenList = this.parent.children + childrenList.map((child, index) => { + // 如果相等,则移除 + if (child === this) { + childrenList.splice(index, 1) + } + }) + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js b/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js new file mode 100644 index 00000000..90b6903c --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js @@ -0,0 +1,8 @@ +export default { + // #ifdef MP-WEIXIN + // 将自定义节点设置成虚拟的(去掉自定义组件包裹层),更加接近Vue组件的表现,能更好的使用flex属性 + options: { + virtualHost: true + } + // #endif +} \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/libs/mixin/mpShare.js b/uni_modules/uv-ui-tools/libs/mixin/mpShare.js new file mode 100644 index 00000000..c9695a03 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/mixin/mpShare.js @@ -0,0 +1,13 @@ +export default { + onLoad() { + // 设置默认的转发参数 + uni.$uv.mpShare = { + title: '', // 默认为小程序名称 + path: '', // 默认为当前页面路径 + imageUrl: '' // 默认为当前页面的截图 + } + }, + onShareAppMessage() { + return uni.$uv.mpShare + } +} \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/libs/mixin/openType.js b/uni_modules/uv-ui-tools/libs/mixin/openType.js new file mode 100644 index 00000000..1b94b7e0 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/mixin/openType.js @@ -0,0 +1,47 @@ +export default { + props: { + openType: String + }, + emits: ['getphonenumber','getuserinfo','error','opensetting','launchapp','contact','chooseavatar','addgroupapp','chooseaddress','subscribe','login','im'], + methods: { + onGetPhoneNumber(event) { + this.$emit('getphonenumber', event.detail) + }, + onGetUserInfo(event) { + this.$emit('getuserinfo', event.detail) + }, + onError(event) { + this.$emit('error', event.detail) + }, + onOpenSetting(event) { + this.$emit('opensetting', event.detail) + }, + onLaunchApp(event) { + this.$emit('launchapp', event.detail) + }, + onContact(event) { + this.$emit('contact', event.detail) + }, + onChooseavatar(event) { + this.$emit('chooseavatar', event.detail) + }, + onAgreeprivacyauthorization(event) { + this.$emit('agreeprivacyauthorization', event.detail) + }, + onAddgroupapp(event) { + this.$emit('addgroupapp', event.detail) + }, + onChooseaddress(event) { + this.$emit('chooseaddress', event.detail) + }, + onSubscribe(event) { + this.$emit('subscribe', event.detail) + }, + onLogin(event) { + this.$emit('login', event.detail) + }, + onIm(event) { + this.$emit('im', event.detail) + } + } +} diff --git a/uni_modules/uview-ui/libs/mixin/touch.js b/uni_modules/uv-ui-tools/libs/mixin/touch.js similarity index 100% rename from uni_modules/uview-ui/libs/mixin/touch.js rename to uni_modules/uv-ui-tools/libs/mixin/touch.js diff --git a/uni_modules/uv-ui-tools/libs/util/dayjs.js b/uni_modules/uv-ui-tools/libs/util/dayjs.js new file mode 100644 index 00000000..c84ab687 --- /dev/null +++ b/uni_modules/uv-ui-tools/libs/util/dayjs.js @@ -0,0 +1,216 @@ +var __getOwnPropNames = Object.getOwnPropertyNames; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; + +var require_dayjs_min = __commonJS({ + "uvuidayjs"(exports, module) { + !function(t, e) { + "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e(); + }(exports, function() { + "use strict"; + var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) { + var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100; + return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]"; + } }, m = function(t2, e2, n2) { + var r2 = String(t2); + return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2; + }, v = { s: m, z: function(t2) { + var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60; + return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0"); + }, m: function t2(e2, n2) { + if (e2.date() < n2.date()) + return -t2(n2, e2); + var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f); + return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0); + }, a: function(t2) { + return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2); + }, p: function(t2) { + return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, ""); + }, u: function(t2) { + return void 0 === t2; + } }, g = "en", D = {}; + D[g] = M; + var p = function(t2) { + return t2 instanceof _; + }, S = function t2(e2, n2, r2) { + var i2; + if (!e2) + return g; + if ("string" == typeof e2) { + var s2 = e2.toLowerCase(); + D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2); + var u2 = e2.split("-"); + if (!i2 && u2.length > 1) + return t2(u2[0]); + } else { + var a2 = e2.name; + D[a2] = e2, i2 = a2; + } + return !r2 && i2 && (g = i2), i2 || !r2 && g; + }, w = function(t2, e2) { + if (p(t2)) + return t2.clone(); + var n2 = "object" == typeof e2 ? e2 : {}; + return n2.date = t2, n2.args = arguments, new _(n2); + }, O = v; + O.l = S, O.i = p, O.w = function(t2, e2) { + return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset }); + }; + var _ = function() { + function M2(t2) { + this.$L = S(t2.locale, null, true), this.parse(t2); + } + var m2 = M2.prototype; + return m2.parse = function(t2) { + this.$d = function(t3) { + var e2 = t3.date, n2 = t3.utc; + if (null === e2) + return new Date(NaN); + if (O.u(e2)) + return new Date(); + if (e2 instanceof Date) + return new Date(e2); + if ("string" == typeof e2 && !/Z$/i.test(e2)) { + var r2 = e2.match($); + if (r2) { + var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3); + return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2); + } + } + return new Date(e2); + }(t2), this.$x = t2.x || {}, this.init(); + }, m2.init = function() { + var t2 = this.$d; + this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds(); + }, m2.$utils = function() { + return O; + }, m2.isValid = function() { + return !(this.$d.toString() === l); + }, m2.isSame = function(t2, e2) { + var n2 = w(t2); + return this.startOf(e2) <= n2 && n2 <= this.endOf(e2); + }, m2.isAfter = function(t2, e2) { + return w(t2) < this.startOf(e2); + }, m2.isBefore = function(t2, e2) { + return this.endOf(e2) < w(t2); + }, m2.$g = function(t2, e2, n2) { + return O.u(t2) ? this[e2] : this.set(n2, t2); + }, m2.unix = function() { + return Math.floor(this.valueOf() / 1e3); + }, m2.valueOf = function() { + return this.$d.getTime(); + }, m2.startOf = function(t2, e2) { + var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), l2 = function(t3, e3) { + var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2); + return r2 ? i2 : i2.endOf(a); + }, $2 = function(t3, e3) { + return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2); + }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : ""); + switch (h2) { + case c: + return r2 ? l2(1, 0) : l2(31, 11); + case f: + return r2 ? l2(1, M3) : l2(0, M3 + 1); + case o: + var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2; + return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3); + case a: + case d: + return $2(v2 + "Hours", 0); + case u: + return $2(v2 + "Minutes", 1); + case s: + return $2(v2 + "Seconds", 2); + case i: + return $2(v2 + "Milliseconds", 3); + default: + return this.clone(); + } + }, m2.endOf = function(t2) { + return this.startOf(t2, false); + }, m2.$set = function(t2, e2) { + var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2; + if (o2 === f || o2 === c) { + var y2 = this.clone().set(d, 1); + y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d; + } else + l2 && this.$d[l2]($2); + return this.init(), this; + }, m2.set = function(t2, e2) { + return this.clone().$set(t2, e2); + }, m2.get = function(t2) { + return this[O.p(t2)](); + }, m2.add = function(r2, h2) { + var d2, l2 = this; + r2 = Number(r2); + var $2 = O.p(h2), y2 = function(t2) { + var e2 = w(l2); + return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2); + }; + if ($2 === f) + return this.set(f, this.$M + r2); + if ($2 === c) + return this.set(c, this.$y + r2); + if ($2 === a) + return y2(1); + if ($2 === o) + return y2(7); + var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3; + return O.w(m3, this); + }, m2.subtract = function(t2, e2) { + return this.add(-1 * t2, e2); + }, m2.format = function(t2) { + var e2 = this, n2 = this.$locale(); + if (!this.isValid()) + return n2.invalidDate || l; + var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) { + return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3); + }, c2 = function(t3) { + return O.s(s2 % 12 || 12, t3, "0"); + }, d2 = n2.meridiem || function(t3, e3, n3) { + var r3 = t3 < 12 ? "AM" : "PM"; + return n3 ? r3.toLowerCase() : r3; + }, $2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 }; + return r2.replace(y, function(t3, e3) { + return e3 || $2[t3] || i2.replace(":", ""); + }); + }, m2.utcOffset = function() { + return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); + }, m2.diff = function(r2, d2, l2) { + var $2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, v2 = this - M3, g2 = O.m(this, M3); + return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f] = g2, $2[h] = g2 / 3, $2[o] = (v2 - m3) / 6048e5, $2[a] = (v2 - m3) / 864e5, $2[u] = v2 / n, $2[s] = v2 / e, $2[i] = v2 / t, $2)[y2] || v2, l2 ? g2 : O.a(g2); + }, m2.daysInMonth = function() { + return this.endOf(f).$D; + }, m2.$locale = function() { + return D[this.$L]; + }, m2.locale = function(t2, e2) { + if (!t2) + return this.$L; + var n2 = this.clone(), r2 = S(t2, e2, true); + return r2 && (n2.$L = r2), n2; + }, m2.clone = function() { + return O.w(this.$d, this); + }, m2.toDate = function() { + return new Date(this.valueOf()); + }, m2.toJSON = function() { + return this.isValid() ? this.toISOString() : null; + }, m2.toISOString = function() { + return this.$d.toISOString(); + }, m2.toString = function() { + return this.$d.toUTCString(); + }, M2; + }(), T = _.prototype; + return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) { + T[t2[1]] = function(e2) { + return this.$g(e2, t2[0], t2[1]); + }; + }), w.extend = function(t2, e2) { + return t2.$i || (t2(e2, _, w), t2.$i = true), w; + }, w.locale = S, w.isDayjs = p, w.unix = function(t2) { + return w(1e3 * t2); + }, w.en = D[g], w.Ls = D, w.p = {}, w; + }); + } +}); +export default require_dayjs_min(); diff --git a/uni_modules/uview-ui/libs/util/route.js b/uni_modules/uv-ui-tools/libs/util/route.js similarity index 81% rename from uni_modules/uview-ui/libs/util/route.js rename to uni_modules/uv-ui-tools/libs/util/route.js index 2afeea5c..80c0afd5 100644 --- a/uni_modules/uview-ui/libs/util/route.js +++ b/uni_modules/uv-ui-tools/libs/util/route.js @@ -2,7 +2,7 @@ * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷 * 并且带有路由拦截功能 */ - +import { queryParams, deepMerge, page } from '@/uni_modules/uv-ui-tools/libs/function/index.js' class Router { constructor() { // 原始属性定义 @@ -13,7 +13,8 @@ class Router { params: {}, // 传递的参数 animationType: 'pop-in', // 窗口动画,只在APP有效 animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效 - intercept: false // 是否需要拦截 + intercept: false ,// 是否需要拦截 + events: {} // 页面间通信接口,用于监听被打开页面发送到当前页面的数据。hbuilderx 2.8.9+ 开始支持。 } // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文 // 这里在构造函数中进行this绑定 @@ -34,12 +35,12 @@ class Router { let query = '' if (/.*\/.*\?.*=.*/.test(url)) { // object对象转为get类型的参数 - query = uni.$u.queryParams(params, false) + query = queryParams(params, false) // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开 return url += `&${query}` } // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号 - query = uni.$u.queryParams(params) + query = queryParams(params) return url += query } @@ -53,26 +54,25 @@ class Router { mergeConfig.url = this.mixinParam(options, params) mergeConfig.type = 'navigateTo' } else { - mergeConfig = uni.$u.deepMerge(this.config, options) + mergeConfig = deepMerge(this.config, options) // 否则正常使用mergeConfig中的url和params进行拼接 mergeConfig.url = this.mixinParam(options.url, options.params) } - // 如果本次跳转的路径和本页面路径一致,不执行跳转,防止用户快速点击跳转按钮,造成多次跳转同一个页面的问题 - if (mergeConfig.url === uni.$u.page()) return + if (mergeConfig.url === page()) return if (params.intercept) { - this.config.intercept = params.intercept + mergeConfig.intercept = params.intercept } // params参数也带给拦截器 mergeConfig.params = params // 合并内外部参数 - mergeConfig = uni.$u.deepMerge(this.config, mergeConfig) + mergeConfig = deepMerge(this.config, mergeConfig) // 判断用户是否定义了拦截器 - if (typeof uni.$u.routeIntercept === 'function') { + if (typeof mergeConfig.intercept === 'function') { // 定一个promise,根据用户执行resolve(true)或者resolve(false)来决定是否进行路由跳转 const isNext = await new Promise((resolve, reject) => { - uni.$u.routeIntercept(mergeConfig, resolve) + mergeConfig.intercept(mergeConfig, resolve) }) // 如果isNext为true,则执行路由跳转 isNext && this.openPage(mergeConfig) @@ -89,13 +89,15 @@ class Router { type, delta, animationType, - animationDuration + animationDuration, + events } = config if (config.type == 'navigateTo' || config.type == 'to') { uni.navigateTo({ url, animationType, - animationDuration + animationDuration, + events }) } if (config.type == 'redirectTo' || config.type == 'redirect') { @@ -121,4 +123,4 @@ class Router { } } -export default (new Router()).route +export default (new Router()).route \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/package.json b/uni_modules/uv-ui-tools/package.json new file mode 100644 index 00000000..32da21c5 --- /dev/null +++ b/uni_modules/uv-ui-tools/package.json @@ -0,0 +1,81 @@ +{ + "id": "uv-ui-tools", + "displayName": "uv-ui-tools 工具集 全面兼容vue3+2、app、h5、小程序等多端", + "version": "1.1.24", + "description": "uv-ui-tools,集成工具库,强大的Http请求封装,清晰的文档说明,开箱即用。方便使用,可以全局使用", + "keywords": [ + "uv-ui-tools,uv-ui组件库,工具集,uvui,uView2.x" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "y" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "y", + "阿里": "y", + "百度": "y", + "字节跳动": "y", + "QQ": "y", + "钉钉": "y", + "快手": "y", + "飞书": "y", + "京东": "y" + }, + "快应用": { + "华为": "y", + "联盟": "y" + } + } + } + } +} \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/readme.md b/uni_modules/uv-ui-tools/readme.md new file mode 100644 index 00000000..79a7df5e --- /dev/null +++ b/uni_modules/uv-ui-tools/readme.md @@ -0,0 +1,23 @@ +## uv-ui-tools 工具集 + +> **组件名:uv-ui-tools** + +uv-ui工具集成,包括网络Http请求、便捷工具、节流防抖、对象操作、时间格式化、路由跳转、全局唯一标识符、规则校验等等。 + +该组件推荐配合[uv-ui组件库](https://www.uvui.cn/components/intro.html)使用,单独下载也可以在自己项目中使用,需要做相应的配置,可查看文档。强烈推荐使用[uv-ui组件库](https://www.uvui.cn/components/intro.html),导入组件都会自动导入`uv-ui-tools`。需要在自己的项目中使用请参考[扩展配置](https://www.uvui.cn/components/setting.html)。 + +uv-ui破釜沉舟之兼容vue3+2、app、h5、多端小程序的uni-app生态框架,大部分组件基于uView2.x,在经过改进后全面支持vue3,部分组件做了进一步的优化,修复大量BUG,支持单独导入,方便开发者选择导入需要的组件。开箱即用,灵活配置。 + +# 查看文档 + +## [下载完整示例项目](https://ext.dcloud.net.cn/plugin?name=uv-ui) (请不要 下载插件ZIP) + +### [更多插件,请关注uv-ui组件库](https://ext.dcloud.net.cn/plugin?name=uv-ui) + + + +![image](https://mp-a667b617-c5f1-4a2d-9a54-683a67cff588.cdn.bspapp.com/uv-ui/banner.png) + + + +#### 如使用过程中有任何问题反馈,或者您对uv-ui有一些好的建议,欢迎加入uv-ui官方交流群:官方QQ群 \ No newline at end of file diff --git a/uni_modules/uv-ui-tools/theme.scss b/uni_modules/uv-ui-tools/theme.scss new file mode 100644 index 00000000..cfaae92f --- /dev/null +++ b/uni_modules/uv-ui-tools/theme.scss @@ -0,0 +1,43 @@ +// 此文件为uvUI的主题变量,这些变量目前只能通过uni.scss引入才有效,另外由于 +// uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中,造成微信程序包太大, +// 故uni.scss只建议放scss变量名相关样式,其他的样式可以通过main.js或者App.vue引入 + +$uv-main-color: #303133; +$uv-content-color: #606266; +$uv-tips-color: #909193; +$uv-light-color: #c0c4cc; +$uv-border-color: #dadbde; +$uv-bg-color: #f3f4f6; +$uv-disabled-color: #c8c9cc; + +$uv-primary: #3c9cff; +$uv-primary-dark: #398ade; +$uv-primary-disabled: #9acafc; +$uv-primary-light: #ecf5ff; + +$uv-warning: #f9ae3d; +$uv-warning-dark: #f1a532; +$uv-warning-disabled: #f9d39b; +$uv-warning-light: #fdf6ec; + +$uv-success: #5ac725; +$uv-success-dark: #53c21d; +$uv-success-disabled: #a9e08f; +$uv-success-light: #f5fff0; + +$uv-error: #f56c6c; +$uv-error-dark: #e45656; +$uv-error-disabled: #f7b2b2; +$uv-error-light: #fef0f0; + +$uv-info: #909399; +$uv-info-dark: #767a82; +$uv-info-disabled: #c4c6c9; +$uv-info-light: #f4f4f5; + +@mixin flex($direction: row) { + /* #ifndef APP-NVUE */ + display: flex; + /* #endif */ + flex-direction: $direction; +} \ No newline at end of file diff --git a/uni_modules/uview-ui/LICENSE b/uni_modules/uview-ui/LICENSE deleted file mode 100644 index 4db40efe..00000000 --- a/uni_modules/uview-ui/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 www.uviewui.com - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/uni_modules/uview-ui/README.md b/uni_modules/uview-ui/README.md deleted file mode 100644 index c78ff479..00000000 --- a/uni_modules/uview-ui/README.md +++ /dev/null @@ -1,66 +0,0 @@ -

- logo -

-

uView 2.0

-

多平台快速开发的UI框架

- -[![stars](https://img.shields.io/github/stars/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0) -[![forks](https://img.shields.io/github/forks/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0) -[![issues](https://img.shields.io/github/issues/umicro/uView2.0?style=flat-square&logo=GitHub)](https://github.com/umicro/uView2.0/issues) -[![Website](https://img.shields.io/badge/uView-up-blue?style=flat-square)](https://uviewui.com) -[![release](https://img.shields.io/github/v/release/umicro/uView2.0?style=flat-square)](https://gitee.com/umicro/uView2.0/releases) -[![license](https://img.shields.io/github/license/umicro/uView2.0?style=flat-square)](https://en.wikipedia.org/wiki/MIT_License) - -## 说明 - -uView UI,是[uni-app](https://uniapp.dcloud.io/)全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水 - -## [官方文档:https://uviewui.com](https://uviewui.com) - - -## 预览 - -您可以通过**微信**扫码,查看最佳的演示效果。 -
-
- - - -## 链接 - -- [官方文档](https://www.uviewui.com/) -- [更新日志](https://www.uviewui.com/components/changelog.html) -- [升级指南](https://www.uviewui.com/components/changeGuide.html) -- [关于我们](https://www.uviewui.com/cooperation/about.html) - -## 交流反馈 - -欢迎加入我们的QQ群交流反馈:[点此跳转](https://www.uviewui.com/components/addQQGroup.html) - -## 关于PR - -> 我们非常乐意接受各位的优质PR,但在此之前我希望您了解uView2.0是一个需要兼容多个平台的(小程序、h5、ios app、android app)包括nvue页面、vue页面。 -> 所以希望在您修复bug并提交之前尽可能的去这些平台测试一下兼容性。最好能携带测试截图以方便审核。非常感谢! - -## 安装 - -#### **uni-app插件市场链接** —— [https://ext.dcloud.net.cn/plugin?id=1593](https://ext.dcloud.net.cn/plugin?id=1593) - -请通过[官网安装文档](https://www.uviewui.com/components/install.html)了解更详细的内容 - -## 快速上手 - -请通过[快速上手](https://uviewui.com/components/quickstart.html)了解更详细的内容 - -## 使用方法 -配置easycom规则后,自动按需引入,无需`import`组件,直接引用即可。 - -```html - -``` - -## 版权信息 -uView遵循[MIT](https://en.wikipedia.org/wiki/MIT_License)开源协议,意味着您无需支付任何费用,也无需授权,即可将uView应用到您的产品中。 - diff --git a/uni_modules/uview-ui/changelog.md b/uni_modules/uview-ui/changelog.md deleted file mode 100644 index 73bb66d3..00000000 --- a/uni_modules/uview-ui/changelog.md +++ /dev/null @@ -1,376 +0,0 @@ -## 2.0.38(2024-06-12) -插件市场处理 -## 2.0.37(2024-03-17) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复表单校验`trigger`触发器参数无效问题 -2. 修复`u-input`组件的`password`属性在动态切换为`false`时失效的问题 -3. 添加微信小程序用户同意隐私协议事件回调 -4. 修复支付宝小程序picker样式问题 -5. `u-modal`添加`duration`字段控制动画过度时间 -6. 修复`picker` `lastIndex`异常导致的`column`异常问题 -7. `tabs`增加长按事件支持 -8. 修复`u-avatar` `square`属性在小程序`open-data`下无效问题 -9. 其他一些修复 -## 2.0.36(2023-03-27) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 重构`deepClone` & `deepMerge`方法 -2. 其他优化 -## 2.0.34(2022-09-24) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. `u-input`、`u-textarea`增加`ignoreCompositionEvent`属性 -2. 修复`route`方法调用可能报错的问题 -3. 修复`u-no-network`组件`z-index`无效的问题 -4. 修复`textarea`组件在h5上confirmType=""报错的问题 -5. `u-rate`适配`nvue` -6. 优化验证手机号码的正则表达式(根据工信部发布的《电信网编号计划(2017年版)》进行修改。) -7. `form-item`添加`labelPosition`属性 -8. `u-calendar`修复`maxDate`设置为当前日期,并且当前时间大于08:00时无法显示日期列表的问题 (#724) -9. `u-radio`增加一个默认插槽用于自定义修改label内容 (#680) -10. 修复`timeFormat`函数在safari重的兼容性问题 (#664) -## 2.0.33(2022-06-17) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复`loadmore`组件`lineColor`类型错误问题 -2. 修复`u-parse`组件`imgtap`、`linktap`不生效问题 -## 2.0.32(2022-06-16) -# uView2.0重磅发布,利剑出鞘,一统江湖 -1. `u-loadmore`新增自定义颜色、虚/实线 -2. 修复`u-swiper-action`组件部分平台不能上下滑动的问题 -3. 修复`u-list`回弹问题 -4. 修复`notice-bar`组件动画在低端安卓机可能会抖动的问题 -5. `u-loading-page`添加控制图标大小的属性`iconSize` -6. 修复`u-tooltip`组件`color`参数不生效的问题 -7. 修复`u--input`组件使用`blur`事件输出为`undefined`的bug -8. `u-code-input`组件新增键盘弹起时,是否自动上推页面参数`adjustPosition` -9. 修复`image`组件`load`事件无回调对象问题 -10. 修复`button`组件`loadingSize`设置无效问题 -10. 其他修复 -## 2.0.31(2022-04-19) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复`upload`在`vue`页面上传成功后没有成功标志的问题 -2. 解决演示项目中微信小程序模拟上传图片一直出于上传中问题 -3. 修复`u-code-input`组件在`nvue`页面编译到`app`平台上光标异常问题(`app`去除此功能) -4. 修复`actionSheet`组件标题关闭按钮点击事件名称错误的问题 -5. 其他修复 -## 2.0.30(2022-04-04) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. `u-rate`增加`readonly`属性 -2. `tabs`滑块支持设置背景图片 -3. 修复`u-subsection` `mode`为`subsection`时,滑块样式不正确的问题 -4. `u-code-input`添加光标效果动画 -5. 修复`popup`的`open`事件不触发 -6. 修复`u-flex-column`无效的问题 -7. 修复`u-datetime-picker`索引在特定场合异常问题 -8. 修复`u-datetime-picker`最小时间字符串模板错误问题 -9. `u-swiper`添加`m3u8`验证 -10. `u-swiper`修改判断image和video逻辑 -11. 修复`swiper`无法使用本地图片问题,增加`type`参数 -12. 修复`u-row-notice`格式错误问题 -13. 修复`u-switch`组件当`unit`为`rpx`时,`nodeStyle`消失的问题 -14. 修复`datetime-picker`组件`showToolbar`与`visibleItemCount`属性无效的问题 -15. 修复`upload`组件条件编译位置判断错误,导致`previewImage`属性设置为`false`时,整个组件都会被隐藏的问题 -16. 修复`u-checkbox-group`设置`shape`属性无效的问题 -17. 修复`u-upload`的`capture`传入字符串的时候不生效的问题 -18. 修复`u-action-sheet`组件,关闭事件逻辑错误的问题 -19. 修复`u-list`触顶事件的触发错误的问题 -20. 修复`u-text`只有手机号可拨打的问题 -21. 修复`u-textarea`不能换行的问题 -22. 其他修复 -## 2.0.29(2022-03-13) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复`u--text`组件设置`decoration`属性未生效的问题 -2. 修复`u-datetime-picker`使用`formatter`后返回值不正确 -3. 修复`u-datetime-picker` `intercept` 可能为undefined -4. 修复已设置单位 uni..config.unit = 'rpx'时,线型指示器 `transform` 的位置翻倍,导致指示器超出宽度 -5. 修复mixin中bem方法生成的类名在支付宝和字节小程序中失效 -6. 修复默认值传值为空的时候,打开`u-datetime-picker`报错,不能选中第一列时间的bug -7. 修复`u-datetime-picker`使用`formatter`后返回值不正确 -8. 修复`u-image`组件`loading`无效果的问题 -9. 修复`config.unit`属性设为`rpx`时,导航栏占用高度不足导致塌陷的问题 -10. 修复`u-datetime-picker`组件`itemHeight`无效问题 -11. 其他修复 -## 2.0.28(2022-02-22) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. search组件新增searchIconSize属性 -2. 兼容Safari/Webkit中传入时间格式如2022-02-17 12:00:56 -3. 修复text value.js 判断日期出format错误问题 -4. priceFormat格式化金额出现精度错误 -5. priceFormat在部分情况下出现精度损失问题 -6. 优化表单rules提示 -7. 修复avatar组件src为空时,展示状态不对 -8. 其他修复 -## 2.0.27(2022-01-28) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1.样式修复 -## 2.0.26(2022-01-28) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1.样式修复 -## 2.0.25(2022-01-27) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复text组件mode=price时,可能会导致精度错误的问题 -2. 添加$u.setConfig()方法,可设置uView内置的config, props, zIndex, color属性,详见:[修改uView内置配置方案](https://uviewui.com/components/setting.html#%E9%BB%98%E8%AE%A4%E5%8D%95%E4%BD%8D%E9%85%8D%E7%BD%AE) -3. 优化form组件在errorType=toast时,如果输入错误页面会有抖动的问题 -4. 修复$u.addUnit()对配置默认单位可能无效的问题 -## 2.0.24(2022-01-25) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复swiper在current指定非0时缩放有误 -2. 修复u-icon添加stop属性的时候报错 -3. 优化遗留的通过正则判断rpx单位的问题 -4. 优化Layout布局 vue使用gutter时,会超出固定区域 -5. 优化search组件高度单位问题(rpx -> px) -6. 修复u-image slot 加载和错误的图片失去了高度 -7. 修复u-index-list中footer插槽与header插槽存在性判断错误 -8. 修复部分机型下u-popup关闭时会闪烁 -9. 修复u-image在nvue-app下失去宽高 -10. 修复u-popup运行报错 -11. 修复u-tooltip报错 -12. 修复box-sizing在app下的警告 -13. 修复u-navbar在小程序中报运行时错误 -14. 其他修复 -## 2.0.23(2022-01-24) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复image组件在hx3.3.9的nvue下可能会显示异常的问题 -2. 修复col组件gutter参数带rpx单位处理不正确的问题 -3. 修复text组件单行时无法显示省略号的问题 -4. navbar添加titleStyle参数 -5. 升级到hx3.3.9可消除nvue下控制台样式警告的问题 -## 2.0.22(2022-01-19) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. $u.page()方法优化,避免在特殊场景可能报错的问题 -2. picker组件添加immediateChange参数 -3. 新增$u.pages()方法 -## 2.0.21(2022-01-19) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 优化:form组件在用户设置rules的时候提示用户model必传 -2. 优化遗留的通过正则判断rpx单位的问题 -3. 修复微信小程序环境中tabbar组件开启safeAreaInsetBottom属性后,placeholder高度填充不正确 -4. 修复swiper在current指定非0时缩放有误 -5. 修复u-icon添加stop属性的时候报错 -6. 修复upload组件在accept=all的时候没有作用 -7. 修复在text组件mode为phone时call属性无效的问题 -8. 处理u-form clearValidate方法 -9. 其他修复 -## 2.0.20(2022-01-14) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复calendar默认会选择一个日期,如果直接点确定的话,无法取到值的问题 -2. 修复Slider缺少disabled props 还有注释 -3. 修复u-notice-bar点击事件无法拿到index索引值的问题 -4. 修复u-collapse-item在vue文件下,app端自定义插槽不生效的问题 -5. 优化头像为空时显示默认头像 -6. 修复图片地址赋值后判断加载状态为完成问题 -7. 修复日历滚动到默认日期月份区域 -8. search组件暴露点击左边icon事件 -9. 修复u-form clearValidate方法不生效 -10. upload h5端增加返回文件参数(文件的name参数) -11. 处理upload选择文件后url为blob类型无法预览的问题 -12. u-code-input 修复输入框没有往左移出一半屏幕 -13. 修复Upload上传 disabled为true时,控制台报hoverClass类型错误 -14. 临时处理ios app下grid点击坍塌问题 -15. 其他修复 -## 2.0.19(2021-12-29) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 优化微信小程序包体积可在微信中预览,请升级HbuilderX3.3.4,同时在“运行->运行到小程序模拟器”中勾选“运行时是否压缩代码” -2. 优化微信小程序setData性能,处理某些方法如$u.route()无法在模板中使用的问题 -3. navbar添加autoBack参数 -4. 允许avatar组件的事件冒泡 -5. 修复cell组件报错问题 -6. 其他修复 -## 2.0.18(2021-12-28) -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复app端编译报错问题 -2. 重新处理微信小程序端setData过大的性能问题 -3. 修复边框问题 -4. 修复最大最小月份不大于0则没有数据出现的问题 -5. 修复SwipeAction微信小程序端无法上下滑动问题 -6. 修复input的placeholder在小程序端默认显示为true问题 -7. 修复divider组件click事件无效问题 -8. 修复u-code-input maxlength 属性值为 String 类型时显示异常 -9. 修复当 grid只有 1到2时 在小程序端algin设置无效的问题 -10. 处理form-item的label为top时,取消错误提示的左边距 -11. 其他修复 -## 2.0.17(2021-12-26) -## uView正在参与开源中国的“年度最佳项目”评选,之前投过票的现在也可以投票,恳请同学们投一票,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 解决HBuilderX3.3.3.20211225版本导致的样式问题 -2. calendar日历添加monthNum参数 -3. navbar添加center slot -## 2.0.16(2021-12-25) -## uView正在参与开源中国的“年度最佳项目”评选,之前投过票的现在也可以投票,恳请同学们投一票,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 解决微信小程序setData性能问题 -2. 修复count-down组件change事件不触发问题 -## 2.0.15(2021-12-21) -## uView正在参与开源中国的“年度最佳项目”评选,之前投过票的现在也可以投票,恳请同学们投一票,[点此帮助uView](https://www.oschina.net/project/top_cn_2021/?id=583) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复Cell单元格titleWidth无效 -2. 修复cheakbox组件ischecked不更新 -3. 修复keyboard是否显示"."按键默认值问题 -4. 修复number-keyboard是否显示键盘的"."符号问题 -5. 修复Input输入框 readonly无效 -6. 修复u-avatar 导致打包app、H5时候报错问题 -7. 修复Upload上传deletable无效 -8. 修复upload当设置maxSize时无效的问题 -9. 修复tabs lineWidth传入带单位的字符串的时候偏移量计算错误问题 -10. 修复rate组件在有padding的view内,显示的星星位置和可触摸区域不匹配,无法正常选中星星 -## 2.0.13(2021-12-14) -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复配置默认单位为rpx可能会导致自定义导航栏高度异常的问题 -## 2.0.12(2021-12-14) -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复tabs组件在vue环境下划线消失的问题 -2. 修复upload组件在安卓小程序无法选择视频的问题 -3. 添加uni.$u.config.unit配置,用于配置参数默认单位,详见:[默认单位配置](https://www.uviewui.com/components/setting.html#%E9%BB%98%E8%AE%A4%E5%8D%95%E4%BD%8D%E9%85%8D%E7%BD%AE) -4. 修复textarea组件在没绑定v-model时,字符统计不生效问题 -5. 修复nvue下控制是否出现滚动条失效问题 -## 2.0.11(2021-12-13) -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. text组件align参数无效的问题 -2. subsection组件添加keyName参数 -3. upload组件无法判断[Object file]类型的问题 -4. 处理notify层级过低问题 -5. codeInput组件添加disabledDot参数 -6. 处理actionSheet组件round参数无效的问题 -7. calendar组件添加round参数用于控制圆角值 -8. 处理swipeAction组件在vue环境下默认被打开的问题 -9. button组件的throttleTime节流参数无效的问题 -10. 解决u-notify手动关闭方法close()无效的问题 -11. input组件readonly不生效问题 -12. tag组件type参数为info不生效问题 -## 2.0.10(2021-12-08) -## [点击加群交流反馈:364463526](https://jq.qq.com/?_chanwv=1027&k=mCxS3TGY) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复button sendMessagePath属性不生效 -2. 修复DatetimePicker选择器title无效 -3. 修复u-toast设置loading=true不生效 -4. 修复u-text金额模式传0报错 -5. 修复u-toast组件的icon属性配置不生效 -6. button的icon在特殊场景下的颜色优化 -7. IndexList优化,增加# -## 2.0.9(2021-12-01) -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 优化swiper的height支持100%值(仅vue有效),修复嵌入视频时click事件无法触发的问题 -2. 优化tabs组件对list值为空的判断,或者动态变化list时重新计算相关尺寸的问题 -3. 优化datetime-picker组件逻辑,让其后续打开的默认值为上一次的选中值,需要通过v-model绑定值才有效 -4. 修复upload内嵌在其他组件中,选择图片可能不会换行的问题 -## 2.0.8(2021-12-01) -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复toast的position参数无效问题 -2. 处理input在ios nvue上无法获得焦点的问题 -3. avatar-group组件添加extraValue参数,让剩余展示数量可手动控制 -4. tabs组件添加keyName参数用于配置从对象中读取的键名 -5. 处理text组件名字脱敏默认配置无效的问题 -6. 处理picker组件item文本太长换行问题 -## 2.0.7(2021-11-30) -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 修复radio和checkbox动态改变v-model无效的问题。 -2. 优化form规则validator在微信小程序用法 -3. 修复backtop组件mode参数在微信小程序无效的问题 -4. 处理Album的previewFullImage属性无效的问题 -5. 处理u-datetime-picker组件mode='time'在选择改变时间时,控制台报错的问题 -## 2.0.6(2021-11-27) -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. 处理tag组件在vue下边框无效的问题。 -2. 处理popup组件圆角参数可能无效的问题。 -3. 处理tabs组件lineColor参数可能无效的问题。 -4. propgress组件在值很小时,显示异常的问题。 -## 2.0.5(2021-11-25) -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. calendar在vue下显示异常问题。 -2. form组件labelPosition和errorType参数无效的问题 -3. input组件inputAlign无效的问题 -4. 其他一些修复 -## 2.0.4(2021-11-23) -## [点击加群交流反馈:232041042](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -0. input组件缺失@confirm事件,以及subfix和prefix无效问题 -1. component.scss文件样式在vue下干扰全局布局问题 -2. 修复subsection在vue环境下表现异常的问题 -3. tag组件的bgColor等参数无效的问题 -4. upload组件不换行的问题 -5. 其他的一些修复处理 -## 2.0.3(2021-11-16) -## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. uView2.0已实现全面兼容nvue -2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升 -3. 目前uView2.0为公测阶段,相关细节可能会有变动 -4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html) -5. 处理modal的confirm回调事件拼写错误问题 -6. 处理input组件@input事件参数错误问题 -7. 其他一些修复 -## 2.0.2(2021-11-16) -## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. uView2.0已实现全面兼容nvue -2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升 -3. 目前uView2.0为公测阶段,相关细节可能会有变动 -4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html) -5. 修复input组件formatter参数缺失问题 -6. 优化loading-icon组件的scss写法问题,防止不兼容新版本scss -## 2.0.0(2020-11-15) -## [点击加群交流反馈:1129077272](https://jq.qq.com/?_wv=1027&k=KnbeceDU) - -# uView2.0重磅发布,利剑出鞘,一统江湖 - -1. uView2.0已实现全面兼容nvue -2. uView2.0对1.x进行了架构重构,细节和性能都有极大提升 -3. 目前uView2.0为公测阶段,相关细节可能会有变动 -4. 我们写了一份与1.x的对比指南,详见[对比1.x](https://www.uviewui.com/components/diff1.x.html) -5. 修复input组件formatter参数缺失问题 - - diff --git a/uni_modules/uview-ui/components/u--form/u--form.vue b/uni_modules/uview-ui/components/u--form/u--form.vue deleted file mode 100644 index d534ece0..00000000 --- a/uni_modules/uview-ui/components/u--form/u--form.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/uni_modules/uview-ui/components/u--image/u--image.vue b/uni_modules/uview-ui/components/u--image/u--image.vue deleted file mode 100644 index 21b7ab19..00000000 --- a/uni_modules/uview-ui/components/u--image/u--image.vue +++ /dev/null @@ -1,47 +0,0 @@ - - - \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u--input/u--input.vue b/uni_modules/uview-ui/components/u--input/u--input.vue deleted file mode 100644 index 1e58b010..00000000 --- a/uni_modules/uview-ui/components/u--input/u--input.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u--text/u--text.vue b/uni_modules/uview-ui/components/u--text/u--text.vue deleted file mode 100644 index 44ee52a3..00000000 --- a/uni_modules/uview-ui/components/u--text/u--text.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - diff --git a/uni_modules/uview-ui/components/u--textarea/u--textarea.vue b/uni_modules/uview-ui/components/u--textarea/u--textarea.vue deleted file mode 100644 index f4df0b9a..00000000 --- a/uni_modules/uview-ui/components/u--textarea/u--textarea.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/uni_modules/uview-ui/components/u-action-sheet/props.js b/uni_modules/uview-ui/components/u-action-sheet/props.js deleted file mode 100644 index e96e04fd..00000000 --- a/uni_modules/uview-ui/components/u-action-sheet/props.js +++ /dev/null @@ -1,54 +0,0 @@ -export default { - props: { - // 操作菜单是否展示 (默认false) - show: { - type: Boolean, - default: uni.$u.props.actionSheet.show - }, - // 标题 - title: { - type: String, - default: uni.$u.props.actionSheet.title - }, - // 选项上方的描述信息 - description: { - type: String, - default: uni.$u.props.actionSheet.description - }, - // 数据 - actions: { - type: Array, - default: uni.$u.props.actionSheet.actions - }, - // 取消按钮的文字,不为空时显示按钮 - cancelText: { - type: String, - default: uni.$u.props.actionSheet.cancelText - }, - // 点击某个菜单项时是否关闭弹窗 - closeOnClickAction: { - type: Boolean, - default: uni.$u.props.actionSheet.closeOnClickAction - }, - // 处理底部安全区(默认true) - safeAreaInsetBottom: { - type: Boolean, - default: uni.$u.props.actionSheet.safeAreaInsetBottom - }, - // 小程序的打开方式 - openType: { - type: String, - default: uni.$u.props.actionSheet.openType - }, - // 点击遮罩是否允许关闭 (默认true) - closeOnClickOverlay: { - type: Boolean, - default: uni.$u.props.actionSheet.closeOnClickOverlay - }, - // 圆角值 - round: { - type: [Boolean, String, Number], - default: uni.$u.props.actionSheet.round - } - } -} diff --git a/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue b/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue deleted file mode 100644 index 26d5d8d9..00000000 --- a/uni_modules/uview-ui/components/u-action-sheet/u-action-sheet.vue +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - diff --git a/uni_modules/uview-ui/components/u-album/props.js b/uni_modules/uview-ui/components/u-album/props.js deleted file mode 100644 index 75cdb37d..00000000 --- a/uni_modules/uview-ui/components/u-album/props.js +++ /dev/null @@ -1,59 +0,0 @@ -export default { - props: { - // 图片地址,Array|Array形式 - urls: { - type: Array, - default: uni.$u.props.album.urls - }, - // 指定从数组的对象元素中读取哪个属性作为图片地址 - keyName: { - type: String, - default: uni.$u.props.album.keyName - }, - // 单图时,图片长边的长度 - singleSize: { - type: [String, Number], - default: uni.$u.props.album.singleSize - }, - // 多图时,图片边长 - multipleSize: { - type: [String, Number], - default: uni.$u.props.album.multipleSize - }, - // 多图时,图片水平和垂直之间的间隔 - space: { - type: [String, Number], - default: uni.$u.props.album.space - }, - // 单图时,图片缩放裁剪的模式 - singleMode: { - type: String, - default: uni.$u.props.album.singleMode - }, - // 多图时,图片缩放裁剪的模式 - multipleMode: { - type: String, - default: uni.$u.props.album.multipleMode - }, - // 最多展示的图片数量,超出时最后一个位置将会显示剩余图片数量 - maxCount: { - type: [String, Number], - default: uni.$u.props.album.maxCount - }, - // 是否可以预览图片 - previewFullImage: { - type: Boolean, - default: uni.$u.props.album.previewFullImage - }, - // 每行展示图片数量,如设置,singleSize和multipleSize将会无效 - rowCount: { - type: [String, Number], - default: uni.$u.props.album.rowCount - }, - // 超出maxCount时是否显示查看更多的提示 - showMore: { - type: Boolean, - default: uni.$u.props.album.showMore - } - } -} diff --git a/uni_modules/uview-ui/components/u-album/u-album.vue b/uni_modules/uview-ui/components/u-album/u-album.vue deleted file mode 100644 index 687e2d52..00000000 --- a/uni_modules/uview-ui/components/u-album/u-album.vue +++ /dev/null @@ -1,259 +0,0 @@ - - - - - \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u-alert/props.js b/uni_modules/uview-ui/components/u-alert/props.js deleted file mode 100644 index 4297e2c3..00000000 --- a/uni_modules/uview-ui/components/u-alert/props.js +++ /dev/null @@ -1,44 +0,0 @@ -export default { - props: { - // 显示文字 - title: { - type: String, - default: uni.$u.props.alert.title - }, - // 主题,success/warning/info/error - type: { - type: String, - default: uni.$u.props.alert.type - }, - // 辅助性文字 - description: { - type: String, - default: uni.$u.props.alert.description - }, - // 是否可关闭 - closable: { - type: Boolean, - default: uni.$u.props.alert.closable - }, - // 是否显示图标 - showIcon: { - type: Boolean, - default: uni.$u.props.alert.showIcon - }, - // 浅或深色调,light-浅色,dark-深色 - effect: { - type: String, - default: uni.$u.props.alert.effect - }, - // 文字是否居中 - center: { - type: Boolean, - default: uni.$u.props.alert.center - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.alert.fontSize - } - } -} diff --git a/uni_modules/uview-ui/components/u-alert/u-alert.vue b/uni_modules/uview-ui/components/u-alert/u-alert.vue deleted file mode 100644 index 81f7d43e..00000000 --- a/uni_modules/uview-ui/components/u-alert/u-alert.vue +++ /dev/null @@ -1,243 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-avatar-group/props.js b/uni_modules/uview-ui/components/u-avatar-group/props.js deleted file mode 100644 index 58b42ac9..00000000 --- a/uni_modules/uview-ui/components/u-avatar-group/props.js +++ /dev/null @@ -1,52 +0,0 @@ -export default { - props: { - // 头像图片组 - urls: { - type: Array, - default: uni.$u.props.avatarGroup.urls - }, - // 最多展示的头像数量 - maxCount: { - type: [String, Number], - default: uni.$u.props.avatarGroup.maxCount - }, - // 头像形状 - shape: { - type: String, - default: uni.$u.props.avatarGroup.shape - }, - // 图片裁剪模式 - mode: { - type: String, - default: uni.$u.props.avatarGroup.mode - }, - // 超出maxCount时是否显示查看更多的提示 - showMore: { - type: Boolean, - default: uni.$u.props.avatarGroup.showMore - }, - // 头像大小 - size: { - type: [String, Number], - default: uni.$u.props.avatarGroup.size - }, - // 指定从数组的对象元素中读取哪个属性作为图片地址 - keyName: { - type: String, - default: uni.$u.props.avatarGroup.keyName - }, - // 头像之间的遮挡比例 - gap: { - type: [String, Number], - validator(value) { - return value >= 0 && value <= 1 - }, - default: uni.$u.props.avatarGroup.gap - }, - // 需额外显示的值 - extraValue: { - type: [Number, String], - default: uni.$u.props.avatarGroup.extraValue - } - } -} diff --git a/uni_modules/uview-ui/components/u-avatar-group/u-avatar-group.vue b/uni_modules/uview-ui/components/u-avatar-group/u-avatar-group.vue deleted file mode 100644 index 7e996d77..00000000 --- a/uni_modules/uview-ui/components/u-avatar-group/u-avatar-group.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-avatar/props.js b/uni_modules/uview-ui/components/u-avatar/props.js deleted file mode 100644 index 34ca0f28..00000000 --- a/uni_modules/uview-ui/components/u-avatar/props.js +++ /dev/null @@ -1,78 +0,0 @@ -export default { - props: { - // 头像图片路径(不能为相对路径) - src: { - type: String, - default: uni.$u.props.avatar.src - }, - // 头像形状,circle-圆形,square-方形 - shape: { - type: String, - default: uni.$u.props.avatar.shape - }, - // 头像尺寸 - size: { - type: [String, Number], - default: uni.$u.props.avatar.size - }, - // 裁剪模式 - mode: { - type: String, - default: uni.$u.props.avatar.mode - }, - // 显示的文字 - text: { - type: String, - default: uni.$u.props.avatar.text - }, - // 背景色 - bgColor: { - type: String, - default: uni.$u.props.avatar.bgColor - }, - // 文字颜色 - color: { - type: String, - default: uni.$u.props.avatar.color - }, - // 文字大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.avatar.fontSize - }, - // 显示的图标 - icon: { - type: String, - default: uni.$u.props.avatar.icon - }, - // 显示小程序头像,只对百度,微信,QQ小程序有效 - mpAvatar: { - type: Boolean, - default: uni.$u.props.avatar.mpAvatar - }, - // 是否使用随机背景色 - randomBgColor: { - type: Boolean, - default: uni.$u.props.avatar.randomBgColor - }, - // 加载失败的默认头像(组件有内置默认图片) - defaultUrl: { - type: String, - default: uni.$u.props.avatar.defaultUrl - }, - // 如果配置了randomBgColor为true,且配置了此值,则从默认的背景色数组中取出对应索引的颜色值,取值0-19之间 - colorIndex: { - type: [String, Number], - // 校验参数规则,索引在0-19之间 - validator(n) { - return uni.$u.test.range(n, [0, 19]) || n === '' - }, - default: uni.$u.props.avatar.colorIndex - }, - // 组件标识符 - name: { - type: String, - default: uni.$u.props.avatar.name - } - } -} diff --git a/uni_modules/uview-ui/components/u-avatar/u-avatar.vue b/uni_modules/uview-ui/components/u-avatar/u-avatar.vue deleted file mode 100644 index d38d8a6a..00000000 --- a/uni_modules/uview-ui/components/u-avatar/u-avatar.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-back-top/props.js b/uni_modules/uview-ui/components/u-back-top/props.js deleted file mode 100644 index 6c702c28..00000000 --- a/uni_modules/uview-ui/components/u-back-top/props.js +++ /dev/null @@ -1,54 +0,0 @@ -export default { - props: { - // 返回顶部的形状,circle-圆形,square-方形 - mode: { - type: String, - default: uni.$u.props.backtop.mode - }, - // 自定义图标 - icon: { - type: String, - default: uni.$u.props.backtop.icon - }, - // 提示文字 - text: { - type: String, - default: uni.$u.props.backtop.text - }, - // 返回顶部滚动时间 - duration: { - type: [String, Number], - default: uni.$u.props.backtop.duration - }, - // 滚动距离 - scrollTop: { - type: [String, Number], - default: uni.$u.props.backtop.scrollTop - }, - // 距离顶部多少距离显示,单位px - top: { - type: [String, Number], - default: uni.$u.props.backtop.top - }, - // 返回顶部按钮到底部的距离,单位px - bottom: { - type: [String, Number], - default: uni.$u.props.backtop.bottom - }, - // 返回顶部按钮到右边的距离,单位px - right: { - type: [String, Number], - default: uni.$u.props.backtop.right - }, - // 层级 - zIndex: { - type: [String, Number], - default: uni.$u.props.backtop.zIndex - }, - // 图标的样式,对象形式 - iconStyle: { - type: Object, - default: uni.$u.props.backtop.iconStyle - } - } -} diff --git a/uni_modules/uview-ui/components/u-back-top/u-back-top.vue b/uni_modules/uview-ui/components/u-back-top/u-back-top.vue deleted file mode 100644 index 2d075667..00000000 --- a/uni_modules/uview-ui/components/u-back-top/u-back-top.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-badge/props.js b/uni_modules/uview-ui/components/u-badge/props.js deleted file mode 100644 index 74c032c3..00000000 --- a/uni_modules/uview-ui/components/u-badge/props.js +++ /dev/null @@ -1,72 +0,0 @@ -export default { - props: { - // 是否显示圆点 - isDot: { - type: Boolean, - default: uni.$u.props.badge.isDot - }, - // 显示的内容 - value: { - type: [Number, String], - default: uni.$u.props.badge.value - }, - // 是否显示 - show: { - type: Boolean, - default: uni.$u.props.badge.show - }, - // 最大值,超过最大值会显示 '{max}+' - max: { - type: [Number, String], - default: uni.$u.props.badge.max - }, - // 主题类型,error|warning|success|primary - type: { - type: String, - default: uni.$u.props.badge.type - }, - // 当数值为 0 时,是否展示 Badge - showZero: { - type: Boolean, - default: uni.$u.props.badge.showZero - }, - // 背景颜色,优先级比type高,如设置,type参数会失效 - bgColor: { - type: [String, null], - default: uni.$u.props.badge.bgColor - }, - // 字体颜色 - color: { - type: [String, null], - default: uni.$u.props.badge.color - }, - // 徽标形状,circle-四角均为圆角,horn-左下角为直角 - shape: { - type: String, - default: uni.$u.props.badge.shape - }, - // 设置数字的显示方式,overflow|ellipsis|limit - // overflow会根据max字段判断,超出显示`${max}+` - // ellipsis会根据max判断,超出显示`${max}...` - // limit会依据1000作为判断条件,超出1000,显示`${value/1000}K`,比如2.2k、3.34w,最多保留2位小数 - numberType: { - type: String, - default: uni.$u.props.badge.numberType - }, - // 设置badge的位置偏移,格式为 [x, y],也即设置的为top和right的值,absolute为true时有效 - offset: { - type: Array, - default: uni.$u.props.badge.offset - }, - // 是否反转背景和字体颜色 - inverted: { - type: Boolean, - default: uni.$u.props.badge.inverted - }, - // 是否绝对定位 - absolute: { - type: Boolean, - default: uni.$u.props.badge.absolute - } - } -} diff --git a/uni_modules/uview-ui/components/u-badge/u-badge.vue b/uni_modules/uview-ui/components/u-badge/u-badge.vue deleted file mode 100644 index 53cfc811..00000000 --- a/uni_modules/uview-ui/components/u-badge/u-badge.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-button/nvue.scss b/uni_modules/uview-ui/components/u-button/nvue.scss deleted file mode 100644 index 490db7d9..00000000 --- a/uni_modules/uview-ui/components/u-button/nvue.scss +++ /dev/null @@ -1,46 +0,0 @@ -$u-button-active-opacity:0.75 !default; -$u-button-loading-text-margin-left:4px !default; -$u-button-text-color: #FFFFFF !default; -$u-button-text-plain-error-color:$u-error !default; -$u-button-text-plain-warning-color:$u-warning !default; -$u-button-text-plain-success-color:$u-success !default; -$u-button-text-plain-info-color:$u-info !default; -$u-button-text-plain-primary-color:$u-primary !default; -.u-button { - &--active { - opacity: $u-button-active-opacity; - } - - &--active--plain { - background-color: rgb(217, 217, 217); - } - - &__loading-text { - margin-left:$u-button-loading-text-margin-left; - } - - &__text, - &__loading-text { - color:$u-button-text-color; - } - - &__text--plain--error { - color:$u-button-text-plain-error-color; - } - - &__text--plain--warning { - color:$u-button-text-plain-warning-color; - } - - &__text--plain--success{ - color:$u-button-text-plain-success-color; - } - - &__text--plain--info { - color:$u-button-text-plain-info-color; - } - - &__text--plain--primary { - color:$u-button-text-plain-primary-color; - } -} \ No newline at end of file diff --git a/uni_modules/uview-ui/components/u-button/props.js b/uni_modules/uview-ui/components/u-button/props.js deleted file mode 100644 index 07fd8446..00000000 --- a/uni_modules/uview-ui/components/u-button/props.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * @Author : LQ - * @Description : - * @version : 1.0 - * @Date : 2021-08-16 10:04:04 - * @LastAuthor : LQ - * @lastTime : 2021-08-16 10:04:24 - * @FilePath : /u-view2.0/uview-ui/components/u-button/props.js - */ -export default { - props: { - // 是否细边框 - hairline: { - type: Boolean, - default: uni.$u.props.button.hairline - }, - // 按钮的预置样式,info,primary,error,warning,success - type: { - type: String, - default: uni.$u.props.button.type - }, - // 按钮尺寸,large,normal,small,mini - size: { - type: String, - default: uni.$u.props.button.size - }, - // 按钮形状,circle(两边为半圆),square(带圆角) - shape: { - type: String, - default: uni.$u.props.button.shape - }, - // 按钮是否镂空 - plain: { - type: Boolean, - default: uni.$u.props.button.plain - }, - // 是否禁止状态 - disabled: { - type: Boolean, - default: uni.$u.props.button.disabled - }, - // 是否加载中 - loading: { - type: Boolean, - default: uni.$u.props.button.loading - }, - // 加载中提示文字 - loadingText: { - type: [String, Number], - default: uni.$u.props.button.loadingText - }, - // 加载状态图标类型 - loadingMode: { - type: String, - default: uni.$u.props.button.loadingMode - }, - // 加载图标大小 - loadingSize: { - type: [String, Number], - default: uni.$u.props.button.loadingSize - }, - // 开放能力,具体请看uniapp稳定关于button组件部分说明 - // https://uniapp.dcloud.io/component/button - openType: { - type: String, - default: uni.$u.props.button.openType - }, - // 用于 组件,点击分别会触发 组件的 submit/reset 事件 - // 取值为submit(提交表单),reset(重置表单) - formType: { - type: String, - default: uni.$u.props.button.formType - }, - // 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 - // 只微信小程序、QQ小程序有效 - appParameter: { - type: String, - default: uni.$u.props.button.appParameter - }, - // 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效 - hoverStopPropagation: { - type: Boolean, - default: uni.$u.props.button.hoverStopPropagation - }, - // 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。只微信小程序有效 - lang: { - type: String, - default: uni.$u.props.button.lang - }, - // 会话来源,open-type="contact"时有效。只微信小程序有效 - sessionFrom: { - type: String, - default: uni.$u.props.button.sessionFrom - }, - // 会话内消息卡片标题,open-type="contact"时有效 - // 默认当前标题,只微信小程序有效 - sendMessageTitle: { - type: String, - default: uni.$u.props.button.sendMessageTitle - }, - // 会话内消息卡片点击跳转小程序路径,open-type="contact"时有效 - // 默认当前分享路径,只微信小程序有效 - sendMessagePath: { - type: String, - default: uni.$u.props.button.sendMessagePath - }, - // 会话内消息卡片图片,open-type="contact"时有效 - // 默认当前页面截图,只微信小程序有效 - sendMessageImg: { - type: String, - default: uni.$u.props.button.sendMessageImg - }, - // 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示, - // 用户点击后可以快速发送小程序消息,open-type="contact"时有效 - showMessageCard: { - type: Boolean, - default: uni.$u.props.button.showMessageCard - }, - // 额外传参参数,用于小程序的data-xxx属性,通过target.dataset.name获取 - dataName: { - type: String, - default: uni.$u.props.button.dataName - }, - // 节流,一定时间内只能触发一次 - throttleTime: { - type: [String, Number], - default: uni.$u.props.button.throttleTime - }, - // 按住后多久出现点击态,单位毫秒 - hoverStartTime: { - type: [String, Number], - default: uni.$u.props.button.hoverStartTime - }, - // 手指松开后点击态保留时间,单位毫秒 - hoverStayTime: { - type: [String, Number], - default: uni.$u.props.button.hoverStayTime - }, - // 按钮文字,之所以通过props传入,是因为slot传入的话 - // nvue中无法控制文字的样式 - text: { - type: [String, Number], - default: uni.$u.props.button.text - }, - // 按钮图标 - icon: { - type: String, - default: uni.$u.props.button.icon - }, - // 按钮图标 - iconColor: { - type: String, - default: uni.$u.props.button.icon - }, - // 按钮颜色,支持传入linear-gradient渐变色 - color: { - type: String, - default: uni.$u.props.button.color - } - } -} diff --git a/uni_modules/uview-ui/components/u-button/u-button.vue b/uni_modules/uview-ui/components/u-button/u-button.vue deleted file mode 100644 index d60f73e2..00000000 --- a/uni_modules/uview-ui/components/u-button/u-button.vue +++ /dev/null @@ -1,495 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-button/vue.scss b/uni_modules/uview-ui/components/u-button/vue.scss deleted file mode 100644 index 32019b27..00000000 --- a/uni_modules/uview-ui/components/u-button/vue.scss +++ /dev/null @@ -1,80 +0,0 @@ -// nvue下hover-class无效 -$u-button-before-top:50% !default; -$u-button-before-left:50% !default; -$u-button-before-width:100% !default; -$u-button-before-height:100% !default; -$u-button-before-transform:translate(-50%, -50%) !default; -$u-button-before-opacity:0 !default; -$u-button-before-background-color:#000 !default; -$u-button-before-border-color:#000 !default; -$u-button-active-before-opacity:.15 !default; -$u-button-icon-margin-left:4px !default; -$u-button-plain-u-button-info-color:$u-info; -$u-button-plain-u-button-success-color:$u-success; -$u-button-plain-u-button-error-color:$u-error; -$u-button-plain-u-button-warning-color:$u-error; - -.u-button { - width: 100%; - - &__text { - white-space: nowrap; - line-height: 1; - } - - &:before { - position: absolute; - top:$u-button-before-top; - left:$u-button-before-left; - width:$u-button-before-width; - height:$u-button-before-height; - border: inherit; - border-radius: inherit; - transform:$u-button-before-transform; - opacity:$u-button-before-opacity; - content: " "; - background-color:$u-button-before-background-color; - border-color:$u-button-before-border-color; - } - - &--active { - &:before { - opacity: .15 - } - } - - &__icon+&__text:not(:empty), - &__loading-text { - margin-left:$u-button-icon-margin-left; - } - - &--plain { - &.u-button--primary { - color: $u-primary; - } - } - - &--plain { - &.u-button--info { - color:$u-button-plain-u-button-info-color; - } - } - - &--plain { - &.u-button--success { - color:$u-button-plain-u-button-success-color; - } - } - - &--plain { - &.u-button--error { - color:$u-button-plain-u-button-error-color; - } - } - - &--plain { - &.u-button--warning { - color:$u-button-plain-u-button-warning-color; - } - } -} diff --git a/uni_modules/uview-ui/components/u-calendar/header.vue b/uni_modules/uview-ui/components/u-calendar/header.vue deleted file mode 100644 index dc4f7d05..00000000 --- a/uni_modules/uview-ui/components/u-calendar/header.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-calendar/month.vue b/uni_modules/uview-ui/components/u-calendar/month.vue deleted file mode 100644 index c20937fe..00000000 --- a/uni_modules/uview-ui/components/u-calendar/month.vue +++ /dev/null @@ -1,579 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-calendar/props.js b/uni_modules/uview-ui/components/u-calendar/props.js deleted file mode 100644 index 2ad7bc76..00000000 --- a/uni_modules/uview-ui/components/u-calendar/props.js +++ /dev/null @@ -1,144 +0,0 @@ -export default { - props: { - // 日历顶部标题 - title: { - type: String, - default: uni.$u.props.calendar.title - }, - // 是否显示标题 - showTitle: { - type: Boolean, - default: uni.$u.props.calendar.showTitle - }, - // 是否显示副标题 - showSubtitle: { - type: Boolean, - default: uni.$u.props.calendar.showSubtitle - }, - // 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围 - mode: { - type: String, - default: uni.$u.props.calendar.mode - }, - // mode=range时,第一个日期底部的提示文字 - startText: { - type: String, - default: uni.$u.props.calendar.startText - }, - // mode=range时,最后一个日期底部的提示文字 - endText: { - type: String, - default: uni.$u.props.calendar.endText - }, - // 自定义列表 - customList: { - type: Array, - default: uni.$u.props.calendar.customList - }, - // 主题色,对底部按钮和选中日期有效 - color: { - type: String, - default: uni.$u.props.calendar.color - }, - // 最小的可选日期 - minDate: { - type: [String, Number], - default: uni.$u.props.calendar.minDate - }, - // 最大可选日期 - maxDate: { - type: [String, Number], - default: uni.$u.props.calendar.maxDate - }, - // 默认选中的日期,mode为multiple或range是必须为数组格式 - defaultDate: { - type: [Array, String, Date, null], - default: uni.$u.props.calendar.defaultDate - }, - // mode=multiple时,最多可选多少个日期 - maxCount: { - type: [String, Number], - default: uni.$u.props.calendar.maxCount - }, - // 日期行高 - rowHeight: { - type: [String, Number], - default: uni.$u.props.calendar.rowHeight - }, - // 日期格式化函数 - formatter: { - type: [Function, null], - default: uni.$u.props.calendar.formatter - }, - // 是否显示农历 - showLunar: { - type: Boolean, - default: uni.$u.props.calendar.showLunar - }, - // 是否显示月份背景色 - showMark: { - type: Boolean, - default: uni.$u.props.calendar.showMark - }, - // 确定按钮的文字 - confirmText: { - type: String, - default: uni.$u.props.calendar.confirmText - }, - // 确认按钮处于禁用状态时的文字 - confirmDisabledText: { - type: String, - default: uni.$u.props.calendar.confirmDisabledText - }, - // 是否显示日历弹窗 - show: { - type: Boolean, - default: uni.$u.props.calendar.show - }, - // 是否允许点击遮罩关闭日历 - closeOnClickOverlay: { - type: Boolean, - default: uni.$u.props.calendar.closeOnClickOverlay - }, - // 是否为只读状态,只读状态下禁止选择日期 - readonly: { - type: Boolean, - default: uni.$u.props.calendar.readonly - }, - // 是否展示确认按钮 - showConfirm: { - type: Boolean, - default: uni.$u.props.calendar.showConfirm - }, - // 日期区间最多可选天数,默认无限制,mode = range时有效 - maxRange: { - type: [Number, String], - default: uni.$u.props.calendar.maxRange - }, - // 范围选择超过最多可选天数时的提示文案,mode = range时有效 - rangePrompt: { - type: String, - default: uni.$u.props.calendar.rangePrompt - }, - // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效 - showRangePrompt: { - type: Boolean, - default: uni.$u.props.calendar.showRangePrompt - }, - // 是否允许日期范围的起止时间为同一天,mode = range时有效 - allowSameDay: { - type: Boolean, - default: uni.$u.props.calendar.allowSameDay - }, - // 圆角值 - round: { - type: [Boolean, String, Number], - default: uni.$u.props.calendar.round - }, - // 最多展示月份数量 - monthNum: { - type: [Number, String], - default: 3 - } - } -} diff --git a/uni_modules/uview-ui/components/u-calendar/u-calendar.vue b/uni_modules/uview-ui/components/u-calendar/u-calendar.vue deleted file mode 100644 index 511f9939..00000000 --- a/uni_modules/uview-ui/components/u-calendar/u-calendar.vue +++ /dev/null @@ -1,384 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-calendar/util.js b/uni_modules/uview-ui/components/u-calendar/util.js deleted file mode 100644 index ca4736bb..00000000 --- a/uni_modules/uview-ui/components/u-calendar/util.js +++ /dev/null @@ -1,85 +0,0 @@ -export default { - methods: { - // 设置月份数据 - setMonth() { - // 月初是周几 - const day = dayjs(this.date).date(1).day() - const start = day == 0 ? 6 : day - 1 - - // 本月天数 - const days = dayjs(this.date).endOf('month').format('D') - - // 上个月天数 - const prevDays = dayjs(this.date).endOf('month').subtract(1, 'month').format('D') - - // 日期数据 - const arr = [] - // 清空表格 - this.month = [] - - // 添加上月数据 - arr.push( - ...new Array(start).fill(1).map((e, i) => { - const day = prevDays - start + i + 1 - - return { - value: day, - disabled: true, - date: dayjs(this.date).subtract(1, 'month').date(day).format('YYYY-MM-DD') - } - }) - ) - - // 添加本月数据 - arr.push( - ...new Array(days - 0).fill(1).map((e, i) => { - const day = i + 1 - - return { - value: day, - date: dayjs(this.date).date(day).format('YYYY-MM-DD') - } - }) - ) - - // 添加下个月 - arr.push( - ...new Array(42 - days - start).fill(1).map((e, i) => { - const day = i + 1 - - return { - value: day, - disabled: true, - date: dayjs(this.date).add(1, 'month').date(day).format('YYYY-MM-DD') - } - }) - ) - - // 分割数组 - for (let n = 0; n < arr.length; n += 7) { - this.month.push( - arr.slice(n, n + 7).map((e, i) => { - e.index = i + n - - // 自定义信息 - const custom = this.customList.find((c) => c.date == e.date) - - // 农历 - if (this.lunar) { - const { - IDayCn, - IMonthCn - } = this.getLunar(e.date) - e.lunar = IDayCn == '初一' ? IMonthCn : IDayCn - } - - return { - ...e, - ...custom - } - }) - ) - } - } - } -} diff --git a/uni_modules/uview-ui/components/u-car-keyboard/props.js b/uni_modules/uview-ui/components/u-car-keyboard/props.js deleted file mode 100644 index 3553647a..00000000 --- a/uni_modules/uview-ui/components/u-car-keyboard/props.js +++ /dev/null @@ -1,14 +0,0 @@ -export default { - props: { - // 是否打乱键盘按键的顺序 - random: { - type: Boolean, - default: false - }, - // 输入一个中文后,是否自动切换到英文 - autoChange: { - type: Boolean, - default: false - } - } -} diff --git a/uni_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue b/uni_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue deleted file mode 100644 index 51175b54..00000000 --- a/uni_modules/uview-ui/components/u-car-keyboard/u-car-keyboard.vue +++ /dev/null @@ -1,311 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-cell-group/props.js b/uni_modules/uview-ui/components/u-cell-group/props.js deleted file mode 100644 index 350ef403..00000000 --- a/uni_modules/uview-ui/components/u-cell-group/props.js +++ /dev/null @@ -1,14 +0,0 @@ -export default { - props: { - // 分组标题 - title: { - type: String, - default: uni.$u.props.cellGroup.title - }, - // 是否显示外边框 - border: { - type: Boolean, - default: uni.$u.props.cellGroup.border - } - } -} diff --git a/uni_modules/uview-ui/components/u-cell-group/u-cell-group.vue b/uni_modules/uview-ui/components/u-cell-group/u-cell-group.vue deleted file mode 100644 index a9508c0c..00000000 --- a/uni_modules/uview-ui/components/u-cell-group/u-cell-group.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - diff --git a/uni_modules/uview-ui/components/u-cell/props.js b/uni_modules/uview-ui/components/u-cell/props.js deleted file mode 100644 index da033303..00000000 --- a/uni_modules/uview-ui/components/u-cell/props.js +++ /dev/null @@ -1,110 +0,0 @@ -export default { - props: { - // 标题 - title: { - type: [String, Number], - default: uni.$u.props.cell.title - }, - // 标题下方的描述信息 - label: { - type: [String, Number], - default: uni.$u.props.cell.label - }, - // 右侧的内容 - value: { - type: [String, Number], - default: uni.$u.props.cell.value - }, - // 左侧图标名称,或者图片链接(本地文件建议使用绝对地址) - icon: { - type: String, - default: uni.$u.props.cell.icon - }, - // 是否禁用cell - disabled: { - type: Boolean, - default: uni.$u.props.cell.disabled - }, - // 是否显示下边框 - border: { - type: Boolean, - default: uni.$u.props.cell.border - }, - // 内容是否垂直居中(主要是针对右侧的value部分) - center: { - type: Boolean, - default: uni.$u.props.cell.center - }, - // 点击后跳转的URL地址 - url: { - type: String, - default: uni.$u.props.cell.url - }, - // 链接跳转的方式,内部使用的是uView封装的route方法,可能会进行拦截操作 - linkType: { - type: String, - default: uni.$u.props.cell.linkType - }, - // 是否开启点击反馈(表现为点击时加上灰色背景) - clickable: { - type: Boolean, - default: uni.$u.props.cell.clickable - }, - // 是否展示右侧箭头并开启点击反馈 - isLink: { - type: Boolean, - default: uni.$u.props.cell.isLink - }, - // 是否显示表单状态下的必填星号(此组件可能会内嵌入input组件) - required: { - type: Boolean, - default: uni.$u.props.cell.required - }, - // 右侧的图标箭头 - rightIcon: { - type: String, - default: uni.$u.props.cell.rightIcon - }, - // 右侧箭头的方向,可选值为:left,up,down - arrowDirection: { - type: String, - default: uni.$u.props.cell.arrowDirection - }, - // 左侧图标样式 - iconStyle: { - type: [Object, String], - default: () => { - return uni.$u.props.cell.iconStyle - } - }, - // 右侧箭头图标的样式 - rightIconStyle: { - type: [Object, String], - default: () => { - return uni.$u.props.cell.rightIconStyle - } - }, - // 标题的样式 - titleStyle: { - type: [Object, String], - default: () => { - return uni.$u.props.cell.titleStyle - } - }, - // 单位元的大小,可选值为large - size: { - type: String, - default: uni.$u.props.cell.size - }, - // 点击cell是否阻止事件传播 - stop: { - type: Boolean, - default: uni.$u.props.cell.stop - }, - // 标识符,cell被点击时返回 - name: { - type: [Number, String], - default: uni.$u.props.cell.name - } - } -} diff --git a/uni_modules/uview-ui/components/u-cell/u-cell.vue b/uni_modules/uview-ui/components/u-cell/u-cell.vue deleted file mode 100644 index b099c907..00000000 --- a/uni_modules/uview-ui/components/u-cell/u-cell.vue +++ /dev/null @@ -1,229 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-checkbox-group/props.js b/uni_modules/uview-ui/components/u-checkbox-group/props.js deleted file mode 100644 index 2f818a10..00000000 --- a/uni_modules/uview-ui/components/u-checkbox-group/props.js +++ /dev/null @@ -1,82 +0,0 @@ -export default { - props: { - // 标识符 - name: { - type: String, - default: uni.$u.props.checkboxGroup.name - }, - // 绑定的值 - value: { - type: Array, - default: uni.$u.props.checkboxGroup.value - }, - // 形状,circle-圆形,square-方形 - shape: { - type: String, - default: uni.$u.props.checkboxGroup.shape - }, - // 是否禁用全部checkbox - disabled: { - type: Boolean, - default: uni.$u.props.checkboxGroup.disabled - }, - - // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 - activeColor: { - type: String, - default: uni.$u.props.checkboxGroup.activeColor - }, - // 未选中的颜色 - inactiveColor: { - type: String, - default: uni.$u.props.checkboxGroup.inactiveColor - }, - - // 整个组件的尺寸,默认px - size: { - type: [String, Number], - default: uni.$u.props.checkboxGroup.size - }, - // 布局方式,row-横向,column-纵向 - placement: { - type: String, - default: uni.$u.props.checkboxGroup.placement - }, - // label的字体大小,px单位 - labelSize: { - type: [String, Number], - default: uni.$u.props.checkboxGroup.labelSize - }, - // label的字体颜色 - labelColor: { - type: [String], - default: uni.$u.props.checkboxGroup.labelColor - }, - // 是否禁止点击文本操作 - labelDisabled: { - type: Boolean, - default: uni.$u.props.checkboxGroup.labelDisabled - }, - // 图标颜色 - iconColor: { - type: String, - default: uni.$u.props.checkboxGroup.iconColor - }, - // 图标的大小,单位px - iconSize: { - type: [String, Number], - default: uni.$u.props.checkboxGroup.iconSize - }, - // 勾选图标的对齐方式,left-左边,right-右边 - iconPlacement: { - type: String, - default: uni.$u.props.checkboxGroup.iconPlacement - }, - // 竖向配列时,是否显示下划线 - borderBottom: { - type: Boolean, - default: uni.$u.props.checkboxGroup.borderBottom - } - - } -} diff --git a/uni_modules/uview-ui/components/u-checkbox/props.js b/uni_modules/uview-ui/components/u-checkbox/props.js deleted file mode 100644 index 93f4fd9f..00000000 --- a/uni_modules/uview-ui/components/u-checkbox/props.js +++ /dev/null @@ -1,69 +0,0 @@ -export default { - props: { - // checkbox的名称 - name: { - type: [String, Number, Boolean], - default: uni.$u.props.checkbox.name - }, - // 形状,square为方形,circle为圆型 - shape: { - type: String, - default: uni.$u.props.checkbox.shape - }, - // 整体的大小 - size: { - type: [String, Number], - default: uni.$u.props.checkbox.size - }, - // 是否默认选中 - checked: { - type: Boolean, - default: uni.$u.props.checkbox.checked - }, - // 是否禁用 - disabled: { - type: [String, Boolean], - default: uni.$u.props.checkbox.disabled - }, - // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 - activeColor: { - type: String, - default: uni.$u.props.checkbox.activeColor - }, - // 未选中的颜色 - inactiveColor: { - type: String, - default: uni.$u.props.checkbox.inactiveColor - }, - // 图标的大小,单位px - iconSize: { - type: [String, Number], - default: uni.$u.props.checkbox.iconSize - }, - // 图标颜色 - iconColor: { - type: String, - default: uni.$u.props.checkbox.iconColor - }, - // label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式 - label: { - type: [String, Number], - default: uni.$u.props.checkbox.label - }, - // label的字体大小,px单位 - labelSize: { - type: [String, Number], - default: uni.$u.props.checkbox.labelSize - }, - // label的颜色 - labelColor: { - type: String, - default: uni.$u.props.checkbox.labelColor - }, - // 是否禁止点击提示语选中复选框 - labelDisabled: { - type: [String, Boolean], - default: uni.$u.props.checkbox.labelDisabled - } - } -} diff --git a/uni_modules/uview-ui/components/u-circle-progress/props.js b/uni_modules/uview-ui/components/u-circle-progress/props.js deleted file mode 100644 index d776cfb6..00000000 --- a/uni_modules/uview-ui/components/u-circle-progress/props.js +++ /dev/null @@ -1,8 +0,0 @@ -export default { - props: { - percentage: { - type: [String, Number], - default: uni.$u.props.circleProgress.percentage - } - } -} diff --git a/uni_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue b/uni_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue deleted file mode 100644 index d1ee2867..00000000 --- a/uni_modules/uview-ui/components/u-circle-progress/u-circle-progress.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-code-input/props.js b/uni_modules/uview-ui/components/u-code-input/props.js deleted file mode 100644 index 0f016ee0..00000000 --- a/uni_modules/uview-ui/components/u-code-input/props.js +++ /dev/null @@ -1,79 +0,0 @@ -export default { - props: { - // 键盘弹起时,是否自动上推页面 - adjustPosition: { - type: Boolean, - default: uni.$u.props.codeInput.adjustPosition - }, - // 最大输入长度 - maxlength: { - type: [String, Number], - default: uni.$u.props.codeInput.maxlength - }, - // 是否用圆点填充 - dot: { - type: Boolean, - default: uni.$u.props.codeInput.dot - }, - // 显示模式,box-盒子模式,line-底部横线模式 - mode: { - type: String, - default: uni.$u.props.codeInput.mode - }, - // 是否细边框 - hairline: { - type: Boolean, - default: uni.$u.props.codeInput.hairline - }, - // 字符间的距离 - space: { - type: [String, Number], - default: uni.$u.props.codeInput.space - }, - // 预置值 - value: { - type: [String, Number], - default: uni.$u.props.codeInput.value - }, - // 是否自动获取焦点 - focus: { - type: Boolean, - default: uni.$u.props.codeInput.focus - }, - // 字体是否加粗 - bold: { - type: Boolean, - default: uni.$u.props.codeInput.bold - }, - // 字体颜色 - color: { - type: String, - default: uni.$u.props.codeInput.color - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.codeInput.fontSize - }, - // 输入框的大小,宽等于高 - size: { - type: [String, Number], - default: uni.$u.props.codeInput.size - }, - // 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true - disabledKeyboard: { - type: Boolean, - default: uni.$u.props.codeInput.disabledKeyboard - }, - // 边框和线条颜色 - borderColor: { - type: String, - default: uni.$u.props.codeInput.borderColor - }, - // 是否禁止输入"."符号 - disabledDot: { - type: Boolean, - default: uni.$u.props.codeInput.disabledDot - } - } -} diff --git a/uni_modules/uview-ui/components/u-code-input/u-code-input.vue b/uni_modules/uview-ui/components/u-code-input/u-code-input.vue deleted file mode 100644 index 96241cfc..00000000 --- a/uni_modules/uview-ui/components/u-code-input/u-code-input.vue +++ /dev/null @@ -1,252 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-code/props.js b/uni_modules/uview-ui/components/u-code/props.js deleted file mode 100644 index eaf80d02..00000000 --- a/uni_modules/uview-ui/components/u-code/props.js +++ /dev/null @@ -1,34 +0,0 @@ -export default { - props: { - // 倒计时总秒数 - seconds: { - type: [String, Number], - default: uni.$u.props.code.seconds - }, - // 尚未开始时提示 - startText: { - type: String, - default: uni.$u.props.code.startText - }, - // 正在倒计时中的提示 - changeText: { - type: String, - default: uni.$u.props.code.changeText - }, - // 倒计时结束时的提示 - endText: { - type: String, - default: uni.$u.props.code.endText - }, - // 是否在H5刷新或各端返回再进入时继续倒计时 - keepRunning: { - type: Boolean, - default: uni.$u.props.code.keepRunning - }, - // 为了区分多个页面,或者一个页面多个倒计时组件本地存储的继续倒计时变了 - uniqueKey: { - type: String, - default: uni.$u.props.code.uniqueKey - } - } -} diff --git a/uni_modules/uview-ui/components/u-code/u-code.vue b/uni_modules/uview-ui/components/u-code/u-code.vue deleted file mode 100644 index f79a09ac..00000000 --- a/uni_modules/uview-ui/components/u-code/u-code.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-col/props.js b/uni_modules/uview-ui/components/u-col/props.js deleted file mode 100644 index 06222517..00000000 --- a/uni_modules/uview-ui/components/u-col/props.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - props: { - // 占父容器宽度的多少等分,总分为12份 - span: { - type: [String, Number], - default: uni.$u.props.col.span - }, - // 指定栅格左侧的间隔数(总12栏) - offset: { - type: [String, Number], - default: uni.$u.props.col.offset - }, - // 水平排列方式,可选值为`start`(或`flex-start`)、`end`(或`flex-end`)、`center`、`around`(或`space-around`)、`between`(或`space-between`) - justify: { - type: String, - default: uni.$u.props.col.justify - }, - // 垂直对齐方式,可选值为top、center、bottom、stretch - align: { - type: String, - default: uni.$u.props.col.align - }, - // 文字对齐方式 - textAlign: { - type: String, - default: uni.$u.props.col.textAlign - } - } -} diff --git a/uni_modules/uview-ui/components/u-col/u-col.vue b/uni_modules/uview-ui/components/u-col/u-col.vue deleted file mode 100644 index 8be15174..00000000 --- a/uni_modules/uview-ui/components/u-col/u-col.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-collapse-item/props.js b/uni_modules/uview-ui/components/u-collapse-item/props.js deleted file mode 100644 index bd5749b6..00000000 --- a/uni_modules/uview-ui/components/u-collapse-item/props.js +++ /dev/null @@ -1,59 +0,0 @@ -export default { - props: { - // 标题 - title: { - type: String, - default: uni.$u.props.collapseItem.title - }, - // 标题右侧内容 - value: { - type: String, - default: uni.$u.props.collapseItem.value - }, - // 标题下方的描述信息 - label: { - type: String, - default: uni.$u.props.collapseItem.label - }, - // 是否禁用折叠面板 - disabled: { - type: Boolean, - default: uni.$u.props.collapseItem.disabled - }, - // 是否展示右侧箭头并开启点击反馈 - isLink: { - type: Boolean, - default: uni.$u.props.collapseItem.isLink - }, - // 是否开启点击反馈 - clickable: { - type: Boolean, - default: uni.$u.props.collapseItem.clickable - }, - // 是否显示内边框 - border: { - type: Boolean, - default: uni.$u.props.collapseItem.border - }, - // 标题的对齐方式 - align: { - type: String, - default: uni.$u.props.collapseItem.align - }, - // 唯一标识符 - name: { - type: [String, Number], - default: uni.$u.props.collapseItem.name - }, - // 标题左侧图片,可为绝对路径的图片或内置图标 - icon: { - type: String, - default: uni.$u.props.collapseItem.icon - }, - // 面板展开收起的过渡时间,单位ms - duration: { - type: Number, - default: uni.$u.props.collapseItem.duration - } - } -} diff --git a/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue b/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue deleted file mode 100644 index 0e1b7039..00000000 --- a/uni_modules/uview-ui/components/u-collapse-item/u-collapse-item.vue +++ /dev/null @@ -1,225 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-collapse/props.js b/uni_modules/uview-ui/components/u-collapse/props.js deleted file mode 100644 index 7ee6d319..00000000 --- a/uni_modules/uview-ui/components/u-collapse/props.js +++ /dev/null @@ -1,19 +0,0 @@ -export default { - props: { - // 当前展开面板的name,非手风琴模式:[],手风琴模式:string | number - value: { - type: [String, Number, Array, null], - default: uni.$u.props.collapse.value - }, - // 是否手风琴模式 - accordion: { - type: Boolean, - default: uni.$u.props.collapse.accordion - }, - // 是否显示外边框 - border: { - type: Boolean, - default: uni.$u.props.collapse.border - } - } -} diff --git a/uni_modules/uview-ui/components/u-collapse/u-collapse.vue b/uni_modules/uview-ui/components/u-collapse/u-collapse.vue deleted file mode 100644 index fc188a2e..00000000 --- a/uni_modules/uview-ui/components/u-collapse/u-collapse.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-column-notice/props.js b/uni_modules/uview-ui/components/u-column-notice/props.js deleted file mode 100644 index 48091549..00000000 --- a/uni_modules/uview-ui/components/u-column-notice/props.js +++ /dev/null @@ -1,55 +0,0 @@ -export default { - props: { - // 显示的内容,字符串 - text: { - type: [Array], - default: uni.$u.props.columnNotice.text - }, - // 是否显示左侧的音量图标 - icon: { - type: String, - default: uni.$u.props.columnNotice.icon - }, - // 通告模式,link-显示右箭头,closable-显示右侧关闭图标 - mode: { - type: String, - default: uni.$u.props.columnNotice.mode - }, - // 文字颜色,各图标也会使用文字颜色 - color: { - type: String, - default: uni.$u.props.columnNotice.color - }, - // 背景颜色 - bgColor: { - type: String, - default: uni.$u.props.columnNotice.bgColor - }, - // 字体大小,单位px - fontSize: { - type: [String, Number], - default: uni.$u.props.columnNotice.fontSize - }, - // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度 - speed: { - type: [String, Number], - default: uni.$u.props.columnNotice.speed - }, - // direction = row时,是否使用步进形式滚动 - step: { - type: Boolean, - default: uni.$u.props.columnNotice.step - }, - // 滚动一个周期的时间长,单位ms - duration: { - type: [String, Number], - default: uni.$u.props.columnNotice.duration - }, - // 是否禁止用手滑动切换 - // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序 - disableTouch: { - type: Boolean, - default: uni.$u.props.columnNotice.disableTouch - } - } -} diff --git a/uni_modules/uview-ui/components/u-count-down/props.js b/uni_modules/uview-ui/components/u-count-down/props.js deleted file mode 100644 index d62f0255..00000000 --- a/uni_modules/uview-ui/components/u-count-down/props.js +++ /dev/null @@ -1,24 +0,0 @@ -export default { - props: { - // 倒计时时长,单位ms - time: { - type: [String, Number], - default: uni.$u.props.countDown.time - }, - // 时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒 - format: { - type: String, - default: uni.$u.props.countDown.format - }, - // 是否自动开始倒计时 - autoStart: { - type: Boolean, - default: uni.$u.props.countDown.autoStart - }, - // 是否展示毫秒倒计时 - millisecond: { - type: Boolean, - default: uni.$u.props.countDown.millisecond - } - } -} diff --git a/uni_modules/uview-ui/components/u-count-down/u-count-down.vue b/uni_modules/uview-ui/components/u-count-down/u-count-down.vue deleted file mode 100644 index b5e85a63..00000000 --- a/uni_modules/uview-ui/components/u-count-down/u-count-down.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-count-down/utils.js b/uni_modules/uview-ui/components/u-count-down/utils.js deleted file mode 100644 index 8c750050..00000000 --- a/uni_modules/uview-ui/components/u-count-down/utils.js +++ /dev/null @@ -1,62 +0,0 @@ -// 补0,如1 -> 01 -function padZero(num, targetLength = 2) { - let str = `${num}` - while (str.length < targetLength) { - str = `0${str}` - } - return str -} -const SECOND = 1000 -const MINUTE = 60 * SECOND -const HOUR = 60 * MINUTE -const DAY = 24 * HOUR -export function parseTimeData(time) { - const days = Math.floor(time / DAY) - const hours = Math.floor((time % DAY) / HOUR) - const minutes = Math.floor((time % HOUR) / MINUTE) - const seconds = Math.floor((time % MINUTE) / SECOND) - const milliseconds = Math.floor(time % SECOND) - return { - days, - hours, - minutes, - seconds, - milliseconds - } -} -export function parseFormat(format, timeData) { - let { - days, - hours, - minutes, - seconds, - milliseconds - } = timeData - // 如果格式化字符串中不存在DD(天),则将天的时间转为小时中去 - if (format.indexOf('DD') === -1) { - hours += days * 24 - } else { - // 对天补0 - format = format.replace('DD', padZero(days)) - } - // 其他同理于DD的格式化处理方式 - if (format.indexOf('HH') === -1) { - minutes += hours * 60 - } else { - format = format.replace('HH', padZero(hours)) - } - if (format.indexOf('mm') === -1) { - seconds += minutes * 60 - } else { - format = format.replace('mm', padZero(minutes)) - } - if (format.indexOf('ss') === -1) { - milliseconds += seconds * 1000 - } else { - format = format.replace('ss', padZero(seconds)) - } - return format.replace('SSS', padZero(milliseconds, 3)) -} -export function isSameSecond(time1, time2) { - return Math.floor(time1 / 1000) === Math.floor(time2 / 1000) -} diff --git a/uni_modules/uview-ui/components/u-count-to/props.js b/uni_modules/uview-ui/components/u-count-to/props.js deleted file mode 100644 index 86873c18..00000000 --- a/uni_modules/uview-ui/components/u-count-to/props.js +++ /dev/null @@ -1,59 +0,0 @@ -export default { - props: { - // 开始的数值,默认从0增长到某一个数 - startVal: { - type: [String, Number], - default: uni.$u.props.countTo.startVal - }, - // 要滚动的目标数值,必须 - endVal: { - type: [String, Number], - default: uni.$u.props.countTo.endVal - }, - // 滚动到目标数值的动画持续时间,单位为毫秒(ms) - duration: { - type: [String, Number], - default: uni.$u.props.countTo.duration - }, - // 设置数值后是否自动开始滚动 - autoplay: { - type: Boolean, - default: uni.$u.props.countTo.autoplay - }, - // 要显示的小数位数 - decimals: { - type: [String, Number], - default: uni.$u.props.countTo.decimals - }, - // 是否在即将到达目标数值的时候,使用缓慢滚动的效果 - useEasing: { - type: Boolean, - default: uni.$u.props.countTo.useEasing - }, - // 十进制分割 - decimal: { - type: [String, Number], - default: uni.$u.props.countTo.decimal - }, - // 字体颜色 - color: { - type: String, - default: uni.$u.props.countTo.color - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.countTo.fontSize - }, - // 是否加粗字体 - bold: { - type: Boolean, - default: uni.$u.props.countTo.bold - }, - // 千位分隔符,类似金额的分割(¥23,321.05中的",") - separator: { - type: String, - default: uni.$u.props.countTo.separator - } - } -} diff --git a/uni_modules/uview-ui/components/u-count-to/u-count-to.vue b/uni_modules/uview-ui/components/u-count-to/u-count-to.vue deleted file mode 100644 index 417b7327..00000000 --- a/uni_modules/uview-ui/components/u-count-to/u-count-to.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-datetime-picker/props.js b/uni_modules/uview-ui/components/u-datetime-picker/props.js deleted file mode 100644 index f44c0f99..00000000 --- a/uni_modules/uview-ui/components/u-datetime-picker/props.js +++ /dev/null @@ -1,116 +0,0 @@ -export default { - props: { - // 是否打开组件 - show: { - type: Boolean, - default: uni.$u.props.datetimePicker.show - }, - // 是否展示顶部的操作栏 - showToolbar: { - type: Boolean, - default: uni.$u.props.datetimePicker.showToolbar - }, - // 绑定值 - value: { - type: [String, Number], - default: uni.$u.props.datetimePicker.value - }, - // 顶部标题 - title: { - type: String, - default: uni.$u.props.datetimePicker.title - }, - // 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择 - mode: { - type: String, - default: uni.$u.props.datetimePicker.mode - }, - // 可选的最大时间 - maxDate: { - type: Number, - // 最大默认值为后10年 - default: uni.$u.props.datetimePicker.maxDate - }, - // 可选的最小时间 - minDate: { - type: Number, - // 最小默认值为前10年 - default: uni.$u.props.datetimePicker.minDate - }, - // 可选的最小小时,仅mode=time有效 - minHour: { - type: Number, - default: uni.$u.props.datetimePicker.minHour - }, - // 可选的最大小时,仅mode=time有效 - maxHour: { - type: Number, - default: uni.$u.props.datetimePicker.maxHour - }, - // 可选的最小分钟,仅mode=time有效 - minMinute: { - type: Number, - default: uni.$u.props.datetimePicker.minMinute - }, - // 可选的最大分钟,仅mode=time有效 - maxMinute: { - type: Number, - default: uni.$u.props.datetimePicker.maxMinute - }, - // 选项过滤函数 - filter: { - type: [Function, null], - default: uni.$u.props.datetimePicker.filter - }, - // 选项格式化函数 - formatter: { - type: [Function, null], - default: uni.$u.props.datetimePicker.formatter - }, - // 是否显示加载中状态 - loading: { - type: Boolean, - default: uni.$u.props.datetimePicker.loading - }, - // 各列中,单个选项的高度 - itemHeight: { - type: [String, Number], - default: uni.$u.props.datetimePicker.itemHeight - }, - // 取消按钮的文字 - cancelText: { - type: String, - default: uni.$u.props.datetimePicker.cancelText - }, - // 确认按钮的文字 - confirmText: { - type: String, - default: uni.$u.props.datetimePicker.confirmText - }, - // 取消按钮的颜色 - cancelColor: { - type: String, - default: uni.$u.props.datetimePicker.cancelColor - }, - // 确认按钮的颜色 - confirmColor: { - type: String, - default: uni.$u.props.datetimePicker.confirmColor - }, - // 每列中可见选项的数量 - visibleItemCount: { - type: [String, Number], - default: uni.$u.props.datetimePicker.visibleItemCount - }, - // 是否允许点击遮罩关闭选择器 - closeOnClickOverlay: { - type: Boolean, - default: uni.$u.props.datetimePicker.closeOnClickOverlay - }, - // 各列的默认索引 - defaultIndex: { - type: Array, - default: uni.$u.props.datetimePicker.defaultIndex - } - } -} diff --git a/uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue b/uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue deleted file mode 100644 index b6896613..00000000 --- a/uni_modules/uview-ui/components/u-datetime-picker/u-datetime-picker.vue +++ /dev/null @@ -1,360 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-divider/props.js b/uni_modules/uview-ui/components/u-divider/props.js deleted file mode 100644 index 1fa8359f..00000000 --- a/uni_modules/uview-ui/components/u-divider/props.js +++ /dev/null @@ -1,44 +0,0 @@ -export default { - props: { - // 是否虚线 - dashed: { - type: Boolean, - default: uni.$u.props.divider.dashed - }, - // 是否细线 - hairline: { - type: Boolean, - default: uni.$u.props.divider.hairline - }, - // 是否以点替代文字,优先于text字段起作用 - dot: { - type: Boolean, - default: uni.$u.props.divider.dot - }, - // 内容文本的位置,left-左边,center-中间,right-右边 - textPosition: { - type: String, - default: uni.$u.props.divider.textPosition - }, - // 文本内容 - text: { - type: [String, Number], - default: uni.$u.props.divider.text - }, - // 文本大小 - textSize: { - type: [String, Number], - default: uni.$u.props.divider.textSize - }, - // 文本颜色 - textColor: { - type: String, - default: uni.$u.props.divider.textColor - }, - // 线条颜色 - lineColor: { - type: String, - default: uni.$u.props.divider.lineColor - } - } -} diff --git a/uni_modules/uview-ui/components/u-divider/u-divider.vue b/uni_modules/uview-ui/components/u-divider/u-divider.vue deleted file mode 100644 index b629da64..00000000 --- a/uni_modules/uview-ui/components/u-divider/u-divider.vue +++ /dev/null @@ -1,116 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-dropdown-item/props.js b/uni_modules/uview-ui/components/u-dropdown-item/props.js deleted file mode 100644 index 501a1f05..00000000 --- a/uni_modules/uview-ui/components/u-dropdown-item/props.js +++ /dev/null @@ -1,36 +0,0 @@ -export default { - props: { - // 当前选中项的value值 - value: { - type: [Number, String, Array], - default: '' - }, - // 菜单项标题 - title: { - type: [String, Number], - default: '' - }, - // 选项数据,如果传入了默认slot,此参数无效 - options: { - type: Array, - default() { - return [] - } - }, - // 是否禁用此菜单项 - disabled: { - type: Boolean, - default: false - }, - // 下拉弹窗的高度 - height: { - type: [Number, String], - default: 'auto' - }, - // 点击遮罩是否可以收起弹窗 - closeOnClickOverlay: { - type: Boolean, - default: true - } - } -} diff --git a/uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue b/uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue deleted file mode 100644 index f830291a..00000000 --- a/uni_modules/uview-ui/components/u-dropdown-item/u-dropdown-item.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-dropdown/props.js b/uni_modules/uview-ui/components/u-dropdown/props.js deleted file mode 100644 index 5f8465ef..00000000 --- a/uni_modules/uview-ui/components/u-dropdown/props.js +++ /dev/null @@ -1,65 +0,0 @@ -export default { - props: { - // 标题选中时的样式 - activeStyle: { - type: [String, Object], - default: () => ({ - color: '#2979ff', - fontSize: '14px' - }) - }, - // 标题未选中时的样式 - inactiveStyle: { - type: [String, Object], - default: () => ({ - color: '#606266', - fontSize: '14px' - }) - }, - // 点击遮罩是否关闭菜单 - closeOnClickMask: { - type: Boolean, - default: true - }, - // 点击当前激活项标题是否关闭菜单 - closeOnClickSelf: { - type: Boolean, - default: true - }, - // 过渡时间 - duration: { - type: [Number, String], - default: 300 - }, - // 标题菜单的高度 - height: { - type: [Number, String], - default: 40 - }, - // 是否显示下边框 - borderBottom: { - type: Boolean, - default: false - }, - // 标题的字体大小 - titleSize: { - type: [Number, String], - default: 14 - }, - // 下拉出来的内容部分的圆角值 - borderRadius: { - type: [Number, String], - default: 0 - }, - // 菜单右侧的icon图标 - menuIcon: { - type: String, - default: 'arrow-down' - }, - // 菜单右侧图标的大小 - menuIconSize: { - type: [Number, String], - default: 14 - } - } -} diff --git a/uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue b/uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue deleted file mode 100644 index f830291a..00000000 --- a/uni_modules/uview-ui/components/u-dropdown/u-dropdown.vue +++ /dev/null @@ -1,127 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-empty/props.js b/uni_modules/uview-ui/components/u-empty/props.js deleted file mode 100644 index 78662f8f..00000000 --- a/uni_modules/uview-ui/components/u-empty/props.js +++ /dev/null @@ -1,59 +0,0 @@ -export default { - props: { - // 内置图标名称,或图片路径,建议绝对路径 - icon: { - type: String, - default: uni.$u.props.empty.icon - }, - // 提示文字 - text: { - type: String, - default: uni.$u.props.empty.text - }, - // 文字颜色 - textColor: { - type: String, - default: uni.$u.props.empty.textColor - }, - // 文字大小 - textSize: { - type: [String, Number], - default: uni.$u.props.empty.textSize - }, - // 图标的颜色 - iconColor: { - type: String, - default: uni.$u.props.empty.iconColor - }, - // 图标的大小 - iconSize: { - type: [String, Number], - default: uni.$u.props.empty.iconSize - }, - // 选择预置的图标类型 - mode: { - type: String, - default: uni.$u.props.empty.mode - }, - // 图标宽度,单位px - width: { - type: [String, Number], - default: uni.$u.props.empty.width - }, - // 图标高度,单位px - height: { - type: [String, Number], - default: uni.$u.props.empty.height - }, - // 是否显示组件 - show: { - type: Boolean, - default: uni.$u.props.empty.show - }, - // 组件距离上一个元素之间的距离,默认px单位 - marginTop: { - type: [String, Number], - default: uni.$u.props.empty.marginTop - } - } -} diff --git a/uni_modules/uview-ui/components/u-empty/u-empty.vue b/uni_modules/uview-ui/components/u-empty/u-empty.vue deleted file mode 100644 index 03d6a273..00000000 --- a/uni_modules/uview-ui/components/u-empty/u-empty.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-form-item/props.js b/uni_modules/uview-ui/components/u-form-item/props.js deleted file mode 100644 index 7b166556..00000000 --- a/uni_modules/uview-ui/components/u-form-item/props.js +++ /dev/null @@ -1,48 +0,0 @@ -export default { - props: { - // input的label提示语 - label: { - type: String, - default: uni.$u.props.formItem.label - }, - // 绑定的值 - prop: { - type: String, - default: uni.$u.props.formItem.prop - }, - // 是否显示表单域的下划线边框 - borderBottom: { - type: [String, Boolean], - default: uni.$u.props.formItem.borderBottom - }, - // label的位置,left-左边,top-上边 - labelPosition: { - type: String, - default: uni.$u.props.formItem.labelPosition - }, - // label的宽度,单位px - labelWidth: { - type: [String, Number], - default: uni.$u.props.formItem.labelWidth - }, - // 右侧图标 - rightIcon: { - type: String, - default: uni.$u.props.formItem.rightIcon - }, - // 左侧图标 - leftIcon: { - type: String, - default: uni.$u.props.formItem.leftIcon - }, - // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置 - required: { - type: Boolean, - default: uni.$u.props.formItem.required - }, - leftIconStyle: { - type: [String, Object], - default: uni.$u.props.formItem.leftIconStyle, - } - } -} diff --git a/uni_modules/uview-ui/components/u-form-item/u-form-item.vue b/uni_modules/uview-ui/components/u-form-item/u-form-item.vue deleted file mode 100644 index 6aa8d690..00000000 --- a/uni_modules/uview-ui/components/u-form-item/u-form-item.vue +++ /dev/null @@ -1,235 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-form/props.js b/uni_modules/uview-ui/components/u-form/props.js deleted file mode 100644 index f2a629c0..00000000 --- a/uni_modules/uview-ui/components/u-form/props.js +++ /dev/null @@ -1,45 +0,0 @@ -export default { - props: { - // 当前form的需要验证字段的集合 - model: { - type: Object, - default: uni.$u.props.form.model - }, - // 验证规则 - rules: { - type: [Object, Function, Array], - default: uni.$u.props.form.rules - }, - // 有错误时的提示方式,message-提示信息,toast-进行toast提示 - // border-bottom-下边框呈现红色,none-无提示 - errorType: { - type: String, - default: uni.$u.props.form.errorType - }, - // 是否显示表单域的下划线边框 - borderBottom: { - type: Boolean, - default: uni.$u.props.form.borderBottom - }, - // label的位置,left-左边,top-上边 - labelPosition: { - type: String, - default: uni.$u.props.form.labelPosition - }, - // label的宽度,单位px - labelWidth: { - type: [String, Number], - default: uni.$u.props.form.labelWidth - }, - // lable字体的对齐方式 - labelAlign: { - type: String, - default: uni.$u.props.form.labelAlign - }, - // lable的样式,对象形式 - labelStyle: { - type: Object, - default: uni.$u.props.form.labelStyle - } - } -} diff --git a/uni_modules/uview-ui/components/u-form/u-form.vue b/uni_modules/uview-ui/components/u-form/u-form.vue deleted file mode 100644 index fe2dde2d..00000000 --- a/uni_modules/uview-ui/components/u-form/u-form.vue +++ /dev/null @@ -1,214 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-gap/props.js b/uni_modules/uview-ui/components/u-gap/props.js deleted file mode 100644 index 89953e32..00000000 --- a/uni_modules/uview-ui/components/u-gap/props.js +++ /dev/null @@ -1,24 +0,0 @@ -export default { - props: { - // 背景颜色(默认transparent) - bgColor: { - type: String, - default: uni.$u.props.gap.bgColor - }, - // 分割槽高度,单位px(默认30) - height: { - type: [String, Number], - default: uni.$u.props.gap.height - }, - // 与上一个组件的距离 - marginTop: { - type: [String, Number], - default: uni.$u.props.gap.marginTop - }, - // 与下一个组件的距离 - marginBottom: { - type: [String, Number], - default: uni.$u.props.gap.marginBottom - } - } -} diff --git a/uni_modules/uview-ui/components/u-gap/u-gap.vue b/uni_modules/uview-ui/components/u-gap/u-gap.vue deleted file mode 100644 index e4429f0e..00000000 --- a/uni_modules/uview-ui/components/u-gap/u-gap.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-grid-item/props.js b/uni_modules/uview-ui/components/u-grid-item/props.js deleted file mode 100644 index 06c3c663..00000000 --- a/uni_modules/uview-ui/components/u-grid-item/props.js +++ /dev/null @@ -1,14 +0,0 @@ -export default { - props: { - // 宫格的name - name: { - type: [String, Number, null], - default: uni.$u.props.gridItem.name - }, - // 背景颜色 - bgColor: { - type: String, - default: uni.$u.props.gridItem.bgColor - } - } -} diff --git a/uni_modules/uview-ui/components/u-grid-item/u-grid-item.vue b/uni_modules/uview-ui/components/u-grid-item/u-grid-item.vue deleted file mode 100644 index fc0c7cf1..00000000 --- a/uni_modules/uview-ui/components/u-grid-item/u-grid-item.vue +++ /dev/null @@ -1,209 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-grid/props.js b/uni_modules/uview-ui/components/u-grid/props.js deleted file mode 100644 index 87b0f6a7..00000000 --- a/uni_modules/uview-ui/components/u-grid/props.js +++ /dev/null @@ -1,19 +0,0 @@ -export default { - props: { - // 分成几列 - col: { - type: [String, Number], - default: uni.$u.props.grid.col - }, - // 是否显示边框 - border: { - type: Boolean, - default: uni.$u.props.grid.border - }, - // 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右 - align: { - type: String, - default: uni.$u.props.grid.align - } - } -} diff --git a/uni_modules/uview-ui/components/u-grid/u-grid.vue b/uni_modules/uview-ui/components/u-grid/u-grid.vue deleted file mode 100644 index b43cc270..00000000 --- a/uni_modules/uview-ui/components/u-grid/u-grid.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-icon/icons.js b/uni_modules/uview-ui/components/u-icon/icons.js deleted file mode 100644 index f4d0fe29..00000000 --- a/uni_modules/uview-ui/components/u-icon/icons.js +++ /dev/null @@ -1,214 +0,0 @@ -export default { - 'uicon-level': '\ue693', - 'uicon-column-line': '\ue68e', - 'uicon-checkbox-mark': '\ue807', - 'uicon-folder': '\ue7f5', - 'uicon-movie': '\ue7f6', - 'uicon-star-fill': '\ue669', - 'uicon-star': '\ue65f', - 'uicon-phone-fill': '\ue64f', - 'uicon-phone': '\ue622', - 'uicon-apple-fill': '\ue881', - 'uicon-chrome-circle-fill': '\ue885', - 'uicon-backspace': '\ue67b', - 'uicon-attach': '\ue632', - 'uicon-cut': '\ue948', - 'uicon-empty-car': '\ue602', - 'uicon-empty-coupon': '\ue682', - 'uicon-empty-address': '\ue646', - 'uicon-empty-favor': '\ue67c', - 'uicon-empty-permission': '\ue686', - 'uicon-empty-news': '\ue687', - 'uicon-empty-search': '\ue664', - 'uicon-github-circle-fill': '\ue887', - 'uicon-rmb': '\ue608', - 'uicon-person-delete-fill': '\ue66a', - 'uicon-reload': '\ue788', - 'uicon-order': '\ue68f', - 'uicon-server-man': '\ue6bc', - 'uicon-search': '\ue62a', - 'uicon-fingerprint': '\ue955', - 'uicon-more-dot-fill': '\ue630', - 'uicon-scan': '\ue662', - 'uicon-share-square': '\ue60b', - 'uicon-map': '\ue61d', - 'uicon-map-fill': '\ue64e', - 'uicon-tags': '\ue629', - 'uicon-tags-fill': '\ue651', - 'uicon-bookmark-fill': '\ue63b', - 'uicon-bookmark': '\ue60a', - 'uicon-eye': '\ue613', - 'uicon-eye-fill': '\ue641', - 'uicon-mic': '\ue64a', - 'uicon-mic-off': '\ue649', - 'uicon-calendar': '\ue66e', - 'uicon-calendar-fill': '\ue634', - 'uicon-trash': '\ue623', - 'uicon-trash-fill': '\ue658', - 'uicon-play-left': '\ue66d', - 'uicon-play-right': '\ue610', - 'uicon-minus': '\ue618', - 'uicon-plus': '\ue62d', - 'uicon-info': '\ue653', - 'uicon-info-circle': '\ue7d2', - 'uicon-info-circle-fill': '\ue64b', - 'uicon-question': '\ue715', - 'uicon-error': '\ue6d3', - 'uicon-close': '\ue685', - 'uicon-checkmark': '\ue6a8', - 'uicon-android-circle-fill': '\ue67e', - 'uicon-android-fill': '\ue67d', - 'uicon-ie': '\ue87b', - 'uicon-IE-circle-fill': '\ue889', - 'uicon-google': '\ue87a', - 'uicon-google-circle-fill': '\ue88a', - 'uicon-setting-fill': '\ue872', - 'uicon-setting': '\ue61f', - 'uicon-minus-square-fill': '\ue855', - 'uicon-plus-square-fill': '\ue856', - 'uicon-heart': '\ue7df', - 'uicon-heart-fill': '\ue851', - 'uicon-camera': '\ue7d7', - 'uicon-camera-fill': '\ue870', - 'uicon-more-circle': '\ue63e', - 'uicon-more-circle-fill': '\ue645', - 'uicon-chat': '\ue620', - 'uicon-chat-fill': '\ue61e', - 'uicon-bag-fill': '\ue617', - 'uicon-bag': '\ue619', - 'uicon-error-circle-fill': '\ue62c', - 'uicon-error-circle': '\ue624', - 'uicon-close-circle': '\ue63f', - 'uicon-close-circle-fill': '\ue637', - 'uicon-checkmark-circle': '\ue63d', - 'uicon-checkmark-circle-fill': '\ue635', - 'uicon-question-circle-fill': '\ue666', - 'uicon-question-circle': '\ue625', - 'uicon-share': '\ue631', - 'uicon-share-fill': '\ue65e', - 'uicon-shopping-cart': '\ue621', - 'uicon-shopping-cart-fill': '\ue65d', - 'uicon-bell': '\ue609', - 'uicon-bell-fill': '\ue640', - 'uicon-list': '\ue650', - 'uicon-list-dot': '\ue616', - 'uicon-zhihu': '\ue6ba', - 'uicon-zhihu-circle-fill': '\ue709', - 'uicon-zhifubao': '\ue6b9', - 'uicon-zhifubao-circle-fill': '\ue6b8', - 'uicon-weixin-circle-fill': '\ue6b1', - 'uicon-weixin-fill': '\ue6b2', - 'uicon-twitter-circle-fill': '\ue6ab', - 'uicon-twitter': '\ue6aa', - 'uicon-taobao-circle-fill': '\ue6a7', - 'uicon-taobao': '\ue6a6', - 'uicon-weibo-circle-fill': '\ue6a5', - 'uicon-weibo': '\ue6a4', - 'uicon-qq-fill': '\ue6a1', - 'uicon-qq-circle-fill': '\ue6a0', - 'uicon-moments-circel-fill': '\ue69a', - 'uicon-moments': '\ue69b', - 'uicon-qzone': '\ue695', - 'uicon-qzone-circle-fill': '\ue696', - 'uicon-baidu-circle-fill': '\ue680', - 'uicon-baidu': '\ue681', - 'uicon-facebook-circle-fill': '\ue68a', - 'uicon-facebook': '\ue689', - 'uicon-car': '\ue60c', - 'uicon-car-fill': '\ue636', - 'uicon-warning-fill': '\ue64d', - 'uicon-warning': '\ue694', - 'uicon-clock-fill': '\ue638', - 'uicon-clock': '\ue60f', - 'uicon-edit-pen': '\ue612', - 'uicon-edit-pen-fill': '\ue66b', - 'uicon-email': '\ue611', - 'uicon-email-fill': '\ue642', - 'uicon-minus-circle': '\ue61b', - 'uicon-minus-circle-fill': '\ue652', - 'uicon-plus-circle': '\ue62e', - 'uicon-plus-circle-fill': '\ue661', - 'uicon-file-text': '\ue663', - 'uicon-file-text-fill': '\ue665', - 'uicon-pushpin': '\ue7e3', - 'uicon-pushpin-fill': '\ue86e', - 'uicon-grid': '\ue673', - 'uicon-grid-fill': '\ue678', - 'uicon-play-circle': '\ue647', - 'uicon-play-circle-fill': '\ue655', - 'uicon-pause-circle-fill': '\ue654', - 'uicon-pause': '\ue8fa', - 'uicon-pause-circle': '\ue643', - 'uicon-eye-off': '\ue648', - 'uicon-eye-off-outline': '\ue62b', - 'uicon-gift-fill': '\ue65c', - 'uicon-gift': '\ue65b', - 'uicon-rmb-circle-fill': '\ue657', - 'uicon-rmb-circle': '\ue677', - 'uicon-kefu-ermai': '\ue656', - 'uicon-server-fill': '\ue751', - 'uicon-coupon-fill': '\ue8c4', - 'uicon-coupon': '\ue8ae', - 'uicon-integral': '\ue704', - 'uicon-integral-fill': '\ue703', - 'uicon-home-fill': '\ue964', - 'uicon-home': '\ue965', - 'uicon-hourglass-half-fill': '\ue966', - 'uicon-hourglass': '\ue967', - 'uicon-account': '\ue628', - 'uicon-plus-people-fill': '\ue626', - 'uicon-minus-people-fill': '\ue615', - 'uicon-account-fill': '\ue614', - 'uicon-thumb-down-fill': '\ue726', - 'uicon-thumb-down': '\ue727', - 'uicon-thumb-up': '\ue733', - 'uicon-thumb-up-fill': '\ue72f', - 'uicon-lock-fill': '\ue979', - 'uicon-lock-open': '\ue973', - 'uicon-lock-opened-fill': '\ue974', - 'uicon-lock': '\ue97a', - 'uicon-red-packet-fill': '\ue690', - 'uicon-photo-fill': '\ue98b', - 'uicon-photo': '\ue98d', - 'uicon-volume-off-fill': '\ue659', - 'uicon-volume-off': '\ue644', - 'uicon-volume-fill': '\ue670', - 'uicon-volume': '\ue633', - 'uicon-red-packet': '\ue691', - 'uicon-download': '\ue63c', - 'uicon-arrow-up-fill': '\ue6b0', - 'uicon-arrow-down-fill': '\ue600', - 'uicon-play-left-fill': '\ue675', - 'uicon-play-right-fill': '\ue676', - 'uicon-rewind-left-fill': '\ue679', - 'uicon-rewind-right-fill': '\ue67a', - 'uicon-arrow-downward': '\ue604', - 'uicon-arrow-leftward': '\ue601', - 'uicon-arrow-rightward': '\ue603', - 'uicon-arrow-upward': '\ue607', - 'uicon-arrow-down': '\ue60d', - 'uicon-arrow-right': '\ue605', - 'uicon-arrow-left': '\ue60e', - 'uicon-arrow-up': '\ue606', - 'uicon-skip-back-left': '\ue674', - 'uicon-skip-forward-right': '\ue672', - 'uicon-rewind-right': '\ue66f', - 'uicon-rewind-left': '\ue671', - 'uicon-arrow-right-double': '\ue68d', - 'uicon-arrow-left-double': '\ue68c', - 'uicon-wifi-off': '\ue668', - 'uicon-wifi': '\ue667', - 'uicon-empty-data': '\ue62f', - 'uicon-empty-history': '\ue684', - 'uicon-empty-list': '\ue68b', - 'uicon-empty-page': '\ue627', - 'uicon-empty-order': '\ue639', - 'uicon-man': '\ue697', - 'uicon-woman': '\ue69c', - 'uicon-man-add': '\ue61c', - 'uicon-man-add-fill': '\ue64c', - 'uicon-man-delete': '\ue61a', - 'uicon-man-delete-fill': '\ue66a', - 'uicon-zh': '\ue70a', - 'uicon-en': '\ue692' -} diff --git a/uni_modules/uview-ui/components/u-icon/props.js b/uni_modules/uview-ui/components/u-icon/props.js deleted file mode 100644 index 71845b7c..00000000 --- a/uni_modules/uview-ui/components/u-icon/props.js +++ /dev/null @@ -1,89 +0,0 @@ -export default { - props: { - // 图标类名 - name: { - type: String, - default: uni.$u.props.icon.name - }, - // 图标颜色,可接受主题色 - color: { - type: String, - default: uni.$u.props.icon.color - }, - // 字体大小,单位px - size: { - type: [String, Number], - default: uni.$u.props.icon.size - }, - // 是否显示粗体 - bold: { - type: Boolean, - default: uni.$u.props.icon.bold - }, - // 点击图标的时候传递事件出去的index(用于区分点击了哪一个) - index: { - type: [String, Number], - default: uni.$u.props.icon.index - }, - // 触摸图标时的类名 - hoverClass: { - type: String, - default: uni.$u.props.icon.hoverClass - }, - // 自定义扩展前缀,方便用户扩展自己的图标库 - customPrefix: { - type: String, - default: uni.$u.props.icon.customPrefix - }, - // 图标右边或者下面的文字 - label: { - type: [String, Number], - default: uni.$u.props.icon.label - }, - // label的位置,只能右边或者下边 - labelPos: { - type: String, - default: uni.$u.props.icon.labelPos - }, - // label的大小 - labelSize: { - type: [String, Number], - default: uni.$u.props.icon.labelSize - }, - // label的颜色 - labelColor: { - type: String, - default: uni.$u.props.icon.labelColor - }, - // label与图标的距离 - space: { - type: [String, Number], - default: uni.$u.props.icon.space - }, - // 图片的mode - imgMode: { - type: String, - default: uni.$u.props.icon.imgMode - }, - // 用于显示图片小图标时,图片的宽度 - width: { - type: [String, Number], - default: uni.$u.props.icon.width - }, - // 用于显示图片小图标时,图片的高度 - height: { - type: [String, Number], - default: uni.$u.props.icon.height - }, - // 用于解决某些情况下,让图标垂直居中的用途 - top: { - type: [String, Number], - default: uni.$u.props.icon.top - }, - // 是否阻止事件传播 - stop: { - type: Boolean, - default: uni.$u.props.icon.stop - } - } -} diff --git a/uni_modules/uview-ui/components/u-image/props.js b/uni_modules/uview-ui/components/u-image/props.js deleted file mode 100644 index 2eabb746..00000000 --- a/uni_modules/uview-ui/components/u-image/props.js +++ /dev/null @@ -1,84 +0,0 @@ -export default { - props: { - // 图片地址 - src: { - type: String, - default: uni.$u.props.image.src - }, - // 裁剪模式 - mode: { - type: String, - default: uni.$u.props.image.mode - }, - // 宽度,单位任意 - width: { - type: [String, Number], - default: uni.$u.props.image.width - }, - // 高度,单位任意 - height: { - type: [String, Number], - default: uni.$u.props.image.height - }, - // 图片形状,circle-圆形,square-方形 - shape: { - type: String, - default: uni.$u.props.image.shape - }, - // 圆角,单位任意 - radius: { - type: [String, Number], - default: uni.$u.props.image.radius - }, - // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序 - lazyLoad: { - type: Boolean, - default: uni.$u.props.image.lazyLoad - }, - // 开启长按图片显示识别微信小程序码菜单 - showMenuByLongpress: { - type: Boolean, - default: uni.$u.props.image.showMenuByLongpress - }, - // 加载中的图标,或者小图片 - loadingIcon: { - type: String, - default: uni.$u.props.image.loadingIcon - }, - // 加载失败的图标,或者小图片 - errorIcon: { - type: String, - default: uni.$u.props.image.errorIcon - }, - // 是否显示加载中的图标或者自定义的slot - showLoading: { - type: Boolean, - default: uni.$u.props.image.showLoading - }, - // 是否显示加载错误的图标或者自定义的slot - showError: { - type: Boolean, - default: uni.$u.props.image.showError - }, - // 是否需要淡入效果 - fade: { - type: Boolean, - default: uni.$u.props.image.fade - }, - // 只支持网络资源,只对微信小程序有效 - webp: { - type: Boolean, - default: uni.$u.props.image.webp - }, - // 过渡时间,单位ms - duration: { - type: [String, Number], - default: uni.$u.props.image.duration - }, - // 背景颜色,用于深色页面加载图片时,为了和背景色融合 - bgColor: { - type: String, - default: uni.$u.props.image.bgColor - } - } -} diff --git a/uni_modules/uview-ui/components/u-image/u-image.vue b/uni_modules/uview-ui/components/u-image/u-image.vue deleted file mode 100644 index 473e35b4..00000000 --- a/uni_modules/uview-ui/components/u-image/u-image.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-index-anchor/props.js b/uni_modules/uview-ui/components/u-index-anchor/props.js deleted file mode 100644 index 6d8b59a7..00000000 --- a/uni_modules/uview-ui/components/u-index-anchor/props.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - props: { - // 列表锚点文本内容 - text: { - type: [String, Number], - default: uni.$u.props.indexAnchor.text - }, - // 列表锚点文字颜色 - color: { - type: String, - default: uni.$u.props.indexAnchor.color - }, - // 列表锚点文字大小,单位默认px - size: { - type: [String, Number], - default: uni.$u.props.indexAnchor.size - }, - // 列表锚点背景颜色 - bgColor: { - type: String, - default: uni.$u.props.indexAnchor.bgColor - }, - // 列表锚点高度,单位默认px - height: { - type: [String, Number], - default: uni.$u.props.indexAnchor.height - } - } -} diff --git a/uni_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue b/uni_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue deleted file mode 100644 index b95ddef9..00000000 --- a/uni_modules/uview-ui/components/u-index-anchor/u-index-anchor.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-index-item/props.js b/uni_modules/uview-ui/components/u-index-item/props.js deleted file mode 100644 index 7c113311..00000000 --- a/uni_modules/uview-ui/components/u-index-item/props.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - props: { - - } -} diff --git a/uni_modules/uview-ui/components/u-index-item/u-index-item.vue b/uni_modules/uview-ui/components/u-index-item/u-index-item.vue deleted file mode 100644 index 0bc7fb3c..00000000 --- a/uni_modules/uview-ui/components/u-index-item/u-index-item.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-index-list/props.js b/uni_modules/uview-ui/components/u-index-list/props.js deleted file mode 100644 index 354d4591..00000000 --- a/uni_modules/uview-ui/components/u-index-list/props.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - props: { - // 右边锚点非激活的颜色 - inactiveColor: { - type: String, - default: uni.$u.props.indexList.inactiveColor - }, - // 右边锚点激活的颜色 - activeColor: { - type: String, - default: uni.$u.props.indexList.activeColor - }, - // 索引字符列表,数组形式 - indexList: { - type: Array, - default: uni.$u.props.indexList.indexList - }, - // 是否开启锚点自动吸顶 - sticky: { - type: Boolean, - default: uni.$u.props.indexList.sticky - }, - // 自定义导航栏的高度 - customNavHeight: { - type: [String, Number], - default: uni.$u.props.indexList.customNavHeight - } - } -} diff --git a/uni_modules/uview-ui/components/u-index-list/u-index-list.vue b/uni_modules/uview-ui/components/u-index-list/u-index-list.vue deleted file mode 100644 index d7126185..00000000 --- a/uni_modules/uview-ui/components/u-index-list/u-index-list.vue +++ /dev/null @@ -1,440 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-input/u-input.vue b/uni_modules/uview-ui/components/u-input/u-input.vue deleted file mode 100644 index 4c837574..00000000 --- a/uni_modules/uview-ui/components/u-input/u-input.vue +++ /dev/null @@ -1,354 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-keyboard/props.js b/uni_modules/uview-ui/components/u-keyboard/props.js deleted file mode 100644 index cfdb00ac..00000000 --- a/uni_modules/uview-ui/components/u-keyboard/props.js +++ /dev/null @@ -1,84 +0,0 @@ -export default { - props: { - // 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘 - mode: { - type: String, - default: uni.$u.props.keyboard.mode - }, - // 是否显示键盘的"."符号 - dotDisabled: { - type: Boolean, - default: uni.$u.props.keyboard.dotDisabled - }, - // 是否显示顶部工具条 - tooltip: { - type: Boolean, - default: uni.$u.props.keyboard.tooltip - }, - // 是否显示工具条中间的提示 - showTips: { - type: Boolean, - default: uni.$u.props.keyboard.showTips - }, - // 工具条中间的提示文字 - tips: { - type: String, - default: uni.$u.props.keyboard.tips - }, - // 是否显示工具条左边的"取消"按钮 - showCancel: { - type: Boolean, - default: uni.$u.props.keyboard.showCancel - }, - // 是否显示工具条右边的"完成"按钮 - showConfirm: { - type: Boolean, - default: uni.$u.props.keyboard.showConfirm - }, - // 是否打乱键盘按键的顺序 - random: { - type: Boolean, - default: uni.$u.props.keyboard.random - }, - // 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距 - safeAreaInsetBottom: { - type: Boolean, - default: uni.$u.props.keyboard.safeAreaInsetBottom - }, - // 是否允许通过点击遮罩关闭键盘 - closeOnClickOverlay: { - type: Boolean, - default: uni.$u.props.keyboard.closeOnClickOverlay - }, - // 控制键盘的弹出与收起 - show: { - type: Boolean, - default: uni.$u.props.keyboard.show - }, - // 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩 - overlay: { - type: Boolean, - default: uni.$u.props.keyboard.overlay - }, - // z-index值 - zIndex: { - type: [String, Number], - default: uni.$u.props.keyboard.zIndex - }, - // 取消按钮的文字 - cancelText: { - type: String, - default: uni.$u.props.keyboard.cancelText - }, - // 确认按钮的文字 - confirmText: { - type: String, - default: uni.$u.props.keyboard.confirmText - }, - // 输入一个中文后,是否自动切换到英文 - autoChange: { - type: Boolean, - default: uni.$u.props.keyboard.autoChange - } - } -} diff --git a/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue b/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue deleted file mode 100644 index 14228cbf..00000000 --- a/uni_modules/uview-ui/components/u-keyboard/u-keyboard.vue +++ /dev/null @@ -1,164 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-line-progress/props.js b/uni_modules/uview-ui/components/u-line-progress/props.js deleted file mode 100644 index a4210bdf..00000000 --- a/uni_modules/uview-ui/components/u-line-progress/props.js +++ /dev/null @@ -1,28 +0,0 @@ -export default { - props: { - // 激活部分的颜色 - activeColor: { - type: String, - default: uni.$u.props.lineProgress.activeColor - }, - inactiveColor: { - type: String, - default: uni.$u.props.lineProgress.color - }, - // 进度百分比,数值 - percentage: { - type: [String, Number], - default: uni.$u.props.lineProgress.inactiveColor - }, - // 是否在进度条内部显示百分比的值 - showText: { - type: Boolean, - default: uni.$u.props.lineProgress.showText - }, - // 进度条的高度,单位px - height: { - type: [String, Number], - default: uni.$u.props.lineProgress.height - } - } -} diff --git a/uni_modules/uview-ui/components/u-line-progress/u-line-progress.vue b/uni_modules/uview-ui/components/u-line-progress/u-line-progress.vue deleted file mode 100644 index 4e279310..00000000 --- a/uni_modules/uview-ui/components/u-line-progress/u-line-progress.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-line/props.js b/uni_modules/uview-ui/components/u-line/props.js deleted file mode 100644 index 2308cc36..00000000 --- a/uni_modules/uview-ui/components/u-line/props.js +++ /dev/null @@ -1,33 +0,0 @@ -export default { - props: { - color: { - type: String, - default: uni.$u.props.line.color - }, - // 长度,竖向时表现为高度,横向时表现为长度,可以为百分比,带px单位的值等 - length: { - type: [String, Number], - default: uni.$u.props.line.length - }, - // 线条方向,col-竖向,row-横向 - direction: { - type: String, - default: uni.$u.props.line.direction - }, - // 是否显示细边框 - hairline: { - type: Boolean, - default: uni.$u.props.line.hairline - }, - // 线条与上下左右元素的间距,字符串形式,如"30px"、"20px 30px" - margin: { - type: [String, Number], - default: uni.$u.props.line.margin - }, - // 是否虚线,true-虚线,false-实线 - dashed: { - type: Boolean, - default: uni.$u.props.line.dashed - } - } -} diff --git a/uni_modules/uview-ui/components/u-line/u-line.vue b/uni_modules/uview-ui/components/u-line/u-line.vue deleted file mode 100644 index e0a6d925..00000000 --- a/uni_modules/uview-ui/components/u-line/u-line.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-link/props.js b/uni_modules/uview-ui/components/u-link/props.js deleted file mode 100644 index d39353f1..00000000 --- a/uni_modules/uview-ui/components/u-link/props.js +++ /dev/null @@ -1,39 +0,0 @@ -export default { - props: { - // 文字颜色 - color: { - type: String, - default: uni.$u.props.link.color - }, - // 字体大小,单位px - fontSize: { - type: [String, Number], - default: uni.$u.props.link.fontSize - }, - // 是否显示下划线 - underLine: { - type: Boolean, - default: uni.$u.props.link.underLine - }, - // 要跳转的链接 - href: { - type: String, - default: uni.$u.props.link.href - }, - // 小程序中复制到粘贴板的提示语 - mpTips: { - type: String, - default: uni.$u.props.link.mpTips - }, - // 下划线颜色 - lineColor: { - type: String, - default: uni.$u.props.link.lineColor - }, - // 超链接的问题,不使用slot形式传入,是因为nvue下无法修改颜色 - text: { - type: String, - default: uni.$u.props.link.text - } - } -} diff --git a/uni_modules/uview-ui/components/u-link/u-link.vue b/uni_modules/uview-ui/components/u-link/u-link.vue deleted file mode 100644 index c6802a56..00000000 --- a/uni_modules/uview-ui/components/u-link/u-link.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-list-item/props.js b/uni_modules/uview-ui/components/u-list-item/props.js deleted file mode 100644 index 58ddc493..00000000 --- a/uni_modules/uview-ui/components/u-list-item/props.js +++ /dev/null @@ -1,9 +0,0 @@ -export default { - props: { - // 用于滚动到指定item - anchor: { - type: [String, Number], - default: uni.$u.props.listItem.anchor - } - } -} diff --git a/uni_modules/uview-ui/components/u-list-item/u-list-item.vue b/uni_modules/uview-ui/components/u-list-item/u-list-item.vue deleted file mode 100644 index 1a25db65..00000000 --- a/uni_modules/uview-ui/components/u-list-item/u-list-item.vue +++ /dev/null @@ -1,116 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-list/props.js b/uni_modules/uview-ui/components/u-list/props.js deleted file mode 100644 index 25406f4e..00000000 --- a/uni_modules/uview-ui/components/u-list/props.js +++ /dev/null @@ -1,76 +0,0 @@ -export default { - props: { - // 控制是否出现滚动条,仅nvue有效 - showScrollbar: { - type: Boolean, - default: uni.$u.props.list.showScrollbar - }, - // 距底部多少时触发scrolltolower事件 - lowerThreshold: { - type: [String, Number], - default: uni.$u.props.list.lowerThreshold - }, - // 距顶部多少时触发scrolltoupper事件,非nvue有效 - upperThreshold: { - type: [String, Number], - default: uni.$u.props.list.upperThreshold - }, - // 设置竖向滚动条位置 - scrollTop: { - type: [String, Number], - default: uni.$u.props.list.scrollTop - }, - // 控制 onscroll 事件触发的频率,仅nvue有效 - offsetAccuracy: { - type: [String, Number], - default: uni.$u.props.list.offsetAccuracy - }, - // 启用 flexbox 布局。开启后,当前节点声明了display: flex就会成为flex container,并作用于其孩子节点,仅微信小程序有效 - enableFlex: { - type: Boolean, - default: uni.$u.props.list.enableFlex - }, - // 是否按分页模式显示List,默认值false - pagingEnabled: { - type: Boolean, - default: uni.$u.props.list.pagingEnabled - }, - // 是否允许List滚动 - scrollable: { - type: Boolean, - default: uni.$u.props.list.scrollable - }, - // 值应为某子元素id(id不能以数字开头) - scrollIntoView: { - type: String, - default: uni.$u.props.list.scrollIntoView - }, - // 在设置滚动条位置时使用动画过渡 - scrollWithAnimation: { - type: Boolean, - default: uni.$u.props.list.scrollWithAnimation - }, - // iOS点击顶部状态栏、安卓双击标题栏时,滚动条返回顶部,只对微信小程序有效 - enableBackToTop: { - type: Boolean, - default: uni.$u.props.list.enableBackToTop - }, - // 列表的高度 - height: { - type: [String, Number], - default: uni.$u.props.list.height - }, - // 列表宽度 - width: { - type: [String, Number], - default: uni.$u.props.list.width - }, - // 列表前后预渲染的屏数,1代表一个屏幕的高度,1.5代表1个半屏幕高度 - preLoadScreen: { - type: [String, Number], - default: uni.$u.props.list.preLoadScreen - } - // vue下,是否开启虚拟列表 - - } -} diff --git a/uni_modules/uview-ui/components/u-list/u-list.vue b/uni_modules/uview-ui/components/u-list/u-list.vue deleted file mode 100644 index 4447cab6..00000000 --- a/uni_modules/uview-ui/components/u-list/u-list.vue +++ /dev/null @@ -1,157 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-loading-icon/props.js b/uni_modules/uview-ui/components/u-loading-icon/props.js deleted file mode 100644 index c35524e2..00000000 --- a/uni_modules/uview-ui/components/u-loading-icon/props.js +++ /dev/null @@ -1,59 +0,0 @@ -export default { - props: { - // 是否显示组件 - show: { - type: Boolean, - default: uni.$u.props.loadingIcon.show - }, - // 颜色 - color: { - type: String, - default: uni.$u.props.loadingIcon.color - }, - // 提示文字颜色 - textColor: { - type: String, - default: uni.$u.props.loadingIcon.textColor - }, - // 文字和图标是否垂直排列 - vertical: { - type: Boolean, - default: uni.$u.props.loadingIcon.vertical - }, - // 模式选择,circle-圆形,spinner-花朵形,semicircle-半圆形 - mode: { - type: String, - default: uni.$u.props.loadingIcon.mode - }, - // 图标大小,单位默认px - size: { - type: [String, Number], - default: uni.$u.props.loadingIcon.size - }, - // 文字大小 - textSize: { - type: [String, Number], - default: uni.$u.props.loadingIcon.textSize - }, - // 文字内容 - text: { - type: [String, Number], - default: uni.$u.props.loadingIcon.text - }, - // 动画模式 - timingFunction: { - type: String, - default: uni.$u.props.loadingIcon.timingFunction - }, - // 动画执行周期时间 - duration: { - type: [String, Number], - default: uni.$u.props.loadingIcon.duration - }, - // mode=circle时的暗边颜色 - inactiveColor: { - type: String, - default: uni.$u.props.loadingIcon.inactiveColor - } - } -} diff --git a/uni_modules/uview-ui/components/u-loading-page/props.js b/uni_modules/uview-ui/components/u-loading-page/props.js deleted file mode 100644 index e239b612..00000000 --- a/uni_modules/uview-ui/components/u-loading-page/props.js +++ /dev/null @@ -1,49 +0,0 @@ -export default { - props: { - // 提示内容 - loadingText: { - type: [String, Number], - default: uni.$u.props.loadingPage.loadingText - }, - // 文字上方用于替换loading动画的图片 - image: { - type: String, - default: uni.$u.props.loadingPage.image - }, - // 加载动画的模式,circle-圆形,spinner-花朵形,semicircle-半圆形 - loadingMode: { - type: String, - default: uni.$u.props.loadingPage.loadingMode - }, - // 是否加载中 - loading: { - type: Boolean, - default: uni.$u.props.loadingPage.loading - }, - // 背景色 - bgColor: { - type: String, - default: uni.$u.props.loadingPage.bgColor - }, - // 文字颜色 - color: { - type: String, - default: uni.$u.props.loadingPage.color - }, - // 文字大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.loadingPage.fontSize - }, - // 图标大小 - iconSize: { - type: [String, Number], - default: uni.$u.props.loadingPage.fontSize - }, - // 加载中图标的颜色,只能rgb或者十六进制颜色值 - loadingColor: { - type: String, - default: uni.$u.props.loadingPage.loadingColor - } - } -} diff --git a/uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue b/uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue deleted file mode 100644 index 03a78ad8..00000000 --- a/uni_modules/uview-ui/components/u-loading-page/u-loading-page.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-loadmore/props.js b/uni_modules/uview-ui/components/u-loadmore/props.js deleted file mode 100644 index 1e67d891..00000000 --- a/uni_modules/uview-ui/components/u-loadmore/props.js +++ /dev/null @@ -1,94 +0,0 @@ -export default { - props: { - // 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态 - status: { - type: String, - default: uni.$u.props.loadmore.status - }, - // 组件背景色 - bgColor: { - type: String, - default: uni.$u.props.loadmore.bgColor - }, - // 是否显示加载中的图标 - icon: { - type: Boolean, - default: uni.$u.props.loadmore.icon - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.loadmore.fontSize - }, - // 图标大小 - iconSize: { - type: [String, Number], - default: uni.$u.props.loadmore.iconSize - }, - // 字体颜色 - color: { - type: String, - default: uni.$u.props.loadmore.color - }, - // 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆 - loadingIcon: { - type: String, - default: uni.$u.props.loadmore.loadingIcon - }, - // 加载前的提示语 - loadmoreText: { - type: String, - default: uni.$u.props.loadmore.loadmoreText - }, - // 加载中提示语 - loadingText: { - type: String, - default: uni.$u.props.loadmore.loadingText - }, - // 没有更多的提示语 - nomoreText: { - type: String, - default: uni.$u.props.loadmore.nomoreText - }, - // 在“没有更多”状态下,是否显示粗点 - isDot: { - type: Boolean, - default: uni.$u.props.loadmore.isDot - }, - // 加载中图标的颜色 - iconColor: { - type: String, - default: uni.$u.props.loadmore.iconColor - }, - // 上边距 - marginTop: { - type: [String, Number], - default: uni.$u.props.loadmore.marginTop - }, - // 下边距 - marginBottom: { - type: [String, Number], - default: uni.$u.props.loadmore.marginBottom - }, - // 高度,单位px - height: { - type: [String, Number], - default: uni.$u.props.loadmore.height - }, - // 是否显示左边分割线 - line: { - type: Boolean, - default: uni.$u.props.loadmore.line - }, - // 线条颜色 - lineColor: { - type: String, - default: uni.$u.props.loadmore.lineColor - }, - // 是否虚线,true-虚线,false-实线 - dashed: { - type: Boolean, - default: uni.$u.props.loadmore.dashed - } - } -} diff --git a/uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue b/uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue deleted file mode 100644 index 73c79fef..00000000 --- a/uni_modules/uview-ui/components/u-loadmore/u-loadmore.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-modal/props.js b/uni_modules/uview-ui/components/u-modal/props.js deleted file mode 100644 index 94b30781..00000000 --- a/uni_modules/uview-ui/components/u-modal/props.js +++ /dev/null @@ -1,89 +0,0 @@ -export default { - props: { - // 是否展示modal - show: { - type: Boolean, - default: uni.$u.props.modal.show - }, - // 标题 - title: { - type: [String], - default: uni.$u.props.modal.title - }, - // 弹窗内容 - content: { - type: String, - default: uni.$u.props.modal.content - }, - // 确认文案 - confirmText: { - type: String, - default: uni.$u.props.modal.confirmText - }, - // 取消文案 - cancelText: { - type: String, - default: uni.$u.props.modal.cancelText - }, - // 是否显示确认按钮 - showConfirmButton: { - type: Boolean, - default: uni.$u.props.modal.showConfirmButton - }, - // 是否显示取消按钮 - showCancelButton: { - type: Boolean, - default: uni.$u.props.modal.showCancelButton - }, - // 确认按钮颜色 - confirmColor: { - type: String, - default: uni.$u.props.modal.confirmColor - }, - // 取消文字颜色 - cancelColor: { - type: String, - default: uni.$u.props.modal.cancelColor - }, - // 对调确认和取消的位置 - buttonReverse: { - type: Boolean, - default: uni.$u.props.modal.buttonReverse - }, - // 是否开启缩放效果 - zoom: { - type: Boolean, - default: uni.$u.props.modal.zoom - }, - // 是否异步关闭,只对确定按钮有效 - asyncClose: { - type: Boolean, - default: uni.$u.props.modal.asyncClose - }, - // 是否允许点击遮罩关闭modal - closeOnClickOverlay: { - type: Boolean, - default: uni.$u.props.modal.closeOnClickOverlay - }, - // 给一个负的margin-top,往上偏移,避免和键盘重合的情况 - negativeTop: { - type: [String, Number], - default: uni.$u.props.modal.negativeTop - }, - // modal宽度,不支持百分比,可以数值,px,rpx单位 - width: { - type: [String, Number], - default: uni.$u.props.modal.width - }, - // 确认按钮的样式,circle-圆形,square-方形,如设置,将不会显示取消按钮 - confirmButtonShape: { - type: String, - default: uni.$u.props.modal.confirmButtonShape - }, - // 弹窗动画过度时间 - duration:{ - type:String | Number, - default: uni.$u.props.modal.duration - } - } -} diff --git a/uni_modules/uview-ui/components/u-modal/u-modal.vue b/uni_modules/uview-ui/components/u-modal/u-modal.vue deleted file mode 100644 index 72e1ed22..00000000 --- a/uni_modules/uview-ui/components/u-modal/u-modal.vue +++ /dev/null @@ -1,228 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-navbar/props.js b/uni_modules/uview-ui/components/u-navbar/props.js deleted file mode 100644 index 5398de28..00000000 --- a/uni_modules/uview-ui/components/u-navbar/props.js +++ /dev/null @@ -1,84 +0,0 @@ -export default { - props: { - // 是否开启顶部安全区适配 - safeAreaInsetTop: { - type: Boolean, - default: uni.$u.props.navbar.safeAreaInsetTop - }, - // 固定在顶部时,是否生成一个等高元素,以防止塌陷 - placeholder: { - type: Boolean, - default: uni.$u.props.navbar.placeholder - }, - // 是否固定在顶部 - fixed: { - type: Boolean, - default: uni.$u.props.navbar.fixed - }, - // 是否显示下边框 - border: { - type: Boolean, - default: uni.$u.props.navbar.border - }, - // 左边的图标 - leftIcon: { - type: String, - default: uni.$u.props.navbar.leftIcon - }, - // 左边的提示文字 - leftText: { - type: String, - default: uni.$u.props.navbar.leftText - }, - // 左右的提示文字 - rightText: { - type: String, - default: uni.$u.props.navbar.rightText - }, - // 右边的图标 - rightIcon: { - type: String, - default: uni.$u.props.navbar.rightIcon - }, - // 标题 - title: { - type: [String, Number], - default: uni.$u.props.navbar.title - }, - // 背景颜色 - bgColor: { - type: String, - default: uni.$u.props.navbar.bgColor - }, - // 标题的宽度 - titleWidth: { - type: [String, Number], - default: uni.$u.props.navbar.titleWidth - }, - // 导航栏高度 - height: { - type: [String, Number], - default: uni.$u.props.navbar.height - }, - // 左侧返回图标的大小 - leftIconSize: { - type: [String, Number], - default: uni.$u.props.navbar.leftIconSize - }, - // 左侧返回图标的颜色 - leftIconColor: { - type: String, - default: uni.$u.props.navbar.leftIconColor - }, - // 点击左侧区域(返回图标),是否自动返回上一页 - autoBack: { - type: Boolean, - default: uni.$u.props.navbar.autoBack - }, - // 标题的样式,对象或字符串 - titleStyle: { - type: [String, Object], - default: uni.$u.props.navbar.titleStyle - } - } -} diff --git a/uni_modules/uview-ui/components/u-navbar/u-navbar.vue b/uni_modules/uview-ui/components/u-navbar/u-navbar.vue deleted file mode 100644 index 2b206b7d..00000000 --- a/uni_modules/uview-ui/components/u-navbar/u-navbar.vue +++ /dev/null @@ -1,186 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-no-network/props.js b/uni_modules/uview-ui/components/u-no-network/props.js deleted file mode 100644 index 9f3af62c..00000000 --- a/uni_modules/uview-ui/components/u-no-network/props.js +++ /dev/null @@ -1,19 +0,0 @@ -export default { - props: { - // 页面文字提示 - tips: { - type: String, - default: uni.$u.props.noNetwork.tips - }, - // 一个z-index值,用于设置没有网络这个组件的层次,因为页面可能会有其他定位的元素层级过高,导致此组件被覆盖 - zIndex: { - type: [String, Number], - default: uni.$u.props.noNetwork.zIndex - }, - // image 没有网络的图片提示 - image: { - type: String, - default: uni.$u.props.noNetwork.image - } - } -} diff --git a/uni_modules/uview-ui/components/u-no-network/u-no-network.vue b/uni_modules/uview-ui/components/u-no-network/u-no-network.vue deleted file mode 100644 index 9710729e..00000000 --- a/uni_modules/uview-ui/components/u-no-network/u-no-network.vue +++ /dev/null @@ -1,220 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-notice-bar/props.js b/uni_modules/uview-ui/components/u-notice-bar/props.js deleted file mode 100644 index 7040c29a..00000000 --- a/uni_modules/uview-ui/components/u-notice-bar/props.js +++ /dev/null @@ -1,70 +0,0 @@ -export default { - props: { - // 显示的内容,数组 - text: { - type: [Array, String], - default: uni.$u.props.noticeBar.text - }, - // 通告滚动模式,row-横向滚动,column-竖向滚动 - direction: { - type: String, - default: uni.$u.props.noticeBar.direction - }, - // direction = row时,是否使用步进形式滚动 - step: { - type: Boolean, - default: uni.$u.props.noticeBar.step - }, - // 是否显示左侧的音量图标 - icon: { - type: String, - default: uni.$u.props.noticeBar.icon - }, - // 通告模式,link-显示右箭头,closable-显示右侧关闭图标 - mode: { - type: String, - default: uni.$u.props.noticeBar.mode - }, - // 文字颜色,各图标也会使用文字颜色 - color: { - type: String, - default: uni.$u.props.noticeBar.color - }, - // 背景颜色 - bgColor: { - type: String, - default: uni.$u.props.noticeBar.bgColor - }, - // 水平滚动时的滚动速度,即每秒滚动多少px(px),这有利于控制文字无论多少时,都能有一个恒定的速度 - speed: { - type: [String, Number], - default: uni.$u.props.noticeBar.speed - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.noticeBar.fontSize - }, - // 滚动一个周期的时间长,单位ms - duration: { - type: [String, Number], - default: uni.$u.props.noticeBar.duration - }, - // 是否禁止用手滑动切换 - // 目前HX2.6.11,只支持App 2.5.5+、H5 2.5.5+、支付宝小程序、字节跳动小程序 - disableTouch: { - type: Boolean, - default: uni.$u.props.noticeBar.disableTouch - }, - // 跳转的页面路径 - url: { - type: String, - default: uni.$u.props.noticeBar.url - }, - // 页面跳转的类型 - linkType: { - type: String, - default: uni.$u.props.noticeBar.linkType - } - } -} diff --git a/uni_modules/uview-ui/components/u-notify/props.js b/uni_modules/uview-ui/components/u-notify/props.js deleted file mode 100644 index 57a9d71e..00000000 --- a/uni_modules/uview-ui/components/u-notify/props.js +++ /dev/null @@ -1,49 +0,0 @@ -export default { - props: { - // 到顶部的距离 - top: { - type: [String, Number], - default: uni.$u.props.notify.top - }, - // 是否展示组件 - // show: { - // type: Boolean, - // default: uni.$u.props.notify.show - // }, - // type主题,primary,success,warning,error - type: { - type: String, - default: uni.$u.props.notify.type - }, - // 字体颜色 - color: { - type: String, - default: uni.$u.props.notify.color - }, - // 背景颜色 - bgColor: { - type: String, - default: uni.$u.props.notify.bgColor - }, - // 展示的文字内容 - message: { - type: String, - default: uni.$u.props.notify.message - }, - // 展示时长,为0时不消失,单位ms - duration: { - type: [String, Number], - default: uni.$u.props.notify.duration - }, - // 字体大小 - fontSize: { - type: [String, Number], - default: uni.$u.props.notify.fontSize - }, - // 是否留出顶部安全距离(状态栏高度) - safeAreaInsetTop: { - type: Boolean, - default: uni.$u.props.notify.safeAreaInsetTop - } - } -} diff --git a/uni_modules/uview-ui/components/u-notify/u-notify.vue b/uni_modules/uview-ui/components/u-notify/u-notify.vue deleted file mode 100644 index 30adb72f..00000000 --- a/uni_modules/uview-ui/components/u-notify/u-notify.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-number-box/props.js b/uni_modules/uview-ui/components/u-number-box/props.js deleted file mode 100644 index fb0fa947..00000000 --- a/uni_modules/uview-ui/components/u-number-box/props.js +++ /dev/null @@ -1,109 +0,0 @@ -export default { - props: { - // 步进器标识符,在change回调返回 - name: { - type: [String, Number], - default: uni.$u.props.numberBox.name - }, - // 用于双向绑定的值,初始化时设置设为默认min值(最小值) - value: { - type: [String, Number], - default: uni.$u.props.numberBox.value - }, - // 最小值 - min: { - type: [String, Number], - default: uni.$u.props.numberBox.min - }, - // 最大值 - max: { - type: [String, Number], - default: uni.$u.props.numberBox.max - }, - // 加减的步长,可为小数 - step: { - type: [String, Number], - default: uni.$u.props.numberBox.step - }, - // 是否只允许输入整数 - integer: { - type: Boolean, - default: uni.$u.props.numberBox.integer - }, - // 是否禁用,包括输入框,加减按钮 - disabled: { - type: Boolean, - default: uni.$u.props.numberBox.disabled - }, - // 是否禁用输入框 - disabledInput: { - type: Boolean, - default: uni.$u.props.numberBox.disabledInput - }, - // 是否开启异步变更,开启后需要手动控制输入值 - asyncChange: { - type: Boolean, - default: uni.$u.props.numberBox.asyncChange - }, - // 输入框宽度,单位为px - inputWidth: { - type: [String, Number], - default: uni.$u.props.numberBox.inputWidth - }, - // 是否显示减少按钮 - showMinus: { - type: Boolean, - default: uni.$u.props.numberBox.showMinus - }, - // 是否显示增加按钮 - showPlus: { - type: Boolean, - default: uni.$u.props.numberBox.showPlus - }, - // 显示的小数位数 - decimalLength: { - type: [String, Number, null], - default: uni.$u.props.numberBox.decimalLength - }, - // 是否开启长按加减手势 - longPress: { - type: Boolean, - default: uni.$u.props.numberBox.longPress - }, - // 输入框文字和加减按钮图标的颜色 - color: { - type: String, - default: uni.$u.props.numberBox.color - }, - // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致 - buttonSize: { - type: [String, Number], - default: uni.$u.props.numberBox.buttonSize - }, - // 输入框和按钮的背景颜色 - bgColor: { - type: String, - default: uni.$u.props.numberBox.bgColor - }, - // 指定光标于键盘的距离,避免键盘遮挡输入框,单位px - cursorSpacing: { - type: [String, Number], - default: uni.$u.props.numberBox.cursorSpacing - }, - // 是否禁用增加按钮 - disablePlus: { - type: Boolean, - default: uni.$u.props.numberBox.disablePlus - }, - // 是否禁用减少按钮 - disableMinus: { - type: Boolean, - default: uni.$u.props.numberBox.disableMinus - }, - // 加减按钮图标的样式 - iconStyle: { - type: [Object, String], - default: uni.$u.props.numberBox.iconStyle - } - } -} diff --git a/uni_modules/uview-ui/components/u-number-box/u-number-box.vue b/uni_modules/uview-ui/components/u-number-box/u-number-box.vue deleted file mode 100644 index 69211c54..00000000 --- a/uni_modules/uview-ui/components/u-number-box/u-number-box.vue +++ /dev/null @@ -1,416 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-number-keyboard/props.js b/uni_modules/uview-ui/components/u-number-keyboard/props.js deleted file mode 100644 index 5e3bf556..00000000 --- a/uni_modules/uview-ui/components/u-number-keyboard/props.js +++ /dev/null @@ -1,19 +0,0 @@ -export default { - props: { - // 键盘的类型,number-数字键盘,card-身份证键盘 - mode: { - type: String, - default: uni.$u.props.numberKeyboard.value - }, - // 是否显示键盘的"."符号 - dotDisabled: { - type: Boolean, - default: uni.$u.props.numberKeyboard.dotDisabled - }, - // 是否打乱键盘按键的顺序 - random: { - type: Boolean, - default: uni.$u.props.numberKeyboard.random - } - } -} diff --git a/uni_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue b/uni_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue deleted file mode 100644 index 4f505c6e..00000000 --- a/uni_modules/uview-ui/components/u-number-keyboard/u-number-keyboard.vue +++ /dev/null @@ -1,196 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-overlay/props.js b/uni_modules/uview-ui/components/u-overlay/props.js deleted file mode 100644 index e6974df9..00000000 --- a/uni_modules/uview-ui/components/u-overlay/props.js +++ /dev/null @@ -1,24 +0,0 @@ -export default { - props: { - // 是否显示遮罩 - show: { - type: Boolean, - default: uni.$u.props.overlay.show - }, - // 层级z-index - zIndex: { - type: [String, Number], - default: uni.$u.props.overlay.zIndex - }, - // 遮罩的过渡时间,单位为ms - duration: { - type: [String, Number], - default: uni.$u.props.overlay.duration - }, - // 不透明度值,当做rgba的第四个参数 - opacity: { - type: [String, Number], - default: uni.$u.props.overlay.opacity - } - } -} diff --git a/uni_modules/uview-ui/components/u-overlay/u-overlay.vue b/uni_modules/uview-ui/components/u-overlay/u-overlay.vue deleted file mode 100644 index 92de4e9f..00000000 --- a/uni_modules/uview-ui/components/u-overlay/u-overlay.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - diff --git a/uni_modules/uview-ui/components/u-parse/node/node.vue b/uni_modules/uview-ui/components/u-parse/node/node.vue deleted file mode 100644 index 73e30fd6..00000000 --- a/uni_modules/uview-ui/components/u-parse/node/node.vue +++ /dev/null @@ -1,499 +0,0 @@ -