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.
- package/.eslintignore +5 -0
- package/.eslintrc.js +192 -0
- package/.gitignore +3 -0
- package/README.md +4 -0
- package/babel.config.js +5 -0
- package/docs/.vuepress/config.js +169 -0
- package/docs/.vuepress/styles/index.styl +62 -0
- package/docs/.vuepress/styles/palette.styl +20 -0
- package/docs/.vuepress/theme/enhanceApp.js +100 -0
- package/docs/.vuepress/theme/index.js +3 -0
- package/docs/README.md +13 -0
- package/docs/components/description.md +519 -0
- package/docs/components/dialog-select.md +91 -0
- package/docs/components/display.md +36 -0
- package/docs/components/enums.md +33 -0
- package/docs/components/icon.md +406 -0
- package/docs/components/link-group.md +39 -0
- package/docs/components/page-detail.md +48 -0
- package/docs/components/page-module.md +51 -0
- package/docs/components/pro-form.md +958 -0
- package/docs/components/pro-table.md +683 -0
- package/docs/components/request.md +44 -0
- package/docs/components/search-table.md +963 -0
- package/docs/components/space.md +35 -0
- package/docs/components/sub-title.md +24 -0
- package/docs/components/submit-module.md +24 -0
- package/docs/template/add.md +124 -0
- package/docs/template/confirm.md +28 -0
- package/docs/template/detail.md +240 -0
- package/docs/template/dialog.md +339 -0
- package/docs/template/list.md +464 -0
- package/docs/template/tabs-mini.md +32 -0
- package/docs/template/tabs.md +32 -0
- package/jsconfig.json +19 -0
- package/lib/iov-pro-components.css +1 -0
- package/lib/iov-pro-components.min.js +7 -0
- package/lib/postcss.config.js +8 -0
- package/package.json +75 -0
- package/patches/vue-server-renderer+2.7.16.patch +13 -0
- package/rollup.config.mjs +79 -0
- package/src/App.vue +103 -0
- package/src/main.js +33 -0
- package/src/packages/column-tooltip/index.js +7 -0
- package/src/packages/column-tooltip/src/main.vue +127 -0
- package/src/packages/description/index.js +7 -0
- package/src/packages/description/src/main.vue +375 -0
- package/src/packages/description/src/text.vue +103 -0
- package/src/packages/dialog-select/index.js +7 -0
- package/src/packages/dialog-select/src/main.vue +308 -0
- package/src/packages/display/index.js +7 -0
- package/src/packages/display/src/main.vue +44 -0
- package/src/packages/enums/index.js +7 -0
- package/src/packages/enums/src/main.vue +23 -0
- package/src/packages/export/index.js +7 -0
- package/src/packages/export/src/main.vue +316 -0
- package/src/packages/fixed-button-group/index.js +7 -0
- package/src/packages/fixed-button-group/src/main.vue +104 -0
- package/src/packages/form/index.js +7 -0
- package/src/packages/form/src/collapse.vue +149 -0
- package/src/packages/form/src/main.vue +1190 -0
- package/src/packages/form-collapse/index.js +7 -0
- package/src/packages/index.js +86 -0
- package/src/packages/link-group/index.js +7 -0
- package/src/packages/link-group/src/main.vue +52 -0
- package/src/packages/page-detail/index.js +7 -0
- package/src/packages/page-detail/src/main.vue +123 -0
- package/src/packages/page-module/index.js +7 -0
- package/src/packages/page-module/src/main.vue +56 -0
- package/src/packages/preview/index.js +7 -0
- package/src/packages/preview/src/eval-image-viewer.js +50 -0
- package/src/packages/preview/src/image-viewer.vue +366 -0
- package/src/packages/preview/src/main.vue +97 -0
- package/src/packages/request/index.js +7 -0
- package/src/packages/request/src/main.vue +125 -0
- package/src/packages/search-table/index.js +7 -0
- package/src/packages/search-table/src/inner-tabs.vue +237 -0
- package/src/packages/search-table/src/main.vue +472 -0
- package/src/packages/search-table/src/outer-tabs.vue +45 -0
- package/src/packages/search-table-inner-tabs/index.js +7 -0
- package/src/packages/search-table-outer-tabs/index.js +7 -0
- package/src/packages/space/index.js +7 -0
- package/src/packages/space/src/main.vue +74 -0
- package/src/packages/sub-title/index.js +7 -0
- package/src/packages/sub-title/src/main.vue +70 -0
- package/src/packages/submit-module/index.js +7 -0
- package/src/packages/submit-module/src/main.vue +67 -0
- package/src/packages/table/index.js +7 -0
- package/src/packages/table/src/filter.vue +89 -0
- package/src/packages/table/src/main.vue +668 -0
- package/src/packages/table/src/search.vue +90 -0
- package/src/packages/table/src/sort.vue +118 -0
- package/src/packages/theme/index.scss +15 -0
- package/src/packages/theme/src/column-tooltip.scss +23 -0
- package/src/packages/theme/src/common/color.scss +134 -0
- package/src/packages/theme/src/description.scss +56 -0
- package/src/packages/theme/src/dialog-select.scss +32 -0
- package/src/packages/theme/src/fixed-button-group.scss +25 -0
- package/src/packages/theme/src/form.scss +11 -0
- package/src/packages/theme/src/link-group.scss +43 -0
- package/src/packages/theme/src/page-detail.scss +61 -0
- package/src/packages/theme/src/page-module.scss +46 -0
- package/src/packages/theme/src/preview.scss +67 -0
- package/src/packages/theme/src/search-table.scss +185 -0
- package/src/packages/theme/src/space.scss +12 -0
- package/src/packages/theme/src/sub-title.scss +47 -0
- package/src/packages/theme/src/submit-module.scss +13 -0
- package/src/packages/theme/src/table.scss +129 -0
- package/src/packages/theme/src/toolbar.scss +109 -0
- package/src/packages/toolbar/index.js +7 -0
- package/src/packages/toolbar/src/main.vue +126 -0
- package/src/packages/toolbar/src/setting.vue +217 -0
- package/src/packages/toolbar/src/style.vue +68 -0
- package/src/packages/toolbar/src/zoom.vue +65 -0
- package/src/router.js +83 -0
- package/src/utils/config-center.js +218 -0
- package/src/utils/function-eval.js +84 -0
- package/src/utils/index.js +104 -0
- package/src/views/column-tooltip.vue +37 -0
- package/src/views/components/OtherSelect.vue +18 -0
- package/src/views/description.vue +60 -0
- package/src/views/detail.vue +146 -0
- package/src/views/directive/number.js +82 -0
- package/src/views/enums.vue +22 -0
- package/src/views/export.vue +9 -0
- package/src/views/form-collapse.vue +185 -0
- package/src/views/form.vue +402 -0
- package/src/views/link-group.vue +16 -0
- package/src/views/preview.vue +33 -0
- package/src/views/request.vue +56 -0
- package/src/views/search-table.vue +297 -0
- package/src/views/table.vue +145 -0
- package/src/views/toolbar.vue +30 -0
- package/vue.config.js +22 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parserOptions: {
|
|
4
|
+
parser: 'babel-eslint',
|
|
5
|
+
sourceType: 'module'
|
|
6
|
+
},
|
|
7
|
+
env: {
|
|
8
|
+
browser: true,
|
|
9
|
+
node: true,
|
|
10
|
+
es6: true,
|
|
11
|
+
},
|
|
12
|
+
extends: ['plugin:vue/recommended', 'eslint:recommended'],
|
|
13
|
+
|
|
14
|
+
// add your custom rules here
|
|
15
|
+
//it is base on https://github.com/vuejs/eslint-config-vue
|
|
16
|
+
rules: {
|
|
17
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
18
|
+
"vue/multiline-html-element-content-newline":"off",
|
|
19
|
+
"vue/name-property-casing": ["error", "PascalCase"],
|
|
20
|
+
"vue/no-v-html": "off",
|
|
21
|
+
'accessor-pairs': 2,
|
|
22
|
+
'arrow-spacing': [2, {
|
|
23
|
+
'before': true,
|
|
24
|
+
'after': true
|
|
25
|
+
}],
|
|
26
|
+
'block-spacing': [2, 'always'],
|
|
27
|
+
'brace-style': [2, '1tbs', {
|
|
28
|
+
'allowSingleLine': true
|
|
29
|
+
}],
|
|
30
|
+
'camelcase': [0, {
|
|
31
|
+
'properties': 'always'
|
|
32
|
+
}],
|
|
33
|
+
'comma-dangle': [2, 'never'],
|
|
34
|
+
'comma-spacing': [2, {
|
|
35
|
+
'before': false,
|
|
36
|
+
'after': true
|
|
37
|
+
}],
|
|
38
|
+
'comma-style': [2, 'last'],
|
|
39
|
+
'constructor-super': 2,
|
|
40
|
+
'curly': [2, 'multi-line'],
|
|
41
|
+
'dot-location': [2, 'property'],
|
|
42
|
+
'eol-last': 2,
|
|
43
|
+
'eqeqeq': ["error", "always", {"null": "ignore"}],
|
|
44
|
+
'generator-star-spacing': [2, {
|
|
45
|
+
'before': true,
|
|
46
|
+
'after': true
|
|
47
|
+
}],
|
|
48
|
+
'handle-callback-err': [2, '^(err|error)$'],
|
|
49
|
+
'indent': [2, 2, {
|
|
50
|
+
'SwitchCase': 1
|
|
51
|
+
}],
|
|
52
|
+
'jsx-quotes': [2, 'prefer-single'],
|
|
53
|
+
'key-spacing': [2, {
|
|
54
|
+
'beforeColon': false,
|
|
55
|
+
'afterColon': true
|
|
56
|
+
}],
|
|
57
|
+
'keyword-spacing': [2, {
|
|
58
|
+
'before': true,
|
|
59
|
+
'after': true
|
|
60
|
+
}],
|
|
61
|
+
'new-cap': [2, {
|
|
62
|
+
'newIsCap': true,
|
|
63
|
+
'capIsNew': false
|
|
64
|
+
}],
|
|
65
|
+
'new-parens': 2,
|
|
66
|
+
'no-array-constructor': 2,
|
|
67
|
+
'no-caller': 2,
|
|
68
|
+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
69
|
+
'no-class-assign': 2,
|
|
70
|
+
'no-cond-assign': 2,
|
|
71
|
+
'no-const-assign': 2,
|
|
72
|
+
'no-control-regex': 0,
|
|
73
|
+
'no-delete-var': 2,
|
|
74
|
+
'no-dupe-args': 2,
|
|
75
|
+
'no-dupe-class-members': 2,
|
|
76
|
+
'no-dupe-keys': 2,
|
|
77
|
+
'no-duplicate-case': 2,
|
|
78
|
+
'no-empty-character-class': 2,
|
|
79
|
+
'no-empty-pattern': 2,
|
|
80
|
+
'no-eval': 2,
|
|
81
|
+
'no-ex-assign': 2,
|
|
82
|
+
'no-extend-native': 2,
|
|
83
|
+
'no-extra-bind': 2,
|
|
84
|
+
'no-extra-boolean-cast': 2,
|
|
85
|
+
'no-extra-parens': [2, 'functions'],
|
|
86
|
+
'no-fallthrough': 2,
|
|
87
|
+
'no-floating-decimal': 2,
|
|
88
|
+
'no-func-assign': 2,
|
|
89
|
+
'no-implied-eval': 2,
|
|
90
|
+
'no-inner-declarations': [2, 'functions'],
|
|
91
|
+
'no-invalid-regexp': 2,
|
|
92
|
+
'no-irregular-whitespace': 2,
|
|
93
|
+
'no-iterator': 2,
|
|
94
|
+
'no-label-var': 2,
|
|
95
|
+
'no-labels': [2, {
|
|
96
|
+
'allowLoop': false,
|
|
97
|
+
'allowSwitch': false
|
|
98
|
+
}],
|
|
99
|
+
'no-lone-blocks': 2,
|
|
100
|
+
'no-mixed-spaces-and-tabs': 2,
|
|
101
|
+
'no-multi-spaces': 2,
|
|
102
|
+
'no-multi-str': 2,
|
|
103
|
+
'no-multiple-empty-lines': [2, {
|
|
104
|
+
'max': 1
|
|
105
|
+
}],
|
|
106
|
+
'no-native-reassign': 2,
|
|
107
|
+
'no-negated-in-lhs': 2,
|
|
108
|
+
'no-new-object': 2,
|
|
109
|
+
'no-new-require': 2,
|
|
110
|
+
'no-new-symbol': 2,
|
|
111
|
+
'no-new-wrappers': 2,
|
|
112
|
+
'no-obj-calls': 2,
|
|
113
|
+
'no-octal': 2,
|
|
114
|
+
'no-octal-escape': 2,
|
|
115
|
+
'no-path-concat': 2,
|
|
116
|
+
'no-proto': 2,
|
|
117
|
+
'no-redeclare': 2,
|
|
118
|
+
'no-regex-spaces': 2,
|
|
119
|
+
'no-return-assign': [2, 'except-parens'],
|
|
120
|
+
'no-self-assign': 2,
|
|
121
|
+
'no-self-compare': 2,
|
|
122
|
+
'no-sequences': 2,
|
|
123
|
+
'no-shadow-restricted-names': 2,
|
|
124
|
+
'no-spaced-func': 2,
|
|
125
|
+
'no-sparse-arrays': 2,
|
|
126
|
+
'no-this-before-super': 2,
|
|
127
|
+
'no-throw-literal': 2,
|
|
128
|
+
'no-trailing-spaces': 2,
|
|
129
|
+
'no-undef': 2,
|
|
130
|
+
'no-undef-init': 2,
|
|
131
|
+
'no-unexpected-multiline': 2,
|
|
132
|
+
'no-unmodified-loop-condition': 2,
|
|
133
|
+
'no-unneeded-ternary': [2, {
|
|
134
|
+
'defaultAssignment': false
|
|
135
|
+
}],
|
|
136
|
+
'no-unreachable': 2,
|
|
137
|
+
'no-unsafe-finally': 2,
|
|
138
|
+
'no-unused-vars': [2, {
|
|
139
|
+
'vars': 'all',
|
|
140
|
+
'args': 'none'
|
|
141
|
+
}],
|
|
142
|
+
'no-useless-call': 2,
|
|
143
|
+
'no-useless-computed-key': 2,
|
|
144
|
+
'no-useless-constructor': 2,
|
|
145
|
+
'no-useless-escape': 0,
|
|
146
|
+
'no-whitespace-before-property': 2,
|
|
147
|
+
'no-with': 2,
|
|
148
|
+
'one-var': [2, {
|
|
149
|
+
'initialized': 'never'
|
|
150
|
+
}],
|
|
151
|
+
'operator-linebreak': [2, 'after', {
|
|
152
|
+
'overrides': {
|
|
153
|
+
'?': 'before',
|
|
154
|
+
':': 'before'
|
|
155
|
+
}
|
|
156
|
+
}],
|
|
157
|
+
'padded-blocks': [2, 'never'],
|
|
158
|
+
'quotes': [2, 'single', {
|
|
159
|
+
'avoidEscape': true,
|
|
160
|
+
'allowTemplateLiterals': true
|
|
161
|
+
}],
|
|
162
|
+
'semi': [2, 'never'],
|
|
163
|
+
'semi-spacing': [2, {
|
|
164
|
+
'before': false,
|
|
165
|
+
'after': true
|
|
166
|
+
}],
|
|
167
|
+
'space-before-blocks': [2, 'always'],
|
|
168
|
+
'space-before-function-paren': [2, 'never'],
|
|
169
|
+
'space-in-parens': [2, 'never'],
|
|
170
|
+
'space-infix-ops': 2,
|
|
171
|
+
'space-unary-ops': [2, {
|
|
172
|
+
'words': true,
|
|
173
|
+
'nonwords': false
|
|
174
|
+
}],
|
|
175
|
+
'spaced-comment': [2, 'always', {
|
|
176
|
+
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
|
177
|
+
}],
|
|
178
|
+
'template-curly-spacing': [2, 'never'],
|
|
179
|
+
'use-isnan': 2,
|
|
180
|
+
'valid-typeof': 2,
|
|
181
|
+
'wrap-iife': [2, 'any'],
|
|
182
|
+
'yield-star-spacing': [2, 'both'],
|
|
183
|
+
'yoda': [2, 'never'],
|
|
184
|
+
'prefer-const': 2,
|
|
185
|
+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
|
186
|
+
'object-curly-spacing': [2, 'always', {
|
|
187
|
+
objectsInObjects: false
|
|
188
|
+
}],
|
|
189
|
+
'array-bracket-spacing': [2, 'never'],
|
|
190
|
+
"max-len": [0, 180, 4],//字符串最大长度
|
|
191
|
+
}
|
|
192
|
+
}
|
package/.gitignore
ADDED
package/README.md
ADDED
package/babel.config.js
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
base: '/iov-pro-components/',
|
|
5
|
+
title: 'IOV Pro Components',
|
|
6
|
+
dest: path.resolve(__dirname, '../../dist'),
|
|
7
|
+
description: '基于IOV Design的前端组件库',
|
|
8
|
+
configureWebpack: {
|
|
9
|
+
resolve: {
|
|
10
|
+
alias: {
|
|
11
|
+
'@': path.join(__dirname, '../../src')
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
chainWebpack: (config) => {
|
|
16
|
+
config.resolve.alias
|
|
17
|
+
.set('core-js/library/fn', 'core-js/features')
|
|
18
|
+
},
|
|
19
|
+
plugins: ['demo-container'],
|
|
20
|
+
themeConfig: {
|
|
21
|
+
// 顶部导航
|
|
22
|
+
nav: [
|
|
23
|
+
{ text: '首页', link: '/' },
|
|
24
|
+
{ text: '组件', link: '/components/icon' },
|
|
25
|
+
{ text: '模板', link: '/template/list' },
|
|
26
|
+
{ text: 'GitLab', link: 'http://172.23.105.167/cusc-fe/iov-pro-components.git' }
|
|
27
|
+
],
|
|
28
|
+
// 侧边栏配置
|
|
29
|
+
sidebar: {
|
|
30
|
+
'/components/': [
|
|
31
|
+
{
|
|
32
|
+
title: '基础',
|
|
33
|
+
redirect: '/components/icon',
|
|
34
|
+
collapsable: false,
|
|
35
|
+
sidebarDepth: 0,
|
|
36
|
+
children: [
|
|
37
|
+
{
|
|
38
|
+
title: '图标 Icon',
|
|
39
|
+
path: '/components/icon'
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: '列表',
|
|
45
|
+
redirect: '/components/pro-form',
|
|
46
|
+
collapsable: false,
|
|
47
|
+
sidebarDepth: 0,
|
|
48
|
+
children: [
|
|
49
|
+
{
|
|
50
|
+
title: '表单 ProForm',
|
|
51
|
+
path: '/components/pro-form'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: '表格 ProTable',
|
|
55
|
+
path: '/components/pro-table'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: '搜索表单 SearchTable',
|
|
59
|
+
path: '/components/search-table'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: '表格按钮组 LinkGroup',
|
|
63
|
+
path: '/components/link-group'
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: '详情',
|
|
69
|
+
redirect: '/components/page-detail',
|
|
70
|
+
collapsable: false,
|
|
71
|
+
sidebarDepth: 0,
|
|
72
|
+
children: [
|
|
73
|
+
{
|
|
74
|
+
title: '页面详情 PageDetail',
|
|
75
|
+
path: '/components/page-detail'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: '页面模块 PageModule',
|
|
79
|
+
path: '/components/page-module'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: '小标题 SubTitle',
|
|
83
|
+
path: '/components/sub-title'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: '提交按钮模块 SubmitModule',
|
|
87
|
+
path: '/components/submit-module'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: '描述 Description',
|
|
91
|
+
path: '/components/description'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: '弹窗搜索 DialogSelect',
|
|
95
|
+
path: '/components/dialog-select'
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: '工具',
|
|
101
|
+
redirect: '/components/request',
|
|
102
|
+
collapsable: false,
|
|
103
|
+
sidebarDepth: 0,
|
|
104
|
+
children: [
|
|
105
|
+
{
|
|
106
|
+
title: '接口请求 Request',
|
|
107
|
+
path: '/components/request'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
title: '间隔 Space',
|
|
111
|
+
path: '/components/space'
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
title: '显示 Display',
|
|
115
|
+
path: '/components/display'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: '枚举 Enums',
|
|
119
|
+
path: '/components/enums'
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
'/template/': [
|
|
125
|
+
{
|
|
126
|
+
title: '模板',
|
|
127
|
+
redirect: '/template/list',
|
|
128
|
+
collapsable: false,
|
|
129
|
+
sidebarDepth: 0,
|
|
130
|
+
children: [
|
|
131
|
+
{
|
|
132
|
+
title: '列表页',
|
|
133
|
+
path: '/template/list'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
title: '新增页',
|
|
137
|
+
path: '/template/add'
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
title: '详情页',
|
|
141
|
+
path: '/template/detail'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
title: '弹窗',
|
|
145
|
+
path: '/template/dialog'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
title: '确认框',
|
|
149
|
+
path: '/template/confirm'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
title: '标签页',
|
|
153
|
+
path: '/template/tabs'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: 'mini标签页',
|
|
157
|
+
path: '/template/tabs-mini'
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
locales: {
|
|
165
|
+
'/': {
|
|
166
|
+
lang: 'zh-CN'
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
table {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
[class*=" iov-icon-"], [class^=iov-icon-] {
|
|
5
|
+
line-height: 1.5;
|
|
6
|
+
}
|
|
7
|
+
a.sidebar-link {
|
|
8
|
+
line-height: 28px !important;
|
|
9
|
+
}
|
|
10
|
+
h1 {
|
|
11
|
+
font-size: 28px;
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
margin-bottom: 0 !important;
|
|
14
|
+
}
|
|
15
|
+
h2 {
|
|
16
|
+
border-bottom: 0;
|
|
17
|
+
font-size: 22px;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
padding-top: 4.1rem;
|
|
20
|
+
}
|
|
21
|
+
p {
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
}
|
|
24
|
+
th, td {
|
|
25
|
+
border-top: 0;
|
|
26
|
+
border: 0;
|
|
27
|
+
}
|
|
28
|
+
.caret-bottom.icon {
|
|
29
|
+
height: 44px;
|
|
30
|
+
&:before {
|
|
31
|
+
top: 50%;
|
|
32
|
+
transform: translateY(-50%);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
div.search-box {
|
|
36
|
+
margin-right: 3rem;
|
|
37
|
+
}
|
|
38
|
+
.copy-action, .demo-block-control {
|
|
39
|
+
background-color: #ffffff !important;
|
|
40
|
+
border-top: none !important;
|
|
41
|
+
color: #494b53 !important;
|
|
42
|
+
}
|
|
43
|
+
.demo-block-control .caret-bottom:before {
|
|
44
|
+
border-top-color: #494b53 !important;
|
|
45
|
+
opacity: 0.8;
|
|
46
|
+
}
|
|
47
|
+
.demo-block .meta {
|
|
48
|
+
border-top: 1px solid #ebebeb;
|
|
49
|
+
}
|
|
50
|
+
.demo-block-control:hover {
|
|
51
|
+
background-color: #f9fafc !important;
|
|
52
|
+
}
|
|
53
|
+
.demo-block-control:hover .copy-action, .demo-block-control:hover {
|
|
54
|
+
color: #2A68FF !important;
|
|
55
|
+
}
|
|
56
|
+
.demo-block-control:hover .caret-bottom:before {
|
|
57
|
+
border-top-color: #2A68FF !important;
|
|
58
|
+
}
|
|
59
|
+
.theme-container.grey-background-demo-content .demo-content {
|
|
60
|
+
background-color: #FAFAFA;
|
|
61
|
+
padding: 0 !important;
|
|
62
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 颜色
|
|
2
|
+
$accentColor = #2A68FF
|
|
3
|
+
$textColor = #2c3e50
|
|
4
|
+
$borderColor = #eaecef
|
|
5
|
+
$codeBgColor = #282c34
|
|
6
|
+
$arrowBgColor = #ccc
|
|
7
|
+
$badgeTipColor = #42b983
|
|
8
|
+
$badgeWarningColor = darken(#ffe564, 35%)
|
|
9
|
+
$badgeErrorColor = #DA5961
|
|
10
|
+
|
|
11
|
+
// 布局
|
|
12
|
+
$navbarHeight = 4.6rem
|
|
13
|
+
$sidebarWidth = 20rem
|
|
14
|
+
$contentWidth = 960px
|
|
15
|
+
$homePageWidth = 960px
|
|
16
|
+
|
|
17
|
+
// 响应式变化点
|
|
18
|
+
$MQNarrow = 959px
|
|
19
|
+
$MQMobile = 719px
|
|
20
|
+
$MQMobileNarrow = 419px
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import ElementUI from 'iov-design'
|
|
2
|
+
import IovProComponents from '../../../src/packages'
|
|
3
|
+
|
|
4
|
+
import 'iov-design/lib/theme-chalk/index.css'
|
|
5
|
+
|
|
6
|
+
function checkNumber(el, binding, vnode) {
|
|
7
|
+
const decimals = !isNaN(binding.value) ? binding.value : 2 // 默认小数位数为 2
|
|
8
|
+
|
|
9
|
+
// 构建正则表达式,支持 0 和空值,不允许以 '.' 开头,也不允许多个零开头
|
|
10
|
+
const regex = new RegExp(`^(?!\\.)[0-9]*(\\.\\d{0,${decimals}})?$|^$`)
|
|
11
|
+
|
|
12
|
+
// 获取 el-input 内部的 input 元素
|
|
13
|
+
const input = el.tagName === 'INPUT' ? el : el.querySelector('input')
|
|
14
|
+
if (input) {
|
|
15
|
+
let previousValue = '' // 记录上次合法的值
|
|
16
|
+
|
|
17
|
+
input.addEventListener('input', (event) => {
|
|
18
|
+
let currentValue = input.value
|
|
19
|
+
|
|
20
|
+
// 使用 slice 去除多余的零
|
|
21
|
+
if (/^0[0-9]/.test(currentValue)) {
|
|
22
|
+
currentValue = currentValue.slice(0, 1) // 保留一个零,移除其他零
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 防止以小数点开头,例如 ".123" -> "0.123"
|
|
26
|
+
if (/^\./.test(currentValue)) {
|
|
27
|
+
currentValue = '0' + currentValue // 补全为 "0.123"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (+decimals === 0 && /^\d+\.$/.test(currentValue)) {
|
|
31
|
+
currentValue = currentValue.slice(0, -1)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// 如果当前值合法,保存为上次合法值
|
|
35
|
+
if (regex.test(currentValue)) {
|
|
36
|
+
previousValue = currentValue
|
|
37
|
+
input.value = previousValue
|
|
38
|
+
} else {
|
|
39
|
+
// 如果不合法,恢复到上次合法值
|
|
40
|
+
const cursorPosition = input.selectionStart - 1 // 获取光标位置
|
|
41
|
+
input.value = previousValue // 恢复到合法值
|
|
42
|
+
|
|
43
|
+
// 修复光标位置
|
|
44
|
+
input.setSelectionRange(cursorPosition, cursorPosition)
|
|
45
|
+
|
|
46
|
+
// 手动触发 input 事件以更新 v-model
|
|
47
|
+
const event = new Event('input', { bubbles: true })
|
|
48
|
+
input.dispatchEvent(event)
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
input.addEventListener('blur', () => {
|
|
52
|
+
// 当前输入的值
|
|
53
|
+
const currentValue = input.value
|
|
54
|
+
// 如果当前输入的值以.结尾
|
|
55
|
+
if (/\.$/.test(currentValue)) {
|
|
56
|
+
previousValue = currentValue.slice(0, currentValue.length - 1)
|
|
57
|
+
input.value = previousValue
|
|
58
|
+
// 手动触发 input 事件以更新 v-model
|
|
59
|
+
const event = new Event('input', { bubbles: true })
|
|
60
|
+
input.dispatchEvent(event)
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default ({
|
|
67
|
+
Vue, // VuePress 正在使用的 Vue 构造函数
|
|
68
|
+
options, // 附加到根实例的一些选项
|
|
69
|
+
router, // 当前应用的路由实例
|
|
70
|
+
siteData // 站点元数据
|
|
71
|
+
}) => {
|
|
72
|
+
// 注册全局组件
|
|
73
|
+
Vue.use(ElementUI)
|
|
74
|
+
Vue.use(IovProComponents, {
|
|
75
|
+
preview: {
|
|
76
|
+
request: (params) => {
|
|
77
|
+
return new Promise((resolve) => {
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
resolve('https://prod-common-public.obs-helf.cucloud.cn/mall/goods/893f1000000000114669556')
|
|
80
|
+
}, 1000)
|
|
81
|
+
})
|
|
82
|
+
},
|
|
83
|
+
cacheTime: 60000
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
// 注册自定义指令
|
|
88
|
+
Vue.directive('number', {
|
|
89
|
+
bind(el, binding, vnode) {
|
|
90
|
+
checkNumber(el, binding, vnode)
|
|
91
|
+
},
|
|
92
|
+
unbind(el) {
|
|
93
|
+
const input = el.tagName === 'INPUT' ? el : el.querySelector('input')
|
|
94
|
+
if (input) {
|
|
95
|
+
input.removeEventListener('input', () => {})
|
|
96
|
+
input.removeEventListener('blur', () => {})
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
}
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
home: true
|
|
3
|
+
heroText: IOV Pro Components
|
|
4
|
+
tagline: 基于IOV Design的高级组件库
|
|
5
|
+
actionText: 快速上手 →
|
|
6
|
+
actionLink: /components/pro-form
|
|
7
|
+
features:
|
|
8
|
+
- title: 简洁至上
|
|
9
|
+
details: 以 Schema配置 为中心的项目结构,以最少的代码帮助你日常开发。
|
|
10
|
+
- title: Vue2驱动
|
|
11
|
+
details: 享受 Vue + webpack 的开发体验。
|
|
12
|
+
footer: Copyright©2018 联通智网科技版权所有 京ICP备16005440号-1
|
|
13
|
+
---
|