Merge branch 'main' into ray-template-dev

This commit is contained in:
XiaoDaiGua-Ray 2023-08-04 10:10:55 +08:00
commit 660b61340d
7 changed files with 50 additions and 10 deletions

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# 将换行符设置为lf
* text eol=lf

View File

@ -6,9 +6,11 @@ jobs:
cache-and-install: cache-and-install:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false
matrix: matrix:
node-version: [ 16.x, 18.x ] node-version: [ 16.x, 18.x ]
os: [ ubuntu-latest, windows-latest, macos-latest ] os: [ ubuntu-latest, windows-latest, macos-latest ]
experimental: [ true ]
steps: steps:
- name: Checkout - name: Checkout
@ -22,7 +24,7 @@ jobs:
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
name: Install pnpm name: Install pnpm
with: with:
version: 7 version: 8
run_install: false run_install: false
- name: Get pnpm store directory - name: Get pnpm store directory

View File

@ -1,5 +1,14 @@
# CHANGE LOG # CHANGE LOG
## 4.1.5
### Fixes
- 修复 windows 平台下构建失败问题
- 修复换行符导致构建失败问题
- 修复特定 node pnpm 版本构建栈溢出问题
- 修复 `RayCollapseGrid` 组件 open 属性歧义问题
## 4.1.4 ## 4.1.4
该版本后,不会做破坏性更新了。版本功能趋于稳定,后续更新不会那么频繁了。。。。。 该版本后,不会做破坏性更新了。版本功能趋于稳定,后续更新不会那么频繁了。。。。。

View File

@ -1,7 +1,7 @@
{ {
"name": "ray-template", "name": "ray-template",
"private": false, "private": false,
"version": "4.1.4", "version": "4.1.5",
"type": "module", "type": "module",
"engines": { "engines": {
"node": ">=16.0.0", "node": ">=16.0.0",

View File

@ -22,7 +22,7 @@ const RayCollapseGrid = defineComponent({
name: 'RayCollapseGrid', name: 'RayCollapseGrid',
props: collapseGridProps, props: collapseGridProps,
setup(props) { setup(props) {
const modelCollapsed = ref(props.open) const modelCollapsed = ref(!props.open)
const handleCollapse = () => { const handleCollapse = () => {
modelCollapsed.value = !modelCollapsed.value modelCollapsed.value = !modelCollapsed.value

View File

@ -15,7 +15,7 @@ export const collapseGridProps = {
* `true` , `false` * `true` , `false`
*/ */
type: Boolean, type: Boolean,
default: true, default: false,
}, },
collapseToggleText: { collapseToggleText: {
/** /**

View File

@ -85,14 +85,28 @@ export const format = (
: currency(value, options).toString() : currency(value, options).toString()
} }
/** 加法 */ /**
*
*
*
* @example
* format(add(0.1, 0.2)) => 0.3
* format(add(0.2, 0.33)) => 0.53
*/
export const add = (...args: CurrencyArguments[]) => { export const add = (...args: CurrencyArguments[]) => {
return basic(args, 0, (pre, curr) => { return basic(args, 0, (pre, curr) => {
return currency(pre).add(curr) return currency(pre).add(curr)
}) })
} }
/** 减法 */ /**
*
*
*
* @example
* format(subtract(0.1, 0.12312)) => -0.02
* format(subtract(0.2, 0.33)) => -0.13
*/
export const subtract = (...args: CurrencyArguments[]) => { export const subtract = (...args: CurrencyArguments[]) => {
if (args.length === 2) { if (args.length === 2) {
const [one, two] = args const [one, two] = args
@ -112,14 +126,28 @@ export const subtract = (...args: CurrencyArguments[]) => {
}) })
} }
/** 乘法 */ /**
*
*
*
* @example
* format(multiply(1, 0.2)) => 0.2
* format(multiply(0.2, 0.33)) => 0.07
*/
export const multiply = (...args: CurrencyArguments[]) => { export const multiply = (...args: CurrencyArguments[]) => {
return basic(args, 1, (pre, curr) => { return basic(args, 1, (pre, curr) => {
return currency(pre).multiply(curr) return currency(pre).multiply(curr)
}) })
} }
/** 除法 */ /**
*
*
*
* @example
* format(divide(1, 0.2)) => 5
* format(divide(0.2, 0.33)) => 0.61
*/
export const divide = (...args: CurrencyArguments[]) => { export const divide = (...args: CurrencyArguments[]) => {
if (args.length === 2) { if (args.length === 2) {
const [one, two] = args const [one, two] = args
@ -144,10 +172,9 @@ export const divide = (...args: CurrencyArguments[]) => {
* () * ()
* undefind null 0 * undefind null 0
* *
* ``` * @example
* distribute(0, 1) => [0] * distribute(0, 1) => [0]
* distribute(0, 3) => [0, 0, 0] * distribute(0, 3) => [0, 0, 0]
* ```
*/ */
export const distribute = ( export const distribute = (
value: CurrencyArguments, value: CurrencyArguments,