@didaoktv/didaoui-uniapp 1.3.4 → 1.3.6

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @didaoktv/didaoui-uniapp
1
+ # @didaoktv/didaoui-uniapp
2
2
 
3
3
  专为 KTV 场景打造的 UniApp 组件库。
4
4
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  - **帝王级配色** — 帝王金 `#F5A623` + 皇家蓝 `#2D4BA0` 双主色,暗色主题默认
8
8
  - **玻璃拟态设计** — 多层级玻璃拟态效果,打造高端夜店沉浸感
9
- - **89 个精心打磨的组件** — 覆盖表单、导航、布局卡片、数据展示、浮层反馈、交互、画布七大类,含 KTV 业务组件(房态卡、账单明细、工单卡、日历、二维码)
9
+ - **90 个精心打磨的组件** — 覆盖表单、导航、布局卡片、数据展示、浮层反馈、交互、画布七大类,含 KTV 业务组件(房态卡、账单明细、工单卡、日历、二维码)
10
10
  - **Vue3 + TypeScript** — 完整类型定义,Composition API
11
11
  - **多端兼容** — H5 / 微信小程序 / 抖音小程序 / Android / iOS
12
12
 
@@ -54,7 +54,7 @@ import { DdButton, DdInput } from '@didaoktv/didaoui-uniapp'
54
54
  | 导航 | 12 | Navigation, TopNavbar, SwipeableTab, SegmentedTab, Drawer, Tabbar, TabbarItem, Backtop, Collapse, CollapseItem, DropdownMenu, DropdownItem |
55
55
  | 布局/卡片 | 8 | Card, RoomCard, FeatureGrid, Sticky, BillDetail, WorkorderCard, Calendar, Qrcode |
56
56
  | 数据展示 | 24 | Tag, StatCard, ChampionCard, Avatar, AvatarGroup, Badge, ListCell, Cell, CellGroup, CountDown, Divider, Image, Progress, Skeleton, EmptyState, Step, Steps, Text, Link, Copy, Album, Coupon, Parse, Markdown |
57
- | 浮层反馈 | 10 | Modal, ActionSheet, Toast, Alert, Loading, Dialog, Overlay, Popup, Popover, PopoverItem |
57
+ | 浮层反馈 | 11 | Modal, ActionSheet, Toast, Alert, Loading, Dialog, Overlay, Popup, Popover, PopoverItem, Portal |
58
58
  | 交互 | 5 | SwipeAction, Swipe, SwipeItem, PullRefresh, Loadmore |
59
59
  | 小程序专属 | 2 | CapsuleButton, MiniProgramNavbar |
60
60
  | 画布 | 5 | Canvas, Barcode, Cropper, Signature, Poster |
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <dd-portal>
2
3
  <view class="dd-action-sheet">
3
4
  <view
4
5
  class="dd-action-sheet__mask"
@@ -33,9 +34,11 @@
33
34
  <view class="dd-action-sheet__safe-bottom"></view>
34
35
  </view>
35
36
  </view>
37
+ </dd-portal>
36
38
  </template>
37
39
 
38
40
  <script setup lang="ts">
41
+ import DdPortal from '../dd-portal/dd-portal.vue'
39
42
  import DdIcon from '../dd-icon/dd-icon.vue'
40
43
 
41
44
  interface ActionItem {
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <dd-portal>
2
3
  <view class="dd-alert">
3
4
  <view
4
5
  class="dd-alert__mask"
@@ -21,10 +22,12 @@
21
22
  </view>
22
23
  </view>
23
24
  </view>
25
+ </dd-portal>
24
26
  </template>
25
27
 
26
28
  <script setup lang="ts">
27
29
  import { computed } from 'vue'
30
+ import DdPortal from '../dd-portal/dd-portal.vue'
28
31
  import DdIcon from '../dd-icon/dd-icon.vue'
29
32
 
30
33
  type AlertType = 'info' | 'success' | 'warning' | 'error' | 'confirm'
@@ -0,0 +1,47 @@
1
+ // 车牌号键盘纯逻辑:键位布局、按位锁键、光标推进(供 dd-car-keyboard.vue 消费)
2
+ export const MAX_LEN = 8
3
+
4
+ export interface KeyItem {
5
+ label: string
6
+ locked: boolean
7
+ }
8
+
9
+ // 省份行(参考实现末行含字母 W 为笔误,此处修正为 港/澳)
10
+ export const PROVINCE_ROWS: string[][] = [
11
+ ['京', '津', '晋', '冀', '蒙', '辽', '吉', '黑', '沪'],
12
+ ['苏', '浙', '皖', '闽', '赣', '鲁', '豫', '鄂', '湘'],
13
+ ['粤', '桂', '琼', '渝', '川', '贵', '云', '藏'],
14
+ ['陕', '甘', '青', '宁', '新', '港', '澳']
15
+ ]
16
+
17
+ const DIGIT_ROW = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
18
+ const EN_ROW2_DEFAULT = ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'O', 'P', '挂']
19
+ // 第 6 位(新能源序号位)去掉 O,追加 学/挂
20
+ const EN_ROW2_ENERGY = ['Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'P', '学', '挂']
21
+ const EN_ROW3 = ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', '警']
22
+ const EN_ROW4 = ['Z', 'X', 'C', 'V', 'B', 'N', 'M', '港', '澳']
23
+
24
+ // 按位锁键:1 位禁数字与特殊字;2-5/7 位禁 O 与特殊字;6 位(新能源)仅禁 O
25
+ export function getLockedKeys(pos: number): string[] {
26
+ if (pos <= 0) return []
27
+ if (pos === 1) return [...DIGIT_ROW, '学', '挂', '警', '港', '澳']
28
+ if (pos === MAX_LEN - 2) return ['O']
29
+ return ['O', '学', '挂', '警', '港', '澳']
30
+ }
31
+
32
+ // pos=0 返回省份键盘,其余位返回字母数字键盘(带锁定态)
33
+ export function getKeyRows(pos: number): KeyItem[][] {
34
+ if (pos === 0) {
35
+ return PROVINCE_ROWS.map((row) => row.map((label) => ({ label, locked: false })))
36
+ }
37
+ const row2 = pos === MAX_LEN - 2 ? EN_ROW2_ENERGY : EN_ROW2_DEFAULT
38
+ const locked = getLockedKeys(pos)
39
+ return [DIGIT_ROW, row2, EN_ROW3, EN_ROW4].map((row) =>
40
+ row.map((label) => ({ label, locked: locked.includes(label) }))
41
+ )
42
+ }
43
+
44
+ // 填完第 7 位后收起键盘(返回 -1),新能源位(第 8 位)由用户主动点选
45
+ export function nextPos(pos: number): number {
46
+ return pos < MAX_LEN - 2 ? pos + 1 : -1
47
+ }