@vunk/form 2.17.2 → 2.18.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 (139) hide show
  1. package/components/api-tables-select/index.cjs +1 -1
  2. package/components/api-tables-select/index.mjs +1 -1
  3. package/components/button/index.cjs +1 -1
  4. package/components/button/index.mjs +1 -1
  5. package/components/card-input-collection/index.cjs +2 -2
  6. package/components/card-input-collection/index.css +11 -11
  7. package/components/card-input-collection/index.mjs +2 -2
  8. package/components/cascader/index.cjs +1 -1
  9. package/components/cascader/index.mjs +1 -1
  10. package/components/checkbox/index.cjs +1 -1
  11. package/components/checkbox/index.mjs +1 -1
  12. package/components/color-picker/index.cjs +1 -1
  13. package/components/color-picker/index.mjs +1 -1
  14. package/components/date-picker/index.cjs +1 -1
  15. package/components/date-picker/index.mjs +1 -1
  16. package/components/date-picker-range/index.cjs +11 -4
  17. package/components/date-picker-range/index.mjs +11 -4
  18. package/components/date-picker-range/src/ctx.d.ts +2 -2
  19. package/components/date-picker-range/src/index.vue.d.ts +8 -5
  20. package/components/dialog/index.cjs +1 -1
  21. package/components/dialog/index.mjs +1 -1
  22. package/components/dialog-input-collection/index.cjs +58 -36
  23. package/components/dialog-input-collection/index.mjs +51 -29
  24. package/components/dialog-input-collection/src/dialog-form.vue.d.ts +1 -0
  25. package/components/dialog-input-collection/src/index.vue.d.ts +2 -0
  26. package/components/download-plus/index.cjs +25 -14
  27. package/components/download-plus/index.mjs +26 -15
  28. package/components/download-plus/src/index.vue.d.ts +1 -0
  29. package/components/editable-text/index.cjs +1 -1
  30. package/components/editable-text/index.mjs +1 -1
  31. package/components/esri-input-geojson/index.cjs +16 -11
  32. package/components/esri-input-geojson/index.mjs +16 -11
  33. package/components/esri-input-geojson/src/ctx.d.ts +1 -1
  34. package/components/esri-input-geojson/src/index.vue.d.ts +4 -3
  35. package/components/fieldset/index.cjs +1 -1
  36. package/components/fieldset/index.mjs +1 -1
  37. package/components/form/index.cjs +1 -1
  38. package/components/form/index.mjs +1 -1
  39. package/components/form-item/index.cjs +19 -16
  40. package/components/form-item/index.css +12 -12
  41. package/components/form-item/index.mjs +20 -17
  42. package/components/form-item-renderer/index.cjs +2 -2
  43. package/components/form-item-renderer/index.mjs +2 -2
  44. package/components/form-item-renderer-template/index.cjs +1 -1
  45. package/components/form-item-renderer-template/index.mjs +1 -1
  46. package/components/forms-provider/index.cjs +3 -3
  47. package/components/forms-provider/index.mjs +3 -3
  48. package/components/information/index.cjs +1 -1
  49. package/components/information/index.mjs +1 -1
  50. package/components/information-collection/index.cjs +1 -1
  51. package/components/information-collection/index.mjs +1 -1
  52. package/components/information-tag/index.cjs +1 -1
  53. package/components/information-tag/index.mjs +1 -1
  54. package/components/information-templates-default/index.cjs +1 -1
  55. package/components/information-templates-default/index.mjs +1 -1
  56. package/components/input/index.cjs +1 -1
  57. package/components/input/index.mjs +1 -1
  58. package/components/input-array/index.cjs +2 -2
  59. package/components/input-array/index.mjs +2 -2
  60. package/components/input-collection/index.cjs +13 -8
  61. package/components/input-collection/index.css +8 -8
  62. package/components/input-collection/index.mjs +8 -3
  63. package/components/input-collection/src/core.vue.d.ts +1 -0
  64. package/components/input-file/index.cjs +2 -2
  65. package/components/input-file/index.mjs +2 -2
  66. package/components/input-link/index.cjs +20 -10
  67. package/components/input-link/index.mjs +17 -7
  68. package/components/input-link/src/ctx.d.ts +3 -3
  69. package/components/input-link/src/index.vue.d.ts +9 -6
  70. package/components/input-number/index.cjs +1 -1
  71. package/components/input-number/index.mjs +1 -1
  72. package/components/input-tag/index.cjs +1 -1
  73. package/components/input-tag/index.mjs +1 -1
  74. package/components/monaco-editor/index.cjs +1 -1
  75. package/components/monaco-editor/index.mjs +1 -1
  76. package/components/radio/index.cjs +3 -3
  77. package/components/radio/index.css +8 -8
  78. package/components/radio/index.mjs +3 -3
  79. package/components/radio/src/index.vue.d.ts +2 -2
  80. package/components/radio/src/option.vue.d.ts +1 -1
  81. package/components/radio/src/wraper.vue.d.ts +1 -1
  82. package/components/renderer-data/index.cjs +1 -1
  83. package/components/renderer-data/index.mjs +1 -1
  84. package/components/select/index.cjs +3 -3
  85. package/components/select/index.css +9 -9
  86. package/components/select/index.mjs +3 -3
  87. package/components/slider/index.cjs +1 -1
  88. package/components/slider/index.mjs +1 -1
  89. package/components/switch/index.cjs +1 -1
  90. package/components/switch/index.mjs +1 -1
  91. package/components/tables-select/index.cjs +7 -4
  92. package/components/tables-select/index.mjs +7 -4
  93. package/components/tables-select/src/index.vue.d.ts +1 -0
  94. package/components/template-instances-provider/index.cjs +1 -1
  95. package/components/template-instances-provider/index.mjs +1 -1
  96. package/components/templates-default/index.cjs +1 -1
  97. package/components/templates-default/index.mjs +1 -1
  98. package/components/templates-element-plus/index.cjs +1 -1
  99. package/components/templates-element-plus/index.mjs +1 -1
  100. package/components/templates-esri/index.cjs +1 -1
  101. package/components/templates-esri/index.mjs +1 -1
  102. package/components/templates-layout/index.cjs +1 -1
  103. package/components/templates-layout/index.mjs +1 -1
  104. package/components/templates-variant/index.cjs +1 -1
  105. package/components/templates-variant/index.mjs +1 -1
  106. package/components/time-picker/index.cjs +1 -1
  107. package/components/time-picker/index.mjs +1 -1
  108. package/components/upload/index.cjs +42 -29
  109. package/components/upload/index.mjs +41 -28
  110. package/components/upload/src/ctx.d.ts +1 -1
  111. package/components/upload/src/file.vue.d.ts +4 -3
  112. package/components/upload/src/index.vue.d.ts +7 -5
  113. package/components/upload/src/wraper.vue.d.ts +2 -2
  114. package/components/upload-plus/index.cjs +57 -38
  115. package/components/upload-plus/index.mjs +58 -39
  116. package/components/upload-plus/src/index.vue.d.ts +1 -0
  117. package/components/van-cascader/index.cjs +1 -1
  118. package/components/van-cascader/index.mjs +1 -1
  119. package/components/var-datetime-picker/index.cjs +19 -16
  120. package/components/var-datetime-picker/index.mjs +19 -16
  121. package/components/var-datetime-picker/src/index.vue.d.ts +1 -0
  122. package/components/vditor/index.cjs +1 -1
  123. package/components/vditor/index.mjs +1 -1
  124. package/composables/element-plus/index.cjs +23 -0
  125. package/composables/element-plus/index.d.ts +1 -0
  126. package/composables/element-plus/index.mjs +21 -0
  127. package/composables/element-plus/useLocale.d.ts +8 -0
  128. package/index.css +48 -48
  129. package/index.d.ts +1 -0
  130. package/index.esm.js +1 -0
  131. package/locale/index.cjs +110 -0
  132. package/locale/index.d.ts +2 -0
  133. package/locale/index.mjs +107 -0
  134. package/locale/lang/en.d.ts +53 -0
  135. package/locale/lang/index.cjs +2 -0
  136. package/locale/lang/index.d.ts +0 -0
  137. package/locale/lang/index.mjs +1 -0
  138. package/locale/lang/zh-cn.d.ts +53 -0
  139. package/package.json +160 -1
@@ -1,4 +1,4 @@
1
- import { defineComponent, watchEffect, watch, ref, computed, onBeforeUnmount, openBlock, createBlock, mergeProps, withCtx, createElementVNode, createVNode, normalizeClass, createElementBlock, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
1
+ import { defineComponent, watchEffect, watch, ref, computed, onBeforeUnmount, openBlock, createBlock, mergeProps, withCtx, createElementVNode, createVNode, normalizeClass, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, normalizeStyle, withDirectives, createTextVNode } from 'vue';
2
2
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
3
3
  import { ElMessage, ElInput, ElButtonGroup, ElButton, ElIcon, vLoading } from 'element-plus';
4
4
  import { createFileChunk, calculateFileHashSample } from '@vunk/form/shared/upload';
@@ -10,6 +10,7 @@ import { restFetch as restFetch$1 } from '@skzz/platform/shared/fetch/platform';
10
10
  import { l as success_filled_default, c as circle_close_filled_default, n as upload_filled_default } from '../index.mjs';
11
11
  import { useModelComputed } from '@vunk/core/composables';
12
12
  import { ToggleHandler } from '@vunk/shared/class';
13
+ import { useLocale } from '@vunk/form/composables/element-plus';
13
14
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
14
15
 
15
16
  const props = {
@@ -18247,6 +18248,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18247
18248
  const ToggleHandler$1 = ToggleHandler;
18248
18249
  const props = __props;
18249
18250
  const emit = __emit;
18251
+ const { tr } = useLocale();
18250
18252
  const formItemBindProps = _VkfFormItemCtx.createBindProps(props);
18251
18253
  const uuid = Math.random().toString(36).slice(-8);
18252
18254
  const containerFile = useModelComputed({
@@ -18313,14 +18315,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18313
18315
  fileStatus.value = Status.error;
18314
18316
  ElMessage({
18315
18317
  type: "error",
18316
- message: "\u4E0A\u4F20\u5931\u8D25"
18318
+ message: tr("vkf.uploadPlus.uploadFailed", "\u4E0A\u4F20\u5931\u8D25")
18317
18319
  });
18318
18320
  return;
18319
18321
  }
18320
18322
  if (uploaded) {
18321
18323
  ElMessage({
18322
18324
  type: "success",
18323
- message: "\u4E0A\u4F20\u6210\u529F"
18325
+ message: tr("vkf.uploadPlus.uploadSuccess", "\u4E0A\u4F20\u6210\u529F")
18324
18326
  });
18325
18327
  emit("success", mergedFile);
18326
18328
  fileStatus.value = Status.done;
@@ -18354,7 +18356,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18354
18356
  fileStatus.value = Status.error;
18355
18357
  ElMessage({
18356
18358
  type: "error",
18357
- message: "\u4E0A\u4F20\u5931\u8D25"
18359
+ message: tr("vkf.uploadPlus.uploadFailed", "\u4E0A\u4F20\u5931\u8D25")
18358
18360
  });
18359
18361
  });
18360
18362
  };
@@ -18435,7 +18437,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18435
18437
  console.error("\u5408\u5E76\u5931\u8D25", err);
18436
18438
  ElMessage({
18437
18439
  type: "error",
18438
- message: "\u5408\u5E76\u5931\u8D25"
18440
+ message: tr("vkf.uploadPlus.mergeFailed", "\u5408\u5E76\u5931\u8D25")
18439
18441
  });
18440
18442
  throw err;
18441
18443
  }).finally(() => {
@@ -18466,7 +18468,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18466
18468
  onBeforeUnmount(() => {
18467
18469
  offlineToggle.remove();
18468
18470
  });
18469
- const __returned__ = { vLoading: vLoading$1, ToggleHandler: ToggleHandler$1, props, emit, formItemBindProps, uuid, containerFile, fileStatus, containerHash, chunks, uploadingXhrs, filePrefixIcon, handleFileChange, handleUpload, handlePause, cUploadedChunks, merging, cFile, OnlineToggle, offlineToggle, get VkfFormItem() {
18471
+ const __returned__ = { vLoading: vLoading$1, ToggleHandler: ToggleHandler$1, props, emit, tr, formItemBindProps, uuid, containerFile, fileStatus, containerHash, chunks, uploadingXhrs, filePrefixIcon, handleFileChange, handleUpload, handlePause, cUploadedChunks, merging, cFile, OnlineToggle, offlineToggle, get VkfFormItem() {
18470
18472
  return VkfFormItem;
18471
18473
  }, get ElInput() {
18472
18474
  return ElInput;
@@ -18492,11 +18494,12 @@ const _hoisted_3 = {
18492
18494
  key: 0,
18493
18495
  class: "vkf-upload-plus-msg-x"
18494
18496
  };
18495
- const _hoisted_4 = {
18497
+ const _hoisted_4 = { class: "vkf-upload-plus-msg" };
18498
+ const _hoisted_5 = {
18496
18499
  key: 1,
18497
18500
  class: "vkf-upload-plus-cube-x"
18498
18501
  };
18499
- const _hoisted_5 = ["id", "accept"];
18502
+ const _hoisted_6 = ["id", "accept"];
18500
18503
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18501
18504
  return openBlock(), createBlock(
18502
18505
  $setup["VkfFormItem"],
@@ -18515,8 +18518,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18515
18518
  }),
18516
18519
  "model-value": $setup.containerFile?.name,
18517
18520
  "prefix-icon": $setup.filePrefixIcon,
18518
- placeholder: "\u8BF7\u9009\u62E9\u6587\u4EF6"
18519
- }, null, 8, ["class", "model-value", "prefix-icon"]),
18521
+ placeholder: $setup.tr("vkf.uploadPlus.selectFile", "\u8BF7\u9009\u62E9\u6587\u4EF6")
18522
+ }, null, 8, ["class", "model-value", "prefix-icon", "placeholder"]),
18520
18523
  $setup.fileStatus === $setup.Status.done ? (openBlock(), createElementBlock("div", _hoisted_3, [
18521
18524
  createVNode($setup["ElIcon"], null, {
18522
18525
  default: withCtx(() => [
@@ -18525,15 +18528,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18525
18528
  _: 1
18526
18529
  /* STABLE */
18527
18530
  }),
18528
- _cache[0] || (_cache[0] = createElementVNode(
18531
+ createElementVNode(
18529
18532
  "span",
18530
- { class: "vkf-upload-plus-msg" },
18531
- " \u4E0A\u4F20\u6210\u529F ",
18532
- -1
18533
- /* CACHED */
18534
- ))
18533
+ _hoisted_4,
18534
+ toDisplayString($setup.tr("vkf.uploadPlus.uploadSuccess", "\u4E0A\u4F20\u6210\u529F")),
18535
+ 1
18536
+ /* TEXT */
18537
+ )
18535
18538
  ])) : createCommentVNode("v-if", true),
18536
- $setup.fileStatus === $setup.Status.uploading || $setup.fileStatus === $setup.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_4, [
18539
+ $setup.fileStatus === $setup.Status.uploading || $setup.fileStatus === $setup.Status.pause ? (openBlock(), createElementBlock("div", _hoisted_5, [
18537
18540
  (openBlock(true), createElementBlock(
18538
18541
  Fragment,
18539
18542
  null,
@@ -18581,18 +18584,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18581
18584
  class: "vkf-upload-plus-input",
18582
18585
  accept: _ctx.accept,
18583
18586
  onChange: $setup.handleFileChange
18584
- }, null, 40, _hoisted_5),
18587
+ }, null, 40, _hoisted_6),
18585
18588
  createVNode($setup["ElButtonGroup"], { class: "vkf-upload-plus-btng" }, {
18586
18589
  default: withCtx(() => [
18587
18590
  $setup.merging ? withDirectives((openBlock(), createBlock($setup["ElButton"], {
18588
18591
  key: 0,
18589
18592
  type: "success"
18590
18593
  }, {
18591
- default: withCtx(() => _cache[1] || (_cache[1] = [
18592
- createTextVNode(" \u5408\u5E76 ")
18593
- ])),
18594
- _: 1,
18595
- __: [1]
18594
+ default: withCtx(() => [
18595
+ createTextVNode(
18596
+ toDisplayString($setup.tr("vkf.uploadPlus.merge", "\u5408\u5E76")),
18597
+ 1
18598
+ /* TEXT */
18599
+ )
18600
+ ]),
18601
+ _: 1
18602
+ /* STABLE */
18596
18603
  })), [
18597
18604
  [$setup["vLoading"], $setup.merging]
18598
18605
  ]) : $setup.fileStatus === $setup.Status.uploading ? (openBlock(), createBlock($setup["ElButton"], {
@@ -18600,32 +18607,44 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18600
18607
  type: "danger",
18601
18608
  onClick: $setup.handlePause
18602
18609
  }, {
18603
- default: withCtx(() => _cache[2] || (_cache[2] = [
18604
- createTextVNode(" \u6682\u505C ")
18605
- ])),
18606
- _: 1,
18607
- __: [2]
18610
+ default: withCtx(() => [
18611
+ createTextVNode(
18612
+ toDisplayString($setup.tr("vkf.common.pause", "\u6682\u505C")),
18613
+ 1
18614
+ /* TEXT */
18615
+ )
18616
+ ]),
18617
+ _: 1
18618
+ /* STABLE */
18608
18619
  })) : $setup.fileStatus === $setup.Status.done ? (openBlock(), createBlock($setup["ElButton"], {
18609
18620
  key: 2,
18610
18621
  type: "success",
18611
18622
  disabled: ""
18612
18623
  }, {
18613
- default: withCtx(() => _cache[3] || (_cache[3] = [
18614
- createTextVNode(" \u5DF2\u4F20 ")
18615
- ])),
18616
- _: 1,
18617
- __: [3]
18624
+ default: withCtx(() => [
18625
+ createTextVNode(
18626
+ toDisplayString($setup.tr("vkf.uploadPlus.uploaded", "\u5DF2\u4F20")),
18627
+ 1
18628
+ /* TEXT */
18629
+ )
18630
+ ]),
18631
+ _: 1
18632
+ /* STABLE */
18618
18633
  })) : (openBlock(), createBlock($setup["ElButton"], {
18619
18634
  key: 3,
18620
18635
  type: "primary",
18621
18636
  disabled: !$setup.containerFile,
18622
18637
  onClick: $setup.handleUpload
18623
18638
  }, {
18624
- default: withCtx(() => _cache[4] || (_cache[4] = [
18625
- createTextVNode(" \u4E0A\u4F20 ")
18626
- ])),
18627
- _: 1,
18628
- __: [4]
18639
+ default: withCtx(() => [
18640
+ createTextVNode(
18641
+ toDisplayString($setup.tr("vkf.common.upload", "\u4E0A\u4F20")),
18642
+ 1
18643
+ /* TEXT */
18644
+ )
18645
+ ]),
18646
+ _: 1
18647
+ /* STABLE */
18629
18648
  }, 8, ["disabled"]))
18630
18649
  ]),
18631
18650
  _: 1
@@ -18640,7 +18659,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
18640
18659
  /* FULL_PROPS */
18641
18660
  );
18642
18661
  }
18643
- var VkfUploadPlus = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/upload-plus/src/index.vue"]]);
18662
+ var VkfUploadPlus = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\upload-plus\\src\\index.vue"]]);
18644
18663
 
18645
18664
  var types = /*#__PURE__*/Object.freeze({
18646
18665
  __proto__: null
@@ -248,6 +248,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
248
248
  "onUpdate:file"?: (...args: any[] | unknown[]) => any;
249
249
  }> & {}>;
250
250
  emit: ((event: "success", file: FileInfo) => void) & ((event: "update:fileStatus", ...args: unknown[]) => void) & ((event: "update:fileStatus", ...args: any) => void) & ((event: "update:fileStatus", ...args: any[]) => void) & ((event: "update:file", ...args: unknown[]) => void) & ((event: "update:file", ...args: any) => void) & ((event: "update:file", ...args: any[]) => void);
251
+ tr: import("@vunk/form/composables/element-plus").TranslateWithFallback;
251
252
  formItemBindProps: import("vue").ComputedRef<{}>;
252
253
  uuid: string;
253
254
  containerFile: import("vue").WritableComputedRef<File, File>;
@@ -110,7 +110,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
110
110
  /* FULL_PROPS */
111
111
  );
112
112
  }
113
- var VkfVanCascader = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/van-cascader/src/index.vue"]]);
113
+ var VkfVanCascader = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\van-cascader\\src\\index.vue"]]);
114
114
 
115
115
  var types = /*#__PURE__*/Object.freeze({
116
116
  __proto__: null
@@ -106,7 +106,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
106
106
  /* FULL_PROPS */
107
107
  );
108
108
  }
109
- var VkfVanCascader = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/van-cascader/src/index.vue"]]);
109
+ var VkfVanCascader = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\van-cascader\\src\\index.vue"]]);
110
110
 
111
111
  var types = /*#__PURE__*/Object.freeze({
112
112
  __proto__: null
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var formItem = require('@vunk/form/components/form-item');
6
6
  var vue = require('vue');
7
7
  var composables = require('@vunk/form/composables');
8
+ var elementPlus$1 = require('@vunk/form/composables/element-plus');
8
9
  var vant = require('vant');
9
10
  var ui = require('@varlet/ui');
10
11
  var elementPlus = require('element-plus');
@@ -134,10 +135,11 @@ var _sfc_main = vue.defineComponent({
134
135
  ElTabPane: elementPlus.ElTabPane,
135
136
  ElTabs: elementPlus.ElTabs
136
137
  },
137
- emits,
138
138
  props,
139
+ emits,
139
140
  setup(props2, { emit }) {
140
141
  const formItemBindProps = formItem._VkfFormItemCtx.createBindProps(props2);
142
+ const { tr } = elementPlus$1.useLocale();
141
143
  const varDatePickerType = vue.computed(() => {
142
144
  return ElDatePickerTypeReflect[props2.type].varDatePickerType;
143
145
  });
@@ -217,7 +219,8 @@ var _sfc_main = vue.defineComponent({
217
219
  hasTime,
218
220
  currentTab,
219
221
  valueTime,
220
- valueDate
222
+ valueDate,
223
+ tr
221
224
  };
222
225
  }
223
226
  });
@@ -244,49 +247,49 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
244
247
  vue.createVNode(_component_ElDatePicker, {
245
248
  "popper-class": "var-datetime-picker-el-popover",
246
249
  "model-value": _ctx.modelValue,
247
- onFocus: _ctx.inputBlur,
248
250
  type: _ctx.type,
249
251
  readonly: true,
250
- "value-format": _ctx.valueFormat
251
- }, null, 8, ["model-value", "onFocus", "type", "value-format"])
252
+ "value-format": _ctx.valueFormat,
253
+ onFocus: _ctx.inputBlur
254
+ }, null, 8, ["model-value", "type", "value-format", "onFocus"])
252
255
  ],
253
256
  32
254
257
  /* NEED_HYDRATION */
255
258
  ),
256
259
  vue.createVNode(_component_Popup, {
257
- position: "bottom",
258
260
  show: _ctx.popupShow,
259
261
  "onUpdate:show": _cache[4] || (_cache[4] = ($event) => _ctx.popupShow = $event),
262
+ position: "bottom",
260
263
  round: ""
261
264
  }, {
262
265
  default: vue.withCtx(() => [
263
266
  vue.createVNode(_component_ElTabs, {
267
+ modelValue: _ctx.currentTab,
268
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.currentTab = $event),
264
269
  class: vue.normalizeClass(["var-datetime-picker-el-tabs", {
265
270
  "is-hidden": !_ctx.hasTime
266
- }]),
267
- modelValue: _ctx.currentTab,
268
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.currentTab = $event)
271
+ }])
269
272
  }, {
270
273
  default: vue.withCtx(() => [
271
274
  vue.createVNode(_component_ElTabPane, {
272
- label: _ctx.valueDate || "\u9009\u62E9\u65E5\u671F",
275
+ label: _ctx.valueDate || _ctx.tr("el.datepicker.selectDate", "\u9009\u62E9\u65E5\u671F"),
273
276
  name: "date"
274
277
  }, {
275
278
  default: vue.withCtx(() => [
276
279
  vue.createVNode(_component_DatePicker, {
277
- type: _ctx.varDatePickerType,
278
- range: _ctx.isRange,
279
280
  modelValue: _ctx.valueDate,
280
281
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.valueDate = $event),
282
+ type: _ctx.varDatePickerType,
283
+ range: _ctx.isRange,
281
284
  "allowed-dates": _ctx.allowedDates
282
- }, null, 8, ["type", "range", "modelValue", "allowed-dates"])
285
+ }, null, 8, ["modelValue", "type", "range", "allowed-dates"])
283
286
  ]),
284
287
  _: 1
285
288
  /* STABLE */
286
289
  }, 8, ["label"]),
287
290
  _ctx.hasTime ? (vue.openBlock(), vue.createBlock(_component_ElTabPane, {
288
291
  key: 0,
289
- label: _ctx.valueTime || "\u9009\u62E9\u65F6\u95F4",
292
+ label: _ctx.valueTime || _ctx.tr("el.datepicker.selectTime", "\u9009\u62E9\u65F6\u95F4"),
290
293
  name: "time"
291
294
  }, {
292
295
  default: vue.withCtx(() => [
@@ -302,7 +305,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
302
305
  ]),
303
306
  _: 1
304
307
  /* STABLE */
305
- }, 8, ["class", "modelValue"])
308
+ }, 8, ["modelValue", "class"])
306
309
  ]),
307
310
  _: 1
308
311
  /* STABLE */
@@ -315,7 +318,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
315
318
  /* FULL_PROPS */
316
319
  );
317
320
  }
318
- var VkfVarDatetimePicker = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/var-datetime-picker/src/index.vue"]]);
321
+ var VkfVarDatetimePicker = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\var-datetime-picker\\src\\index.vue"]]);
319
322
 
320
323
  var types = /*#__PURE__*/Object.freeze({
321
324
  __proto__: null
@@ -1,6 +1,7 @@
1
1
  import { _VkfFormItemCtx, VkfFormItem } from '@vunk/form/components/form-item';
2
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
+ import { useLocale } from '@vunk/form/composables/element-plus';
4
5
  import { Popup } from 'vant';
5
6
  import { DatePicker, TimePicker } from '@varlet/ui';
6
7
  import { ElDatePicker, ElTabPane, ElTabs, dayjs } from 'element-plus';
@@ -130,10 +131,11 @@ var _sfc_main = defineComponent({
130
131
  ElTabPane,
131
132
  ElTabs
132
133
  },
133
- emits,
134
134
  props,
135
+ emits,
135
136
  setup(props2, { emit }) {
136
137
  const formItemBindProps = _VkfFormItemCtx.createBindProps(props2);
138
+ const { tr } = useLocale();
137
139
  const varDatePickerType = computed(() => {
138
140
  return ElDatePickerTypeReflect[props2.type].varDatePickerType;
139
141
  });
@@ -213,7 +215,8 @@ var _sfc_main = defineComponent({
213
215
  hasTime,
214
216
  currentTab,
215
217
  valueTime,
216
- valueDate
218
+ valueDate,
219
+ tr
217
220
  };
218
221
  }
219
222
  });
@@ -240,49 +243,49 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
240
243
  createVNode(_component_ElDatePicker, {
241
244
  "popper-class": "var-datetime-picker-el-popover",
242
245
  "model-value": _ctx.modelValue,
243
- onFocus: _ctx.inputBlur,
244
246
  type: _ctx.type,
245
247
  readonly: true,
246
- "value-format": _ctx.valueFormat
247
- }, null, 8, ["model-value", "onFocus", "type", "value-format"])
248
+ "value-format": _ctx.valueFormat,
249
+ onFocus: _ctx.inputBlur
250
+ }, null, 8, ["model-value", "type", "value-format", "onFocus"])
248
251
  ],
249
252
  32
250
253
  /* NEED_HYDRATION */
251
254
  ),
252
255
  createVNode(_component_Popup, {
253
- position: "bottom",
254
256
  show: _ctx.popupShow,
255
257
  "onUpdate:show": _cache[4] || (_cache[4] = ($event) => _ctx.popupShow = $event),
258
+ position: "bottom",
256
259
  round: ""
257
260
  }, {
258
261
  default: withCtx(() => [
259
262
  createVNode(_component_ElTabs, {
263
+ modelValue: _ctx.currentTab,
264
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.currentTab = $event),
260
265
  class: normalizeClass(["var-datetime-picker-el-tabs", {
261
266
  "is-hidden": !_ctx.hasTime
262
- }]),
263
- modelValue: _ctx.currentTab,
264
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.currentTab = $event)
267
+ }])
265
268
  }, {
266
269
  default: withCtx(() => [
267
270
  createVNode(_component_ElTabPane, {
268
- label: _ctx.valueDate || "\u9009\u62E9\u65E5\u671F",
271
+ label: _ctx.valueDate || _ctx.tr("el.datepicker.selectDate", "\u9009\u62E9\u65E5\u671F"),
269
272
  name: "date"
270
273
  }, {
271
274
  default: withCtx(() => [
272
275
  createVNode(_component_DatePicker, {
273
- type: _ctx.varDatePickerType,
274
- range: _ctx.isRange,
275
276
  modelValue: _ctx.valueDate,
276
277
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.valueDate = $event),
278
+ type: _ctx.varDatePickerType,
279
+ range: _ctx.isRange,
277
280
  "allowed-dates": _ctx.allowedDates
278
- }, null, 8, ["type", "range", "modelValue", "allowed-dates"])
281
+ }, null, 8, ["modelValue", "type", "range", "allowed-dates"])
279
282
  ]),
280
283
  _: 1
281
284
  /* STABLE */
282
285
  }, 8, ["label"]),
283
286
  _ctx.hasTime ? (openBlock(), createBlock(_component_ElTabPane, {
284
287
  key: 0,
285
- label: _ctx.valueTime || "\u9009\u62E9\u65F6\u95F4",
288
+ label: _ctx.valueTime || _ctx.tr("el.datepicker.selectTime", "\u9009\u62E9\u65F6\u95F4"),
286
289
  name: "time"
287
290
  }, {
288
291
  default: withCtx(() => [
@@ -298,7 +301,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
298
301
  ]),
299
302
  _: 1
300
303
  /* STABLE */
301
- }, 8, ["class", "modelValue"])
304
+ }, 8, ["modelValue", "class"])
302
305
  ]),
303
306
  _: 1
304
307
  /* STABLE */
@@ -311,7 +314,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
311
314
  /* FULL_PROPS */
312
315
  );
313
316
  }
314
- var VkfVarDatetimePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/var-datetime-picker/src/index.vue"]]);
317
+ var VkfVarDatetimePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\var-datetime-picker\\src\\index.vue"]]);
315
318
 
316
319
  var types = /*#__PURE__*/Object.freeze({
317
320
  __proto__: null
@@ -115,6 +115,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
115
115
  currentTab: import("vue").Ref<string, string>;
116
116
  valueTime: import("vue").WritableComputedRef<string, string>;
117
117
  valueDate: import("vue").WritableComputedRef<string, string>;
118
+ tr: import("@vunk/form/composables/element-plus").TranslateWithFallback;
118
119
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
119
120
  'update:modelValue': any;
120
121
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -71,7 +71,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
71
71
  /* FULL_PROPS */
72
72
  );
73
73
  }
74
- var VkfVditor = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/index.vue"]]);
74
+ var VkfVditor = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\vditor\\src\\index.vue"]]);
75
75
 
76
76
  var types = /*#__PURE__*/Object.freeze({
77
77
  __proto__: null
@@ -67,7 +67,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
67
67
  /* FULL_PROPS */
68
68
  );
69
69
  }
70
- var VkfVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/private-vunk-form/private-vunk-form/packages/components/vditor/src/index.vue"]]);
70
+ var VkfVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\vditor\\src\\index.vue"]]);
71
71
 
72
72
  var types = /*#__PURE__*/Object.freeze({
73
73
  __proto__: null
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var elementPlus = require('element-plus');
4
+
5
+ const translateFallback = (fallback, option) => {
6
+ return fallback.replace(
7
+ /\{(\w+)\}/g,
8
+ (_, key) => `${option?.[key] ?? `{${key}}`}`
9
+ );
10
+ };
11
+ const useLocale = (localeOverrides) => {
12
+ const locale = elementPlus.useLocale(localeOverrides);
13
+ const tr = (path, fallback, option) => {
14
+ const value = locale.t(path, option);
15
+ return value === path ? translateFallback(fallback, option) : value;
16
+ };
17
+ return {
18
+ ...locale,
19
+ tr
20
+ };
21
+ };
22
+
23
+ exports.useLocale = useLocale;
@@ -0,0 +1 @@
1
+ export * from './useLocale';
@@ -0,0 +1,21 @@
1
+ import { useLocale as useLocale$1 } from 'element-plus';
2
+
3
+ const translateFallback = (fallback, option) => {
4
+ return fallback.replace(
5
+ /\{(\w+)\}/g,
6
+ (_, key) => `${option?.[key] ?? `{${key}}`}`
7
+ );
8
+ };
9
+ const useLocale = (localeOverrides) => {
10
+ const locale = useLocale$1(localeOverrides);
11
+ const tr = (path, fallback, option) => {
12
+ const value = locale.t(path, option);
13
+ return value === path ? translateFallback(fallback, option) : value;
14
+ };
15
+ return {
16
+ ...locale,
17
+ tr
18
+ };
19
+ };
20
+
21
+ export { useLocale };
@@ -0,0 +1,8 @@
1
+ import type { LocaleContext, TranslatorOption } from 'element-plus/es/hooks/use-locale';
2
+ import type { Language } from 'element-plus/es/locale';
3
+ import type { Ref } from 'vue';
4
+ export type TranslateWithFallback = (path: string, fallback: string, option?: TranslatorOption) => string;
5
+ export type LocaleContextWithFallback = LocaleContext & {
6
+ tr: TranslateWithFallback;
7
+ };
8
+ export declare const useLocale: (localeOverrides?: Ref<Language | undefined>) => LocaleContextWithFallback;