shujie-ui 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -26
- package/dist/shujie-ui.css +1 -1
- package/dist/shujie-ui.es.js +271 -42
- package/dist/shujie-ui.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,60 +19,74 @@ npm install shujie-ui
|
|
|
19
19
|
|
|
20
20
|
## 快速上手
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### 1. 全局引入(推荐,适合从 npm 安装)
|
|
23
|
+
|
|
24
|
+
npm 包内主要包含 **打包后的 `dist`**,组件样式集中在 **`dist/shujie-ui.css`**。在 UniApp **Vue 3** 项目的 `main.ts`(或 `main.js`)里:
|
|
23
25
|
|
|
24
26
|
```ts
|
|
25
|
-
// main.ts
|
|
26
27
|
import { createSSRApp } from 'vue'
|
|
28
|
+
import App from './App.vue'
|
|
27
29
|
import SjUI from 'shujie-ui'
|
|
28
30
|
import 'shujie-ui/dist/shujie-ui.css'
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
app
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### 按需引入(easycom)
|
|
35
|
-
|
|
36
|
-
在 `pages.json` 中配置:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"easycom": {
|
|
41
|
-
"custom": {
|
|
42
|
-
"^sj-(.*)": "shujie-ui/src/components/sj-$1/sj-$1.vue"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
32
|
+
export function createApp() {
|
|
33
|
+
const app = createSSRApp(App)
|
|
34
|
+
app.use(SjUI)
|
|
35
|
+
return { app }
|
|
45
36
|
}
|
|
46
37
|
```
|
|
47
38
|
|
|
48
|
-
|
|
39
|
+
之后在任意页面 **无需 import**,模板里直接用标签名(与文档一致,**`sj-` 前缀 + 短横线**):
|
|
49
40
|
|
|
50
41
|
```vue
|
|
51
42
|
<template>
|
|
52
|
-
<
|
|
43
|
+
<view class="page">
|
|
44
|
+
<sj-button type="primary">按钮</sj-button>
|
|
45
|
+
<sj-cell title="标题" value="内容" is-link />
|
|
46
|
+
</view>
|
|
53
47
|
</template>
|
|
54
48
|
```
|
|
55
49
|
|
|
56
|
-
###
|
|
50
|
+
### 2. 按需手动引入(不调用 `app.use`)
|
|
51
|
+
|
|
52
|
+
在页面或布局里 `import` 组件即可;**样式仍需在入口引一次**全局 CSS,否则无样式:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import 'shujie-ui/dist/shujie-ui.css'
|
|
56
|
+
```
|
|
57
57
|
|
|
58
58
|
```vue
|
|
59
|
-
<script setup>
|
|
60
|
-
import { SjButton } from 'shujie-ui'
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { SjButton, SjCell } from 'shujie-ui'
|
|
61
61
|
</script>
|
|
62
62
|
|
|
63
63
|
<template>
|
|
64
64
|
<sj-button type="primary">按钮</sj-button>
|
|
65
|
+
<SjCell title="标题" value="内容" />
|
|
65
66
|
</template>
|
|
66
67
|
```
|
|
67
68
|
|
|
69
|
+
### 3. easycom 自动扫描 `.vue`(仅当能访问源码路径时)
|
|
70
|
+
|
|
71
|
+
README 曾示例 `shujie-ui/src/components/...`,但 **当前发布到 npm 的包默认不包含 `src`**,该路径在 `node_modules` 里一般不存在。若要用 easycom 指到单文件组件,需要任选其一:
|
|
72
|
+
|
|
73
|
+
- 使用 **Git 子模块 / 本地拷贝 / `npm link`** 把仓库放进工程,并把 `pages.json` 的 `custom` 指到**你机器上真实的 `sj-*.vue` 路径**;或
|
|
74
|
+
- 后续若在 `package.json` 的 `files` 中增加 `src` 再发版,即可用类似规则指向包内源码。
|
|
75
|
+
|
|
76
|
+
在未包含源码的情况下,请使用上面的 **全局引入** 或 **按需 import + 入口 CSS**。
|
|
77
|
+
|
|
68
78
|
## 组件列表
|
|
69
79
|
|
|
70
80
|
| 组件 | 说明 |
|
|
71
81
|
|------|------|
|
|
72
|
-
| sj-button |
|
|
73
|
-
| sj-icon |
|
|
74
|
-
| sj-cell |
|
|
75
|
-
| sj-loading |
|
|
82
|
+
| sj-button | 按钮,多种类型/尺寸/形状/状态 |
|
|
83
|
+
| sj-icon | 图标(iconfont,需自行替换字体资源) |
|
|
84
|
+
| sj-cell | 单元格列表项 |
|
|
85
|
+
| sj-loading | 加载指示 |
|
|
86
|
+
| sj-divider | 分隔线 |
|
|
87
|
+
| sj-tag | 标签 |
|
|
88
|
+
| sj-badge | 徽标 |
|
|
89
|
+
| sj-space | 间距布局 |
|
|
76
90
|
|
|
77
91
|
## 设计系统
|
|
78
92
|
|
package/dist/shujie-ui.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.sj-button[data-v-d5bd5c39]{box-sizing:border-box;text-align:center;white-space:nowrap;appearance:none;cursor:pointer;border:none;outline:none;justify-content:center;align-items:center;margin:0;padding:0;font-weight:500;line-height:1;transition:all .3s cubic-bezier(.645,.045,.355,1);display:inline-flex}.sj-button--small[data-v-d5bd5c39]{height:56rpx;padding:0 24rpx;font-size:24rpx}.sj-button--medium[data-v-d5bd5c39]{height:72rpx;padding:0 32rpx;font-size:28rpx}.sj-button--large[data-v-d5bd5c39]{height:88rpx;padding:0 48rpx;font-size:32rpx}.sj-button--default[data-v-d5bd5c39]{color:#606266;border:1rpx solid #e4e7ed;background:#fff}.sj-button--primary[data-v-d5bd5c39]{color:#fff;background:#2979ff}.sj-button--success[data-v-d5bd5c39]{color:#fff;background:#19be6b}.sj-button--warning[data-v-d5bd5c39]{color:#fff;background:#f90}.sj-button--danger[data-v-d5bd5c39]{color:#fff;background:#fa3534}.sj-button--info[data-v-d5bd5c39]{color:#fff;background:#909399}.sj-button--square[data-v-d5bd5c39]{border-radius:8rpx}.sj-button--round[data-v-d5bd5c39]{border-radius:999rpx}.sj-button--circle[data-v-d5bd5c39]{border-radius:50%;padding:0}.sj-button--circle.sj-button--small[data-v-d5bd5c39]{width:56rpx}.sj-button--circle.sj-button--medium[data-v-d5bd5c39]{width:72rpx}.sj-button--circle.sj-button--large[data-v-d5bd5c39]{width:88rpx}.sj-button--plain[data-v-d5bd5c39]{background:0 0!important}.sj-button--plain.sj-button--primary[data-v-d5bd5c39]{color:#2979ff;border:1rpx solid #2979ff}.sj-button--plain.sj-button--success[data-v-d5bd5c39]{color:#19be6b;border:1rpx solid #19be6b}.sj-button--plain.sj-button--warning[data-v-d5bd5c39]{color:#f90;border:1rpx solid #f90}.sj-button--plain.sj-button--danger[data-v-d5bd5c39]{color:#fa3534;border:1rpx solid #fa3534}.sj-button--plain.sj-button--info[data-v-d5bd5c39]{color:#909399;border:1rpx solid #909399}.sj-button--hairline[data-v-d5bd5c39]{position:relative;border-width:0!important}.sj-button--hairline[data-v-d5bd5c39]:after{content:"";border-radius:inherit;border:1px solid inherit;pointer-events:none;transform-origin:0 0;position:absolute;inset:0;transform:scale(.5)}.sj-button--hairline.sj-button--default[data-v-d5bd5c39]:after{border-color:#e4e7ed}.sj-button--hairline.sj-button--primary[data-v-d5bd5c39]:after{border-color:#2979ff}.sj-button--hairline.sj-button--success[data-v-d5bd5c39]:after{border-color:#19be6b}.sj-button--hairline.sj-button--warning[data-v-d5bd5c39]:after{border-color:#f90}.sj-button--hairline.sj-button--danger[data-v-d5bd5c39]:after{border-color:#fa3534}.sj-button--hairline.sj-button--info[data-v-d5bd5c39]:after{border-color:#909399}.sj-button--disabled[data-v-d5bd5c39]{opacity:.5;cursor:not-allowed;pointer-events:none}.sj-button--loading[data-v-d5bd5c39]{cursor:default}.sj-button--block[data-v-d5bd5c39]{width:100%;display:flex}.sj-button--active[data-v-d5bd5c39]{opacity:.7}.sj-button__icon[data-v-d5bd5c39],.sj-button__loading[data-v-d5bd5c39]{margin-right:8rpx}.sj-button__loading-spinner[data-v-d5bd5c39]{width:32rpx;height:32rpx;border:4rpx solid currentColor;border-top-color:#0000;border-radius:50%;animation:.6s linear infinite sj-spin-d5bd5c39}.sj-button__text[data-v-d5bd5c39]{align-items:center;display:flex}@keyframes sj-spin-d5bd5c39{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sj-cell[data-v-17f18255]{box-sizing:border-box;width:100%;padding:24rpx 32rpx;font-size:28rpx;background:#fff;align-items:center;line-height:1.5;display:flex;position:relative}.sj-cell[data-v-17f18255]:after{content:"";pointer-events:none;border-bottom:1rpx solid #e4e7ed;transform-origin:0 100%;position:absolute;bottom:0;left:0;right:0}.sj-cell--clickable[data-v-17f18255]{cursor:pointer}.sj-cell--clickable[data-v-17f18255]:active{background:#f2f3f5}.sj-cell--required[data-v-17f18255]:before{content:"*";left:16rpx;color:#fa3534;font-size:32rpx;position:absolute}.sj-cell--borderless[data-v-17f18255]:after{display:none}.sj-cell__left-icon[data-v-17f18255]{margin-right:16rpx;color:#909399}.sj-cell__title[data-v-17f18255]{flex:1;min-width:0}.sj-cell__title-text[data-v-17f18255]{color:#303133;font-size:28rpx}.sj-cell__label[data-v-17f18255]{margin-top:8rpx;color:#909399;font-size:24rpx;line-height:1.2;display:block}.sj-cell__value[data-v-17f18255]{text-align:right;flex:1;min-width:0;overflow:hidden}.sj-cell__value-text[data-v-17f18255]{color:#909399;font-size:28rpx;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.sj-cell__value--alone[data-v-17f18255]{color:#303133;text-align:left}.sj-cell__right-icon[data-v-17f18255]{margin-left:8rpx;color:#c0c4cc;font-size:28rpx}.sj-loading[data-v-48c28ad3]{align-items:center;gap:16rpx;color:#909399;display:inline-flex}.sj-loading--vertical[data-v-48c28ad3]{gap:8rpx;flex-direction:column}.sj-loading__spinner[data-v-48c28ad3]{box-sizing:border-box;animation:.8s linear infinite sj-loading-rotate-48c28ad3;position:relative}.sj-loading__circular[data-v-48c28ad3]{width:100%;height:100%}.sj-loading__circular-ring[data-v-48c28ad3]{border:4rpx solid currentColor;box-sizing:border-box;border-top-color:#0000;border-radius:50%;width:100%;height:100%}.sj-loading__spinner-dot[data-v-48c28ad3]{opacity:0;background:currentColor;border-radius:50%;width:20%;height:20%;margin-left:-10%;position:absolute;top:0;left:50%}.sj-loading__spinner-dot[data-v-48c28ad3]:first-child{opacity:0;transform:rotate(0)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(2){opacity:.0833333;transform:rotate(30deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(3){opacity:.166667;transform:rotate(60deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(4){opacity:.25;transform:rotate(90deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(5){opacity:.333333;transform:rotate(120deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(6){opacity:.416667;transform:rotate(150deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(7){opacity:.5;transform:rotate(180deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(8){opacity:.583333;transform:rotate(210deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(9){opacity:.666667;transform:rotate(240deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(10){opacity:.75;transform:rotate(270deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(11){opacity:.833333;transform:rotate(300deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(12){opacity:.916667;transform:rotate(330deg)}.sj-loading__spinner--spinner[data-v-48c28ad3]{animation:none}.sj-loading__text[data-v-48c28ad3]{color:#909399;font-size:28rpx;line-height:1.5}@keyframes sj-loading-rotate-48c28ad3{0%{transform:rotate(0)}to{transform:rotate(360deg)}}view,text,scroll-view,swiper,input,textarea,button,image{box-sizing:border-box}button{line-height:inherit;font-size:inherit;background:0 0;border:none;outline:none;margin:0;padding:0}button:after{display:none}input,textarea{box-sizing:border-box}
|
|
1
|
+
.sj-button[data-v-d5bd5c39]{box-sizing:border-box;text-align:center;white-space:nowrap;appearance:none;cursor:pointer;border:none;outline:none;justify-content:center;align-items:center;margin:0;padding:0;font-weight:500;line-height:1;transition:all .3s cubic-bezier(.645,.045,.355,1);display:inline-flex}.sj-button--small[data-v-d5bd5c39]{height:56rpx;padding:0 24rpx;font-size:24rpx}.sj-button--medium[data-v-d5bd5c39]{height:72rpx;padding:0 32rpx;font-size:28rpx}.sj-button--large[data-v-d5bd5c39]{height:88rpx;padding:0 48rpx;font-size:32rpx}.sj-button--default[data-v-d5bd5c39]{color:#606266;border:1rpx solid #e4e7ed;background:#fff}.sj-button--primary[data-v-d5bd5c39]{color:#fff;background:#2979ff}.sj-button--success[data-v-d5bd5c39]{color:#fff;background:#19be6b}.sj-button--warning[data-v-d5bd5c39]{color:#fff;background:#f90}.sj-button--danger[data-v-d5bd5c39]{color:#fff;background:#fa3534}.sj-button--info[data-v-d5bd5c39]{color:#fff;background:#909399}.sj-button--square[data-v-d5bd5c39]{border-radius:8rpx}.sj-button--round[data-v-d5bd5c39]{border-radius:999rpx}.sj-button--circle[data-v-d5bd5c39]{border-radius:50%;padding:0}.sj-button--circle.sj-button--small[data-v-d5bd5c39]{width:56rpx}.sj-button--circle.sj-button--medium[data-v-d5bd5c39]{width:72rpx}.sj-button--circle.sj-button--large[data-v-d5bd5c39]{width:88rpx}.sj-button--plain[data-v-d5bd5c39]{background:0 0!important}.sj-button--plain.sj-button--primary[data-v-d5bd5c39]{color:#2979ff;border:1rpx solid #2979ff}.sj-button--plain.sj-button--success[data-v-d5bd5c39]{color:#19be6b;border:1rpx solid #19be6b}.sj-button--plain.sj-button--warning[data-v-d5bd5c39]{color:#f90;border:1rpx solid #f90}.sj-button--plain.sj-button--danger[data-v-d5bd5c39]{color:#fa3534;border:1rpx solid #fa3534}.sj-button--plain.sj-button--info[data-v-d5bd5c39]{color:#909399;border:1rpx solid #909399}.sj-button--hairline[data-v-d5bd5c39]{position:relative;border-width:0!important}.sj-button--hairline[data-v-d5bd5c39]:after{content:"";border-radius:inherit;border:1px solid inherit;pointer-events:none;transform-origin:0 0;position:absolute;inset:0;transform:scale(.5)}.sj-button--hairline.sj-button--default[data-v-d5bd5c39]:after{border-color:#e4e7ed}.sj-button--hairline.sj-button--primary[data-v-d5bd5c39]:after{border-color:#2979ff}.sj-button--hairline.sj-button--success[data-v-d5bd5c39]:after{border-color:#19be6b}.sj-button--hairline.sj-button--warning[data-v-d5bd5c39]:after{border-color:#f90}.sj-button--hairline.sj-button--danger[data-v-d5bd5c39]:after{border-color:#fa3534}.sj-button--hairline.sj-button--info[data-v-d5bd5c39]:after{border-color:#909399}.sj-button--disabled[data-v-d5bd5c39]{opacity:.5;cursor:not-allowed;pointer-events:none}.sj-button--loading[data-v-d5bd5c39]{cursor:default}.sj-button--block[data-v-d5bd5c39]{width:100%;display:flex}.sj-button--active[data-v-d5bd5c39]{opacity:.7}.sj-button__icon[data-v-d5bd5c39],.sj-button__loading[data-v-d5bd5c39]{margin-right:8rpx}.sj-button__loading-spinner[data-v-d5bd5c39]{width:32rpx;height:32rpx;border:4rpx solid currentColor;border-top-color:#0000;border-radius:50%;animation:.6s linear infinite sj-spin-d5bd5c39}.sj-button__text[data-v-d5bd5c39]{align-items:center;display:flex}@keyframes sj-spin-d5bd5c39{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sj-cell[data-v-17f18255]{box-sizing:border-box;width:100%;padding:24rpx 32rpx;font-size:28rpx;background:#fff;align-items:center;line-height:1.5;display:flex;position:relative}.sj-cell[data-v-17f18255]:after{content:"";pointer-events:none;border-bottom:1rpx solid #e4e7ed;transform-origin:0 100%;position:absolute;bottom:0;left:0;right:0}.sj-cell--clickable[data-v-17f18255]{cursor:pointer}.sj-cell--clickable[data-v-17f18255]:active{background:#f2f3f5}.sj-cell--required[data-v-17f18255]:before{content:"*";left:16rpx;color:#fa3534;font-size:32rpx;position:absolute}.sj-cell--borderless[data-v-17f18255]:after{display:none}.sj-cell__left-icon[data-v-17f18255]{margin-right:16rpx;color:#909399}.sj-cell__title[data-v-17f18255]{flex:1;min-width:0}.sj-cell__title-text[data-v-17f18255]{color:#303133;font-size:28rpx}.sj-cell__label[data-v-17f18255]{margin-top:8rpx;color:#909399;font-size:24rpx;line-height:1.2;display:block}.sj-cell__value[data-v-17f18255]{text-align:right;flex:1;min-width:0;overflow:hidden}.sj-cell__value-text[data-v-17f18255]{color:#909399;font-size:28rpx;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.sj-cell__value--alone[data-v-17f18255]{color:#303133;text-align:left}.sj-cell__right-icon[data-v-17f18255]{margin-left:8rpx;color:#c0c4cc;font-size:28rpx}.sj-loading[data-v-48c28ad3]{align-items:center;gap:16rpx;color:#909399;display:inline-flex}.sj-loading--vertical[data-v-48c28ad3]{gap:8rpx;flex-direction:column}.sj-loading__spinner[data-v-48c28ad3]{box-sizing:border-box;animation:.8s linear infinite sj-loading-rotate-48c28ad3;position:relative}.sj-loading__circular[data-v-48c28ad3]{width:100%;height:100%}.sj-loading__circular-ring[data-v-48c28ad3]{border:4rpx solid currentColor;box-sizing:border-box;border-top-color:#0000;border-radius:50%;width:100%;height:100%}.sj-loading__spinner-dot[data-v-48c28ad3]{opacity:0;background:currentColor;border-radius:50%;width:20%;height:20%;margin-left:-10%;position:absolute;top:0;left:50%}.sj-loading__spinner-dot[data-v-48c28ad3]:first-child{opacity:0;transform:rotate(0)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(2){opacity:.0833333;transform:rotate(30deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(3){opacity:.166667;transform:rotate(60deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(4){opacity:.25;transform:rotate(90deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(5){opacity:.333333;transform:rotate(120deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(6){opacity:.416667;transform:rotate(150deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(7){opacity:.5;transform:rotate(180deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(8){opacity:.583333;transform:rotate(210deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(9){opacity:.666667;transform:rotate(240deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(10){opacity:.75;transform:rotate(270deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(11){opacity:.833333;transform:rotate(300deg)}.sj-loading__spinner-dot[data-v-48c28ad3]:nth-child(12){opacity:.916667;transform:rotate(330deg)}.sj-loading__spinner--spinner[data-v-48c28ad3]{animation:none}.sj-loading__text[data-v-48c28ad3]{color:#909399;font-size:28rpx;line-height:1.5}@keyframes sj-loading-rotate-48c28ad3{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.sj-divider[data-v-4e98255f]{box-sizing:border-box}.sj-divider--horizontal[data-v-4e98255f]{width:100%;margin:24rpx 0;align-items:center;display:flex}.sj-divider--vertical[data-v-4e98255f]{width:1rpx;min-height:32rpx;margin:0 16rpx;vertical-align:middle;align-self:stretch;display:inline-flex}.sj-divider--dashed .sj-divider__line[data-v-4e98255f]{border-style:dashed}.sj-divider--hairline .sj-divider__line[data-v-4e98255f]{border-width:1rpx}.sj-divider__line[data-v-4e98255f]{box-sizing:border-box;border:0 solid #e4e7ed}.sj-divider__line--full[data-v-4e98255f]{border-top-width:1rpx;flex:1;width:100%}.sj-divider__line--left[data-v-4e98255f],.sj-divider__line--right[data-v-4e98255f]{border-top-width:1rpx;flex:1}.sj-divider__text[data-v-4e98255f]{padding:0 24rpx;flex-shrink:0;max-width:80%}.sj-divider__text-inner[data-v-4e98255f]{color:#909399;font-size:24rpx;line-height:1.2}.sj-divider--vertical .sj-divider__line--full[data-v-4e98255f]{width:1rpx;height:100%;min-height:inherit;border-top-width:0;border-left-width:1rpx;flex:1}.sj-tag[data-v-2c263ebd]{box-sizing:border-box;align-items:center;max-width:100%;font-weight:400;line-height:1;display:inline-flex;position:relative}.sj-tag--medium[data-v-2c263ebd]{padding:8rpx 16rpx;font-size:24rpx}.sj-tag--small[data-v-2c263ebd]{padding:4rpx 12rpx;font-size:20rpx}.sj-tag--round[data-v-2c263ebd]{border-radius:999rpx}.sj-tag[data-v-2c263ebd]:not(.sj-tag--round){border-radius:4rpx}.sj-tag__text[data-v-2c263ebd]{text-overflow:ellipsis;white-space:nowrap;max-width:100%;overflow:hidden}.sj-tag__close[data-v-2c263ebd]{margin-left:4rpx;padding:0 2rpx;opacity:.75;justify-content:center;align-items:center;display:flex}.sj-tag__close-icon[data-v-2c263ebd]{font-size:1.2em;line-height:1}.sj-tag--default[data-v-2c263ebd]{color:#606266;background:#f3f4f6}.sj-tag--default.sj-tag--plain[data-v-2c263ebd]{color:#606266;border:1rpx solid #e4e7ed;background:0 0}.sj-tag--primary[data-v-2c263ebd]{color:#fff;background:#2979ff}.sj-tag--primary.sj-tag--plain[data-v-2c263ebd]{color:#2979ff;border:1rpx solid #70b1ff;background:#e8f0fe}.sj-tag--success[data-v-2c263ebd]{color:#fff;background:#19be6b}.sj-tag--success.sj-tag--plain[data-v-2c263ebd]{color:#19be6b;border:1rpx solid #8ce8b5;background:#e8f9f0}.sj-tag--warning[data-v-2c263ebd]{color:#fff;background:#f90}.sj-tag--warning.sj-tag--plain[data-v-2c263ebd]{color:#f90;border:1rpx solid #ffcb57;background:#fff4e0}.sj-tag--danger[data-v-2c263ebd]{color:#fff;background:#fa3534}.sj-tag--danger.sj-tag--plain[data-v-2c263ebd]{color:#fa3534;border:1rpx solid #ff8a8a;background:#fee8e8}.sj-tag--info[data-v-2c263ebd]{color:#fff;background:#909399}.sj-tag--info.sj-tag--plain[data-v-2c263ebd]{color:#909399;border:1rpx solid #c0c4cc;background:#f4f4f5}.sj-badge[data-v-77de098c]{vertical-align:middle;justify-content:center;align-items:center;display:inline-flex;position:relative}.sj-badge__content[data-v-77de098c]{z-index:1;box-sizing:border-box;min-width:32rpx;padding:0 8rpx;color:#fff;font-size:20rpx;font-weight:500;line-height:32rpx;text-align:center;border:2rpx solid #fff;border-radius:999rpx;transform-origin:50%;background:#fa3534;position:absolute}.sj-badge__content--dot[data-v-77de098c]{min-width:16rpx;width:16rpx;height:16rpx;border-radius:50%;padding:0}.sj-badge__content--top-right[data-v-77de098c]{top:0;right:0}.sj-badge__content--top-left[data-v-77de098c]{top:0;left:0}.sj-badge__content--bottom-right[data-v-77de098c]{bottom:0;right:0}.sj-badge__content--bottom-left[data-v-77de098c]{bottom:0;left:0}.sj-badge__text[data-v-77de098c]{display:block;transform:scale(.92)}.sj-space[data-v-ab457af8],view,text,scroll-view,swiper,input,textarea,button,image{box-sizing:border-box}button{line-height:inherit;font-size:inherit;background:0 0;border:none;outline:none;margin:0;padding:0}button:after{display:none}input,textarea{box-sizing:border-box}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/shujie-ui.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h } from "vue";
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, useSlots as g, withModifiers as _ } from "vue";
|
|
2
2
|
//#region src/utils/format.ts
|
|
3
|
-
function
|
|
3
|
+
function v(e, t = "rpx") {
|
|
4
4
|
return e == null ? "" : typeof e == "string" ? /^\d+(\.\d+)?$/.test(e) ? `${e}${t}` : e : `${e}${t}`;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function ee(e) {
|
|
7
7
|
return Number(e.replace(/rpx|px|rem|em|vw|vh/g, ""));
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function y(e, t, n) {
|
|
10
10
|
return Math.min(Math.max(e, t), n);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function b(e, t = 2) {
|
|
13
13
|
return String(e).padStart(t, "0");
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function x(e) {
|
|
16
16
|
if (typeof e != "object" || !e) return e;
|
|
17
17
|
if (e instanceof Date) return new Date(e.getTime());
|
|
18
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
18
|
+
if (Array.isArray(e)) return e.map((e) => x(e));
|
|
19
19
|
let t = {};
|
|
20
|
-
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] =
|
|
20
|
+
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = x(e[n]));
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
|
-
var
|
|
24
|
-
function
|
|
25
|
-
return `${e}-${++
|
|
23
|
+
var S = 0;
|
|
24
|
+
function C(e = "sj") {
|
|
25
|
+
return `${e}-${++S}-${Math.random().toString(36).slice(2, 8)}`;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function te(e, t = 300) {
|
|
28
28
|
let n = null;
|
|
29
29
|
return function(...r) {
|
|
30
30
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -60,7 +60,7 @@ var E = /* @__PURE__ */ s({
|
|
|
60
60
|
},
|
|
61
61
|
emits: ["click"],
|
|
62
62
|
setup(e, { emit: n }) {
|
|
63
|
-
let r = e, a = n, o = t(() =>
|
|
63
|
+
let r = e, a = n, o = t(() => v(r.size)), s = (e) => {
|
|
64
64
|
a("click", e);
|
|
65
65
|
};
|
|
66
66
|
return (t, n) => (u(), i("text", {
|
|
@@ -231,7 +231,7 @@ var N = { class: "sj-cell__title-text" }, P = {
|
|
|
231
231
|
class: "sj-cell__title",
|
|
232
232
|
style: l({
|
|
233
233
|
textAlign: e.titleAlign,
|
|
234
|
-
flex: e.titleWidth ? `0 0 ${h(
|
|
234
|
+
flex: e.titleWidth ? `0 0 ${h(v)(e.titleWidth)}` : ""
|
|
235
235
|
})
|
|
236
236
|
}, [p(t.$slots, "title", {}, () => [a("text", N, m(e.title), 1)], !0), p(t.$slots, "label", {}, () => [e.label ? (u(), i("text", P, m(e.label), 1)) : r("", !0)], !0)], 4)) : r("", !0),
|
|
237
237
|
a("view", { class: c(["sj-cell__value", { "sj-cell__value--alone": !e.title && !t.$slots.title }]) }, [p(t.$slots, "default", {}, () => [a("text", F, m(e.value), 1)], !0)], 2),
|
|
@@ -269,7 +269,7 @@ var L = {
|
|
|
269
269
|
customStyle: { default: "" }
|
|
270
270
|
},
|
|
271
271
|
setup(n) {
|
|
272
|
-
let s = n, d = t(() =>
|
|
272
|
+
let s = n, d = t(() => v(s.size));
|
|
273
273
|
return (t, s) => (u(), i("view", {
|
|
274
274
|
class: c([
|
|
275
275
|
"sj-loading",
|
|
@@ -290,7 +290,7 @@ var L = {
|
|
|
290
290
|
})), 64))], 6), n.text || t.$slots.default ? (u(), i("text", {
|
|
291
291
|
key: 0,
|
|
292
292
|
class: "sj-loading__text",
|
|
293
|
-
style: l({ fontSize: n.textSize ? h(
|
|
293
|
+
style: l({ fontSize: n.textSize ? h(v)(n.textSize) : void 0 })
|
|
294
294
|
}, [p(t.$slots, "default", {}, () => [o(m(n.text), 1)], !0)], 4)) : r("", !0)], 6));
|
|
295
295
|
}
|
|
296
296
|
}), [["__scopeId", "data-v-48c28ad3"]]);
|
|
@@ -300,26 +300,251 @@ R.install = (e) => {
|
|
|
300
300
|
e.component("SjLoading", R);
|
|
301
301
|
};
|
|
302
302
|
//#endregion
|
|
303
|
+
//#region src/components/sj-divider/sj-divider.vue?vue&type=script&setup=true&lang.ts
|
|
304
|
+
var z = { class: "sj-divider__text" }, B = { class: "sj-divider__text-inner" }, V = {
|
|
305
|
+
key: 1,
|
|
306
|
+
class: "sj-divider__line sj-divider__line--full"
|
|
307
|
+
}, H = /* @__PURE__ */ D(/* @__PURE__ */ s({
|
|
308
|
+
__name: "sj-divider",
|
|
309
|
+
props: {
|
|
310
|
+
orientation: { default: "horizontal" },
|
|
311
|
+
dashed: {
|
|
312
|
+
type: Boolean,
|
|
313
|
+
default: !1
|
|
314
|
+
},
|
|
315
|
+
hairline: {
|
|
316
|
+
type: Boolean,
|
|
317
|
+
default: !0
|
|
318
|
+
},
|
|
319
|
+
text: { default: "" },
|
|
320
|
+
height: { default: "" },
|
|
321
|
+
margin: { default: "" },
|
|
322
|
+
customClass: { default: "" },
|
|
323
|
+
customStyle: { default: "" }
|
|
324
|
+
},
|
|
325
|
+
setup(n) {
|
|
326
|
+
let r = n, o = g(), s = t(() => r.orientation === "horizontal" ? !!(r.text || o.default) : !1), d = t(() => {
|
|
327
|
+
let e = {};
|
|
328
|
+
return r.margin && (e.margin = v(r.margin)), r.orientation === "vertical" && r.height && (e.height = v(r.height), e.alignSelf = "stretch"), [e, r.customStyle];
|
|
329
|
+
});
|
|
330
|
+
return (t, r) => (u(), i("view", {
|
|
331
|
+
class: c([
|
|
332
|
+
"sj-divider",
|
|
333
|
+
`sj-divider--${n.orientation}`,
|
|
334
|
+
{
|
|
335
|
+
"sj-divider--dashed": n.dashed,
|
|
336
|
+
"sj-divider--hairline": n.hairline,
|
|
337
|
+
"sj-divider--with-text": s.value
|
|
338
|
+
},
|
|
339
|
+
n.customClass
|
|
340
|
+
]),
|
|
341
|
+
style: l(d.value)
|
|
342
|
+
}, [n.orientation === "horizontal" && s.value ? (u(), i(e, { key: 0 }, [
|
|
343
|
+
r[0] ||= a("view", { class: "sj-divider__line sj-divider__line--left" }, null, -1),
|
|
344
|
+
a("view", z, [p(t.$slots, "default", {}, () => [a("text", B, m(n.text), 1)], !0)]),
|
|
345
|
+
r[1] ||= a("view", { class: "sj-divider__line sj-divider__line--right" }, null, -1)
|
|
346
|
+
], 64)) : (u(), i("view", V))], 6));
|
|
347
|
+
}
|
|
348
|
+
}), [["__scopeId", "data-v-4e98255f"]]);
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region src/components/sj-divider/index.ts
|
|
351
|
+
H.install = (e) => {
|
|
352
|
+
e.component("SjDivider", H);
|
|
353
|
+
};
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region src/components/sj-tag/sj-tag.vue?vue&type=script&setup=true&lang.ts
|
|
356
|
+
var U = { class: "sj-tag__text" }, W = /* @__PURE__ */ D(/* @__PURE__ */ s({
|
|
357
|
+
__name: "sj-tag",
|
|
358
|
+
props: {
|
|
359
|
+
type: { default: "default" },
|
|
360
|
+
plain: {
|
|
361
|
+
type: Boolean,
|
|
362
|
+
default: !1
|
|
363
|
+
},
|
|
364
|
+
round: {
|
|
365
|
+
type: Boolean,
|
|
366
|
+
default: !1
|
|
367
|
+
},
|
|
368
|
+
size: { default: "medium" },
|
|
369
|
+
closable: {
|
|
370
|
+
type: Boolean,
|
|
371
|
+
default: !1
|
|
372
|
+
},
|
|
373
|
+
color: { default: "" },
|
|
374
|
+
bgColor: { default: "" },
|
|
375
|
+
customClass: { default: "" },
|
|
376
|
+
customStyle: { default: "" }
|
|
377
|
+
},
|
|
378
|
+
emits: ["click", "close"],
|
|
379
|
+
setup(e, { emit: n }) {
|
|
380
|
+
let o = e, s = n, d = t(() => {
|
|
381
|
+
let e = {};
|
|
382
|
+
return o.color && (e.color = o.color), o.bgColor && !o.plain && (e.backgroundColor = o.bgColor), [e, o.customStyle];
|
|
383
|
+
}), f = (e) => {
|
|
384
|
+
s("click", e);
|
|
385
|
+
}, m = (e) => {
|
|
386
|
+
s("close", e);
|
|
387
|
+
};
|
|
388
|
+
return (t, n) => (u(), i("view", {
|
|
389
|
+
class: c([
|
|
390
|
+
"sj-tag",
|
|
391
|
+
`sj-tag--${e.type}`,
|
|
392
|
+
`sj-tag--${e.size}`,
|
|
393
|
+
{
|
|
394
|
+
"sj-tag--plain": e.plain,
|
|
395
|
+
"sj-tag--round": e.round,
|
|
396
|
+
"sj-tag--closable": e.closable
|
|
397
|
+
},
|
|
398
|
+
e.customClass
|
|
399
|
+
]),
|
|
400
|
+
style: l(d.value),
|
|
401
|
+
onClick: f
|
|
402
|
+
}, [a("text", U, [p(t.$slots, "default", {}, void 0, !0)]), e.closable ? (u(), i("view", {
|
|
403
|
+
key: 0,
|
|
404
|
+
class: "sj-tag__close",
|
|
405
|
+
onClick: _(m, ["stop"])
|
|
406
|
+
}, [...n[0] ||= [a("text", { class: "sj-tag__close-icon" }, "×", -1)]])) : r("", !0)], 6));
|
|
407
|
+
}
|
|
408
|
+
}), [["__scopeId", "data-v-2c263ebd"]]);
|
|
409
|
+
//#endregion
|
|
410
|
+
//#region src/components/sj-tag/index.ts
|
|
411
|
+
W.install = (e) => {
|
|
412
|
+
e.component("SjTag", W);
|
|
413
|
+
};
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/components/sj-badge/sj-badge.vue?vue&type=script&setup=true&lang.ts
|
|
416
|
+
var G = {
|
|
417
|
+
key: 0,
|
|
418
|
+
class: "sj-badge__text"
|
|
419
|
+
}, K = /* @__PURE__ */ D(/* @__PURE__ */ s({
|
|
420
|
+
__name: "sj-badge",
|
|
421
|
+
props: {
|
|
422
|
+
dot: {
|
|
423
|
+
type: Boolean,
|
|
424
|
+
default: !1
|
|
425
|
+
},
|
|
426
|
+
content: { default: "" },
|
|
427
|
+
max: { default: 99 },
|
|
428
|
+
position: { default: "top-right" },
|
|
429
|
+
offset: {},
|
|
430
|
+
color: { default: "" },
|
|
431
|
+
customClass: { default: "" },
|
|
432
|
+
customStyle: { default: "" }
|
|
433
|
+
},
|
|
434
|
+
setup(e) {
|
|
435
|
+
let n = e, a = t(() => !!(n.dot || n.content === 0 || n.content === "0" || n.content !== "" && n.content !== null && n.content !== void 0)), o = t(() => {
|
|
436
|
+
let e = n.content;
|
|
437
|
+
return typeof e == "number" && e > n.max ? `${n.max}+` : String(e);
|
|
438
|
+
}), s = t(() => ["sj-badge__content", {
|
|
439
|
+
"sj-badge__content--dot": n.dot,
|
|
440
|
+
[`sj-badge__content--${n.position}`]: !0
|
|
441
|
+
}]), d = {
|
|
442
|
+
"top-right": "translate(40%, -40%)",
|
|
443
|
+
"top-left": "translate(-40%, -40%)",
|
|
444
|
+
"bottom-right": "translate(40%, 40%)",
|
|
445
|
+
"bottom-left": "translate(-40%, 40%)"
|
|
446
|
+
}, f = t(() => {
|
|
447
|
+
let e = {};
|
|
448
|
+
n.color && (e.backgroundColor = n.color);
|
|
449
|
+
let t = d[n.position];
|
|
450
|
+
if (n.offset && n.offset.length === 2) {
|
|
451
|
+
let [e, r] = n.offset;
|
|
452
|
+
t += ` translate(${v(e)}, ${v(r)})`;
|
|
453
|
+
}
|
|
454
|
+
return e.transform = t, e;
|
|
455
|
+
});
|
|
456
|
+
return (t, n) => (u(), i("view", {
|
|
457
|
+
class: c(["sj-badge", e.customClass]),
|
|
458
|
+
style: l(e.customStyle)
|
|
459
|
+
}, [p(t.$slots, "default", {}, void 0, !0), a.value ? (u(), i("view", {
|
|
460
|
+
key: 0,
|
|
461
|
+
class: c(s.value),
|
|
462
|
+
style: l(f.value)
|
|
463
|
+
}, [e.dot ? r("", !0) : (u(), i("text", G, m(o.value), 1))], 6)) : r("", !0)], 6));
|
|
464
|
+
}
|
|
465
|
+
}), [["__scopeId", "data-v-77de098c"]]);
|
|
466
|
+
//#endregion
|
|
467
|
+
//#region src/components/sj-badge/index.ts
|
|
468
|
+
K.install = (e) => {
|
|
469
|
+
e.component("SjBadge", K);
|
|
470
|
+
};
|
|
471
|
+
//#endregion
|
|
472
|
+
//#region src/components/sj-space/sj-space.vue
|
|
473
|
+
var q = /* @__PURE__ */ D(/* @__PURE__ */ s({
|
|
474
|
+
__name: "sj-space",
|
|
475
|
+
props: {
|
|
476
|
+
direction: { default: "horizontal" },
|
|
477
|
+
size: { default: "medium" },
|
|
478
|
+
wrap: {
|
|
479
|
+
type: Boolean,
|
|
480
|
+
default: !1
|
|
481
|
+
},
|
|
482
|
+
align: { default: "center" },
|
|
483
|
+
justify: { default: "start" },
|
|
484
|
+
customClass: { default: "" },
|
|
485
|
+
customStyle: { default: "" }
|
|
486
|
+
},
|
|
487
|
+
setup(e) {
|
|
488
|
+
let n = e, r = {
|
|
489
|
+
small: 16,
|
|
490
|
+
medium: 24,
|
|
491
|
+
large: 32
|
|
492
|
+
}, a = t(() => {
|
|
493
|
+
let e = typeof n.size == "number" ? v(n.size) : v(r[n.size]);
|
|
494
|
+
return [{
|
|
495
|
+
display: "flex",
|
|
496
|
+
flexDirection: n.direction === "vertical" ? "column" : "row",
|
|
497
|
+
flexWrap: n.wrap ? "wrap" : "nowrap",
|
|
498
|
+
alignItems: {
|
|
499
|
+
start: "flex-start",
|
|
500
|
+
center: "center",
|
|
501
|
+
end: "flex-end",
|
|
502
|
+
stretch: "stretch",
|
|
503
|
+
baseline: "baseline"
|
|
504
|
+
}[n.align] || "center",
|
|
505
|
+
justifyContent: {
|
|
506
|
+
start: "flex-start",
|
|
507
|
+
center: "center",
|
|
508
|
+
end: "flex-end",
|
|
509
|
+
between: "space-between",
|
|
510
|
+
around: "space-around",
|
|
511
|
+
evenly: "space-evenly"
|
|
512
|
+
}[n.justify] || "flex-start",
|
|
513
|
+
gap: e
|
|
514
|
+
}, n.customStyle];
|
|
515
|
+
});
|
|
516
|
+
return (t, n) => (u(), i("view", {
|
|
517
|
+
class: c(["sj-space", e.customClass]),
|
|
518
|
+
style: l(a.value)
|
|
519
|
+
}, [p(t.$slots, "default", {}, void 0, !0)], 6));
|
|
520
|
+
}
|
|
521
|
+
}), [["__scopeId", "data-v-ab457af8"]]);
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/components/sj-space/index.ts
|
|
524
|
+
q.install = (e) => {
|
|
525
|
+
e.component("SjSpace", q);
|
|
526
|
+
};
|
|
527
|
+
//#endregion
|
|
303
528
|
//#region src/utils/platform.ts
|
|
304
|
-
function
|
|
529
|
+
function J() {
|
|
305
530
|
return typeof uni < "u" ? uni.getSystemInfoSync().uniPlatform || "unknown" : typeof window < "u" ? "h5" : "unknown";
|
|
306
531
|
}
|
|
307
|
-
function
|
|
308
|
-
return
|
|
532
|
+
function Y() {
|
|
533
|
+
return J() === "h5";
|
|
309
534
|
}
|
|
310
|
-
function
|
|
311
|
-
return
|
|
535
|
+
function X() {
|
|
536
|
+
return J().startsWith("mp-");
|
|
312
537
|
}
|
|
313
|
-
function
|
|
314
|
-
return
|
|
538
|
+
function Z() {
|
|
539
|
+
return J() === "mp-weixin";
|
|
315
540
|
}
|
|
316
|
-
function
|
|
317
|
-
return
|
|
541
|
+
function Q() {
|
|
542
|
+
return J() === "mp-alipay";
|
|
318
543
|
}
|
|
319
|
-
function
|
|
320
|
-
return
|
|
544
|
+
function ne() {
|
|
545
|
+
return J() === "app-plus";
|
|
321
546
|
}
|
|
322
|
-
function
|
|
547
|
+
function re() {
|
|
323
548
|
try {
|
|
324
549
|
return uni.getSystemInfoSync();
|
|
325
550
|
} catch {
|
|
@@ -335,27 +560,27 @@ function G() {
|
|
|
335
560
|
}
|
|
336
561
|
//#endregion
|
|
337
562
|
//#region src/utils/validate.ts
|
|
338
|
-
function
|
|
563
|
+
function ie(e) {
|
|
339
564
|
return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
|
|
340
565
|
}
|
|
341
|
-
function
|
|
566
|
+
function ae(e) {
|
|
342
567
|
return typeof e == "number" && !isNaN(e);
|
|
343
568
|
}
|
|
344
|
-
function
|
|
569
|
+
function oe(e) {
|
|
345
570
|
return /^1[3-9]\d{9}$/.test(e);
|
|
346
571
|
}
|
|
347
|
-
function
|
|
572
|
+
function $(e) {
|
|
348
573
|
return /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e);
|
|
349
574
|
}
|
|
350
|
-
function
|
|
575
|
+
function se(e) {
|
|
351
576
|
return /^https?:\/\/.+/.test(e);
|
|
352
577
|
}
|
|
353
|
-
function
|
|
578
|
+
function ce(e) {
|
|
354
579
|
return /^\d{15}|\d{18}|\d{17}[Xx]$/.test(e);
|
|
355
580
|
}
|
|
356
581
|
//#endregion
|
|
357
582
|
//#region src/hooks/useVisible.ts
|
|
358
|
-
function
|
|
583
|
+
function le(e = !1) {
|
|
359
584
|
let t = d(e);
|
|
360
585
|
return {
|
|
361
586
|
visible: t,
|
|
@@ -372,7 +597,7 @@ function Q(e = !1) {
|
|
|
372
597
|
}
|
|
373
598
|
//#endregion
|
|
374
599
|
//#region src/hooks/useLoading.ts
|
|
375
|
-
function
|
|
600
|
+
function ue(e = !1) {
|
|
376
601
|
let t = d(e), n = () => {
|
|
377
602
|
t.value = !0;
|
|
378
603
|
}, r = () => {
|
|
@@ -393,7 +618,7 @@ function $(e = !1) {
|
|
|
393
618
|
}
|
|
394
619
|
//#endregion
|
|
395
620
|
//#region src/hooks/useScroll.ts
|
|
396
|
-
function
|
|
621
|
+
function de(e = 50) {
|
|
397
622
|
let t = d({
|
|
398
623
|
scrollTop: 0,
|
|
399
624
|
scrollLeft: 0,
|
|
@@ -417,15 +642,19 @@ function ee(e = 50) {
|
|
|
417
642
|
}
|
|
418
643
|
//#endregion
|
|
419
644
|
//#region src/index.ts
|
|
420
|
-
var
|
|
645
|
+
var fe = {
|
|
421
646
|
SjButton: M,
|
|
422
647
|
SjIcon: O,
|
|
423
648
|
SjCell: I,
|
|
424
|
-
SjLoading: R
|
|
425
|
-
|
|
426
|
-
|
|
649
|
+
SjLoading: R,
|
|
650
|
+
SjDivider: H,
|
|
651
|
+
SjTag: W,
|
|
652
|
+
SjBadge: K,
|
|
653
|
+
SjSpace: q
|
|
654
|
+
}, pe = { install: (e) => {
|
|
655
|
+
Object.entries(fe).forEach(([t, n]) => {
|
|
427
656
|
e.component(t, n);
|
|
428
657
|
});
|
|
429
658
|
} };
|
|
430
659
|
//#endregion
|
|
431
|
-
export { M as SjButton, I as SjCell, O as SjIcon, R as SjLoading,
|
|
660
|
+
export { K as SjBadge, M as SjButton, I as SjCell, H as SjDivider, O as SjIcon, R as SjLoading, q as SjSpace, W as SjTag, v as addUnit, y as clamp, te as debounce, x as deepClone, pe as default, J as getPlatform, T as getRect, re as getSystemInfo, Q as isAlipay, ne as isApp, $ as isEmail, ie as isEmpty, Y as isH5, ce as isIdCard, X as isMP, ae as isNumber, oe as isPhone, se as isUrl, Z as isWeixin, b as padZero, ee as removeUnit, w as throttle, C as uniqueId, ue as useLoading, de as useScroll, le as useVisible };
|
package/dist/shujie-ui.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SjUI={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n(e,t=`rpx`){return e==null?``:typeof e==`string`?/^\d+(\.\d+)?$/.test(e)?`${e}${t}`:e:`${e}${t}`}function r(e){return Number(e.replace(/rpx|px|rem|em|vw|vh/g,``))}function i(e,t,n){return Math.min(Math.max(e,t),n)}function a(e,t=2){return String(e).padStart(t,`0`)}function o(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>o(e));let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=o(e[n]));return t}var s=0;function c(e=`sj`){return`${e}-${++s}-${Math.random().toString(36).slice(2,8)}`}function l(e,t=300){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r),n=null},t)}}function u(e,t=300){let n=0;return function(...r){let i=Date.now();i-n>=t&&(e.apply(this,r),n=i)}}function d(e,t){return new Promise(n=>{uni.createSelectorQuery().in(t).select(e).boundingClientRect(e=>{n(e)}).exec()})}var f=(0,t.defineComponent)({__name:`sj-icon`,props:{name:{default:``},color:{default:``},size:{default:`inherit`},prefix:{default:`sj-icon`},customClass:{default:``},customStyle:{default:``}},emits:[`click`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>n(i.size)),s=e=>{a(`click`,e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`text`,{class:(0,t.normalizeClass)([e.prefix,e.name?`${e.prefix}-${e.name}`:``,e.customClass]),style:(0,t.normalizeStyle)([{fontSize:o.value,color:e.color||void 0},e.customStyle]),onClick:s},null,6))}}),p=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},m=p(f,[[`__scopeId`,`data-v-7cac47d7`]]),h=[`disabled`,`form-type`,`hover-class`],g={key:0,class:`sj-button__loading`},_={class:`sj-button__text`},v=p((0,t.defineComponent)({__name:`sj-button`,props:{type:{default:`default`},size:{default:`medium`},shape:{default:`square`},plain:{type:Boolean,default:!1},hairline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{default:``},loadingSize:{default:`40rpx`},icon:{default:``},iconPrefix:{default:`sj-icon`},block:{type:Boolean,default:!1},nativeType:{default:`button`},customClass:{default:``},customStyle:{default:``}},emits:[`click`],setup(e,{emit:n}){let r=e,i=n,a=e=>{r.disabled||r.loading||i(`click`,e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([`sj-button`,`sj-button--${e.type}`,`sj-button--${e.size}`,`sj-button--${e.shape}`,{"sj-button--plain":e.plain,"sj-button--hairline":e.hairline,"sj-button--disabled":e.disabled,"sj-button--loading":e.loading,"sj-button--block":e.block},e.customClass]),style:(0,t.normalizeStyle)(e.customStyle),disabled:e.disabled||e.loading,"form-type":e.nativeType===`submit`||e.nativeType===`reset`?e.nativeType:void 0,"hover-class":e.disabled||e.loading?``:`sj-button--active`,"hover-start-time":`20`,"hover-stay-time":`70`,onClick:a},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,g,[...r[0]||=[(0,t.createElementVNode)(`view`,{class:`sj-button__loading-spinner`},null,-1)]])):(0,t.createCommentVNode)(``,!0),e.icon&&!e.loading?((0,t.openBlock)(),(0,t.createBlock)(m,{key:1,name:e.icon,prefix:e.iconPrefix,class:`sj-button__icon`},null,8,[`name`,`prefix`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`text`,_,[e.loading&&e.loadingText?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)((0,t.toDisplayString)(e.loadingText),1)],64)):(0,t.renderSlot)(n.$slots,`default`,{key:1},void 0,!0)])],14,h))}}),[[`__scopeId`,`data-v-d5bd5c39`]]);v.install=e=>{e.component(`SjButton`,v)},m.install=e=>{e.component(`SjIcon`,m)};var y={class:`sj-cell__title-text`},b={key:0,class:`sj-cell__label`},x={class:`sj-cell__value-text`},S=p((0,t.defineComponent)({__name:`sj-cell`,props:{title:{default:``},value:{default:``},label:{default:``},isLink:{type:Boolean,default:!1},arrowDirection:{default:`right`},required:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},icon:{default:``},iconSize:{default:``},titleWidth:{default:``},titleAlign:{default:`left`},border:{type:Boolean,default:!0},customClass:{default:``},customStyle:{default:``}},emits:[`click`],setup(e,{emit:r}){let i=r,a=e=>{i(`click`,e)};return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-cell`,{"sj-cell--clickable":e.clickable||e.isLink,"sj-cell--required":e.required,"sj-cell--borderless":!e.border},e.customClass]),style:(0,t.normalizeStyle)(e.customStyle),onClick:a},[e.icon?((0,t.openBlock)(),(0,t.createBlock)(m,{key:0,name:e.icon,size:e.iconSize||`40rpx`,class:`sj-cell__left-icon`},null,8,[`name`,`size`])):(0,t.renderSlot)(r.$slots,`icon`,{key:1},void 0,!0),e.title||r.$slots.title||r.$slots.label||e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{key:2,class:`sj-cell__title`,style:(0,t.normalizeStyle)({textAlign:e.titleAlign,flex:e.titleWidth?`0 0 ${(0,t.unref)(n)(e.titleWidth)}`:``})},[(0,t.renderSlot)(r.$slots,`title`,{},()=>[(0,t.createElementVNode)(`text`,y,(0,t.toDisplayString)(e.title),1)],!0),(0,t.renderSlot)(r.$slots,`label`,{},()=>[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`text`,b,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0)],!0)],4)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`view`,{class:(0,t.normalizeClass)([`sj-cell__value`,{"sj-cell__value--alone":!e.title&&!r.$slots.title}])},[(0,t.renderSlot)(r.$slots,`default`,{},()=>[(0,t.createElementVNode)(`text`,x,(0,t.toDisplayString)(e.value),1)],!0)],2),e.isLink?((0,t.openBlock)(),(0,t.createBlock)(m,{key:3,name:`arrow-${e.arrowDirection}`,class:`sj-cell__right-icon`},null,8,[`name`])):(0,t.renderSlot)(r.$slots,`right-icon`,{key:4},void 0,!0)],6))}}),[[`__scopeId`,`data-v-17f18255`]]);S.install=e=>{e.component(`SjCell`,S)};var C={key:0,class:`sj-loading__circular`},w=p((0,t.defineComponent)({__name:`sj-loading`,props:{type:{default:`circular`},color:{default:``},size:{default:`64rpx`},textSize:{default:``},text:{default:``},vertical:{type:Boolean,default:!1},customClass:{default:``},customStyle:{default:``}},setup(e){let r=e,i=(0,t.computed)(()=>n(r.size));return(r,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-loading`,{"sj-loading--vertical":e.vertical},e.customClass]),style:(0,t.normalizeStyle)(e.customStyle)},[(0,t.createElementVNode)(`view`,{class:(0,t.normalizeClass)([`sj-loading__spinner`,`sj-loading__spinner--${e.type}`]),style:(0,t.normalizeStyle)({width:i.value,height:i.value,color:e.color||void 0})},[e.type===`circular`?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,C,[...a[0]||=[(0,t.createElementVNode)(`view`,{class:`sj-loading__circular-ring`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(12,e=>(0,t.createElementVNode)(`view`,{key:e,class:`sj-loading__spinner-dot`})),64))],6),e.text||r.$slots.default?((0,t.openBlock)(),(0,t.createElementBlock)(`text`,{key:0,class:`sj-loading__text`,style:(0,t.normalizeStyle)({fontSize:e.textSize?(0,t.unref)(n)(e.textSize):void 0})},[(0,t.renderSlot)(r.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.text),1)],!0)],4)):(0,t.createCommentVNode)(``,!0)],6))}}),[[`__scopeId`,`data-v-48c28ad3`]]);w.install=e=>{e.component(`SjLoading`,w)};function T(){return typeof uni<`u`?uni.getSystemInfoSync().uniPlatform||`unknown`:typeof window<`u`?`h5`:`unknown`}function E(){return T()===`h5`}function D(){return T().startsWith(`mp-`)}function O(){return T()===`mp-weixin`}function k(){return T()===`mp-alipay`}function A(){return T()===`app-plus`}function j(){try{return uni.getSystemInfoSync()}catch{return{screenWidth:375,screenHeight:667,windowWidth:375,windowHeight:667,pixelRatio:2,platform:`unknown`}}}function M(e){return e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:typeof e==`object`?Object.keys(e).length===0:!1}function N(e){return typeof e==`number`&&!isNaN(e)}function P(e){return/^1[3-9]\d{9}$/.test(e)}function F(e){return/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)}function I(e){return/^https?:\/\/.+/.test(e)}function L(e){return/^\d{15}|\d{18}|\d{17}[Xx]$/.test(e)}function R(e=!1){let n=(0,t.ref)(e);return{visible:n,show:()=>{n.value=!0},hide:()=>{n.value=!1},toggle:()=>{n.value=!n.value}}}function z(e=!1){let n=(0,t.ref)(e),r=()=>{n.value=!0},i=()=>{n.value=!1};return{loading:n,startLoading:r,stopLoading:i,withLoading:async e=>{try{return r(),await e()}finally{i()}}}}function B(e=50){let n=(0,t.ref)({scrollTop:0,scrollLeft:0,isScrollTop:!0,isScrollBottom:!1,direction:`none`}),r=0;return{scrollState:n,onScroll:u(t=>{let{scrollTop:i,scrollLeft:a}=t.detail,o=i>r?`down`:i<r?`up`:`none`;r=i,n.value={scrollTop:i,scrollLeft:a,isScrollTop:i<=e,isScrollBottom:!1,direction:o}},100)}}var V={SjButton:v,SjIcon:m,SjCell:S,SjLoading:w};e.SjButton=v,e.SjCell=S,e.SjIcon=m,e.SjLoading=w,e.addUnit=n,e.clamp=i,e.debounce=l,e.deepClone=o,e.default={install:e=>{Object.entries(V).forEach(([t,n])=>{e.component(t,n)})}},e.getPlatform=T,e.getRect=d,e.getSystemInfo=j,e.isAlipay=k,e.isApp=A,e.isEmail=F,e.isEmpty=M,e.isH5=E,e.isIdCard=L,e.isMP=D,e.isNumber=N,e.isPhone=P,e.isUrl=I,e.isWeixin=O,e.padZero=a,e.removeUnit=r,e.throttle=u,e.uniqueId=c,e.useLoading=z,e.useScroll=B,e.useVisible=R});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SjUI={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n(e,t=`rpx`){return e==null?``:typeof e==`string`?/^\d+(\.\d+)?$/.test(e)?`${e}${t}`:e:`${e}${t}`}function r(e){return Number(e.replace(/rpx|px|rem|em|vw|vh/g,``))}function i(e,t,n){return Math.min(Math.max(e,t),n)}function a(e,t=2){return String(e).padStart(t,`0`)}function o(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>o(e));let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=o(e[n]));return t}var s=0;function c(e=`sj`){return`${e}-${++s}-${Math.random().toString(36).slice(2,8)}`}function l(e,t=300){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r),n=null},t)}}function u(e,t=300){let n=0;return function(...r){let i=Date.now();i-n>=t&&(e.apply(this,r),n=i)}}function d(e,t){return new Promise(n=>{uni.createSelectorQuery().in(t).select(e).boundingClientRect(e=>{n(e)}).exec()})}var f=(0,t.defineComponent)({__name:`sj-icon`,props:{name:{default:``},color:{default:``},size:{default:`inherit`},prefix:{default:`sj-icon`},customClass:{default:``},customStyle:{default:``}},emits:[`click`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.computed)(()=>n(i.size)),s=e=>{a(`click`,e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`text`,{class:(0,t.normalizeClass)([e.prefix,e.name?`${e.prefix}-${e.name}`:``,e.customClass]),style:(0,t.normalizeStyle)([{fontSize:o.value,color:e.color||void 0},e.customStyle]),onClick:s},null,6))}}),p=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},m=p(f,[[`__scopeId`,`data-v-7cac47d7`]]),h=[`disabled`,`form-type`,`hover-class`],g={key:0,class:`sj-button__loading`},_={class:`sj-button__text`},v=p((0,t.defineComponent)({__name:`sj-button`,props:{type:{default:`default`},size:{default:`medium`},shape:{default:`square`},plain:{type:Boolean,default:!1},hairline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{default:``},loadingSize:{default:`40rpx`},icon:{default:``},iconPrefix:{default:`sj-icon`},block:{type:Boolean,default:!1},nativeType:{default:`button`},customClass:{default:``},customStyle:{default:``}},emits:[`click`],setup(e,{emit:n}){let r=e,i=n,a=e=>{r.disabled||r.loading||i(`click`,e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([`sj-button`,`sj-button--${e.type}`,`sj-button--${e.size}`,`sj-button--${e.shape}`,{"sj-button--plain":e.plain,"sj-button--hairline":e.hairline,"sj-button--disabled":e.disabled,"sj-button--loading":e.loading,"sj-button--block":e.block},e.customClass]),style:(0,t.normalizeStyle)(e.customStyle),disabled:e.disabled||e.loading,"form-type":e.nativeType===`submit`||e.nativeType===`reset`?e.nativeType:void 0,"hover-class":e.disabled||e.loading?``:`sj-button--active`,"hover-start-time":`20`,"hover-stay-time":`70`,onClick:a},[e.loading?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,g,[...r[0]||=[(0,t.createElementVNode)(`view`,{class:`sj-button__loading-spinner`},null,-1)]])):(0,t.createCommentVNode)(``,!0),e.icon&&!e.loading?((0,t.openBlock)(),(0,t.createBlock)(m,{key:1,name:e.icon,prefix:e.iconPrefix,class:`sj-button__icon`},null,8,[`name`,`prefix`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`text`,_,[e.loading&&e.loadingText?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)((0,t.toDisplayString)(e.loadingText),1)],64)):(0,t.renderSlot)(n.$slots,`default`,{key:1},void 0,!0)])],14,h))}}),[[`__scopeId`,`data-v-d5bd5c39`]]);v.install=e=>{e.component(`SjButton`,v)},m.install=e=>{e.component(`SjIcon`,m)};var y={class:`sj-cell__title-text`},b={key:0,class:`sj-cell__label`},x={class:`sj-cell__value-text`},S=p((0,t.defineComponent)({__name:`sj-cell`,props:{title:{default:``},value:{default:``},label:{default:``},isLink:{type:Boolean,default:!1},arrowDirection:{default:`right`},required:{type:Boolean,default:!1},clickable:{type:Boolean,default:!1},icon:{default:``},iconSize:{default:``},titleWidth:{default:``},titleAlign:{default:`left`},border:{type:Boolean,default:!0},customClass:{default:``},customStyle:{default:``}},emits:[`click`],setup(e,{emit:r}){let i=r,a=e=>{i(`click`,e)};return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-cell`,{"sj-cell--clickable":e.clickable||e.isLink,"sj-cell--required":e.required,"sj-cell--borderless":!e.border},e.customClass]),style:(0,t.normalizeStyle)(e.customStyle),onClick:a},[e.icon?((0,t.openBlock)(),(0,t.createBlock)(m,{key:0,name:e.icon,size:e.iconSize||`40rpx`,class:`sj-cell__left-icon`},null,8,[`name`,`size`])):(0,t.renderSlot)(r.$slots,`icon`,{key:1},void 0,!0),e.title||r.$slots.title||r.$slots.label||e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{key:2,class:`sj-cell__title`,style:(0,t.normalizeStyle)({textAlign:e.titleAlign,flex:e.titleWidth?`0 0 ${(0,t.unref)(n)(e.titleWidth)}`:``})},[(0,t.renderSlot)(r.$slots,`title`,{},()=>[(0,t.createElementVNode)(`text`,y,(0,t.toDisplayString)(e.title),1)],!0),(0,t.renderSlot)(r.$slots,`label`,{},()=>[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`text`,b,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0)],!0)],4)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`view`,{class:(0,t.normalizeClass)([`sj-cell__value`,{"sj-cell__value--alone":!e.title&&!r.$slots.title}])},[(0,t.renderSlot)(r.$slots,`default`,{},()=>[(0,t.createElementVNode)(`text`,x,(0,t.toDisplayString)(e.value),1)],!0)],2),e.isLink?((0,t.openBlock)(),(0,t.createBlock)(m,{key:3,name:`arrow-${e.arrowDirection}`,class:`sj-cell__right-icon`},null,8,[`name`])):(0,t.renderSlot)(r.$slots,`right-icon`,{key:4},void 0,!0)],6))}}),[[`__scopeId`,`data-v-17f18255`]]);S.install=e=>{e.component(`SjCell`,S)};var C={key:0,class:`sj-loading__circular`},w=p((0,t.defineComponent)({__name:`sj-loading`,props:{type:{default:`circular`},color:{default:``},size:{default:`64rpx`},textSize:{default:``},text:{default:``},vertical:{type:Boolean,default:!1},customClass:{default:``},customStyle:{default:``}},setup(e){let r=e,i=(0,t.computed)(()=>n(r.size));return(r,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-loading`,{"sj-loading--vertical":e.vertical},e.customClass]),style:(0,t.normalizeStyle)(e.customStyle)},[(0,t.createElementVNode)(`view`,{class:(0,t.normalizeClass)([`sj-loading__spinner`,`sj-loading__spinner--${e.type}`]),style:(0,t.normalizeStyle)({width:i.value,height:i.value,color:e.color||void 0})},[e.type===`circular`?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,C,[...a[0]||=[(0,t.createElementVNode)(`view`,{class:`sj-loading__circular-ring`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(12,e=>(0,t.createElementVNode)(`view`,{key:e,class:`sj-loading__spinner-dot`})),64))],6),e.text||r.$slots.default?((0,t.openBlock)(),(0,t.createElementBlock)(`text`,{key:0,class:`sj-loading__text`,style:(0,t.normalizeStyle)({fontSize:e.textSize?(0,t.unref)(n)(e.textSize):void 0})},[(0,t.renderSlot)(r.$slots,`default`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.text),1)],!0)],4)):(0,t.createCommentVNode)(``,!0)],6))}}),[[`__scopeId`,`data-v-48c28ad3`]]);w.install=e=>{e.component(`SjLoading`,w)};var T={class:`sj-divider__text`},E={class:`sj-divider__text-inner`},D={key:1,class:`sj-divider__line sj-divider__line--full`},O=p((0,t.defineComponent)({__name:`sj-divider`,props:{orientation:{default:`horizontal`},dashed:{type:Boolean,default:!1},hairline:{type:Boolean,default:!0},text:{default:``},height:{default:``},margin:{default:``},customClass:{default:``},customStyle:{default:``}},setup(e){let r=e,i=(0,t.useSlots)(),a=(0,t.computed)(()=>r.orientation===`horizontal`?!!(r.text||i.default):!1),o=(0,t.computed)(()=>{let e={};return r.margin&&(e.margin=n(r.margin)),r.orientation===`vertical`&&r.height&&(e.height=n(r.height),e.alignSelf=`stretch`),[e,r.customStyle]});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-divider`,`sj-divider--${e.orientation}`,{"sj-divider--dashed":e.dashed,"sj-divider--hairline":e.hairline,"sj-divider--with-text":a.value},e.customClass]),style:(0,t.normalizeStyle)(o.value)},[e.orientation===`horizontal`&&a.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[r[0]||=(0,t.createElementVNode)(`view`,{class:`sj-divider__line sj-divider__line--left`},null,-1),(0,t.createElementVNode)(`view`,T,[(0,t.renderSlot)(n.$slots,`default`,{},()=>[(0,t.createElementVNode)(`text`,E,(0,t.toDisplayString)(e.text),1)],!0)]),r[1]||=(0,t.createElementVNode)(`view`,{class:`sj-divider__line sj-divider__line--right`},null,-1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`view`,D))],6))}}),[[`__scopeId`,`data-v-4e98255f`]]);O.install=e=>{e.component(`SjDivider`,O)};var k={class:`sj-tag__text`},A=p((0,t.defineComponent)({__name:`sj-tag`,props:{type:{default:`default`},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},size:{default:`medium`},closable:{type:Boolean,default:!1},color:{default:``},bgColor:{default:``},customClass:{default:``},customStyle:{default:``}},emits:[`click`,`close`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>{let e={};return r.color&&(e.color=r.color),r.bgColor&&!r.plain&&(e.backgroundColor=r.bgColor),[e,r.customStyle]}),o=e=>{i(`click`,e)},s=e=>{i(`close`,e)};return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-tag`,`sj-tag--${e.type}`,`sj-tag--${e.size}`,{"sj-tag--plain":e.plain,"sj-tag--round":e.round,"sj-tag--closable":e.closable},e.customClass]),style:(0,t.normalizeStyle)(a.value),onClick:o},[(0,t.createElementVNode)(`text`,k,[(0,t.renderSlot)(n.$slots,`default`,{},void 0,!0)]),e.closable?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{key:0,class:`sj-tag__close`,onClick:(0,t.withModifiers)(s,[`stop`])},[...r[0]||=[(0,t.createElementVNode)(`text`,{class:`sj-tag__close-icon`},`×`,-1)]])):(0,t.createCommentVNode)(``,!0)],6))}}),[[`__scopeId`,`data-v-2c263ebd`]]);A.install=e=>{e.component(`SjTag`,A)};var j={key:0,class:`sj-badge__text`},M=p((0,t.defineComponent)({__name:`sj-badge`,props:{dot:{type:Boolean,default:!1},content:{default:``},max:{default:99},position:{default:`top-right`},offset:{},color:{default:``},customClass:{default:``},customStyle:{default:``}},setup(e){let r=e,i=(0,t.computed)(()=>!!(r.dot||r.content===0||r.content===`0`||r.content!==``&&r.content!==null&&r.content!==void 0)),a=(0,t.computed)(()=>{let e=r.content;return typeof e==`number`&&e>r.max?`${r.max}+`:String(e)}),o=(0,t.computed)(()=>[`sj-badge__content`,{"sj-badge__content--dot":r.dot,[`sj-badge__content--${r.position}`]:!0}]),s={"top-right":`translate(40%, -40%)`,"top-left":`translate(-40%, -40%)`,"bottom-right":`translate(40%, 40%)`,"bottom-left":`translate(-40%, 40%)`},c=(0,t.computed)(()=>{let e={};r.color&&(e.backgroundColor=r.color);let t=s[r.position];if(r.offset&&r.offset.length===2){let[e,i]=r.offset;t+=` translate(${n(e)}, ${n(i)})`}return e.transform=t,e});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-badge`,e.customClass]),style:(0,t.normalizeStyle)(e.customStyle)},[(0,t.renderSlot)(n.$slots,`default`,{},void 0,!0),i.value?((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{key:0,class:(0,t.normalizeClass)(o.value),style:(0,t.normalizeStyle)(c.value)},[e.dot?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`text`,j,(0,t.toDisplayString)(a.value),1))],6)):(0,t.createCommentVNode)(``,!0)],6))}}),[[`__scopeId`,`data-v-77de098c`]]);M.install=e=>{e.component(`SjBadge`,M)};var N=p((0,t.defineComponent)({__name:`sj-space`,props:{direction:{default:`horizontal`},size:{default:`medium`},wrap:{type:Boolean,default:!1},align:{default:`center`},justify:{default:`start`},customClass:{default:``},customStyle:{default:``}},setup(e){let r=e,i={small:16,medium:24,large:32},a=(0,t.computed)(()=>{let e=typeof r.size==`number`?n(r.size):n(i[r.size]);return[{display:`flex`,flexDirection:r.direction===`vertical`?`column`:`row`,flexWrap:r.wrap?`wrap`:`nowrap`,alignItems:{start:`flex-start`,center:`center`,end:`flex-end`,stretch:`stretch`,baseline:`baseline`}[r.align]||`center`,justifyContent:{start:`flex-start`,center:`center`,end:`flex-end`,between:`space-between`,around:`space-around`,evenly:`space-evenly`}[r.justify]||`flex-start`,gap:e},r.customStyle]});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`view`,{class:(0,t.normalizeClass)([`sj-space`,e.customClass]),style:(0,t.normalizeStyle)(a.value)},[(0,t.renderSlot)(n.$slots,`default`,{},void 0,!0)],6))}}),[[`__scopeId`,`data-v-ab457af8`]]);N.install=e=>{e.component(`SjSpace`,N)};function P(){return typeof uni<`u`?uni.getSystemInfoSync().uniPlatform||`unknown`:typeof window<`u`?`h5`:`unknown`}function F(){return P()===`h5`}function I(){return P().startsWith(`mp-`)}function L(){return P()===`mp-weixin`}function R(){return P()===`mp-alipay`}function z(){return P()===`app-plus`}function B(){try{return uni.getSystemInfoSync()}catch{return{screenWidth:375,screenHeight:667,windowWidth:375,windowHeight:667,pixelRatio:2,platform:`unknown`}}}function V(e){return e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:typeof e==`object`?Object.keys(e).length===0:!1}function H(e){return typeof e==`number`&&!isNaN(e)}function U(e){return/^1[3-9]\d{9}$/.test(e)}function W(e){return/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)}function G(e){return/^https?:\/\/.+/.test(e)}function K(e){return/^\d{15}|\d{18}|\d{17}[Xx]$/.test(e)}function q(e=!1){let n=(0,t.ref)(e);return{visible:n,show:()=>{n.value=!0},hide:()=>{n.value=!1},toggle:()=>{n.value=!n.value}}}function J(e=!1){let n=(0,t.ref)(e),r=()=>{n.value=!0},i=()=>{n.value=!1};return{loading:n,startLoading:r,stopLoading:i,withLoading:async e=>{try{return r(),await e()}finally{i()}}}}function Y(e=50){let n=(0,t.ref)({scrollTop:0,scrollLeft:0,isScrollTop:!0,isScrollBottom:!1,direction:`none`}),r=0;return{scrollState:n,onScroll:u(t=>{let{scrollTop:i,scrollLeft:a}=t.detail,o=i>r?`down`:i<r?`up`:`none`;r=i,n.value={scrollTop:i,scrollLeft:a,isScrollTop:i<=e,isScrollBottom:!1,direction:o}},100)}}var X={SjButton:v,SjIcon:m,SjCell:S,SjLoading:w,SjDivider:O,SjTag:A,SjBadge:M,SjSpace:N};e.SjBadge=M,e.SjButton=v,e.SjCell=S,e.SjDivider=O,e.SjIcon=m,e.SjLoading=w,e.SjSpace=N,e.SjTag=A,e.addUnit=n,e.clamp=i,e.debounce=l,e.deepClone=o,e.default={install:e=>{Object.entries(X).forEach(([t,n])=>{e.component(t,n)})}},e.getPlatform=P,e.getRect=d,e.getSystemInfo=B,e.isAlipay=R,e.isApp=z,e.isEmail=W,e.isEmpty=V,e.isH5=F,e.isIdCard=K,e.isMP=I,e.isNumber=H,e.isPhone=U,e.isUrl=G,e.isWeixin=L,e.padZero=a,e.removeUnit=r,e.throttle=u,e.uniqueId=c,e.useLoading=J,e.useScroll=Y,e.useVisible=q});
|