fit2cloud-ui-plus 0.0.1-beta.3 → 0.0.1-beta.7

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 (86) hide show
  1. package/lib/fit2cloud-ui-plus.es.js +119 -114
  2. package/lib/fit2cloud-ui-plus.umd.js +1 -1
  3. package/package.json +6 -10
  4. package/src/components/filter-bar/FuFilter.vue +1 -1
  5. package/src/components/read-write-switch/FuInputRwSwitch.vue +9 -5
  6. package/src/components/read-write-switch/FuReadWriteSwitch.vue +38 -36
  7. package/src/components/read-write-switch/FuSelectRwSwitch.vue +11 -7
  8. package/src/components/read-write-switch/types.ts +4 -0
  9. package/src/components/split-pane/FuSplitPane.vue +1 -1
  10. package/src/components/table/FuTableBody.ts +32 -26
  11. package/src/components/table/table-column-dropdown/FuTableColumnDropdown.vue +5 -2
  12. package/src/components/table/table-column-select/FuTableColumnSelectDialog.vue +12 -11
  13. package/src/components/table/table-column-select/FuTableColumnSelectPopover.vue +9 -9
  14. package/src/components/table/table-column-select/utils.ts +10 -7
  15. package/src/components/table/table-operations/FuTableMoreButton.vue +4 -2
  16. package/src/components/table/table-operations/FuTableOperations.vue +5 -5
  17. package/src/components/tabs/FuTabs.vue +4 -2
  18. package/src/styles/common/variables.scss +0 -6
  19. package/src/styles/components/tabs.scss +1 -1
  20. package/src/tools/types.ts +9 -0
  21. package/src/tools/utils.ts +36 -36
  22. package/.editorconfig +0 -14
  23. package/BETA.MD +0 -6
  24. package/env.d.ts +0 -13
  25. package/examples/App.vue +0 -65
  26. package/examples/assets/github.png +0 -0
  27. package/examples/assets/hidden-code.png +0 -0
  28. package/examples/assets/iconfont/demo.css +0 -539
  29. package/examples/assets/iconfont/demo_index.html +0 -257
  30. package/examples/assets/iconfont/iconfont.css +0 -27
  31. package/examples/assets/iconfont/iconfont.js +0 -1
  32. package/examples/assets/iconfont/iconfont.json +0 -30
  33. package/examples/assets/iconfont/iconfont.ttf +0 -0
  34. package/examples/assets/iconfont/iconfont.woff +0 -0
  35. package/examples/assets/iconfont/iconfont.woff2 +0 -0
  36. package/examples/assets/logo.png +0 -0
  37. package/examples/components/CodeExample.vue +0 -209
  38. package/examples/components/DocumentTable.vue +0 -98
  39. package/examples/components/Markdown.vue +0 -30
  40. package/examples/layout/components/AppHeader.vue +0 -35
  41. package/examples/layout/components/Sidebar.vue +0 -73
  42. package/examples/layout/index.vue +0 -55
  43. package/examples/layout/layout.scss +0 -75
  44. package/examples/main.ts +0 -25
  45. package/examples/markdown/getting-started.md +0 -38
  46. package/examples/pages/filter-bar/demo/BaseFilterBar.vue +0 -70
  47. package/examples/pages/filter-bar/demo/SetConditionsDemo.vue +0 -66
  48. package/examples/pages/filter-bar/demo/SlotDemo.vue +0 -77
  49. package/examples/pages/filter-bar/index.vue +0 -56
  50. package/examples/pages/index.ts +0 -11
  51. package/examples/pages/read-write-switch/demo/BaseDemo.vue +0 -30
  52. package/examples/pages/read-write-switch/demo/CustomContentDemo.vue +0 -28
  53. package/examples/pages/read-write-switch/demo/InputRwSwitchDemo.vue +0 -16
  54. package/examples/pages/read-write-switch/demo/ReadSwitchDemo.vue +0 -54
  55. package/examples/pages/read-write-switch/demo/SelectRwSwitchDemo.vue +0 -23
  56. package/examples/pages/read-write-switch/demo/TableInnerEditDemo.vue +0 -73
  57. package/examples/pages/read-write-switch/demo/WriteSwitchDemo.vue +0 -39
  58. package/examples/pages/read-write-switch/index.vue +0 -81
  59. package/examples/pages/speed-dial/demo/BaseSpeedDial.vue +0 -51
  60. package/examples/pages/speed-dial/demo/SpeedDialCustom.vue +0 -109
  61. package/examples/pages/speed-dial/demo/SpeedDialPosition.vue +0 -66
  62. package/examples/pages/speed-dial/demo/SpeedDialTrigger.vue +0 -64
  63. package/examples/pages/speed-dial/index.vue +0 -61
  64. package/examples/pages/split-pane/demo/BaseSplit.vue +0 -36
  65. package/examples/pages/split-pane/demo/CustomResizer.vue +0 -47
  66. package/examples/pages/split-pane/demo/NestSplit.vue +0 -34
  67. package/examples/pages/split-pane/demo/ResizerType.vue +0 -60
  68. package/examples/pages/split-pane/index.vue +0 -61
  69. package/examples/pages/table/demo/BaseTable.vue +0 -35
  70. package/examples/pages/table/demo/DropdownColumn.vue +0 -89
  71. package/examples/pages/table/demo/DropdownColumnSlot.vue +0 -92
  72. package/examples/pages/table/demo/SaveSelectColumn.vue +0 -41
  73. package/examples/pages/table/demo/SelectColumn.vue +0 -47
  74. package/examples/pages/table/demo/TableOperations.vue +0 -95
  75. package/examples/pages/table/demo/TablePagination.vue +0 -100
  76. package/examples/pages/table/index.vue +0 -89
  77. package/examples/pages/tabs/demo/AddCloseTab.vue +0 -73
  78. package/examples/pages/tabs/index.vue +0 -42
  79. package/examples/router/doc-routes.ts +0 -52
  80. package/examples/router/index.ts +0 -56
  81. package/index.html +0 -13
  82. package/plugins/example-transform.ts +0 -30
  83. package/public/favicon.bmp +0 -0
  84. package/tsconfig.json +0 -24
  85. package/tsconfig.node.json +0 -9
  86. package/vite.config.ts +0 -56
@@ -17,23 +17,27 @@
17
17
  </template>
18
18
 
19
19
  <script setup lang="ts">
20
- import { ref, watch } from "vue";
20
+ import { ref, watch, PropType } from "vue";
21
+ import { OptionProps } from "./types";
21
22
  defineOptions({ name: "FuSelectRwSwitch" });
22
23
  const props = defineProps({
23
- value: [String, Number],
24
- options: Array,
24
+ modelValue: [String, Number],
25
+ options: {
26
+ type: Array as PropType<OptionProps[]>,
27
+ default: []
28
+ },
25
29
  writeTrigger: {
26
30
  type: String,
27
- default: "click",
31
+ default: "onClick",
28
32
  validator: (value: string) => {
29
- return ['click', 'dblclick'].includes(value)
33
+ return ['onClick', 'onDblclick'].includes(value)
30
34
  }
31
35
  }
32
36
  })
33
37
  const emit = defineEmits(["input", "blur", "change"])
34
- const data = ref(props.value)
38
+ const data = ref(props.modelValue)
35
39
 
36
- watch(() => props.value, (v) => {
40
+ watch(() => props.modelValue, (v) => {
37
41
  data.value = v
38
42
  })
39
43
  function input(e: Event) {
@@ -0,0 +1,4 @@
1
+ export interface OptionProps {
2
+ label: string
3
+ value: string | number
4
+ }
@@ -8,7 +8,7 @@
8
8
  @mouseover="hover = true" @mouseleave="hover = false">
9
9
  <div class="icon" v-if="resizerType === 'resizer'">
10
10
  <slot name="resizer">
11
- <i class="el-icon-more"></i>
11
+ <el-icon :size="10"><MoreFilled /></el-icon>
12
12
  </slot>
13
13
  </div>
14
14
  </div>
@@ -1,40 +1,46 @@
1
- import { h } from 'vue'
1
+ import { h } from "vue";
2
2
 
3
3
  const isFix = (node: any) => {
4
- const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0
5
- const { fix } = node.props
6
- let { type } = node.props
7
- return (fix !== undefined && fix !== false) || ["selection", "index", "expand"].includes(type) || includeTag
8
- }
4
+ const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
5
+ const { fix } = node.props;
6
+ let { type } = node.props;
7
+ return (
8
+ (fix !== undefined && fix !== false) ||
9
+ ["selection", "index", "expand"].includes(type) ||
10
+ includeTag
11
+ );
12
+ };
9
13
 
10
14
  const getLabel = (node: any) => {
11
- if (node.props.label) return node.props.label
12
- const prefix = "FU-T-"
13
- const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0
14
- let { label, type } = node.props
15
- if (includeTag) label = prefix + "dropdown"
16
- label ??= node.props.label
17
- label ??= prefix + type
15
+ if (node.props.label) return node.props.label;
16
+ const prefix = "FU-T-";
17
+ const includeTag = node.type.name.indexOf("FuTableColumnDropdown") >= 0;
18
+ let { label, type } = node.props;
19
+ if (includeTag) label = prefix + "dropdown";
20
+ label ??= node.props.label;
21
+ label ??= prefix + type;
18
22
  return label;
19
- }
23
+ };
24
+
20
25
  const FuTableBody = (props: any, context: any) => {
21
- const slots = context.slots.default()
26
+ let slots = context.slots.default();
22
27
  const nodes: any = [];
23
- let { columns } = props
24
- const children = slots[0].children.filter((c: any) => c.type.name !== undefined)
25
- if (!children) return nodes
26
- if (!columns || columns?.length === 0) return children
28
+ let { columns } = props;
29
+ if (typeof slots[0].children[0].type === "symbol") {
30
+ slots = slots[0].children;
31
+ }
32
+ const children = slots[0].children.filter((c: any) => c.type.name !== undefined);
33
+ if (!children) return nodes;
34
+ if (!columns || columns?.length === 0) return children;
27
35
  columns.forEach((col: any) => {
28
36
  let node = children.find((child: any) => {
29
- return col.label === getLabel(child)
30
- })
37
+ return col.label === getLabel(child);
38
+ });
31
39
  if (node && (isFix(node) || col.show !== false)) {
32
40
  nodes.push(node);
33
41
  }
34
- })
35
- return nodes
36
- }
42
+ });
43
+ return nodes;
44
+ };
37
45
 
38
46
  export default FuTableBody;
39
-
40
-
@@ -33,6 +33,9 @@
33
33
  </template>
34
34
  <script lang="ts" setup>
35
35
  import { computed, getCurrentInstance } from "vue";
36
+ import { PropType } from "vue";
37
+ import { DropdownProps } from "@/tools/types";
38
+
36
39
  defineOptions({ name: "FuTableColumnDropdown" });
37
40
  const props = defineProps({
38
41
  showType: {
@@ -41,7 +44,7 @@ const props = defineProps({
41
44
  validator: (value: string) => ["always", "hover", "selected"].includes(value),
42
45
  },
43
46
  menus: {
44
- type: Array,
47
+ type: Array as PropType<DropdownProps[]>,
45
48
  default: () => [],
46
49
  },
47
50
  title: String,
@@ -56,7 +59,7 @@ const props = defineProps({
56
59
 
57
60
  });
58
61
 
59
- const instance = getCurrentInstance()
62
+ const instance = getCurrentInstance() as any
60
63
 
61
64
 
62
65
  const isShow = computed(() => {
@@ -1,18 +1,19 @@
1
1
  <template>
2
2
  <div style="display: inline-block">
3
3
  <!-- :size="configSize" -->
4
- <el-button class="fu-search-bar-button" :icon="icon" @click="visible = true">{{t('fu.table.custom_table_rows')}}</el-button>
4
+ <el-button class="fu-search-bar-button" :icon="icon" @click="visible = true">{{ t('fu.table.custom_table_rows') }}
5
+ </el-button>
5
6
  <el-dialog custom-class="fu-table-column-select-dialog" v-model="visible" @open="open" append-to-body>
6
- <template #title>
7
+ <template #header>
7
8
  <h3>
8
9
  {{ t('fu.table.custom_table_fields') }}
9
10
  </h3>
10
- <el-alert :title="t('fu.table.custom_table_fields_desc')" type="info" :closable="false"/>
11
+ <el-alert :title="t('fu.table.custom_table_fields_desc')" type="info" :closable="false" />
11
12
  </template>
12
13
 
13
14
  <el-checkbox v-for="(c, i) in cloneColumns" :key="i" v-model="c.show" :checked="c.show !== false" draggable="true"
14
- @dragstart="dragstart($event, i)" @dragenter="dragenter" @dragleave="dragleave"
15
- @dragover.prevent @dragend="dragend" @drop="drop($event, cloneColumns, i)" v-show="!c.fix">
15
+ @dragstart="dragstart($event, i)" @dragenter="dragenter" @dragleave="dragleave" @dragover.prevent
16
+ @dragend="dragend" @drop="drop($event, cloneColumns, i)" v-show="!c.fix">
16
17
  {{ c.label }}
17
18
  </el-checkbox>
18
19
 
@@ -30,9 +31,9 @@
30
31
  </template>
31
32
 
32
33
  <script setup lang="ts">
33
- import {ref, inject} from "vue";
34
- import {tableColumnSelect} from "./utils"
35
- import {useLocale} from "@/hooks"
34
+ import { ref, inject } from "vue";
35
+ import { tableColumnSelect } from "./utils"
36
+ import { useLocale } from "@/hooks"
36
37
 
37
38
  const props = defineProps({
38
39
  icon: {
@@ -53,7 +54,7 @@ const props = defineProps({
53
54
 
54
55
  const localKey = inject("localKey")
55
56
 
56
- const {t} = useLocale()
57
+ const { t } = useLocale()
57
58
 
58
59
  const cloneColumn = (source: any, target: any) => {
59
60
  source.forEach((col: any) => {
@@ -72,7 +73,7 @@ const {
72
73
  drop
73
74
  } = tableColumnSelect(localKey)
74
75
 
75
- const cloneColumns = ref([])
76
+ const cloneColumns = ref([]) as any
76
77
  const visible = ref(false)
77
78
 
78
79
  function open() {
@@ -82,7 +83,7 @@ function open() {
82
83
 
83
84
  function ok() {
84
85
  props.columns.splice(0, props.columns.length)
85
- cloneColumns.value.forEach(c => {
86
+ cloneColumns.value.forEach((c: any) => {
86
87
  props.columns.push(c)
87
88
  })
88
89
  visible.value = false
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <el-popover class="fu-table-column-select" popper-class="fu-table-column-select-popper" :trigger="trigger"
3
- :show-arrow="false" v-show="hasSelect">
3
+ :show-arrow="false" v-show="hasSelect">
4
4
  <h3>
5
5
  {{ t('fu.table.custom_table_fields') }}
6
6
  </h3>
7
7
  <div class="fu-table-column-select-popper__body">
8
8
  <div v-for="(c, i) in columns" :key="i" class="fu-table-column-select-popper__item">
9
9
  <el-checkbox v-model="c.show" :checked="c.show !== false" draggable="true" @dragstart="dragstart($event, i)"
10
- @dragenter="dragenter" @dragleave="dragleave" @dragover.prevent @dragend="dragend"
11
- @drop="drop($event, columns, i)" v-show="!c.fix">
10
+ @dragenter="dragenter" @dragleave="dragleave" @dragover.prevent @dragend="dragend"
11
+ @drop="drop($event, columns, i)" v-show="!c.fix">
12
12
  {{ c.label }}
13
13
  </el-checkbox>
14
14
  </div>
@@ -20,16 +20,16 @@
20
20
  </div>
21
21
 
22
22
  <template #reference>
23
- <el-button class="fu-search-bar-button" :icon="icon">{{t('fu.table.custom_table_rows')}}</el-button>
23
+ <el-button class="fu-search-bar-button" :icon="icon">{{ t('fu.table.custom_table_rows') }}</el-button>
24
24
  </template>
25
25
  <!-- :size="configSize" -->
26
26
  </el-popover>
27
27
  </template>
28
28
 
29
29
  <script setup lang="ts">
30
- import {computed, inject} from "vue";
31
- import {tableColumnSelect} from "./utils"
32
- import {useLocale} from "@/hooks"
30
+ import { computed, inject } from "vue";
31
+ import { tableColumnSelect } from "./utils"
32
+ import { useLocale } from "@/hooks"
33
33
 
34
34
  const props = defineProps({
35
35
  icon: {
@@ -42,13 +42,13 @@ const props = defineProps({
42
42
  validator: (value: string) => ['click', 'hover'].includes(value)
43
43
  },
44
44
  columns: {
45
- type: Array,
45
+ type: Array as any,
46
46
  default: () => []
47
47
  },
48
48
 
49
49
  });
50
50
 
51
- const {t} = useLocale()
51
+ const { t } = useLocale()
52
52
 
53
53
  const localKey = inject("localKey")
54
54
 
@@ -6,7 +6,7 @@ export const tableColumnSelect = (localKey: any) => {
6
6
  return localKey ? "FU-T-" + localKey : ''
7
7
  })
8
8
 
9
- function dragstart(event: DragEvent, index: string) {
9
+ function dragstart(event: DragEvent, index: any) {
10
10
  if (event.dataTransfer) {
11
11
  event.dataTransfer.effectAllowed = "move"
12
12
  event.dataTransfer.setData("source_index", index)
@@ -15,15 +15,17 @@ export const tableColumnSelect = (localKey: any) => {
15
15
 
16
16
  function dragenter(event: DragEvent) {
17
17
  event.preventDefault()
18
- if (event.target) {
19
- event.target.style.opacity = .2
18
+ let target = event.target as HTMLElement
19
+ if (target) {
20
+ target.style.opacity= ".2"
20
21
  }
21
22
  }
22
23
 
23
24
  function dragleave(event: DragEvent) {
24
25
  event.preventDefault()
25
- if (event.target) {
26
- event.target.style.opacity = ""
26
+ let target = event.target as HTMLElement
27
+ if (target) {
28
+ target.style.opacity = ""
27
29
  }
28
30
  }
29
31
 
@@ -34,6 +36,7 @@ export const tableColumnSelect = (localKey: any) => {
34
36
  }
35
37
 
36
38
  function drop(event: DragEvent, list: any, index: number) {
39
+ let target = event.target as HTMLElement
37
40
  let source_index = Number(event.dataTransfer?.getData("source_index"))
38
41
  let target_index = index
39
42
  if (target_index > source_index) {
@@ -43,8 +46,8 @@ export const tableColumnSelect = (localKey: any) => {
43
46
  list.splice(target_index, 0, list[source_index])
44
47
  list.splice(source_index + 1, 1)
45
48
  }
46
- if (event.target) {
47
- event.target.style.opacity = ""
49
+ if (target) {
50
+ target.style.opacity = ""
48
51
  }
49
52
  }
50
53
 
@@ -10,7 +10,7 @@
10
10
  </el-button>
11
11
  <template #dropdown>
12
12
  <el-dropdown-menu>
13
- <el-dropdown-item v-for="(btn, i) in buttons" :key="i" :icon="type === 'icon'&& btn.icon" :disabled="disabled(btn)"
13
+ <el-dropdown-item v-for="(btn, i) in buttons" :key="i" :icon="type === 'icon'? btn.icon: ''" :disabled="disabled(btn)"
14
14
  :command="btn">
15
15
  {{ btn.label }}
16
16
  </el-dropdown-item>
@@ -21,12 +21,14 @@
21
21
  <script lang="ts" setup>
22
22
  import { computed } from "vue";
23
23
  import { useLocale } from "@/hooks"
24
+ import { PropType } from "vue";
25
+ import { DropdownProps } from "@/tools/types";
24
26
 
25
27
  const { t } = useLocale()
26
28
  const props = defineProps({
27
29
  row: Object,
28
30
  buttons: {
29
- type: Array,
31
+ type: Array as PropType<DropdownProps[]>,
30
32
  required: true
31
33
  },
32
34
  size: {
@@ -5,8 +5,8 @@
5
5
  </template>
6
6
  <template #default="{ row }">
7
7
  <fu-table-button :icon="type === 'icon'" v-for="(btn, i) in defaultButtons(row)" :key="i"
8
- @click.stop="btn.click(row)" :disabled="disableButton(btn, row)" :label="btn.label" :type="btn.type || 'primary'"
9
- link>
8
+ @click.stop="btn.click(row)" :disabled="disableButton(btn, row)" :label="btn.label"
9
+ :type="btn.type || 'primary'" link>
10
10
  <el-icon v-if="type === 'icon'">
11
11
  <component :is="btn.icon" />
12
12
  </el-icon>
@@ -52,13 +52,13 @@ const hasShowFunc = computed(() => {
52
52
  return props.buttons.some((btn: any) => typeof btn.show === "function")
53
53
  });
54
54
 
55
- const defaultButtons = computed(() => {
55
+ const defaultButtons: any = computed(() => {
56
56
  return function (row: any) {
57
57
  return hasMore(row) ? showButtons(row).slice(0, props.ellipsis) : showButtons(row)
58
58
  }
59
59
  });
60
60
 
61
- const moreButtons = computed(() => {
61
+ const moreButtons: any = computed(() => {
62
62
  return function (row: any) {
63
63
  return hasMore(row) ? showButtons(row).slice(props.ellipsis) : []
64
64
  }
@@ -66,7 +66,7 @@ const moreButtons = computed(() => {
66
66
 
67
67
  const computeWidth = computed(() => {
68
68
  let length = hasShowFunc.value ? props.ellipsis : defaultButtons.value.length
69
- let buttonsWidth = 35 + length * 58 + 58
69
+ let buttonsWidth: string | number = 35 + length * 58 + 58
70
70
  if (props.minWidth) {
71
71
  buttonsWidth = buttonsWidth < props.minWidth ? props.minWidth : buttonsWidth
72
72
  }
@@ -2,7 +2,7 @@
2
2
  <el-tabs class="fu-tabs" :before-leave="beforeLeave" :editable="false" :addable="false" v-bind="$attrs">
3
3
  <slot></slot>
4
4
  <el-tab-pane name="add" key="add" v-if="addable">
5
- <template v-slot:label>
5
+ <template #label>
6
6
  <slot name="add">
7
7
  <!-- 下拉方式 -->
8
8
  <el-dropdown @command="handleCommand" v-if="addType === 'dropdown'" :trigger="addTrigger">
@@ -38,6 +38,8 @@
38
38
  </template>
39
39
 
40
40
  <script lang="ts" setup>
41
+ import { PropType } from "vue";
42
+ import { DropdownProps } from "@/tools/types";
41
43
  import { uuid } from "@/tools/utils";
42
44
  defineOptions({ name: "FuTabs" });
43
45
  type TabPanelName = string | number
@@ -48,7 +50,7 @@ const props = defineProps({
48
50
  validator: (val: string) => ["default", "dropdown"].includes(val),
49
51
  },
50
52
  dropdownMenus: {
51
- type: Array,
53
+ type: Array as PropType<DropdownProps[]>,
52
54
  default: () => [],
53
55
  },
54
56
  addTrigger: {
@@ -14,15 +14,9 @@
14
14
  );
15
15
 
16
16
  // fit2cloud ui variables
17
-
18
17
  $filter-color: #646A73 !default;
19
18
  $filter-drawer-color: #646A73 !default;
20
19
  $filter-condition-color: #0C296E !default;
21
20
  $filter-condition-bgColor: rgba(51, 112, 255, 0.1) !default;
22
21
  $filter-option-bgColor: #F5F6F7 !default;
23
22
  $filter-scroll-bgColor: rgba(31, 35, 41, 0.1) !default;
24
-
25
- // $fu-search-bar-width: 100% !default;
26
- // $fu-search-bar-height: 48px !default;
27
- // $fu-search-bar-condition-color: #424242 !default;
28
- // $fu-search-bar-condition-bgColor: #E6E6E6 !default;
@@ -3,7 +3,7 @@
3
3
 
4
4
  @include b(tabs) {
5
5
  #tab-add {
6
- .el-icon-close {
6
+ .is-icon-close {
7
7
  display: none;
8
8
  }
9
9
  }
@@ -0,0 +1,9 @@
1
+ export interface DropdownProps {
2
+ icon?: string
3
+ disabled?: boolean
4
+ divided?: boolean
5
+ command?: string | number | object
6
+ label?: string | number
7
+ [k:string]: any;
8
+ }
9
+
@@ -1,29 +1,29 @@
1
- export const download = function ({url, name, content}) {
2
- if (url) {
3
- downloadByURL(url)
4
- } else {
5
- downloadByContent(name, content)
6
- }
7
- }
1
+ // export const download = function ({url, name, content}) {
2
+ // if (url) {
3
+ // downloadByURL(url)
4
+ // } else {
5
+ // downloadByContent(name, content)
6
+ // }
7
+ // }
8
8
 
9
- export const downloadByContent = function (name, content) {
10
- const blob = new Blob([content])
11
- const a = document.createElement('a')
12
- a.setAttribute('href', window.URL.createObjectURL(blob))
13
- a.setAttribute('download', name)
14
- document.body.appendChild(a)
15
- a.click()
16
- document.body.removeChild(a)
17
- }
9
+ // export const downloadByContent = function (name, content) {
10
+ // const blob = new Blob([content])
11
+ // const a = document.createElement('a')
12
+ // a.setAttribute('href', window.URL.createObjectURL(blob))
13
+ // a.setAttribute('download', name)
14
+ // document.body.appendChild(a)
15
+ // a.click()
16
+ // document.body.removeChild(a)
17
+ // }
18
18
 
19
- export const downloadByURL = function (url) {
20
- const a = document.createElement('a')
21
- a.setAttribute('href', url)
22
- a.setAttribute('download', url)
23
- document.body.appendChild(a)
24
- a.click()
25
- document.body.removeChild(a)
26
- }
19
+ // export const downloadByURL = function (url) {
20
+ // const a = document.createElement('a')
21
+ // a.setAttribute('href', url)
22
+ // a.setAttribute('download', url)
23
+ // document.body.appendChild(a)
24
+ // a.click()
25
+ // document.body.removeChild(a)
26
+ // }
27
27
 
28
28
  export const uuid = function () {
29
29
  let d = new Date().getTime();
@@ -45,16 +45,16 @@ export const randomId = function () {
45
45
  return Math.floor(Math.random() * 10000);
46
46
  }
47
47
 
48
- export const hasOwn = function (obj, key) {
49
- return Object.prototype.hasOwnProperty.call(obj, key);
50
- }
48
+ // export const hasOwn = function (obj, key) {
49
+ // return Object.prototype.hasOwnProperty.call(obj, key);
50
+ // }
51
51
 
52
- export const convertToUnit = function (value, unit = "px") {
53
- if (value == null || value === '') {
54
- return undefined
55
- } else if (isNaN(+value)) {
56
- return String(value)
57
- } else {
58
- return `${Number(value)}${unit}`
59
- }
60
- }
52
+ // export const convertToUnit = function (value, unit = "px") {
53
+ // if (value == null || value === '') {
54
+ // return undefined
55
+ // } else if (isNaN(+value)) {
56
+ // return String(value)
57
+ // } else {
58
+ // return `${Number(value)}${unit}`
59
+ // }
60
+ // }
package/.editorconfig DELETED
@@ -1,14 +0,0 @@
1
- # https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- end_of_line = lf
9
- insert_final_newline = true
10
- trim_trailing_whitespace = true
11
-
12
- [*.md]
13
- insert_final_newline = false
14
- trim_trailing_whitespace = false
package/BETA.MD DELETED
@@ -1,6 +0,0 @@
1
- ### 如何发布测试版
2
-
3
- 1. package.json 中的 version 修改为 x.x.x-beta.x(不用提交),例如1.1.0-beta.0
4
- 2. 打包,npm run build,然后检查lib目录内容是否正确
5
- 3. 发布,npm publish --tag beta,发布的包是beta,而不是latest,这样npm install不会安装beta版的包
6
- 4. 安装,npm install fit2cloud-ui-plus@beta 或者 直接修改package.json 中的 version,然后npm install
package/env.d.ts DELETED
@@ -1,13 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare module '*.vue' {
4
- import type { DefineComponent } from 'vue'
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6
- const component: DefineComponent<{}, {}, any>
7
- export default component
8
- }
9
-
10
- declare module "*.md" {
11
- const content: string;
12
- export default content;
13
- }
package/examples/App.vue DELETED
@@ -1,65 +0,0 @@
1
- <template>
2
- <div id="app">
3
- <router-view></router-view>
4
- </div>
5
- </template>
6
-
7
- <script setup lang="ts">
8
-
9
- </script>
10
-
11
- <style>
12
- button {
13
- margin: 0;
14
- }
15
- body {
16
- margin: 0;
17
- padding: 0 !important;
18
- height: 100%;
19
- color: #333333;
20
- font-size: 14px;
21
- overflow: hidden;
22
- }
23
-
24
- #app {
25
- width: 100%;
26
- height: 100%;
27
- }
28
-
29
- :focus {
30
- outline: none;
31
- }
32
-
33
- a:active {
34
- outline: none;
35
- }
36
-
37
- a,
38
- a:focus,
39
- a:hover {
40
- cursor: pointer;
41
- color: inherit;
42
- text-decoration: none;
43
- }
44
- /* 列表元素 */
45
- ul,
46
- ol {
47
- list-style: none;
48
- margin: 0;
49
- padding: 0;
50
- }
51
- ::-webkit-scrollbar {
52
- width: 6px;
53
- height: 6px;
54
- }
55
-
56
- ::-webkit-scrollbar-thumb {
57
- border-radius: 5px;
58
- background-color: rgba(144, 147, 153, 0.3);
59
- }
60
-
61
- ::-webkit-scrollbar-track {
62
- border-radius: 5px;
63
- background-color: transparent;
64
- }
65
- </style>
Binary file
Binary file