@didaoktv/didaoui-uniapp 1.0.0 → 1.2.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.
Files changed (114) hide show
  1. package/README.md +16 -7
  2. package/components/dd-action-sheet/dd-action-sheet.vue +3 -3
  3. package/components/dd-album/album.js +19 -0
  4. package/components/dd-album/dd-album.vue +345 -0
  5. package/components/dd-album/props.js +89 -0
  6. package/components/dd-avatar/avatar.js +19 -0
  7. package/components/dd-avatar/dd-avatar.vue +172 -160
  8. package/components/dd-avatar/props.js +84 -0
  9. package/components/dd-avatar-group/avatarGroup.js +14 -0
  10. package/components/dd-avatar-group/dd-avatar-group.vue +110 -0
  11. package/components/dd-avatar-group/props.js +57 -0
  12. package/components/dd-badge/dd-badge.vue +2 -2
  13. package/components/dd-barcode/dd-barcode.vue +1030 -0
  14. package/components/dd-bill-detail/dd-bill-detail.vue +265 -0
  15. package/components/dd-button/dd-button.vue +17 -17
  16. package/components/dd-calendar/dd-calendar.vue +357 -0
  17. package/components/dd-canvas/dd-canvas.vue +1088 -0
  18. package/components/dd-capsule-button/dd-capsule-button.vue +6 -6
  19. package/components/dd-car-keyboard/carKeyboard.js +6 -0
  20. package/components/dd-car-keyboard/dd-car-keyboard.vue +315 -0
  21. package/components/dd-car-keyboard/props.js +19 -0
  22. package/components/dd-cascader/dd-cascader.vue +405 -0
  23. package/components/dd-cell/dd-cell.vue +50 -23
  24. package/components/dd-cell-group/dd-cell-group.vue +32 -25
  25. package/components/dd-champion-card/dd-champion-card.vue +4 -4
  26. package/components/dd-checkbox/dd-checkbox.vue +30 -39
  27. package/components/dd-checkbox-group/dd-checkbox-group.vue +67 -0
  28. package/components/dd-copy/dd-copy.vue +74 -0
  29. package/components/dd-coupon/dd-coupon.vue +368 -0
  30. package/components/dd-cropper/dd-cropper.vue +1297 -0
  31. package/components/dd-dialog/dd-dialog.vue +1 -1
  32. package/components/dd-divider/dd-divider.vue +3 -3
  33. package/components/dd-dropdown-item/dd-dropdown-item.vue +5 -5
  34. package/components/dd-empty-state/dd-empty-state.vue +1 -1
  35. package/components/dd-field/dd-field.vue +531 -106
  36. package/components/dd-form/dd-form.vue +116 -0
  37. package/components/dd-form/rules.ts +84 -0
  38. package/components/dd-goods-sku/dd-goods-sku.vue +434 -0
  39. package/components/dd-icon/dd-icon.vue +2 -2
  40. package/components/dd-image/dd-image.vue +4 -4
  41. package/components/dd-input/dd-input.vue +5 -5
  42. package/components/dd-keyboard/dd-keyboard.vue +178 -0
  43. package/components/dd-keyboard/keyboard.js +22 -0
  44. package/components/dd-keyboard/props.js +89 -0
  45. package/components/dd-link/dd-link.vue +87 -0
  46. package/components/dd-link/link.js +18 -0
  47. package/components/dd-link/props.js +44 -0
  48. package/components/dd-list-cell/dd-list-cell.vue +4 -4
  49. package/components/dd-loading/dd-loading.vue +1 -1
  50. package/components/dd-loadmore/dd-loadmore.vue +2 -2
  51. package/components/dd-markdown/dd-markdown.vue +344 -0
  52. package/components/dd-markdown/marked.esm.mjs +7 -0
  53. package/components/dd-mini-program-navbar/dd-mini-program-navbar.vue +9 -9
  54. package/components/dd-navigation/dd-navigation.vue +5 -5
  55. package/components/dd-number-keyboard/dd-number-keyboard.vue +200 -0
  56. package/components/dd-number-keyboard/numberKeyboard.js +8 -0
  57. package/components/dd-number-keyboard/props.js +24 -0
  58. package/components/dd-parse/dd-parse.vue +534 -0
  59. package/components/dd-parse/node/handler.wxs +26 -0
  60. package/components/dd-parse/node/node.vue +603 -0
  61. package/components/dd-parse/parse.js +13 -0
  62. package/components/dd-parse/parser.js +1400 -0
  63. package/components/dd-parse/props.js +57 -0
  64. package/components/dd-popover/dd-popover.vue +10 -10
  65. package/components/dd-popover-item/dd-popover-item.vue +3 -3
  66. package/components/dd-popup/dd-popup.vue +5 -5
  67. package/components/dd-poster/dd-poster.vue +695 -0
  68. package/components/dd-progress/dd-progress.vue +3 -3
  69. package/components/dd-pull-refresh/dd-pull-refresh.vue +3 -3
  70. package/components/dd-qrcode/dd-qrcode.vue +509 -0
  71. package/components/dd-qrcode/qrcode.js +1283 -0
  72. package/components/dd-radio/dd-radio.vue +19 -20
  73. package/components/dd-radio-group/dd-radio-group.vue +53 -0
  74. package/components/dd-rate/dd-rate.vue +1 -1
  75. package/components/dd-room-card/dd-room-card.vue +3 -3
  76. package/components/dd-search-bar/dd-search-bar.vue +8 -8
  77. package/components/dd-segmented-tab/dd-segmented-tab.vue +6 -6
  78. package/components/dd-signature/dd-signature.vue +513 -0
  79. package/components/dd-skeleton/dd-skeleton.vue +1 -1
  80. package/components/dd-slider/dd-slider.vue +4 -4
  81. package/components/dd-stat-card/dd-stat-card.vue +5 -5
  82. package/components/dd-step/dd-step.vue +11 -11
  83. package/components/dd-stepper/dd-stepper.vue +6 -6
  84. package/components/dd-swipe-action/dd-swipe-action.vue +1 -1
  85. package/components/dd-swipeable-tab/dd-swipeable-tab.vue +1 -1
  86. package/components/dd-tabbar-item/dd-tabbar-item.vue +8 -8
  87. package/components/dd-tag/dd-tag.vue +17 -1
  88. package/components/dd-text/dd-text.vue +250 -0
  89. package/components/dd-text/props.js +120 -0
  90. package/components/dd-text/text.js +30 -0
  91. package/components/dd-text/value.js +87 -0
  92. package/components/dd-toast/dd-toast.vue +2 -2
  93. package/components/dd-upload/dd-upload.vue +4 -4
  94. package/components/dd-workorder-card/dd-workorder-card.vue +237 -0
  95. package/index.ts +50 -9
  96. package/libs/config/color.js +16 -0
  97. package/libs/config/config.js +25 -0
  98. package/libs/config/props.js +185 -0
  99. package/libs/config/zIndex.js +20 -0
  100. package/libs/function/digit.js +167 -0
  101. package/libs/function/index.js +932 -0
  102. package/libs/function/test.js +327 -0
  103. package/libs/i18n/index.d.ts +2 -0
  104. package/libs/i18n/index.js +89 -0
  105. package/libs/i18n/locales/zh-Hans.js +86 -0
  106. package/libs/mixin/button.js +18 -0
  107. package/libs/mixin/mixin.js +44 -0
  108. package/libs/mixin/mpMixin.js +13 -0
  109. package/libs/mixin/openType.js +27 -0
  110. package/libs/utils.ts +462 -0
  111. package/libs/vue.js +3 -0
  112. package/package.json +1 -1
  113. package/scss/_dd-shared.scss +40 -0
  114. package/scss/_variables.scss +4 -1
@@ -0,0 +1,237 @@
1
+ <template>
2
+ <view
3
+ class="dd-workorder-card"
4
+ :class="`dd-workorder-card--${type}`"
5
+ hover-class="dd-workorder-card--press"
6
+ :hover-stay-time="40"
7
+ @click="onClick"
8
+ >
9
+ <view class="dd-workorder-card__head">
10
+ <text class="dd-workorder-card__title">{{ title }}</text>
11
+ <text v-if="status || typeText" class="dd-workorder-card__tag" :class="`dd-workorder-card__tag--${type}`">
12
+ {{ status || typeText }}
13
+ </text>
14
+ </view>
15
+
16
+ <view v-if="checklist && checklist.length" class="dd-workorder-card__checklist">
17
+ <view
18
+ v-for="item in checklist"
19
+ :key="item.id"
20
+ class="dd-workorder-card__check-item"
21
+ hover-class="dd-workorder-card__check-item--press"
22
+ :hover-stay-time="40"
23
+ @click.stop="onCheck(item)"
24
+ >
25
+ <view class="dd-workorder-card__box" :class="{ 'dd-workorder-card__box--on': item.done }">
26
+ <text v-if="item.done" class="dd-workorder-card__box-check">✓</text>
27
+ </view>
28
+ <text class="dd-workorder-card__check-text" :class="{ 'dd-workorder-card__check-text--done': item.done }">
29
+ {{ item.text }}
30
+ </text>
31
+ </view>
32
+ </view>
33
+
34
+ <view v-if="progress !== undefined" class="dd-workorder-card__progress">
35
+ <view class="dd-workorder-card__progress-track">
36
+ <view class="dd-workorder-card__progress-bar" :style="{ width: progress + '%' }" />
37
+ </view>
38
+ <text class="dd-workorder-card__progress-text">{{ progress }}%</text>
39
+ </view>
40
+
41
+ <view v-if="time" class="dd-workorder-card__time">{{ time }}</view>
42
+
43
+ <view v-if="$slots.actions" class="dd-workorder-card__actions">
44
+ <slot name="actions" />
45
+ </view>
46
+ </view>
47
+ </template>
48
+
49
+ <script setup lang="ts">
50
+ import { computed } from 'vue'
51
+
52
+ export interface ChecklistItem {
53
+ id: string
54
+ text: string
55
+ done: boolean
56
+ }
57
+
58
+ interface Props {
59
+ title: string
60
+ type?: 'service' | 'repair' | 'feedback' | 'decoration' | 'todo'
61
+ status?: string
62
+ checklist?: ChecklistItem[]
63
+ progress?: number
64
+ time?: string
65
+ }
66
+
67
+ const props = withDefaults(defineProps<Props>(), {
68
+ title: '',
69
+ type: 'todo',
70
+ status: '',
71
+ checklist: () => [],
72
+ progress: undefined,
73
+ time: '',
74
+ })
75
+
76
+ const emit = defineEmits<{
77
+ (e: 'check', val: { item: ChecklistItem; done: boolean }): void
78
+ (e: 'click', val: { title: string }): void
79
+ }>()
80
+
81
+ const typeTextMap: Record<string, string> = {
82
+ service: '服务铃',
83
+ repair: '维修',
84
+ feedback: '反馈',
85
+ decoration: '布置',
86
+ todo: '待办',
87
+ }
88
+
89
+ const typeText = computed(() => (props.status ? '' : typeTextMap[props.type] || '待办'))
90
+
91
+ function onCheck(item: ChecklistItem) {
92
+ // 受控组件:不直接改 prop,仅把「期望的新状态」上抛,由父级持有 done 状态。
93
+ // 避免父级 @check 再翻转一次导致双重切换。
94
+ const done = !item.done
95
+ emit('check', { item, done })
96
+ }
97
+
98
+ function onClick() {
99
+ emit('click', { title: props.title })
100
+ }
101
+ </script>
102
+
103
+ <style lang="scss" scoped>
104
+ @import '../../scss/variables';
105
+ @import '../../scss/mixins';
106
+
107
+ .dd-workorder-card {
108
+ @include dd-glass(sm);
109
+ border-radius: $dd-radius-lg;
110
+ padding: $dd-space-3 $dd-space-4;
111
+
112
+ &--press {
113
+ transform: scale(0.99);
114
+ background: $dd-surface-hover;
115
+ }
116
+ }
117
+
118
+ .dd-workorder-card__head {
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: space-between;
122
+ gap: $dd-space-2;
123
+ }
124
+
125
+ .dd-workorder-card__title {
126
+ flex: 1;
127
+ min-width: 0;
128
+ font-size: $dd-font-size-body;
129
+ font-weight: $dd-font-weight-lead;
130
+ color: $dd-text-primary;
131
+ @include dd-ellipsis(1);
132
+ }
133
+
134
+ .dd-workorder-card__tag {
135
+ flex-shrink: 0;
136
+ font-size: 20rpx;
137
+ padding: 2rpx 14rpx;
138
+ border-radius: $dd-radius-sm;
139
+
140
+ &--service { color: $dd-primary-400; background: rgba(245, 166, 35, 0.12); }
141
+ &--repair { color: $dd-error-400; background: rgba(229, 57, 53, 0.12); }
142
+ &--feedback { color: $dd-accent-300; background: rgba(45, 75, 160, 0.2); }
143
+ &--decoration { color: $dd-vip-500; background: rgba(156, 39, 176, 0.14); }
144
+ &--todo { color: $dd-text-secondary; background: $dd-glass-border; }
145
+ }
146
+
147
+ .dd-workorder-card__checklist {
148
+ margin-top: $dd-space-2;
149
+ display: flex;
150
+ flex-direction: column;
151
+ }
152
+
153
+ .dd-workorder-card__check-item {
154
+ display: flex;
155
+ align-items: center;
156
+ gap: $dd-space-2;
157
+ padding: $dd-space-1 0;
158
+
159
+ &--press {
160
+ opacity: 0.7;
161
+ }
162
+ }
163
+
164
+ .dd-workorder-card__box {
165
+ width: 40rpx;
166
+ height: 40rpx;
167
+ flex-shrink: 0;
168
+ border-radius: $dd-radius-sm;
169
+ border: 2rpx solid $dd-border-strong;
170
+ @include dd-flex-center;
171
+
172
+ &--on {
173
+ background: $dd-gradient-primary;
174
+ border-color: transparent;
175
+ }
176
+ }
177
+
178
+ .dd-workorder-card__box-check {
179
+ font-size: $dd-font-size-caption;
180
+ color: $dd-neutral-900;
181
+ line-height: 1;
182
+ }
183
+
184
+ .dd-workorder-card__check-text {
185
+ flex: 1;
186
+ font-size: $dd-font-size-body;
187
+ color: $dd-text-primary;
188
+
189
+ &--done {
190
+ color: $dd-text-tertiary;
191
+ text-decoration: line-through;
192
+ }
193
+ }
194
+
195
+ .dd-workorder-card__progress {
196
+ display: flex;
197
+ align-items: center;
198
+ gap: $dd-space-2;
199
+ margin-top: $dd-space-2;
200
+ }
201
+
202
+ .dd-workorder-card__progress-track {
203
+ flex: 1;
204
+ height: $dd-space-1;
205
+ background: $dd-surface-container-high;
206
+ border-radius: $dd-radius-full;
207
+ overflow: hidden;
208
+ }
209
+
210
+ .dd-workorder-card__progress-bar {
211
+ height: 100%;
212
+ background: $dd-gradient-primary-h;
213
+ border-radius: $dd-radius-full;
214
+ transition: width 0.3s ease;
215
+ }
216
+
217
+ .dd-workorder-card__progress-text {
218
+ font-size: $dd-font-size-caption;
219
+ color: $dd-text-tertiary;
220
+ font-family: $dd-font-mono;
221
+ }
222
+
223
+ .dd-workorder-card__time {
224
+ margin-top: $dd-space-1;
225
+ font-size: $dd-font-size-caption;
226
+ color: $dd-text-tertiary;
227
+ }
228
+
229
+ .dd-workorder-card__actions {
230
+ display: flex;
231
+ justify-content: flex-end;
232
+ gap: $dd-space-3;
233
+ margin-top: $dd-space-2;
234
+ border-top: 1px solid $dd-border-subtle;
235
+ padding-top: $dd-space-2;
236
+ }
237
+ </style>
package/index.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  import type { App } from 'vue'
2
2
 
3
- // === Input (13) ===
3
+ // === Input (21) ===
4
4
  import DdButton from './components/dd-button/dd-button.vue'
5
5
  import DdInput from './components/dd-input/dd-input.vue'
6
6
  import DdSwitch from './components/dd-switch/dd-switch.vue'
7
7
  import DdCheckbox from './components/dd-checkbox/dd-checkbox.vue'
8
+ import DdCheckboxGroup from './components/dd-checkbox-group/dd-checkbox-group.vue'
8
9
  import DdRadio from './components/dd-radio/dd-radio.vue'
10
+ import DdRadioGroup from './components/dd-radio-group/dd-radio-group.vue'
11
+ import DdForm from './components/dd-form/dd-form.vue'
9
12
  import DdSearchBar from './components/dd-search-bar/dd-search-bar.vue'
10
13
  import DdSlider from './components/dd-slider/dd-slider.vue'
11
14
  import DdStepper from './components/dd-stepper/dd-stepper.vue'
@@ -15,6 +18,11 @@ import DdPicker from './components/dd-picker/dd-picker.vue'
15
18
  import DdRate from './components/dd-rate/dd-rate.vue'
16
19
  import DdUpload from './components/dd-upload/dd-upload.vue'
17
20
  import DdIcon from './components/dd-icon/dd-icon.vue'
21
+ import DdKeyboard from './components/dd-keyboard/dd-keyboard.vue'
22
+ import DdNumberKeyboard from './components/dd-number-keyboard/dd-number-keyboard.vue'
23
+ import DdCarKeyboard from './components/dd-car-keyboard/dd-car-keyboard.vue'
24
+ import DdCascader from './components/dd-cascader/dd-cascader.vue'
25
+ import DdGoodsSku from './components/dd-goods-sku/dd-goods-sku.vue'
18
26
 
19
27
  // === Navigation (12) ===
20
28
  import DdNavigation from './components/dd-navigation/dd-navigation.vue'
@@ -35,12 +43,17 @@ import DdCard from './components/dd-card/dd-card.vue'
35
43
  import DdRoomCard from './components/dd-room-card/dd-room-card.vue'
36
44
  import DdFeatureGrid from './components/dd-feature-grid/dd-feature-grid.vue'
37
45
  import DdSticky from './components/dd-sticky/dd-sticky.vue'
46
+ import DdBillDetail from './components/dd-bill-detail/dd-bill-detail.vue'
47
+ import DdWorkorderCard from './components/dd-workorder-card/dd-workorder-card.vue'
48
+ import DdCalendar from './components/dd-calendar/dd-calendar.vue'
49
+ import DdQrcode from './components/dd-qrcode/dd-qrcode.vue'
38
50
 
39
- // === Display (16) ===
51
+ // === Display (24) ===
40
52
  import DdTag from './components/dd-tag/dd-tag.vue'
41
53
  import DdStatCard from './components/dd-stat-card/dd-stat-card.vue'
42
54
  import DdChampionCard from './components/dd-champion-card/dd-champion-card.vue'
43
55
  import DdAvatar from './components/dd-avatar/dd-avatar.vue'
56
+ import DdAvatarGroup from './components/dd-avatar-group/dd-avatar-group.vue'
44
57
  import DdBadge from './components/dd-badge/dd-badge.vue'
45
58
  import DdListCell from './components/dd-list-cell/dd-list-cell.vue'
46
59
  import DdCell from './components/dd-cell/dd-cell.vue'
@@ -53,6 +66,13 @@ import DdSkeleton from './components/dd-skeleton/dd-skeleton.vue'
53
66
  import DdEmptyState from './components/dd-empty-state/dd-empty-state.vue'
54
67
  import DdStep from './components/dd-step/dd-step.vue'
55
68
  import DdSteps from './components/dd-steps/dd-steps.vue'
69
+ import DdText from './components/dd-text/dd-text.vue'
70
+ import DdLink from './components/dd-link/dd-link.vue'
71
+ import DdCopy from './components/dd-copy/dd-copy.vue'
72
+ import DdAlbum from './components/dd-album/dd-album.vue'
73
+ import DdCoupon from './components/dd-coupon/dd-coupon.vue'
74
+ import DdParse from './components/dd-parse/dd-parse.vue'
75
+ import DdMarkdown from './components/dd-markdown/dd-markdown.vue'
56
76
 
57
77
  // === Overlay (10) ===
58
78
  import DdModal from './components/dd-modal/dd-modal.vue'
@@ -77,24 +97,34 @@ import DdLoadmore from './components/dd-loadmore/dd-loadmore.vue'
77
97
  import DdCapsuleButton from './components/dd-capsule-button/dd-capsule-button.vue'
78
98
  import DdMiniProgramNavbar from './components/dd-mini-program-navbar/dd-mini-program-navbar.vue'
79
99
 
100
+ // === Canvas (5) ===
101
+ import DdCanvas from './components/dd-canvas/dd-canvas.vue'
102
+ import DdBarcode from './components/dd-barcode/dd-barcode.vue'
103
+ import DdCropper from './components/dd-cropper/dd-cropper.vue'
104
+ import DdSignature from './components/dd-signature/dd-signature.vue'
105
+ import DdPoster from './components/dd-poster/dd-poster.vue'
106
+
80
107
  const components = {
81
- DdButton, DdInput, DdSwitch, DdCheckbox, DdRadio,
108
+ DdButton, DdInput, DdSwitch, DdCheckbox, DdCheckboxGroup, DdRadio, DdRadioGroup, DdForm,
82
109
  DdSearchBar, DdSlider, DdStepper, DdDatePicker, DdField,
83
110
  DdPicker, DdRate, DdUpload, DdIcon,
111
+ DdKeyboard, DdNumberKeyboard, DdCarKeyboard, DdCascader, DdGoodsSku,
84
112
  DdNavigation, DdTopNavbar, DdSegmentedTab, DdSwipeableTab,
85
113
  DdDrawer, DdTabbar, DdTabbarItem, DdBacktop,
86
114
  DdCollapse, DdCollapseItem, DdDropdownMenu, DdDropdownItem,
87
- DdCard, DdRoomCard, DdFeatureGrid, DdSticky,
88
- DdTag, DdStatCard, DdChampionCard, DdAvatar, DdBadge,
115
+ DdCard, DdRoomCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdCalendar, DdQrcode,
116
+ DdTag, DdStatCard, DdChampionCard, DdAvatar, DdAvatarGroup, DdBadge,
89
117
  DdListCell, DdCell, DdCellGroup, DdCountDown, DdDivider,
90
118
  DdImage, DdProgress, DdSkeleton, DdEmptyState, DdStep, DdSteps,
119
+ DdText, DdLink, DdCopy, DdAlbum, DdCoupon, DdParse, DdMarkdown,
91
120
  DdModal, DdActionSheet, DdToast, DdAlert, DdLoading,
92
121
  DdDialog, DdOverlay, DdPopup, DdPopover, DdPopoverItem,
93
122
  DdSwipeAction, DdSwipe, DdSwipeItem, DdPullRefresh, DdLoadmore,
94
123
  DdCapsuleButton, DdMiniProgramNavbar,
124
+ DdCanvas, DdBarcode, DdCropper, DdSignature, DdPoster,
95
125
  }
96
126
 
97
- export function install(app: App) {
127
+ export function install(app: App, ...options: any[]) {
98
128
  Object.entries(components).forEach(([name, comp]) => {
99
129
  app.component(name, comp)
100
130
  })
@@ -105,23 +135,34 @@ export default { install }
105
135
  // 全量具名导出
106
136
  export {
107
137
  components,
108
- DdButton, DdInput, DdSwitch, DdCheckbox, DdRadio,
138
+ DdButton, DdInput, DdSwitch, DdCheckbox, DdCheckboxGroup, DdRadio, DdRadioGroup, DdForm,
109
139
  DdSearchBar, DdSlider, DdStepper, DdDatePicker, DdField,
110
140
  DdPicker, DdRate, DdUpload, DdIcon,
141
+ DdKeyboard, DdNumberKeyboard, DdCarKeyboard, DdCascader, DdGoodsSku,
111
142
  DdNavigation, DdTopNavbar, DdSegmentedTab, DdSwipeableTab,
112
143
  DdDrawer, DdTabbar, DdTabbarItem, DdBacktop,
113
144
  DdCollapse, DdCollapseItem, DdDropdownMenu, DdDropdownItem,
114
- DdCard, DdRoomCard, DdFeatureGrid, DdSticky,
115
- DdTag, DdStatCard, DdChampionCard, DdAvatar, DdBadge,
145
+ DdCard, DdRoomCard, DdFeatureGrid, DdSticky, DdBillDetail, DdWorkorderCard, DdCalendar, DdQrcode,
146
+ DdTag, DdStatCard, DdChampionCard, DdAvatar, DdAvatarGroup, DdBadge,
116
147
  DdListCell, DdCell, DdCellGroup, DdCountDown, DdDivider,
117
148
  DdImage, DdProgress, DdSkeleton, DdEmptyState, DdStep, DdSteps,
149
+ DdText, DdLink, DdCopy, DdAlbum, DdCoupon, DdParse, DdMarkdown,
118
150
  DdModal, DdActionSheet, DdToast, DdAlert, DdLoading,
119
151
  DdDialog, DdOverlay, DdPopup, DdPopover, DdPopoverItem,
120
152
  DdSwipeAction, DdSwipe, DdSwipeItem, DdPullRefresh, DdLoadmore,
121
153
  DdCapsuleButton, DdMiniProgramNavbar,
154
+ DdCanvas, DdBarcode, DdCropper, DdSignature, DdPoster,
122
155
  }
123
156
 
124
157
  export * from './libs/utils'
125
158
 
159
+ // 表单校验类型(dd-form/dd-field 配套)
160
+ export type {
161
+ DdFieldRule,
162
+ DdFieldValidateTrigger,
163
+ DdFieldInstance,
164
+ DdFormContext,
165
+ } from './components/dd-form/rules'
166
+
126
167
  // 图标元数据(供 demo/文档消费,与 dd-icon.vue 内 SCSS &-- 规则保持一致)
127
168
  export { iconNames, iconGroups } from './components/dd-icon/dd-icon.vue'
@@ -0,0 +1,16 @@
1
+ // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
2
+ const color = {
3
+ primary: '#3c9cff',
4
+ info: '#909399',
5
+ default: '#909399',
6
+ warning: '#f9ae3d',
7
+ error: '#f56c6c',
8
+ success: '#5ac725',
9
+ mainColor: '#303133',
10
+ contentColor: '#606266',
11
+ tipsColor: '#909399',
12
+ lightColor: '#c0c4cc',
13
+ borderColor: '#e4e7ed'
14
+ }
15
+
16
+ export default color
@@ -0,0 +1,25 @@
1
+ const version = '3'
2
+
3
+ // 开发环境才提示,生产环境不会提示
4
+ if (process.env.NODE_ENV === 'development') {
5
+ console.log(`\n %c DidaoUI V${version} %c https://didaoktv.com \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
6
+ }
7
+
8
+ export default {
9
+ v: version,
10
+ version,
11
+ // 颜色部分,本来可以通过scss的:export导出供js使用,但是奈何nvue不支持
12
+ color: {
13
+ 'primary': '#2979ff',
14
+ 'warning': '#ff9900',
15
+ 'success': '#19be6b',
16
+ 'error': '#fa3534',
17
+ 'info': '#909399',
18
+ 'main-color': '#303133',
19
+ 'content-color': '#606266',
20
+ 'tips-color': '#909399',
21
+ 'light-color': '#c0c4cc'
22
+ },
23
+ // 默认单位,可以通过配置为rpx,那么在用于传入组件大小参数为数值时,就默认为rpx
24
+ unit: 'px'
25
+ }
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Shared props configuration store.
3
+ *
4
+ * Component defaults are registered lazily by each component props.js file so
5
+ * importing one component no longer pulls defaults for every component.
6
+ */
7
+ import config from './config'
8
+ import zIndex from './zIndex.js'
9
+ import color from './color.js'
10
+ import { shallowMerge } from '../function/index.js'
11
+
12
+ const componentKeys = [
13
+ 'actionSheet',
14
+ 'album',
15
+ 'alert',
16
+ 'avatar',
17
+ 'avatarGroup',
18
+ 'backtop',
19
+ 'badge',
20
+ 'box',
21
+ 'button',
22
+ 'calendar',
23
+ 'calendarStrip',
24
+ 'carKeyboard',
25
+ 'card',
26
+ 'cell',
27
+ 'cellGroup',
28
+ 'checkbox',
29
+ 'checkboxGroup',
30
+ 'circleProgress',
31
+ 'code',
32
+ 'codeInput',
33
+ 'col',
34
+ 'collapse',
35
+ 'collapseItem',
36
+ 'columnNotice',
37
+ 'countDown',
38
+ 'countTo',
39
+ 'datetimePicker',
40
+ 'divider',
41
+ 'dropdown',
42
+ 'dropdownItem',
43
+ 'empty',
44
+ 'form',
45
+ 'formItem',
46
+ 'gap',
47
+ 'grid',
48
+ 'gridItem',
49
+ 'guide',
50
+ 'icon',
51
+ 'image',
52
+ 'indexAnchor',
53
+ 'indexItem',
54
+ 'indexList',
55
+ 'input',
56
+ 'keyboard',
57
+ 'line',
58
+ 'lineProgress',
59
+ 'link',
60
+ 'list',
61
+ 'listItem',
62
+ 'loadingIcon',
63
+ 'loadingPage',
64
+ 'loadmore',
65
+ 'modal',
66
+ 'navbar',
67
+ 'navbarMini',
68
+ 'noNetwork',
69
+ 'noticeBar',
70
+ 'notify',
71
+ 'novelReader',
72
+ 'numberBox',
73
+ 'numberKeyboard',
74
+ 'overlay',
75
+ 'parse',
76
+ 'pdfReader',
77
+ 'picker',
78
+ 'pickerColumn',
79
+ 'popover',
80
+ 'popup',
81
+ 'radio',
82
+ 'radioGroup',
83
+ 'rate',
84
+ 'readMore',
85
+ 'row',
86
+ 'rowNotice',
87
+ 'safeBottom',
88
+ 'scrollList',
89
+ 'search',
90
+ 'section',
91
+ 'skeleton',
92
+ 'slider',
93
+ 'statusBar',
94
+ 'steps',
95
+ 'stepsItem',
96
+ 'sticky',
97
+ 'subsection',
98
+ 'swipeAction',
99
+ 'swipeActionItem',
100
+ 'swiper',
101
+ 'swiperIndicator',
102
+ 'switch',
103
+ 'tabbar',
104
+ 'tabbarItem',
105
+ 'table',
106
+ 'tabs',
107
+ 'tabsItem',
108
+ 'tag',
109
+ 'td',
110
+ 'text',
111
+ 'textarea',
112
+ 'th',
113
+ 'toast',
114
+ 'toolbar',
115
+ 'tooltip',
116
+ 'tr',
117
+ 'transition',
118
+ 'upload'
119
+ ]
120
+
121
+ const props = {}
122
+
123
+ function ensureComponentProps(key) {
124
+ if (!props[key] || typeof props[key] !== 'object') {
125
+ props[key] = {}
126
+ }
127
+ return props[key]
128
+ }
129
+
130
+ function isPlainObject(value) {
131
+ return Object.prototype.toString.call(value) === '[object Object]'
132
+ }
133
+
134
+ function cloneDefaultValue(value) {
135
+ if (Array.isArray(value)) {
136
+ return value.slice()
137
+ }
138
+ if (isPlainObject(value)) {
139
+ return mergeDefaults({}, value)
140
+ }
141
+ return value
142
+ }
143
+
144
+ function mergeDefaults(target, defaults = {}) {
145
+ if (!target || typeof target !== 'object' || !defaults || typeof defaults !== 'object') {
146
+ return target
147
+ }
148
+ Object.keys(defaults).forEach((key) => {
149
+ const defaultValue = defaults[key]
150
+ const targetValue = target[key]
151
+ if (targetValue === undefined) {
152
+ target[key] = cloneDefaultValue(defaultValue)
153
+ } else if (isPlainObject(targetValue) && isPlainObject(defaultValue)) {
154
+ mergeDefaults(targetValue, defaultValue)
155
+ }
156
+ })
157
+ return target
158
+ }
159
+
160
+ componentKeys.forEach(ensureComponentProps)
161
+
162
+ export function registerComponentProps(defaultProps = {}) {
163
+ Object.keys(defaultProps || {}).forEach((key) => {
164
+ const componentProps = ensureComponentProps(key)
165
+ mergeDefaults(componentProps, defaultProps[key])
166
+ })
167
+ return props
168
+ }
169
+
170
+ export function setPropsConfig(configProps = {}) {
171
+ Object.keys(configProps || {}).forEach((key) => {
172
+ shallowMerge(ensureComponentProps(key), configProps[key])
173
+ })
174
+ return props
175
+ }
176
+
177
+ function setConfig(configs = {}) {
178
+ shallowMerge(config, configs.config || {})
179
+ setPropsConfig(configs.props || {})
180
+ shallowMerge(color, configs.color || {})
181
+ shallowMerge(zIndex, configs.zIndex || {})
182
+ }
183
+
184
+ // ponytail: 不提供全局配置注入入口(含 http 实例注册),DidaoUI 组件默认值由各组件 props.js 就地注册
185
+ export default props
@@ -0,0 +1,20 @@
1
+ // uniapp在H5中各API的z-index值如下:
2
+ /**
3
+ * actionsheet: 999
4
+ * modal: 999
5
+ * navigate: 998
6
+ * tabbar: 998
7
+ * toast: 999
8
+ */
9
+
10
+ export default {
11
+ toast: 10090,
12
+ noNetwork: 10080,
13
+ // popup包含popup,actionsheet,keyboard,picker的值
14
+ popup: 10075,
15
+ mask: 10070,
16
+ navbar: 980,
17
+ topTips: 975,
18
+ sticky: 970,
19
+ indexListSticky: 965
20
+ }