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,48 +0,0 @@
1
- /** 级联选项(字段名可由 props 配置) */
2
- export type QiuCascaderOption = Record<string, any>
3
-
4
- export interface QiuCascaderPropsConfig {
5
- /** 选项值字段,默认 value */
6
- value?: string
7
- /** 选项文案字段,默认 label */
8
- label?: string
9
- /** 子级字段,默认 children */
10
- children?: string
11
- /** 禁用字段,默认 disabled */
12
- disabled?: string
13
- /** 是否多选 */
14
- multiple?: boolean
15
- /** 是否允许选择任意一级(非仅叶子) */
16
- checkStrictly?: boolean
17
- /** 是否返回完整路径;false 时只返回末级 value */
18
- emitPath?: boolean
19
- /** 展开方式 */
20
- expandTrigger?: 'click' | 'hover'
21
- }
22
-
23
- export type QiuCascaderValue =
24
- | string
25
- | number
26
- | Array<string | number>
27
- | Array<Array<string | number>>
28
- | null
29
-
30
- export function getOptValue(opt: QiuCascaderOption, cfg: QiuCascaderPropsConfig) {
31
- return opt[cfg.value ?? 'value'] as string | number
32
- }
33
-
34
- export function getOptLabel(opt: QiuCascaderOption, cfg: QiuCascaderPropsConfig) {
35
- return String(opt[cfg.label ?? 'label'] ?? '')
36
- }
37
-
38
- export function getOptChildren(
39
- opt: QiuCascaderOption,
40
- cfg: QiuCascaderPropsConfig
41
- ): QiuCascaderOption[] | undefined {
42
- const children = opt[cfg.children ?? 'children']
43
- return Array.isArray(children) ? (children as QiuCascaderOption[]) : undefined
44
- }
45
-
46
- export function isOptDisabled(opt: QiuCascaderOption, cfg: QiuCascaderPropsConfig) {
47
- return Boolean(opt[cfg.disabled ?? 'disabled'])
48
- }
@@ -1,78 +0,0 @@
1
- <template>
2
- <div
3
- class="qiu-checkbox-group"
4
- :class="[
5
- { 'is-disabled': disabled },
6
- `qiu-checkbox-group--${type}`,
7
- ]"
8
- role="group"
9
- >
10
- <slot />
11
- </div>
12
- </template>
13
-
14
- <script lang="ts" setup>
15
- import type { QiuCheckboxGroupContext } from './types'
16
-
17
- defineOptions({ name: 'QiuCheckboxGroup' })
18
-
19
- const props = withDefaults(
20
- defineProps<{
21
- modelValue?: (string | number)[]
22
- disabled?: boolean
23
- /** default | button */
24
- type?: 'default' | 'button'
25
- }>(),
26
- {
27
- modelValue: () => [],
28
- disabled: false,
29
- type: 'default',
30
- }
31
- )
32
-
33
- const emit = defineEmits<{
34
- 'update:modelValue': [(string | number)[]]
35
- change: [(string | number)[]]
36
- }>()
37
-
38
- const modelValueRef = computed(() => props.modelValue)
39
- const disabledRef = computed(() => props.disabled)
40
-
41
- const toggleOption = (label: string | number, checked: boolean) => {
42
- const next = [...props.modelValue]
43
- const idx = next.indexOf(label)
44
- if (checked && idx < 0) next.push(label)
45
- else if (!checked && idx >= 0) next.splice(idx, 1)
46
- emit('update:modelValue', next)
47
- emit('change', next)
48
- }
49
-
50
- provide<QiuCheckboxGroupContext>('qiuCheckboxGroup', {
51
- modelValue: modelValueRef as Ref<(string | number)[]>,
52
- disabled: disabledRef as Ref<boolean>,
53
- type: computed(() => props.type),
54
- toggleOption,
55
- })
56
- </script>
57
-
58
- <style lang="scss" scoped>
59
- .qiu-checkbox-group {
60
- display: inline-flex;
61
- flex-wrap: wrap;
62
- align-items: center;
63
-
64
- &.is-disabled {
65
- cursor: not-allowed;
66
- opacity: 0.6;
67
- }
68
-
69
- &--button {
70
- flex-wrap: nowrap;
71
- gap: 0;
72
-
73
- :deep(.qiu-checkbox) {
74
- margin-right: 0;
75
- }
76
- }
77
- }
78
- </style>
@@ -1,231 +0,0 @@
1
- <template>
2
- <label
3
- class="qiu-checkbox"
4
- :class="{
5
- 'is-checked': isChecked,
6
- 'is-disabled': isDisabled,
7
- 'is-indeterminate': indeterminate,
8
- 'is-button': isButton,
9
- 'is-border': border,
10
- }"
11
- >
12
- <span class="qiu-checkbox__input">
13
- <input
14
- type="checkbox"
15
- class="qiu-checkbox__original"
16
- :checked="isChecked"
17
- :disabled="isDisabled"
18
- :value="label"
19
- @change="onChange"
20
- />
21
- <span class="qiu-checkbox__inner" />
22
- </span>
23
- <span v-if="showLabel" class="qiu-checkbox__label">
24
- <slot>{{ label }}</slot>
25
- </span>
26
- </label>
27
- </template>
28
-
29
- <script lang="ts" setup>
30
- import type { QiuCheckboxGroupContext } from './types'
31
-
32
- defineOptions({ name: 'QiuCheckbox' })
33
-
34
- const props = withDefaults(
35
- defineProps<{
36
- modelValue?: boolean | string | number
37
- /** 选项值(用于 CheckboxGroup);勿用 boolean,否则 Vue 会把未传当成 false 并显示成文字 */
38
- label?: string | number
39
- disabled?: boolean
40
- indeterminate?: boolean
41
- trueLabel?: string | number
42
- falseLabel?: string | number
43
- border?: boolean
44
- }>(),
45
- {
46
- modelValue: false,
47
- disabled: false,
48
- indeterminate: false,
49
- border: false,
50
- }
51
- )
52
-
53
- const emit = defineEmits<{
54
- 'update:modelValue': [boolean | string | number]
55
- change: [boolean | string | number]
56
- }>()
57
-
58
- const slots = useSlots()
59
- const groupCtx = inject<QiuCheckboxGroupContext | null>('qiuCheckboxGroup', null)
60
-
61
- const isDisabled = computed(() => props.disabled || groupCtx?.disabled.value)
62
- const isButton = computed(() => groupCtx?.type?.value === 'button')
63
-
64
- /** 仅在有真实文案时展示 label,避免出现 "false" */
65
- const showLabel = computed(() => {
66
- if (slots.default) return true
67
- if (props.label === undefined || props.label === null) return false
68
- return String(props.label).length > 0
69
- })
70
-
71
- const isChecked = computed(() => {
72
- if (groupCtx) {
73
- return groupCtx.modelValue.value.includes(props.label as string | number)
74
- }
75
- if (props.trueLabel !== undefined || props.falseLabel !== undefined) {
76
- return props.modelValue === props.trueLabel
77
- }
78
- return !!props.modelValue
79
- })
80
-
81
- const onChange = (e: Event) => {
82
- if (isDisabled.value) return
83
- const checked = (e.target as HTMLInputElement).checked
84
-
85
- if (groupCtx && props.label !== undefined) {
86
- groupCtx.toggleOption(props.label as string | number, checked)
87
- return
88
- }
89
-
90
- let val: boolean | string | number = checked
91
- if (props.trueLabel !== undefined || props.falseLabel !== undefined) {
92
- val = checked ? (props.trueLabel ?? true) : (props.falseLabel ?? false)
93
- }
94
- emit('update:modelValue', val)
95
- emit('change', val)
96
- }
97
- </script>
98
-
99
- <style lang="scss" scoped>
100
- .qiu-checkbox {
101
- display: inline-flex;
102
- gap: 8px;
103
- align-items: center;
104
- height: 32px;
105
- margin-right: 16px;
106
- font-size: 14px;
107
- color: var(--qiu-text-color-regular, var(--qiu-text-color-regular, #606266));
108
- white-space: nowrap;
109
- cursor: pointer;
110
- user-select: none;
111
-
112
- &.is-disabled {
113
- cursor: not-allowed;
114
- opacity: 0.6;
115
- }
116
- }
117
-
118
- .qiu-checkbox__input {
119
- position: relative;
120
- display: inline-flex;
121
- align-items: center;
122
- white-space: nowrap;
123
- }
124
-
125
- .qiu-checkbox__original {
126
- position: absolute;
127
- z-index: -1;
128
- width: 0;
129
- height: 0;
130
- margin: 0;
131
- opacity: 0;
132
- }
133
-
134
- .qiu-checkbox__inner {
135
- position: relative;
136
- box-sizing: border-box;
137
- display: inline-block;
138
- width: 14px;
139
- height: 14px;
140
- background: var(--qiu-bg-color, var(--qiu-bg-color, #fff));
141
- border: 1px solid var(--qiu-border-color, var(--qiu-border-color, #dcdfe6));
142
- border-radius: 2px;
143
- transition: border-color 0.2s ease, background 0.2s ease;
144
-
145
- &::after {
146
- position: absolute;
147
- top: 1px;
148
- left: 4px;
149
- box-sizing: content-box;
150
- width: 3px;
151
- height: 7px;
152
- content: '';
153
- border: 2px solid #fff;
154
- border-top: 0;
155
- border-left: 0;
156
- opacity: 0;
157
- transform: rotate(45deg) scaleY(0);
158
- transition: transform 0.15s ease-in 0.05s, opacity 0.15s ease;
159
- transform-origin: center;
160
- }
161
-
162
- .is-checked & {
163
- background: var(--qiu-color-primary, var(--qiu-color-primary));
164
- border-color: var(--qiu-color-primary, var(--qiu-color-primary));
165
-
166
- &::after {
167
- opacity: 1;
168
- transform: rotate(45deg) scaleY(1);
169
- }
170
- }
171
-
172
- .is-indeterminate & {
173
- background: var(--qiu-color-primary, var(--qiu-color-primary));
174
- border-color: var(--qiu-color-primary, var(--qiu-color-primary));
175
-
176
- &::after {
177
- top: 5px;
178
- left: 2px;
179
- width: 8px;
180
- height: 0;
181
- border: 0;
182
- opacity: 1;
183
- transform: none;
184
- background: #fff;
185
- }
186
- }
187
- }
188
-
189
- .qiu-checkbox__label {
190
- line-height: 1;
191
- }
192
-
193
- .qiu-checkbox.is-border {
194
- padding: 0 12px;
195
- height: 32px;
196
- border: 1px solid var(--qiu-border-color, #dcdfe6);
197
- border-radius: 4px;
198
-
199
- &.is-checked {
200
- border-color: var(--qiu-color-primary, var(--qiu-color-primary));
201
- }
202
- }
203
-
204
- .qiu-checkbox.is-button {
205
- height: 32px;
206
- padding: 0 16px;
207
- margin: 0;
208
- background: var(--qiu-fill-color-blank, #fff);
209
- border: 1px solid var(--qiu-border-color, #dcdfe6);
210
- border-left-width: 0;
211
-
212
- &:first-child {
213
- border-left-width: 1px;
214
- border-radius: 4px 0 0 4px;
215
- }
216
-
217
- &:last-child {
218
- border-radius: 0 4px 4px 0;
219
- }
220
-
221
- .qiu-checkbox__input {
222
- display: none;
223
- }
224
-
225
- &.is-checked {
226
- color: #fff;
227
- background: var(--qiu-color-primary, var(--qiu-color-primary));
228
- border-color: var(--qiu-color-primary, var(--qiu-color-primary));
229
- }
230
- }
231
- </style>
@@ -1,8 +0,0 @@
1
- import type { ComputedRef, Ref } from 'vue'
2
-
3
- export interface QiuCheckboxGroupContext {
4
- modelValue: Ref<(string | number)[]>
5
- disabled: Ref<boolean>
6
- type?: ComputedRef<'default' | 'button'>
7
- toggleOption: (label: string | number, checked: boolean) => void
8
- }
@@ -1,64 +0,0 @@
1
- <template>
2
- <pre class="qiu-code" :class="[`qiu-code--${theme}`, { 'is-wrap': wrap }]"><code>{{ displayCode }}</code></pre>
3
- </template>
4
-
5
- <script lang="ts" setup>
6
- import { computed } from 'vue'
7
-
8
- defineOptions({ name: 'QiuCode' })
9
-
10
- const props = withDefaults(
11
- defineProps<{
12
- code?: string
13
- /** 语言标识,仅做展示用途 */
14
- language?: string
15
- /** 是否自动换行 */
16
- wrap?: boolean
17
- theme?: 'light' | 'dark'
18
- }>(),
19
- {
20
- code: '',
21
- language: 'text',
22
- wrap: false,
23
- theme: 'light',
24
- }
25
- )
26
-
27
- const displayCode = computed(() => String(props.code ?? '').replace(/\n$/, ''))
28
- </script>
29
-
30
- <style lang="scss" scoped>
31
- .qiu-code {
32
- margin: 0;
33
- padding: 12px 14px;
34
- overflow: auto;
35
- font-family: var(--qiu-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
36
- font-size: 13px;
37
- line-height: 1.6;
38
- white-space: pre;
39
- border-radius: var(--qiu-border-radius-base, 4px);
40
- box-sizing: border-box;
41
-
42
- &.is-wrap {
43
- white-space: pre-wrap;
44
- word-break: break-all;
45
- }
46
-
47
- code {
48
- font-family: inherit;
49
- white-space: inherit;
50
- }
51
- }
52
-
53
- .qiu-code--light {
54
- color: var(--qiu-text-color-primary, #303133);
55
- background: var(--qiu-fill-color-light, #f5f7fa);
56
- border: 1px solid var(--qiu-border-color-lighter, #ebeef5);
57
- }
58
-
59
- .qiu-code--dark {
60
- color: #d4d4d4;
61
- background: #1e1e1e;
62
- border: 1px solid #2d2d2d;
63
- }
64
- </style>
@@ -1,55 +0,0 @@
1
- .qiu-col {
2
- box-sizing: border-box;
3
- min-height: 1px;
4
- }
5
-
6
- @for $i from 0 through 24 {
7
- .qiu-col-#{$i} {
8
- @if $i == 0 {
9
- display: none;
10
- } @else {
11
- flex: 0 0 #{calc($i / 24 * 100%)};
12
- max-width: #{calc($i / 24 * 100%)};
13
- }
14
- }
15
-
16
- .qiu-col-offset-#{$i} {
17
- margin-left: #{calc($i / 24 * 100%)};
18
- }
19
-
20
- .qiu-col-push-#{$i} {
21
- position: relative;
22
- left: #{calc($i / 24 * 100%)};
23
- }
24
-
25
- .qiu-col-pull-#{$i} {
26
- position: relative;
27
- right: #{calc($i / 24 * 100%)};
28
- }
29
- }
30
-
31
- @mixin respond-col($name, $min) {
32
- @media (min-width: $min) {
33
- @for $i from 0 through 24 {
34
- .qiu-col-#{$name}-#{$i} {
35
- @if $i == 0 {
36
- display: none;
37
- } @else {
38
- display: block;
39
- flex: 0 0 #{calc($i / 24 * 100%)};
40
- max-width: #{calc($i / 24 * 100%)};
41
- }
42
- }
43
-
44
- .qiu-col-#{$name}-offset-#{$i} {
45
- margin-left: #{calc($i / 24 * 100%)};
46
- }
47
- }
48
- }
49
- }
50
-
51
- @include respond-col(xs, 0);
52
- @include respond-col(sm, 768px);
53
- @include respond-col(md, 992px);
54
- @include respond-col(lg, 1200px);
55
- @include respond-col(xl, 1920px);
@@ -1,64 +0,0 @@
1
- <template>
2
- <div class="qiu-col" :class="colClass" :style="colStyle">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import { QIU_ROW_KEY, type QiuRowContext } from '../QiuRow/types'
9
-
10
- defineOptions({ name: 'QiuCol' })
11
-
12
- const props = withDefaults(
13
- defineProps<{
14
- span?: number
15
- offset?: number
16
- push?: number
17
- pull?: number
18
- xs?: number | { span?: number; offset?: number }
19
- sm?: number | { span?: number; offset?: number }
20
- md?: number | { span?: number; offset?: number }
21
- lg?: number | { span?: number; offset?: number }
22
- xl?: number | { span?: number; offset?: number }
23
- }>(),
24
- {
25
- span: 24,
26
- offset: 0,
27
- push: 0,
28
- pull: 0,
29
- }
30
- )
31
-
32
- const row = inject<QiuRowContext | null>(QIU_ROW_KEY, null)
33
-
34
- const normalize = (v?: number | { span?: number; offset?: number }) => {
35
- if (v == null) return null
36
- if (typeof v === 'number') return { span: v, offset: 0 }
37
- return { span: v.span ?? 24, offset: v.offset ?? 0 }
38
- }
39
-
40
- const colClass = computed(() => {
41
- const list = [`qiu-col-${props.span}`]
42
- if (props.offset) list.push(`qiu-col-offset-${props.offset}`)
43
- if (props.push) list.push(`qiu-col-push-${props.push}`)
44
- if (props.pull) list.push(`qiu-col-pull-${props.pull}`)
45
- ;(['xs', 'sm', 'md', 'lg', 'xl'] as const).forEach((bp) => {
46
- const conf = normalize(props[bp])
47
- if (!conf) return
48
- list.push(`qiu-col-${bp}-${conf.span}`)
49
- if (conf.offset) list.push(`qiu-col-${bp}-offset-${conf.offset}`)
50
- })
51
- return list
52
- })
53
-
54
- const colStyle = computed(() => {
55
- const g = row?.gutter.value || 0
56
- if (!g) return undefined
57
- return {
58
- paddingLeft: `${g / 2}px`,
59
- paddingRight: `${g / 2}px`,
60
- }
61
- })
62
- </script>
63
-
64
- <style lang="scss" src="./col.scss"></style>
@@ -1,10 +0,0 @@
1
- import type { InjectionKey, Ref } from 'vue'
2
-
3
- export interface QiuCollapseContext {
4
- activeNames: Ref<(string | number)[]>
5
- accordion: Ref<boolean>
6
- toggleItem: (name: string | number) => void
7
- isActive: (name: string | number) => boolean
8
- }
9
-
10
- export const QIU_COLLAPSE_KEY: InjectionKey<QiuCollapseContext> = Symbol('QiuCollapse')
@@ -1,70 +0,0 @@
1
- <template>
2
- <div class="qiu-collapse" role="presentation">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import type { QiuCollapseContext } from './context'
9
- import { QIU_COLLAPSE_KEY } from './context'
10
-
11
- defineOptions({ name: 'QiuCollapse' })
12
-
13
- const props = withDefaults(
14
- defineProps<{
15
- modelValue?: string | number | (string | number)[]
16
- accordion?: boolean
17
- }>(),
18
- {
19
- accordion: false,
20
- }
21
- )
22
-
23
- const emit = defineEmits<{
24
- 'update:modelValue': [string | number | (string | number)[]]
25
- change: [string | number | (string | number)[]]
26
- }>()
27
-
28
- const normalize = (val: typeof props.modelValue): (string | number)[] => {
29
- if (val === undefined || val === null) return []
30
- return Array.isArray(val) ? [...val] : [val]
31
- }
32
-
33
- const activeNames = computed({
34
- get() {
35
- return normalize(props.modelValue)
36
- },
37
- set(val: (string | number)[]) {
38
- const out = props.accordion ? val[0] ?? '' : val
39
- emit('update:modelValue', out)
40
- emit('change', out)
41
- },
42
- })
43
-
44
- const isActive = (name: string | number) => activeNames.value.includes(name)
45
-
46
- const toggleItem = (name: string | number) => {
47
- if (props.accordion) {
48
- activeNames.value = isActive(name) ? [] : [name]
49
- return
50
- }
51
- const set = new Set(activeNames.value)
52
- if (set.has(name)) set.delete(name)
53
- else set.add(name)
54
- activeNames.value = [...set]
55
- }
56
-
57
- provide<QiuCollapseContext>(QIU_COLLAPSE_KEY, {
58
- activeNames: activeNames as Ref<(string | number)[]>,
59
- accordion: toRef(props, 'accordion'),
60
- toggleItem,
61
- isActive,
62
- })
63
- </script>
64
-
65
- <style lang="scss" scoped>
66
- .qiu-collapse {
67
- border-top: 1px solid var(--qiu-border-color-light, var(--qiu-border-color-light, #e4e7ed));
68
- border-bottom: 1px solid var(--qiu-border-color-light, var(--qiu-border-color-light, #e4e7ed));
69
- }
70
- </style>