wlwy-package 3.2.0 → 3.2.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.
@@ -1,11 +1,5 @@
1
1
  import { type FormInstance } from 'ant-design-vue';
2
2
  import type { WFormProps } from '../type';
3
- declare var __VLS_11: {}, __VLS_13: {};
4
- type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_11) => any;
6
- } & {
7
- default?: (props: typeof __VLS_13) => any;
8
- };
9
3
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormProps, {
10
4
  getFormInstance: () => FormInstance | undefined;
11
5
  $: import("vue").ComponentInternalInstance;
@@ -424,7 +418,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<WFormProps
424
418
  name: string;
425
419
  labelAlign: import("ant-design-vue/es/form/interface").FormLabelAlign;
426
420
  scrollToFirstError: boolean | import("scroll-into-view-if-needed").Options<any>;
427
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
421
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
422
+ default?: ((props: {}) => any) | undefined;
423
+ }>;
428
424
  export default _default;
429
425
  type __VLS_WithSlots<T, S> = T & {
430
426
  new (): {
@@ -204,7 +204,7 @@ export interface WFormSelectInputProps extends FormItemXxProps, Pick<SelectProps
204
204
  /**
205
205
  * w-select-date-range 组件属性
206
206
  */
207
- export interface WFormDateRangeProps extends FormItemXxProps, Pick<DatePickerProps, 'picker'>, Pick<TimeRangePickerProps, 'presets'> {
207
+ export interface WFormDateRangeProps extends FormItemXxProps, Pick<DatePickerProps, 'picker' | 'showTime'>, Pick<TimeRangePickerProps, 'presets'> {
208
208
  /**
209
209
  * Lable下拉选项列表
210
210
  */
@@ -837,6 +837,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
837
837
  }),
838
838
  emits: /* @__PURE__ */ mergeModels(["change", "click"], ["update:checked"]),
839
839
  setup(__props, { emit: __emit }) {
840
+ const { t: t3 } = useI18n();
840
841
  const checked = useModel(__props, "checked");
841
842
  const emits = __emit;
842
843
  function handleChange(checked2, event) {
@@ -852,7 +853,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
852
853
  placement: "top"
853
854
  }, {
854
855
  title: withCtx(() => [
855
- createTextVNode(toDisplayString(__props.title), 1)
856
+ createTextVNode(toDisplayString(__props.title ? unref(t3)(__props.title) : ""), 1)
856
857
  ]),
857
858
  default: withCtx(() => [
858
859
  createVNode(unref(Switch), mergeProps({
@@ -943,7 +944,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
943
944
  }
944
945
  });
945
946
  const configProvider = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-f1ca2106"]]);
946
- const _hoisted_1$u = { class: "no-data" };
947
+ const _hoisted_1$v = { class: "no-data" };
947
948
  const _sfc_main$15 = /* @__PURE__ */ defineComponent({
948
949
  __name: "noData",
949
950
  props: {
@@ -960,7 +961,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
960
961
  return props.msg ? t3(props.msg) : props.msg;
961
962
  });
962
963
  return (_ctx, _cache) => {
963
- return openBlock(), createElementBlock("div", _hoisted_1$u, toDisplayString(msg.value), 1);
964
+ return openBlock(), createElementBlock("div", _hoisted_1$v, toDisplayString(msg.value), 1);
964
965
  };
965
966
  }
966
967
  });
@@ -2091,7 +2092,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
2091
2092
  };
2092
2093
  }
2093
2094
  });
2094
- const _hoisted_1$t = { class: "w-card-title" };
2095
+ const _hoisted_1$u = { class: "w-card-title" };
2095
2096
  const _hoisted_2$g = { class: "right" };
2096
2097
  const _sfc_main$13 = /* @__PURE__ */ defineComponent({
2097
2098
  ...{
@@ -2187,7 +2188,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
2187
2188
  title.value || _ctx.$slots.title ? {
2188
2189
  name: "title",
2189
2190
  fn: withCtx(() => [
2190
- createElementVNode("div", _hoisted_1$t, [
2191
+ createElementVNode("div", _hoisted_1$u, [
2191
2192
  createElementVNode("div", {
2192
2193
  class: normalizeClass(["title", { required: props.required }])
2193
2194
  }, [
@@ -2784,7 +2785,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
2784
2785
  };
2785
2786
  }
2786
2787
  });
2787
- const _hoisted_1$s = {
2788
+ const _hoisted_1$t = {
2788
2789
  key: 0,
2789
2790
  class: "ant-upload-drag-icon"
2790
2791
  };
@@ -2928,7 +2929,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
2928
2929
  onChange: handleChange
2929
2930
  }), {
2930
2931
  default: withCtx(() => [
2931
- uploadIcon.value || _ctx.$slots.uploadIcon ? (openBlock(), createElementBlock("p", _hoisted_1$s, [
2932
+ uploadIcon.value || _ctx.$slots.uploadIcon ? (openBlock(), createElementBlock("p", _hoisted_1$t, [
2932
2933
  renderSlot(_ctx.$slots, "uploadIcon", {}, () => [
2933
2934
  createVNode(unref(WIcon), { type: uploadIcon.value }, null, 8, ["type"])
2934
2935
  ], true)
@@ -2979,7 +2980,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
2979
2980
  }
2980
2981
  });
2981
2982
  const upload = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-1fb3c2b7"]]);
2982
- const _hoisted_1$r = { class: "cropper-content" };
2983
+ const _hoisted_1$s = { class: "cropper-content" };
2983
2984
  const _hoisted_2$e = { class: "cropper" };
2984
2985
  const _hoisted_3$b = ["src"];
2985
2986
  const _hoisted_4$a = { class: "footer-btn" };
@@ -3106,7 +3107,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
3106
3107
  onOk: getCrop
3107
3108
  }, {
3108
3109
  default: withCtx(() => [
3109
- createElementVNode("div", _hoisted_1$r, [
3110
+ createElementVNode("div", _hoisted_1$s, [
3110
3111
  createElementVNode("div", _hoisted_2$e, [
3111
3112
  createVNode(unref(M), mergeProps({
3112
3113
  ref_key: "cropper",
@@ -3559,7 +3560,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
3559
3560
  };
3560
3561
  }
3561
3562
  });
3562
- const _hoisted_1$q = { class: "w-table-container" };
3563
+ const _hoisted_1$r = { class: "w-table-container" };
3563
3564
  const _hoisted_2$d = {
3564
3565
  key: 0,
3565
3566
  class: "w-table-selection-summary"
@@ -3854,7 +3855,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
3854
3855
  emit("pageChange", args);
3855
3856
  }
3856
3857
  return (_ctx, _cache) => {
3857
- return openBlock(), createElementBlock("div", _hoisted_1$q, [
3858
+ return openBlock(), createElementBlock("div", _hoisted_1$r, [
3858
3859
  showToolbar.value ? (openBlock(), createBlock(unref(VxeToolbar), mergeProps({
3859
3860
  key: 0,
3860
3861
  ref_key: "xToolbarRef",
@@ -4218,6 +4219,10 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
4218
4219
  };
4219
4220
  }
4220
4221
  });
4222
+ const _hoisted_1$q = {
4223
+ key: 0,
4224
+ class: "form-row-wrapper"
4225
+ };
4221
4226
  const _sfc_main$S = /* @__PURE__ */ defineComponent({
4222
4227
  ...{
4223
4228
  name: "WForm"
@@ -4267,6 +4272,37 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
4267
4272
  offset: 0
4268
4273
  };
4269
4274
  });
4275
+ const slots = useSlots();
4276
+ const categorizedNodes = computed(() => {
4277
+ var _a, _b;
4278
+ const leftNodes = [];
4279
+ const rightNodes = [];
4280
+ const normalNodes = [];
4281
+ const slotContent = (_a = slots.default) == null ? void 0 : _a.call(slots);
4282
+ if (slotContent) {
4283
+ for (const node of slotContent) {
4284
+ if (typeof node !== "object" || node === null) {
4285
+ normalNodes.push(node);
4286
+ continue;
4287
+ }
4288
+ const vnode = node;
4289
+ const flexExtra = (_b = vnode.props) == null ? void 0 : _b["flex-extra"];
4290
+ if (flexExtra === "left") {
4291
+ leftNodes.push(vnode);
4292
+ } else if (flexExtra === "right") {
4293
+ rightNodes.push(vnode);
4294
+ } else {
4295
+ normalNodes.push(vnode);
4296
+ }
4297
+ }
4298
+ }
4299
+ return { leftNodes, rightNodes, normalNodes };
4300
+ });
4301
+ const flexExtraLeftNodes = computed(() => categorizedNodes.value.leftNodes);
4302
+ const flexExtraRightNodes = computed(() => categorizedNodes.value.rightNodes);
4303
+ const normalSlotNodes = computed(() => categorizedNodes.value.normalNodes);
4304
+ const hasFlexExtraLeft = computed(() => flexExtraLeftNodes.value.length > 0);
4305
+ const hasFlexExtraRight = computed(() => flexExtraRightNodes.value.length > 0);
4270
4306
  const { useProvideData, useProvideDisabled, useProvideColumn, useProvideLabelCol, useProvideWrapperCol, useProvideCard } = useFormStorage();
4271
4307
  useProvideData(computed(() => props.model));
4272
4308
  useProvideDisabled(computed(() => props.disabled));
@@ -4289,25 +4325,56 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
4289
4325
  model: props.model
4290
4326
  }), {
4291
4327
  default: withCtx(() => [
4292
- props.column && !props.card ? (openBlock(), createBlock(unref(Row), {
4293
- key: 0,
4294
- class: "form-row",
4295
- wrap: "",
4296
- gutter: props.gutter,
4297
- align: props.align
4298
- }, {
4299
- default: withCtx(() => [
4300
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
4301
- ]),
4302
- _: 3
4303
- }, 8, ["gutter", "align"])) : renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
4328
+ props.column && !props.card ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
4329
+ hasFlexExtraLeft.value ? (openBlock(), createBlock(unref(Space), {
4330
+ key: 0,
4331
+ class: "flex-extra-left"
4332
+ }, {
4333
+ default: withCtx(() => [
4334
+ (openBlock(true), createElementBlock(Fragment, null, renderList(flexExtraLeftNodes.value, (node, index2) => {
4335
+ return openBlock(), createBlock(resolveDynamicComponent(node), {
4336
+ key: `flex-left-${index2}`
4337
+ });
4338
+ }), 128))
4339
+ ]),
4340
+ _: 1
4341
+ })) : createCommentVNode("", true),
4342
+ createVNode(unref(Row), {
4343
+ class: "form-row",
4344
+ wrap: "",
4345
+ gutter: props.gutter,
4346
+ align: props.align
4347
+ }, {
4348
+ default: withCtx(() => [
4349
+ (openBlock(true), createElementBlock(Fragment, null, renderList(normalSlotNodes.value, (node, index2) => {
4350
+ return openBlock(), createBlock(resolveDynamicComponent(node), {
4351
+ key: `form-item-${index2}`
4352
+ });
4353
+ }), 128))
4354
+ ]),
4355
+ _: 1
4356
+ }, 8, ["gutter", "align"]),
4357
+ hasFlexExtraRight.value ? (openBlock(), createBlock(unref(Space), {
4358
+ key: 1,
4359
+ class: "flex-extra-right"
4360
+ }, {
4361
+ default: withCtx(() => [
4362
+ (openBlock(true), createElementBlock(Fragment, null, renderList(flexExtraRightNodes.value, (node, index2) => {
4363
+ return openBlock(), createBlock(resolveDynamicComponent(node), {
4364
+ key: `flex-right-${index2}`
4365
+ });
4366
+ }), 128))
4367
+ ]),
4368
+ _: 1
4369
+ })) : createCommentVNode("", true)
4370
+ ])) : renderSlot(_ctx.$slots, "default", { key: 1 }, void 0, true)
4304
4371
  ]),
4305
4372
  _: 3
4306
4373
  }, 16, ["scrollToFirstError", "layout", "label-align", "label-col", "wrapper-col", "disabled", "name", "model"]);
4307
4374
  };
4308
4375
  }
4309
4376
  });
4310
- const WForm = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-1c55119b"]]);
4377
+ const WForm = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-6b613d1a"]]);
4311
4378
  const _sfc_main$R = /* @__PURE__ */ defineComponent({
4312
4379
  ...{
4313
4380
  name: "WFormCol",
@@ -5477,6 +5544,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5477
5544
  labelTooltip: {},
5478
5545
  labelTooltipIcon: {},
5479
5546
  picker: {},
5547
+ showTime: { type: [Boolean, Object] },
5480
5548
  presets: {}
5481
5549
  },
5482
5550
  setup(__props) {
@@ -5563,9 +5631,14 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5563
5631
  });
5564
5632
  const offsetDays = computed(() => props.offsetDays >= 864e5 ? props.offsetDays / 864e5 : props.offsetDays);
5565
5633
  const showTime = computed(() => {
5566
- var _a, _b;
5567
- const v2 = ((_a = attrMap.value.default) == null ? void 0 : _a.showTime) ?? ((_b = attrMap.value.default) == null ? void 0 : _b["show-time"]);
5568
- return v2 !== void 0 && v2 !== false && v2 !== null;
5634
+ const v2 = props.showTime;
5635
+ if (v2 === true) {
5636
+ return { defaultValue: [dayjs("00:00:00", "HH:mm:ss"), dayjs("23:59:59", "HH:mm:ss")] };
5637
+ }
5638
+ return v2;
5639
+ });
5640
+ const hasShowTime = computed(() => {
5641
+ return props.showTime !== void 0 && props.showTime !== false && props.showTime !== null;
5569
5642
  });
5570
5643
  const dates = ref([void 0, void 0]);
5571
5644
  const hackValue = ref();
@@ -5595,7 +5668,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5595
5668
  if (val) {
5596
5669
  if (range === "start") {
5597
5670
  const start = toDayjs(val[0]);
5598
- dates.value[0] = showTime.value ? start : start == null ? void 0 : start.startOf("day");
5671
+ dates.value[0] = hasShowTime.value ? start : start == null ? void 0 : start.startOf("day");
5599
5672
  }
5600
5673
  if (range === "end") {
5601
5674
  const end = toDayjs(val[1]);
@@ -5616,8 +5689,8 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5616
5689
  hackValue.value = form.value[props.model];
5617
5690
  } else {
5618
5691
  if (hackValue.value && !((_a = hackValue.value) == null ? void 0 : _a.some((val) => !val))) {
5619
- const start = showTime.value ? hackValue.value[0] : (_b = hackValue.value[0]) == null ? void 0 : _b.startOf("day");
5620
- const end = showTime.value ? hackValue.value[1] : (_c = hackValue.value[1]) == null ? void 0 : _c.endOf("day");
5692
+ const start = hasShowTime.value ? hackValue.value[0] : (_b = hackValue.value[0]) == null ? void 0 : _b.startOf("day");
5693
+ const end = hasShowTime.value ? hackValue.value[1] : (_c = hackValue.value[1]) == null ? void 0 : _c.endOf("day");
5621
5694
  form.value[props.model] = [start, end];
5622
5695
  if (startKey.value) {
5623
5696
  form.value[startKey.value] = start ? Number(start.format("x")) : void 0;
@@ -5691,7 +5764,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5691
5764
  ])
5692
5765
  ]),
5693
5766
  default: withCtx(() => [
5694
- createVNode(unref(RangePicker), mergeProps({ disabledDate, presets: presets.value, ...unref(attrMap).default, onCalendarChange, onOpenChange, onChange }, {
5767
+ createVNode(unref(RangePicker), mergeProps({ disabledDate, presets: presets.value, showTime: showTime.value, ...unref(attrMap).default, onCalendarChange, onOpenChange, onChange }, {
5695
5768
  value: hackValue.value || unref(form)[props.model],
5696
5769
  disabled: unref(disabled),
5697
5770
  allowClear: props.allowClear,
@@ -5704,7 +5777,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
5704
5777
  };
5705
5778
  }
5706
5779
  });
5707
- const dateRange = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-78a548c6"]]);
5780
+ const dateRange = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-13c65dce"]]);
5708
5781
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
5709
5782
  ...{
5710
5783
  name: "WFormTimePicker",
@@ -6227,7 +6300,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
6227
6300
  const keyword = ref("");
6228
6301
  const code = ref("");
6229
6302
  watch(keyword, (value) => {
6230
- code.value = i18nMap.value[value] ?? value;
6303
+ code.value = i18nMap.value[value.trim()] ?? value.trim();
6231
6304
  form.value[props.model] = code.value;
6232
6305
  });
6233
6306
  watch(
@@ -7427,7 +7500,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
7427
7500
  const actionColSpan = computed(() => 24 - firstRowCount.value * colSpan.value);
7428
7501
  const fieldVnodes = computed(() => {
7429
7502
  var _a;
7430
- return flattenVNodes2(((_a = slots.default) == null ? void 0 : _a.call(slots)) ?? []).filter(isSearchField);
7503
+ return flattenVNodes2(((_a = slots.default) == null ? void 0 : _a.call(slots)) ?? []);
7431
7504
  });
7432
7505
  const firstRowFields = computed(() => fieldVnodes.value.slice(0, firstRowCount.value));
7433
7506
  const moreFields = computed(() => fieldVnodes.value.slice(firstRowCount.value));
@@ -7447,15 +7520,6 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
7447
7520
  }
7448
7521
  return result;
7449
7522
  }
7450
- function isSearchField(vnode) {
7451
- const type = vnode.type;
7452
- if (!type || typeof type === "string") return false;
7453
- const name = String(type.name ?? type.__name ?? type.displayName ?? "");
7454
- if (/FormItem/i.test(name)) return true;
7455
- return /^WForm(?:Input|Select|Textarea|Number|Password|DatePicker|TimePicker|Radio|Checkbox|Tags|Match|I18n|Custom|Upload|DateRange|NumberRange|SelectInput|Country|Customer|Channel|Sku)/.test(
7456
- name
7457
- );
7458
- }
7459
7523
  function handleSearch() {
7460
7524
  var _a;
7461
7525
  (_a = formRef.value) == null ? void 0 : _a.validate().then(() => {
@@ -7601,7 +7665,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
7601
7665
  };
7602
7666
  }
7603
7667
  });
7604
- const search = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-2fa2161d"]]);
7668
+ const search = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-f5fc66e3"]]);
7605
7669
  const _hoisted_1$h = { class: "w-edit-title" };
7606
7670
  const _hoisted_2$a = { class: "right" };
7607
7671
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wlwy-package",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/wlwy-package.es.js",