@lx-frontend/wrap-element-ui 0.4.1-beta → 0.4.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 (33) hide show
  1. package/README.md +54 -54
  2. package/babel.config.js +5 -5
  3. package/global.d.ts +23 -23
  4. package/package.json +48 -48
  5. package/packages/AddMembers/index.js +11 -11
  6. package/packages/AddMembers/src/AddMembers.vue +127 -127
  7. package/packages/AuditSteps/index.js +7 -7
  8. package/packages/AuditSteps/src/AuditSteps.vue +85 -85
  9. package/packages/DemoComponent/index.js +7 -7
  10. package/packages/DemoComponent/src/DemoComponent.vue +10 -10
  11. package/packages/Ellipsis/index.js +7 -7
  12. package/packages/Ellipsis/src/Ellipsis.vue +119 -119
  13. package/packages/Ellipsis/src/MultilineEllipsis.vue +141 -141
  14. package/packages/LxTable/index.js +11 -11
  15. package/packages/LxTable/src/LxTable.vue +281 -281
  16. package/packages/PopoverForm/index.js +7 -7
  17. package/packages/PopoverForm/src/PopoverForm.vue +66 -66
  18. package/packages/SearchForm/index.js +7 -7
  19. package/packages/SearchForm/src/SearchForm.vue +217 -217
  20. package/packages/SearchSelect/index.js +7 -7
  21. package/packages/SearchSelect/src/SearchSelect.vue +150 -150
  22. package/packages/index.js +59 -59
  23. package/packages/singleMessage/index.ts +44 -44
  24. package/packages/theme-default/gulpfile.js +25 -25
  25. package/packages/theme-default/package.json +23 -23
  26. package/packages/theme-default/src/AuditSteps.scss +52 -52
  27. package/packages/theme-default/src/DemoComponent.scss +9 -9
  28. package/packages/theme-default/src/index.css +11 -11
  29. package/packages/theme-default/src/index.scss +2 -2
  30. package/plugins/wrap.js +22 -22
  31. package/postcss.config.js +5 -5
  32. package/tsconfig.json +41 -41
  33. package/yarn.lock +12226 -0
@@ -1,66 +1,66 @@
1
- <template>
2
- <el-popover :placement="placement" :disabled="isDisabled" :width="width || 300" v-model="show" trigger="click" :visible-arrow="true">
3
- <div class="el-popover__header">
4
- {{title}}
5
- <slot name="title"></slot>
6
- <el-button type="text" icon="el-icon-close" @click="handleClose"></el-button>
7
- </div>
8
- <slot name="form"></slot>
9
-
10
- <div v-if="withSubmitBtn" class="el-popover__footer">
11
- <slot name="footer"></slot>
12
- <el-button type="primary" class="wp100" @click="handleSubmit">{{ okText }}</el-button>
13
- </div>
14
- <span slot='reference'>
15
- <slot name='reference'></slot>
16
- </span>
17
- </el-popover>
18
- </template>
19
- <script>
20
- export default {
21
- name: 'PopoverForm',
22
- props: {
23
- title: String,
24
- width: Number,
25
- placement: {
26
- type: String,
27
- default: 'left',
28
- },
29
- withSubmitBtn: {
30
- type: Boolean,
31
- default: true,
32
- },
33
- isDisabled: {
34
- type: Boolean,
35
- default: false,
36
- },
37
- okText: {
38
- type: String,
39
- default: '确认',
40
- },
41
- },
42
- data() {
43
- return {
44
- show: false,
45
- };
46
- },
47
- methods: {
48
- handleClose() {
49
- this.show = false;
50
- },
51
- handleSubmit() {
52
- this.$emit('on-sure');
53
- },
54
- },
55
- watch: {
56
- show(val) {
57
- this.$emit('on-change', val);
58
- },
59
- },
60
- };
61
- </script>
62
- <style type="scss" scoped>
63
- .wp100{
64
- width: 100%;
65
- }
66
- </style>
1
+ <template>
2
+ <el-popover :placement="placement" :disabled="isDisabled" :width="width || 300" v-model="show" trigger="click" :visible-arrow="true">
3
+ <div class="el-popover__header">
4
+ {{title}}
5
+ <slot name="title"></slot>
6
+ <el-button type="text" icon="el-icon-close" @click="handleClose"></el-button>
7
+ </div>
8
+ <slot name="form"></slot>
9
+
10
+ <div v-if="withSubmitBtn" class="el-popover__footer">
11
+ <slot name="footer"></slot>
12
+ <el-button type="primary" class="wp100" @click="handleSubmit">{{ okText }}</el-button>
13
+ </div>
14
+ <span slot='reference'>
15
+ <slot name='reference'></slot>
16
+ </span>
17
+ </el-popover>
18
+ </template>
19
+ <script>
20
+ export default {
21
+ name: 'PopoverForm',
22
+ props: {
23
+ title: String,
24
+ width: Number,
25
+ placement: {
26
+ type: String,
27
+ default: 'left',
28
+ },
29
+ withSubmitBtn: {
30
+ type: Boolean,
31
+ default: true,
32
+ },
33
+ isDisabled: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+ okText: {
38
+ type: String,
39
+ default: '确认',
40
+ },
41
+ },
42
+ data() {
43
+ return {
44
+ show: false,
45
+ };
46
+ },
47
+ methods: {
48
+ handleClose() {
49
+ this.show = false;
50
+ },
51
+ handleSubmit() {
52
+ this.$emit('on-sure');
53
+ },
54
+ },
55
+ watch: {
56
+ show(val) {
57
+ this.$emit('on-change', val);
58
+ },
59
+ },
60
+ };
61
+ </script>
62
+ <style type="scss" scoped>
63
+ .wp100{
64
+ width: 100%;
65
+ }
66
+ </style>
@@ -1,7 +1,7 @@
1
- import SearchForm from './src/SearchForm.vue'
2
-
3
- SearchForm.install = function (Vue) {
4
- Vue.component(SearchForm.name, SearchForm)
5
- }
6
-
7
- export default SearchForm
1
+ import SearchForm from './src/SearchForm.vue'
2
+
3
+ SearchForm.install = function (Vue) {
4
+ Vue.component(SearchForm.name, SearchForm)
5
+ }
6
+
7
+ export default SearchForm
@@ -1,218 +1,218 @@
1
- <template>
2
- <el-form class='search-form' :inline="isInline" :label-width="width">
3
- <el-form-item
4
- v-for="({
5
- isEmpty = true, key, type, prop, label, placeholder, candidate, filterable=false, withoutAll=false, collapseTags=false,
6
- clearable=false, multiple=false, multipleLimit=0, changeCb, inputLimitCallback, slotName, dateType='date',
7
- doubleIsInline = true,
8
- }) in config"
9
- :key="label"
10
- :label="showLabel ? label : ''"
11
- style="margin-right: 10px"
12
- >
13
- <el-input
14
- v-if="type === 'input'"
15
- :placeholder="placeholder ? placeholder : showLabel ? '请输入' : label"
16
- :value="formData[prop]"
17
- @input="val => handleInput(val, prop, inputLimitCallback)"
18
- ></el-input>
19
- <div v-if="type === 'doubleInput'" :class="doubleIsInline ? 'form-double-inline': ''">
20
- <el-input
21
- @input="val => handleInput(val, prop[0], inputLimitCallback)"
22
- :value="formData[prop[0]]"
23
- :placeholder="(placeholder || [])[0] || '请输入'"
24
- ></el-input>
25
- <el-input
26
- :placeholder="(placeholder || [])[1] || '请输入'"
27
- :value="formData[prop[1]]"
28
- @input="val => handleInput(val, prop[1], inputLimitCallback)"
29
- ></el-input>
30
- </div>
31
- <el-select
32
- v-if="type === 'select'"
33
- :value="formData[prop]"
34
- :placeholder="placeholder ? placeholder : showLabel ? '请输入' : label"
35
- :clearable="clearable"
36
- @input="val => handleInput(val, prop)"
37
- @change="(...args) => changeCb && changeCb(...args)"
38
- :filterable="filterable"
39
- :multiple="multiple"
40
- :multipleLimit="multipleLimit"
41
- :collapseTags="collapseTags"
42
- >
43
- <el-option
44
- v-if="!withoutAll"
45
- value=""
46
- :label="showLabel ? '全部' : label"
47
- />
48
- <el-option
49
- v-for="({name, value, code, id}) in candidate"
50
- :key="id || name"
51
- :value="value || code || id"
52
- :label="name"
53
- />
54
- </el-select>
55
- <el-date-picker
56
- v-if="type === 'datePicker'"
57
- @input="val => handleInput(val, prop)"
58
- @change="(...args) => changeCb && changeCb(...args)"
59
- :value="formData[prop]"
60
- format="yyyy-MM-dd"
61
- :type="dateType"
62
- range-separator="到"
63
- :placeholder="dateType == 'date' ? placeholder || '选择日期' : '选择日期范围'"
64
- start-placeholder="开始日期"
65
- end-placeholder="结束日期"
66
- />
67
- <div v-if="type === 'doubleDatePicker'" :class="doubleIsInline ? 'form-double-inline': ''">
68
- <el-date-picker
69
- @input="val => handleInput(val, prop[0], '', key)"
70
- @change="(...args) => changeCb && changeCb(...args)"
71
- :value="formData[prop[0]]"
72
- value-format="yyyy-MM-dd"
73
- format="yyyy-MM-dd"
74
- type="date"
75
- :placeholder="(placeholder || [])[0] || '开始日期'"
76
- />
77
- <el-date-picker
78
- @input="val => handleInput(val, prop[1], '', key)"
79
- @change="(...args) => changeCb && changeCb(...args)"
80
- :value="formData[prop[1]]"
81
- value-format="yyyy-MM-dd"
82
- format="yyyy-MM-dd"
83
- type="date"
84
- :placeholder="(placeholder || [])[1] || '结束日期'"
85
- />
86
- <el-checkbox :value="checkedIds[key]" v-if="isEmpty" @change="(value) => handelIsEmpty(prop, value, key)" class="is-empty">空白</el-checkbox>
87
- </div>
88
- <slot
89
- v-if="type === 'slot'"
90
- :name="slotName"
91
- />
92
- </el-form-item >
93
- <span v-if="isShowSearchBtn">
94
- <el-button class="search" @click="handleSearch" type="primary">{{searchText}}</el-button>
95
- <el-button v-if="showClear" @click="handleClearParams">{{clearText}}</el-button>
96
- </span>
97
- </el-form>
98
- </template>
99
-
100
- <script>
101
- export default {
102
- name: 'SearchForm',
103
- props: {
104
- isShowSearchBtn: {
105
- default: true,
106
- type: Boolean
107
- },
108
- isInline: {
109
- default: false,
110
- type: Boolean
111
- },
112
- config: {
113
- required: true,
114
- type: Array
115
- },
116
- width: {
117
- default: '100px',
118
- type: String
119
- },
120
- formData: {
121
- required: true
122
- },
123
- showClear: {
124
- default: true,
125
- type: Boolean
126
- },
127
- showLabel: {
128
- default: true,
129
- type: Boolean
130
- },
131
- ownerClear: {
132
- type: Function
133
- },
134
- resetCheckedIds: {
135
- type: Boolean
136
- },
137
- searchText: {
138
- default: '搜索',
139
- type: String
140
- },
141
- clearText: {
142
- default: '清除',
143
- type: String
144
- }
145
- },
146
- data () {
147
- return {
148
- visible: true,
149
- initialData: {},
150
- checkedIds: {}
151
- }
152
- },
153
- mounted () {
154
- this.initialData = Object.freeze({ ...this.formData })
155
- },
156
- methods: {
157
- handleInput (val, prop, inputLimitCallback, key) {
158
- if (inputLimitCallback && !inputLimitCallback(val)) return false
159
- if (val) {
160
- this.$set(this.checkedIds, key, false)
161
- }
162
- this.$emit('update:formData', { ...this.formData, [prop]: val })
163
- this.$emit('isPickerEmpty', this.checkedIds)
164
- },
165
-
166
- handleSearch () {
167
- this.$emit('search', this.formData)
168
- },
169
-
170
- handelIsEmpty (prop, value, key) {
171
- if (value) {
172
- this.formData[prop[0]] = '';
173
- this.formData[prop[1]] = '';
174
- }
175
- this.$set(this.checkedIds, key, value)
176
- this.$emit('isPickerEmpty', this.checkedIds)
177
- },
178
-
179
- handleClearParams () { // 父组件可以通过调用 `this.$refs[xx].handleClearParams()` 来清空表单数据
180
- if (this.ownerClear && typeof this.ownerClear === 'function') {
181
- this.ownerClear()
182
- return
183
- }
184
- Object.keys(this.checkedIds).forEach((k) => {
185
- this.checkedIds[k] = false
186
- })
187
- this.$emit('update:formData', { ...this.formData, ...this.initialData })
188
- },
189
-
190
- handleFormClose () {
191
- this.visible = false;
192
- },
193
- },
194
- watch: {
195
- resetCheckedIds () {
196
- this.config.filter(c => c.type === 'doubleDatePicker').map(t => t.key).forEach(k => {
197
- this.$set(this.checkedIds, k, false)
198
- })
199
- }
200
- }
201
- }
202
- </script>
203
- <style scoped lang="scss">
204
- .form-double-inline {
205
- display: flex;
206
- & .el-input {
207
- width: 100%;
208
- &:not(:first-child) {
209
- margin-left: 4px;
210
- }
211
- }
212
- & .el-date-editor{
213
- &:not(:first-child){
214
- margin-left: 4px;
215
- }
216
- }
217
- }
1
+ <template>
2
+ <el-form class='search-form' :inline="isInline" :label-width="width">
3
+ <el-form-item
4
+ v-for="({
5
+ isEmpty = true, key, type, prop, label, placeholder, candidate, filterable=false, withoutAll=false, collapseTags=false,
6
+ clearable=false, multiple=false, multipleLimit=0, changeCb, inputLimitCallback, slotName, dateType='date',
7
+ doubleIsInline = true,
8
+ }) in config"
9
+ :key="label"
10
+ :label="showLabel ? label : ''"
11
+ style="margin-right: 10px"
12
+ >
13
+ <el-input
14
+ v-if="type === 'input'"
15
+ :placeholder="placeholder ? placeholder : showLabel ? '请输入' : label"
16
+ :value="formData[prop]"
17
+ @input="val => handleInput(val, prop, inputLimitCallback)"
18
+ ></el-input>
19
+ <div v-if="type === 'doubleInput'" :class="doubleIsInline ? 'form-double-inline': ''">
20
+ <el-input
21
+ @input="val => handleInput(val, prop[0], inputLimitCallback)"
22
+ :value="formData[prop[0]]"
23
+ :placeholder="(placeholder || [])[0] || '请输入'"
24
+ ></el-input>
25
+ <el-input
26
+ :placeholder="(placeholder || [])[1] || '请输入'"
27
+ :value="formData[prop[1]]"
28
+ @input="val => handleInput(val, prop[1], inputLimitCallback)"
29
+ ></el-input>
30
+ </div>
31
+ <el-select
32
+ v-if="type === 'select'"
33
+ :value="formData[prop]"
34
+ :placeholder="placeholder ? placeholder : showLabel ? '请输入' : label"
35
+ :clearable="clearable"
36
+ @input="val => handleInput(val, prop)"
37
+ @change="(...args) => changeCb && changeCb(...args)"
38
+ :filterable="filterable"
39
+ :multiple="multiple"
40
+ :multipleLimit="multipleLimit"
41
+ :collapseTags="collapseTags"
42
+ >
43
+ <el-option
44
+ v-if="!withoutAll"
45
+ value=""
46
+ :label="showLabel ? '全部' : label"
47
+ />
48
+ <el-option
49
+ v-for="({name, value, code, id}) in candidate"
50
+ :key="id || name"
51
+ :value="value || code || id"
52
+ :label="name"
53
+ />
54
+ </el-select>
55
+ <el-date-picker
56
+ v-if="type === 'datePicker'"
57
+ @input="val => handleInput(val, prop)"
58
+ @change="(...args) => changeCb && changeCb(...args)"
59
+ :value="formData[prop]"
60
+ format="yyyy-MM-dd"
61
+ :type="dateType"
62
+ range-separator="到"
63
+ :placeholder="dateType == 'date' ? placeholder || '选择日期' : '选择日期范围'"
64
+ start-placeholder="开始日期"
65
+ end-placeholder="结束日期"
66
+ />
67
+ <div v-if="type === 'doubleDatePicker'" :class="doubleIsInline ? 'form-double-inline': ''">
68
+ <el-date-picker
69
+ @input="val => handleInput(val, prop[0], '', key)"
70
+ @change="(...args) => changeCb && changeCb(...args)"
71
+ :value="formData[prop[0]]"
72
+ value-format="yyyy-MM-dd"
73
+ format="yyyy-MM-dd"
74
+ type="date"
75
+ :placeholder="(placeholder || [])[0] || '开始日期'"
76
+ />
77
+ <el-date-picker
78
+ @input="val => handleInput(val, prop[1], '', key)"
79
+ @change="(...args) => changeCb && changeCb(...args)"
80
+ :value="formData[prop[1]]"
81
+ value-format="yyyy-MM-dd"
82
+ format="yyyy-MM-dd"
83
+ type="date"
84
+ :placeholder="(placeholder || [])[1] || '结束日期'"
85
+ />
86
+ <el-checkbox :value="checkedIds[key]" v-if="isEmpty" @change="(value) => handelIsEmpty(prop, value, key)" class="is-empty">空白</el-checkbox>
87
+ </div>
88
+ <slot
89
+ v-if="type === 'slot'"
90
+ :name="slotName"
91
+ />
92
+ </el-form-item >
93
+ <span v-if="isShowSearchBtn">
94
+ <el-button class="search" @click="handleSearch" type="primary">{{searchText}}</el-button>
95
+ <el-button v-if="showClear" @click="handleClearParams">{{clearText}}</el-button>
96
+ </span>
97
+ </el-form>
98
+ </template>
99
+
100
+ <script>
101
+ export default {
102
+ name: 'SearchForm',
103
+ props: {
104
+ isShowSearchBtn: {
105
+ default: true,
106
+ type: Boolean
107
+ },
108
+ isInline: {
109
+ default: false,
110
+ type: Boolean
111
+ },
112
+ config: {
113
+ required: true,
114
+ type: Array
115
+ },
116
+ width: {
117
+ default: '100px',
118
+ type: String
119
+ },
120
+ formData: {
121
+ required: true
122
+ },
123
+ showClear: {
124
+ default: true,
125
+ type: Boolean
126
+ },
127
+ showLabel: {
128
+ default: true,
129
+ type: Boolean
130
+ },
131
+ ownerClear: {
132
+ type: Function
133
+ },
134
+ resetCheckedIds: {
135
+ type: Boolean
136
+ },
137
+ searchText: {
138
+ default: '搜索',
139
+ type: String
140
+ },
141
+ clearText: {
142
+ default: '清除',
143
+ type: String
144
+ }
145
+ },
146
+ data () {
147
+ return {
148
+ visible: true,
149
+ initialData: {},
150
+ checkedIds: {}
151
+ }
152
+ },
153
+ mounted () {
154
+ this.initialData = Object.freeze({ ...this.formData })
155
+ },
156
+ methods: {
157
+ handleInput (val, prop, inputLimitCallback, key) {
158
+ if (inputLimitCallback && !inputLimitCallback(val)) return false
159
+ if (val) {
160
+ this.$set(this.checkedIds, key, false)
161
+ }
162
+ this.$emit('update:formData', { ...this.formData, [prop]: val })
163
+ this.$emit('isPickerEmpty', this.checkedIds)
164
+ },
165
+
166
+ handleSearch () {
167
+ this.$emit('search', this.formData)
168
+ },
169
+
170
+ handelIsEmpty (prop, value, key) {
171
+ if (value) {
172
+ this.formData[prop[0]] = '';
173
+ this.formData[prop[1]] = '';
174
+ }
175
+ this.$set(this.checkedIds, key, value)
176
+ this.$emit('isPickerEmpty', this.checkedIds)
177
+ },
178
+
179
+ handleClearParams () { // 父组件可以通过调用 `this.$refs[xx].handleClearParams()` 来清空表单数据
180
+ if (this.ownerClear && typeof this.ownerClear === 'function') {
181
+ this.ownerClear()
182
+ return
183
+ }
184
+ Object.keys(this.checkedIds).forEach((k) => {
185
+ this.checkedIds[k] = false
186
+ })
187
+ this.$emit('update:formData', { ...this.formData, ...this.initialData })
188
+ },
189
+
190
+ handleFormClose () {
191
+ this.visible = false;
192
+ },
193
+ },
194
+ watch: {
195
+ resetCheckedIds () {
196
+ this.config.filter(c => c.type === 'doubleDatePicker').map(t => t.key).forEach(k => {
197
+ this.$set(this.checkedIds, k, false)
198
+ })
199
+ }
200
+ }
201
+ }
202
+ </script>
203
+ <style scoped lang="scss">
204
+ .form-double-inline {
205
+ display: flex;
206
+ & .el-input {
207
+ width: 100%;
208
+ &:not(:first-child) {
209
+ margin-left: 4px;
210
+ }
211
+ }
212
+ & .el-date-editor{
213
+ &:not(:first-child){
214
+ margin-left: 4px;
215
+ }
216
+ }
217
+ }
218
218
  </style>
@@ -1,7 +1,7 @@
1
- import SearchSelect from './src/SearchSelect.vue'
2
-
3
- SearchSelect.install = function (Vue) {
4
- Vue.component(SearchSelect.name, SearchSelect)
5
- }
6
-
7
- export default SearchSelect
1
+ import SearchSelect from './src/SearchSelect.vue'
2
+
3
+ SearchSelect.install = function (Vue) {
4
+ Vue.component(SearchSelect.name, SearchSelect)
5
+ }
6
+
7
+ export default SearchSelect