foucui 1.0.1 → 1.0.2

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 (234) hide show
  1. package/dist/components/QiuCanvasKit/QiuCanvasEditor.vue.d.ts +3 -1
  2. package/dist/components/QiuCanvasKit/components/DataModulesPanel.vue.d.ts +1 -0
  3. package/dist/components/QiuTable/index.vue.d.ts +12 -12
  4. package/dist/foucui.css +1 -1
  5. package/dist/foucui.js +7476 -7373
  6. package/dist/foucui.umd.cjs +19 -19
  7. package/package.json +23 -13
  8. package/components/QiuAffix/index.vue +0 -186
  9. package/components/QiuAlert/index.vue +0 -208
  10. package/components/QiuAnchor/context.ts +0 -18
  11. package/components/QiuAnchor/index.vue +0 -180
  12. package/components/QiuAnchorLink/index.vue +0 -67
  13. package/components/QiuApp/index.vue +0 -9
  14. package/components/QiuAutocomplete/index.vue +0 -408
  15. package/components/QiuAvatar/index.vue +0 -140
  16. package/components/QiuBacktop/index.vue +0 -121
  17. package/components/QiuBadge/api/index.ts +0 -389
  18. package/components/QiuBadge/components/BadgeImagePickerDialog.vue +0 -243
  19. package/components/QiuBadge/components/BadgeLibraryManagerDialog.vue +0 -30
  20. package/components/QiuBadge/components/BadgeLibraryPanel.vue +0 -182
  21. package/components/QiuBadge/composables/useTableHostHeight.ts +0 -53
  22. package/components/QiuBadge/index.ts +0 -18
  23. package/components/QiuBadge/shared/BadgeTemplateRenderer.vue +0 -32
  24. package/components/QiuBadge/shared/assetUrl.ts +0 -26
  25. package/components/QiuBadge/shared/badgeTemplate.ts +0 -309
  26. package/components/QiuBadge/utils/chinaAreaData.ts +0 -44
  27. package/components/QiuBadge/utils/hostRegion.ts +0 -22
  28. package/components/QiuBadge/utils/pca-code.json +0 -1
  29. package/components/QiuBadge/utils/pdfFromElement.ts +0 -348
  30. package/components/QiuBadge/views/BadgeLibraryView.vue +0 -32
  31. package/components/QiuBadge/views/BadgeManageView.vue +0 -1364
  32. package/components/QiuBadge/views/BadgeTemplateEditorView.vue +0 -10
  33. package/components/QiuBadge/views/BadgeTemplateListView.vue +0 -229
  34. package/components/QiuBadge/views/DeskLabelTemplateListView.vue +0 -227
  35. package/components/QiuBadge/views/DeskLabelView.vue +0 -683
  36. package/components/QiuBadgeDot/index.vue +0 -87
  37. package/components/QiuButton/index.vue +0 -247
  38. package/components/QiuButtonGroup/index.vue +0 -63
  39. package/components/QiuCanvasKit/QiuCanvasEditor.vue +0 -5503
  40. package/components/QiuCanvasKit/QiuCanvasRenderer.vue +0 -348
  41. package/components/QiuCanvasKit/assetUrl.ts +0 -11
  42. package/components/QiuCanvasKit/components/DataModulesPanel.vue +0 -352
  43. package/components/QiuCanvasKit/export/html.ts +0 -132
  44. package/components/QiuCanvasKit/export/pdf.ts +0 -48
  45. package/components/QiuCanvasKit/export/png.ts +0 -50
  46. package/components/QiuCanvasKit/index.ts +0 -20
  47. package/components/QiuCanvasKit/modules/badgeCompat.ts +0 -84
  48. package/components/QiuCanvasKit/modules/dataRegistry.ts +0 -207
  49. package/components/QiuCanvasKit/modules/merge.ts +0 -71
  50. package/components/QiuCanvasKit/presets/badge.ts +0 -67
  51. package/components/QiuCanvasKit/presets/banner.ts +0 -79
  52. package/components/QiuCanvasKit/types.ts +0 -138
  53. package/components/QiuCard/index.vue +0 -104
  54. package/components/QiuCarousel/context.ts +0 -16
  55. package/components/QiuCarousel/index.vue +0 -343
  56. package/components/QiuCarouselItem/index.vue +0 -47
  57. package/components/QiuCascader/index.vue +0 -879
  58. package/components/QiuCascader/types.ts +0 -48
  59. package/components/QiuCheckbox/QiuCheckboxGroup.vue +0 -78
  60. package/components/QiuCheckbox/index.vue +0 -231
  61. package/components/QiuCheckbox/types.ts +0 -8
  62. package/components/QiuCode/index.vue +0 -64
  63. package/components/QiuCol/col.scss +0 -55
  64. package/components/QiuCol/index.vue +0 -64
  65. package/components/QiuCollapse/context.ts +0 -10
  66. package/components/QiuCollapse/index.vue +0 -70
  67. package/components/QiuCollapseItem/index.vue +0 -167
  68. package/components/QiuColorField/index.vue +0 -296
  69. package/components/QiuColorPicker/README.md +0 -118
  70. package/components/QiuColorPicker/index.vue +0 -60
  71. package/components/QiuColorfulCard/index.vue +0 -101
  72. package/components/QiuCombobox/index.vue +0 -277
  73. package/components/QiuConfigProvider/index.vue +0 -31
  74. package/components/QiuContextMenu/index.vue +0 -209
  75. package/components/QiuDate/index.vue +0 -1134
  76. package/components/QiuDescriptions/context.ts +0 -20
  77. package/components/QiuDescriptions/index.vue +0 -115
  78. package/components/QiuDescriptionsItem/index.vue +0 -103
  79. package/components/QiuDialog/index.vue +0 -828
  80. package/components/QiuDigitalCard/index.vue +0 -159
  81. package/components/QiuDivider/index.vue +0 -185
  82. package/components/QiuDot/index.vue +0 -83
  83. package/components/QiuDrawer/index.vue +0 -350
  84. package/components/QiuDropdown/QiuDropdownItem.vue +0 -74
  85. package/components/QiuDropdown/QiuDropdownMenu.vue +0 -22
  86. package/components/QiuDropdown/context.ts +0 -9
  87. package/components/QiuDropdown/index.vue +0 -189
  88. package/components/QiuEmpty/index.vue +0 -73
  89. package/components/QiuForm/index.vue +0 -172
  90. package/components/QiuForm/types.ts +0 -39
  91. package/components/QiuFormItem/index.vue +0 -276
  92. package/components/QiuFullscreen/index.vue +0 -11
  93. package/components/QiuGrid/index.vue +0 -408
  94. package/components/QiuHoverCard/index.vue +0 -192
  95. package/components/QiuIcon/index.vue +0 -117
  96. package/components/QiuIconPicker/iconify.libraries.ts +0 -182
  97. package/components/QiuIconPicker/icons.catalog.ts +0 -3072
  98. package/components/QiuIconPicker/index.vue +0 -488
  99. package/components/QiuImage/index.vue +0 -177
  100. package/components/QiuInput/index.vue +0 -328
  101. package/components/QiuInputNumber/index.vue +0 -295
  102. package/components/QiuInputOtp/index.vue +0 -190
  103. package/components/QiuKbd/index.vue +0 -57
  104. package/components/QiuLayoutContainer/index.vue +0 -50
  105. package/components/QiuLinkPreview/index.vue +0 -224
  106. package/components/QiuLoading/index.ts +0 -176
  107. package/components/QiuLoading/spinner.vue +0 -820
  108. package/components/QiuLoading/types.ts +0 -44
  109. package/components/QiuMention/index.vue +0 -299
  110. package/components/QiuMenu/QiuMenuRoot.vue +0 -241
  111. package/components/QiuMenu/components/QiuMenuItem.vue +0 -340
  112. package/components/QiuMenu/components/QiuSubMenu.vue +0 -504
  113. package/components/QiuMenu/context.ts +0 -21
  114. package/components/QiuMenu/index.vue +0 -43
  115. package/components/QiuMenuNav/QiuMenuNavItem.vue +0 -100
  116. package/components/QiuMenuNav/QiuMenuNavSub.vue +0 -120
  117. package/components/QiuMenuNav/context.ts +0 -14
  118. package/components/QiuMenuNav/index.vue +0 -148
  119. package/components/QiuMsg/QiuMsgItem.vue +0 -180
  120. package/components/QiuMsg/index.ts +0 -158
  121. package/components/QiuMsg/types.ts +0 -23
  122. package/components/QiuMsgBox/index.ts +0 -147
  123. package/components/QiuNotification/QiuNotificationItem.vue +0 -168
  124. package/components/QiuNotification/index.ts +0 -155
  125. package/components/QiuNotification/types.ts +0 -14
  126. package/components/QiuPage/index.vue +0 -12
  127. package/components/QiuPageHeader/index.vue +0 -115
  128. package/components/QiuPageMain/index.vue +0 -78
  129. package/components/QiuPagination/index.vue +0 -421
  130. package/components/QiuPasswordStrength/index.vue +0 -101
  131. package/components/QiuPopconfirm/index.vue +0 -196
  132. package/components/QiuPopover/index.vue +0 -277
  133. package/components/QiuProgress/index.vue +0 -235
  134. package/components/QiuQrcode/index.vue +0 -302
  135. package/components/QiuQueryForm/components/QiuQueryFormBottomPanel.vue +0 -13
  136. package/components/QiuQueryForm/components/QiuQueryFormLeftPanel.vue +0 -37
  137. package/components/QiuQueryForm/components/QiuQueryFormRightPanel.vue +0 -37
  138. package/components/QiuQueryForm/components/QiuQueryFormTopPanel.vue +0 -13
  139. package/components/QiuQueryForm/index.vue +0 -117
  140. package/components/QiuRadio/QiuRadioGroup.vue +0 -75
  141. package/components/QiuRadio/index.vue +0 -191
  142. package/components/QiuRadio/types.ts +0 -9
  143. package/components/QiuRate/index.vue +0 -184
  144. package/components/QiuRefresh/index.vue +0 -32
  145. package/components/QiuResult/index.vue +0 -103
  146. package/components/QiuRow/index.vue +0 -60
  147. package/components/QiuRow/types.ts +0 -5
  148. package/components/QiuScrollbar/index.vue +0 -107
  149. package/components/QiuSearchBar/index.vue +0 -154
  150. package/components/QiuSegmented/index.vue +0 -120
  151. package/components/QiuSelect/QiuOption.vue +0 -93
  152. package/components/QiuSelect/index.vue +0 -452
  153. package/components/QiuSelect/types.ts +0 -15
  154. package/components/QiuSkeleton/index.vue +0 -78
  155. package/components/QiuSlider/index.vue +0 -266
  156. package/components/QiuSpace/index.vue +0 -95
  157. package/components/QiuSparkline/index.vue +0 -92
  158. package/components/QiuStatistic/index.vue +0 -4
  159. package/components/QiuStatistics/index.vue +0 -123
  160. package/components/QiuStep/index.vue +0 -220
  161. package/components/QiuSteps/context.ts +0 -25
  162. package/components/QiuSteps/index.vue +0 -84
  163. package/components/QiuSwitch/index.vue +0 -145
  164. package/components/QiuTabBar/index.vue +0 -218
  165. package/components/QiuTabBar/types.ts +0 -19
  166. package/components/QiuTabPane/index.vue +0 -82
  167. package/components/QiuTable/columns.ts +0 -16
  168. package/components/QiuTable/export.ts +0 -102
  169. package/components/QiuTable/index.ts +0 -24
  170. package/components/QiuTable/index.vue +0 -3503
  171. package/components/QiuTable/registry.ts +0 -75
  172. package/components/QiuTable/styles/table.scss +0 -1230
  173. package/components/QiuTable/types.ts +0 -413
  174. package/components/QiuTable/useArea.ts +0 -202
  175. package/components/QiuTable/useColumns.ts +0 -325
  176. package/components/QiuTable/useEdit.ts +0 -136
  177. package/components/QiuTable/useExtras.ts +0 -115
  178. package/components/QiuTable/useHistory.ts +0 -77
  179. package/components/QiuTable/useMerge.ts +0 -105
  180. package/components/QiuTable/useResize.ts +0 -86
  181. package/components/QiuTable/useScrollSync.ts +0 -152
  182. package/components/QiuTable/useVirtual.ts +0 -97
  183. package/components/QiuTable/utils.ts +0 -165
  184. package/components/QiuTableColumn/index.vue +0 -101
  185. package/components/QiuTag/index.vue +0 -143
  186. package/components/QiuText/index.vue +0 -99
  187. package/components/QiuTime/index.vue +0 -548
  188. package/components/QiuTimeAgo/index.vue +0 -103
  189. package/components/QiuTimeline/index.vue +0 -54
  190. package/components/QiuTimelineItem/index.vue +0 -140
  191. package/components/QiuTips/index.vue +0 -323
  192. package/components/QiuTooltip/index.vue +0 -237
  193. package/components/QiuTransfer/index.vue +0 -277
  194. package/components/QiuTree/QiuTreeNode.vue +0 -146
  195. package/components/QiuTree/index.vue +0 -143
  196. package/components/QiuTree/types.ts +0 -30
  197. package/components/QiuTreeSelect/index.vue +0 -259
  198. package/components/QiuTrend/index.vue +0 -92
  199. package/components/QiuUpload/index.vue +0 -628
  200. package/components/QiuUploadCrop/index.vue +0 -1267
  201. package/components/QiuWatermark/index.vue +0 -121
  202. package/components/useBodyScrollLock.ts +0 -28
  203. package/dist/components/QiuBadge/utils/pca-code.json.d.ts +0 -3
  204. package/plugins/qiu.ts +0 -83
  205. package/plugins/shortcuts.ts +0 -69
  206. package/src/bridge/@/api/media.ts +0 -8
  207. package/src/bridge/@/api/notice.ts +0 -5
  208. package/src/bridge/@/config/index.ts +0 -38
  209. package/src/bridge/@/config/media.config.ts +0 -37
  210. package/src/bridge/@/config/security.config.ts +0 -8
  211. package/src/bridge/@/i18n/index.ts +0 -6
  212. package/src/bridge/@/store/modules/bing.ts +0 -9
  213. package/src/bridge/@/store/modules/errorLog.ts +0 -9
  214. package/src/bridge/@/store/modules/media.ts +0 -10
  215. package/src/bridge/@/store/modules/routes.ts +0 -10
  216. package/src/bridge/@/store/modules/settings.ts +0 -9
  217. package/src/bridge/@/store/modules/tabs.ts +0 -9
  218. package/src/bridge/@/store/modules/user.ts +0 -9
  219. package/src/bridge/@/utils/convertToCamelCase.ts +0 -11
  220. package/src/bridge/@/utils/index.ts +0 -9
  221. package/src/bridge/@/utils/pageTitle.ts +0 -4
  222. package/src/bridge/@/utils/routes.ts +0 -14
  223. package/src/bridge/@/utils/validate.ts +0 -17
  224. package/src/bridge/@qiu/plugins/shortcuts.ts +0 -3
  225. package/src/i18n.ts +0 -8
  226. package/src/icons/qiu-logo.svg +0 -1
  227. package/styles/dark.scss +0 -194
  228. package/styles/normalize.css +0 -349
  229. package/styles/plain.scss +0 -423
  230. package/styles/qiu-tokens.scss +0 -40
  231. package/styles/qiu.scss +0 -1149
  232. package/styles/technology.scss +0 -452
  233. package/styles/var.scss +0 -382
  234. package/styles/variables.scss +0 -77
@@ -1,191 +0,0 @@
1
- <template>
2
- <label
3
- class="qiu-radio"
4
- :class="{
5
- 'is-checked': isChecked,
6
- 'is-disabled': isDisabled,
7
- 'is-button': isButton,
8
- 'is-border': border,
9
- }"
10
- >
11
- <span class="qiu-radio__input">
12
- <input
13
- type="radio"
14
- class="qiu-radio__original"
15
- :checked="isChecked"
16
- :disabled="isDisabled"
17
- :name="radioName"
18
- :value="label"
19
- @change="onChange"
20
- />
21
- <span class="qiu-radio__inner" />
22
- </span>
23
- <span v-if="$slots.default || label !== undefined" class="qiu-radio__label">
24
- <slot>{{ label }}</slot>
25
- </span>
26
- </label>
27
- </template>
28
-
29
- <script lang="ts" setup>
30
- import type { QiuRadioGroupContext } from './types'
31
-
32
- defineOptions({ name: 'QiuRadio' })
33
-
34
- const props = withDefaults(
35
- defineProps<{
36
- modelValue?: string | number | boolean
37
- label?: string | number | boolean
38
- disabled?: boolean
39
- border?: boolean
40
- }>(),
41
- {
42
- disabled: false,
43
- border: false,
44
- }
45
- )
46
-
47
- const emit = defineEmits<{
48
- 'update:modelValue': [string | number | boolean]
49
- change: [string | number | boolean]
50
- }>()
51
-
52
- const groupCtx = inject<QiuRadioGroupContext | null>('qiuRadioGroup', null)
53
- const fallbackName = `qiu-radio-${Math.random().toString(36).slice(2, 9)}`
54
-
55
- const isDisabled = computed(() => props.disabled || groupCtx?.disabled.value)
56
- const isButton = computed(() => groupCtx?.type?.value === 'button')
57
-
58
- const isChecked = computed(() => {
59
- const current = groupCtx ? groupCtx.modelValue.value : props.modelValue
60
- return current === props.label
61
- })
62
-
63
- const radioName = computed(() => groupCtx?.name.value || fallbackName)
64
-
65
- const onChange = () => {
66
- if (isDisabled.value || props.label === undefined) return
67
- if (groupCtx) {
68
- groupCtx.changeEvent(props.label)
69
- } else {
70
- emit('update:modelValue', props.label)
71
- emit('change', props.label)
72
- }
73
- }
74
- </script>
75
-
76
- <style lang="scss" scoped>
77
- .qiu-radio {
78
- display: inline-flex;
79
- gap: 8px;
80
- align-items: center;
81
- height: 32px;
82
- margin-right: 16px;
83
- font-size: 14px;
84
- color: var(--qiu-text-color-regular, var(--qiu-text-color-regular, #606266));
85
- white-space: nowrap;
86
- cursor: pointer;
87
- user-select: none;
88
-
89
- &.is-disabled {
90
- cursor: not-allowed;
91
- opacity: 0.6;
92
- }
93
- }
94
-
95
- .qiu-radio__input {
96
- position: relative;
97
- display: inline-flex;
98
- align-items: center;
99
- }
100
-
101
- .qiu-radio__original {
102
- position: absolute;
103
- z-index: -1;
104
- width: 0;
105
- height: 0;
106
- margin: 0;
107
- opacity: 0;
108
- }
109
-
110
- .qiu-radio__inner {
111
- position: relative;
112
- box-sizing: border-box;
113
- display: inline-block;
114
- width: 14px;
115
- height: 14px;
116
- background: var(--qiu-bg-color, #fff);
117
- border: 1px solid var(--qiu-border-color, #dcdfe6);
118
- border-radius: 50% !important;
119
- transition: border-color 0.2s ease;
120
- }
121
-
122
- .qiu-radio__inner::after {
123
- position: absolute;
124
- top: 50%;
125
- left: 50%;
126
- display: block;
127
- width: 6px;
128
- height: 6px;
129
- content: '';
130
- background-color: #fff;
131
- border-radius: 50% !important;
132
- opacity: 0;
133
- transform: translate(-50%, -50%) scale(0);
134
- transition: transform 0.15s ease-in-out, opacity 0.15s ease-in-out;
135
- }
136
-
137
- .qiu-radio.is-checked .qiu-radio__inner,
138
- .is-checked .qiu-radio__inner {
139
- background-color: var(--qiu-color-primary, #409eff);
140
- border-color: var(--qiu-color-primary, #409eff);
141
- }
142
-
143
- .qiu-radio.is-checked .qiu-radio__inner::after,
144
- .is-checked .qiu-radio__inner::after {
145
- opacity: 1;
146
- transform: translate(-50%, -50%) scale(1);
147
- }
148
-
149
- .qiu-radio__label {
150
- line-height: 1;
151
- }
152
-
153
- .qiu-radio.is-border {
154
- height: 32px;
155
- padding: 0 12px;
156
- border: 1px solid var(--qiu-border-color, #dcdfe6);
157
- border-radius: 4px;
158
-
159
- &.is-checked {
160
- border-color: var(--qiu-color-primary, var(--qiu-color-primary));
161
- }
162
- }
163
-
164
- .qiu-radio.is-button {
165
- height: 32px;
166
- padding: 0 16px;
167
- margin: 0;
168
- background: #fff;
169
- border: 1px solid var(--qiu-border-color, #dcdfe6);
170
- border-left-width: 0;
171
-
172
- &:first-child {
173
- border-left-width: 1px;
174
- border-radius: 4px 0 0 4px;
175
- }
176
-
177
- &:last-child {
178
- border-radius: 0 4px 4px 0;
179
- }
180
-
181
- .qiu-radio__input {
182
- display: none;
183
- }
184
-
185
- &.is-checked {
186
- color: #fff;
187
- background: var(--qiu-color-primary, var(--qiu-color-primary));
188
- border-color: var(--qiu-color-primary, var(--qiu-color-primary));
189
- }
190
- }
191
- </style>
@@ -1,9 +0,0 @@
1
- import type { ComputedRef, Ref } from 'vue'
2
-
3
- export interface QiuRadioGroupContext {
4
- modelValue: Ref<string | number | boolean | undefined>
5
- disabled: Ref<boolean>
6
- name: Ref<string>
7
- type?: ComputedRef<'default' | 'button'>
8
- changeEvent: (val: string | number | boolean) => void
9
- }
@@ -1,184 +0,0 @@
1
- <template>
2
- <div
3
- class="qiu-rate"
4
- :class="{ 'is-disabled': disabled, 'is-readonly': readonly }"
5
- role="slider"
6
- :aria-valuenow="modelValue"
7
- :aria-valuemin="0"
8
- :aria-valuemax="max"
9
- >
10
- <button
11
- v-for="i in max"
12
- :key="i"
13
- type="button"
14
- class="qiu-rate__item"
15
- :class="{
16
- 'is-active': displayValue >= i,
17
- 'is-half': allowHalf && displayValue + 0.5 === i,
18
- }"
19
- :disabled="disabled || readonly"
20
- @mousemove="onMove($event, i)"
21
- @mouseleave="hoverValue = -1"
22
- @click="onClick($event, i)"
23
- >
24
- <span class="qiu-rate__icon qiu-rate__icon--void">
25
- <qiu-icon :icon="voidIcon" />
26
- </span>
27
- <span
28
- class="qiu-rate__icon qiu-rate__icon--full"
29
- :style="fullStyle(i)"
30
- >
31
- <qiu-icon :icon="icon" />
32
- </span>
33
- </button>
34
- <span v-if="showScore || showText" class="qiu-rate__text">
35
- {{ text }}
36
- </span>
37
- </div>
38
- </template>
39
-
40
- <script lang="ts" setup>
41
- defineOptions({ name: 'QiuRate' })
42
-
43
- const props = withDefaults(
44
- defineProps<{
45
- modelValue?: number
46
- max?: number
47
- disabled?: boolean
48
- readonly?: boolean
49
- allowHalf?: boolean
50
- showScore?: boolean
51
- showText?: boolean
52
- texts?: string[]
53
- colors?: string[]
54
- voidColor?: string
55
- icon?: string
56
- voidIcon?: string
57
- }>(),
58
- {
59
- modelValue: 0,
60
- max: 5,
61
- disabled: false,
62
- readonly: false,
63
- allowHalf: false,
64
- showScore: false,
65
- showText: false,
66
- texts: () => ['极差', '失望', '一般', '满意', '惊喜'],
67
- colors: () => ['#f7ba2a', '#f7ba2a', '#f7ba2a'],
68
- voidColor: '#c0c4cc',
69
- icon: 'star-fill',
70
- voidIcon: 'star-line',
71
- }
72
- )
73
-
74
- const emit = defineEmits<{
75
- 'update:modelValue': [number]
76
- change: [number]
77
- }>()
78
-
79
- const hoverValue = ref(-1)
80
-
81
- const voidColor = computed(() => props.voidColor)
82
-
83
- const displayValue = computed(() =>
84
- hoverValue.value >= 0 ? hoverValue.value : props.modelValue
85
- )
86
-
87
- const activeColor = computed(() => {
88
- const v = displayValue.value
89
- const colors = props.colors
90
- if (v <= props.max / 3) return colors[0] || '#f7ba2a'
91
- if (v <= (props.max * 2) / 3) return colors[1] || colors[0] || '#f7ba2a'
92
- return colors[2] || colors[1] || colors[0] || '#f7ba2a'
93
- })
94
-
95
- const text = computed(() => {
96
- if (props.showScore) return String(displayValue.value)
97
- if (!props.showText) return ''
98
- const idx = Math.ceil(displayValue.value) - 1
99
- return props.texts[Math.max(0, Math.min(props.texts.length - 1, idx))] || ''
100
- })
101
-
102
- const fullStyle = (i: number) => {
103
- const v = displayValue.value
104
- let width = '0%'
105
- if (v >= i) width = '100%'
106
- else if (props.allowHalf && v + 0.5 >= i && v < i) width = '50%'
107
- return {
108
- width,
109
- color: activeColor.value,
110
- }
111
- }
112
-
113
- const resolveHalf = (e: MouseEvent, i: number) => {
114
- if (!props.allowHalf) return i
115
- const el = e.currentTarget as HTMLElement
116
- const rect = el.getBoundingClientRect()
117
- return e.clientX - rect.left < rect.width / 2 ? i - 0.5 : i
118
- }
119
-
120
- const onMove = (e: MouseEvent, i: number) => {
121
- if (props.disabled || props.readonly) return
122
- hoverValue.value = resolveHalf(e, i)
123
- }
124
-
125
- const onClick = (e: MouseEvent, i: number) => {
126
- if (props.disabled || props.readonly) return
127
- const next = resolveHalf(e, i)
128
- emit('update:modelValue', next)
129
- emit('change', next)
130
- }
131
- </script>
132
-
133
- <style lang="scss" scoped>
134
- .qiu-rate {
135
- display: inline-flex;
136
- gap: 6px;
137
- align-items: center;
138
- height: 32px;
139
- line-height: 1;
140
- vertical-align: middle;
141
-
142
- &.is-disabled,
143
- &.is-readonly {
144
- .qiu-rate__item {
145
- cursor: default;
146
- }
147
- }
148
- }
149
-
150
- .qiu-rate__item {
151
- position: relative;
152
- display: inline-flex;
153
- padding: 0;
154
- font-size: 18px;
155
- color: v-bind(voidColor);
156
- cursor: pointer;
157
- background: transparent;
158
- border: 0;
159
-
160
- &:disabled {
161
- cursor: not-allowed;
162
- opacity: 0.7;
163
- }
164
- }
165
-
166
- .qiu-rate__icon {
167
- display: inline-flex;
168
- line-height: 1;
169
-
170
- &--full {
171
- position: absolute;
172
- top: 0;
173
- left: 0;
174
- overflow: hidden;
175
- white-space: nowrap;
176
- }
177
- }
178
-
179
- .qiu-rate__text {
180
- margin-left: 6px;
181
- font-size: 14px;
182
- color: var(--qiu-text-color-regular, #606266);
183
- }
184
- </style>
@@ -1,32 +0,0 @@
1
- <template>
2
- <qiu-icon :class="className" icon="refresh-line" @click="refreshRoute" />
3
- </template>
4
-
5
- <script lang="ts" setup>
6
- defineOptions({
7
- name: 'QiuRefresh',
8
- })
9
-
10
- const className = ref<string>('')
11
-
12
- const $pub = inject<(...args: any[]) => void>('$pub')
13
- const $sub = inject<(...args: any[]) => void>('$sub')
14
-
15
- const rotate = () => {
16
- className.value = 'rotate'
17
- setTimeout(() => {
18
- className.value = ''
19
- }, 500)
20
- }
21
-
22
- const refreshRoute = () => {
23
- $pub?.('reload-router-view')
24
- rotate()
25
- }
26
-
27
- onBeforeMount(() => {
28
- $sub?.('refresh-rotate', () => {
29
- rotate()
30
- })
31
- })
32
- </script>
@@ -1,103 +0,0 @@
1
- <template>
2
- <div class="qiu-result" :class="icon ? `qiu-result--${icon}` : ''">
3
- <div class="qiu-result__icon">
4
- <slot name="icon">
5
- <qiu-icon v-if="resolvedIcon" :icon="resolvedIcon" />
6
- </slot>
7
- </div>
8
- <div v-if="title || $slots.title" class="qiu-result__title">
9
- <slot name="title">{{ title }}</slot>
10
- </div>
11
- <div v-if="subTitle || $slots['sub-title']" class="qiu-result__subtitle">
12
- <slot name="sub-title">{{ subTitle }}</slot>
13
- </div>
14
- <div v-if="$slots.extra" class="qiu-result__extra">
15
- <slot name="extra" />
16
- </div>
17
- <div v-if="$slots.default" class="qiu-result__content">
18
- <slot />
19
- </div>
20
- </div>
21
- </template>
22
-
23
- <script lang="ts" setup>
24
- defineOptions({ name: 'QiuResult' })
25
-
26
- const props = withDefaults(
27
- defineProps<{
28
- icon?: 'success' | 'warning' | 'info' | 'error' | ''
29
- title?: string
30
- subTitle?: string
31
- }>(),
32
- {
33
- icon: '',
34
- title: '',
35
- subTitle: '',
36
- }
37
- )
38
-
39
- const iconMap: Record<string, string> = {
40
- success: 'checkbox-circle-line',
41
- warning: 'error-warning-line',
42
- info: 'information-line',
43
- error: 'close-circle-line',
44
- }
45
-
46
- const resolvedIcon = computed(() => (props.icon ? iconMap[props.icon] || '' : ''))
47
- </script>
48
-
49
- <style lang="scss" scoped>
50
- .qiu-result {
51
- display: flex;
52
- flex-direction: column;
53
- align-items: center;
54
- padding: 40px 24px;
55
- text-align: center;
56
- }
57
-
58
- .qiu-result__icon {
59
- font-size: 64px;
60
- line-height: 1;
61
- color: var(--qiu-color-primary, var(--qiu-color-primary, #0f766e));
62
- }
63
-
64
- .qiu-result--success .qiu-result__icon {
65
- color: var(--qiu-color-success, var(--qiu-color-success, #67c23a));
66
- }
67
-
68
- .qiu-result--warning .qiu-result__icon {
69
- color: var(--qiu-color-warning, var(--qiu-color-warning, #e6a23c));
70
- }
71
-
72
- .qiu-result--error .qiu-result__icon {
73
- color: var(--qiu-color-danger, var(--qiu-color-danger, #f56c6c));
74
- }
75
-
76
- .qiu-result--info .qiu-result__icon {
77
- color: var(--qiu-color-info, var(--qiu-color-info, #909399));
78
- }
79
-
80
- .qiu-result__title {
81
- margin-top: 20px;
82
- font-size: 20px;
83
- font-weight: 600;
84
- line-height: 1.4;
85
- color: var(--qiu-text-color-primary, var(--qiu-text-color-primary, #303133));
86
- }
87
-
88
- .qiu-result__subtitle {
89
- margin-top: 8px;
90
- font-size: var(--qiu-font-size, 14px);
91
- line-height: 1.6;
92
- color: var(--qiu-text-color-secondary, var(--qiu-text-color-secondary, #909399));
93
- }
94
-
95
- .qiu-result__extra {
96
- margin-top: 24px;
97
- }
98
-
99
- .qiu-result__content {
100
- width: 100%;
101
- margin-top: 24px;
102
- }
103
- </style>
@@ -1,60 +0,0 @@
1
- <template>
2
- <div class="qiu-row" :style="rowStyle">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import { QIU_ROW_KEY, type QiuRowContext } from './types'
9
-
10
- defineOptions({ name: 'QiuRow' })
11
-
12
- const props = withDefaults(
13
- defineProps<{
14
- gutter?: number
15
- justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly'
16
- align?: 'top' | 'middle' | 'bottom'
17
- tag?: string
18
- }>(),
19
- {
20
- gutter: 0,
21
- justify: 'start',
22
- align: 'top',
23
- tag: 'div',
24
- }
25
- )
26
-
27
- const gutterRef = computed(() => props.gutter || 0)
28
-
29
- provide<QiuRowContext>(QIU_ROW_KEY, {
30
- gutter: gutterRef,
31
- })
32
-
33
- const rowStyle = computed(() => {
34
- const g = props.gutter || 0
35
- return {
36
- marginLeft: g ? `${-g / 2}px` : undefined,
37
- marginRight: g ? `${-g / 2}px` : undefined,
38
- justifyContent:
39
- props.justify === 'start'
40
- ? 'flex-start'
41
- : props.justify === 'end'
42
- ? 'flex-end'
43
- : props.justify === 'center'
44
- ? 'center'
45
- : props.justify,
46
- alignItems:
47
- props.align === 'top' ? 'flex-start' : props.align === 'bottom' ? 'flex-end' : 'center',
48
- }
49
- })
50
- </script>
51
-
52
- <style lang="scss" scoped>
53
- .qiu-row {
54
- box-sizing: border-box;
55
- display: flex;
56
- flex-wrap: wrap;
57
- position: relative;
58
- box-sizing: border-box;
59
- }
60
- </style>
@@ -1,5 +0,0 @@
1
- export const QIU_ROW_KEY = Symbol('qiuRow')
2
-
3
- export interface QiuRowContext {
4
- gutter: import('vue').Ref<number>
5
- }
@@ -1,107 +0,0 @@
1
- <template>
2
- <div
3
- ref="rootRef"
4
- class="qiu-scrollbar"
5
- :class="[wrapClass, { 'qiu-scrollbar--native': native }]"
6
- :style="wrapStyle"
7
- @scroll="onScroll"
8
- >
9
- <div class="qiu-scrollbar__view">
10
- <slot />
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script lang="ts" setup>
16
- defineOptions({ name: 'QiuScrollbar' })
17
-
18
- const props = withDefaults(
19
- defineProps<{
20
- maxHeight?: string | number
21
- height?: string | number
22
- native?: boolean
23
- wrapClass?: string | string[] | Record<string, boolean>
24
- }>(),
25
- {
26
- native: true,
27
- }
28
- )
29
-
30
- const emit = defineEmits<{
31
- scroll: [payload: { scrollTop: number; scrollLeft: number }]
32
- }>()
33
-
34
- const rootRef = ref<HTMLElement | null>(null)
35
-
36
- const toCssSize = (v?: string | number) => {
37
- if (v === undefined || v === null || v === '') return undefined
38
- return typeof v === 'number' ? `${v}px` : String(v)
39
- }
40
-
41
- const wrapStyle = computed(() => {
42
- const style: Record<string, string> = {}
43
- const maxH = toCssSize(props.maxHeight)
44
- const h = toCssSize(props.height)
45
- if (maxH) style.maxHeight = maxH
46
- if (h) style.height = h
47
- return style
48
- })
49
-
50
- const onScroll = (e: Event) => {
51
- const t = e.target as HTMLElement
52
- emit('scroll', { scrollTop: t.scrollTop, scrollLeft: t.scrollLeft })
53
- }
54
-
55
- const setScrollTop = (top: number) => {
56
- if (rootRef.value) rootRef.value.scrollTop = top
57
- }
58
-
59
- const setScrollLeft = (left: number) => {
60
- if (rootRef.value) rootRef.value.scrollLeft = left
61
- }
62
-
63
- defineExpose({
64
- wrapRef: rootRef,
65
- $el: rootRef,
66
- setScrollTop,
67
- setScrollLeft,
68
- })
69
- </script>
70
-
71
- <style lang="scss" scoped>
72
- .qiu-scrollbar {
73
- flex: 1 1 auto;
74
- min-width: 0;
75
- min-height: 0;
76
- width: 100%;
77
- height: 100%;
78
- overflow: auto;
79
- box-sizing: border-box;
80
-
81
- scrollbar-width: thin;
82
- scrollbar-color: var(--qiu-border-color-lighter, var(--qiu-border-color-lighter, #e4e7ed)) transparent;
83
-
84
- &::-webkit-scrollbar {
85
- width: 3px;
86
- height: 3px;
87
- }
88
-
89
- &::-webkit-scrollbar-thumb {
90
- background: var(--qiu-border-color, var(--qiu-border-color, #dcdfe6));
91
- border-radius: 2px;
92
-
93
- &:hover {
94
- background: var(--qiu-text-color-placeholder, var(--qiu-text-color-placeholder, #a8abb2));
95
- }
96
- }
97
-
98
- &::-webkit-scrollbar-track {
99
- background: transparent;
100
- }
101
- }
102
-
103
- .qiu-scrollbar__view {
104
- min-height: 100%;
105
- min-width: 100%;
106
- }
107
- </style>