@lx-frontend/wrap-element-ui 0.4.2-beta.1 → 0.4.2

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 (42) 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 -224
  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/lib/AddMembers.js +1 -0
  24. package/packages/lib/AuditSteps.js +1 -0
  25. package/packages/lib/DemoComponent.js +1 -0
  26. package/packages/lib/Ellipsis.js +1 -0
  27. package/packages/lib/LxTable.js +21 -0
  28. package/packages/lib/PopoverForm.js +1 -0
  29. package/packages/lib/SearchForm.js +1 -0
  30. package/packages/lib/SearchSelect.js +1 -0
  31. package/packages/lib/index.js +21 -0
  32. package/packages/singleMessage/index.ts +44 -44
  33. package/packages/theme-default/gulpfile.js +25 -25
  34. package/packages/theme-default/package.json +23 -23
  35. package/packages/theme-default/src/AuditSteps.scss +52 -52
  36. package/packages/theme-default/src/DemoComponent.scss +9 -9
  37. package/packages/theme-default/src/index.css +11 -11
  38. package/packages/theme-default/src/index.scss +2 -2
  39. package/plugins/wrap.js +22 -22
  40. package/postcss.config.js +5 -5
  41. package/tsconfig.json +41 -41
  42. package/yarn.lock +0 -12226
@@ -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,225 +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, separator, label, placeholder, candidate, filterable=false, withoutAll=false, collapseTags=false,
6
- clearable=false, multiple=false, multipleLimit=0, changeCb, inputLimitCallback, slotName, dateType='date',
7
- doubleIsInline = true, pickerOptionsStart, pickerOptionsEnd,
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
- :pickerOptions="pickerOptionsStart ? pickerOptionsStart : ''"
77
- />
78
- <span v-if="separator" class="ml4">{{separator}}</span>
79
- <el-date-picker
80
- @input="val => handleInput(val, prop[1], '', key)"
81
- @change="(...args) => changeCb && changeCb(...args)"
82
- :value="formData[prop[1]]"
83
- value-format="yyyy-MM-dd"
84
- format="yyyy-MM-dd"
85
- type="date"
86
- :placeholder="(placeholder || [])[1] || '结束日期'"
87
- :pickerOptions="pickerOptionsEnd ? pickerOptionsEnd : ''"
88
- />
89
- <el-checkbox :value="checkedIds[key]" v-if="isEmpty" @change="(value) => handelIsEmpty(prop, value, key)" class="is-empty">空白</el-checkbox>
90
- </div>
91
- <slot
92
- v-if="type === 'slot'"
93
- :name="slotName"
94
- />
95
- </el-form-item >
96
- <span v-if="isShowSearchBtn">
97
- <el-button class="search" @click="handleSearch" type="primary">{{searchText}}</el-button>
98
- <el-button v-if="showClear" @click="handleClearParams">{{clearText}}</el-button>
99
- </span>
100
- </el-form>
101
- </template>
102
-
103
- <script>
104
- export default {
105
- name: 'SearchForm',
106
- props: {
107
- isShowSearchBtn: {
108
- default: true,
109
- type: Boolean
110
- },
111
- isInline: {
112
- default: false,
113
- type: Boolean
114
- },
115
- config: {
116
- required: true,
117
- type: Array
118
- },
119
- width: {
120
- default: '100px',
121
- type: String
122
- },
123
- formData: {
124
- required: true
125
- },
126
- showClear: {
127
- default: true,
128
- type: Boolean
129
- },
130
- showLabel: {
131
- default: true,
132
- type: Boolean
133
- },
134
- ownerClear: {
135
- type: Function
136
- },
137
- resetCheckedIds: {
138
- type: Boolean
139
- },
140
- searchText: {
141
- default: '搜索',
142
- type: String
143
- },
144
- clearText: {
145
- default: '清除',
146
- type: String
147
- },
148
- pickerOptions: {
149
- type: Function
150
- }
151
- },
152
- data () {
153
- return {
154
- visible: true,
155
- initialData: {},
156
- checkedIds: {}
157
- }
158
- },
159
- mounted () {
160
- this.initialData = Object.freeze({ ...this.formData })
161
- },
162
- methods: {
163
- handleInput (val, prop, inputLimitCallback, key) {
164
- if (inputLimitCallback && !inputLimitCallback(val)) return false
165
- if (val) {
166
- this.$set(this.checkedIds, key, false)
167
- }
168
- this.$emit('update:formData', { ...this.formData, [prop]: val })
169
- this.$emit('isPickerEmpty', this.checkedIds)
170
- },
171
-
172
- handleSearch () {
173
- this.$emit('search', this.formData)
174
- },
175
-
176
- handelIsEmpty (prop, value, key) {
177
- if (value) {
178
- this.formData[prop[0]] = '';
179
- this.formData[prop[1]] = '';
180
- }
181
- this.$set(this.checkedIds, key, value)
182
- this.$emit('isPickerEmpty', this.checkedIds)
183
- },
184
-
185
- handleClearParams () { // 父组件可以通过调用 `this.$refs[xx].handleClearParams()` 来清空表单数据
186
- if (this.ownerClear && typeof this.ownerClear === 'function') {
187
- this.ownerClear()
188
- return
189
- }
190
- Object.keys(this.checkedIds).forEach((k) => {
191
- this.checkedIds[k] = false
192
- })
193
- this.$emit('update:formData', { ...this.formData, ...this.initialData })
194
- },
195
-
196
- handleFormClose () {
197
- this.visible = false;
198
- },
199
- },
200
- watch: {
201
- resetCheckedIds () {
202
- this.config.filter(c => c.type === 'doubleDatePicker').map(t => t.key).forEach(k => {
203
- this.$set(this.checkedIds, k, false)
204
- })
205
- }
206
- }
207
- }
208
- </script>
209
- <style scoped lang="scss">
210
- .form-double-inline {
211
- display: flex;
212
- & .el-input {
213
- width: 100%;
214
- &:not(:first-child) {
215
- margin-left: 4px;
216
- }
217
- }
218
- & .el-date-editor{
219
- &:not(:first-child){
220
- margin-left: 4px;
221
- }
222
- }
223
- .ml4{ margin-left: 4px;}
224
- }
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
+ }
225
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