@oinone/kunlun-vue-ui-common 6.3.9 → 6.4.0

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 (84) hide show
  1. package/dist/icons/iconfont/iconfont.css +7 -3
  2. package/dist/icons/iconfont/iconfont.js +1 -1
  3. package/dist/icons/iconfont/iconfont.json +7 -0
  4. package/dist/icons/iconfont/iconfont.ttf +0 -0
  5. package/dist/icons/iconfont/iconfont.woff +0 -0
  6. package/dist/icons/iconfont/iconfont.woff2 +0 -0
  7. package/dist/icons/oinone-iconfont/iconfont.css +171 -3
  8. package/dist/icons/oinone-iconfont/iconfont.js +1 -1
  9. package/dist/icons/oinone-iconfont/iconfont.json +294 -0
  10. package/dist/icons/oinone-iconfont/iconfont.ttf +0 -0
  11. package/dist/icons/oinone-iconfont/iconfont.woff +0 -0
  12. package/dist/icons/oinone-iconfont/iconfont.woff2 +0 -0
  13. package/dist/oinone-kunlun-vue-ui-common.esm.js +2 -3
  14. package/dist/types/src/component/index.d.ts +2 -0
  15. package/dist/types/src/component/oio-button/props.d.ts +3 -0
  16. package/dist/types/src/component/oio-card/context.d.ts +12 -0
  17. package/dist/types/src/component/oio-card/index.d.ts +1 -0
  18. package/dist/types/src/component/oio-drawer/props.d.ts +18 -4
  19. package/dist/types/src/component/oio-drawer/typing.d.ts +4 -2
  20. package/dist/types/src/component/oio-drawer/useDrawer.d.ts +5 -1
  21. package/dist/types/src/component/oio-group/props.d.ts +3 -0
  22. package/dist/types/src/component/oio-inner-popup/props.d.ts +0 -2
  23. package/dist/types/src/component/oio-input/props.d.ts +18 -0
  24. package/dist/types/src/component/oio-modal/props.d.ts +18 -3
  25. package/dist/types/src/component/oio-modal/typing.d.ts +3 -5
  26. package/dist/types/src/component/oio-modal/useModal.d.ts +8 -3
  27. package/dist/types/src/component/oio-select/model.d.ts +2 -0
  28. package/dist/types/src/component/oio-select/props.d.ts +4 -0
  29. package/dist/types/src/component/oio-tabs/index.d.ts +1 -0
  30. package/dist/types/src/component/oio-tabs/props.d.ts +4 -0
  31. package/dist/types/src/component/oio-tabs/typing.d.ts +5 -0
  32. package/dist/types/src/component/oio-tree/events.d.ts +1 -1
  33. package/dist/types/src/component/oio-tree/props.d.ts +1 -35
  34. package/dist/types/src/component/vc-popup/index.d.ts +1 -0
  35. package/dist/types/src/component/vc-popup/props.d.ts +13 -0
  36. package/dist/types/src/context/form-context.d.ts +7 -0
  37. package/dist/types/src/context/index.d.ts +1 -0
  38. package/dist/types/src/index.d.ts +1 -0
  39. package/dist/types/src/quick-utils/index.d.ts +1 -0
  40. package/dist/types/src/quick-utils/use-copy.d.ts +4 -0
  41. package/dist/types/src/util/PropRecordHelper.d.ts +1 -1
  42. package/icons/iconfont/iconfont.css +7 -3
  43. package/icons/iconfont/iconfont.js +1 -1
  44. package/icons/iconfont/iconfont.json +7 -0
  45. package/icons/iconfont/iconfont.ttf +0 -0
  46. package/icons/iconfont/iconfont.woff +0 -0
  47. package/icons/iconfont/iconfont.woff2 +0 -0
  48. package/icons/oinone-iconfont/iconfont.css +171 -3
  49. package/icons/oinone-iconfont/iconfont.js +1 -1
  50. package/icons/oinone-iconfont/iconfont.json +294 -0
  51. package/icons/oinone-iconfont/iconfont.ttf +0 -0
  52. package/icons/oinone-iconfont/iconfont.woff +0 -0
  53. package/icons/oinone-iconfont/iconfont.woff2 +0 -0
  54. package/package.json +5 -5
  55. package/src/component/index.ts +4 -0
  56. package/src/component/oio-button/props.ts +3 -0
  57. package/src/component/oio-card/context.ts +27 -0
  58. package/src/component/oio-card/index.ts +1 -0
  59. package/src/component/oio-close-icon/oio-close-icon.vue +2 -2
  60. package/src/component/oio-drawer/props.ts +13 -6
  61. package/src/component/oio-drawer/typing.ts +4 -2
  62. package/src/component/oio-drawer/useDrawer.ts +176 -27
  63. package/src/component/oio-group/props.ts +3 -0
  64. package/src/component/oio-inner-popup/props.ts +1 -2
  65. package/src/component/oio-input/props.ts +3 -0
  66. package/src/component/oio-modal/props.ts +13 -5
  67. package/src/component/oio-modal/typing.ts +3 -5
  68. package/src/component/oio-modal/useModal.ts +110 -20
  69. package/src/component/oio-select/model.ts +3 -0
  70. package/src/component/oio-select/props.ts +4 -0
  71. package/src/component/oio-tabs/index.ts +1 -0
  72. package/src/component/oio-tabs/props.ts +4 -0
  73. package/src/component/oio-tabs/typing.ts +5 -0
  74. package/src/component/oio-tree/events.ts +1 -1
  75. package/src/component/oio-tree/props.ts +1 -37
  76. package/src/component/vc-popup/index.ts +1 -0
  77. package/src/component/vc-popup/props.ts +14 -0
  78. package/src/component/vc-popup/usePopup.ts +2 -0
  79. package/src/context/form-context.ts +17 -0
  80. package/src/context/index.ts +1 -0
  81. package/src/index.ts +1 -0
  82. package/src/quick-utils/index.ts +1 -0
  83. package/src/quick-utils/use-copy.ts +56 -0
  84. package/src/util/PropRecordHelper.ts +9 -7
@@ -1,69 +1,218 @@
1
1
  import { isString } from 'lodash-es';
2
- import { computed } from 'vue';
3
- import { usePopup } from '../vc-popup/usePopup';
4
- import { DrawerHeight, DrawerWidth } from './typing';
2
+ import { computed, ref } from 'vue';
3
+ import { DEFAULT_PREFIX } from '../../theme';
4
+ import { StyleHelper } from '../../util';
5
+ import { ModalHeight, ModalWidth } from '../oio-modal';
6
+ import { PopupDisplayAs, usePopup } from '../vc-popup';
7
+ import { DrawerHeight, DrawerPlacement, DrawerWidth } from './typing';
5
8
 
6
9
  export function useDrawer(props, context) {
10
+ const internalDisplayAs = ref<PopupDisplayAs | undefined>();
11
+ const displayAs = computed({
12
+ get() {
13
+ if (props.displayAs == null) {
14
+ return internalDisplayAs.value || PopupDisplayAs.drawer;
15
+ }
16
+ return props.displayAs as PopupDisplayAs;
17
+ },
18
+ set(value: PopupDisplayAs) {
19
+ internalDisplayAs.value = value;
20
+ context.emit('update:displayAs', value);
21
+ }
22
+ });
23
+
24
+ const isFullScreen = ref(false);
25
+ const internalWidth = ref<string | undefined>();
26
+ const internalHeight = ref<string | undefined>();
27
+
28
+ // 弹窗形式的抽屉
29
+ const modalDrawerClassName = computed(() => {
30
+ const classNames: string[] = [];
31
+ if (displayAs.value === PopupDisplayAs.modal) {
32
+ classNames.push(`${DEFAULT_PREFIX}-drawer-modal-mode`);
33
+ if (height.value == null) {
34
+ classNames.push(`${DEFAULT_PREFIX}-drawer-modal-auto-height`);
35
+ }
36
+ }
37
+ if (internalWidth.value === 'full') {
38
+ classNames.push(`${DEFAULT_PREFIX}-drawer-fullscreen`);
39
+ }
40
+ return classNames;
41
+ });
42
+
7
43
  const placement = computed(() => {
44
+ if (displayAs.value === PopupDisplayAs.modal) {
45
+ return DrawerPlacement.right;
46
+ }
8
47
  return props.placement?.toLowerCase?.();
9
48
  });
10
49
 
50
+ const usingWidth = computed(() => {
51
+ return placement.value === 'left' || placement.value === 'right';
52
+ });
53
+
54
+ const usingHeight = computed(() => {
55
+ return placement.value === 'top' || placement.value === 'bottom';
56
+ });
57
+
11
58
  const width = computed(() => {
12
59
  if (!props.visible) {
13
60
  return '0';
14
61
  }
15
- const _width = props.width;
16
- if (isString(_width)) {
17
- const realWidth = DrawerWidth[_width.toLowerCase()];
18
- if (realWidth) {
19
- return null;
62
+ if (internalWidth.value != null) {
63
+ switch (displayAs.value) {
64
+ case PopupDisplayAs.drawer: {
65
+ const val = DrawerWidth[internalWidth.value];
66
+ if (val != null) {
67
+ return val;
68
+ }
69
+ return internalWidth.value;
70
+ }
71
+ case PopupDisplayAs.modal: {
72
+ const val = ModalWidth[internalWidth.value];
73
+ if (val != null) {
74
+ return val;
75
+ }
76
+ return internalWidth.value;
77
+ }
20
78
  }
21
79
  }
22
- return _width;
80
+ if (usingWidth.value) {
81
+ const _width = props.width;
82
+ if (isString(_width)) {
83
+ const realWidth = DrawerWidth[_width.toLowerCase()];
84
+ if (realWidth) {
85
+ return '';
86
+ }
87
+ }
88
+ return StyleHelper.px(_width);
89
+ }
90
+ return undefined;
23
91
  });
24
92
 
25
93
  const widthClassSuffix = computed(() => {
26
- const _width = props.width;
27
- if (isString(_width)) {
28
- const realWidth = DrawerWidth[_width.toLowerCase()];
29
- if (realWidth) {
30
- return _width.toLowerCase();
94
+ if (usingWidth.value) {
95
+ const _width = internalWidth.value || props.width;
96
+ if (isString(_width)) {
97
+ const realWidth = DrawerWidth[_width.toLowerCase()];
98
+ if (realWidth) {
99
+ return _width.toLowerCase();
100
+ }
31
101
  }
32
102
  }
33
103
  return undefined;
34
104
  });
35
105
 
36
- const height = computed(() => {
106
+ const height = computed<string | undefined>(() => {
37
107
  if (!props.visible) {
38
108
  return '0';
39
109
  }
40
- const _height = props.height;
41
- if (isString(_height)) {
42
- const realHeight = DrawerHeight[_height.toLowerCase()];
43
- if (realHeight) {
44
- return null;
110
+ if (internalHeight.value != null) {
111
+ switch (displayAs.value) {
112
+ case PopupDisplayAs.drawer:
113
+ return DrawerHeight[internalHeight.value];
114
+ case PopupDisplayAs.modal:
115
+ return ModalHeight[internalHeight.value];
116
+ }
117
+ }
118
+ if (usingHeight.value) {
119
+ const _height = props.height;
120
+ if (isString(_height)) {
121
+ const realHeight = DrawerHeight[_height.toLowerCase()];
122
+ if (realHeight) {
123
+ return '';
124
+ }
45
125
  }
126
+ return StyleHelper.px(_height);
46
127
  }
47
- return _height;
128
+ return undefined;
48
129
  });
49
130
 
50
131
  const heightClassSuffix = computed(() => {
51
- const _height = props.height;
52
- if (isString(_height)) {
53
- const realHeight = DrawerHeight[_height.toLowerCase()];
54
- if (realHeight) {
55
- return _height.toLowerCase();
132
+ if (usingHeight.value) {
133
+ const _height = internalHeight.value || props.height;
134
+ if (isString(_height)) {
135
+ const realHeight = DrawerHeight[_height.toLowerCase()];
136
+ if (realHeight) {
137
+ return _height.toLowerCase();
138
+ }
56
139
  }
57
140
  }
58
141
  return undefined;
59
142
  });
60
143
 
144
+ /**
145
+ * 全屏切换
146
+ */
147
+ const onFullSwitch = () => {
148
+ displayAs.value = PopupDisplayAs.drawer;
149
+ if (isFullScreen.value) {
150
+ internalHeight.value = undefined;
151
+ internalWidth.value = undefined;
152
+ isFullScreen.value = false;
153
+ } else {
154
+ isFullScreen.value = true;
155
+ internalHeight.value = 'full';
156
+ internalWidth.value = 'full';
157
+ }
158
+ };
159
+
160
+ /**
161
+ * 弹窗展示模式切换
162
+ */
163
+ const onDisplayAsSwitch = () => {
164
+ internalHeight.value = undefined;
165
+ internalWidth.value = undefined;
166
+ isFullScreen.value = false;
167
+
168
+ if (displayAs.value === PopupDisplayAs.drawer) {
169
+ displayAs.value = PopupDisplayAs.modal;
170
+
171
+ const placement = props.placement || DrawerPlacement.right;
172
+ let key: keyof typeof DrawerHeight | undefined;
173
+ switch (placement) {
174
+ case DrawerPlacement.left:
175
+ case DrawerPlacement.right:
176
+ if (typeof props.width === 'string') {
177
+ key = Object.keys(DrawerWidth).find(
178
+ (key) => key === props.width.toLowerCase() || DrawerWidth[key] === props.width
179
+ ) as keyof typeof DrawerHeight | undefined;
180
+ if (key == null) {
181
+ internalHeight.value = StyleHelper.px(props.width);
182
+ } else {
183
+ internalHeight.value = key;
184
+ }
185
+ }
186
+ break;
187
+ case DrawerPlacement.top:
188
+ case DrawerPlacement.bottom:
189
+ if (typeof props.height === 'string') {
190
+ key = Object.keys(DrawerHeight).find(
191
+ (key) => key === props.height.toLowerCase() || DrawerHeight[key] === props.height
192
+ ) as keyof typeof DrawerHeight | undefined;
193
+ if (key == null) {
194
+ internalWidth.value = StyleHelper.px(props.height);
195
+ } else {
196
+ internalWidth.value = key;
197
+ }
198
+ }
199
+ break;
200
+ }
201
+ } else {
202
+ displayAs.value = PopupDisplayAs.drawer;
203
+ }
204
+ };
205
+
61
206
  return {
62
207
  ...usePopup(props, context),
63
208
  placement,
64
209
  width,
65
210
  widthClassSuffix,
66
211
  height,
67
- heightClassSuffix
212
+ heightClassSuffix,
213
+ modalDrawerClassName,
214
+ isFullScreen,
215
+ onFullSwitch,
216
+ onDisplayAsSwitch
68
217
  };
69
218
  }
@@ -36,6 +36,9 @@ export const OioGroupProps = {
36
36
  type: [String, Boolean],
37
37
  default: undefined
38
38
  },
39
+ bizStyle: {
40
+ type: String
41
+ },
39
42
  description: {
40
43
  type: String
41
44
  },
@@ -9,8 +9,7 @@ type InnerPopupTeleportType = string | HTMLElement;
9
9
  export const OioInnerPopupAppearanceProps = {
10
10
  ...VcPopupAppearanceProps,
11
11
  title: {
12
- type: String,
13
- default: '标题'
12
+ type: String
14
13
  },
15
14
  help: {
16
15
  type: String
@@ -34,6 +34,9 @@ export const AInputProps = {
34
34
  value: {
35
35
  type: String
36
36
  },
37
+ 'onUpdate:value': {
38
+ type: Function as PropType<(value: string) => void>
39
+ },
37
40
  defaultValue: {
38
41
  type: String
39
42
  },
@@ -1,20 +1,18 @@
1
1
  import { PropType } from 'vue';
2
2
  import { VcMaskPopupAppearanceProps, VcPopupAppearanceProps, VcPopupControlProps, VcPopupDataProps } from '../vc-popup';
3
- import { ModalWidth, ModalWidthType } from './typing';
3
+ import { ModalWidthType } from './typing';
4
4
 
5
5
  const OioModalAppearanceProps = {
6
6
  ...VcPopupAppearanceProps,
7
7
  ...VcMaskPopupAppearanceProps,
8
8
  title: {
9
- type: String,
10
- default: '对话框'
9
+ type: String
11
10
  },
12
11
  help: {
13
12
  type: String
14
13
  },
15
14
  width: {
16
- type: [Number, String] as PropType<ModalWidthType | string | number>,
17
- default: ModalWidth.small
15
+ type: [Number, String] as PropType<ModalWidthType | string | number>
18
16
  },
19
17
  height: {
20
18
  type: [Number, String] as PropType<ModalWidthType | string | number>
@@ -26,6 +24,16 @@ const OioModalAppearanceProps = {
26
24
  footerInvisible: {
27
25
  type: Boolean,
28
26
  default: undefined
27
+ },
28
+ // 是否显示切换全屏按钮
29
+ enabledFullScreen: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ // 是否显示切换窗口类型按钮
34
+ showPopupToggle: {
35
+ type: Boolean,
36
+ default: true
29
37
  }
30
38
  };
31
39
 
@@ -2,17 +2,15 @@ export enum ModalWidth {
2
2
  small = 560,
3
3
  medium = 890,
4
4
  large = 1200,
5
- custom = 'CUSTOM',
6
5
  full = '100%'
7
6
  }
8
7
 
9
8
  export type ModalWidthType = number | string | keyof typeof ModalWidth;
10
9
 
11
10
  export enum ModalHeight {
12
- small = '30%',
13
- medium = '50%',
14
- large = '80%',
15
- custom = 'CUSTOM',
11
+ small = '40vh',
12
+ medium = '60vh',
13
+ large = '90vh',
16
14
  full = '100%'
17
15
  }
18
16
 
@@ -1,34 +1,96 @@
1
1
  import { isString } from 'lodash-es';
2
- import { computed } from 'vue';
3
- import { usePopup } from '../vc-popup/usePopup';
2
+ import { computed, ref } from 'vue';
3
+ import { DEFAULT_PREFIX } from '../../theme';
4
+ import { StyleHelper } from '../../util';
5
+ import { PopupDisplayAs, usePopup } from '../vc-popup';
4
6
  import { ModalHeight, ModalWidth } from './typing';
5
- import { StyleHelper } from '../../util/style';
6
7
 
7
8
  export function useModal(props, context) {
9
+ const internalDisplayAs = ref<PopupDisplayAs | undefined>();
10
+ const displayAs = computed({
11
+ get() {
12
+ if (props.displayAs == null) {
13
+ return internalDisplayAs.value || PopupDisplayAs.modal;
14
+ }
15
+ return props.displayAs as PopupDisplayAs;
16
+ },
17
+ set(value: PopupDisplayAs) {
18
+ internalDisplayAs.value = value;
19
+ context.emit('update:displayAs', value);
20
+ }
21
+ });
22
+
23
+ const isFullScreen = ref(false);
24
+ const internalWidth = ref<keyof typeof ModalWidth>();
25
+ const internalHeight = ref<keyof typeof ModalHeight>();
26
+
27
+ // 抽屉形式的模态框
28
+ const drawerModalClassName = computed(() => {
29
+ const classNames: string[] = [];
30
+ if (displayAs.value === PopupDisplayAs.drawer) {
31
+ classNames.push(`${DEFAULT_PREFIX}-modal-drawer-mode`);
32
+ }
33
+ if (internalWidth.value === 'full') {
34
+ classNames.push(`${DEFAULT_PREFIX}-modal-fullscreen`);
35
+ }
36
+ return classNames;
37
+ });
38
+
39
+ const title = computed(() => {
40
+ const val = props.title;
41
+ if (val == null) {
42
+ return '对话框';
43
+ }
44
+ return val;
45
+ });
46
+
8
47
  const width = computed(() => {
9
- const _width = props.width;
10
- if (isString(_width)) {
11
- const realWidth = ModalWidth[_width.toLowerCase()];
48
+ if (internalWidth.value != null) {
49
+ return ModalWidth[internalWidth.value];
50
+ }
51
+ const width = props.width;
52
+ if (width == null) {
53
+ return ModalWidth.small;
54
+ }
55
+ if (isString(width)) {
56
+ const realWidth = ModalWidth[width.toLowerCase()];
12
57
  if (realWidth) {
13
58
  return null;
14
59
  }
15
60
  }
16
- return _width;
61
+ return StyleHelper.px(width);
17
62
  });
18
63
 
19
64
  const widthClassSuffix = computed(() => {
20
- const _width = props.width;
21
- if (isString(_width)) {
22
- const realWidth = ModalWidth[_width.toLowerCase()];
65
+ const width = internalWidth.value || props.width;
66
+ if (isString(width)) {
67
+ const realWidth = ModalWidth[width.toLowerCase()];
23
68
  if (realWidth) {
24
- return _width.toLowerCase();
69
+ return width.toLowerCase();
25
70
  }
26
71
  }
27
72
  return undefined;
28
73
  });
29
74
 
30
- const heightClassSuffix = computed(() => {
75
+ const height = computed(() => {
76
+ if (internalHeight.value != null) {
77
+ return ModalHeight[internalHeight.value];
78
+ }
31
79
  const height = props.height;
80
+ if (height == null) {
81
+ return undefined;
82
+ }
83
+ if (isString(height)) {
84
+ const realHeight = ModalHeight[height.toLowerCase()];
85
+ if (realHeight) {
86
+ return null;
87
+ }
88
+ }
89
+ return StyleHelper.px(height);
90
+ });
91
+
92
+ const heightClassSuffix = computed(() => {
93
+ const height = internalHeight.value || props.height;
32
94
  if (isString(height)) {
33
95
  const realHeight = ModalHeight[height.toLowerCase()];
34
96
  if (realHeight) {
@@ -38,21 +100,49 @@ export function useModal(props, context) {
38
100
  return undefined;
39
101
  });
40
102
 
41
- const heightPx = computed(() => StyleHelper.px(props.height));
42
- const customHeightClassSuffix = computed(() => {
43
- if (!heightClassSuffix.value) {
44
- return !!heightPx.value ? 'custom' : null;
103
+ /**
104
+ * 全屏切换
105
+ */
106
+ const onFullSwitch = () => {
107
+ displayAs.value = PopupDisplayAs.modal;
108
+ if (isFullScreen.value) {
109
+ internalHeight.value = undefined;
110
+ internalWidth.value = undefined;
111
+ isFullScreen.value = false;
112
+ } else {
113
+ isFullScreen.value = true;
114
+ internalHeight.value = 'full';
115
+ internalWidth.value = 'full';
45
116
  }
117
+ };
46
118
 
47
- return null;
48
- });
119
+ /**
120
+ * 弹窗展示模式切换
121
+ */
122
+ const onDisplayAsSwitch = () => {
123
+ internalHeight.value = undefined;
124
+ internalWidth.value = undefined;
125
+ isFullScreen.value = false;
126
+
127
+ if (displayAs.value === PopupDisplayAs.modal) {
128
+ displayAs.value = PopupDisplayAs.drawer;
129
+ internalHeight.value = 'full';
130
+ } else {
131
+ displayAs.value = PopupDisplayAs.modal;
132
+ internalHeight.value = undefined;
133
+ }
134
+ };
49
135
 
50
136
  return {
51
137
  ...usePopup(props, context),
138
+ title,
52
139
  width,
53
140
  widthClassSuffix,
141
+ height,
54
142
  heightClassSuffix,
55
- customHeightClassSuffix,
56
- heightPx
143
+ isFullScreen,
144
+ drawerModalClassName,
145
+ onFullSwitch,
146
+ onDisplayAsSwitch
57
147
  };
58
148
  }
@@ -6,6 +6,7 @@ export interface SelectItem<T = unknown> {
6
6
  label: string;
7
7
  state?: EnumOptionState;
8
8
  disabled?: boolean;
9
+ icon?: string;
9
10
  data: T;
10
11
  }
11
12
 
@@ -14,6 +15,7 @@ export interface SelectProperties {
14
15
  keyProp: string;
15
16
  labelProp: string;
16
17
  disabledProp: string;
18
+ iconProp?: string;
17
19
  filterProp: string;
18
20
  }
19
21
 
@@ -22,6 +24,7 @@ export const defaultSelectProperties: SelectProperties = {
22
24
  keyProp: 'key',
23
25
  labelProp: 'label',
24
26
  disabledProp: 'disabled',
27
+ iconProp: 'icon',
25
28
  filterProp: 'label'
26
29
  };
27
30
 
@@ -77,6 +77,10 @@ export const OioSelectProps = {
77
77
  dropdownClassName: {
78
78
  type: [String, Array] as PropType<string | string[]>
79
79
  },
80
+ dropdownVisible: {
81
+ type: Boolean,
82
+ default: undefined
83
+ },
80
84
  getTriggerContainer: {
81
85
  type: Function as PropType<(triggerNode: Node | HTMLElement) => Node | HTMLElement>
82
86
  }
@@ -1,2 +1,3 @@
1
1
  export * from './context';
2
2
  export * from './props';
3
+ export * from './typing';
@@ -1,5 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { OioBaseContainerProps, OioComponentData } from '../../typing';
3
+ import { OioTabsBizStyle } from './typing';
3
4
 
4
5
  export const DEFAULT_TABS_TITLE = '选项卡';
5
6
 
@@ -93,6 +94,9 @@ export const OioTabsProps = {
93
94
  },
94
95
  type: {
95
96
  type: String as PropType<OioTabsType | keyof typeof OioTabsType>
97
+ },
98
+ bizStyle: {
99
+ type: String as PropType<OioTabsBizStyle>
96
100
  }
97
101
  };
98
102
 
@@ -0,0 +1,5 @@
1
+ export enum OioTabsBizStyle {
2
+ Simple = 'style1', // 简约风格
3
+ AccentCard = 'style2', // 卡片上方高亮
4
+ Card = 'style3' // 普通卡片
5
+ }
@@ -1,5 +1,5 @@
1
+ import { OioTreeNode } from '@oinone/kunlun-shared';
1
2
  import { OioEvent } from '../../event';
2
- import { OioTreeNode } from './props';
3
3
 
4
4
  /**
5
5
  * 树节点选中事件
@@ -1,43 +1,7 @@
1
- import { CSSStyle, StandardTreeNode } from '@oinone/kunlun-shared';
1
+ import { OioTreeNode } from '@oinone/kunlun-shared';
2
2
  import { PropType } from 'vue';
3
3
  import { OioSpinProps } from '../oio-spin';
4
4
 
5
- export interface OioTreeNode<T = unknown> extends StandardTreeNode<T, OioTreeNode<T>> {
6
- class?: string | string[];
7
- style?: CSSStyle;
8
- title?: string;
9
- value: T;
10
-
11
- /**
12
- * 正在加载更多状态
13
- */
14
- loadingMore?: boolean;
15
- /**
16
- * 预加载
17
- */
18
- preloaded?: boolean;
19
- /**
20
- * 已加载(不再查询子节点)
21
- */
22
- loaded?: boolean;
23
- /**
24
- * 正在加载状态
25
- */
26
- loading?: boolean;
27
- /**
28
- * 是否显示checkbox, 默认: true
29
- */
30
- checkbox?: boolean;
31
- /**
32
- * 是否可选择, 默认: true
33
- */
34
- selectable?: boolean;
35
- /**
36
- * 是否禁用
37
- */
38
- disabled?: boolean;
39
- }
40
-
41
5
  const OioTreeSelectProps = {
42
6
  selectable: {
43
7
  type: Boolean,
@@ -1 +1,2 @@
1
1
  export * from './props';
2
+ export * from './usePopup';
@@ -1,6 +1,11 @@
1
1
  import { ReturnPromise, ReturnVoid } from '@oinone/kunlun-shared';
2
2
  import { PropType } from 'vue';
3
3
 
4
+ export enum PopupDisplayAs {
5
+ drawer = 'drawer',
6
+ modal = 'modal'
7
+ }
8
+
4
9
  export const VcPopupAppearanceProps = {
5
10
  zIndex: {
6
11
  type: Number,
@@ -45,6 +50,9 @@ export const VcPopupControlProps = {
45
50
  type: Boolean,
46
51
  default: undefined
47
52
  },
53
+ 'onUpdate:visible': {
54
+ type: Function as PropType<(val: boolean) => void>
55
+ },
48
56
  closable: {
49
57
  type: Boolean,
50
58
  default: undefined
@@ -53,6 +61,12 @@ export const VcPopupControlProps = {
53
61
  type: Boolean,
54
62
  default: undefined
55
63
  },
64
+ displayAs: {
65
+ type: String as PropType<keyof typeof PopupDisplayAs>
66
+ },
67
+ 'onUpdate:displayAs': {
68
+ type: Function as PropType<(val: keyof typeof PopupDisplayAs) => void>
69
+ },
56
70
  destroyOnClose: {
57
71
  type: Boolean,
58
72
  default: undefined
@@ -27,10 +27,12 @@ export function usePopup(props, context) {
27
27
 
28
28
  const enter = (event: PointerEvent) => {
29
29
  callback(event, props.enterCallback);
30
+ context.emit('enter', event);
30
31
  };
31
32
 
32
33
  const cancel = (event: PointerEvent) => {
33
34
  callback(event, props.cancelCallback);
35
+ context.emit('cancel', event);
34
36
  };
35
37
 
36
38
  const callback = (