@nutui/nutui 4.0.6-beta.2 → 4.0.6-beta.3

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.
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, h } from "vue";
7
+ import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, nextTick, h } from "vue";
8
8
  import { c as createComponent } from "./component-81a4c1d0.js";
9
9
  import { f as funInterceptor } from "./Interceptor-956b24fc.js";
10
10
  import { P as Popup, p as popupProps } from "./index-c55ad69e.js";
@@ -114,6 +114,7 @@ const _sfc_main = create({
114
114
  funInterceptor(props.beforeClose, {
115
115
  args: [action],
116
116
  done: () => {
117
+ showPopup.value = false;
117
118
  update(false);
118
119
  emit("closed");
119
120
  }
@@ -122,6 +123,7 @@ const _sfc_main = create({
122
123
  const onCancel = () => {
123
124
  emit("cancel");
124
125
  if (props.cancelAutoClose) {
126
+ showPopup.value = false;
125
127
  closed("cancel");
126
128
  }
127
129
  };
@@ -267,8 +269,10 @@ class DialogFunction {
267
269
  return {
268
270
  setup() {
269
271
  options.onUpdate = (val) => {
270
- if (val == false) {
271
- unmount();
272
+ if (val === false) {
273
+ nextTick(() => {
274
+ unmount();
275
+ });
272
276
  }
273
277
  };
274
278
  if (options == null ? void 0 : options.onOpened) {
@@ -101,10 +101,15 @@ const _sfc_main = create({
101
101
  showClearIcon: {
102
102
  type: Boolean,
103
103
  default: false
104
+ },
105
+ class: {
106
+ type: String,
107
+ default: ""
104
108
  }
105
109
  },
106
110
  components: { MaskClose },
107
111
  emits: ["update:modelValue", "blur", "focus", "clear", "keypress", "click", "click-input"],
112
+ expose: ["focus", "blur", "select"],
108
113
  setup(props, { emit, slots }) {
109
114
  const active = ref(false);
110
115
  const inputRef = ref();
@@ -129,7 +134,8 @@ const _sfc_main = create({
129
134
  [`${prefixCls}--disabled`]: props.disabled,
130
135
  [`${prefixCls}--required`]: props.required,
131
136
  [`${prefixCls}--error`]: props.error,
132
- [`${prefixCls}--border`]: props.border
137
+ [`${prefixCls}--border`]: props.border,
138
+ [props.class]: !!props.class
133
139
  };
134
140
  });
135
141
  const styles = computed(() => {
@@ -243,6 +249,18 @@ const _sfc_main = create({
243
249
  onMounted(() => {
244
250
  updateValue(getModelValue(), props.formatTrigger);
245
251
  });
252
+ const focus = () => {
253
+ var _a;
254
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
255
+ };
256
+ const blur = () => {
257
+ var _a;
258
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
259
+ };
260
+ const select = () => {
261
+ var _a;
262
+ (_a = inputRef.value) == null ? void 0 : _a.select();
263
+ };
246
264
  return {
247
265
  renderInput,
248
266
  inputRef,
@@ -257,7 +275,10 @@ const _sfc_main = create({
257
275
  startComposing,
258
276
  endComposing,
259
277
  onClick,
260
- onClickInput
278
+ onClickInput,
279
+ focus,
280
+ blur,
281
+ select
261
282
  };
262
283
  }
263
284
  });
@@ -270,16 +291,12 @@ const _hoisted_5 = {
270
291
  class: "nut-input-word-limit"
271
292
  };
272
293
  const _hoisted_6 = { class: "nut-input-word-num" };
273
- const _hoisted_7 = {
274
- key: 0,
275
- class: "nut-input-clear-box"
276
- };
277
- const _hoisted_8 = { class: "nut-input-right-box" };
294
+ const _hoisted_7 = { class: "nut-input-right-box" };
278
295
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
279
296
  const _component_MaskClose = resolveComponent("MaskClose");
280
297
  return openBlock(), createElementBlock("view", {
281
298
  class: normalizeClass(_ctx.classes),
282
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
299
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args))
283
300
  }, [
284
301
  createElementVNode("view", _hoisted_1, [
285
302
  createElementVNode("view", _hoisted_2, [
@@ -312,19 +329,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
312
329
  createTextVNode("/" + toDisplayString(_ctx.maxLength), 1)
313
330
  ])) : createCommentVNode("", true)
314
331
  ]),
315
- _ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", _hoisted_7, [
332
+ _ctx.clearable && !_ctx.readonly ? withDirectives((openBlock(), createElementBlock("view", {
333
+ key: 0,
334
+ class: "nut-input-clear-box",
335
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clear && _ctx.clear(...args))
336
+ }, [
316
337
  renderSlot(_ctx.$slots, "clear", {}, () => [
317
338
  createVNode(_component_MaskClose, mergeProps({ class: "nut-input-clear" }, _ctx.$attrs, {
318
339
  size: _ctx.clearSize,
319
340
  width: _ctx.clearSize,
320
- height: _ctx.clearSize,
321
- onClick: _ctx.clear
322
- }), null, 16, ["size", "width", "height", "onClick"])
341
+ height: _ctx.clearSize
342
+ }), null, 16, ["size", "width", "height"])
323
343
  ])
324
344
  ], 512)), [
325
345
  [vShow, (_ctx.active || _ctx.showClearIcon) && _ctx.modelValue.length > 0]
326
346
  ]) : createCommentVNode("", true),
327
- createElementVNode("view", _hoisted_8, [
347
+ createElementVNode("view", _hoisted_7, [
328
348
  renderSlot(_ctx.$slots, "right")
329
349
  ])
330
350
  ])
@@ -161,7 +161,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
161
161
  }, [
162
162
  option.value === _ctx.modelValue ? (openBlock(), createElementBlock("span", {
163
163
  key: 0,
164
- class: normalizeClass(["nut-menu-item__span", { activeTitleClass: option.value === _ctx.modelValue, inactiveTitleClass: option.value !== _ctx.modelValue }])
164
+ class: normalizeClass(["nut-menu-item__span", [option.value === _ctx.modelValue ? _ctx.activeTitleClass : _ctx.inactiveTitleClass]])
165
165
  }, [
166
166
  renderSlot(_ctx.$slots, "icon", {}, () => [
167
167
  createVNode(_component_Check, mergeProps(_ctx.$attrs, {
@@ -170,7 +170,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
170
170
  ])
171
171
  ], 2)) : createCommentVNode("", true),
172
172
  createElementVNode("view", {
173
- class: normalizeClass({ activeTitleClass: option.value === _ctx.modelValue, inactiveTitleClass: option.value !== _ctx.modelValue }),
173
+ class: normalizeClass([option.value === _ctx.modelValue ? _ctx.activeTitleClass : _ctx.inactiveTitleClass]),
174
174
  style: normalizeStyle({ color: option.value === _ctx.modelValue ? _ctx.parent.props.activeColor : "" })
175
175
  }, toDisplayString(option.text), 7)
176
176
  ], 14, _hoisted_2);
@@ -410,7 +410,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
410
410
  item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", {
411
411
  key: 1,
412
412
  class: "nut-picker-roller-item-tile",
413
- style: normalizeStyle({ height: _ctx.pxCheck(_ctx.optionHeight) })
413
+ style: normalizeStyle({ height: _ctx.pxCheck(_ctx.optionHeight), lineHeight: _ctx.pxCheck(_ctx.optionHeight) })
414
414
  }, toDisplayString(item.text), 5)) : createCommentVNode("", true)
415
415
  ], 64);
416
416
  }), 128))
@@ -132,11 +132,12 @@ const _sfc_main = create({
132
132
  }
133
133
  });
134
134
  const _hoisted_1 = ["id"];
135
- const _hoisted_2 = {
135
+ const _hoisted_2 = { class: "nut-rate-item__icon--full" };
136
+ const _hoisted_3 = {
136
137
  key: 0,
137
138
  class: "nut-rate-item__icon--half"
138
139
  };
139
- const _hoisted_3 = {
140
+ const _hoisted_4 = {
140
141
  key: 1,
141
142
  class: "nut-rate-item__icon--half"
142
143
  };
@@ -155,18 +156,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
155
156
  id: "rateRefs-" + _ctx.refRandomId + n,
156
157
  style: normalizeStyle(n < Number(_ctx.count) ? { marginRight: _ctx.pxCheck(_ctx.spacing) } : {})
157
158
  }, [
158
- createElementVNode("view", null, [
159
+ createElementVNode("view", _hoisted_2, [
159
160
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.customIcon, { width: _ctx.size, height: _ctx.size, size: _ctx.size, color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor })), {
160
161
  class: normalizeClass(["nut-rate-item__icon", { "nut-rate-item__icon--disabled": _ctx.disabled || n > _ctx.modelValue }]),
161
162
  onClick: ($event) => _ctx.onClick(1, n)
162
163
  }, null, 8, ["class", "onClick"]))
163
164
  ]),
164
- _ctx.allowHalf && Number(_ctx.modelValue) + 1 > n ? (openBlock(), createElementBlock("view", _hoisted_2, [
165
+ _ctx.allowHalf && Number(_ctx.modelValue) + 1 > n ? (openBlock(), createElementBlock("view", _hoisted_3, [
165
166
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.customIcon, { width: _ctx.size, height: _ctx.size, size: _ctx.size, color: n <= Number(_ctx.modelValue) + 1 ? _ctx.activeColor : _ctx.voidColor })), {
166
167
  class: "nut-rate-item__icon",
167
168
  onClick: ($event) => _ctx.onClick(2, n)
168
169
  }, null, 8, ["onClick"]))
169
- ])) : _ctx.allowHalf && Number(_ctx.modelValue) + 1 < n ? (openBlock(), createElementBlock("view", _hoisted_3, [
170
+ ])) : _ctx.allowHalf && Number(_ctx.modelValue) + 1 < n ? (openBlock(), createElementBlock("view", _hoisted_4, [
170
171
  (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.customIcon, { width: _ctx.size, height: _ctx.size, size: _ctx.size, color: _ctx.voidColor })), {
171
172
  class: "nut-rate-item__icon nut-rate-item__icon--disabled",
172
173
  onClick: ($event) => _ctx.onClick(2, n)
@@ -144,27 +144,22 @@
144
144
  }
145
145
 
146
146
  &-item-tile {
147
- display: flex;
148
- align-items: center;
149
- justify-content: center;
147
+ display: block;
148
+ text-align: center;
150
149
  width: 100%;
151
150
  color: $picker-item-text-color;
152
151
  font-size: $picker-item-text-font-size;
153
-
154
152
  overflow: hidden;
155
153
  text-overflow: ellipsis;
156
154
  white-space: nowrap;
157
155
  }
158
156
 
159
157
  &-item-tarotile {
160
- display: flex;
161
- flex-direction: column;
162
- align-items: center;
163
- justify-content: center;
158
+ display: block;
159
+ text-align: center;
164
160
  width: 100%;
165
161
  color: $picker-item-text-color;
166
162
  font-size: $picker-item-text-font-size;
167
-
168
163
  overflow: hidden;
169
164
  text-overflow: ellipsis;
170
165
  white-space: nowrap;
@@ -1,5 +1,6 @@
1
1
  .nut-rate {
2
2
  display: inline-flex;
3
+ vertical-align: bottom;
3
4
  &-item {
4
5
  display: flex;
5
6
  flex-shrink: 0;
@@ -11,25 +12,22 @@
11
12
 
12
13
  &__icon {
13
14
  color: $rate-icon-color;
15
+ flex-shrink: 0;
14
16
  cursor: pointer;
15
17
 
16
- &::before {
17
- // position: relative;
18
- // top: auto;
19
- // left: auto;
20
- // transform: none;
21
- }
22
-
23
18
  &--disabled {
24
19
  color: $rate-icon-void-color;
25
20
  }
21
+ &--full {
22
+ display: flex;
23
+ }
26
24
  &--half {
25
+ display: flex;
27
26
  position: absolute;
28
- width: 50% !important;
27
+ width: 50%;
29
28
  left: 0;
30
29
  top: 0;
31
30
  overflow: hidden;
32
- height: auto !important;
33
31
  }
34
32
  }
35
33
  }
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "NutUI",
5
- "version": "4.0.6-beta.2",
5
+ "version": "4.0.6-beta.3",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "tags": [