@idooel/components 0.0.1-beta.99 → 0.0.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 (105) hide show
  1. package/README.md +98 -98
  2. package/dist/@idooel/components.esm.js +256 -159
  3. package/dist/@idooel/components.umd.js +256 -159
  4. package/jsconfig.json +7 -7
  5. package/package.json +50 -50
  6. package/packages/alert/index.js +4 -4
  7. package/packages/alert/src/index.vue +45 -45
  8. package/packages/batch-export/index.js +4 -4
  9. package/packages/batch-export/src/index.vue +104 -104
  10. package/packages/business-components/modal-fsm/index.js +4 -4
  11. package/packages/business-components/modal-fsm/src/index.vue +163 -163
  12. package/packages/business-components/modal-import/index.js +4 -4
  13. package/packages/business-components/modal-import/src/index.vue +139 -139
  14. package/packages/business-components/modal-timeline/index.js +4 -4
  15. package/packages/business-components/modal-timeline/src/index.vue +77 -77
  16. package/packages/business-components/tabs-sub-center/index.js +4 -4
  17. package/packages/business-components/tabs-sub-center/src/index.vue +116 -116
  18. package/packages/button/index.js +4 -4
  19. package/packages/button/src/index.vue +65 -65
  20. package/packages/checkbox/index.js +4 -4
  21. package/packages/checkbox/src/index.vue +52 -52
  22. package/packages/composite-components/button-group/index.js +4 -4
  23. package/packages/composite-components/button-group/src/index.vue +151 -151
  24. package/packages/composite-components/form-attachment/src/index.vue +14 -14
  25. package/packages/composite-components/form-img-crop/index.js +4 -4
  26. package/packages/composite-components/form-img-crop/src/index.vue +120 -111
  27. package/packages/composite-components/modal-confirm/index.js +4 -4
  28. package/packages/composite-components/modal-confirm/src/index.vue +103 -103
  29. package/packages/composite-components/modal-form/index.js +4 -4
  30. package/packages/composite-components/modal-form/src/index.vue +230 -223
  31. package/packages/composite-components/modal-img-crop/index.js +4 -4
  32. package/packages/composite-components/modal-img-crop/src/index.vue +298 -289
  33. package/packages/composite-components/modal-table/index.js +4 -4
  34. package/packages/composite-components/modal-table/src/index.vue +155 -155
  35. package/packages/composite-components/modal-tree/index.js +4 -4
  36. package/packages/composite-components/modal-tree/src/index.vue +75 -75
  37. package/packages/composite-components/search-area/index.js +4 -4
  38. package/packages/composite-components/search-area/src/index.vue +237 -237
  39. package/packages/composite-components/search-area/src/label.vue +35 -35
  40. package/packages/composite-components/select-entity-modal-table/index.js +4 -4
  41. package/packages/composite-components/select-entity-modal-table/src/index.vue +171 -168
  42. package/packages/date/index.js +4 -4
  43. package/packages/date/src/index.vue +112 -112
  44. package/packages/date-range/index.js +4 -4
  45. package/packages/date-range/src/index.vue +47 -47
  46. package/packages/form/index.js +4 -4
  47. package/packages/form/src/index.vue +318 -302
  48. package/packages/icon/index.js +4 -4
  49. package/packages/icon/src/index.vue +31 -31
  50. package/packages/index.js +153 -153
  51. package/packages/input/index.js +4 -4
  52. package/packages/input/src/index.vue +35 -35
  53. package/packages/input-number/index.js +4 -4
  54. package/packages/input-number/src/index.vue +23 -23
  55. package/packages/loading/index.js +4 -4
  56. package/packages/loading/src/index.vue +36 -36
  57. package/packages/modal/index.js +4 -4
  58. package/packages/modal/src/index.vue +184 -184
  59. package/packages/models/form-group-model/index.js +4 -4
  60. package/packages/models/form-group-model/src/index.vue +273 -273
  61. package/packages/models/form-model/index.js +4 -4
  62. package/packages/models/form-model/src/index.vue +232 -221
  63. package/packages/models/step-model/index.js +4 -4
  64. package/packages/models/step-model/src/index.vue +224 -224
  65. package/packages/models/tree-table-model/index.js +4 -4
  66. package/packages/models/tree-table-model/src/index.vue +689 -681
  67. package/packages/radio/index.js +4 -4
  68. package/packages/radio/src/index.vue +56 -56
  69. package/packages/select/index.js +4 -4
  70. package/packages/select/src/index.vue +105 -105
  71. package/packages/select-entity/index.js +4 -4
  72. package/packages/select-entity/src/index.vue +119 -119
  73. package/packages/table/index.js +4 -4
  74. package/packages/table/src/action.vue +172 -172
  75. package/packages/table/src/index.vue +289 -335
  76. package/packages/tabs/index.js +4 -4
  77. package/packages/tabs/src/index.vue +55 -55
  78. package/packages/text/index.js +4 -4
  79. package/packages/text/src/index.vue +47 -47
  80. package/packages/text-editor/index.js +4 -4
  81. package/packages/text-editor/src/index.vue +72 -72
  82. package/packages/textarea/index.js +4 -4
  83. package/packages/textarea/src/index.vue +57 -57
  84. package/packages/theme/form.scss +21 -21
  85. package/packages/theme/index.scss +42 -42
  86. package/packages/theme/overrid.scss +7 -7
  87. package/packages/theme/styleClass.scss +2 -2
  88. package/packages/theme/variables.scss +55 -55
  89. package/packages/timeline/index.js +4 -4
  90. package/packages/timeline/src/index.vue +257 -257
  91. package/packages/tpl/index.js +4 -4
  92. package/packages/tpl/src/index.vue +55 -55
  93. package/packages/tree/index.js +4 -4
  94. package/packages/tree/src/TreeNode.vue +29 -29
  95. package/packages/tree/src/index.vue +101 -101
  96. package/packages/tree-select/index.js +4 -4
  97. package/packages/tree-select/src/index.vue +142 -142
  98. package/packages/upload/index.js +4 -4
  99. package/packages/upload/src/index.vue +444 -444
  100. package/packages/utils/index.js +62 -62
  101. package/scripts/rollup.config.js +42 -42
  102. package/scripts/rollup.esm.config.js +11 -11
  103. package/scripts/rollup.umd.config.js +14 -14
  104. package/dist/@idooel/components.esm.js.map +0 -1
  105. package/dist/@idooel/components.umd.js.map +0 -1
@@ -1,169 +1,172 @@
1
- <template>
2
- <section class="select__entity--modal-table">
3
- <ele-select-entity :multiple="multiple" :maxCount="maxCount" :value="entityValue" @close="onClosSelectEntity" @evoke="evokeSelectEntity"></ele-select-entity>
4
- <ele-modal-table
5
- @handleEntitySave="handleEntitySave"
6
- @handleEntityCancel="handleEntityCancel"
7
- :meta="buildMeta"
8
- v-model="showModalTableValue">
9
- </ele-modal-table>
10
- </section>
11
- </template>
12
-
13
- <script>
14
- import { type } from '@idooel/shared'
15
- export default {
16
- name: 'ele-select-entity-modal-table',
17
- model: {
18
- prop: 'value',
19
- event: 'change'
20
- },
21
- props: {
22
- value: {
23
- type: [Array, Object],
24
- default: () => []
25
- },
26
- title: {
27
- type: String
28
- },
29
- maxCount: {
30
- type: Number
31
- },
32
- tableMeta: {
33
- type: Object,
34
- default: () => ({})
35
- },
36
- returnValues: {
37
- type: [String, Object],
38
- default: () => ({})
39
- },
40
- replaceFields: {
41
- type: Object
42
- },
43
- multiple: {
44
- type: Boolean,
45
- default: true
46
- }
47
- },
48
- data() {
49
- return {
50
- showModalTableValue: false,
51
- entityValue: [],
52
- emitValue: void 0
53
- }
54
- },
55
- watch: {
56
- value: {
57
- handler(innerValue) {
58
- const { label, value } = this.replaceFields
59
- this.entityValue = innerValue.map(item => {
60
- return {
61
- label: item[label],
62
- value: item[value]
63
- }
64
- })
65
- },
66
- immediate: true
67
- }
68
- },
69
- computed: {
70
- buildMeta () {
71
- const { tableMeta } = this.tableMeta
72
- Object.assign(tableMeta, { multiple: this.multiple })
73
- return {
74
- ...this.tableMeta,
75
- footerMeta: {
76
- elements: (ctx) => [
77
- {
78
- label: '确定',
79
- type: 'primary',
80
- key: 'save',
81
- eventName: 'handleEntitySave'
82
- },
83
- {
84
- label: '返回',
85
- key: 'cancel',
86
- eventName: 'handleEntityCancel'
87
- }
88
- ]
89
- }
90
- }
91
- }
92
- },
93
- created () {
94
- this.emitValue = this.multiple ? [] : void 0
95
- },
96
- methods: {
97
- handleEntityCancel () {
98
- this.showModalTableValue = false
99
- },
100
- buildEntityValueForEmitObjectReturnValues (dataSource = []) {
101
- const keys = Object.keys(this.returnValues)
102
- const ret = dataSource.map(props => {
103
- const ret = {}
104
- keys.forEach(key => {
105
- ret[key] = props[this.returnValues[key]]
106
- })
107
- return ret
108
- })
109
- return this.multiple ? ret : ret[0]
110
- },
111
- emitEntityValue (dataSource = []) {
112
- if (this.multiple) {
113
- if (type.isStr(this.returnValues)) {
114
- this.emitValue = dataSource.map(props => {
115
- return props[this.returnValues]
116
- })
117
- } else if (type.isObject(this.returnValues)) {
118
- this.emitValue = this.buildEntityValueForEmitObjectReturnValues(dataSource)
119
- }
120
- } else {
121
- if (type.isStr(this.returnValues)) {
122
- this.emitValue = dataSource ? dataSource[this.returnValues] : ''
123
- } else if (type.isObject(this.returnValues)) {
124
- this.emitValue = dataSource ? this.buildEntityValueForEmitObjectReturnValues([dataSource]) : ''
125
- }
126
- }
127
- this.$emit('change', this.emitValue)
128
- },
129
- onClosSelectEntity (props) {
130
- this.entityValue = this.entityValue.filter(item => item.value !== props.value)
131
- if (this.multiple) {
132
- if (type.isStr(this.returnValues)) {
133
- this.emitValue = this.emitValue.filter(item => item !== props.value)
134
- } else if (type.isObject(this.returnValues)) {
135
- const reverseReturnValues = Object.fromEntries(Object.entries(this.returnValues).map(([key, value]) => [value, key]))
136
- const primaryKey = reverseReturnValues[this.replaceFields.value]
137
- this.emitValue = this.emitValue.filter(item => item[primaryKey] !== props.value)
138
- }
139
- } else {
140
- if (type.isStr(this.returnValues)) {
141
- this.emitValue = ''
142
- } else if (type.isObject(this.returnValues)) {
143
- this.emitValue = {}
144
- }
145
- }
146
- this.$emit('change', this.emitValue)
147
- },
148
- handleEntitySave (props) {
149
- const { exposed = {} } = props
150
- const { currentTableSelection } = exposed
151
- const currentTableSelectionRet = type.isArray(currentTableSelection) ? currentTableSelection : [currentTableSelection]
152
- this.entityValue = currentTableSelectionRet.map(item => {
153
- return {
154
- label: item[this.replaceFields.label],
155
- value: item[this.replaceFields.value]
156
- }
157
- })
158
- this.emitEntityValue(currentTableSelection)
159
- this.showModalTableValue = false
160
- },
161
- showModalTable () {
162
- this.showModalTableValue = true
163
- },
164
- evokeSelectEntity () {
165
- this.showModalTable()
166
- }
167
- }
168
- }
1
+ <template>
2
+ <section class="select__entity--modal-table">
3
+ <ele-select-entity :multiple="multiple" :maxCount="maxCount" :value="entityValue" @close="onClosSelectEntity" @evoke="evokeSelectEntity"></ele-select-entity>
4
+ <ele-modal-table
5
+ @handleEntitySave="handleEntitySave"
6
+ @handleEntityCancel="handleEntityCancel"
7
+ :meta="buildMeta"
8
+ v-model="showModalTableValue">
9
+ </ele-modal-table>
10
+ </section>
11
+ </template>
12
+
13
+ <script>
14
+ import { type } from '@idooel/shared'
15
+ export default {
16
+ name: 'ele-select-entity-modal-table',
17
+ model: {
18
+ prop: 'value',
19
+ event: 'change'
20
+ },
21
+ props: {
22
+ value: {
23
+ type: [Array, Object],
24
+ default: () => []
25
+ },
26
+ title: {
27
+ type: String
28
+ },
29
+ maxCount: {
30
+ type: Number
31
+ },
32
+ tableMeta: {
33
+ type: Object,
34
+ default: () => ({})
35
+ },
36
+ returnValues: {
37
+ type: [String, Object],
38
+ default: () => ({})
39
+ },
40
+ replaceFields: {
41
+ type: Object
42
+ },
43
+ multiple: {
44
+ type: Boolean,
45
+ default: true
46
+ }
47
+ },
48
+ data() {
49
+ return {
50
+ showModalTableValue: false,
51
+ entityValue: [],
52
+ emitValue: void 0
53
+ }
54
+ },
55
+ watch: {
56
+ value: {
57
+ handler(innerValue) {
58
+ const _innerValue = type.isArray(innerValue) ? innerValue : [innerValue]
59
+ const { label, value } = this.replaceFields
60
+ this.entityValue = _innerValue.map(item => {
61
+ return {
62
+ label: item[label],
63
+ value: item[value]
64
+ }
65
+ })
66
+ },
67
+ immediate: true
68
+ }
69
+ },
70
+ computed: {
71
+ buildMeta () {
72
+ const { tableMeta } = this.tableMeta
73
+ Object.assign(tableMeta, { multiple: this.multiple })
74
+ return {
75
+ ...this.tableMeta,
76
+ footerMeta: {
77
+ elements: (ctx) => [
78
+ {
79
+ label: '确定',
80
+ type: 'primary',
81
+ key: 'save',
82
+ eventName: 'handleEntitySave'
83
+ },
84
+ {
85
+ label: '返回',
86
+ key: 'cancel',
87
+ eventName: 'handleEntityCancel'
88
+ }
89
+ ]
90
+ }
91
+ }
92
+ }
93
+ },
94
+ created () {
95
+ this.emitValue = this.multiple ? [] : void 0
96
+ },
97
+ methods: {
98
+ handleEntityCancel () {
99
+ this.showModalTableValue = false
100
+ },
101
+ buildEntityValueForEmitObjectReturnValues (dataSource = []) {
102
+ const keys = Object.keys(this.returnValues)
103
+ const ret = dataSource.map(props => {
104
+ const ret = {}
105
+ keys.forEach(key => {
106
+ ret[key] = props[this.returnValues[key]]
107
+ })
108
+ return ret
109
+ })
110
+ return this.multiple ? ret : ret[0]
111
+ },
112
+ emitEntityValue (dataSource = []) {
113
+ this.emitValue = this.value
114
+ if (this.multiple) {
115
+ if (type.isStr(this.returnValues)) {
116
+ const ret = dataSource.map(props => {
117
+ return props[this.returnValues]
118
+ })
119
+ this.emitValue.push(...ret)
120
+ } else if (type.isObject(this.returnValues)) {
121
+ this.emitValue.push(...this.buildEntityValueForEmitObjectReturnValues(dataSource))
122
+ }
123
+ } else {
124
+ if (type.isStr(this.returnValues)) {
125
+ this.emitValue = dataSource ? dataSource[this.returnValues] : ''
126
+ } else if (type.isObject(this.returnValues)) {
127
+ this.emitValue = dataSource ? this.buildEntityValueForEmitObjectReturnValues([dataSource]) : ''
128
+ }
129
+ }
130
+ this.$emit('change', this.emitValue)
131
+ },
132
+ onClosSelectEntity (props) {
133
+ this.entityValue = this.entityValue.filter(item => item.value !== props.value)
134
+ if (this.multiple) {
135
+ if (type.isStr(this.returnValues)) {
136
+ this.emitValue = this.emitValue.filter(item => item !== props.value)
137
+ } else if (type.isObject(this.returnValues)) {
138
+ const reverseReturnValues = Object.fromEntries(Object.entries(this.returnValues).map(([key, value]) => [value, key]))
139
+ const primaryKey = reverseReturnValues[this.replaceFields.value]
140
+ this.emitValue = this.emitValue.filter(item => item[primaryKey] !== props.value)
141
+ }
142
+ } else {
143
+ if (type.isStr(this.returnValues)) {
144
+ this.emitValue = ''
145
+ } else if (type.isObject(this.returnValues)) {
146
+ this.emitValue = {}
147
+ }
148
+ }
149
+ this.$emit('change', this.emitValue)
150
+ },
151
+ handleEntitySave (props) {
152
+ const { exposed = {} } = props
153
+ const { currentTableSelection } = exposed
154
+ const currentTableSelectionRet = type.isArray(currentTableSelection) ? currentTableSelection : [currentTableSelection]
155
+ this.entityValue = currentTableSelectionRet.map(item => {
156
+ return {
157
+ label: item[this.replaceFields.label],
158
+ value: item[this.replaceFields.value]
159
+ }
160
+ })
161
+ this.emitEntityValue(currentTableSelection)
162
+ this.showModalTableValue = false
163
+ },
164
+ showModalTable () {
165
+ this.showModalTableValue = true
166
+ },
167
+ evokeSelectEntity () {
168
+ this.showModalTable()
169
+ }
170
+ }
171
+ }
169
172
  </script>
@@ -1,5 +1,5 @@
1
- import EleDate from './src/index.vue'
2
-
3
- EleDate.install = Vue => Vue.component(EleDate.name, EleDate)
4
-
1
+ import EleDate from './src/index.vue'
2
+
3
+ EleDate.install = Vue => Vue.component(EleDate.name, EleDate)
4
+
5
5
  export default EleDate
@@ -1,113 +1,113 @@
1
- <template>
2
- <div class="ele-date__wrapper">
3
- <a-date-picker
4
- style="width: 100%;"
5
- :mode="modeValue"
6
- v-if="modeValue == 'year'"
7
- :open="open"
8
- :disabled="disabled"
9
- :value="value"
10
- :placeholder="placeholder"
11
- :show-time="showTime"
12
- :show-today="showToday"
13
- :valueFormat="innerValueFormat"
14
- @panelChange="onPanelChange"
15
- @openChange="openChange"
16
- @change="onChange"
17
- :format="format">
18
- </a-date-picker>
19
- <a-date-picker
20
- v-else
21
- style="width: 100%;"
22
- :placeholder="placeholder"
23
- :open="open"
24
- :disabled="disabled"
25
- :value="value"
26
- :show-time="showTime"
27
- :show-today="showToday"
28
- :valueFormat="innerValueFormat"
29
- @panelChange="onPanelChange"
30
- @openChange="openChange"
31
- @change="onChange"
32
- :format="format">
33
- </a-date-picker>
34
- </div>
35
- </template>
36
-
37
- <script>
38
- import moment from 'moment'
39
- export default {
40
- name: 'ele-date',
41
- model: {
42
- prop: 'value',
43
- event: 'change'
44
- },
45
- props: {
46
- value: {
47
- type: [String, Object]
48
- },
49
- disabled: {
50
- type: Boolean,
51
- default: false
52
- },
53
- format: {
54
- type: String,
55
- default: 'YYYY/MM/DD'
56
- },
57
- mode: {
58
- type: String
59
- },
60
- valueFormat: {
61
- type: String
62
- },
63
- showTime: {
64
- type: [Boolean, Object],
65
- default: true
66
- },
67
- showToday: {
68
- type: Boolean,
69
- default: true
70
- },
71
- placeholder: {
72
- type: String,
73
- default: '请选择日期'
74
- }
75
- },
76
- data () {
77
- return {
78
- open: false
79
- }
80
- },
81
- computed: {
82
- innerValueFormat () {
83
- if (this.valueFormat) return this.valueFormat
84
- return this.format
85
- },
86
- modeValue () {
87
- if (this.mode) return this.mode
88
- if (this.format === 'YYYY') return 'year'
89
- return 'date'
90
- }
91
- },
92
- methods: {
93
- onChange (_, dataString) {
94
- this.$emit('input', dataString)
95
- this.$emit('change', dataString)
96
- },
97
- onPanelChange (value, mode) {
98
- if (this.modeValue !== 'year') return
99
- this.$emit('input', moment(value).format(this.format))
100
- this.$emit('change', moment(value).format(this.format))
101
- this.open = false
102
- },
103
- openChange (open) {
104
- this.open = open
105
- }
106
- }
107
- }
108
- </script>
109
- <style lang="scss" scoped>
110
- .ele-date__wrapper {
111
- width: 100%;
112
- }
1
+ <template>
2
+ <div class="ele-date__wrapper">
3
+ <a-date-picker
4
+ style="width: 100%;"
5
+ :mode="modeValue"
6
+ v-if="modeValue == 'year'"
7
+ :open="open"
8
+ :disabled="disabled"
9
+ :value="value"
10
+ :placeholder="placeholder"
11
+ :show-time="showTime"
12
+ :show-today="showToday"
13
+ :valueFormat="innerValueFormat"
14
+ @panelChange="onPanelChange"
15
+ @openChange="openChange"
16
+ @change="onChange"
17
+ :format="format">
18
+ </a-date-picker>
19
+ <a-date-picker
20
+ v-else
21
+ style="width: 100%;"
22
+ :placeholder="placeholder"
23
+ :open="open"
24
+ :disabled="disabled"
25
+ :value="value"
26
+ :show-time="showTime"
27
+ :show-today="showToday"
28
+ :valueFormat="innerValueFormat"
29
+ @panelChange="onPanelChange"
30
+ @openChange="openChange"
31
+ @change="onChange"
32
+ :format="format">
33
+ </a-date-picker>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import moment from 'moment'
39
+ export default {
40
+ name: 'ele-date',
41
+ model: {
42
+ prop: 'value',
43
+ event: 'change'
44
+ },
45
+ props: {
46
+ value: {
47
+ type: [String, Object]
48
+ },
49
+ disabled: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ format: {
54
+ type: String,
55
+ default: 'YYYY/MM/DD'
56
+ },
57
+ mode: {
58
+ type: String
59
+ },
60
+ valueFormat: {
61
+ type: String
62
+ },
63
+ showTime: {
64
+ type: [Boolean, Object],
65
+ default: true
66
+ },
67
+ showToday: {
68
+ type: Boolean,
69
+ default: true
70
+ },
71
+ placeholder: {
72
+ type: String,
73
+ default: '请选择日期'
74
+ }
75
+ },
76
+ data () {
77
+ return {
78
+ open: false
79
+ }
80
+ },
81
+ computed: {
82
+ innerValueFormat () {
83
+ if (this.valueFormat) return this.valueFormat
84
+ return this.format
85
+ },
86
+ modeValue () {
87
+ if (this.mode) return this.mode
88
+ if (this.format === 'YYYY') return 'year'
89
+ return 'date'
90
+ }
91
+ },
92
+ methods: {
93
+ onChange (_, dataString) {
94
+ this.$emit('input', dataString)
95
+ this.$emit('change', dataString)
96
+ },
97
+ onPanelChange (value, mode) {
98
+ if (this.modeValue !== 'year') return
99
+ this.$emit('input', moment(value).format(this.format))
100
+ this.$emit('change', moment(value).format(this.format))
101
+ this.open = false
102
+ },
103
+ openChange (open) {
104
+ this.open = open
105
+ }
106
+ }
107
+ }
108
+ </script>
109
+ <style lang="scss" scoped>
110
+ .ele-date__wrapper {
111
+ width: 100%;
112
+ }
113
113
  </style>
@@ -1,5 +1,5 @@
1
- import EleDateRange from './src/index.vue'
2
-
3
- EleDateRange.install = Vue => Vue.component(EleDateRange.name, EleDateRange)
4
-
1
+ import EleDateRange from './src/index.vue'
2
+
3
+ EleDateRange.install = Vue => Vue.component(EleDateRange.name, EleDateRange)
4
+
5
5
  export default EleDateRange