zartui 0.1.113 → 2.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.
Files changed (159) hide show
  1. package/es/action-sheet/index.css +1 -1
  2. package/es/action-sheet/index.js +3 -3
  3. package/es/action-sheet/index.less +12 -8
  4. package/es/area/style/index.js +1 -0
  5. package/es/area/style/less.js +1 -0
  6. package/es/avatar/index.css +1 -1
  7. package/es/button/index.css +1 -1
  8. package/es/button/index.js +28 -13
  9. package/es/button/index.less +60 -27
  10. package/es/calendar/components/Header.js +1 -6
  11. package/es/calendar/index.css +1 -1
  12. package/es/calendar/index.js +31 -8
  13. package/es/calendar/index.less +16 -10
  14. package/es/cell/index.css +1 -1
  15. package/es/cell/index.js +60 -38
  16. package/es/cell/index.less +67 -12
  17. package/es/cell/shared.js +2 -0
  18. package/es/checkbox/index.css +1 -1
  19. package/es/checkbox/index.less +18 -6
  20. package/es/checkbox-group/index.js +1 -0
  21. package/es/datetime-picker/style/index.js +1 -0
  22. package/es/datetime-picker/style/less.js +1 -0
  23. package/es/field/index.css +1 -1
  24. package/es/field/index.js +80 -7
  25. package/es/field/index.less +60 -8
  26. package/es/icon/index.css +1 -1
  27. package/es/image/index.css +1 -1
  28. package/es/image-preview/ImagePreview.js +1 -1
  29. package/es/image-preview/index.css +1 -1
  30. package/es/image-preview/index.less +4 -2
  31. package/es/index.js +1 -1
  32. package/es/loading/index.css +1 -1
  33. package/es/loading/index.js +3 -3
  34. package/es/loading/index.less +1 -1
  35. package/es/media-picker/image/PickFileIcon.js +2 -9
  36. package/es/media-picker/image/PickPhotoIcon.js +2 -9
  37. package/es/media-picker/image/TakeAudioIcon.js +2 -9
  38. package/es/media-picker/image/TakePhotoIcon.js +2 -9
  39. package/es/media-picker/image/TakeVideoIcon.js +2 -9
  40. package/es/media-picker/index.css +1 -1
  41. package/es/media-picker/index.less +6 -4
  42. package/es/mixins/checkbox.js +12 -30
  43. package/es/multiple-picker/index.css +1 -1
  44. package/es/multiple-picker/index.js +18 -11
  45. package/es/multiple-picker/index.less +11 -5
  46. package/es/multiple-picker/style/index.js +1 -0
  47. package/es/multiple-picker/style/less.js +1 -0
  48. package/es/pdf-viewer/style/index.js +1 -0
  49. package/es/pdf-viewer/style/less.js +1 -0
  50. package/es/picker/index.css +1 -1
  51. package/es/picker/index.js +18 -9
  52. package/es/picker/index.less +18 -2
  53. package/es/picker/style/index.js +1 -0
  54. package/es/picker/style/less.js +1 -0
  55. package/es/popup/index.css +1 -1
  56. package/es/popup/index.js +1 -1
  57. package/es/popup/index.less +2 -2
  58. package/es/radio/index.css +1 -1
  59. package/es/radio/index.less +23 -22
  60. package/es/radio-group/index.js +1 -0
  61. package/es/signature/index.js +7 -6
  62. package/es/signature/index.less +1 -1
  63. package/es/step/index.css +1 -1
  64. package/es/step/index.js +3 -5
  65. package/es/step/index.less +3 -1
  66. package/es/stepper/index.css +1 -1
  67. package/es/steps/index.css +1 -1
  68. package/es/steps/index.less +3 -3
  69. package/es/style/reset.css +1 -1
  70. package/es/style/var.less +92 -53
  71. package/es/switch-cell/index.css +1 -1
  72. package/es/tabs/Title.js +6 -1
  73. package/es/tabs/index.css +1 -1
  74. package/es/tabs/index.js +2 -4
  75. package/es/tabs/index.less +18 -15
  76. package/es/toast/index.css +1 -1
  77. package/es/uploader/index.css +1 -1
  78. package/lib/action-sheet/index.css +1 -1
  79. package/lib/action-sheet/index.js +3 -3
  80. package/lib/action-sheet/index.less +12 -8
  81. package/lib/area/style/index.js +1 -0
  82. package/lib/area/style/less.js +1 -0
  83. package/lib/avatar/index.css +1 -1
  84. package/lib/button/index.css +1 -1
  85. package/lib/button/index.js +28 -13
  86. package/lib/button/index.less +60 -27
  87. package/lib/calendar/components/Header.js +1 -6
  88. package/lib/calendar/index.css +1 -1
  89. package/lib/calendar/index.js +31 -8
  90. package/lib/calendar/index.less +16 -10
  91. package/lib/cell/index.css +1 -1
  92. package/lib/cell/index.js +60 -38
  93. package/lib/cell/index.less +67 -12
  94. package/lib/cell/shared.js +2 -0
  95. package/lib/checkbox/index.css +1 -1
  96. package/lib/checkbox/index.less +18 -6
  97. package/lib/checkbox-group/index.js +1 -0
  98. package/lib/datetime-picker/style/index.js +1 -0
  99. package/lib/datetime-picker/style/less.js +1 -0
  100. package/lib/field/index.css +1 -1
  101. package/lib/field/index.js +80 -7
  102. package/lib/field/index.less +60 -8
  103. package/lib/icon/index.css +1 -1
  104. package/lib/image/index.css +1 -1
  105. package/lib/image-preview/ImagePreview.js +1 -1
  106. package/lib/image-preview/index.css +1 -1
  107. package/lib/image-preview/index.less +4 -2
  108. package/lib/index.css +1 -1
  109. package/lib/index.js +1 -1
  110. package/lib/index.less +1 -1
  111. package/lib/loading/index.css +1 -1
  112. package/lib/loading/index.js +3 -3
  113. package/lib/loading/index.less +1 -1
  114. package/lib/media-picker/image/PickFileIcon.js +2 -9
  115. package/lib/media-picker/image/PickPhotoIcon.js +2 -9
  116. package/lib/media-picker/image/TakeAudioIcon.js +2 -9
  117. package/lib/media-picker/image/TakePhotoIcon.js +2 -9
  118. package/lib/media-picker/image/TakeVideoIcon.js +2 -9
  119. package/lib/media-picker/index.css +1 -1
  120. package/lib/media-picker/index.less +6 -4
  121. package/lib/mixins/checkbox.js +12 -30
  122. package/lib/multiple-picker/index.css +1 -1
  123. package/lib/multiple-picker/index.js +19 -11
  124. package/lib/multiple-picker/index.less +11 -5
  125. package/lib/multiple-picker/style/index.js +1 -0
  126. package/lib/multiple-picker/style/less.js +1 -0
  127. package/lib/pdf-viewer/style/index.js +1 -0
  128. package/lib/pdf-viewer/style/less.js +1 -0
  129. package/lib/picker/index.css +1 -1
  130. package/lib/picker/index.js +19 -9
  131. package/lib/picker/index.less +18 -2
  132. package/lib/picker/style/index.js +1 -0
  133. package/lib/picker/style/less.js +1 -0
  134. package/lib/popup/index.css +1 -1
  135. package/lib/popup/index.js +1 -1
  136. package/lib/popup/index.less +2 -2
  137. package/lib/radio/index.css +1 -1
  138. package/lib/radio/index.less +23 -22
  139. package/lib/radio-group/index.js +1 -0
  140. package/lib/signature/index.js +7 -6
  141. package/lib/signature/index.less +1 -1
  142. package/lib/step/index.css +1 -1
  143. package/lib/step/index.js +3 -5
  144. package/lib/step/index.less +3 -1
  145. package/lib/stepper/index.css +1 -1
  146. package/lib/steps/index.css +1 -1
  147. package/lib/steps/index.less +3 -3
  148. package/lib/style/reset.css +1 -1
  149. package/lib/style/var.less +92 -53
  150. package/lib/switch-cell/index.css +1 -1
  151. package/lib/tabs/Title.js +6 -1
  152. package/lib/tabs/index.css +1 -1
  153. package/lib/tabs/index.js +2 -4
  154. package/lib/tabs/index.less +18 -15
  155. package/lib/toast/index.css +1 -1
  156. package/lib/uploader/index.css +1 -1
  157. package/lib/zart.js +547 -450
  158. package/lib/zart.min.js +1 -1
  159. package/package.json +3 -3
package/lib/cell/index.js CHANGED
@@ -34,27 +34,65 @@ function Cell(h, props, slots, ctx) {
34
34
  label = props.label,
35
35
  value = props.value,
36
36
  isLink = props.isLink,
37
- placeholder = props.placeholder;
37
+ placeholder = props.placeholder,
38
+ direction = props.direction,
39
+ subtitle = props.subtitle;
38
40
  var showTitle = slots.title || (0, _utils.isDef)(title);
41
+ var clickable = (_props$clickable = props.clickable) != null ? _props$clickable : isLink;
39
42
 
40
43
  function Label() {
41
44
  var showLabel = slots.label || (0, _utils.isDef)(label);
42
45
 
43
- if (showLabel) {
46
+ if (showLabel && direction !== "column") {
44
47
  return h("div", {
45
48
  "class": [bem('label'), props.labelClass]
46
49
  }, [slots.label ? slots.label() : label]);
47
50
  }
48
51
  }
49
52
 
53
+ function LeftIcon() {
54
+ if (slots.icon) {
55
+ return slots.icon();
56
+ }
57
+
58
+ if (icon) {
59
+ return h(_icon.default, {
60
+ "class": bem('left-icon'),
61
+ "attrs": {
62
+ "name": icon,
63
+ "classPrefix": props.iconPrefix
64
+ }
65
+ });
66
+ }
67
+ } // 渲染副标题
68
+
69
+
70
+ function renderSubTitle() {
71
+ if (direction === "column") {
72
+ if (slots != null && slots.subtitle) {
73
+ return h("div", {
74
+ "class": bem('title-subtitle')
75
+ }, [slots == null ? void 0 : slots.subtitle()]);
76
+ }
77
+
78
+ if (subtitle) {
79
+ return h("div", {
80
+ "class": bem('title-subtitle')
81
+ }, [subtitle]);
82
+ }
83
+ }
84
+ }
85
+
50
86
  function Title() {
51
87
  if (showTitle) {
52
88
  return h("div", {
53
89
  "class": [bem('title'), props.titleClass],
54
90
  "style": props.titleStyle
55
- }, [slots.title ? slots.title() : h("span", [title]), Label(), props.required ? h("span", {
91
+ }, [LeftIcon(), slots.title ? slots.title() : h("span", {
92
+ "class": bem('title-content')
93
+ }, [title, Label()]), props.required ? h("span", {
56
94
  "style": "color:#ff5023;margin-left:4px;"
57
- }, ["*"]) : ""]);
95
+ }, ["*"]) : "", renderSubTitle()]);
58
96
  }
59
97
  }
60
98
 
@@ -68,36 +106,6 @@ function Cell(h, props, slots, ctx) {
68
106
  }
69
107
  }
70
108
 
71
- function Value() {
72
- var showValue = slots.default || (0, _utils.isDef)(value);
73
-
74
- if (showValue) {
75
- return h("div", {
76
- "class": [bem('value', {
77
- alone: !showTitle
78
- }), props.valueClass]
79
- }, [slots.default ? slots.default() : value !== "" ? h("span", [value]) : PlaceholderSpan()]);
80
- } else {
81
- return PlaceholderSpan();
82
- }
83
- }
84
-
85
- function LeftIcon() {
86
- if (slots.icon) {
87
- return slots.icon();
88
- }
89
-
90
- if (icon) {
91
- return h(_icon.default, {
92
- "class": bem('left-icon'),
93
- "attrs": {
94
- "name": icon,
95
- "classPrefix": props.iconPrefix
96
- }
97
- });
98
- }
99
- }
100
-
101
109
  function RightIcon() {
102
110
  var rightIconSlot = slots['right-icon'];
103
111
 
@@ -116,14 +124,28 @@ function Cell(h, props, slots, ctx) {
116
124
  }
117
125
  }
118
126
 
127
+ function Value() {
128
+ var showValue = slots.default || (0, _utils.isDef)(value) || clickable;
129
+
130
+ if (showValue) {
131
+ return h("div", {
132
+ "class": [bem('value', {
133
+ alone: !showTitle
134
+ }), props.valueClass, direction === 'column' && clickable ? bem('clickable') : '']
135
+ }, [slots.default ? slots.default() : value !== "" ? h("span", {
136
+ "class": bem('value-content')
137
+ }, [value]) : PlaceholderSpan(), slots.extra == null ? void 0 : slots.extra(), RightIcon()]);
138
+ } else {
139
+ return PlaceholderSpan();
140
+ }
141
+ }
142
+
119
143
  function onClick(event) {
120
144
  (0, _functional.emit)(ctx, 'click', event);
121
145
  (0, _router.functionalRoute)(ctx);
122
146
  }
123
147
 
124
- var clickable = (_props$clickable = props.clickable) != null ? _props$clickable : isLink;
125
148
  var classes = {
126
- clickable: clickable,
127
149
  center: props.center,
128
150
  // required: props.required,
129
151
  borderless: !props.border,
@@ -135,7 +157,7 @@ function Cell(h, props, slots, ctx) {
135
157
  }
136
158
 
137
159
  return h("div", (0, _babelHelperVueJsxMergeProps.default)([{
138
- "class": bem(classes),
160
+ "class": [bem(classes), direction === 'column' ? bem('direction-column') : '', clickable && direction !== 'column' ? bem('clickable') : ''],
139
161
  "attrs": {
140
162
  "role": clickable ? 'button' : null,
141
163
  "tabindex": clickable ? 0 : null
@@ -143,7 +165,7 @@ function Cell(h, props, slots, ctx) {
143
165
  "on": {
144
166
  "click": onClick
145
167
  }
146
- }, (0, _functional.inherit)(ctx)]), [LeftIcon(), Title(), Value(), RightIcon(), slots.extra == null ? void 0 : slots.extra()]);
168
+ }, (0, _functional.inherit)(ctx)]), [Title(), Value()]);
147
169
  }
148
170
 
149
171
  Cell.props = (0, _extends2.default)({}, _shared.cellProps, _router.routeProps);
@@ -22,9 +22,9 @@
22
22
  }
23
23
  }
24
24
 
25
- &::after {
26
- .hairline-bottom(@cell-border-color, @padding-md, );
27
- }
25
+ // &::after {
26
+ // .hairline-bottom(@cell-border-color, @padding-md, );
27
+ // }
28
28
 
29
29
  &:last-child::after,
30
30
  &--borderless::after {
@@ -40,19 +40,28 @@
40
40
 
41
41
  &__title,
42
42
  &__value {
43
+ display: flex;
43
44
  flex: 1;
45
+ &-content {
46
+ flex: 18;
47
+ }
48
+ .zt-icon {
49
+ flex: 1;
50
+ display: flex;
51
+ justify-content: flex-end;
52
+ }
44
53
  }
45
54
 
46
55
  &__placeholder {
47
56
  color: @field-placeholder-text-color;
48
- flex: 1;
57
+ flex: 9;
49
58
  text-align: right;
50
59
  }
51
60
 
52
61
  &__value {
53
62
  position: relative;
54
63
  overflow: hidden;
55
- color: @cell-value-color;
64
+ color: @cell-text-color;
56
65
  text-align: right;
57
66
  vertical-align: middle;
58
67
  word-wrap: break-word;
@@ -80,13 +89,7 @@
80
89
  color: @cell-right-icon-color;
81
90
  }
82
91
 
83
- &--clickable {
84
- cursor: pointer;
85
-
86
- &:active {
87
- background-color: @cell-active-color;
88
- }
89
- }
92
+
90
93
 
91
94
  &--center {
92
95
  align-items: center;
@@ -105,3 +108,55 @@
105
108
  }
106
109
  }
107
110
  }
111
+
112
+ .zt-cell__direction-column {
113
+ flex-direction: column;
114
+ background-color: #f5faff;
115
+ font-size: 14px;
116
+ line-height: 20px;
117
+ .zt-cell__title {
118
+ margin-bottom: 8px;
119
+ display: flex;
120
+ align-items: center;
121
+ &-content {
122
+ white-space: nowrap;
123
+ overflow: hidden;
124
+ text-overflow: ellipsis;
125
+ flex: 1;
126
+ }
127
+ &-subtitle {
128
+ display: flex;
129
+ white-space: nowrap;
130
+ justify-content: flex-end;
131
+ flex: 1;
132
+ opacity: 0.4;
133
+ }
134
+ }
135
+
136
+ .zt-cell__value {
137
+ display: flex;
138
+ text-align: left;
139
+ min-height: 44px;
140
+ padding: 12px;
141
+ box-sizing: border-box;
142
+ background-color: white;
143
+ align-items: center;
144
+ .zt-icon {
145
+ flex: 2;
146
+ display: flex;
147
+ justify-content: flex-end;
148
+ }
149
+ &-content {
150
+ flex: 18;
151
+ word-break: break-all;
152
+ }
153
+ }
154
+ }
155
+
156
+
157
+ .zt-cell__clickable {
158
+ cursor: pointer;
159
+ &:active {
160
+ background-color: @cell-active-color;
161
+ }
162
+ }
@@ -18,6 +18,8 @@ var cellProps = {
18
18
  value: [Number, String],
19
19
  label: [Number, String],
20
20
  arrowDirection: String,
21
+ direction: String,
22
+ subtitle: String,
21
23
  border: {
22
24
  type: Boolean,
23
25
  default: true
@@ -1 +1 @@
1
- .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 0}.zt-checkbox--disabled{cursor:not-allowed}.zt-checkbox--label-disabled{cursor:default}.zt-checkbox--horizontal{margin-left:12px}.zt-checkbox__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-checkbox__icon i,.zt-checkbox__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-checkbox__icon--round .zt-icon{border-radius:100%}.zt-checkbox__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-checkbox__icon--disabled{cursor:not-allowed}.zt-checkbox__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-checkbox__icon--disabled.zt-checkbox__icon--checked .zt-icon{opacity:.4;background-color:#0091fa;color:#fff}.zt-checkbox__label{margin-left:8px;color:#000;line-height:24px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}
1
+ .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:14px 0}.zt-checkbox--disabled{cursor:not-allowed}.zt-checkbox--label-disabled{cursor:default}.zt-checkbox--horizontal{margin-left:12px}.zt-checkbox__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-checkbox__icon i,.zt-checkbox__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-checkbox__icon--round .zt-icon{border-radius:100%}.zt-checkbox__icon--checked .zt-icon{color:#fff;background:#0091fa;box-shadow:inset 1px 1px 2px 0 rgba(0,0,0,.2);border:1px solid rgba(255,255,255,.5)}.zt-checkbox__icon--disabled{cursor:not-allowed}.zt-checkbox__icon--disabled .zt-icon{border:1px solid rgba(255,255,255,.5);box-shadow:-1px -1px 2px 0 #fff,0 0 3px 0 rgba(45,75,115,.2);background-image:-webkit-linear-gradient(316deg,#e1e6eb 0,#e5edf5 100%);background-image:linear-gradient(134deg,#e1e6eb 0,#e5edf5 100%)}.zt-checkbox__icon--disabled.zt-checkbox__icon--checked .zt-icon{opacity:.4;background:#0091fa;color:#fff}.zt-checkbox__label{margin-left:8px;color:#000;line-height:24px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}.zt-checkbox__disable-icon .zt-checkbox__icon--round:not(.zt-checkbox__icon--disabled,.zt-checkbox__icon--checked){width:18px;height:18px;border-radius:100%;background-image:-webkit-linear-gradient(315deg,#e6ebf0 0,#fff 100%);background-image:linear-gradient(135deg,#e6ebf0 0,#fff 100%);border:1px solid rgba(45,75,115,.13);box-shadow:-1px -1px 2px 0 #fff,0 0 3px 0 rgba(45,75,115,.2)}
@@ -40,7 +40,6 @@
40
40
  font-size: 0.8em;
41
41
  line-height: 1.25;
42
42
  text-align: center;
43
- border: 1px solid @checkbox-border-color;
44
43
  transition-duration: @checkbox-transition-duration;
45
44
  transition-property: color, border-color, background-color;
46
45
  }
@@ -54,8 +53,9 @@
54
53
  &--checked {
55
54
  .zt-icon {
56
55
  color: @white;
57
- background-color: @checkbox-checked-icon-color;
58
- border-color: @checkbox-checked-icon-color;
56
+ background: @checkbox-checked-icon-color;
57
+ box-shadow: inset 1px 1px 2px 0 @gray-a2;
58
+ border: 1px solid rgba(255,255,255,0.50);
59
59
  }
60
60
  }
61
61
 
@@ -63,15 +63,16 @@
63
63
  cursor: not-allowed;
64
64
 
65
65
  .zt-icon {
66
- background-color: @checkbox-disabled-background-color;
67
- border-color: @checkbox-disabled-icon-color;
66
+ border: 1px solid @checkbox-disabled-border-color;
67
+ box-shadow: -1px -1px 2px 0 #fff, 0 0 3px 0 rgba(45,75,115,0.20);
68
+ background-image: @gradient-white;
68
69
  }
69
70
  }
70
71
 
71
72
  &--disabled&--checked {
72
73
  .zt-icon {
73
74
  opacity: .4;
74
- background-color: @checkbox-checked-icon-color;
75
+ background: @radio-checked-icon-color;
75
76
  color: @white;
76
77
  }
77
78
  }
@@ -91,3 +92,14 @@
91
92
  }
92
93
  }
93
94
  }
95
+
96
+ .zt-checkbox__disable-icon {
97
+ .zt-checkbox__icon--round:not(.zt-checkbox__icon--disabled,.zt-checkbox__icon--checked){
98
+ width: 18px;
99
+ height: 18px;
100
+ border-radius: 100%;
101
+ background-image: @gradient-white-1;
102
+ border: 1px solid @radio-border-color;
103
+ box-shadow: -1px -1px 2px 0 #FFF, 0 0 3px 0 rgba(45,75,115,0.20);
104
+ }
105
+ }
@@ -21,6 +21,7 @@ var _default2 = createComponent({
21
21
  direction: String,
22
22
  iconSize: [Number, String],
23
23
  checkedColor: String,
24
+ boxShadow: String,
24
25
  value: {
25
26
  type: Array,
26
27
  default: function _default() {
@@ -4,4 +4,5 @@ require('../../info/index.css');
4
4
  require('../../icon/index.css');
5
5
  require('../../popup/index.css');
6
6
  require('../../loading/index.css');
7
+ require('../../button/index.css');
7
8
  require('../../picker/index.css');
@@ -4,4 +4,5 @@ require('../../info/index.less');
4
4
  require('../../icon/index.less');
5
5
  require('../../popup/index.less');
6
6
  require('../../loading/index.less');
7
+ require('../../button/index.less');
7
8
  require('../../picker/index.less');
@@ -1 +1 @@
1
- .zt-field__root{position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;background-color:#fff;padding:10px 16px}.zt-field__root::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:16px;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt-field__root--borderless::after,.zt-field__root:last-child::after{display:none}.zt-field{padding:0;background-color:#fff}.zt-field::after{display:none}.zt-field__label{-webkit-box-flex:0;-webkit-flex:none;flex:none;box-sizing:border-box;width:6.2em;margin-right:12px;color:#646566;text-align:left;word-wrap:break-word;vertical-align:middle}.zt-field__label--center{text-align:center}.zt-field__label--right{text-align:right}.zt-field--disabled .zt-field__label{color:#c8c9cc}.zt-field__value{overflow:visible}.zt-field__body{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-field__body input{caret-color:#0091fa}.zt-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:rgba(0,0,0,.6);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none}.zt-field__control::-webkit-input-placeholder{color:#c8c9cc}.zt-field__control::placeholder{color:#c8c9cc}.zt-field__control:disabled{color:#c8c9cc;cursor:not-allowed;opacity:1;-webkit-text-fill-color:#c8c9cc}.zt-field__control:read-only{cursor:default}.zt-field__control--center{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center}.zt-field__control--right{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;text-align:right}.zt-field__control--custom{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;min-height:24px}.zt-field__control[type=date],.zt-field__control[type=datetime-local],.zt-field__control[type=time]{min-height:24px}.zt-field__control[type=search]{-webkit-appearance:none}.zt-field__button,.zt-field__clear,.zt-field__icon,.zt-field__right-icon{-webkit-flex-shrink:0;flex-shrink:0}.zt-field__clear,.zt-field__right-icon{margin-right:-8px;padding:0 8px;line-height:inherit}.zt-field__zt-clear-icon{margin-right:-8px;padding:0 8px;height:20px}.zt-field__clear{color:#c8c9cc;font-size:16px;cursor:pointer}.zt-field__left-icon .zt-icon,.zt-field__right-icon .zt-icon{display:block;font-size:16px;line-height:inherit}.zt-field__zt-left-icon{margin-right:4px;height:20px}.zt-field__zt-clear-size,.zt-field__zt-left-icon-size{width:20px;height:20px}.zt-field__left-icon{margin-right:4px}.zt-field__right-icon{color:#969799}.zt-field__button{padding-left:8px}.zt-field__error-message{position:relative;background-color:rgba(230,35,20,.08);margin-top:10px;padding:5px 8px;color:#ff5023;font-size:12px;line-height:20px;text-align:left;word-break:break-all}.zt-field__error-message::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:0;right:0;left:0;border-top:1px solid #ff5023;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt-field__error-message--center{text-align:center}.zt-field__error-message--right{text-align:right}.zt-field__word-limit{margin-top:4px;color:#646566;font-size:12px;line-height:16px;text-align:left}.zt-field--error .zt-field__control::-webkit-input-placeholder{color:#e62314;-webkit-text-fill-color:currentColor}.zt-field--error .zt-field__control,.zt-field--error .zt-field__control::placeholder{color:#e62314;-webkit-text-fill-color:currentColor}.zt-field--error-label span{color:#ff5023}
1
+ .zt-field__root{position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;background-color:#fff;padding:10px 16px}.zt-field__root--borderless::after,.zt-field__root:last-child::after{display:none}.zt-field{padding:0}.zt-field::after{display:none}.zt-field__label{-webkit-box-flex:0;-webkit-flex:none;flex:none;box-sizing:border-box;margin-right:12px;color:#646566;text-align:left;word-wrap:break-word;vertical-align:middle;-webkit-box-flex:4;-webkit-flex:4;flex:4}.zt-field__label--center{text-align:center}.zt-field__label--right{text-align:right}.zt-field--disabled .zt-field__label{color:#c8c9cc}.zt-field__value{overflow:visible;-webkit-box-flex:6;-webkit-flex:6;flex:6;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.zt-field__body{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-field__body input{caret-color:#0091fa}.zt-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:#2d4b73;line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;font-size:14px}.zt-field__control::-webkit-input-placeholder{color:#c8c9cc}.zt-field__control::placeholder{color:#c8c9cc}.zt-field__control:disabled{color:#c8c9cc;cursor:not-allowed;opacity:1;-webkit-text-fill-color:#c8c9cc}.zt-field__control:read-only{cursor:default}.zt-field__control--center{-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;text-align:center}.zt-field__control--right{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;text-align:right}.zt-field__control--custom{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;min-height:24px}.zt-field__control[type=date],.zt-field__control[type=datetime-local],.zt-field__control[type=time]{min-height:24px}.zt-field__control[type=search]{-webkit-appearance:none}.zt-field__button,.zt-field__clear,.zt-field__icon,.zt-field__right-icon{-webkit-flex-shrink:0;flex-shrink:0}.zt-field__clear,.zt-field__right-icon{margin-right:-8px;padding:0 8px;line-height:inherit}.zt-field__zt-clear-icon{margin-right:-8px;padding:0 8px;height:20px}.zt-field__clear{color:#c8c9cc;font-size:16px;cursor:pointer}.zt-field__left-icon .zt-icon,.zt-field__right-icon .zt-icon{display:block;font-size:16px;line-height:inherit}.zt-field__zt-left-icon{margin-right:4px;height:20px}.zt-field__zt-clear-size,.zt-field__zt-left-icon-size{width:20px;height:20px}.zt-field__left-icon{margin-right:4px}.zt-field__right-icon{color:#969799}.zt-field__button{padding-left:8px}.zt-field__error-message{position:relative;background-color:rgba(230,35,20,.08);margin-top:0;padding:5px 8px;color:#ff5023;font-size:12px;line-height:20px;text-align:left;word-break:break-all}.zt-field__error-message::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:0;right:0;left:0;border-top:1px solid #ff5023;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt-field__error-message--center{text-align:center}.zt-field__error-message--right{text-align:right}.zt-field__word-limit{margin-top:4px;color:#646566;font-size:12px;line-height:16px;text-align:left}.zt-field--error .zt-field__control::-webkit-input-placeholder{color:#e62314;-webkit-text-fill-color:currentColor}.zt-field--error .zt-field__control,.zt-field--error .zt-field__control::placeholder{color:#e62314;-webkit-text-fill-color:currentColor}.zt-field--error-label span{color:#ff5023}.zt-field__column{background-color:#f5faff}.zt-field__column .zt-field__label{margin-right:0;line-height:20px}.zt-field__column .zt-field__label-content{color:#2d4b73}.zt-field__column .zt-field__value{-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.zt-field__column .zt-field__value .zt-field__body{-webkit-box-flex:8;-webkit-flex:8;flex:8}.zt-field__column .zt-field__value .zt-field__body textarea{padding-bottom:16px}.zt-field__column .zt-field__word-limit{position:absolute;bottom:12px}.zt-field__column .zt-field__no-error{background:rgba(45,75,115,.04);color:rgba(45,75,115,.6)}.zt-field__column .zt-field__no-error::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:0;right:0;left:0;border-top:1px solid #000;-webkit-transform:scaleY(.5);transform:scaleY(.5);opacity:.2}
@@ -84,7 +84,7 @@ var _default = createComponent({
84
84
  },
85
85
  error: {
86
86
  type: Boolean,
87
- default: null
87
+ default: false
88
88
  },
89
89
  colon: {
90
90
  type: Boolean,
@@ -601,7 +601,7 @@ var _default = createComponent({
601
601
  if (message) {
602
602
  var errorMessageAlign = this.getProp('errorMessageAlign');
603
603
  return h("div", {
604
- "class": bem('error-message', errorMessageAlign)
604
+ "class": [bem('error-message', errorMessageAlign), this.error ? '' : bem('no-error')]
605
605
  }, [message]);
606
606
  }
607
607
  },
@@ -623,12 +623,14 @@ var _default = createComponent({
623
623
  }
624
624
 
625
625
  if (this.label) {
626
- return h("span", [this.label + colon]);
626
+ return h("span", {
627
+ "class": bem('label-content')
628
+ }, [this.label + colon]);
627
629
  }
628
630
  }
629
631
  },
630
632
  render: function render() {
631
- var _bem;
633
+ var _bem2;
632
634
 
633
635
  var h = arguments[0];
634
636
  var slots = this.slots;
@@ -653,6 +655,76 @@ var _default = createComponent({
653
655
  };
654
656
  }
655
657
 
658
+ if (this.direction === 'column') {
659
+ var _bem;
660
+
661
+ return h("div", {
662
+ "class": [bem('root'), bem("column")]
663
+ }, [h(_cell.default, {
664
+ "attrs": {
665
+ "icon": this.leftIcon,
666
+ "size": this.size,
667
+ "center": this.center,
668
+ "border": this.border,
669
+ "isLink": this.isLink,
670
+ "required": this.required,
671
+ "clickable": this.clickable,
672
+ "titleStyle": this.labelStyle,
673
+ "valueClass": bem('value'),
674
+ "titleClass": [bem('label', labelAlign), this.labelClass, {
675
+ 'zt-field--error-label': this.showErrorMessage
676
+ }],
677
+ "arrowDirection": this.arrowDirection,
678
+ "noFlex": this.type === 'textarea',
679
+ "direction": this.direction
680
+ },
681
+ "scopedSlots": scopedSlots,
682
+ "class": bem((_bem = {
683
+ error: this.showError,
684
+ disabled: disabled
685
+ }, _bem["label-" + labelAlign] = labelAlign, _bem['min-height'] = this.type === 'textarea' && !this.autosize, _bem)),
686
+ "on": {
687
+ "click": this.onClick
688
+ }
689
+ }, [h("div", {
690
+ "class": bem('body')
691
+ }, [this.genInput(), this.showClear &&
692
+ /*<Icon
693
+ name="clear"
694
+ class={bem('clear')}
695
+ onTouchstart={this.onClear}
696
+ />*/
697
+ h("div", {
698
+ "class": bem('zt-clear-icon'),
699
+ "on": {
700
+ "touchstart": this.onClear,
701
+ "click": this.onClear
702
+ }
703
+ }, [h(_ClearIcon.default, {
704
+ "class": bem('zt-clear-size'),
705
+ "attrs": {
706
+ "color": this.iconColor
707
+ }
708
+ })]), this.type === 'password' && h("div", {
709
+ "on": {
710
+ "click": this.togglePwdVisible
711
+ },
712
+ "style": "width:20px;height:20px;margin-left:12px;display:flex;justify-content:center;align-items:center;color:rgba(0,0,0,.4);"
713
+ }, [this.showPassword ? h(_icon.default, {
714
+ "attrs": {
715
+ "name": "eye-open",
716
+ "color": this.iconColor
717
+ }
718
+ }) : h(_icon.default, {
719
+ "attrs": {
720
+ "name": "eye-closed",
721
+ "color": this.iconColor
722
+ }
723
+ })]), this.genWordLimit(), this.genRightIcon(), slots('button') && h("div", {
724
+ "class": bem('button')
725
+ }, [slots('button')])])]), this.genMessage()]);
726
+ }
727
+
656
728
  return h("div", {
657
729
  "class": bem('root')
658
730
  }, [h(_cell.default, {
@@ -670,13 +742,14 @@ var _default = createComponent({
670
742
  'zt-field--error-label': this.showErrorMessage
671
743
  }],
672
744
  "arrowDirection": this.arrowDirection,
673
- "noFlex": this.type === 'textarea'
745
+ "noFlex": this.type === 'textarea',
746
+ "direction": this.direction
674
747
  },
675
748
  "scopedSlots": scopedSlots,
676
- "class": bem((_bem = {
749
+ "class": bem((_bem2 = {
677
750
  error: this.showError,
678
751
  disabled: disabled
679
- }, _bem["label-" + labelAlign] = labelAlign, _bem['min-height'] = this.type === 'textarea' && !this.autosize, _bem)),
752
+ }, _bem2["label-" + labelAlign] = labelAlign, _bem2['min-height'] = this.type === 'textarea' && !this.autosize, _bem2)),
680
753
  "on": {
681
754
  "click": this.onClick
682
755
  }
@@ -7,9 +7,9 @@
7
7
  background-color: @field-background-color;
8
8
  padding: @field-vertical-padding @field-horizontal-padding;
9
9
 
10
- &::after {
11
- .hairline-bottom(@cell-border-color, @padding-md, );
12
- }
10
+ // &::after {
11
+ // .hairline-bottom(@cell-border-color, @padding-md, );
12
+ // }
13
13
 
14
14
  &:last-child::after,
15
15
  &--borderless::after {
@@ -19,8 +19,7 @@
19
19
 
20
20
  .zt-field {
21
21
  padding: 0;
22
- background-color: @field-background-color;
23
-
22
+ // background-color: @field-background-color;
24
23
  &::after {
25
24
  display: none;
26
25
  }
@@ -28,12 +27,13 @@
28
27
  &__label {
29
28
  flex: none;
30
29
  box-sizing: border-box;
31
- width: @field-label-width;
30
+ // width: @field-label-width;
32
31
  margin-right: @field-label-margin-right;
33
32
  color: @field-label-color;
34
33
  text-align: left;
35
34
  word-wrap: break-word;
36
35
  vertical-align: middle;
36
+ flex: 4;
37
37
  &--center {
38
38
  text-align: center;
39
39
  }
@@ -51,6 +51,8 @@
51
51
 
52
52
  &__value {
53
53
  overflow: visible;
54
+ flex: 6;
55
+ justify-content: flex-end;
54
56
  }
55
57
 
56
58
  &__body {
@@ -59,6 +61,7 @@
59
61
  input {
60
62
  caret-color: @blue;
61
63
  }
64
+
62
65
  }
63
66
 
64
67
  &__control {
@@ -68,12 +71,13 @@
68
71
  min-width: 0; // for flex-shrink in field__button
69
72
  margin: 0;
70
73
  padding: 0;
71
- color: @field-input-text-color;
74
+ color: #2D4B73;
72
75
  line-height: inherit;
73
76
  text-align: left;
74
77
  background-color: transparent;
75
78
  border: 0;
76
79
  resize: none;
80
+ font-size: 14px;
77
81
 
78
82
  &::placeholder {
79
83
  color: @field-placeholder-text-color;
@@ -177,7 +181,8 @@
177
181
  &__error-message {
178
182
  position: relative;
179
183
  background-color: @field-error-background-color;
180
- margin-top: @field-error-message-margin-top;
184
+ // margin-top: @field-error-message-margin-top;
185
+ margin-top: 0;
181
186
  padding: @field-error-message-padding;
182
187
  color: @field-error-message-color;
183
188
  font-size: @field-error-message-text-size;
@@ -198,6 +203,8 @@
198
203
  }
199
204
  }
200
205
 
206
+
207
+
201
208
  &__word-limit {
202
209
  margin-top: @padding-base;
203
210
  color: @field-word-limit-color;
@@ -229,3 +236,48 @@
229
236
  }
230
237
  }
231
238
  }
239
+
240
+ .zt-field__column {
241
+ background-color: #f5faff;
242
+ .zt-field__label {
243
+ margin-right: 0px;
244
+ line-height: 20px;
245
+ // label内容
246
+ &-content {
247
+ color: #2D4B73;
248
+ }
249
+ }
250
+
251
+ .zt-field__value {
252
+ justify-content: flex-start;
253
+ .zt-field__body {
254
+ flex: 8;
255
+ textarea {
256
+ padding-bottom: 16px;
257
+ }
258
+ }
259
+ }
260
+
261
+ .zt-field__word-limit {
262
+ position: absolute;
263
+ bottom: 12px;
264
+ }
265
+
266
+ .zt-field__no-error {
267
+ background: rgba(45,75,115,0.04);
268
+ color: rgba(45,75,115,0.60);
269
+ &::after {
270
+ position: absolute;
271
+ box-sizing: border-box;
272
+ content: ' ';
273
+ pointer-events: none;
274
+ top: 0;
275
+ right: 0;
276
+ left: 0;
277
+ border-top: 1px solid #000000;
278
+ -webkit-transform: scaleY(0.5);
279
+ transform: scaleY(0.5);
280
+ opacity: 0.2;
281
+ }
282
+ }
283
+ }