vxe-design 3.0.0 → 3.0.1

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 (121) hide show
  1. package/README.md +2 -4
  2. package/es/components.js +2 -1
  3. package/es/flow-design/index.js +3 -1
  4. package/es/flow-design/src/flow-design.js +2 -1
  5. package/es/flow-design/src/flow-view.js +2 -1
  6. package/es/flow-view/index.js +3 -1
  7. package/es/form-design/index.js +3 -1
  8. package/es/form-design/src/form-design.js +42 -2
  9. package/es/form-design/src/form-view.js +2 -1
  10. package/es/form-design/style.css +12 -4
  11. package/es/form-design/style.min.css +1 -1
  12. package/es/form-view/index.js +4 -2
  13. package/es/index.esm.js +2 -2
  14. package/es/list-design/index.js +3 -1
  15. package/es/list-design/src/list-design.js +2 -1
  16. package/es/list-design/src/list-view.js +2 -1
  17. package/es/list-design/style.css +218 -0
  18. package/es/list-design/style.min.css +1 -1
  19. package/es/list-view/index.js +4 -2
  20. package/es/style.css +1 -1
  21. package/es/style.min.css +1 -1
  22. package/es/ui/index.js +5 -3
  23. package/es/ui/src/depend.js +14 -0
  24. package/es/ui/src/dom.js +2 -2
  25. package/es/ui/src/log.js +15 -4
  26. package/es/ui/src/utils.js +2 -1
  27. package/es/vxe-form-design/style.css +12 -4
  28. package/es/vxe-form-design/style.min.css +1 -1
  29. package/es/vxe-list-design/style.css +218 -0
  30. package/es/vxe-list-design/style.min.css +1 -1
  31. package/helper/vetur/attributes.json +1 -1
  32. package/helper/vetur/tags.json +1 -1
  33. package/lib/components.js +6 -5
  34. package/lib/components.min.js +1 -1
  35. package/lib/flow-design/index.js +6 -4
  36. package/lib/flow-design/index.min.js +1 -1
  37. package/lib/flow-design/src/flow-design.js +3 -2
  38. package/lib/flow-design/src/flow-design.min.js +1 -1
  39. package/lib/flow-design/src/flow-view.js +3 -2
  40. package/lib/flow-design/src/flow-view.min.js +1 -1
  41. package/lib/flow-view/index.js +6 -4
  42. package/lib/flow-view/index.min.js +1 -1
  43. package/lib/form-design/index.js +6 -4
  44. package/lib/form-design/index.min.js +1 -1
  45. package/lib/form-design/src/form-design.js +59 -4
  46. package/lib/form-design/src/form-design.min.js +1 -1
  47. package/lib/form-design/src/form-view.js +3 -2
  48. package/lib/form-design/src/form-view.min.js +1 -1
  49. package/lib/form-design/style/style.css +12 -4
  50. package/lib/form-design/style/style.min.css +1 -1
  51. package/lib/form-view/index.js +6 -4
  52. package/lib/form-view/index.min.js +1 -1
  53. package/lib/index.common.js +6 -7
  54. package/lib/index.umd.js +3995 -3539
  55. package/lib/index.umd.min.js +1 -1
  56. package/lib/list-design/index.js +6 -4
  57. package/lib/list-design/index.min.js +1 -1
  58. package/lib/list-design/src/list-design.js +3 -2
  59. package/lib/list-design/src/list-design.min.js +1 -1
  60. package/lib/list-design/src/list-view.js +3 -2
  61. package/lib/list-design/src/list-view.min.js +1 -1
  62. package/lib/list-design/style/style.css +218 -0
  63. package/lib/list-design/style/style.min.css +1 -1
  64. package/lib/list-view/index.js +6 -4
  65. package/lib/list-view/index.min.js +1 -1
  66. package/lib/style.css +1 -1
  67. package/lib/style.min.css +1 -1
  68. package/lib/ui/index.js +10 -7
  69. package/lib/ui/index.min.js +1 -1
  70. package/lib/ui/src/depend.js +19 -0
  71. package/lib/ui/src/depend.min.js +1 -0
  72. package/lib/ui/src/dom.js +2 -2
  73. package/lib/ui/src/dom.min.js +1 -1
  74. package/lib/ui/src/log.js +16 -4
  75. package/lib/ui/src/log.min.js +1 -1
  76. package/lib/ui/src/utils.js +3 -2
  77. package/lib/ui/src/utils.min.js +1 -1
  78. package/lib/vxe-flow-design/index.js +1 -2
  79. package/lib/vxe-flow-design/index.min.js +1 -1
  80. package/lib/vxe-flow-view/index.js +1 -2
  81. package/lib/vxe-flow-view/index.min.js +1 -1
  82. package/lib/vxe-form-design/index.js +1 -2
  83. package/lib/vxe-form-design/index.min.js +1 -1
  84. package/lib/vxe-form-design/style/style.css +12 -4
  85. package/lib/vxe-form-design/style/style.min.css +1 -1
  86. package/lib/vxe-form-view/index.js +1 -2
  87. package/lib/vxe-form-view/index.min.js +1 -1
  88. package/lib/vxe-list-design/index.js +1 -2
  89. package/lib/vxe-list-design/index.min.js +1 -1
  90. package/lib/vxe-list-design/style/style.css +218 -0
  91. package/lib/vxe-list-design/style/style.min.css +1 -1
  92. package/lib/vxe-list-view/index.js +1 -2
  93. package/lib/vxe-list-view/index.min.js +1 -1
  94. package/lib/vxe-ui/index.js +1 -2
  95. package/lib/vxe-ui/index.min.js +1 -1
  96. package/package.json +4 -8
  97. package/packages/components.ts +5 -1
  98. package/packages/flow-design/index.ts +3 -1
  99. package/packages/flow-design/src/flow-design.ts +3 -1
  100. package/packages/flow-design/src/flow-view.ts +3 -1
  101. package/packages/flow-view/index.ts +3 -1
  102. package/packages/form-design/index.ts +3 -1
  103. package/packages/form-design/src/form-design.ts +44 -3
  104. package/packages/form-design/src/form-view.ts +3 -1
  105. package/packages/form-view/index.ts +4 -2
  106. package/packages/index.ts +2 -2
  107. package/packages/list-design/index.ts +3 -1
  108. package/packages/list-design/src/list-design.ts +3 -1
  109. package/packages/list-design/src/list-view.ts +3 -1
  110. package/packages/list-view/index.ts +4 -2
  111. package/packages/ui/index.ts +5 -2
  112. package/packages/ui/src/depend.ts +14 -0
  113. package/packages/ui/src/dom.ts +2 -2
  114. package/packages/ui/src/log.ts +17 -4
  115. package/packages/ui/src/utils.ts +3 -1
  116. package/packages/ui/src/vn.ts +1 -1
  117. package/styles/components/form-design.scss +12 -4
  118. package/styles/components/list-design.scss +3 -0
  119. package/styles/components/list-item/list-item-field-column.scss +3 -3
  120. package/styles/helpers/baseMixin.scss +12 -3
  121. package/types/all.d.ts +42 -1
@@ -1,11 +1,13 @@
1
1
  import { CreateElement, VNode } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
- import { createEvent } from 'vxe-pc-ui'
4
+ import { VxeUI } from '@vxe-ui/core'
5
5
 
6
6
  import type { ValueOf } from 'vxe-pc-ui'
7
7
  import type { FormViewReactData, VxeFormViewEmits } from '../../../types'
8
8
 
9
+ const { createEvent } = VxeUI
10
+
9
11
  export default /* define-vxe-component start */ defineVxeComponent({
10
12
  name: 'VxeFormView',
11
13
  props: {
@@ -1,9 +1,11 @@
1
1
  import { VueConstructor } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import { checkDependVersion } from '../ui/src/depend'
3
4
  import VxeFormViewComponent from '../form-design/src/form-view'
4
5
 
5
6
  export const VxeFormView = Object.assign(VxeFormViewComponent, {
6
- install: function (app: VueConstructor) {
7
+ install (app: VueConstructor) {
8
+ checkDependVersion()
7
9
  app.component(VxeFormViewComponent.name as string, VxeFormViewComponent)
8
10
  }
9
11
  })
package/packages/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- import * as VxeUIExport from './components'
1
+ import * as VxeUIDesignExport from './components'
2
2
 
3
3
  export * from './components'
4
4
 
5
5
  /**
6
6
  * A vue based PC component library
7
7
  */
8
- export default VxeUIExport
8
+ export default VxeUIDesignExport
@@ -1,9 +1,11 @@
1
1
  import { VueConstructor } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import { checkDependVersion } from '../ui/src/depend'
3
4
  import VxeListDesignComponent from './src/list-design'
4
5
 
5
6
  export const VxeListDesign = Object.assign({}, VxeListDesignComponent, {
6
7
  install (app: VueConstructor) {
8
+ checkDependVersion()
7
9
  app.component(VxeListDesignComponent.name as string, VxeListDesignComponent)
8
10
  }
9
11
  })
@@ -1,11 +1,13 @@
1
1
  import { CreateElement, VNode } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
- import { createEvent } from 'vxe-pc-ui'
4
+ import { VxeUI } from '@vxe-ui/core'
5
5
 
6
6
  import type { ValueOf } from 'vxe-pc-ui'
7
7
  import type { ListDesignReactData, VxeListDesignDefines, VxeListDesignEmits } from '../../../types'
8
8
 
9
+ const { createEvent } = VxeUI
10
+
9
11
  export default /* define-vxe-component start */ defineVxeComponent({
10
12
  name: 'VxeListDesign',
11
13
  props: {
@@ -1,11 +1,13 @@
1
1
  import { CreateElement, VNode } from 'vue'
2
2
  import { defineVxeComponent } from '../../ui/src/comp'
3
3
  import XEUtils from 'xe-utils'
4
- import { createEvent } from 'vxe-pc-ui'
4
+ import { VxeUI } from '@vxe-ui/core'
5
5
 
6
6
  import type { ValueOf } from 'vxe-pc-ui'
7
7
  import type { ListViewReactData, VxeListDesignDefines, VxeListViewEmits } from '../../../types'
8
8
 
9
+ const { createEvent } = VxeUI
10
+
9
11
  export default /* define-vxe-component start */ defineVxeComponent({
10
12
  name: 'VxeListView',
11
13
  props: {
@@ -1,9 +1,11 @@
1
1
  import { VueConstructor } from 'vue'
2
- import { VxeUI } from 'vxe-pc-ui'
2
+ import { VxeUI } from '@vxe-ui/core'
3
+ import { checkDependVersion } from '../ui/src/depend'
3
4
  import VxeListViewComponent from '../list-design/src/list-view'
4
5
 
5
6
  export const VxeListView = Object.assign(VxeListViewComponent, {
6
- install: function (app: VueConstructor) {
7
+ install (app: VueConstructor) {
8
+ checkDependVersion()
7
9
  app.component(VxeListViewComponent.name as string, VxeListViewComponent)
8
10
  }
9
11
  })
@@ -1,4 +1,6 @@
1
- import { VxeUI, setConfig, setIcon } from 'vxe-pc-ui'
1
+ import { VxeUI } from '@vxe-ui/core'
2
+
3
+ const { setConfig, setIcon } = VxeUI
2
4
 
3
5
  VxeUI.designVersion = process.env.VUE_APP_VXE_VERSION as string
4
6
 
@@ -6,7 +8,8 @@ setConfig({
6
8
  formDesign: {
7
9
  height: 400,
8
10
  showHeader: true,
9
- showPc: true
11
+ showPc: true,
12
+ showStyleSetting: false
10
13
  },
11
14
  formView: {},
12
15
  listDesign: {
@@ -0,0 +1,14 @@
1
+ import { VxeUI } from '@vxe-ui/core'
2
+ import { errLog } from './log'
3
+
4
+ export function checkDependVersion () {
5
+ const pVersion = 3
6
+ const sVersion = 13
7
+ if (VxeUI.checkVersion) {
8
+ if (!VxeUI.checkVersion(VxeUI.tableVersion, pVersion, sVersion)) {
9
+ errLog('vxe.error.errorVersion', [`vxe-table@${VxeUI.tableVersion || '?'}`, `vxe-table v${pVersion}.${sVersion}+`])
10
+ }
11
+ } else {
12
+ errLog(`Requires vxe-table v${pVersion}.${sVersion}+`)
13
+ }
14
+ }
@@ -43,11 +43,11 @@ function getNodeOffset (elem: any, container: any, rest: any): any {
43
43
  }
44
44
 
45
45
  export function isPx (val: any) {
46
- return val && /^\d+(px)?$/.test(val)
46
+ return val && /^\d+(\.\d+)?(px)?$/.test(val)
47
47
  }
48
48
 
49
49
  export function isScale (val: any) {
50
- return val && /^\d+%$/.test(val)
50
+ return val && /^\d+(\.\d+)?%$/.test(val)
51
51
  }
52
52
 
53
53
  export function hasClass (elem: any, cls: any) {
@@ -1,6 +1,19 @@
1
- import { log } from 'vxe-pc-ui'
1
+ import { VxeUI } from '@vxe-ui/core'
2
2
 
3
- const version = `ui v${process.env.VUE_APP_VXE_VERSION}`
3
+ const { log } = VxeUI
4
4
 
5
- export const warnLog = log.create('warn', version)
6
- export const errLog = log.create('error', version)
5
+ const designVersion = `design v${process.env.VUE_APP_VXE_VERSION}`
6
+
7
+ export function createComponentLog (name: string) {
8
+ const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : ''
9
+ const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : ''
10
+ const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : ''
11
+ const versionInfo = [uiVersion, tableVersion, ganttVersion, designVersion].join(' ')
12
+ return {
13
+ warnLog: log.create('warn', versionInfo + '] [' + name),
14
+ errLog: log.create('error', versionInfo + '] [' + name)
15
+ }
16
+ }
17
+
18
+ export const warnLog = log.create('warn', designVersion)
19
+ export const errLog = log.create('error', designVersion)
@@ -1,7 +1,9 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { getConfig } from 'vxe-pc-ui'
2
+ import { VxeUI } from '@vxe-ui/core'
3
3
  import DomZIndex from 'dom-zindex'
4
4
 
5
+ const { getConfig } = VxeUI
6
+
5
7
  export function isEnableConf (conf: any): boolean {
6
8
  return conf && conf.enabled !== false
7
9
  }
@@ -1,7 +1,7 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { VxeComponentSlotType } from 'vxe-pc-ui'
3
2
 
4
3
  import type { CombinedVueInstance } from 'vue/types/vue'
4
+ import type { VxeComponentSlotType } from 'vxe-pc-ui'
5
5
 
6
6
  export function getOnName (type: string) {
7
7
  return XEUtils.kebabCase(type)
@@ -41,6 +41,7 @@
41
41
  min-height: 3em;
42
42
  border: 1px solid var(--vxe-ui-input-border-color);
43
43
  border-radius: var(--vxe-ui-base-border-radius);
44
+ overflow: hidden;
44
45
  }
45
46
  .vxe-form-design--header-left,
46
47
  .vxe-form-design--header-right {
@@ -48,6 +49,7 @@
48
49
  }
49
50
  .vxe-form-design--header-middle {
50
51
  flex-grow: 1;
52
+ overflow: auto;
51
53
  }
52
54
  .vxe-form-design--header-right {
53
55
  display: flex;
@@ -184,6 +186,9 @@
184
186
  }
185
187
  .vxe-form-design--widget-box {
186
188
  position: relative;
189
+ display: flex;
190
+ flex-direction: row;
191
+ align-items: center;
187
192
  height: 32px;
188
193
  line-height: 32px;
189
194
  font-size: var(--vxe-ui-form-design-widget-item-font-size);
@@ -192,8 +197,6 @@
192
197
  border: 1px solid var(--vxe-ui-input-border-color);
193
198
  background-color: var(--vxe-ui-layout-background-color);
194
199
  overflow: hidden;
195
- text-overflow: ellipsis;
196
- white-space: nowrap;
197
200
  cursor: grabbing;
198
201
  user-select: none;
199
202
  &:hover {
@@ -205,18 +208,23 @@
205
208
  }
206
209
  }
207
210
  .vxe-form-design--widget-item-icon {
211
+ flex-shrink: 0;
208
212
  padding: 0 0.2em;
209
213
  }
210
214
  .vxe-form-design--widget-item-name {
211
- padding-left: var(--vxe-ui-layout-padding-half);
215
+ padding: 0 var(--vxe-ui-layout-padding-half);
216
+ overflow: hidden;
217
+ text-overflow: ellipsis;
218
+ white-space: nowrap;
212
219
  }
213
220
  .vxe-form-design--widget-item-add {
214
221
  display: none;
215
222
  position: absolute;
216
223
  top: 0;
217
224
  right: var(--vxe-ui-layout-padding-default);
218
- width: 1em;
225
+ width: 1.2em;
219
226
  height: 100%;
227
+ text-align: center;
220
228
  cursor: pointer;
221
229
  &:hover {
222
230
  color: var(--vxe-ui-font-primary-color);
@@ -1,3 +1,6 @@
1
+
2
+ @use './list-item/list-item-all.scss';
3
+
1
4
  .vxe-list-design {
2
5
  position: relative;
3
6
  display: flex;
@@ -1,10 +1,10 @@
1
1
  @use '../../helpers/baseMixin.scss';
2
2
 
3
3
  .vxe-list-design--field-checkbox-option {
4
- overflow: hidden;
5
- text-overflow: ellipsis;
4
+ display: inline-flex;
5
+ vertical-align: middle;
6
6
  white-space: nowrap;
7
- flex-grow: 1;
7
+ line-height: 1;
8
8
  @include baseMixin.createCheckboxIcon();
9
9
  }
10
10
  .vxe-list-design--field-option-inner {
@@ -3,6 +3,9 @@
3
3
  }
4
4
 
5
5
  @mixin createCheckboxIcon {
6
+ & {
7
+ cursor: pointer;
8
+ }
6
9
  .vxe-checkbox--icon {
7
10
  font-size: 1.22em;
8
11
  }
@@ -20,7 +23,6 @@
20
23
  }
21
24
  }
22
25
  &:not(.is--disabled) {
23
- cursor: pointer;
24
26
  &:hover {
25
27
  .vxe-checkbox--icon {
26
28
  color: var(--vxe-ui-font-primary-color);
@@ -30,6 +32,9 @@
30
32
  &.is--hidden {
31
33
  cursor: default;
32
34
  }
35
+ &.is--readonly {
36
+ cursor: auto;
37
+ }
33
38
  &.is--disabled {
34
39
  color: var(--vxe-ui-font-disabled-color);
35
40
  cursor: not-allowed;
@@ -44,7 +49,9 @@
44
49
  }
45
50
 
46
51
  @mixin createRadioIcon {
47
- cursor: pointer;
52
+ & {
53
+ cursor: pointer;
54
+ }
48
55
  .vxe-radio--icon {
49
56
  font-size: 1.26em;
50
57
  }
@@ -62,13 +69,15 @@
62
69
  }
63
70
  }
64
71
  &:not(.is--disabled) {
65
- cursor: pointer;
66
72
  &:hover {
67
73
  .vxe-radio--icon {
68
74
  color: var(--vxe-ui-font-primary-color);
69
75
  }
70
76
  }
71
77
  }
78
+ &.is--readonly {
79
+ cursor: auto;
80
+ }
72
81
  &.is--disabled {
73
82
  color: var(--vxe-ui-font-disabled-color);
74
83
  cursor: not-allowed;
package/types/all.d.ts CHANGED
@@ -1,5 +1,12 @@
1
1
  import { VueConstructor } from 'vue'
2
- import { VxeUIExport, VxeGlobalConfig } from 'vxe-pc-ui'
2
+ import { VxeUIExport, VxeGlobalConfig, VxeComponentKebabCaseKeys } from 'vxe-pc-ui'
3
+
4
+ import VxeFlowDesign from 'vxe-pc-ui/types/components/flow-design'
5
+ import VxeFlowView from 'vxe-pc-ui/types/components/flow-view'
6
+ import VxeFormDesign from 'vxe-pc-ui/types/components/form-design'
7
+ import VxeFormView from 'vxe-pc-ui/types/components/form-view'
8
+ import VxeListDesign from 'vxe-pc-ui/types/components/list-design'
9
+ import VxeListView from 'vxe-pc-ui/types/components/list-view'
3
10
 
4
11
  declare global {
5
12
  interface Window {
@@ -9,6 +16,40 @@ declare global {
9
16
 
10
17
  export function install (app: VueConstructor, options?: VxeGlobalConfig): void
11
18
 
19
+ interface AllComponents {
20
+ /**
21
+ * FlowDesign 流程设计器
22
+ */
23
+ VxeFlowDesign: typeof VxeFlowDesign
24
+ /**
25
+ * FlowView 流程设计器 - 视图
26
+ */
27
+ VxeFlowView: typeof VxeFlowView
28
+ /**
29
+ * FormDesign 表单设计器
30
+ */
31
+ VxeFormDesign: typeof VxeFormDesign
32
+ /**
33
+ * FormView 表单设计器 - 视图
34
+ */
35
+ VxeFormView: typeof VxeFormView
36
+ /**
37
+ * ListDesign 列表设计器
38
+ */
39
+ VxeListDesign: typeof VxeListDesign
40
+ /**
41
+ * ListView 列表设计器 - 视图
42
+ */
43
+ VxeListView: typeof VxeListView
44
+ }
45
+
46
+ declare module '@vxe-ui/core' {
47
+ export interface VxeGlobalComponents extends AllComponents, VxeComponentKebabCaseKeys<AllComponents> {}
48
+ }
49
+
50
+ // Vxe core
51
+ export * from 'vxe-pc-ui/types/ui'
52
+
12
53
  // Vxe Design
13
54
  export * from 'vxe-pc-ui/types/components/flow-design'
14
55
  export * from 'vxe-pc-ui/types/components/flow-view'