iov-pro-components 0.0.3

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 (133) hide show
  1. package/.eslintignore +5 -0
  2. package/.eslintrc.js +192 -0
  3. package/.gitignore +3 -0
  4. package/README.md +4 -0
  5. package/babel.config.js +5 -0
  6. package/docs/.vuepress/config.js +169 -0
  7. package/docs/.vuepress/styles/index.styl +62 -0
  8. package/docs/.vuepress/styles/palette.styl +20 -0
  9. package/docs/.vuepress/theme/enhanceApp.js +100 -0
  10. package/docs/.vuepress/theme/index.js +3 -0
  11. package/docs/README.md +13 -0
  12. package/docs/components/description.md +519 -0
  13. package/docs/components/dialog-select.md +91 -0
  14. package/docs/components/display.md +36 -0
  15. package/docs/components/enums.md +33 -0
  16. package/docs/components/icon.md +406 -0
  17. package/docs/components/link-group.md +39 -0
  18. package/docs/components/page-detail.md +48 -0
  19. package/docs/components/page-module.md +51 -0
  20. package/docs/components/pro-form.md +958 -0
  21. package/docs/components/pro-table.md +683 -0
  22. package/docs/components/request.md +44 -0
  23. package/docs/components/search-table.md +963 -0
  24. package/docs/components/space.md +35 -0
  25. package/docs/components/sub-title.md +24 -0
  26. package/docs/components/submit-module.md +24 -0
  27. package/docs/template/add.md +124 -0
  28. package/docs/template/confirm.md +28 -0
  29. package/docs/template/detail.md +240 -0
  30. package/docs/template/dialog.md +339 -0
  31. package/docs/template/list.md +464 -0
  32. package/docs/template/tabs-mini.md +32 -0
  33. package/docs/template/tabs.md +32 -0
  34. package/jsconfig.json +19 -0
  35. package/lib/iov-pro-components.css +1 -0
  36. package/lib/iov-pro-components.min.js +7 -0
  37. package/lib/postcss.config.js +8 -0
  38. package/package.json +75 -0
  39. package/patches/vue-server-renderer+2.7.16.patch +13 -0
  40. package/rollup.config.mjs +79 -0
  41. package/src/App.vue +103 -0
  42. package/src/main.js +33 -0
  43. package/src/packages/column-tooltip/index.js +7 -0
  44. package/src/packages/column-tooltip/src/main.vue +127 -0
  45. package/src/packages/description/index.js +7 -0
  46. package/src/packages/description/src/main.vue +375 -0
  47. package/src/packages/description/src/text.vue +103 -0
  48. package/src/packages/dialog-select/index.js +7 -0
  49. package/src/packages/dialog-select/src/main.vue +308 -0
  50. package/src/packages/display/index.js +7 -0
  51. package/src/packages/display/src/main.vue +44 -0
  52. package/src/packages/enums/index.js +7 -0
  53. package/src/packages/enums/src/main.vue +23 -0
  54. package/src/packages/export/index.js +7 -0
  55. package/src/packages/export/src/main.vue +316 -0
  56. package/src/packages/fixed-button-group/index.js +7 -0
  57. package/src/packages/fixed-button-group/src/main.vue +104 -0
  58. package/src/packages/form/index.js +7 -0
  59. package/src/packages/form/src/collapse.vue +149 -0
  60. package/src/packages/form/src/main.vue +1190 -0
  61. package/src/packages/form-collapse/index.js +7 -0
  62. package/src/packages/index.js +86 -0
  63. package/src/packages/link-group/index.js +7 -0
  64. package/src/packages/link-group/src/main.vue +52 -0
  65. package/src/packages/page-detail/index.js +7 -0
  66. package/src/packages/page-detail/src/main.vue +123 -0
  67. package/src/packages/page-module/index.js +7 -0
  68. package/src/packages/page-module/src/main.vue +56 -0
  69. package/src/packages/preview/index.js +7 -0
  70. package/src/packages/preview/src/eval-image-viewer.js +50 -0
  71. package/src/packages/preview/src/image-viewer.vue +366 -0
  72. package/src/packages/preview/src/main.vue +97 -0
  73. package/src/packages/request/index.js +7 -0
  74. package/src/packages/request/src/main.vue +125 -0
  75. package/src/packages/search-table/index.js +7 -0
  76. package/src/packages/search-table/src/inner-tabs.vue +237 -0
  77. package/src/packages/search-table/src/main.vue +472 -0
  78. package/src/packages/search-table/src/outer-tabs.vue +45 -0
  79. package/src/packages/search-table-inner-tabs/index.js +7 -0
  80. package/src/packages/search-table-outer-tabs/index.js +7 -0
  81. package/src/packages/space/index.js +7 -0
  82. package/src/packages/space/src/main.vue +74 -0
  83. package/src/packages/sub-title/index.js +7 -0
  84. package/src/packages/sub-title/src/main.vue +70 -0
  85. package/src/packages/submit-module/index.js +7 -0
  86. package/src/packages/submit-module/src/main.vue +67 -0
  87. package/src/packages/table/index.js +7 -0
  88. package/src/packages/table/src/filter.vue +89 -0
  89. package/src/packages/table/src/main.vue +668 -0
  90. package/src/packages/table/src/search.vue +90 -0
  91. package/src/packages/table/src/sort.vue +118 -0
  92. package/src/packages/theme/index.scss +15 -0
  93. package/src/packages/theme/src/column-tooltip.scss +23 -0
  94. package/src/packages/theme/src/common/color.scss +134 -0
  95. package/src/packages/theme/src/description.scss +56 -0
  96. package/src/packages/theme/src/dialog-select.scss +32 -0
  97. package/src/packages/theme/src/fixed-button-group.scss +25 -0
  98. package/src/packages/theme/src/form.scss +11 -0
  99. package/src/packages/theme/src/link-group.scss +43 -0
  100. package/src/packages/theme/src/page-detail.scss +61 -0
  101. package/src/packages/theme/src/page-module.scss +46 -0
  102. package/src/packages/theme/src/preview.scss +67 -0
  103. package/src/packages/theme/src/search-table.scss +185 -0
  104. package/src/packages/theme/src/space.scss +12 -0
  105. package/src/packages/theme/src/sub-title.scss +47 -0
  106. package/src/packages/theme/src/submit-module.scss +13 -0
  107. package/src/packages/theme/src/table.scss +129 -0
  108. package/src/packages/theme/src/toolbar.scss +109 -0
  109. package/src/packages/toolbar/index.js +7 -0
  110. package/src/packages/toolbar/src/main.vue +126 -0
  111. package/src/packages/toolbar/src/setting.vue +217 -0
  112. package/src/packages/toolbar/src/style.vue +68 -0
  113. package/src/packages/toolbar/src/zoom.vue +65 -0
  114. package/src/router.js +83 -0
  115. package/src/utils/config-center.js +218 -0
  116. package/src/utils/function-eval.js +84 -0
  117. package/src/utils/index.js +104 -0
  118. package/src/views/column-tooltip.vue +37 -0
  119. package/src/views/components/OtherSelect.vue +18 -0
  120. package/src/views/description.vue +60 -0
  121. package/src/views/detail.vue +146 -0
  122. package/src/views/directive/number.js +82 -0
  123. package/src/views/enums.vue +22 -0
  124. package/src/views/export.vue +9 -0
  125. package/src/views/form-collapse.vue +185 -0
  126. package/src/views/form.vue +402 -0
  127. package/src/views/link-group.vue +16 -0
  128. package/src/views/preview.vue +33 -0
  129. package/src/views/request.vue +56 -0
  130. package/src/views/search-table.vue +297 -0
  131. package/src/views/table.vue +145 -0
  132. package/src/views/toolbar.vue +30 -0
  133. package/vue.config.js +22 -0
@@ -0,0 +1,79 @@
1
+ import path from 'path'
2
+ import { fileURLToPath } from 'url'
3
+ import vue from 'rollup-plugin-vue'
4
+ import commonjs from '@rollup/plugin-commonjs'
5
+ import resolve from '@rollup/plugin-node-resolve'
6
+ import replace from '@rollup/plugin-replace'
7
+ import terser from '@rollup/plugin-terser'
8
+ import babel from '@rollup/plugin-babel'
9
+ import alias from '@rollup/plugin-alias'
10
+ import scss from 'rollup-plugin-scss'
11
+ import VueJsx from 'unplugin-vue-jsx/rollup'
12
+
13
+ // 获取当前文件的绝对路径
14
+ const __filename = fileURLToPath(import.meta.url)
15
+ // 获取当前目录路径
16
+ const __dirname = path.dirname(__filename)
17
+
18
+ export default {
19
+ input: 'src/packages/index.js',
20
+ external: ['vue', 'iov-design'],
21
+ output: {
22
+ dir: 'lib',
23
+ format: 'es',
24
+ entryFileNames: 'iov-pro-components.min.js'
25
+ },
26
+ treeshake: {
27
+ moduleSideEffects: false
28
+ },
29
+ plugins: [
30
+ alias({
31
+ entries: [
32
+ { find: '@', replacement: path.resolve(__dirname, 'src') }
33
+ ],
34
+ resolve: ['.vue', '.scss', '.js']
35
+ }),
36
+ VueJsx({ version: 2 }),
37
+ vue({
38
+ // 动态注入css到js中
39
+ css: false,
40
+ // 将template编译为render函数
41
+ compileTemplate: true
42
+ }),
43
+ scss({
44
+ fileName: 'iov-pro-components.css',
45
+ outputStyle: 'compressed'
46
+ }),
47
+ // 查找并打包node_modules中的第三方模块
48
+ resolve(),
49
+ babel({
50
+ presets: [
51
+ ['@vue/babel-preset-jsx', {
52
+ // 强制注入 h 函数
53
+ injectH: true
54
+ }]
55
+ ],
56
+ plugins: [
57
+ ['@babel/plugin-transform-runtime', {
58
+ corejs: false,
59
+ helpers: true,
60
+ useEsModules: true
61
+ }]
62
+ ],
63
+ exclude: 'node_modules/**',
64
+ extensions: ['.js', '.jsx', '.vue'],
65
+ babelHelpers: 'runtime'
66
+ }),
67
+ // 将 CommonJS 转换成 ES6 模块
68
+ commonjs(),
69
+ replace({
70
+ preventAssignment: true,
71
+ values: {
72
+ // 设置环境变量
73
+ 'process.env.NODE_ENV': JSON.stringify('production')
74
+ }
75
+ }),
76
+ // 压缩代码
77
+ terser()
78
+ ]
79
+ }
package/src/App.vue ADDED
@@ -0,0 +1,103 @@
1
+ <template>
2
+ <el-container class="iov-pro-components">
3
+ <el-header class="iov-pro-components__header">
4
+ <div class="iov-pro-components__logo">IOV Pro Components</div>
5
+ </el-header>
6
+ <el-container>
7
+ <el-aside
8
+ width="240px"
9
+ class="iov-pro-components__navbar"
10
+ >
11
+ <router-link
12
+ v-for="route in routes"
13
+ :key="route.path"
14
+ :to="route.path"
15
+ :class="{ 'is-actived': $route.path === route.path }"
16
+ class="iov-pro-components__nav-link"
17
+ >{{ route.meta.title }}</router-link>
18
+ </el-aside>
19
+ <el-container>
20
+ <el-main class="iov-pro-components__container">
21
+ <el-scrollbar>
22
+ <router-view />
23
+ </el-scrollbar>
24
+ </el-main>
25
+ </el-container>
26
+ </el-container>
27
+ </el-container>
28
+ </template>
29
+
30
+ <script>
31
+ export default {
32
+ name: 'App',
33
+ computed: {
34
+ routes() {
35
+ return this.$router.options.routes
36
+ }
37
+ }
38
+ }
39
+ </script>
40
+
41
+ <style lang="scss">
42
+ html, body {
43
+ padding: 0;
44
+ margin: 0;
45
+ }
46
+ .iov-pro-components {
47
+ display: flex;
48
+ width: 1280px;
49
+ height: 100vh;
50
+ margin: 0 auto;
51
+ &__header {
52
+ align-items: center;
53
+ border-bottom: 1px solid #E5E6EB;
54
+ display: flex;
55
+ }
56
+ &__logo {
57
+ align-items: center;
58
+ background: linear-gradient(#4A6FFF 0%, #2F48FF 100%);
59
+ box-shadow: inset 0px -2px 3px 0px rgba(223, 233, 255, 0.46);
60
+ border-radius: 4px;
61
+ color: #fff;
62
+ display: flex;
63
+ font-style: italic;
64
+ font-weight: 600;
65
+ height: 36px;
66
+ padding: 0 16px;
67
+ }
68
+ &__navbar.el-aside {
69
+ border-right: 1px solid #E5E6EB;
70
+ width: 240px;
71
+ padding: 12px 0;
72
+ overflow-x: hidden;
73
+ overflow-y: auto;
74
+ }
75
+ &__nav-link {
76
+ align-items: center;
77
+ color: #212026;
78
+ display: flex;
79
+ width: 100%;
80
+ height: 40px;
81
+ text-decoration: none;
82
+ padding: 0 12px;
83
+ &.is-actived {
84
+ background-color: #F0F4FD;
85
+ color: #2F48FF;
86
+ }
87
+ &:hover {
88
+ color: #2F48FF;
89
+ }
90
+ }
91
+ &__container.el-main {
92
+ flex: 1;
93
+ height: calc(100vh - 60px);
94
+ padding: 0;
95
+ .el-scrollbar {
96
+ height: 100%;
97
+ &__view {
98
+ padding: 12px;
99
+ }
100
+ }
101
+ }
102
+ }
103
+ </style>
package/src/main.js ADDED
@@ -0,0 +1,33 @@
1
+ import Vue from 'vue'
2
+ import VueRouter from 'vue-router'
3
+ import App from './App.vue'
4
+ import ElementUI from 'iov-design'
5
+ import router from './router'
6
+ import 'iov-design/lib/theme-chalk/index.css'
7
+ import './views/directive/number'
8
+
9
+ import IovProComponents from '@/packages'
10
+
11
+ Vue.use(VueRouter)
12
+
13
+ Vue.config.productionTip = false
14
+
15
+ Vue.use(ElementUI)
16
+ Vue.use(IovProComponents, {
17
+ preview: {
18
+ request: (params) => {
19
+ console.log(params)
20
+ return new Promise((resolve) => {
21
+ setTimeout(() => {
22
+ resolve('https://prod-common-public.obs-helf.cucloud.cn/mall/goods/893f1000000000114669556')
23
+ }, 1000)
24
+ })
25
+ },
26
+ cacheTime: 3600
27
+ }
28
+ })
29
+
30
+ new Vue({
31
+ render: h => h(App),
32
+ router
33
+ }).$mount('#app')
@@ -0,0 +1,7 @@
1
+ import ColumnTooltip from './src/main.vue'
2
+
3
+ ColumnTooltip.install = function(Vue) {
4
+ Vue.component(ColumnTooltip.name, ColumnTooltip)
5
+ }
6
+
7
+ export default ColumnTooltip
@@ -0,0 +1,127 @@
1
+ <script>
2
+ import { getComponentName } from '@/utils/config-center'
3
+
4
+ export default {
5
+ name: 'IovProColumnTooltip',
6
+ props: {
7
+ data: {
8
+ type: Array,
9
+ default: () => []
10
+ },
11
+ // 默认提供的主题
12
+ effect: {
13
+ type: String,
14
+ default: 'dark'
15
+ },
16
+ // Tooltip 的出现位置
17
+ placement: {
18
+ type: String,
19
+ default: 'top'
20
+ },
21
+ // 可显示的最大宽度
22
+ maxWidth: {
23
+ type: [Number, String],
24
+ default: 444
25
+ },
26
+ // 可显示的最大高度
27
+ maxHeight: {
28
+ type: [Number, String],
29
+ default: 134
30
+ },
31
+ // 超出显示
32
+ overflow: {
33
+ type: String,
34
+ default: 'hidden'
35
+ },
36
+ // 是否显示省略号
37
+ ellipsis: {
38
+ type: Boolean,
39
+ default: true
40
+ }
41
+ },
42
+ data() {
43
+ return {
44
+ showEllipsis: false,
45
+ visible: false
46
+ }
47
+ },
48
+ computed: {
49
+ /**
50
+ * 展示的文案
51
+ * @time 2024-10-10 11:43:53
52
+ */
53
+ displayText() {
54
+ return this.data.join('; ')
55
+ }
56
+ },
57
+ watch: {
58
+ /**
59
+ * 等待tooltip展示了后
60
+ * @time 2024-10-17 18:09:31
61
+ */
62
+ visible() {
63
+ // 等待data渲染完成后
64
+ this.$nextTick(() => {
65
+ // 如果当前没有,则不处理
66
+ if (!this.visible) {
67
+ return
68
+ }
69
+ // 总高度
70
+ const totalHeight = Array.from(
71
+ this.$refs.columnTooltipContent
72
+ .querySelectorAll('.iov-pro-column-tooltip__wrapper')
73
+ )
74
+ .reduce(
75
+ (memo, dom) => {
76
+ memo += dom.getBoundingClientRect().height
77
+ return memo
78
+ }, 0
79
+ )
80
+ // 如果总高度大于139,则显示省略号
81
+ this.showEllipsis = totalHeight > +this.maxHeight
82
+ })
83
+ }
84
+ },
85
+ render() {
86
+ // 如果数据不存在
87
+ if (!this.data || this.data.length === 0) {
88
+ return null
89
+ }
90
+ // 内容样式
91
+ const contentClassName = ['iov-pro-column-tooltip__container']
92
+ // 如果需要显示省略号
93
+ if (this.showEllipsis && this.ellipsis && this.overflow === 'hidden') {
94
+ contentClassName.push('ellipsis')
95
+ }
96
+ // 获取tooltip组件
97
+ const Tooltip = getComponentName('tooltip')
98
+ return (
99
+ <Tooltip
100
+ value={this.visible}
101
+ placement={this.placement}
102
+ effect={this.effect}
103
+ class='iov-pro-column-tooltip'
104
+ onInput={value => (this.visible = value)}
105
+ >
106
+ <div
107
+ slot='content'
108
+ ref='columnTooltipContent'
109
+ style={{
110
+ maxHeight: `${this.maxHeight}px`,
111
+ maxWidth: `${this.maxWidth}px`,
112
+ overflowY: this.overflow
113
+ }}
114
+ class={contentClassName.join(' ')}
115
+ >
116
+ { // 便利数据
117
+ this.data.map((item, index) => (
118
+ <div key={index} class='iov-pro-column-tooltip__wrapper'>{item}</div>
119
+ ))
120
+ }
121
+ </div>
122
+ <div class='iov-pro-column-tooltip__text'>{ this.displayText }</div>
123
+ </Tooltip>
124
+ )
125
+ }
126
+ }
127
+ </script>
@@ -0,0 +1,7 @@
1
+ import Description from './src/main.vue'
2
+
3
+ Description.install = function(Vue) {
4
+ Vue.component(Description.name, Description)
5
+ }
6
+
7
+ export default Description