aaa-ui-test 1.0.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.

Potentially problematic release.


This version of aaa-ui-test might be problematic. Click here for more details.

Files changed (189) hide show
  1. package/README.md +62 -0
  2. package/babel-plugin-on-demand-load/index.js +74 -0
  3. package/babel-plugin-on-demand-load/report.js +49 -0
  4. package/lib/address/index.js +19 -0
  5. package/lib/address/src/address.js +340 -0
  6. package/lib/amount/index.js +19 -0
  7. package/lib/amount/src/amount.js +206 -0
  8. package/lib/button/index.js +19 -0
  9. package/lib/button/src/button.js +75 -0
  10. package/lib/button-group/index.js +19 -0
  11. package/lib/button-group/src/button-group.js +53 -0
  12. package/lib/checkbox/index.js +22 -0
  13. package/lib/checkbox/src/checkbox-group.js +85 -0
  14. package/lib/checkbox/src/checkbox.js +228 -0
  15. package/lib/components/address/index.js +19 -0
  16. package/lib/components/amount/index.js +19 -0
  17. package/lib/components/button/index.js +19 -0
  18. package/lib/components/button-group/index.js +19 -0
  19. package/lib/components/checkbox/index.js +22 -0
  20. package/lib/components/date-selecter/index.js +19 -0
  21. package/lib/components/default/index.js +19 -0
  22. package/lib/components/dialog/index.js +204 -0
  23. package/lib/components/field/index.js +19 -0
  24. package/lib/components/input/index.js +19 -0
  25. package/lib/components/list/index.js +19 -0
  26. package/lib/components/list-item/index.js +19 -0
  27. package/lib/components/loading/index.js +116 -0
  28. package/lib/components/mask/index.js +19 -0
  29. package/lib/components/notice/index.js +19 -0
  30. package/lib/components/overlay/index.js +19 -0
  31. package/lib/components/picker/index.js +19 -0
  32. package/lib/components/popup/index.js +19 -0
  33. package/lib/components/popup-header/index.js +19 -0
  34. package/lib/components/radio/index.js +19 -0
  35. package/lib/components/select/index.js +19 -0
  36. package/lib/components/swiper/index.js +19 -0
  37. package/lib/components/switch/index.js +19 -0
  38. package/lib/components/tabs/index.js +22 -0
  39. package/lib/components/textarea/index.js +19 -0
  40. package/lib/components/toast/index.js +60 -0
  41. package/lib/date-selecter/index.js +19 -0
  42. package/lib/date-selecter/src/dateselecter.js +544 -0
  43. package/lib/default/index.js +19 -0
  44. package/lib/default/src/default.js +61 -0
  45. package/lib/dialog/index.js +204 -0
  46. package/lib/dialog/src/dialog.js +258 -0
  47. package/lib/field/index.js +19 -0
  48. package/lib/field/src/field.js +91 -0
  49. package/lib/index.css +2213 -0
  50. package/lib/index.js +10083 -0
  51. package/lib/input/index.js +19 -0
  52. package/lib/input/src/input.js +365 -0
  53. package/lib/list/index.js +19 -0
  54. package/lib/list/src/list.js +54 -0
  55. package/lib/list-item/index.js +19 -0
  56. package/lib/list-item/src/list-item.js +122 -0
  57. package/lib/loading/index.js +116 -0
  58. package/lib/loading/src/loading.js +80 -0
  59. package/lib/mask/index.js +19 -0
  60. package/lib/mask/src/mask.js +94 -0
  61. package/lib/mixins/emitter.js +43 -0
  62. package/lib/mixins/visible.js +29 -0
  63. package/lib/notice/index.js +19 -0
  64. package/lib/notice/src/notice.js +188 -0
  65. package/lib/overlay/index.js +19 -0
  66. package/lib/overlay/src/overlay.js +153 -0
  67. package/lib/picker/index.js +19 -0
  68. package/lib/picker/src/picker.js +218 -0
  69. package/lib/popup/index.js +19 -0
  70. package/lib/popup/src/popup.js +170 -0
  71. package/lib/popup-header/index.js +19 -0
  72. package/lib/popup-header/src/popup-header.js +93 -0
  73. package/lib/radio/index.js +19 -0
  74. package/lib/radio/src/radio.js +102 -0
  75. package/lib/select/index.js +19 -0
  76. package/lib/select/src/select.js +136 -0
  77. package/lib/swiper/index.js +19 -0
  78. package/lib/swiper/src/swiper.js +270 -0
  79. package/lib/switch/index.js +19 -0
  80. package/lib/switch/src/switch.js +143 -0
  81. package/lib/tabs/index.js +22 -0
  82. package/lib/tabs/src/tab-item.js +72 -0
  83. package/lib/tabs/src/tabs.js +171 -0
  84. package/lib/textarea/index.js +19 -0
  85. package/lib/textarea/src/textarea.js +219 -0
  86. package/lib/toast/index.js +60 -0
  87. package/lib/toast/src/toast.js +59 -0
  88. package/lib/utils/clickoutside.js +45 -0
  89. package/lib/utils/fix-body.js +57 -0
  90. package/lib/utils/utils.js +74 -0
  91. package/package.json +73 -0
  92. package/src/assets/css/common/_mixin.scss +130 -0
  93. package/src/assets/css/common/_var.scss +69 -0
  94. package/src/components/address/index.js +8 -0
  95. package/src/components/address/index.scss +72 -0
  96. package/src/components/address/src/address.vue +238 -0
  97. package/src/components/amount/index.js +6 -0
  98. package/src/components/amount/index.scss +88 -0
  99. package/src/components/amount/src/amount.vue +143 -0
  100. package/src/components/button/__tests__/__snapshots__/index.test.js.snap +7 -0
  101. package/src/components/button/__tests__/index.test.js +39 -0
  102. package/src/components/button/index.js +7 -0
  103. package/src/components/button/index.scss +83 -0
  104. package/src/components/button/src/button.vue +39 -0
  105. package/src/components/button-group/index.js +8 -0
  106. package/src/components/button-group/index.scss +37 -0
  107. package/src/components/button-group/src/button-group.vue +21 -0
  108. package/src/components/checkbox/index.js +8 -0
  109. package/src/components/checkbox/index.scss +47 -0
  110. package/src/components/checkbox/src/checkbox-group.vue +53 -0
  111. package/src/components/checkbox/src/checkbox.vue +153 -0
  112. package/src/components/date-selecter/index.js +6 -0
  113. package/src/components/date-selecter/index.scss +190 -0
  114. package/src/components/date-selecter/src/dateselecter.vue +387 -0
  115. package/src/components/default/index.js +6 -0
  116. package/src/components/default/index.scss +25 -0
  117. package/src/components/default/src/default.vue +23 -0
  118. package/src/components/dialog/index.js +146 -0
  119. package/src/components/dialog/index.scss +250 -0
  120. package/src/components/dialog/src/dialog.vue +153 -0
  121. package/src/components/field/index.js +8 -0
  122. package/src/components/field/index.scss +93 -0
  123. package/src/components/field/src/field.vue +57 -0
  124. package/src/components/input/__tests__/__snapshots__/index.test.js.snap +10 -0
  125. package/src/components/input/__tests__/index.test.js +63 -0
  126. package/src/components/input/index.js +8 -0
  127. package/src/components/input/index.scss +91 -0
  128. package/src/components/input/src/input.vue +214 -0
  129. package/src/components/list/index.js +8 -0
  130. package/src/components/list/index.scss +21 -0
  131. package/src/components/list/src/list.vue +16 -0
  132. package/src/components/list-item/index.js +8 -0
  133. package/src/components/list-item/index.scss +126 -0
  134. package/src/components/list-item/src/list-item.vue +59 -0
  135. package/src/components/loading/__tests__/__snapshots__/index.test.js.snap +9 -0
  136. package/src/components/loading/__tests__/index.test.js +30 -0
  137. package/src/components/loading/index.js +128 -0
  138. package/src/components/loading/index.scss +33 -0
  139. package/src/components/loading/src/loading.vue +23 -0
  140. package/src/components/mask/index.js +9 -0
  141. package/src/components/mask/index.scss +16 -0
  142. package/src/components/mask/src/mask.vue +52 -0
  143. package/src/components/notice/index.js +6 -0
  144. package/src/components/notice/index.scss +81 -0
  145. package/src/components/notice/src/notice.vue +128 -0
  146. package/src/components/overlay/index.js +8 -0
  147. package/src/components/overlay/index.scss +119 -0
  148. package/src/components/overlay/src/overlay.vue +72 -0
  149. package/src/components/picker/index.js +7 -0
  150. package/src/components/picker/index.scss +49 -0
  151. package/src/components/picker/src/picker.vue +205 -0
  152. package/src/components/popup/index.js +8 -0
  153. package/src/components/popup/index.scss +79 -0
  154. package/src/components/popup/src/popup.vue +88 -0
  155. package/src/components/popup-header/index.js +8 -0
  156. package/src/components/popup-header/index.scss +45 -0
  157. package/src/components/popup-header/src/popup-header.vue +41 -0
  158. package/src/components/radio/index.js +8 -0
  159. package/src/components/radio/index.scss +19 -0
  160. package/src/components/radio/src/radio.vue +51 -0
  161. package/src/components/select/index.js +8 -0
  162. package/src/components/select/index.scss +51 -0
  163. package/src/components/select/src/select.vue +86 -0
  164. package/src/components/swiper/index.js +6 -0
  165. package/src/components/swiper/index.scss +49 -0
  166. package/src/components/swiper/src/swiper.vue +211 -0
  167. package/src/components/switch/__tests__/__snapshots__/index.test.js.snap +15 -0
  168. package/src/components/switch/__tests__/index.test.js +44 -0
  169. package/src/components/switch/index.js +8 -0
  170. package/src/components/switch/index.scss +85 -0
  171. package/src/components/switch/src/switch.vue +60 -0
  172. package/src/components/tabs/index.js +8 -0
  173. package/src/components/tabs/index.scss +73 -0
  174. package/src/components/tabs/src/tab-item.vue +40 -0
  175. package/src/components/tabs/src/tabs.vue +121 -0
  176. package/src/components/textarea/index.js +8 -0
  177. package/src/components/textarea/index.scss +41 -0
  178. package/src/components/textarea/src/textarea.vue +140 -0
  179. package/src/components/toast/__tests__/__snapshots__/index.test.js.snap +3 -0
  180. package/src/components/toast/__tests__/index.test.js +25 -0
  181. package/src/components/toast/index.js +53 -0
  182. package/src/components/toast/index.scss +102 -0
  183. package/src/components/toast/src/toast.vue +19 -0
  184. package/src/index.js +87 -0
  185. package/src/mixins/emitter.js +33 -0
  186. package/src/mixins/visible.js +23 -0
  187. package/src/utils/clickoutside.js +42 -0
  188. package/src/utils/fix-body.js +46 -0
  189. package/src/utils/utils.js +71 -0
@@ -0,0 +1,143 @@
1
+ <template>
2
+ <div class="jdd-amount-wrap">
3
+ <span class="jdd-amount-icon">¥</span>
4
+ <p :class="[{'jdd-amount-hasvalue':hasValue},'jdd-amount-edit']" @click="onClick">
5
+ <span class="jdd-amount-value">{{getValue}}</span>
6
+ <span class="jdd-amount-shine" v-show="focus"></span>
7
+ <div class="jdd-amount-unit-wrap" v-show="getUnit" :style="{'left':left+'px'}"><span class="jdd-amount-line"></span><span class="jdd-amount-unit">{{getUnit}}</span></div>
8
+ <span class="jdd-amount-slot">
9
+ <slot></slot>
10
+ </span>
11
+ </div>
12
+ </template>
13
+ <script>
14
+ export default {
15
+ name: "JddAmount",
16
+ props: {
17
+ value: {},
18
+ showUnit: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ placeholder: {
23
+ type: String,
24
+ default: "请输入金额"
25
+ },
26
+ focus: {
27
+ type: Boolean,
28
+ default: false
29
+ }
30
+ },
31
+ inject: {
32
+ handleCheck: {
33
+ default: "itemSelect"
34
+ },
35
+ parent: {
36
+ default: null
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ checkValue: this.value,
42
+ validateStatus: true,
43
+ label: this.title,
44
+ left:0
45
+ };
46
+ },
47
+ created() {
48
+ if (this.isGroup()) {
49
+ this.checkValue = this.parent.value;
50
+ } else {
51
+ this.checkValue = this.value;
52
+ }
53
+ },
54
+ computed: {
55
+ getUnit() {
56
+ let unit = "";
57
+ if (this.showUnit) {
58
+ if (this.value >= 100000&& this.value < 1000000) {
59
+ unit = "十万";
60
+ } else if (this.value >= 10000 && this.value < 100000) {
61
+ unit = "万";
62
+ } else if (this.value >= 1000 && this.value < 10000) {
63
+ unit = "千";
64
+ } else if (this.value >= 100 && this.value < 1000) {
65
+ unit = "百";
66
+ } else if (this.value >= 1000000 && this.value < 10000000){
67
+ unit = "百万";
68
+ } else if (this.value >= 10000000 && this.value < 100000000){
69
+ unit = "千万";
70
+ } else if (this.value >= 10000000 ){
71
+ unit = "亿";
72
+ }
73
+ }
74
+ return unit;
75
+ },
76
+ getFillColor() {
77
+ let finalStyle = "";
78
+ if (!this.disabled && !this.isChecked) {
79
+ return this.fillColor;
80
+ }
81
+ },
82
+ isChecked() {
83
+ if (this.isGroup()) {
84
+ return this.name === this.parent.value;
85
+ } else {
86
+ return this.checkValue;
87
+ }
88
+ },
89
+ getValue() {
90
+ return this.focus
91
+ ? this.value
92
+ : this.value || this.value === 0
93
+ ? this.value
94
+ : this.placeholder;
95
+ // return this.value|| this.value===0?this.value:this.placeholder;
96
+ },
97
+ hasValue() {
98
+ return this.value || this.value === 0 || this.focus;
99
+ }
100
+ },
101
+ methods: {
102
+ onClick() {
103
+ this.$emit("update:focus", true);
104
+ this.$emit("click");
105
+ },
106
+ isGroup() {
107
+ return this.parent ? true : false;
108
+ },
109
+ handleChange() {
110
+ // if(this.isGroup()){
111
+ // }else{
112
+ // this.checkValue =
113
+ // }
114
+ }
115
+ },
116
+ watch: {
117
+ value(newVal) {
118
+ this.checkValue = newVal;
119
+ this.$nextTick(() => {
120
+ if(newVal.length ===1) {
121
+ this.left = document.querySelector(".jdd-amount-value").offsetLeft+document.querySelector(".jdd-amount-value").offsetWidth;
122
+ }
123
+ })
124
+
125
+ }
126
+ // "parent.value": function(newVal) {
127
+ // //if(this.name === newVal)
128
+ // this.checkValue = this.name === newVal ? true : false;
129
+ // },
130
+ // checkValue(newVal) {
131
+ // if (typeof this.handleCheck === "function") {
132
+ // if (newVal) this.handleCheck(this.name);
133
+ // else this.handleCheck("");
134
+ // } else {
135
+ // this.$emit("change", newVal);
136
+ // this.$emit("input", newVal);
137
+ // }
138
+ // }
139
+ }
140
+ };
141
+ </script>
142
+
143
+
@@ -0,0 +1,7 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Button has been called 1`] = `<span class="jdd-button jdd-button-sick is-disabled jdd-button-large"><!----></span>`;
4
+
5
+ exports[`Button rander sick correct 1`] = `<span class="jdd-button jdd-button-sick jdd-button-large"><!----></span>`;
6
+
7
+ exports[`Button renders the correct markup 1`] = `<span class="jdd-button jdd-button-default jdd-button-large"><!----></span>`;
@@ -0,0 +1,39 @@
1
+ // Import the mount() method from the test utils
2
+ // and the component you want to test
3
+ import { mount } from '@vue/test-utils'
4
+ import Button from '../index'
5
+
6
+ describe('Button', () => {
7
+ // Now mount the component and you have the wrapper
8
+ const wrapper = mount(Button)
9
+ const mockFn = jest.fn();
10
+ wrapper.vm.$on('click', mockFn);
11
+
12
+ it('renders the correct markup', () => {
13
+ expect(wrapper.html()).toMatchSnapshot();
14
+
15
+ })
16
+ it('has a span class', () => {
17
+ expect(wrapper.contains('span')).toBe(true)
18
+ expect(wrapper.classes("jdd-button")).toBe(true)
19
+
20
+ })
21
+ // it's also easy to check for the existence of elements
22
+ it('rander sick correct', () => {
23
+ wrapper.setProps({ type: 'sick' })
24
+ expect(wrapper.html()).toMatchSnapshot();
25
+ expect(wrapper.classes('jdd-button-sick')).toBe(true)
26
+ wrapper.find('span').trigger('click');
27
+ expect(mockFn).toBeCalled();
28
+ expect(mockFn).toHaveBeenCalledTimes(1)
29
+ })
30
+
31
+ it('has been called', () => {
32
+ wrapper.setProps({ "disabled": true })
33
+ expect(wrapper.html()).toMatchSnapshot();
34
+ expect(wrapper.classes('is-disabled')).toBe(true)
35
+ wrapper.find('span').trigger('click');
36
+ expect(mockFn).toBeCalled();
37
+ expect(mockFn).toHaveBeenCalledTimes(1);
38
+ })
39
+ })
@@ -0,0 +1,7 @@
1
+ import Button from './src/button.vue';
2
+ import "./index.scss"
3
+ Button.install = function(Vue){
4
+ Vue.component(Button.name, Button);
5
+ }
6
+
7
+ export default Button;
@@ -0,0 +1,83 @@
1
+ @import "~@/assets/css/common/var";
2
+ @import "~@/assets/css/common/mixin";
3
+
4
+
5
+ .jdd-button{
6
+ display: inline-block;
7
+ font-family: PingFangSC-Medium;
8
+ text-align: center;
9
+ font-size: 18px;
10
+ color:#fff;
11
+ margin:0;
12
+ border-radius: 2px;
13
+ &-large{
14
+ width: 100%;
15
+ height: 50px;
16
+ line-height: 50px;
17
+ }
18
+ &-medium{
19
+ height: 50px;
20
+ line-height: 50px;
21
+ padding: 0 84px;
22
+ width: auto;
23
+ }
24
+ &-small{
25
+ height: 30px;
26
+ line-height: 30px;
27
+ font-size: 12px;
28
+ width: 80px;
29
+ border-radius: 30px;
30
+ background: #fff;
31
+
32
+ }
33
+ &-default{
34
+ background: #4D7BFE;
35
+ }
36
+ &-default:active{
37
+ background:#4B84E1;
38
+ }
39
+ &-disabled{
40
+ background: #ccc;
41
+ }
42
+ &-sick{
43
+ background: #B9D1F8;
44
+ }
45
+ &-short{
46
+
47
+ background: #4D7BFE;
48
+ &:active{
49
+ background:#4B84E1;
50
+ }
51
+ }
52
+ &-white.jdd-button-large{
53
+ background: #fff;
54
+ @include jdd-border-1px(#DDDDDD,2px);
55
+ color: #4D7BFE;
56
+ }
57
+ &-white.jdd-button-small{
58
+ background: #fff;
59
+ @include jdd-border-1px(#CCC,15px);
60
+ }
61
+ &-white:active{
62
+ background:#f2f2f2;
63
+ }
64
+
65
+ &-white-normal.jdd-button-large{
66
+ background: #fff;
67
+ @include jdd-border-1px(#DDDDDD,2px);
68
+ color: #666;
69
+ }
70
+ &-white-normal.jdd-button-small{
71
+ background: #fff;
72
+ @include jdd-border-1px(#CCC,15px);
73
+ color: #666;
74
+ }
75
+
76
+ &-white-normal:active{
77
+ background:#f2f2f2;
78
+ }
79
+
80
+
81
+
82
+
83
+ }
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <span
3
+ class="jdd-button"
4
+ @click="handleClick"
5
+ :class="[
6
+ type ? 'jdd-button-' + type : '',
7
+ {
8
+ 'is-disabled': disabled
9
+ },
10
+ 'jdd-button-' + size,
11
+ ]"
12
+ > <span v-if="$slots.default"><slot></slot></span>
13
+ </span>
14
+ </template>
15
+ <script>
16
+ export default {
17
+ name: 'JddButton',
18
+ props: {
19
+ type: {
20
+ type: String,
21
+ default: 'default'
22
+ },
23
+ disabled: {
24
+ type:Boolean,
25
+ default:false
26
+ },
27
+ size: {
28
+ type: String,
29
+ default: 'large'
30
+ }
31
+ },
32
+ methods: {
33
+ handleClick(evt) {
34
+ if(!this.disabled)
35
+ this.$emit('click', evt);
36
+ }
37
+ }
38
+ }
39
+ </script>
@@ -0,0 +1,8 @@
1
+ import ButtonGroup from './src/button-group.vue';
2
+ import "./index.scss";
3
+
4
+ ButtonGroup.install = function(Vue){
5
+ Vue.component(ButtonGroup.name, ButtonGroup);
6
+ }
7
+
8
+ export default ButtonGroup;
@@ -0,0 +1,37 @@
1
+ @charset "utf-8";
2
+ @import "~@/assets/css/common/var";
3
+
4
+ // 多按钮吸底
5
+ .jdd-button-group{
6
+ display: flex;
7
+
8
+ width: 100%;
9
+ font-family: PingFangSC-Medium;
10
+ // height: 50px;
11
+ // line-height: 50px;
12
+ font-size: 18px;
13
+ background: #fff;
14
+ color:#fff;
15
+ span{
16
+ flex:1;
17
+ }
18
+ &-bottom{
19
+ position: fixed;
20
+ bottom: 0;
21
+ z-index: $z-index-description;
22
+ padding-bottom: constant(safe-area-inset-bottom) !important;
23
+ padding-bottom: env(safe-area-inset-bottom) !important;
24
+ .jdd-button{
25
+ border-radius: unset;
26
+ }
27
+ .jdd-button:not(:first-child){
28
+ box-shadow:0 -2px 4px 0 rgba(0,0,0,0.04);
29
+ }
30
+ }
31
+ &-top{
32
+ position: fixed;
33
+ top: 0;
34
+ z-index: $z-index-description
35
+ }
36
+ }
37
+
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <div class="jdd-button-group"
3
+ :class="[
4
+ type ? 'jdd-button-group-' + type : ''
5
+ ]"
6
+ >
7
+ <slot></slot>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ name: 'JddButtonGroup',
14
+ props: {
15
+ type: {
16
+ type: String,
17
+ default: 'default'
18
+ }
19
+ }
20
+ };
21
+ </script>
@@ -0,0 +1,8 @@
1
+ import Checkbox from './src/checkbox.vue';
2
+ import CheckboxGroup from './src/checkbox-group.vue';
3
+ import "./index.scss";
4
+ Checkbox.install = function(Vue){
5
+ Vue.component(Checkbox.name, Checkbox);
6
+ Vue.component(CheckboxGroup.name, CheckboxGroup);
7
+ }
8
+ export default Checkbox;
@@ -0,0 +1,47 @@
1
+ .jdd-checkbox{
2
+ display: flex;
3
+ position: relative;
4
+ }
5
+ .jdd-checkbox-disabled {
6
+ .jdd-checkbox-icon{
7
+ background:rgba(221,221,221,1);
8
+ border:none;
9
+ }
10
+ .jdd-checkbox-label {
11
+ color:rgba(204,204,204,1);
12
+ }
13
+ }
14
+ .jdd-list-item-icon .jdd-checkbox-icon {
15
+ margin-right: 0;
16
+ }
17
+ .jdd-checkbox-icon {
18
+ display: flex;
19
+ position: relative;
20
+ width: 15px;
21
+ height: 15px;
22
+ flex-shrink: 0;
23
+ border-radius: 100%;
24
+ margin-right: 6px;
25
+ }
26
+ .jdd-checkbox-input {
27
+ position: absolute;
28
+ left: 0;
29
+ top: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+ outline: none;
33
+ opacity: 0;
34
+ }
35
+ .jdd-checkbox-checked {
36
+ svg{
37
+ width: 100%;
38
+ height: 100%;
39
+ }
40
+ }
41
+ .jdd-checkbox-unchecked {
42
+ border-width: 1px;
43
+ border-style: solid;
44
+ svg{
45
+ display: none;
46
+ }
47
+ }
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div class="jdd-checkbox-list">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "JddCheckboxGroup",
10
+ props: {
11
+ value: {
12
+ default: 0
13
+ }
14
+ },
15
+ provide() {
16
+ return {
17
+ handleCheck: this.boxChecked,
18
+ parent:this
19
+ };
20
+ },
21
+ data() {
22
+ return {
23
+ checkValue:this.value
24
+ };
25
+ },
26
+ created() {
27
+ let slotsLength = 0;
28
+ if(this.$slots.default&&this.$slots.default.length){
29
+ slotsLength = this.$slots.default.length;
30
+ }
31
+ if(slotsLength >= 5){
32
+ this.needScroll = true;
33
+ }
34
+ //let slotsLength = this.$slots.default.length;
35
+ // console.log()
36
+ },
37
+ methods: {
38
+ itemSelect(value,content) {
39
+ this.$emit("input",value);
40
+ },
41
+ boxChecked(check){
42
+
43
+ this.checkValue = check;
44
+ this.$emit("input",check);
45
+ }
46
+ },
47
+ watch: {
48
+ value(newVal){
49
+ this.checkValue = newVal;
50
+ }
51
+ }
52
+ };
53
+ </script>
@@ -0,0 +1,153 @@
1
+ <template>
2
+ <div class="jdd-checkbox-wrap">
3
+ <label for :class="['jdd-checkbox',disabled?'jdd-checkbox-disabled':'']" @click = "check">
4
+ <span
5
+ class="jdd-checkbox-icon"
6
+ :style="{'borderColor':getFillColor}"
7
+ :class="[isChecked?'jdd-checkbox-checked':'jdd-checkbox-unchecked']"
8
+ >
9
+ <svg
10
+ t="1575962492834"
11
+ viewBox="0 0 1024 1024"
12
+ version="1.1"
13
+ p-id="2415"
14
+ data-spm-anchor-id="a313x.7781069.0.i17"
15
+ >
16
+ <path
17
+ d="M512 0C228.430769 0 0 228.430769 0 512s228.430769 512 512 512 512-228.430769 512-512S795.569231 0 512 0z m256 413.538462l-271.753846 271.753846c-7.876923 7.876923-19.692308 11.815385-31.507692 11.815384-11.815385 0-23.630769-3.938462-31.507693-11.815384l-169.353846-169.353846c-15.753846-15.753846-15.753846-47.261538 0-63.015385 15.753846-15.753846 47.261538-15.753846 63.015385 0l137.846154 137.846154 240.246153-240.246154c15.753846-15.753846 47.261538-15.753846 63.015385 0 19.692308 15.753846 19.692308 47.261538 0 63.015385z"
18
+ p-id="2416"
19
+ :fill="fillColor"
20
+ />
21
+ </svg>
22
+ <input type="checkbox" class="jdd-checkbox-input" v-model="getValue" :disabled="disabled" @change="handleChange"/>
23
+ </span>
24
+
25
+ <span class="jdd-checkbox-label">
26
+ <slot></slot>
27
+ </span>
28
+ </label>
29
+ </div>
30
+ </template>
31
+ <script>
32
+ export default {
33
+ name: "JddCheckbox",
34
+ props: {
35
+ value: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ disabled: {
40
+ type: Boolean,
41
+ default: false
42
+ },
43
+ fillColor: {
44
+ type: String,
45
+ default: "#4D7BFE"
46
+ },
47
+ name: {
48
+ default: undefined
49
+ }
50
+ },
51
+ inject: {
52
+ handleCheck: {
53
+ default: "itemSelect"
54
+ },
55
+ parent: {
56
+ default: null
57
+ }
58
+ },
59
+ data() {
60
+ return {
61
+ checkValue: this.value,
62
+ validateStatus: true,
63
+ label: this.title
64
+ };
65
+ },
66
+ created() {
67
+ if (this.isGroup()) {
68
+ this.checkValue = this.parent.value;
69
+ } else {
70
+ this.checkValue = this.value;
71
+ }
72
+ },
73
+ computed: {
74
+ getFillColor() {
75
+ let finalStyle = "";
76
+ if (!this.disabled && !this.isChecked) {
77
+ return this.fillColor;
78
+ }
79
+ },
80
+ isChecked() {
81
+ if (this.isGroup()) {
82
+ return this.name === this.parent.value;
83
+ } else {
84
+ return this.checkValue;
85
+ }
86
+ },
87
+ getValue:{
88
+ get(){
89
+ if(this.isGroup()){
90
+ return this.parent.value;
91
+ }else{
92
+ return this.checkValue
93
+ }
94
+ },
95
+ set(newVal){
96
+
97
+ if(this.isGroup()){
98
+
99
+ this.handleCheck(this.name);
100
+ // else this.handleCheck("");
101
+ }else{
102
+ this.$emit("change", newVal);
103
+ this.$emit("input", newVal);
104
+ }
105
+ }
106
+ }
107
+ },
108
+ methods: {
109
+ check(target) {
110
+ if(target.target.tagName !== 'A' && !this.disabled){
111
+ if(this.isGroup()){
112
+
113
+ this.handleCheck(this.name);
114
+ // else this.handleCheck("");
115
+ }else{
116
+ this.$emit("change", !this.checkValue);
117
+ this.$emit("input", !this.checkValue);
118
+ }
119
+ }
120
+ },
121
+ isGroup() {
122
+ return this.parent ? true : false;
123
+ },
124
+ handleChange(){
125
+ // if(this.isGroup()){
126
+
127
+ // }else{
128
+ // this.checkValue =
129
+ // }
130
+ }
131
+ },
132
+ watch: {
133
+ value(newVal) {
134
+ this.checkValue = newVal;
135
+ },
136
+ // "parent.value": function(newVal) {
137
+ // //if(this.name === newVal)
138
+ // this.checkValue = this.name === newVal ? true : false;
139
+ // },
140
+ // checkValue(newVal) {
141
+ // if (typeof this.handleCheck === "function") {
142
+ // if (newVal) this.handleCheck(this.name);
143
+ // else this.handleCheck("");
144
+ // } else {
145
+ // this.$emit("change", newVal);
146
+ // this.$emit("input", newVal);
147
+ // }
148
+ // }
149
+ }
150
+ };
151
+ </script>
152
+
153
+
@@ -0,0 +1,6 @@
1
+ import Dateselecter from './src/dateselecter.vue';
2
+ import "./index.scss"
3
+ Dateselecter.install = function(Vue){
4
+ Vue.component(Dateselecter.name, Dateselecter);
5
+ }
6
+ export default Dateselecter;