bi-element-ui 0.1.41 → 0.1.42

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 (53) hide show
  1. package/.browserslistrc +3 -3
  2. package/.eslintrc.js +287 -287
  3. package/.prettierrc +7 -7
  4. package/README.md +148 -148
  5. package/cypress.json +3 -3
  6. package/dist/css/about.e70f66ed.css +1 -0
  7. package/dist/css/chunk-vendors.5ad50e34.css +1 -0
  8. package/dist/css/index.6f2c0574.css +1 -0
  9. package/dist/index.html +1 -1
  10. package/dist/js/about.62e2a880.js +2 -0
  11. package/dist/js/chunk-vendors.7136a723.js +41 -0
  12. package/dist/js/index.af0dae4e.js +2 -0
  13. package/lib/bi-element-ui.common.js +23129 -22942
  14. package/lib/bi-element-ui.css +1 -1
  15. package/lib/bi-element-ui.umd.js +23129 -22942
  16. package/lib/bi-element-ui.umd.min.js +2 -279
  17. package/package.json +57 -57
  18. package/src/App.vue +41 -41
  19. package/src/components/BiDatePicker/datePickerOption.js +229 -229
  20. package/src/components/BiDatePicker/index.vue +74 -74
  21. package/src/components/BiTable/columu.vue +104 -104
  22. package/src/components/BiTable/forced.js +76 -76
  23. package/src/components/BiTable/index.js +6 -6
  24. package/src/components/BiTable/render.vue +13 -13
  25. package/src/components/BiTable/table.vue +202 -202
  26. package/src/components/BiTableColumn/Group.vue +277 -277
  27. package/src/components/BiTableColumn/api.js +16 -16
  28. package/src/components/BiTableColumn/index.vue +614 -614
  29. package/src/components/BiTooltipIcon/index.vue +71 -71
  30. package/src/components/EditBtn.vue +15 -15
  31. package/src/components/FreeButton/index.vue +69 -69
  32. package/src/components/Pagination/index.vue +104 -104
  33. package/src/components/Pagination/scrollTo.js +69 -69
  34. package/src/main.js +18 -18
  35. package/src/router/index.js +34 -34
  36. package/src/store/index.js +11 -11
  37. package/src/table.js +463 -463
  38. package/src/views/Date.vue +132 -132
  39. package/src/views/Home.vue +330 -330
  40. package/src/views/Scene.vue +140 -140
  41. package/src/views/Table.vue +220 -220
  42. package/tests/e2e/.eslintrc.js +10 -10
  43. package/tests/e2e/plugins/index.js +25 -25
  44. package/tests/e2e/specs/test.js +8 -8
  45. package/tests/e2e/support/commands.js +25 -25
  46. package/tests/e2e/support/index.js +20 -20
  47. package/tests/unit/example.spec.js +13 -13
  48. package/dist/css/about.6cfcc147.css +0 -1
  49. package/dist/css/chunk-vendors.8140bef9.css +0 -1
  50. package/dist/css/index.59a106c6.css +0 -1
  51. package/dist/js/about.a5370aa0.js +0 -2
  52. package/dist/js/chunk-vendors.a9a38d93.js +0 -318
  53. package/dist/js/index.8837e62a.js +0 -2
@@ -1,220 +1,220 @@
1
- <template>
2
- <div>
3
- <el-button
4
- type=""
5
- @click="search"
6
- >搜索</el-button>
7
- <div
8
- class="example-table-box"
9
- style="padding-top:20px"
10
- >
11
- <p>sticky表格</p>
12
- <bi-table
13
- ref="table"
14
- border
15
- stripe
16
- fixed="sticky"
17
- :data="data"
18
- :column="basicColumn"
19
- show-summary
20
- :summary-method="getSummaries"
21
- ></bi-table>
22
- </div>
23
-
24
- <!-- <div style="padding-bottom:600px"></div>
25
- <div class="example-table-box">
26
- <p>普通固定表头</p>
27
- <bi-table
28
- border
29
- stripe
30
- fixed="fullscreen"
31
- :data="data"
32
- :column="fullscreenColumn"
33
- max-height="200px"
34
- fixed-offset="60"
35
- pagination
36
- :auto-scroll="false"
37
- :total="100"
38
- :page.sync="listQuery.page"
39
- :limit.sync="listQuery.limit"
40
- show-summary
41
- @selection-change="selectionChange"
42
- @pagination="getList"
43
- ></bi-table>
44
- </div>
45
-
46
- <div class="example-table-box">
47
- <p>sticky-tabs表格</p>
48
- <el-tabs>
49
- <el-tab-pane label="tabs">
50
- <div style="height:300px;background:#eee"></div>
51
- <bi-table
52
- border
53
- stripe
54
- fixed="sticky"
55
- :data="data"
56
- :column="fullscreenColumn"
57
- :summary-method="getSummaries"
58
- show-summary
59
- ></bi-table>
60
- </el-tab-pane>
61
- </el-tabs>
62
- </div>
63
- <div class="example-table-box">
64
- <p>tooltipIcon在表格内的组件使用</p>
65
- <bi-table
66
- border
67
- stripe
68
- fixed="sticky"
69
- :data="minData"
70
- :column="renderColumn"
71
- >
72
- <template v-slot:province="{row}">
73
- <BiTooltipIcon
74
- :label="row.province"
75
- content="这是props继承的写法,<br/>可根据不同需求配置属性"
76
- placement="right"
77
- icon="el-icon-warning-outline"
78
- effect="light"
79
- ></BiTooltipIcon>
80
- </template>
81
- <template v-slot:city="{row}">
82
- <BiTooltipIcon placement="right">
83
- <template slot="tip-label"><span>{{ row.city }}</span></template>
84
- <template slot="tip-content"><span>这是slot默认替换的写法,可用自定义的内容配合tooltip使用</span></template>
85
- <template slot="tip-icon">
86
- <i
87
- class="el-icon-chat-dot-round"
88
- style="color:#ff6700"
89
- ></i>
90
- </template>
91
- </BiTooltipIcon>
92
- </template>
93
- </bi-table>
94
- </div> -->
95
- </div>
96
- </template>
97
-
98
- <script>
99
- // import BiTable from '@/components/BiTable'
100
- import TableData from '@/table.js'
101
- // import BiTableColumn from '@/components/BiTableColumn'
102
- // import BiTooltipIcon from '@/components/BiTooltipIcon'
103
- export default {
104
- components: {
105
- // BiTooltipIcon
106
- // BiTable
107
- // BiTableColumn
108
- },
109
- mixins: [TableData],
110
- data() {
111
- return {
112
- basicData2: [],
113
- basicColumn: [
114
- { label: '日期', prop: 'date', sortable: true, fixed: true },
115
- { label: '姓名', prop: 'name' },
116
- { label: '省份', prop: 'province' },
117
- { label: '市区', prop: 'city' },
118
- {
119
- label: '地址',
120
- prop: 'address',
121
- width: () => {
122
- return this.aaWidth
123
- }
124
- },
125
- {
126
- label: '地址2',
127
- prop: 'address2',
128
- minWidth: () => {
129
- return '100'
130
- }
131
- },
132
- { label: '邮编', prop: 'zip' },
133
- {
134
- label: 'v-model',
135
- prop: 'other',
136
- fixed: 'right',
137
- render: (h, scope) => {
138
- return h('input', {
139
- on: {
140
- input(event) {
141
- scope.row.name = event.target.value
142
- }
143
- },
144
- domProps: {
145
- value: scope.row.name
146
- },
147
- style: {
148
- width: '100%',
149
- minHeight: '30px',
150
- color: 'red',
151
- border: '1px solid #ddd'
152
- }
153
- })
154
- }
155
- }
156
- ],
157
- tableLoading: false,
158
- columnsProps: {
159
- width: 'auto'
160
- },
161
- total: 0,
162
- listQuery: {
163
- page: 2,
164
- limit: 20
165
- },
166
- editForm: {},
167
- dialogVisible: false
168
- }
169
- },
170
- computed: {
171
- aaWidth() {
172
- return 400
173
- }
174
- },
175
- methods: {
176
- selectionChange(rows) {
177
- console.log('selected', rows)
178
- },
179
- getList() {},
180
- openDialog({ row }) {
181
- this.editForm = Object.assign({}, row)
182
- this.dialogVisible = true
183
- },
184
- setTableColumn(column) {
185
- // this.tableLoading = true
186
- this.$set(this, 'basicColumn', [])
187
- setTimeout(() => {
188
- this.$set(this, 'basicColumn', column)
189
- // this.tableLoading = false
190
- }, 10)
191
- },
192
-
193
- getSummaries() {
194
- return ['合计', '2016-05-03', '王小虎', '上海', '普陀区', '上海市普陀区金沙江路 1518 弄', '上海市普陀区金沙江路 1518 弄', 200333]
195
- },
196
- search() {
197
- const list = JSON.parse(JSON.stringify(this.data))
198
- this.data = list.splice(0, 7)
199
- // this.tableList2 = this.minData
200
- this.$nextTick(() => {
201
- this.$refs.table.resetHeaderFooter && this.$refs.table.resetHeaderFooter()
202
- // var evt = window.document.createEvent('UIEvents')
203
- // evt.initUIEvent('scroll', true, false, window, 0)
204
- // window.dispatchEvent(evt)
205
- })
206
- }
207
- }
208
- }
209
- </script>
210
-
211
- <style lang="scss" scoped>
212
- .example-table-box {
213
- margin: 25px 50px;
214
-
215
- p {
216
- text-align: left;
217
- font-weight: 700;
218
- }
219
- }
220
- </style>
1
+ <template>
2
+ <div>
3
+ <el-button
4
+ type=""
5
+ @click="search"
6
+ >搜索</el-button>
7
+ <div
8
+ class="example-table-box"
9
+ style="padding-top:20px"
10
+ >
11
+ <p>sticky表格</p>
12
+ <bi-table
13
+ ref="table"
14
+ border
15
+ stripe
16
+ fixed="sticky"
17
+ :data="data"
18
+ :column="basicColumn"
19
+ show-summary
20
+ :summary-method="getSummaries"
21
+ ></bi-table>
22
+ </div>
23
+
24
+ <!-- <div style="padding-bottom:600px"></div>
25
+ <div class="example-table-box">
26
+ <p>普通固定表头</p>
27
+ <bi-table
28
+ border
29
+ stripe
30
+ fixed="fullscreen"
31
+ :data="data"
32
+ :column="fullscreenColumn"
33
+ max-height="200px"
34
+ fixed-offset="60"
35
+ pagination
36
+ :auto-scroll="false"
37
+ :total="100"
38
+ :page.sync="listQuery.page"
39
+ :limit.sync="listQuery.limit"
40
+ show-summary
41
+ @selection-change="selectionChange"
42
+ @pagination="getList"
43
+ ></bi-table>
44
+ </div>
45
+
46
+ <div class="example-table-box">
47
+ <p>sticky-tabs表格</p>
48
+ <el-tabs>
49
+ <el-tab-pane label="tabs">
50
+ <div style="height:300px;background:#eee"></div>
51
+ <bi-table
52
+ border
53
+ stripe
54
+ fixed="sticky"
55
+ :data="data"
56
+ :column="fullscreenColumn"
57
+ :summary-method="getSummaries"
58
+ show-summary
59
+ ></bi-table>
60
+ </el-tab-pane>
61
+ </el-tabs>
62
+ </div>
63
+ <div class="example-table-box">
64
+ <p>tooltipIcon在表格内的组件使用</p>
65
+ <bi-table
66
+ border
67
+ stripe
68
+ fixed="sticky"
69
+ :data="minData"
70
+ :column="renderColumn"
71
+ >
72
+ <template v-slot:province="{row}">
73
+ <BiTooltipIcon
74
+ :label="row.province"
75
+ content="这是props继承的写法,<br/>可根据不同需求配置属性"
76
+ placement="right"
77
+ icon="el-icon-warning-outline"
78
+ effect="light"
79
+ ></BiTooltipIcon>
80
+ </template>
81
+ <template v-slot:city="{row}">
82
+ <BiTooltipIcon placement="right">
83
+ <template slot="tip-label"><span>{{ row.city }}</span></template>
84
+ <template slot="tip-content"><span>这是slot默认替换的写法,可用自定义的内容配合tooltip使用</span></template>
85
+ <template slot="tip-icon">
86
+ <i
87
+ class="el-icon-chat-dot-round"
88
+ style="color:#ff6700"
89
+ ></i>
90
+ </template>
91
+ </BiTooltipIcon>
92
+ </template>
93
+ </bi-table>
94
+ </div> -->
95
+ </div>
96
+ </template>
97
+
98
+ <script>
99
+ // import BiTable from '@/components/BiTable'
100
+ import TableData from '@/table.js'
101
+ // import BiTableColumn from '@/components/BiTableColumn'
102
+ // import BiTooltipIcon from '@/components/BiTooltipIcon'
103
+ export default {
104
+ components: {
105
+ // BiTooltipIcon
106
+ // BiTable
107
+ // BiTableColumn
108
+ },
109
+ mixins: [TableData],
110
+ data() {
111
+ return {
112
+ basicData2: [],
113
+ basicColumn: [
114
+ { label: '日期', prop: 'date', sortable: true, fixed: true },
115
+ { label: '姓名', prop: 'name' },
116
+ { label: '省份', prop: 'province' },
117
+ { label: '市区', prop: 'city' },
118
+ {
119
+ label: '地址',
120
+ prop: 'address',
121
+ width: () => {
122
+ return this.aaWidth
123
+ }
124
+ },
125
+ {
126
+ label: '地址2',
127
+ prop: 'address2',
128
+ minWidth: () => {
129
+ return '100'
130
+ }
131
+ },
132
+ { label: '邮编', prop: 'zip' },
133
+ {
134
+ label: 'v-model',
135
+ prop: 'other',
136
+ fixed: 'right',
137
+ render: (h, scope) => {
138
+ return h('input', {
139
+ on: {
140
+ input(event) {
141
+ scope.row.name = event.target.value
142
+ }
143
+ },
144
+ domProps: {
145
+ value: scope.row.name
146
+ },
147
+ style: {
148
+ width: '100%',
149
+ minHeight: '30px',
150
+ color: 'red',
151
+ border: '1px solid #ddd'
152
+ }
153
+ })
154
+ }
155
+ }
156
+ ],
157
+ tableLoading: false,
158
+ columnsProps: {
159
+ width: 'auto'
160
+ },
161
+ total: 0,
162
+ listQuery: {
163
+ page: 2,
164
+ limit: 20
165
+ },
166
+ editForm: {},
167
+ dialogVisible: false
168
+ }
169
+ },
170
+ computed: {
171
+ aaWidth() {
172
+ return 400
173
+ }
174
+ },
175
+ methods: {
176
+ selectionChange(rows) {
177
+ console.log('selected', rows)
178
+ },
179
+ getList() {},
180
+ openDialog({ row }) {
181
+ this.editForm = Object.assign({}, row)
182
+ this.dialogVisible = true
183
+ },
184
+ setTableColumn(column) {
185
+ // this.tableLoading = true
186
+ this.$set(this, 'basicColumn', [])
187
+ setTimeout(() => {
188
+ this.$set(this, 'basicColumn', column)
189
+ // this.tableLoading = false
190
+ }, 10)
191
+ },
192
+
193
+ getSummaries() {
194
+ return ['合计', '2016-05-03', '王小虎', '上海', '普陀区', '上海市普陀区金沙江路 1518 弄', '上海市普陀区金沙江路 1518 弄', 200333]
195
+ },
196
+ search() {
197
+ const list = JSON.parse(JSON.stringify(this.data))
198
+ this.data = list.splice(0, 7)
199
+ // this.tableList2 = this.minData
200
+ this.$nextTick(() => {
201
+ this.$refs.table.resetHeaderFooter && this.$refs.table.resetHeaderFooter()
202
+ // var evt = window.document.createEvent('UIEvents')
203
+ // evt.initUIEvent('scroll', true, false, window, 0)
204
+ // window.dispatchEvent(evt)
205
+ })
206
+ }
207
+ }
208
+ }
209
+ </script>
210
+
211
+ <style lang="scss" scoped>
212
+ .example-table-box {
213
+ margin: 25px 50px;
214
+
215
+ p {
216
+ text-align: left;
217
+ font-weight: 700;
218
+ }
219
+ }
220
+ </style>
@@ -1,10 +1,10 @@
1
- module.exports = {
2
- plugins: ['cypress'],
3
- env: {
4
- mocha: true,
5
- 'cypress/globals': true
6
- },
7
- rules: {
8
- strict: 'off'
9
- }
10
- }
1
+ module.exports = {
2
+ plugins: ['cypress'],
3
+ env: {
4
+ mocha: true,
5
+ 'cypress/globals': true
6
+ },
7
+ rules: {
8
+ strict: 'off'
9
+ }
10
+ }
@@ -1,25 +1,25 @@
1
- /* eslint-disable arrow-body-style */
2
- // https://docs.cypress.io/guides/guides/plugins-guide.html
3
-
4
- // if you need a custom webpack configuration you can uncomment the following import
5
- // and then use the `file:preprocessor` event
6
- // as explained in the cypress docs
7
- // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
8
-
9
- // /* eslint-disable import/no-extraneous-dependencies, global-require */
10
- // const webpack = require('@cypress/webpack-preprocessor')
11
-
12
- module.exports = (on, config) => {
13
- // on('file:preprocessor', webpack({
14
- // webpackOptions: require('@vue/cli-service/webpack.config'),
15
- // watchOptions: {}
16
- // }))
17
-
18
- return Object.assign({}, config, {
19
- fixturesFolder: 'tests/e2e/fixtures',
20
- integrationFolder: 'tests/e2e/specs',
21
- screenshotsFolder: 'tests/e2e/screenshots',
22
- videosFolder: 'tests/e2e/videos',
23
- supportFile: 'tests/e2e/support/index.js'
24
- })
25
- }
1
+ /* eslint-disable arrow-body-style */
2
+ // https://docs.cypress.io/guides/guides/plugins-guide.html
3
+
4
+ // if you need a custom webpack configuration you can uncomment the following import
5
+ // and then use the `file:preprocessor` event
6
+ // as explained in the cypress docs
7
+ // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
8
+
9
+ // /* eslint-disable import/no-extraneous-dependencies, global-require */
10
+ // const webpack = require('@cypress/webpack-preprocessor')
11
+
12
+ module.exports = (on, config) => {
13
+ // on('file:preprocessor', webpack({
14
+ // webpackOptions: require('@vue/cli-service/webpack.config'),
15
+ // watchOptions: {}
16
+ // }))
17
+
18
+ return Object.assign({}, config, {
19
+ fixturesFolder: 'tests/e2e/fixtures',
20
+ integrationFolder: 'tests/e2e/specs',
21
+ screenshotsFolder: 'tests/e2e/screenshots',
22
+ videosFolder: 'tests/e2e/videos',
23
+ supportFile: 'tests/e2e/support/index.js'
24
+ })
25
+ }
@@ -1,8 +1,8 @@
1
- // https://docs.cypress.io/api/introduction/api.html
2
-
3
- describe('My First Test', () => {
4
- it('Visits the app root url', () => {
5
- cy.visit('/')
6
- cy.contains('h1', 'Welcome to Your Vue.js App')
7
- })
8
- })
1
+ // https://docs.cypress.io/api/introduction/api.html
2
+
3
+ describe('My First Test', () => {
4
+ it('Visits the app root url', () => {
5
+ cy.visit('/')
6
+ cy.contains('h1', 'Welcome to Your Vue.js App')
7
+ })
8
+ })
@@ -1,25 +1,25 @@
1
- // ***********************************************
2
- // This example commands.js shows you how to
3
- // create various custom commands and overwrite
4
- // existing commands.
5
- //
6
- // For more comprehensive examples of custom
7
- // commands please read more here:
8
- // https://on.cypress.io/custom-commands
9
- // ***********************************************
10
- //
11
- //
12
- // -- This is a parent command --
13
- // Cypress.Commands.add("login", (email, password) => { ... })
14
- //
15
- //
16
- // -- This is a child command --
17
- // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18
- //
19
- //
20
- // -- This is a dual command --
21
- // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22
- //
23
- //
24
- // -- This is will overwrite an existing command --
25
- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
1
+ // ***********************************************
2
+ // This example commands.js shows you how to
3
+ // create various custom commands and overwrite
4
+ // existing commands.
5
+ //
6
+ // For more comprehensive examples of custom
7
+ // commands please read more here:
8
+ // https://on.cypress.io/custom-commands
9
+ // ***********************************************
10
+ //
11
+ //
12
+ // -- This is a parent command --
13
+ // Cypress.Commands.add("login", (email, password) => { ... })
14
+ //
15
+ //
16
+ // -- This is a child command --
17
+ // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18
+ //
19
+ //
20
+ // -- This is a dual command --
21
+ // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22
+ //
23
+ //
24
+ // -- This is will overwrite an existing command --
25
+ // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
@@ -1,20 +1,20 @@
1
- // ***********************************************************
2
- // This example support/index.js is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
18
-
19
- // Alternatively you can use CommonJS syntax:
20
- // require('./commands')
1
+ // ***********************************************************
2
+ // This example support/index.js is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import './commands'
18
+
19
+ // Alternatively you can use CommonJS syntax:
20
+ // require('./commands')
@@ -1,13 +1,13 @@
1
- import { expect } from 'chai'
2
- import { shallowMount } from '@vue/test-utils'
3
- import HelloWorld from '@/components/HelloWorld.vue'
4
-
5
- describe('HelloWorld.vue', () => {
6
- it('renders props.msg when passed', () => {
7
- const msg = 'new message'
8
- const wrapper = shallowMount(HelloWorld, {
9
- propsData: { msg }
10
- })
11
- expect(wrapper.text()).to.include(msg)
12
- })
13
- })
1
+ import { expect } from 'chai'
2
+ import { shallowMount } from '@vue/test-utils'
3
+ import HelloWorld from '@/components/HelloWorld.vue'
4
+
5
+ describe('HelloWorld.vue', () => {
6
+ it('renders props.msg when passed', () => {
7
+ const msg = 'new message'
8
+ const wrapper = shallowMount(HelloWorld, {
9
+ propsData: { msg }
10
+ })
11
+ expect(wrapper.text()).to.include(msg)
12
+ })
13
+ })
@@ -1 +0,0 @@
1
- .example-table-box[data-v-a478ee98]{margin:25px 50px}.example-table-box p[data-v-a478ee98]{text-align:left;font-weight:700}.example-table-box[data-v-1a19be12]{margin:25px 50px}.example-table-box p[data-v-1a19be12]{text-align:left;font-weight:700}