@vunk/form 1.1.60 → 1.1.62

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.
@@ -1,5 +1,5 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
- import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createVNode, normalizeClass, createCommentVNode } from 'vue';
2
+ import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode, createVNode, normalizeClass, createCommentVNode } from 'vue';
3
3
  import { useComputedReadonly } from '@vunk/form/composables';
4
4
  import { Popup } from 'vant';
5
5
  import { DatePicker, TimePicker } from '@varlet/ui';
@@ -215,9 +215,11 @@ const _sfc_main = defineComponent({
215
215
  const readonly = useComputedReadonly(props2);
216
216
  const popupShow = ref(false);
217
217
  const currentTab = ref("date");
218
- const preInput = (e) => {
218
+ const inputBlur = (e) => {
219
219
  const target = e.target;
220
220
  target.blur();
221
+ };
222
+ const preInput = () => {
221
223
  if (readonly.value)
222
224
  return;
223
225
  if (props2.modelValue && hasTime.value) {
@@ -227,6 +229,7 @@ const _sfc_main = defineComponent({
227
229
  };
228
230
  return {
229
231
  preInput,
232
+ inputBlur,
230
233
  popupShow,
231
234
  formItemBindProps,
232
235
  varDatePickerType,
@@ -248,16 +251,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
248
251
  const _component_VkfFormItem = resolveComponent("VkfFormItem");
249
252
  return openBlock(), createBlock(_component_VkfFormItem, normalizeProps(guardReactiveProps(_ctx.formItemBindProps)), {
250
253
  default: withCtx(() => [
251
- createVNode(_component_ElDatePicker, {
252
- "popper-class": "var-datetime-picker-el-popover",
253
- "model-value": _ctx.modelValue,
254
- onFocus: _ctx.preInput,
255
- type: _ctx.type
256
- }, null, 8, ["model-value", "onFocus", "type"]),
254
+ createElementVNode("div", {
255
+ onClickCapture: _cache[0] || (_cache[0] = (...args) => _ctx.preInput && _ctx.preInput(...args))
256
+ }, [
257
+ createVNode(_component_ElDatePicker, {
258
+ "popper-class": "var-datetime-picker-el-popover",
259
+ "model-value": _ctx.modelValue,
260
+ onFocus: _ctx.inputBlur,
261
+ type: _ctx.type,
262
+ readonly: true,
263
+ "value-format": _ctx.valueFormat
264
+ }, null, 8, ["model-value", "onFocus", "type", "value-format"])
265
+ ], 32),
257
266
  createVNode(_component_Popup, {
258
267
  position: "bottom",
259
268
  show: _ctx.popupShow,
260
- "onUpdate:show": _cache[3] || (_cache[3] = ($event) => _ctx.popupShow = $event),
269
+ "onUpdate:show": _cache[4] || (_cache[4] = ($event) => _ctx.popupShow = $event),
261
270
  round: ""
262
271
  }, {
263
272
  default: withCtx(() => [
@@ -266,7 +275,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
266
275
  "is-hidden": !_ctx.hasTime
267
276
  }]),
268
277
  modelValue: _ctx.currentTab,
269
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.currentTab = $event)
278
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.currentTab = $event)
270
279
  }, {
271
280
  default: withCtx(() => [
272
281
  createVNode(_component_ElTabPane, {
@@ -278,7 +287,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
278
287
  type: _ctx.varDatePickerType,
279
288
  range: _ctx.isRange,
280
289
  modelValue: _ctx.valueDate,
281
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.valueDate = $event),
290
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.valueDate = $event),
282
291
  "allowed-dates": _ctx.allowedDates
283
292
  }, null, 8, ["type", "range", "modelValue", "allowed-dates"])
284
293
  ]),
@@ -292,7 +301,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
292
301
  default: withCtx(() => [
293
302
  createVNode(_component_TimePicker, {
294
303
  modelValue: _ctx.valueTime,
295
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.valueTime = $event)
304
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.valueTime = $event),
305
+ format: "24hr"
296
306
  }, null, 8, ["modelValue"])
297
307
  ]),
298
308
  _: 1
@@ -63,7 +63,8 @@ declare const _default: import("vue").DefineComponent<{
63
63
  default: string;
64
64
  };
65
65
  }, {
66
- preInput: (e: FocusEvent) => void;
66
+ preInput: () => void;
67
+ inputBlur: (e: FocusEvent) => void;
67
68
  popupShow: import("vue").Ref<boolean>;
68
69
  formItemBindProps: import("vue").ComputedRef<{
69
70
  required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.60",
3
+ "version": "1.1.62",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {