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,488 +0,0 @@
1
- <template>
2
- <div class="qiu-icon-picker">
3
- <div class="qiu-icon-picker__trigger" @click="openDialog">
4
- <span class="qiu-icon-picker__preview-wrap" :class="{ 'is-on': !!modelValue }">
5
- <qiu-icon v-if="modelValue" :icon="modelValue" class="qiu-icon-picker__preview" />
6
- <span v-else class="qiu-icon-picker__placeholder">{{ translate('选择图标') }}</span>
7
- </span>
8
- <qiu-input
9
- :model-value="modelValue"
10
- class="qiu-icon-picker__input"
11
- :placeholder="placeholder"
12
- clearable
13
- @update:model-value="onInput"
14
- @focus="openDialog"
15
- @click.stop="openDialog"
16
- />
17
- <qiu-button size="small" @click.stop="openDialog">
18
- <qiu-icon icon="apps-2-line" />
19
- </qiu-button>
20
- </div>
21
-
22
- <qiu-dialog
23
- v-model="visible"
24
- :title="translate('选择图标')"
25
- width="920px"
26
- :z-index="5300"
27
- :show-minimize="false"
28
- :show-fullscreen="false"
29
- destroy-on-close
30
- @opened="onDialogOpened"
31
- >
32
- <div class="qiu-icon-picker__body">
33
- <qiu-loading-spinner v-if="loadingLib" class="qiu-icon-picker__loading" />
34
- <aside class="qiu-icon-picker__libs">
35
- <button
36
- v-for="lib in libraryStats"
37
- :key="lib.id"
38
- type="button"
39
- class="qiu-icon-picker__lib"
40
- :class="{ 'is-active': activeLib === lib.id }"
41
- @click="switchLib(lib.id)"
42
- >
43
- <strong>{{ lib.name }}</strong>
44
- <span>{{ lib.count }} icons</span>
45
- <em>{{ lib.license }}</em>
46
- </button>
47
- <p class="qiu-icon-picker__license-tip">
48
- {{ translate('均为免费开源图标,可商用(按需懒加载)') }}
49
- </p>
50
- </aside>
51
-
52
- <div class="qiu-icon-picker__main">
53
- <qiu-input
54
- v-model="keyword"
55
- clearable
56
- :placeholder="translate('搜索图标名')"
57
- class="qiu-icon-picker__search"
58
- @input="page = 1"
59
- >
60
- <template #prefix>
61
- <qiu-icon icon="search-line" />
62
- </template>
63
- </qiu-input>
64
-
65
- <div class="qiu-icon-picker__meta">
66
- <span>{{ filteredIcons.length }} / {{ currentCatalog.length }}</span>
67
- <span v-if="modelValue" class="qiu-icon-picker__current">
68
- {{ translate('当前') }}:
69
- <span class="qiu-icon-picker__current-icon">
70
- <qiu-icon :icon="modelValue" />
71
- </span>
72
- <code>{{ modelValue }}</code>
73
- </span>
74
- <qiu-button v-if="modelValue" link type="danger" size="small" @click="clearIcon">
75
- {{ translate('清除') }}
76
- </qiu-button>
77
- </div>
78
-
79
- <div class="qiu-icon-picker__grid">
80
- <button
81
- type="button"
82
- class="qiu-icon-picker__item is-clear"
83
- :title="translate('清除图标')"
84
- @click="clearIcon"
85
- >
86
- <qiu-icon icon="delete-bin-line" />
87
- <span>{{ translate('清除') }}</span>
88
- </button>
89
- <button
90
- v-for="name in pagedIcons"
91
- :key="name"
92
- type="button"
93
- class="qiu-icon-picker__item"
94
- :class="{ 'is-active': modelValue === toValue(name) }"
95
- :title="toValue(name)"
96
- @click="pick(name)"
97
- >
98
- <qiu-icon :icon="toValue(name)" />
99
- <span>{{ name }}</span>
100
- </button>
101
- </div>
102
-
103
- <qiu-empty v-if="!loadingLib && !filteredIcons.length" :description="translate('无匹配图标')" />
104
-
105
- <div v-if="pageCount > 1" class="qiu-icon-picker__pager">
106
- <qiu-pagination
107
- v-model:current-page="page"
108
- background
109
- layout="prev, pager, next, jumper"
110
- :page-size="pageSize"
111
- :total="filteredIcons.length"
112
- small
113
- />
114
- </div>
115
- </div>
116
- </div>
117
- </qiu-dialog>
118
- </div>
119
- </template>
120
-
121
- <script lang="ts" setup>
122
- import QiuLoadingSpinner from '../QiuLoading/spinner.vue'
123
- import { translate } from '../../src/i18n'
124
- import { remixIconCatalog } from './icons.catalog'
125
- import {
126
- detectLibraryId,
127
- ensureIconifyLibrary,
128
- iconifyLibraries,
129
- toPickerValue,
130
- type IconifyLibId,
131
- type IconifyLibraryDef,
132
- } from './iconify.libraries'
133
-
134
- defineOptions({
135
- name: 'QiuIconPicker',
136
- })
137
-
138
- const props = withDefaults(
139
- defineProps<{
140
- modelValue?: string
141
- placeholder?: string
142
- }>(),
143
- {
144
- modelValue: '',
145
- placeholder: 'home-2-line / mdi:home',
146
- }
147
- )
148
-
149
- const emit = defineEmits<{
150
- 'update:modelValue': [value: string]
151
- }>()
152
-
153
- const visible = ref(false)
154
- const keyword = ref('')
155
- const page = ref(1)
156
- const pageSize = 60
157
- const activeLib = ref<IconifyLibId>('remix')
158
- const loadingLib = ref(false)
159
- const catalogByLib = reactive<Record<string, string[]>>({
160
- remix: remixIconCatalog,
161
- })
162
- const countByLib = reactive<Record<string, number>>({
163
- remix: remixIconCatalog.length,
164
- })
165
-
166
- const currentLib = computed(
167
- () => iconifyLibraries.find((l) => l.id === activeLib.value) || iconifyLibraries[0]
168
- )
169
-
170
- const libraryStats = computed(() =>
171
- iconifyLibraries.map((lib) => ({
172
- ...lib,
173
- count: countByLib[lib.id] || (lib.localRemix ? remixIconCatalog.length : '…'),
174
- }))
175
- )
176
-
177
- const currentCatalog = computed(() => catalogByLib[activeLib.value] || [])
178
-
179
- const filteredIcons = computed(() => {
180
- const q = keyword.value.trim().toLowerCase()
181
- if (!q) return currentCatalog.value
182
- return currentCatalog.value.filter((name) => name.toLowerCase().includes(q))
183
- })
184
-
185
- const pageCount = computed(() => Math.max(1, Math.ceil(filteredIcons.value.length / pageSize)))
186
-
187
- const pagedIcons = computed(() => {
188
- const start = (page.value - 1) * pageSize
189
- return filteredIcons.value.slice(start, start + pageSize)
190
- })
191
-
192
- const toValue = (iconName: string) => toPickerValue(currentLib.value, iconName)
193
-
194
- const loadLib = async (lib: IconifyLibraryDef) => {
195
- if (lib.localRemix) {
196
- catalogByLib.remix = remixIconCatalog
197
- countByLib.remix = remixIconCatalog.length
198
- return
199
- }
200
- if (catalogByLib[lib.id]?.length) return
201
- loadingLib.value = true
202
- try {
203
- const names = await ensureIconifyLibrary(lib)
204
- catalogByLib[lib.id] = names
205
- countByLib[lib.id] = names.length
206
- } finally {
207
- loadingLib.value = false
208
- }
209
- }
210
-
211
- const switchLib = async (id: IconifyLibId) => {
212
- activeLib.value = id
213
- page.value = 1
214
- keyword.value = ''
215
- const lib = iconifyLibraries.find((l) => l.id === id)
216
- if (lib) await loadLib(lib)
217
- }
218
-
219
- const openDialog = () => {
220
- visible.value = true
221
- }
222
-
223
- const onDialogOpened = async () => {
224
- activeLib.value = detectLibraryId(props.modelValue)
225
- await loadLib(currentLib.value)
226
- }
227
-
228
- const pick = (name: string) => {
229
- emit('update:modelValue', toValue(name))
230
- visible.value = false
231
- }
232
-
233
- const clearIcon = () => {
234
- emit('update:modelValue', '')
235
- }
236
-
237
- const onInput = (val: string) => {
238
- emit('update:modelValue', val || '')
239
- keyword.value = val?.includes(':') ? val.split(':')[1] || '' : val || ''
240
- page.value = 1
241
- visible.value = true
242
- }
243
- </script>
244
-
245
- <style lang="scss" scoped>
246
- .qiu-icon-picker {
247
- width: 100%;
248
-
249
- &__trigger {
250
- display: flex;
251
- gap: 8px;
252
- align-items: center;
253
- width: 100%;
254
- }
255
-
256
- &__preview-wrap {
257
- display: inline-flex;
258
- flex-shrink: 0;
259
- align-items: center;
260
- justify-content: center;
261
- width: 36px;
262
- height: 36px;
263
- color: var(--qiu-text-color-secondary);
264
- background: var(--qiu-fill-color-light);
265
- border: 1px solid var(--qiu-border-color-lighter);
266
- border-radius: 8px;
267
-
268
- &.is-on {
269
- color: var(--qiu-color-primary);
270
- background: var(--qiu-color-primary-light-9);
271
- border-color: color-mix(in srgb, var(--qiu-color-primary) 35%, transparent);
272
- }
273
- }
274
-
275
- &__preview {
276
- font-size: 20px;
277
- }
278
-
279
- &__placeholder {
280
- font-size: 11px;
281
- color: var(--qiu-text-color-placeholder);
282
- text-align: center;
283
- }
284
-
285
- &__input {
286
- flex: 1;
287
- min-width: 0;
288
- }
289
-
290
- &__body {
291
- position: relative;
292
- display: grid;
293
- grid-template-columns: 210px minmax(0, 1fr);
294
- gap: 12px;
295
- height: min(48vh, 420px);
296
- max-height: min(48vh, 420px);
297
- min-height: 280px;
298
- }
299
-
300
- &__loading {
301
- position: absolute;
302
- inset: 0;
303
- z-index: 10;
304
- pointer-events: auto;
305
- }
306
-
307
- &__libs {
308
- display: flex;
309
- flex-direction: column;
310
- gap: 6px;
311
- height: 100%;
312
- min-height: 0;
313
- padding: 4px;
314
- overflow-x: hidden;
315
- overflow-y: auto;
316
- background: var(--qiu-fill-color-lighter);
317
- border-radius: 8px;
318
- }
319
-
320
- &__lib {
321
- display: flex;
322
- flex-direction: column;
323
- gap: 2px;
324
- flex-shrink: 0;
325
- align-items: flex-start;
326
- padding: 10px 12px;
327
- text-align: left;
328
- cursor: pointer;
329
- background: transparent;
330
- border: 1px solid transparent;
331
- border-radius: 8px;
332
-
333
- strong {
334
- font-size: 13px;
335
- color: var(--qiu-text-color-primary);
336
- }
337
-
338
- span {
339
- font-size: 12px;
340
- color: var(--qiu-text-color-secondary);
341
- }
342
-
343
- em {
344
- font-size: 11px;
345
- font-style: normal;
346
- color: var(--qiu-text-color-placeholder);
347
- }
348
-
349
- &:hover,
350
- &.is-active {
351
- background: var(--qiu-bg-color);
352
- border-color: var(--qiu-color-primary-light-5);
353
- box-shadow: 0 1px 4px rgb(0 0 0 / 6%);
354
- }
355
-
356
- &.is-active strong {
357
- color: var(--qiu-color-primary);
358
- }
359
- }
360
-
361
- &__license-tip {
362
- flex-shrink: 0;
363
- margin: 8px 4px 0;
364
- font-size: 11px;
365
- line-height: 1.4;
366
- color: var(--qiu-text-color-placeholder);
367
- }
368
-
369
- &__main {
370
- display: flex;
371
- flex-direction: column;
372
- height: 100%;
373
- min-width: 0;
374
- min-height: 0;
375
- }
376
-
377
- &__search {
378
- flex-shrink: 0;
379
- margin-bottom: 8px;
380
- }
381
-
382
- &__meta {
383
- display: flex;
384
- flex-shrink: 0;
385
- flex-wrap: wrap;
386
- gap: 12px;
387
- align-items: center;
388
- margin-bottom: 8px;
389
- font-size: 12px;
390
- color: var(--qiu-text-color-secondary);
391
- }
392
-
393
- &__current {
394
- display: inline-flex;
395
- gap: 6px;
396
- align-items: center;
397
-
398
- code {
399
- font-size: 12px;
400
- }
401
- }
402
-
403
- &__current-icon {
404
- display: inline-flex;
405
- align-items: center;
406
- justify-content: center;
407
- width: 26px;
408
- height: 26px;
409
- color: var(--qiu-color-primary);
410
- background: var(--qiu-color-primary-light-9);
411
- border-radius: 6px;
412
- }
413
-
414
- &__grid {
415
- display: grid;
416
- flex: 1 1 auto;
417
- grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
418
- gap: 8px;
419
- align-content: start;
420
- min-height: 0;
421
- max-height: none;
422
- padding-right: 4px;
423
- overflow: auto;
424
- }
425
-
426
- &__item {
427
- display: flex;
428
- flex-direction: column;
429
- gap: 6px;
430
- align-items: center;
431
- padding: 10px 6px;
432
- font-size: 11px;
433
- line-height: 1.2;
434
- color: var(--qiu-text-color-regular);
435
- cursor: pointer;
436
- background: var(--qiu-fill-color-blank);
437
- border: 1px solid var(--qiu-border-color-lighter);
438
- border-radius: 8px;
439
- transition: border-color 0.15s, background 0.15s, color 0.15s;
440
-
441
- :deep(.qiu-icon) {
442
- font-size: 22px;
443
- }
444
-
445
- span {
446
- width: 100%;
447
- overflow: hidden;
448
- text-align: center;
449
- text-overflow: ellipsis;
450
- white-space: nowrap;
451
- }
452
-
453
- &:hover,
454
- &.is-active {
455
- color: var(--qiu-color-primary);
456
- background: var(--qiu-color-primary-light-9);
457
- border-color: var(--qiu-color-primary);
458
- }
459
-
460
- &.is-clear {
461
- color: var(--qiu-color-danger);
462
- border-style: dashed;
463
- }
464
- }
465
-
466
- &__pager {
467
- display: flex;
468
- flex-shrink: 0;
469
- justify-content: center;
470
- margin-top: 12px;
471
- }
472
- }
473
-
474
- @media (width <= 720px) {
475
- .qiu-icon-picker__body {
476
- grid-template-columns: 1fr;
477
- height: min(60vh, 480px);
478
- max-height: min(60vh, 480px);
479
- }
480
-
481
- .qiu-icon-picker__libs {
482
- flex-direction: row;
483
- height: auto;
484
- max-height: 120px;
485
- overflow: auto;
486
- }
487
- }
488
- </style>
@@ -1,177 +0,0 @@
1
- <template>
2
- <div
3
- class="qiu-image"
4
- :class="{ 'is-preview': previewable }"
5
- @click="onPreview"
6
- >
7
- <img
8
- class="qiu-image__inner"
9
- :src="src"
10
- :alt="alt"
11
- :loading="lazy ? 'lazy' : undefined"
12
- :style="{ objectFit: fit }"
13
- />
14
- <div v-if="previewable" class="qiu-image__mask">
15
- <qiu-icon icon="zoom-in-line" />
16
- </div>
17
-
18
- <Teleport to="body">
19
- <Transition name="qiu-image-fade">
20
- <div
21
- v-if="previewVisible"
22
- class="qiu-image__viewer"
23
- @click.self="closePreview"
24
- >
25
- <button type="button" class="qiu-image__close" aria-label="关闭" @click="closePreview">
26
- <qiu-icon icon="close-line" />
27
- </button>
28
- <img
29
- class="qiu-image__preview"
30
- :src="currentPreviewSrc"
31
- :alt="alt"
32
- @click.stop
33
- />
34
- </div>
35
- </Transition>
36
- </Teleport>
37
- </div>
38
- </template>
39
-
40
- <script lang="ts" setup>
41
- defineOptions({ name: 'QiuImage' })
42
-
43
- const props = withDefaults(
44
- defineProps<{
45
- src?: string
46
- fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down'
47
- alt?: string
48
- lazy?: boolean
49
- previewSrcList?: string[]
50
- hideOnClickModal?: boolean
51
- }>(),
52
- {
53
- src: '',
54
- fit: 'fill',
55
- alt: '',
56
- lazy: false,
57
- previewSrcList: () => [],
58
- hideOnClickModal: true,
59
- }
60
- )
61
-
62
- const previewVisible = ref(false)
63
-
64
- const previewable = computed(() => props.previewSrcList.length > 0 || !!props.src)
65
-
66
- const currentPreviewSrc = computed(() => {
67
- if (props.previewSrcList.length > 0) return props.previewSrcList[0]
68
- return props.src
69
- })
70
-
71
- const onPreview = () => {
72
- if (!previewable.value) return
73
- previewVisible.value = true
74
- }
75
-
76
- const closePreview = () => {
77
- if (!props.hideOnClickModal) return
78
- previewVisible.value = false
79
- }
80
-
81
- const onKeydown = (e: KeyboardEvent) => {
82
- if (e.key === 'Escape' && previewVisible.value) {
83
- previewVisible.value = false
84
- }
85
- }
86
-
87
- onMounted(() => window.addEventListener('keydown', onKeydown))
88
- onUnmounted(() => window.removeEventListener('keydown', onKeydown))
89
- </script>
90
-
91
- <style lang="scss" scoped>
92
- .qiu-image {
93
- position: relative;
94
- display: inline-block;
95
- overflow: hidden;
96
- line-height: 0;
97
- background: var(--qiu-fill-color-light, var(--qiu-fill-color-light, #f5f7fa));
98
- border-radius: var(--qiu-border-radius, var(--qiu-border-radius-base, 4px));
99
-
100
- &.is-preview {
101
- cursor: zoom-in;
102
- }
103
- }
104
-
105
- .qiu-image__inner {
106
- display: block;
107
- width: 100%;
108
- height: 100%;
109
- }
110
-
111
- .qiu-image__mask {
112
- position: absolute;
113
- inset: 0;
114
- display: flex;
115
- align-items: center;
116
- justify-content: center;
117
- font-size: 24px;
118
- color: #fff;
119
- background: rgb(0 0 0 / 35%);
120
- opacity: 0;
121
- transition: opacity 0.2s ease;
122
-
123
- .qiu-image:hover & {
124
- opacity: 1;
125
- }
126
- }
127
-
128
- .qiu-image__viewer {
129
- position: fixed;
130
- inset: 0;
131
- z-index: 3000;
132
- display: flex;
133
- align-items: center;
134
- justify-content: center;
135
- background: rgb(0 0 0 / 75%);
136
- }
137
-
138
- .qiu-image__preview {
139
- max-width: 90vw;
140
- max-height: 90vh;
141
- object-fit: contain;
142
- border-radius: 4px;
143
- box-shadow: 0 8px 32px rgb(0 0 0 / 40%);
144
- }
145
-
146
- .qiu-image__close {
147
- position: absolute;
148
- top: 24px;
149
- right: 24px;
150
- display: inline-flex;
151
- align-items: center;
152
- justify-content: center;
153
- width: 40px;
154
- height: 40px;
155
- font-size: 20px;
156
- color: #fff;
157
- cursor: pointer;
158
- background: rgb(255 255 255 / 15%);
159
- border: 0;
160
- border-radius: 50%;
161
- transition: background 0.2s ease;
162
-
163
- &:hover {
164
- background: rgb(255 255 255 / 25%);
165
- }
166
- }
167
-
168
- .qiu-image-fade-enter-active,
169
- .qiu-image-fade-leave-active {
170
- transition: opacity 0.25s ease;
171
- }
172
-
173
- .qiu-image-fade-enter-from,
174
- .qiu-image-fade-leave-to {
175
- opacity: 0;
176
- }
177
- </style>