fit2cloud-ui-plus 1.1.0 → 1.1.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 (41) hide show
  1. package/lib/fit2cloud-ui-plus.es.js +1326 -1341
  2. package/lib/fit2cloud-ui-plus.umd.js +1 -1
  3. package/package.json +2 -2
  4. package/src/components/filter-bar/filter-components/FuFilterDateTime.vue +0 -1
  5. package/src/components/filter-bar/filter-components/FuFilterInputText.vue +1 -2
  6. package/src/components/icon-button/FuIconButton.vue +0 -4
  7. package/src/components/read-write-switch/FuReadWriteSwitch.vue +2 -3
  8. package/src/components/search-bar/FuComplexSearch.vue +1 -1
  9. package/src/components/search-bar/FuQuickSearch.vue +1 -1
  10. package/src/components/search-bar/complex-components/FuComplexDateTime.vue +0 -1
  11. package/src/components/speed-dial/FuSpeedDial.vue +3 -3
  12. package/src/components/speed-dial/FuSpeedDialActionButton.vue +0 -3
  13. package/src/components/{ steps/FuVerticalNavigation.vue → steps/FuVerticalNavigation.vue} +1 -1
  14. package/src/components/{ steps/Stepper.ts → steps/Stepper.ts} +11 -29
  15. package/src/components/{ steps/types.ts → steps/types.ts} +1 -1
  16. package/src/components/table/FuTableColumnDropdown.vue +1 -2
  17. package/src/components/table/table-column-select/FuTableColumnSelectDialog.vue +1 -1
  18. package/src/components/table/table-operations/FuTableMoreButton.vue +2 -2
  19. package/src/components/tabs/FuTabs.vue +1 -2
  20. package/src/tools/size.ts +2 -2
  21. package/types/src/components/{ steps/FuVerticalNavigation.vue.d.ts → steps/FuVerticalNavigation.vue.d.ts} +1 -1
  22. package/types/src/components/{ steps/types.d.ts → steps/types.d.ts} +1 -1
  23. package/src/tools/utils.ts +0 -60
  24. package/types/src/tools/utils.d.ts +0 -2
  25. /package/src/components/{ steps → steps}/FuHorizontalNavigation.vue +0 -0
  26. /package/src/components/{ steps → steps}/FuHorizontalSteps.vue +0 -0
  27. /package/src/components/{ steps → steps}/FuStep.vue +0 -0
  28. /package/src/components/{ steps → steps}/FuStepButton.vue +0 -0
  29. /package/src/components/{ steps → steps}/FuSteps.vue +0 -0
  30. /package/src/components/{ steps → steps}/FuStepsFooter.ts +0 -0
  31. /package/src/components/{ steps → steps}/FuVerticalSteps.vue +0 -0
  32. /package/src/components/{ steps → steps}/index.ts +0 -0
  33. /package/types/src/components/{ steps → steps}/FuHorizontalNavigation.vue.d.ts +0 -0
  34. /package/types/src/components/{ steps → steps}/FuHorizontalSteps.vue.d.ts +0 -0
  35. /package/types/src/components/{ steps → steps}/FuStep.vue.d.ts +0 -0
  36. /package/types/src/components/{ steps → steps}/FuStepButton.vue.d.ts +0 -0
  37. /package/types/src/components/{ steps → steps}/FuSteps.vue.d.ts +0 -0
  38. /package/types/src/components/{ steps → steps}/FuStepsFooter.d.ts +0 -0
  39. /package/types/src/components/{ steps → steps}/FuVerticalSteps.vue.d.ts +0 -0
  40. /package/types/src/components/{ steps → steps}/Stepper.d.ts +0 -0
  41. /package/types/src/components/{ steps → steps}/index.d.ts +0 -0
@@ -71,7 +71,7 @@ function exec() {
71
71
  let conditions: any = [];
72
72
  references?.value.forEach(r => {
73
73
  let condition = r.getCondition()
74
- if (condition && condition.value !== undefined) {
74
+ if (condition?.value !== undefined) {
75
75
  conditions.push(condition)
76
76
  }
77
77
  })
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
  <script setup lang="ts">
14
- import {computed, ref, watch} from "vue";
14
+ import {computed, ref} from "vue";
15
15
  import {validateSize} from "@/tools/size";
16
16
  import {useSize} from "@/hooks";
17
17
 
@@ -2,7 +2,6 @@
2
2
  <div class="fu-complex-component">
3
3
  <div class="fu-complex-component__label">{{ label }}</div>
4
4
  <div class="fu-complex-component__content">
5
- <!-- :size="configSize" -->
6
5
  <el-date-picker class="fu-complex-date-time" v-model="value" v-bind="$attrs" :size="configSize"
7
6
  :placeholder="t('fu.search_bar.select_date_time')" type="datetimerange"
8
7
  :value-format="valueFormat"
@@ -135,7 +135,7 @@ const hashChildren = computed(() => {
135
135
  if (props.items && props.items.length > 0) {
136
136
  return true
137
137
  }
138
- return slots && slots.default
138
+ return slots?.default
139
139
  })
140
140
  const config = computed(() => {
141
141
  return props.sizeOptions[props.size] || props.sizeOptions["default"]
@@ -212,8 +212,8 @@ function mousemove(e: MouseEvent) {
212
212
  if (props.position === "absolute") {
213
213
  const {offsetLeft, offsetTop, clientWidth, clientHeight, offsetParent} = instance?.vnode.el as HTMLElement
214
214
 
215
- const maxWidth = offsetParent && offsetParent.clientWidth || 0 - clientWidth
216
- const maxHeight = offsetParent && offsetParent.clientHeight || 0 - clientHeight
215
+ const maxWidth = offsetParent?.clientWidth ?? 0 - clientWidth
216
+ const maxHeight = offsetParent?.clientHeight ?? 0 - clientHeight
217
217
 
218
218
  let left = offsetLeft + e.movementX
219
219
  let top = offsetTop + e.movementY
@@ -44,9 +44,6 @@ const config = computed(() => {
44
44
  const direction = computed(() => {
45
45
  return speedDialKey?.direction.value || "";
46
46
  })
47
- // const clickClose =computed(()=>{
48
- // return FuSpeedDial.clickClose;
49
- // })
50
47
 
51
48
  const titleSize = computed(() => {
52
49
  let size = config.value?.fab.size + "px";
@@ -17,7 +17,7 @@
17
17
  <script lang="ts" setup>
18
18
  import type { PropType } from 'vue'
19
19
  import { computed } from "vue";
20
- import {Step} from "@/components/ steps/Stepper";
20
+ import {Step} from "@/components/steps/Stepper";
21
21
  const props = defineProps({
22
22
  stepper: Object,
23
23
  steps: Array as PropType<Step[]>,
@@ -20,24 +20,24 @@ export class Stepper implements StepperOptions {
20
20
  height: string;
21
21
 
22
22
  constructor(options?: StepperOptions) {
23
- options = options || ({} as StepperOptions);
23
+ options ??= {} as StepperOptions;
24
24
  // 所有步骤节点(Step对象数组)
25
25
  this.steps = options.steps;
26
26
  // 正在执行的节点的索引
27
- this.index = options.index === undefined ? 0 : options.index;
27
+ this.index = options.index ?? 0;
28
28
  // 激活过的节点的索引
29
29
  this.activeSet = new Set();
30
30
  // loading状态
31
- this.isLoading = options?.isLoading || false;
31
+ this.isLoading = options.isLoading ?? false;
32
32
  // footer 属性
33
- this.onCancelButtonText = options.onCancelButtonText || t('fu.steps.cancel');
34
- this.onFinishButtonText = options.onFinishButtonText || t('fu.steps.finish');
35
- this.prevButtonText = options.prevButtonText || t('fu.steps.prev');
36
- this.nextButtonText = options.nextButtonText || t('fu.steps.next');
37
- this.buttonSize = options.buttonSize || 'default';
38
- this.footerAlign = options.footerAlign || 'flex';
33
+ this.onCancelButtonText = options.onCancelButtonText ?? t('fu.steps.cancel');
34
+ this.onFinishButtonText = options.onFinishButtonText ?? t('fu.steps.finish');
35
+ this.prevButtonText = options.prevButtonText ?? t('fu.steps.prev');
36
+ this.nextButtonText = options.nextButtonText ?? t('fu.steps.next');
37
+ this.buttonSize = options.buttonSize ?? 'default';
38
+ this.footerAlign = options.footerAlign ?? 'flex';
39
39
  // 是否显示取消按钮
40
- this.showCancel = options.showCancel === undefined ? false : options.showCancel;
40
+ this.showCancel = options.showCancel ?? false;
41
41
  // 激活前钩子
42
42
  this.beforeActive = options.beforeActive;
43
43
  // 离开前钩子
@@ -84,11 +84,6 @@ export class Stepper implements StepperOptions {
84
84
  }
85
85
  }
86
86
 
87
- // 反激活
88
- // inactive(index: number): void {
89
- // this.activeSet.delete(index);
90
- // }
91
-
92
87
  // 下一步
93
88
  next(): void {
94
89
  if (!this.isLast(this.index)) {
@@ -110,19 +105,6 @@ export class Stepper implements StepperOptions {
110
105
  }
111
106
  }
112
107
 
113
- // 使用ID获取节点索引
114
- // getIndex(id: string): number {
115
- // if (this.steps) {
116
- // for (let i = 0; i < this.steps.length; i++) {
117
- // let step: any = this.steps[i];
118
- // if (id === step.id) {
119
- // return i;
120
- // }
121
- // }
122
- // }
123
- // return -1;
124
- // }
125
-
126
108
  executeBeforeLeave(index: number, forward: boolean) {
127
109
  const step: any = this.getStep(index);
128
110
  if (step.beforeLeave) {
@@ -155,7 +137,7 @@ export class Step implements StepOptions {
155
137
  status?: string;
156
138
 
157
139
  constructor(options?: StepOptions) {
158
- options = options || ({} as StepOptions);
140
+ options ??= {} as StepOptions;
159
141
  this.id = options.id;
160
142
  this.index = options.index;
161
143
  // 激活前钩子
@@ -1,4 +1,4 @@
1
- import {Step} from "@/components/ steps/Stepper";
1
+ import {Step} from "@/components/steps/Stepper";
2
2
 
3
3
  export interface StepperOptions {
4
4
  steps: [Step]
@@ -32,8 +32,7 @@
32
32
  </el-table-column>
33
33
  </template>
34
34
  <script lang="ts" setup>
35
- import { computed, getCurrentInstance } from "vue";
36
- import { PropType } from "vue";
35
+ import { computed, getCurrentInstance, PropType } from "vue";
37
36
  import { DropdownProps } from "@/tools/types";
38
37
 
39
38
  defineOptions({ name: "FuTableColumnDropdown" });
@@ -56,7 +56,7 @@ const {t} = useLocale()
56
56
 
57
57
  const cloneColumn = (source: any, target: any) => {
58
58
  source.forEach((col: any) => {
59
- target.push(Object.assign({}, col))
59
+ target.push({...col})
60
60
  })
61
61
  return target
62
62
  }
@@ -19,10 +19,10 @@
19
19
  </el-dropdown>
20
20
  </template>
21
21
  <script lang="ts" setup>
22
- import { computed } from "vue";
22
+ import { computed, PropType } from "vue";
23
23
  import { useLocale } from "@/hooks"
24
- import { PropType } from "vue";
25
24
  import { DropdownProps } from "@/tools/types";
25
+
26
26
  defineOptions({ name: "FuTableMoreButton" });
27
27
  const { t } = useLocale()
28
28
  const props = defineProps({
@@ -41,7 +41,6 @@
41
41
  <script lang="ts" setup>
42
42
  import { PropType } from "vue";
43
43
  import { DropdownProps } from "@/tools/types";
44
- import { uuid } from "@/tools/utils";
45
44
  defineOptions({ name: "FuTabs" });
46
45
  type TabPanelName = string | number
47
46
  const props = defineProps({
@@ -69,7 +68,7 @@ const props = defineProps({
69
68
  const emit = defineEmits(["command"])
70
69
 
71
70
  function handleCommand(e: any) {
72
- const name = uuid();
71
+ const name = crypto.randomUUID();
73
72
  let obj = null;
74
73
  if (e) {
75
74
  obj = props.dropdownMenus.find((item: any) => item.command === e);
package/src/tools/size.ts CHANGED
@@ -2,5 +2,5 @@ const COMPONENTS_SIZE = ['', 'default', 'small', 'large'];
2
2
 
3
3
  export type ComponentSize = typeof COMPONENTS_SIZE[number]
4
4
 
5
- export const validateSize = (val: string): val is ComponentSize | '' =>
6
- ['', ...COMPONENTS_SIZE].includes(val)
5
+ export const validateSize = (val: string): val is ComponentSize =>
6
+ ["", ...COMPONENTS_SIZE].includes(val)
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import { Step } from "@/components/ steps/Stepper";
2
+ import { Step } from "@/components/steps/Stepper";
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  stepper: ObjectConstructor;
5
5
  steps: PropType<Step[]>;
@@ -1,4 +1,4 @@
1
- import { Step } from "@/components/ steps/Stepper";
1
+ import { Step } from "@/components/steps/Stepper";
2
2
  export interface StepperOptions {
3
3
  steps: [Step];
4
4
  index: number;
@@ -1,60 +0,0 @@
1
- // export const download = function ({url, name, content}) {
2
- // if (url) {
3
- // downloadByURL(url)
4
- // } else {
5
- // downloadByContent(name, content)
6
- // }
7
- // }
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
- // }
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
- // }
27
-
28
- export const uuid = function () {
29
- let d = new Date().getTime();
30
- let d2 = (performance && performance.now && (performance.now() * 1000)) || 0;
31
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
32
- let r = Math.random() * 16;
33
- if (d > 0) {
34
- r = (d + r) % 16 | 0;
35
- d = Math.floor(d / 16);
36
- } else {
37
- r = (d2 + r) % 16 | 0;
38
- d2 = Math.floor(d2 / 16);
39
- }
40
- return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
41
- });
42
- };
43
-
44
- export const randomId = function () {
45
- return Math.floor(Math.random() * 10000);
46
- }
47
-
48
- // export const hasOwn = function (obj, key) {
49
- // return Object.prototype.hasOwnProperty.call(obj, key);
50
- // }
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
- // }
@@ -1,2 +0,0 @@
1
- export declare const uuid: () => string;
2
- export declare const randomId: () => number;
File without changes
File without changes
File without changes