zartui 2.0.1 → 2.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 (55) hide show
  1. package/es/button/index.css +1 -1
  2. package/es/cell/index.css +1 -1
  3. package/es/cell/index.js +3 -3
  4. package/es/cell/index.less +5 -5
  5. package/es/checkbox/index.css +1 -1
  6. package/es/checkbox/index.less +10 -19
  7. package/es/field/index.css +1 -1
  8. package/es/field/index.js +16 -4
  9. package/es/field/index.less +21 -3
  10. package/es/index.js +1 -1
  11. package/es/media-picker/index.js +22 -17
  12. package/es/media-picker/style/index.js +4 -0
  13. package/es/media-picker/style/less.js +4 -0
  14. package/es/popup/index.css +1 -1
  15. package/es/popup/index.js +119 -48
  16. package/es/popup/index.less +29 -0
  17. package/es/radio/index.css +1 -1
  18. package/es/radio/index.less +9 -15
  19. package/es/search/index.css +1 -1
  20. package/es/search/index.js +1 -1
  21. package/es/search/index.less +31 -3
  22. package/es/style/var.less +16 -11
  23. package/es/switch-cell/index.css +1 -1
  24. package/lib/7893e51cf0a4877dac80.worker.js +10 -0
  25. package/lib/be09b519a460e229fd8d.worker.js +2527 -0
  26. package/lib/button/index.css +1 -1
  27. package/lib/cell/index.css +1 -1
  28. package/lib/cell/index.js +3 -3
  29. package/lib/cell/index.less +5 -5
  30. package/lib/checkbox/index.css +1 -1
  31. package/lib/checkbox/index.less +10 -19
  32. package/lib/field/index.css +1 -1
  33. package/lib/field/index.js +16 -4
  34. package/lib/field/index.less +21 -3
  35. package/lib/index.css +1 -1
  36. package/lib/index.js +1 -1
  37. package/lib/index.less +2 -2
  38. package/lib/media-picker/index.js +22 -11
  39. package/lib/media-picker/style/index.js +4 -0
  40. package/lib/media-picker/style/less.js +4 -0
  41. package/lib/popup/index.css +1 -1
  42. package/lib/popup/index.js +119 -48
  43. package/lib/popup/index.less +29 -0
  44. package/lib/radio/index.css +1 -1
  45. package/lib/radio/index.less +9 -15
  46. package/lib/search/index.css +1 -1
  47. package/lib/search/index.js +1 -1
  48. package/lib/search/index.less +31 -3
  49. package/lib/style/var.less +16 -11
  50. package/lib/switch-cell/index.css +1 -1
  51. package/lib/zart.js +17812 -49870
  52. package/lib/zart.min.js +4 -4
  53. package/package.json +2 -2
  54. package/lib/a037f57fc4d92a8a1f1e.worker.js +0 -60600
  55. package/lib/b7cf90b4775181215df7.worker.js +0 -10
@@ -1 +1 @@
1
- .zt-button{position:relative;display:inline-block;box-sizing:border-box;height:44px;margin:0;padding:0;font-size:16px;line-height:calc(var(16px) * 2 - 8px);text-align:center;border-radius:22px;cursor:pointer;-webkit-transition:opacity .2s;transition:opacity .2s;-webkit-appearance:none}.zt-button::before{position:absolute;top:50%;left:50%;width:100%;height:100%;background-color:#000;border:inherit;border-color:#000;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:' '}.zt-button:active::before{opacity:.1}.zt-button--disabled::before,.zt-button--loading::before{display:none}.zt-button--default{color:#2d4b73;background:#f5faff;border:1px solid rgba(45,75,115,.2)}.zt-button--primary{color:#fff;background:-webkit-linear-gradient(135deg,#3cafff 0,#0091fa 100%);background:linear-gradient(-45deg,#3cafff 0,#0091fa 100%);border:1px solid #3caafa}.zt-button--primary-light{color:#0091fa;background:rgba(1,144,250,.1);border:none}.zt-button--danger{color:#fff;background:#ff5a5a;border:1px solid #ff5a5a}.zt-button--warning{color:#fff;background:#fa8500;border:1px solid #fa8500}.zt-button--success{color:#fff;background:#00e173;border:1px solid #00e173}.zt-button--plain{background:#f5faff}.zt-button--plain.zt-button--primary{color:#3caafa}.zt-button--plain.zt-button--danger{color:#ff5a5a}.zt-button--plain.zt-button--warning{color:#fa8500}.zt-button--plain.zt-button--success{color:#00e173}.zt-button--large{width:100%;height:50px}.zt-button--normal{padding:0 24px;font-size:16px}.zt-button--medium{height:36px;padding:0 16px;font-size:14px}.zt-button--small{height:28px;padding:0 12px;font-size:14px}.zt-button__loading{color:inherit;font-size:inherit}.zt-button--mini{height:24px;padding:0 12px;font-size:12px}.zt-button--mini+.zt-button--mini{margin-left:4px}.zt-button--block{display:block;width:100%}.zt-button--block-inner{display:block;width:calc(100% - 2 * 16px);margin:0 16px}.zt-button--disabled{cursor:not-allowed;opacity:.4}.zt-button--loading{cursor:default}.zt-button--round{border-radius:999px;padding:0}.zt-button--round.zt-button--mini{width:24px}.zt-button--round.zt-button--small{width:28px}.zt-button--round.zt-button--medium{width:36px}.zt-button--round.zt-button--normal{width:44px}.zt-button--square{border-radius:0}.zt-button__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;height:100%}.zt-button__content::before{content:' '}.zt-button__icon{font-size:24px}.zt-button__icon--mini{font-size:16px}.zt-button__icon--small{font-size:20px}.zt-button__icon--medium{font-size:20px}.zt-button__icon+.zt-button__text,.zt-button__loading+.zt-button__text,.zt-button__text+.zt-button__icon,.zt-button__text+.zt-button__loading{margin-left:2px}.zt-button--hairline{border-width:0}.zt-button--hairline::after{border-color:inherit;border-radius:44px}.zt-button--hairline.zt-button--round::after{border-radius:999px}.zt-button--hairline.zt-button--square::after{border-radius:0}
1
+ .zt-button{position:relative;display:inline-block;box-sizing:border-box;height:44px;margin:0;padding:0;font-size:16px;line-height:calc(var(16px) * 2 - 8px);text-align:center;border-radius:22px;cursor:pointer;-webkit-transition:opacity .2s;transition:opacity .2s;-webkit-appearance:none}.zt-button::before{position:absolute;top:50%;left:50%;width:100%;height:100%;background-color:#000;border:inherit;border-color:#000;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:' '}.zt-button:active::before{opacity:.1}.zt-button--disabled::before,.zt-button--loading::before{display:none}.zt-button--default{color:#2d4b73;background:#f5faff;border:1px solid rgba(45,75,115,.2)}.zt-button--primary{color:#fff;background:-webkit-linear-gradient(135deg,#3cafff 0,#0091fa 100%);background:linear-gradient(-45deg,#3cafff 0,#0091fa 100%);border:1px solid #3caafa}.zt-button--primary-light{color:#0091fa;background:rgba(1,144,250,.1);border:none}.zt-button--danger{color:#fff;background:#ff5a5a;border:1px solid #ff5a5a}.zt-button--warning{color:#fff;background:#fa8500;border:1px solid #fa8500}.zt-button--success{color:#fff;background:#00e173;border:1px solid #00e173}.zt-button--plain{background:0 0}.zt-button--plain.zt-button--primary{color:#3caafa}.zt-button--plain.zt-button--danger{color:#ff5a5a}.zt-button--plain.zt-button--warning{color:#fa8500}.zt-button--plain.zt-button--success{color:#00e173}.zt-button--large{width:100%;height:50px}.zt-button--normal{padding:0 24px;font-size:16px}.zt-button--medium{height:36px;padding:0 16px;font-size:14px}.zt-button--small{height:28px;padding:0 12px;font-size:14px}.zt-button__loading{color:inherit;font-size:inherit}.zt-button--mini{height:24px;padding:0 12px;font-size:12px}.zt-button--mini+.zt-button--mini{margin-left:4px}.zt-button--block{display:block;width:100%}.zt-button--block-inner{display:block;width:calc(100% - 2 * 16px);margin:0 16px}.zt-button--disabled{cursor:not-allowed;opacity:.4}.zt-button--loading{cursor:default}.zt-button--round{border-radius:999px;padding:0}.zt-button--round.zt-button--mini{width:24px}.zt-button--round.zt-button--small{width:28px}.zt-button--round.zt-button--medium{width:36px}.zt-button--round.zt-button--normal{width:44px}.zt-button--square{border-radius:0}.zt-button__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;height:100%}.zt-button__content::before{content:' '}.zt-button__icon{font-size:24px}.zt-button__icon--mini{font-size:16px}.zt-button__icon--small{font-size:20px}.zt-button__icon--medium{font-size:20px}.zt-button__icon+.zt-button__text,.zt-button__loading+.zt-button__text,.zt-button__text+.zt-button__icon,.zt-button__text+.zt-button__loading{margin-left:2px}.zt-button--hairline{border-width:0}.zt-button--hairline::after{border-color:inherit;border-radius:44px}.zt-button--hairline.zt-button--round::after{border-radius:999px}.zt-button--hairline.zt-button--square::after{border-radius:0}
package/es/cell/index.css CHANGED
@@ -1 +1 @@
1
- .zt-cell{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:16px 16px;overflow:hidden;color:#2d4b73;font-size:16px;line-height:24px;background-color:#fff}.zt-cell--noFlex{display:block}.zt-cell--noFlex .zt-cell__title{margin-bottom:10px;width:100%;max-width:100%}.zt-cell--borderless::after,.zt-cell:last-child::after{display:none}.zt-cell__label{margin-top:10px;color:#2d4b73;font-size:14px;line-height:18px}.zt-cell__title,.zt-cell__value{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1}.zt-cell__title-content,.zt-cell__value-content{-webkit-box-flex:18;-webkit-flex:18;flex:18}.zt-cell__title .zt-icon,.zt-cell__value .zt-icon{-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.zt-cell__placeholder{color:#c8c9cc;-webkit-box-flex:9;-webkit-flex:9;flex:9;text-align:right}.zt-cell__value{position:relative;overflow:hidden;color:#2d4b73;text-align:right;vertical-align:middle;word-wrap:break-word}.zt-cell__value--alone{color:rgba(0,0,0,.6);text-align:left}.zt-cell__left-icon,.zt-cell__right-icon{height:24px;font-size:16px;line-height:24px}.zt-cell__left-icon{margin-right:4px}.zt-cell__right-icon{margin:auto 0;margin-left:4px;color:#969799}.zt-cell--center{-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-cell--large{padding-top:12px;padding-bottom:12px}.zt-cell--large .zt-cell__title{font-size:16px}.zt-cell--large .zt-cell__label{font-size:14px}.zt-cell__direction-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#f5faff;font-size:14px;line-height:20px}.zt-cell__direction-column .zt-cell__title{margin-bottom:8px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-cell__direction-column .zt-cell__title-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-box-flex:1;-webkit-flex:1;flex:1}.zt-cell__direction-column .zt-cell__title-subtitle{display:-webkit-box;display:-webkit-flex;display:flex;white-space:nowrap;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-box-flex:1;-webkit-flex:1;flex:1;opacity:.4}.zt-cell__direction-column .zt-cell__value{display:-webkit-box;display:-webkit-flex;display:flex;text-align:left;min-height:44px;padding:12px;box-sizing:border-box;background-color:#fff;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-cell__direction-column .zt-cell__value .zt-icon{-webkit-box-flex:2;-webkit-flex:2;flex:2;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.zt-cell__direction-column .zt-cell__value-content{-webkit-box-flex:18;-webkit-flex:18;flex:18;word-break:break-all}.zt-cell__clickable{cursor:pointer}.zt-cell__clickable:active{background-color:rgba(0,0,0,.04)}
1
+ .zt-cell{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:12px 16px;overflow:hidden;color:#2d4b73;font-size:16px;line-height:20px;background-color:#fff}.zt-cell--noFlex{display:block}.zt-cell--noFlex .zt-cell__title{margin-bottom:10px;width:100%;max-width:100%}.zt-cell--borderless::after,.zt-cell:last-child::after{display:none}.zt-cell__label{margin-top:10px;color:#2d4b73;font-size:14px;line-height:18px}.zt-cell__title,.zt-cell__value{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1}.zt-cell__title-content,.zt-cell__value-content{-webkit-box-flex:18;-webkit-flex:18;flex:18}.zt-cell__value{-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.zt-cell__placeholder{color:#c8c9cc;-webkit-box-flex:9;-webkit-flex:9;flex:9;text-align:right}.zt-cell__value{position:relative;overflow:hidden;color:#2d4b73;text-align:right;vertical-align:middle;word-wrap:break-word}.zt-cell__value--alone{color:rgba(0,0,0,.6);text-align:left}.zt-cell__left-icon,.zt-cell__right-icon{height:20px;font-size:16px;line-height:20px}.zt-cell__left-icon{margin-right:4px}.zt-cell__right-icon{margin:auto 0;margin-left:4px;color:#969799}.zt-cell--center{-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-cell--large{padding-top:12px;padding-bottom:12px}.zt-cell--large .zt-cell__title{font-size:16px}.zt-cell--large .zt-cell__label{font-size:14px}.zt-cell__direction-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;background-color:#f5faff;font-size:14px;line-height:20px}.zt-cell__direction-column .zt-cell__title{margin-bottom:8px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-cell__direction-column .zt-cell__title-content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-box-flex:1;-webkit-flex:1;flex:1}.zt-cell__direction-column .zt-cell__title-subtitle{display:-webkit-box;display:-webkit-flex;display:flex;white-space:nowrap;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-box-flex:1;-webkit-flex:1;flex:1;opacity:.4}.zt-cell__direction-column .zt-cell__value{display:-webkit-box;display:-webkit-flex;display:flex;text-align:left;min-height:44px;padding:12px;box-sizing:border-box;background-color:#fff;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start}.zt-cell__direction-column .zt-cell__value .zt-icon{-webkit-box-flex:2;-webkit-flex:2;flex:2;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end}.zt-cell__direction-column .zt-cell__value-content{-webkit-box-flex:18;-webkit-flex:18;flex:18;word-break:break-all}.zt-cell__clickable{cursor:pointer}.zt-cell__clickable:active{background-color:rgba(0,0,0,.04)}
package/es/cell/index.js CHANGED
@@ -24,7 +24,7 @@ function Cell(h, props, slots, ctx) {
24
24
  placeholder = props.placeholder,
25
25
  direction = props.direction,
26
26
  subtitle = props.subtitle;
27
- var showTitle = slots.title || isDef(title);
27
+ var showTitle = slots.title || isDef(title) || icon || slots.icon;
28
28
  var clickable = (_props$clickable = props.clickable) != null ? _props$clickable : isLink;
29
29
 
30
30
  function Label() {
@@ -105,14 +105,14 @@ function Cell(h, props, slots, ctx) {
105
105
  return h(Icon, {
106
106
  "class": bem('right-icon'),
107
107
  "attrs": {
108
- "name": arrowDirection ? "arrow-" + arrowDirection : 'arrow'
108
+ "name": arrowDirection ? "arrow-" + arrowDirection : 'arrow-right'
109
109
  }
110
110
  });
111
111
  }
112
112
  }
113
113
 
114
114
  function Value() {
115
- var showValue = slots.default || isDef(value) || clickable;
115
+ var showValue = slots.default || isDef(value) || clickable || slots['right-icon'];
116
116
 
117
117
  if (showValue) {
118
118
  return h("div", {
@@ -45,11 +45,10 @@
45
45
  &-content {
46
46
  flex: 18;
47
47
  }
48
- .zt-icon {
49
- flex: 1;
50
- display: flex;
51
- justify-content: flex-end;
52
- }
48
+
49
+ }
50
+ &__value {
51
+ justify-content: flex-end;
53
52
  }
54
53
 
55
54
  &__placeholder {
@@ -141,6 +140,7 @@
141
140
  box-sizing: border-box;
142
141
  background-color: white;
143
142
  align-items: center;
143
+ justify-content: flex-start;
144
144
  .zt-icon {
145
145
  flex: 2;
146
146
  display: flex;
@@ -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: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)}
1
+ .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;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:20px;line-height:1em;cursor:pointer}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1em;height:1em;color:transparent;font-size:1em;line-height:.95em;text-align:center;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);-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{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center;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:20px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}
@@ -2,7 +2,6 @@
2
2
 
3
3
  .zt-checkbox {
4
4
  display: flex;
5
- align-items: center;
6
5
  overflow: hidden;
7
6
  cursor: pointer;
8
7
  user-select: none;
@@ -26,26 +25,28 @@
26
25
  font-size: @checkbox-size;
27
26
  line-height: 1em;
28
27
  cursor: pointer;
29
- i, img {
30
- transform: scale(0.8333);
31
- transform-origin: center;
32
- }
33
28
 
34
29
  .zt-icon {
35
30
  display: block;
36
31
  box-sizing: border-box;
37
- width: 1.25em;
38
- height: 1.25em;
32
+ width: 1em;
33
+ height: 1em;
39
34
  color: transparent;
40
- font-size: 0.8em;
41
- line-height: 1.25;
35
+ font-size: 1em;
36
+ line-height: 0.95em;
42
37
  text-align: center;
38
+ background-image: @gradient-white-1;
39
+ border: 1px solid @radio-border-color;
40
+ box-shadow: -1px -1px 2px 0 #FFF, 0 0 3px 0 rgba(45,75,115,0.20);
43
41
  transition-duration: @checkbox-transition-duration;
44
42
  transition-property: color, border-color, background-color;
45
43
  }
46
44
 
47
45
  &--round {
48
46
  .zt-icon {
47
+ display: flex;
48
+ justify-content: center;
49
+ align-items: center;
49
50
  border-radius: 100%;
50
51
  }
51
52
  }
@@ -93,13 +94,3 @@
93
94
  }
94
95
  }
95
96
 
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
- }
@@ -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--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}
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;font-size:14px;line-height:20px}.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-content{color:#2d4b73}.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;width:100%}.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;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:20px}.zt-field__control[type=date],.zt-field__control[type=datetime-local],.zt-field__control[type=time]{min-height:20px}.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;color:rgba(45,75,115,.4)}.zt-field__left-icon{margin-right:4px}.zt-field__right-icon{color:#969799}.zt-field__button{padding:0 8px 0 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{color:#646566;font-size:12px;line-height:20px;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__right-icon-box{position:absolute;right:12px;bottom:12px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-field__column .zt-field__right-icon-box-row{-webkit-flex-shrink:0;flex-shrink:0}.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}
package/es/field/index.js CHANGED
@@ -51,7 +51,10 @@ export default createComponent({
51
51
  labelWidth: [Number, String],
52
52
  labelClass: null,
53
53
  labelAlign: String,
54
- inputAlign: String,
54
+ inputAlign: {
55
+ type: String,
56
+ default: 'left'
57
+ },
55
58
  placeholder: String,
56
59
  errorMessage: String,
57
60
  errorMessageAlign: String,
@@ -525,7 +528,10 @@ export default createComponent({
525
528
  "on": {
526
529
  "click": this.onClickLeftIcon
527
530
  }
528
- }, [h(SearchIcon, {
531
+ }, [h(Icon, {
532
+ "attrs": {
533
+ "name": "search"
534
+ },
529
535
  "class": bem('zt-left-icon-size')
530
536
  })]);
531
537
  } else if (this.leftIcon) {
@@ -704,9 +710,15 @@ export default createComponent({
704
710
  "name": "eye-closed",
705
711
  "color": this.iconColor
706
712
  }
707
- })]), this.genWordLimit(), this.genRightIcon(), slots('button') && h("div", {
713
+ })]), this.genWordLimit(), this.type === "textarea" ? h("div", {
714
+ "class": bem("right-icon-box")
715
+ }, [this.genRightIcon(), slots('button') && h("div", {
716
+ "class": bem('button')
717
+ }, [slots('button')])]) : h("div", {
718
+ "class": bem("right-icon-box-row")
719
+ }, [this.genRightIcon(), slots('button') && h("div", {
708
720
  "class": bem('button')
709
- }, [slots('button')])])]), this.genMessage()]);
721
+ }, [slots('button')])])])]), this.genMessage()]);
710
722
  }
711
723
 
712
724
  return h("div", {
@@ -20,6 +20,8 @@
20
20
  .zt-field {
21
21
  padding: 0;
22
22
  // background-color: @field-background-color;
23
+ font-size: 14px;
24
+ line-height: 20px;
23
25
  &::after {
24
26
  display: none;
25
27
  }
@@ -34,6 +36,10 @@
34
36
  word-wrap: break-word;
35
37
  vertical-align: middle;
36
38
  flex: 4;
39
+ &-content {
40
+ color: #2D4B73;
41
+
42
+ }
37
43
  &--center {
38
44
  text-align: center;
39
45
  }
@@ -58,6 +64,7 @@
58
64
  &__body {
59
65
  display: flex;
60
66
  align-items: center;
67
+ width: 100%;
61
68
  input {
62
69
  caret-color: @blue;
63
70
  }
@@ -73,7 +80,6 @@
73
80
  padding: 0;
74
81
  color: #2D4B73;
75
82
  line-height: inherit;
76
- text-align: left;
77
83
  background-color: transparent;
78
84
  border: 0;
79
85
  resize: none;
@@ -164,6 +170,7 @@
164
170
  &__zt-left-icon-size, &__zt-clear-size {
165
171
  width: @field-zt-icon-size;
166
172
  height: @field-zt-icon-size;
173
+ color: @field-zt-icon-color;
167
174
  }
168
175
 
169
176
  &__left-icon {
@@ -175,7 +182,7 @@
175
182
  }
176
183
 
177
184
  &__button {
178
- padding-left: @padding-xs;
185
+ padding: 0 @padding-xs 0 @padding-xs;
179
186
  }
180
187
 
181
188
  &__error-message {
@@ -206,7 +213,7 @@
206
213
 
207
214
 
208
215
  &__word-limit {
209
- margin-top: @padding-base;
216
+ // margin-top: @padding-base;
210
217
  color: @field-word-limit-color;
211
218
  font-size: @field-word-limit-font-size;
212
219
  line-height: @field-word-limit-line-height;
@@ -247,6 +254,17 @@
247
254
  color: #2D4B73;
248
255
  }
249
256
  }
257
+ .zt-field__right-icon-box {
258
+ position: absolute;
259
+ right: 12px;
260
+ bottom: 12px;
261
+ display: flex;
262
+ align-items: center;
263
+ }
264
+
265
+ .zt-field__right-icon-box-row {
266
+ flex-shrink: 0;
267
+ }
250
268
 
251
269
  .zt-field__value {
252
270
  justify-content: flex-start;
package/es/index.js CHANGED
@@ -75,7 +75,7 @@ import Tag from './tag';
75
75
  import Timeline from './timeline';
76
76
  import Toast from './toast';
77
77
  import Uploader from './uploader';
78
- var version = '2.0.1';
78
+ var version = '2.0.2';
79
79
 
80
80
  function install(Vue) {
81
81
  var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader];
@@ -1,15 +1,15 @@
1
1
  // Utils
2
- import { createNamespace, isDef, isPromise, noop } from '../utils'; // Types
2
+ import { createNamespace, isDef, isPromise, noop } from '../utils';
3
+ import Icon from "../icon";
4
+ import Loading from "../loading";
5
+ import ZtImage from "../image";
6
+ import ZtGridItem from "../grid-item";
7
+ import ZtMediaPlayer from "../media-player";
8
+ import ZtActionSheet from "../action-sheet";
9
+ import ZtGrid from "../grid"; // Types
3
10
 
4
11
  import { MediaAddType, MediaType, Media, MediaUploadStatus } from "./type";
5
- import { checkWatermarkConfigSupported, CompressOptions, file2DataURL, ImageProcessor, ResizeOptions, WatermarkOptions } from "@egova/media"; // 单个文件最大限制,单位为M(目前限制是100M)
6
-
7
- var FILE_SIZE_LIMIT = 100;
8
-
9
- var _createNamespace = createNamespace('media-picker'),
10
- createComponent = _createNamespace[0],
11
- bem = _createNamespace[1]; // import components
12
-
12
+ import { checkWatermarkConfigSupported, CompressOptions, file2DataURL, ImageProcessor, ResizeOptions, WatermarkOptions } from "@egova/media"; // import components
13
13
 
14
14
  import Toast from '../toast';
15
15
  import ImagePreview from "../image-preview"; // Images
@@ -23,9 +23,14 @@ import DeleteIcon from "./image/DeleteIcon";
23
23
  import DefaultVideoIcon from "./image/DefaultVideoIcon";
24
24
  import DefaultAudioIcon from "./image/DefaultAudioIcon";
25
25
  import DefaultFileIcon from "./image/DefaultFileIcon";
26
- import { getFileUniqueCode, getUniqueFileName, isAudioType, isImageType, isVideoType } from "./media-util";
27
- import Icon from "../icon";
28
- import Loading from "../loading";
26
+ import { getFileUniqueCode, getUniqueFileName, isAudioType, isImageType, isVideoType } from "./media-util"; // 单个文件最大限制,单位为M(目前限制是100M)
27
+
28
+ var FILE_SIZE_LIMIT = 100;
29
+
30
+ var _createNamespace = createNamespace('media-picker'),
31
+ createComponent = _createNamespace[0],
32
+ bem = _createNamespace[1];
33
+
29
34
  export default createComponent({
30
35
  props: {
31
36
  disabled: Boolean,
@@ -885,7 +890,7 @@ export default createComponent({
885
890
  var h = this.$createElement;
886
891
 
887
892
  if (media.showSrc) {
888
- return h("zt-image", {
893
+ return h(ZtImage, {
889
894
  "attrs": {
890
895
  "src": media.showSrc,
891
896
  "fit": 'fill',
@@ -922,7 +927,7 @@ export default createComponent({
922
927
  }
923
928
  }
924
929
  });
925
- return h("zt-grid-item", {
930
+ return h(ZtGridItem, {
926
931
  "key": media.uniqueCode,
927
932
  "on": {
928
933
  "click": function click() {
@@ -946,7 +951,7 @@ export default createComponent({
946
951
  }, [this.title]);
947
952
  return h("div", {
948
953
  "class": bem()
949
- }, [title, this.hiddenInput(), h("zt-media-player", {
954
+ }, [title, this.hiddenInput(), h(ZtMediaPlayer, {
950
955
  "attrs": {
951
956
  "mediaType": this.mediaTypeToPlay,
952
957
  "mediaUrl": this.mediaUrlToPlay
@@ -957,7 +962,7 @@ export default createComponent({
957
962
  _this9.mediaPlayerVisible = $$v;
958
963
  }
959
964
  }
960
- }), h("zt-action-sheet", {
965
+ }), h(ZtActionSheet, {
961
966
  "attrs": {
962
967
  "actions": this.actionOptions,
963
968
  "title": '请选择',
@@ -975,7 +980,7 @@ export default createComponent({
975
980
  }
976
981
  }), h("div", {
977
982
  "class": bem('line')
978
- }, [this.renderButtons()]), h("zt-grid", {
983
+ }, [this.renderButtons()]), h(ZtGrid, {
979
984
  "directives": [{
980
985
  name: "show",
981
986
  value: this.mediaList.length
@@ -3,10 +3,14 @@ import '../../overlay/index.css';
3
3
  import '../../info/index.css';
4
4
  import '../../icon/index.css';
5
5
  import '../../image/index.css';
6
+ import '../../grid-item/index.css';
6
7
  import '../../popup/index.css';
7
8
  import '../../loading/index.css';
8
9
  import '../../toast/index.css';
10
+ import '../../action-sheet/index.css';
11
+ import '../../grid/index.css';
9
12
  import '../../swipe/index.css';
10
13
  import '../../swipe-item/index.css';
11
14
  import '../../image-preview/index.css';
15
+ import '../../media-player/index.css';
12
16
  import '../index.css';
@@ -3,10 +3,14 @@ import '../../overlay/index.less';
3
3
  import '../../info/index.less';
4
4
  import '../../icon/index.less';
5
5
  import '../../image/index.less';
6
+ import '../../grid-item/index.less';
6
7
  import '../../popup/index.less';
7
8
  import '../../loading/index.less';
8
9
  import '../../toast/index.less';
10
+ import '../../action-sheet/index.less';
11
+ import '../../grid/index.less';
9
12
  import '../../swipe/index.less';
10
13
  import '../../swipe-item/index.less';
11
14
  import '../../image-preview/index.less';
15
+ import '../../media-player/index.less';
12
16
  import '../index.less';
@@ -1 +1 @@
1
- .zt-overflow-hidden{overflow:hidden!important}.zt-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:#fff;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-overflow-scrolling:touch}.zt-popup--center{top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.zt-popup--center.zt-popup--round{border-radius:16px}.zt-popup--top{top:0;left:0;width:100%}.zt-popup--top.zt-popup--round{border-radius:0 0 16px 16px}.zt-popup--right{top:50%;right:0;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.zt-popup--right.zt-popup--round{border-radius:16px 0 0 16px}.zt-popup--bottom{bottom:0;left:0;width:100%}.zt-popup--bottom.zt-popup--round{border-radius:16px 16px 0 0}.zt-popup--left{top:50%;left:0;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.zt-popup--left.zt-popup--round{border-radius:0 16px 16px 0}.zt-popup--safe-area-inset-bottom{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.zt-popup-slide-bottom-enter-active,.zt-popup-slide-left-enter-active,.zt-popup-slide-right-enter-active,.zt-popup-slide-top-enter-active{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.zt-popup-slide-bottom-leave-active,.zt-popup-slide-left-leave-active,.zt-popup-slide-right-leave-active,.zt-popup-slide-top-leave-active{-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}.zt-popup-slide-top-enter,.zt-popup-slide-top-leave-active{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.zt-popup-slide-right-enter,.zt-popup-slide-right-leave-active{-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}.zt-popup-slide-bottom-enter,.zt-popup-slide-bottom-leave-active{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.zt-popup-slide-left-enter,.zt-popup-slide-left-leave-active{-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}.zt-popup__close-icon{position:absolute;z-index:1;color:rgba(45,75,115,.6);font-size:24px;cursor:pointer}.zt-popup__close-icon:active{color:#969799}.zt-popup__close-icon--top-left{top:12px;left:16px}.zt-popup__close-icon--top-right{top:12px;right:16px}.zt-popup__close-icon--bottom-left{bottom:16px;left:16px}.zt-popup__close-icon--bottom-right{right:16px;bottom:16px}
1
+ .zt-overflow-hidden{overflow:hidden!important}.zt-popup{position:fixed;max-height:100%;overflow-y:auto;background-color:#fff;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-overflow-scrolling:touch}.zt-popup__slider{position:fixed;width:100%;bottom:0;border-radius:16px 16px 0 0;background-color:#fff}.zt-popup__slider-title{height:40px;text-align:center}.zt-popup__slider-bar{display:inline-block;width:32px;height:4px;-webkit-transform:scaleY(-1);transform:scaleY(-1);background:rgba(45,75,115,.2);border-radius:3px}.zt-popup__slider-content{overflow-y:auto}.zt-popup--center{top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.zt-popup--center.zt-popup--round{border-radius:16px}.zt-popup--top{top:0;left:0;width:100%}.zt-popup--top.zt-popup--round{border-radius:0 0 16px 16px}.zt-popup--right{top:50%;right:0;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.zt-popup--right.zt-popup--round{border-radius:16px 0 0 16px}.zt-popup--bottom{bottom:0;left:0;width:100%}.zt-popup--bottom.zt-popup--round{border-radius:16px 16px 0 0}.zt-popup--left{top:50%;left:0;-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.zt-popup--left.zt-popup--round{border-radius:0 16px 16px 0}.zt-popup--safe-area-inset-bottom{padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.zt-popup-slide-bottom-enter-active,.zt-popup-slide-left-enter-active,.zt-popup-slide-right-enter-active,.zt-popup-slide-top-enter-active{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.zt-popup-slide-bottom-leave-active,.zt-popup-slide-left-leave-active,.zt-popup-slide-right-leave-active,.zt-popup-slide-top-leave-active{-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}.zt-popup-slide-top-enter,.zt-popup-slide-top-leave-active{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}.zt-popup-slide-right-enter,.zt-popup-slide-right-leave-active{-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}.zt-popup-slide-bottom-enter,.zt-popup-slide-bottom-leave-active{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}.zt-popup-slide-left-enter,.zt-popup-slide-left-leave-active{-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}.zt-popup__slider-icon{z-index:1;color:rgba(45,75,115,.6);font-size:24px;cursor:pointer}.zt-popup__close-icon{position:absolute;z-index:1;color:rgba(45,75,115,.6);font-size:24px;cursor:pointer}.zt-popup__close-icon:active{color:#969799}.zt-popup__close-icon--top-left{top:12px;left:16px}.zt-popup__close-icon--top-right{top:12px;right:16px}.zt-popup__close-icon--bottom-left{bottom:16px;left:16px}.zt-popup__close-icon--bottom-right{right:16px;bottom:16px}
package/es/popup/index.js CHANGED
@@ -37,6 +37,14 @@ export default createComponent({
37
37
  customOnClickOverlay: {
38
38
  type: Function,
39
39
  default: null
40
+ },
41
+ sliderContentHeight: {
42
+ type: Number,
43
+ default: 60
44
+ },
45
+ sliderShow: {
46
+ type: Boolean,
47
+ default: false
40
48
  }
41
49
  },
42
50
  beforeCreate: function beforeCreate() {
@@ -52,71 +60,134 @@ export default createComponent({
52
60
  this.onOpened = createEmitter('opened');
53
61
  this.onClosed = createEmitter('closed');
54
62
  },
63
+ data: function data() {
64
+ return {
65
+ positionY: 0,
66
+ timerId: null,
67
+ contentStyle: "height:" + this.sliderContentHeight + "px;",
68
+ touchHeight: 0
69
+ };
70
+ },
55
71
  methods: {
56
72
  onClickCloseIcon: function onClickCloseIcon(event) {
57
73
  this.$emit('click-close-icon', event);
58
74
  this.close();
59
75
  },
60
76
  onClickOverlay: function onClickOverlay() {
77
+ if (this.sliderShow) {
78
+ this.contentStyle = 'height:60px';
79
+ }
80
+
61
81
  if (this.customOnClickOverlay) {
62
82
  this.customOnClickOverlay();
63
83
  } else if (this.closeOnClickOverlay) {
64
84
  this.close();
65
85
  }
86
+ },
87
+ move: function move(event) {
88
+ var _this2 = this;
89
+
90
+ if (this.timerId) {
91
+ event.preventDefault();
92
+ }
93
+
94
+ var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
95
+ this.positionY = event.touches[0].clientY;
96
+ this.timerId = setTimeout(function () {
97
+ if (_this2.positionY === 0 || _this2.positionY < h * 0.15) {
98
+ return;
99
+ }
100
+
101
+ _this2.touchHeight = _this2.positionY - 40 > h - 40 ? h - 40 : _this2.positionY;
102
+ _this2.contentStyle = "height:" + (h - _this2.touchHeight - 40) + "px;";
103
+ }, 10);
104
+ },
105
+ endMove: function endMove() {
106
+ clearInterval(this.timerId);
107
+ this.timerId = null;
108
+ },
109
+ startMove: function startMove() {
110
+ if (this.timerId) {
111
+ clearInterval(this.timerId);
112
+ }
113
+ },
114
+ allowSliderRender: function allowSliderRender() {
115
+ var h = this.$createElement;
116
+ return h("div", {
117
+ "class": bem('slider'),
118
+ "directives": [{
119
+ name: "show",
120
+ value: this.value
121
+ }]
122
+ }, [h("div", {
123
+ "class": bem('slider-title'),
124
+ "on": {
125
+ "touchmove": this.move,
126
+ "touchend": this.endMove,
127
+ "touchstart": this.startMove
128
+ }
129
+ }, [h("div", {
130
+ "class": bem('slider-bar')
131
+ })]), h("div", {
132
+ "class": bem('slider-content'),
133
+ "style": this.contentStyle
134
+ }, [this.slots()])]);
135
+ },
136
+ popupRender: function popupRender() {
137
+ var _bem;
138
+
139
+ var h = this.$createElement;
140
+ var round = this.round,
141
+ position = this.position,
142
+ duration = this.duration;
143
+ var isCenter = position === 'center';
144
+ var transitionName = this.transition || (isCenter ? 'zt-fade' : "zt-popup-slide-" + position);
145
+ var style = {};
146
+
147
+ if (isDef(duration)) {
148
+ var key = isCenter ? 'animationDuration' : 'transitionDuration';
149
+ style[key] = duration + "s";
150
+ }
151
+
152
+ return h("transition", {
153
+ "attrs": {
154
+ "appear": this.transitionAppear,
155
+ "name": transitionName
156
+ },
157
+ "on": {
158
+ "afterEnter": this.onOpened,
159
+ "afterLeave": this.onClosed
160
+ }
161
+ }, [h("div", {
162
+ "directives": [{
163
+ name: "show",
164
+ value: this.value
165
+ }],
166
+ "style": style,
167
+ "class": bem((_bem = {
168
+ round: round
169
+ }, _bem[position] = position, _bem['safe-area-inset-bottom'] = this.safeAreaInsetBottom, _bem)),
170
+ "on": {
171
+ "click": this.onClick
172
+ }
173
+ }, [this.slots(), this.closeable && h(Icon, {
174
+ "attrs": {
175
+ "role": "button",
176
+ "tabindex": "0",
177
+ "name": this.closeIcon
178
+ },
179
+ "class": bem('close-icon', this.closeIconPosition),
180
+ "on": {
181
+ "click": this.onClickCloseIcon
182
+ }
183
+ })])]);
66
184
  }
67
185
  },
68
186
  render: function render() {
69
- var _bem;
70
-
71
- var h = arguments[0];
72
-
73
187
  if (!this.shouldRender) {
74
188
  return;
75
189
  }
76
190
 
77
- var round = this.round,
78
- position = this.position,
79
- duration = this.duration;
80
- var isCenter = position === 'center';
81
- var transitionName = this.transition || (isCenter ? 'zt-fade' : "zt-popup-slide-" + position);
82
- var style = {};
83
-
84
- if (isDef(duration)) {
85
- var key = isCenter ? 'animationDuration' : 'transitionDuration';
86
- style[key] = duration + "s";
87
- }
88
-
89
- return h("transition", {
90
- "attrs": {
91
- "appear": this.transitionAppear,
92
- "name": transitionName
93
- },
94
- "on": {
95
- "afterEnter": this.onOpened,
96
- "afterLeave": this.onClosed
97
- }
98
- }, [h("div", {
99
- "directives": [{
100
- name: "show",
101
- value: this.value
102
- }],
103
- "style": style,
104
- "class": bem((_bem = {
105
- round: round
106
- }, _bem[position] = position, _bem['safe-area-inset-bottom'] = this.safeAreaInsetBottom, _bem)),
107
- "on": {
108
- "click": this.onClick
109
- }
110
- }, [this.slots(), this.closeable && h(Icon, {
111
- "attrs": {
112
- "role": "button",
113
- "tabindex": "0",
114
- "name": this.closeIcon
115
- },
116
- "class": bem('close-icon', this.closeIconPosition),
117
- "on": {
118
- "click": this.onClickCloseIcon
119
- }
120
- })])]);
191
+ return this.sliderShow ? this.allowSliderRender() : this.popupRender();
121
192
  }
122
193
  });