@nutui/nutui-react-taro 3.0.19-cpp.15-beta.0 → 3.0.19-cpp.16

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 (37) hide show
  1. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  2. package/dist/cjs/packages/dialog/dialog.js +19 -7
  3. package/dist/cjs/packages/dialog/style/dialog.scss +31 -10
  4. package/dist/cjs/packages/dialog/style/style.css +27 -7
  5. package/dist/cjs/packages/dialog/style/style.harmony.css +27 -7
  6. package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +31 -10
  7. package/dist/cjs/packages/dialog/style-jmapp/style.css +27 -7
  8. package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +31 -10
  9. package/dist/cjs/packages/dialog/style-jrkf/style.css +27 -7
  10. package/dist/cjs/packages/tabs/tabs.js +8 -0
  11. package/dist/cjs/packages/textarea/textarea.js +3 -1
  12. package/dist/cjs/types/spec/dialog/base.d.ts +2 -1
  13. package/dist/cjs/types/spec/textarea/base.d.ts +1 -0
  14. package/dist/es/packages/configprovider/types.d.ts +1 -1
  15. package/dist/es/packages/dialog/dialog.js +19 -7
  16. package/dist/es/packages/dialog/style/dialog.scss +31 -10
  17. package/dist/es/packages/dialog/style/style.css +27 -7
  18. package/dist/es/packages/dialog/style/style.harmony.css +27 -7
  19. package/dist/es/packages/dialog/style-jmapp/dialog.scss +31 -10
  20. package/dist/es/packages/dialog/style-jmapp/style.css +27 -7
  21. package/dist/es/packages/dialog/style-jrkf/dialog.scss +31 -10
  22. package/dist/es/packages/dialog/style-jrkf/style.css +27 -7
  23. package/dist/es/packages/tabs/tabs.js +8 -0
  24. package/dist/es/packages/textarea/textarea.js +3 -1
  25. package/dist/es/types/spec/dialog/base.d.ts +2 -1
  26. package/dist/es/types/spec/textarea/base.d.ts +1 -0
  27. package/dist/nutui.react.umd.js +28 -8
  28. package/dist/style-jmapp.css +1 -1
  29. package/dist/style-jmapp.scss +30 -30
  30. package/dist/style-jrkf.css +1 -1
  31. package/dist/style-jrkf.scss +22 -22
  32. package/dist/style.css +1 -1
  33. package/dist/style.scss +30 -30
  34. package/dist/styles/variables-jmapp.scss +33 -7
  35. package/dist/styles/variables-jrkf.scss +33 -7
  36. package/dist/styles/variables.scss +33 -7
  37. package/package.json +1 -1
@@ -141,25 +141,25 @@
141
141
  }
142
142
  }
143
143
 
144
- &-ok-container{
144
+ &-ok-container {
145
145
  position: relative;
146
146
  display: flex;
147
147
  align-items: center;
148
148
  width: 100%;
149
149
  justify-content: space-around;
150
150
 
151
- .nut-dialog-footer-ok-badge{
151
+ .nut-dialog-footer-ok-badge {
152
152
  position: absolute;
153
153
  right: 0;
154
- top: $dialog-footer-ok-badge-top;
154
+ top: $dialog-footer-badge-top;
155
155
  display: flex;
156
156
  align-items: center;
157
- height: $dialog-footer-ok-badge-height;
158
- padding: $dialog-footer-ok-badge-padding;
159
- background: $dialog-footer-ok-badge-bg;
160
- border-radius: $dialog-footer-ok-badge-border-radius;
161
- font-size: $dialog-footer-ok-badge-fontsize;
162
- color: $dialog-footer-ok-badge-color;
157
+ height: $dialog-footer-badge-height;
158
+ padding: $dialog-footer-badge-padding;
159
+ background: $dialog-footer-badge-bg-ok;
160
+ border-radius: $dialog-footer-badge-border-radius;
161
+ font-size: $dialog-footer-badge-fontsize;
162
+ color: $dialog-footer-badge-color-ok;
163
163
  }
164
164
  }
165
165
 
@@ -169,7 +169,6 @@
169
169
  .nut-button-children {
170
170
  font-weight: $font-weight-medium;
171
171
  }
172
-
173
172
  }
174
173
 
175
174
  &-block {
@@ -177,6 +176,28 @@
177
176
  min-width: 100%;
178
177
  }
179
178
  }
179
+
180
+ &-cancel-container {
181
+ position: relative;
182
+ display: flex;
183
+ align-items: center;
184
+ width: 100%;
185
+ justify-content: space-around;
186
+
187
+ .nut-dialog-footer-cancel-badge {
188
+ position: absolute;
189
+ right: $dialog-footer-cancel-margin-right;
190
+ top: $dialog-footer-badge-top;
191
+ display: flex;
192
+ align-items: center;
193
+ height: $dialog-footer-badge-height;
194
+ padding: $dialog-footer-badge-padding;
195
+ background: $dialog-footer-badge-bg-cancel;
196
+ border-radius: $dialog-footer-badge-border-radius;
197
+ font-size: $dialog-footer-badge-fontsize;
198
+ color: $dialog-footer-badge-color-cancel;
199
+ }
200
+ }
180
201
  }
181
202
  }
182
203
 
@@ -141,15 +141,15 @@
141
141
  .nut-dialog-footer-ok-container .nut-dialog-footer-ok-badge {
142
142
  position: absolute;
143
143
  right: 0;
144
- top: var(--nutui-dialog-footer-ok-badge-top, -8px);
144
+ top: var(--nutui-dialog-footer-badge-top, -8px);
145
145
  display: flex;
146
146
  align-items: center;
147
- height: var(--nutui-dialog-footer-ok-badge-height, 14px);
148
- padding: var(--nutui-dialog-footer-ok-badge-padding, 0 3px);
149
- background: var(--nutui-dialog-footer-ok-badge-bg, var(--nutui-color-danger-light));
150
- border-radius: var(--nutui-dialog-footer-ok-badge-border-radius, 2px 2px 0px 2px);
151
- font-size: var(--nutui-dialog-footer-ok-badge-fontsize, 10px);
152
- color: var(--nutui-dialog-footer-ok-badge-color, var(--nutui-color-primary, #ff6666));
147
+ height: var(--nutui-dialog-footer-badge-height, 14px);
148
+ padding: var(--nutui-dialog-footer-badge-padding, 0 3px);
149
+ background: var(--nutui-dialog-footer-badge-bg-ok, var(--nutui-color-danger-light));
150
+ border-radius: var(--nutui-dialog-footer-badge-border-radius, 2px 2px 0px 2px);
151
+ font-size: var(--nutui-dialog-footer-badge-fontsize, 10px);
152
+ color: var(--nutui-dialog-footer-badge-color-ok, var(--nutui-color-primary, #ff6666));
153
153
  }
154
154
  .nut-dialog-footer-ok {
155
155
  max-width: var(--nutui-dialog-footer-ok-max-width, 128px);
@@ -161,6 +161,26 @@
161
161
  .nut-dialog-footer-block.nut-button {
162
162
  min-width: 100%;
163
163
  }
164
+ .nut-dialog-footer-cancel-container {
165
+ position: relative;
166
+ display: flex;
167
+ align-items: center;
168
+ width: 100%;
169
+ justify-content: space-around;
170
+ }
171
+ .nut-dialog-footer-cancel-container .nut-dialog-footer-cancel-badge {
172
+ position: absolute;
173
+ right: var(--nutui-dialog-footer-cancel-margin-right, 12px);
174
+ top: var(--nutui-dialog-footer-badge-top, -8px);
175
+ display: flex;
176
+ align-items: center;
177
+ height: var(--nutui-dialog-footer-badge-height, 14px);
178
+ padding: var(--nutui-dialog-footer-badge-padding, 0 3px);
179
+ background: var(--nutui-dialog-footer-badge-bg-cancel, var(--nutui-color-danger-light));
180
+ border-radius: var(--nutui-dialog-footer-badge-border-radius, 2px 2px 0px 2px);
181
+ font-size: var(--nutui-dialog-footer-badge-fontsize, 10px);
182
+ color: var(--nutui-dialog-footer-badge-color-cancel, var(--nutui-color-primary, #ff6666));
183
+ }
164
184
 
165
185
  [dir=rtl] .nut-dialog-outer,
166
186
  .nut-rtl .nut-dialog-outer {
@@ -15,6 +15,7 @@ import { useForceUpdate } from "../../hooks/use-force-update";
15
15
  import raf from "../../utils/raf";
16
16
  import { useUuid } from "../../hooks/use-uuid";
17
17
  import { useRtl } from "../configprovider/configprovider";
18
+ import { td } from "../../utils/taro/platform";
18
19
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
19
20
  tabStyle: {},
20
21
  activeColor: '',
@@ -150,6 +151,13 @@ export var Tabs = function(props) {
150
151
  return String(t.value) === String(value);
151
152
  });
152
153
  index = index < 0 ? 0 : index;
154
+ // 适配 安卓 处理,临时方案,hack
155
+ if (td()) {
156
+ return {
157
+ transform: direction === 'horizontal' ? "translate3d(".concat(rtl ? '' : '-').concat(index * 50, "%, 0, 0)") : "translate3d( 0, -".concat(index * 50, "%, 0)"),
158
+ transitionDuration: "".concat(duration, "ms")
159
+ };
160
+ }
153
161
  return {
154
162
  transform: direction === 'horizontal' ? "translate3d(".concat(rtl ? '' : '-').concat(index * 100, "%, 0, 0)") : "translate3d( 0, -".concat(index * 100, "%, 0)"),
155
163
  transitionDuration: "".concat(duration, "ms")
@@ -22,7 +22,7 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
22
22
  });
23
23
  export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
24
24
  var locale = useConfig().locale;
25
- var _ref = _object_spread({}, defaultProps, props), className = _ref.className, value = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
25
+ var _ref = _object_spread({}, defaultProps, props), className = _ref.className, value = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, viewId = _ref.viewId, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
26
26
  "className",
27
27
  "value",
28
28
  "defaultValue",
@@ -36,6 +36,7 @@ export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
36
36
  "style",
37
37
  "plain",
38
38
  "status",
39
+ "viewId",
39
40
  "onChange",
40
41
  "onBlur",
41
42
  "onFocus"
@@ -97,6 +98,7 @@ export var TextArea = /*#__PURE__*/ forwardRef(function(props, ref) {
97
98
  });
98
99
  var _obj;
99
100
  return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(View, {
101
+ id: viewId,
100
102
  className: classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix, "-plain"), plain), _define_property(_obj, "".concat(classPrefix, "-container"), !plain), _define_property(_obj, "".concat(classPrefix, "-").concat(status), status), _obj), className)
101
103
  }, /*#__PURE__*/ React.createElement(Textarea, _object_spread_props(_object_spread({}, rest), {
102
104
  ref: textareaRef,
@@ -14,7 +14,6 @@ export interface BaseContentProps extends BasicComponent {
14
14
  header: ReactNode;
15
15
  footer: ReactNode;
16
16
  close: ReactNode;
17
- badge: ReactNode;
18
17
  footerDirection: DialogFooterDirection;
19
18
  }
20
19
  export interface DialogWrapProps extends WebOverlayProps, Omit<BaseContentProps, 'onClick'> {
@@ -39,6 +38,8 @@ export interface BaseDialog extends DialogWrapProps {
39
38
  * 取消按钮文案
40
39
  */
41
40
  cancelText: ReactNode
41
+ confirmBadge: ReactNode;
42
+ cancelBadge: ReactNode;
42
43
  /**
43
44
  * 是否隐藏确定按钮
44
45
  */
@@ -1,5 +1,6 @@
1
1
  import { BaseProps } from '../../base/props';
2
2
  export interface BaseTextArea<EVENT = any> extends BaseProps {
3
+ viewId: string;
3
4
  /**
4
5
  * 输入框内容,受控
5
6
  */
@@ -4303,6 +4303,12 @@
4303
4303
  return String(t.value) === String(value2);
4304
4304
  });
4305
4305
  index2 = index2 < 0 ? 0 : index2;
4306
+ if (td()) {
4307
+ return {
4308
+ transform: direction === "horizontal" ? "translate3d(".concat(rtl ? "" : "-").concat(index2 * 50, "%, 0, 0)") : "translate3d( 0, -".concat(index2 * 50, "%, 0)"),
4309
+ transitionDuration: "".concat(duration, "ms")
4310
+ };
4311
+ }
4306
4312
  return {
4307
4313
  transform: direction === "horizontal" ? "translate3d(".concat(rtl ? "" : "-").concat(index2 * 100, "%, 0, 0)") : "translate3d( 0, -".concat(index2 * 100, "%, 0)"),
4308
4314
  transitionDuration: "".concat(duration, "ms")
@@ -14163,7 +14169,7 @@
14163
14169
  });
14164
14170
  var TextArea = /* @__PURE__ */ React.forwardRef(function(props, ref) {
14165
14171
  var locale = useConfig().locale;
14166
- var _ref = _object_spread({}, defaultProps$L, props), className = _ref.className, value2 = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
14172
+ var _ref = _object_spread({}, defaultProps$L, props), className = _ref.className, value2 = _ref.value, defaultValue = _ref.defaultValue, showCount = _ref.showCount, maxLength = _ref.maxLength, rows = _ref.rows, placeholder = _ref.placeholder, readOnly = _ref.readOnly, disabled = _ref.disabled, autoSize = _ref.autoSize, style = _ref.style, plain = _ref.plain, status = _ref.status, viewId = _ref.viewId, onChange = _ref.onChange, onBlur = _ref.onBlur, onFocus = _ref.onFocus, rest = _object_without_properties(_ref, [
14167
14173
  "className",
14168
14174
  "value",
14169
14175
  "defaultValue",
@@ -14177,6 +14183,7 @@
14177
14183
  "style",
14178
14184
  "plain",
14179
14185
  "status",
14186
+ "viewId",
14180
14187
  "onChange",
14181
14188
  "onBlur",
14182
14189
  "onFocus"
@@ -14238,6 +14245,7 @@
14238
14245
  });
14239
14246
  var _obj;
14240
14247
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(components.View, {
14248
+ id: viewId,
14241
14249
  className: classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix2, "-readonly"), readOnly), _define_property(_obj, "".concat(classPrefix2, "-rtl"), rtl), _define_property(_obj, "".concat(classPrefix2, "-plain"), plain), _define_property(_obj, "".concat(classPrefix2, "-container"), !plain), _define_property(_obj, "".concat(classPrefix2, "-").concat(status), status), _obj), className)
14242
14250
  }, /* @__PURE__ */ React.createElement(components.Textarea, _object_spread_props(_object_spread({}, rest), {
14243
14251
  ref: textareaRef,
@@ -15116,7 +15124,8 @@
15116
15124
  content: "",
15117
15125
  header: "",
15118
15126
  footer: "",
15119
- badge: "",
15127
+ cancelBadge: "",
15128
+ confirmBadge: "",
15120
15129
  confirmText: "",
15121
15130
  cancelText: "",
15122
15131
  hideConfirmButton: false,
@@ -15146,7 +15155,7 @@
15146
15155
  }
15147
15156
  });
15148
15157
  var BaseDialog = function(props) {
15149
- var _useParams = useParams(mergeProps(defaultProps$H, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content2 = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, badge = _useParams_params.badge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick, setParams = _useParams.setParams;
15158
+ var _useParams = useParams(mergeProps(defaultProps$H, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content2 = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick, setParams = _useParams.setParams;
15150
15159
  var classPrefix2 = "nut-dialog";
15151
15160
  var locale = useConfig().locale;
15152
15161
  var _useState = _sliced_to_array(React.useState(false), 2), loading = _useState[0], setLoading = _useState[1];
@@ -15216,17 +15225,28 @@
15216
15225
  }, cancelText || locale.cancel);
15217
15226
  };
15218
15227
  var renderCancel = function() {
15219
- return !hideCancelButton && /* @__PURE__ */ React.createElement(Button, {
15228
+ return !hideCancelButton && /* @__PURE__ */ React.createElement(React.Fragment, null, cancelBadge ? /* @__PURE__ */ React.createElement(components.View, {
15229
+ className: "".concat(classPrefix2, "-footer-cancel-container")
15230
+ }, /* @__PURE__ */ React.createElement(Button, {
15220
15231
  type: "default",
15221
15232
  size: "large",
15222
15233
  className: "".concat(classPrefix2, "-footer-cancel ").concat(btnClass),
15223
15234
  onClick: function(e) {
15224
15235
  return handleCancel(e);
15225
15236
  }
15226
- }, cancelText || locale.cancel);
15237
+ }, cancelText || locale.cancel), cancelBadge ? /* @__PURE__ */ React.createElement(components.View, {
15238
+ className: "".concat(classPrefix2, "-footer-cancel-badge")
15239
+ }, cancelBadge) : null) : /* @__PURE__ */ React.createElement(Button, {
15240
+ type: "default",
15241
+ size: "large",
15242
+ className: "".concat(classPrefix2, "-footer-cancel ").concat(btnClass),
15243
+ onClick: function(e) {
15244
+ return handleCancel(e);
15245
+ }
15246
+ }, cancelText || locale.cancel));
15227
15247
  };
15228
15248
  var renderConfirm = function() {
15229
- return !hideConfirmButton && /* @__PURE__ */ React.createElement(React.Fragment, null, badge ? /* @__PURE__ */ React.createElement(components.View, {
15249
+ return !hideConfirmButton && /* @__PURE__ */ React.createElement(React.Fragment, null, confirmBadge ? /* @__PURE__ */ React.createElement(components.View, {
15230
15250
  className: "".concat(classPrefix2, "-footer-ok-container")
15231
15251
  }, /* @__PURE__ */ React.createElement(Button, {
15232
15252
  type: "primary",
@@ -15239,9 +15259,9 @@
15239
15259
  return handleOk(e);
15240
15260
  },
15241
15261
  loading
15242
- }, confirmText || locale.confirm), badge ? /* @__PURE__ */ React.createElement(components.View, {
15262
+ }, confirmText || locale.confirm), confirmBadge ? /* @__PURE__ */ React.createElement(components.View, {
15243
15263
  className: "".concat(classPrefix2, "-footer-ok-badge")
15244
- }, badge) : null) : /* @__PURE__ */ React.createElement(Button, {
15264
+ }, confirmBadge) : null) : /* @__PURE__ */ React.createElement(Button, {
15245
15265
  type: "primary",
15246
15266
  size: "large",
15247
15267
  className: classNames("".concat(classPrefix2, "-footer-ok ").concat(btnClass), {