wlwy-package 3.2.2 → 4.0.0-beta.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 (55) hide show
  1. package/dist/editor/index.es.js +1 -1
  2. package/dist/{editor-core-D9MSA0yc.js → editor-core-BuQ0a_wZ.js} +2 -2
  3. package/dist/{index-DbAXWdHe.js → index-CcW4jJHZ.js} +1 -1
  4. package/dist/{index-D4mQXwMj.js → index-DHKUfRSS.js} +189 -17
  5. package/dist/style.css +1 -1
  6. package/dist/types/packages/components/antd/src/datePicker.vue.d.ts +1 -1
  7. package/dist/types/packages/components/common/index.d.ts +0 -3
  8. package/dist/types/packages/components/common/src/page.vue.d.ts +1 -1
  9. package/dist/types/packages/components/common/src/rangePicker.vue.d.ts +1 -1
  10. package/dist/types/packages/components/common/type.d.ts +1 -37
  11. package/dist/types/packages/components/form/default/index.d.ts +1 -7
  12. package/dist/types/packages/components/form/default/src/checkbox.vue.d.ts +1 -0
  13. package/dist/types/packages/components/form/default/src/dateRange.vue.d.ts +1 -0
  14. package/dist/types/packages/components/form/default/src/form.vue.d.ts +1 -0
  15. package/dist/types/packages/components/form/default/src/numberRange.vue.d.ts +1 -0
  16. package/dist/types/packages/components/form/default/src/radio.vue.d.ts +1 -0
  17. package/dist/types/packages/components/form/default/src/select.vue.d.ts +1 -0
  18. package/dist/types/packages/components/form/default/src/selectInput.vue.d.ts +1 -0
  19. package/dist/types/packages/components/form/default/type.d.ts +100 -249
  20. package/dist/types/packages/components/index.d.ts +0 -1
  21. package/dist/types/packages/components/table/constants.d.ts +3 -5
  22. package/dist/types/packages/components/table/index.d.ts +1 -1
  23. package/dist/types/packages/components/table/resolveToolbarButtons.d.ts +16 -0
  24. package/dist/types/packages/components/table/src/search.vue.d.ts +9 -3
  25. package/dist/types/packages/components/table/src/table.vue.d.ts +8 -20
  26. package/dist/types/packages/components/{common/src/editTitle.vue.d.ts → table/src/toolbarButtons.vue.d.ts} +7 -7
  27. package/dist/types/packages/components/table/type.d.ts +101 -15
  28. package/dist/types/packages/components/table/useWTableConfig.d.ts +0 -1
  29. package/dist/types/packages/components/table/warnDeprecated.d.ts +3 -5
  30. package/dist/types/packages/hooks/private/src/useRenderCell.d.ts +6 -4
  31. package/dist/types/packages/hooks/web/index.d.ts +1 -4
  32. package/dist/types/packages/hooks/web/src/useDate.d.ts +65 -0
  33. package/dist/types/packages/keys/index.d.ts +3 -0
  34. package/dist/types/packages/utils/formatCellValue.d.ts +5 -1
  35. package/dist/types/packages/utils/index.d.ts +2 -1
  36. package/dist/types/packages/utils/resolveDefaultValue.d.ts +7 -0
  37. package/dist/types/packages/utils/type.d.ts +7 -0
  38. package/dist/wlwy-package.es.js +2599 -4162
  39. package/package.json +1 -1
  40. package/dist/types/packages/components/common/src/pageHead.vue.d.ts +0 -29
  41. package/dist/types/packages/components/form/default/src/modal.vue.d.ts +0 -46
  42. package/dist/types/packages/components/form/default/src/page.vue.d.ts +0 -48
  43. package/dist/types/packages/components/form/default/src/wrap.vue.d.ts +0 -56
  44. package/dist/types/packages/components/list/index.d.ts +0 -7
  45. package/dist/types/packages/components/list/input.d.ts +0 -432
  46. package/dist/types/packages/components/list/src/header.vue.d.ts +0 -44
  47. package/dist/types/packages/components/list/src/index.vue.d.ts +0 -68
  48. package/dist/types/packages/components/list/src/pager.vue.d.ts +0 -10
  49. package/dist/types/packages/components/list/src/table.vue.d.ts +0 -774
  50. package/dist/types/packages/components/list/type.d.ts +0 -346
  51. package/dist/types/packages/components/table/resolveInjectColumns.d.ts +0 -17
  52. package/dist/types/packages/hooks/web/src/useListConfig.d.ts +0 -16
  53. package/dist/types/packages/hooks/web/src/usePageForm.d.ts +0 -9
  54. package/dist/types/packages/hooks/web/src/usePrefixTitle.d.ts +0 -7
  55. package/dist/types/packages/hooks/web/src/useUpload.d.ts +0 -1
@@ -1,4 +1,4 @@
1
- import { E as Editor } from "../index-DbAXWdHe.js";
1
+ import { E as Editor } from "../index-CcW4jJHZ.js";
2
2
  export {
3
3
  Editor as default
4
4
  };
@@ -1,9 +1,9 @@
1
1
  import { defineComponent, createElementBlock, openBlock, ref, shallowRef, onMounted, watch, toRaw, watchEffect, mergeModels, useCssVars, unref, useModel, computed, onBeforeUnmount, createVNode } from "vue";
2
2
  import "xe-utils";
3
+ import { u as useI18n, b as useLocale, A as API } from "./index-DHKUfRSS.js";
3
4
  import { theme, message } from "ant-design-vue";
4
5
  import "vue-router";
5
- import { u as useI18n, b as useLocale, A as API } from "./index-D4mQXwMj.js";
6
- import { _ as _export_sfc$1 } from "./index-DbAXWdHe.js";
6
+ import { _ as _export_sfc$1 } from "./index-CcW4jJHZ.js";
7
7
  var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
8
8
  function t(e10) {
9
9
  return e10 && e10.__esModule && Object.prototype.hasOwnProperty.call(e10, "default") ? e10.default : e10;
@@ -22,7 +22,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
22
  }),
23
23
  emits: /* @__PURE__ */ mergeModels(["change", "focus", "blur"], ["update:html", "update:text"]),
24
24
  setup(__props, { expose: __expose, emit: __emit }) {
25
- const EditorCore = defineAsyncComponent(() => import("./editor-core-D9MSA0yc.js"));
25
+ const EditorCore = defineAsyncComponent(() => import("./editor-core-BuQ0a_wZ.js"));
26
26
  const html = useModel(__props, "html");
27
27
  const text = useModel(__props, "text");
28
28
  const props = __props;
@@ -5,8 +5,11 @@ import { defineStore, createPinia } from "pinia";
5
5
  import { ref, reactive, computed, toRefs, effectScope, shallowRef, watch, isRef, defineComponent, getCurrentInstance, h, Fragment, inject, onMounted, onUnmounted, createVNode, Text, unref, useAttrs, useSlots, provide, nextTick, createBlock, openBlock, resolveDynamicComponent, createElementBlock } from "vue";
6
6
  import { cookie, merge as merge$1, omit, pick, toTreeArray, clone, findTree } from "xe-utils";
7
7
  import { message, theme } from "ant-design-vue";
8
- import { useRouter } from "vue-router";
9
8
  import dayjs from "dayjs";
9
+ import isBetween from "dayjs/plugin/isBetween";
10
+ import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
11
+ import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
12
+ import { useRouter } from "vue-router";
10
13
  import utc from "dayjs/plugin/utc";
11
14
  import timezone from "dayjs/plugin/timezone";
12
15
  import * as Icons from "@ant-design/icons-vue";
@@ -213,6 +216,158 @@ function useCookie() {
213
216
  getCookieAll
214
217
  };
215
218
  }
219
+ dayjs.extend(isBetween);
220
+ dayjs.extend(isSameOrAfter);
221
+ dayjs.extend(isSameOrBefore);
222
+ const DEFAULT_DATETIME_FORMAT$1 = "YYYY-MM-DD HH:mm:ss";
223
+ const DEFAULT_DATE_FORMAT$1 = "YYYY-MM-DD";
224
+ function useDate(options = {}) {
225
+ const defaultFormat = options.format ?? DEFAULT_DATETIME_FORMAT$1;
226
+ const includeCurrent = options.includeCurrent ?? true;
227
+ function toDayjs(value) {
228
+ if (value == null || value === "") return dayjs();
229
+ return dayjs.isDayjs(value) ? value : dayjs(value);
230
+ }
231
+ function format2(value, pattern = defaultFormat) {
232
+ if (!value) return "-";
233
+ const d = toDayjs(value);
234
+ return d.isValid() ? d.format(pattern) : "-";
235
+ }
236
+ function parse2(value, pattern) {
237
+ return pattern ? dayjs(value, pattern) : dayjs(value);
238
+ }
239
+ function startOf(value, unit = "day") {
240
+ return toDayjs(value).startOf(unit);
241
+ }
242
+ function endOf(value, unit = "day") {
243
+ return toDayjs(value).endOf(unit);
244
+ }
245
+ function toTimestamp(value) {
246
+ return toDayjs(value).valueOf();
247
+ }
248
+ function fromTimestamp(ms) {
249
+ return dayjs(ms);
250
+ }
251
+ function recentRange(n, unit = "day", opts) {
252
+ const base = endOf((opts == null ? void 0 : opts.base) ?? dayjs(), "day");
253
+ const include = (opts == null ? void 0 : opts.includeCurrent) ?? includeCurrent;
254
+ let start;
255
+ if (unit === "day" || unit === "d") {
256
+ start = base.subtract(include ? n - 1 : n, "day").startOf("day");
257
+ } else {
258
+ start = base.subtract(n, unit).add(include ? 1 : 0, "day").startOf("day");
259
+ }
260
+ return [start, base];
261
+ }
262
+ const recentDays = (n, opts) => recentRange(n, "day", opts);
263
+ const recentMonths = (n, opts) => recentRange(n, "month", opts);
264
+ const recentYears = (n, opts) => recentRange(n, "year", opts);
265
+ const presets = {
266
+ last3Days: () => recentDays(3),
267
+ last7Days: () => recentDays(7),
268
+ last1Month: () => recentMonths(1),
269
+ last3Months: () => recentMonths(3),
270
+ last6Months: () => recentMonths(6),
271
+ last1Year: () => recentYears(1),
272
+ last2Years: () => recentYears(2),
273
+ last3Years: () => recentYears(3),
274
+ last5Years: () => recentYears(5),
275
+ last10Years: () => recentYears(10)
276
+ };
277
+ function today() {
278
+ const now2 = dayjs();
279
+ return [now2.startOf("day"), now2.endOf("day")];
280
+ }
281
+ function yesterday() {
282
+ const d = dayjs().subtract(1, "day");
283
+ return [d.startOf("day"), d.endOf("day")];
284
+ }
285
+ function thisWeek() {
286
+ const now2 = dayjs();
287
+ return [now2.startOf("week"), now2.endOf("week")];
288
+ }
289
+ function lastWeek() {
290
+ const d = dayjs().subtract(1, "week");
291
+ return [d.startOf("week"), d.endOf("week")];
292
+ }
293
+ function thisMonth() {
294
+ const now2 = dayjs();
295
+ return [now2.startOf("month"), now2.endOf("month")];
296
+ }
297
+ function lastMonth() {
298
+ const d = dayjs().subtract(1, "month");
299
+ return [d.startOf("month"), d.endOf("month")];
300
+ }
301
+ function thisYear() {
302
+ const now2 = dayjs();
303
+ return [now2.startOf("year"), now2.endOf("year")];
304
+ }
305
+ function lastYear() {
306
+ const d = dayjs().subtract(1, "year");
307
+ return [d.startOf("year"), d.endOf("year")];
308
+ }
309
+ function add(value, n, unit) {
310
+ return toDayjs(value).add(n, unit);
311
+ }
312
+ function subtract(value, n, unit) {
313
+ return toDayjs(value).subtract(n, unit);
314
+ }
315
+ function diff(a, b, unit = "day", float = false) {
316
+ return toDayjs(a).diff(toDayjs(b), unit, float);
317
+ }
318
+ function isBefore(a, b, unit) {
319
+ return toDayjs(a).isBefore(toDayjs(b), unit);
320
+ }
321
+ function isAfter(a, b, unit) {
322
+ return toDayjs(a).isAfter(toDayjs(b), unit);
323
+ }
324
+ function isSame(a, b, unit) {
325
+ return toDayjs(a).isSame(toDayjs(b), unit);
326
+ }
327
+ function isBetween2(value, start, end, unit = "day", inclusivity = "[]") {
328
+ return toDayjs(value).isBetween(toDayjs(start), toDayjs(end), unit, inclusivity);
329
+ }
330
+ function toTimestampRange(range) {
331
+ return [range[0].valueOf(), range[1].valueOf()];
332
+ }
333
+ function toFormatRange(range, pattern = defaultFormat) {
334
+ return [range[0].format(pattern), range[1].format(pattern)];
335
+ }
336
+ return {
337
+ dayjs,
338
+ DEFAULT_DATETIME_FORMAT: DEFAULT_DATETIME_FORMAT$1,
339
+ DEFAULT_DATE_FORMAT: DEFAULT_DATE_FORMAT$1,
340
+ toDayjs,
341
+ format: format2,
342
+ parse: parse2,
343
+ startOf,
344
+ endOf,
345
+ toTimestamp,
346
+ fromTimestamp,
347
+ recentRange,
348
+ recentDays,
349
+ recentMonths,
350
+ recentYears,
351
+ presets,
352
+ today,
353
+ yesterday,
354
+ thisWeek,
355
+ lastWeek,
356
+ thisMonth,
357
+ lastMonth,
358
+ thisYear,
359
+ lastYear,
360
+ add,
361
+ subtract,
362
+ diff,
363
+ isBefore,
364
+ isAfter,
365
+ isSame,
366
+ isBetween: isBetween2,
367
+ toTimestampRange,
368
+ toFormatRange
369
+ };
370
+ }
216
371
  function bind(fn, thisArg) {
217
372
  return function wrap() {
218
373
  return fn.apply(thisArg, arguments);
@@ -8472,14 +8627,23 @@ const DEFAULT_TEMPORAL_PATTERNS = {
8472
8627
  datetime: DEFAULT_DATETIME_FORMAT
8473
8628
  };
8474
8629
  const INTL_MAX_FRACTION_DIGITS = 20;
8475
- function resolvePlaceholder() {
8476
- return DEFAULT_PLACEHOLDER;
8630
+ function resolvePlaceholder(emptyPlaceholder) {
8631
+ return emptyPlaceholder ?? DEFAULT_PLACEHOLDER;
8477
8632
  }
8478
8633
  function isEmptyCellValue(value) {
8479
8634
  if (value === null || value === void 0) return true;
8480
8635
  if (value === "") return true;
8481
8636
  return false;
8482
8637
  }
8638
+ function isEmptyTemporalValue(value) {
8639
+ if (isEmptyCellValue(value)) return true;
8640
+ if (value === 0 || value === "0") return true;
8641
+ if (typeof value === "string" && value.trim() === "") return true;
8642
+ return false;
8643
+ }
8644
+ function isTemporalFormatType(type) {
8645
+ return type === "date" || type === "time" || type === "datetime";
8646
+ }
8483
8647
  function preserveRawCellValue(value) {
8484
8648
  if (value === null || value === void 0) return "";
8485
8649
  return String(value);
@@ -8549,6 +8713,7 @@ function resolveNumberPrecision(precision) {
8549
8713
  };
8550
8714
  }
8551
8715
  function formatTemporalValue(value, temporalType, options) {
8716
+ if (isEmptyTemporalValue(value)) return "";
8552
8717
  const d = coerceToValidDate(value, DEFAULT_DATE_MIN_YEAR, DEFAULT_DATE_MAX_YEAR);
8553
8718
  if (!d) return preserveRawCellValue(value);
8554
8719
  try {
@@ -8608,7 +8773,10 @@ function formatCellValueCore(value, options) {
8608
8773
  const n = coerceFiniteNumber(value);
8609
8774
  if (n === null) return preserveRawCellValue(value);
8610
8775
  try {
8611
- return new Intl.NumberFormat(void 0, resolveNumberPrecision(options.precision)).format(n);
8776
+ return new Intl.NumberFormat(void 0, {
8777
+ ...resolveNumberPrecision(options.precision),
8778
+ ...options.useGrouping !== void 0 ? { useGrouping: options.useGrouping } : {}
8779
+ }).format(n);
8612
8780
  } catch {
8613
8781
  return preserveRawCellValue(value);
8614
8782
  }
@@ -8655,9 +8823,13 @@ function formatCellValueCore(value, options) {
8655
8823
  return preserveRawCellValue(value);
8656
8824
  }
8657
8825
  }
8658
- function formatCellValue(value, options) {
8826
+ function formatCellValue(value, options, emptyPlaceholder = DEFAULT_PLACEHOLDER) {
8827
+ const placeholder = resolvePlaceholder(emptyPlaceholder);
8659
8828
  if (isEmptyCellValue(value)) {
8660
- return resolvePlaceholder();
8829
+ return placeholder;
8830
+ }
8831
+ if (isTemporalFormatType(options.type) && isEmptyTemporalValue(value)) {
8832
+ return placeholder;
8661
8833
  }
8662
8834
  return formatCellValueCore(value, options);
8663
8835
  }
@@ -8751,7 +8923,7 @@ function useFormItemProps(props) {
8751
8923
  const attrs = useAttrs();
8752
8924
  const slots = useSlots();
8753
8925
  const { useInjectDisabled, useInjectData } = useFormStorage();
8754
- const WFormModaldisabled = useInjectDisabled(false);
8926
+ const formDisabled = useInjectDisabled(false);
8755
8927
  const WFormData = useInjectData();
8756
8928
  const attrMap = computed(() => {
8757
8929
  const fromAttrs = pickMultiple(kebabToCamel(attrs), {
@@ -8775,7 +8947,7 @@ function useFormItemProps(props) {
8775
8947
  return props.label ? t(props.label) : props.label ?? "";
8776
8948
  });
8777
8949
  const disabled = computed(() => {
8778
- return props.disabled || props.isDetails || WFormModaldisabled.value || false;
8950
+ return props.disabled || props.isDetails || formDisabled.value || false;
8779
8951
  });
8780
8952
  const placeholder = computed(() => {
8781
8953
  return disabled.value ? "" : props.placeholder ? t(props.placeholder) : `${t("com_msg_062")}${isChinese ? "" : " "}${label.value}`;
@@ -9465,15 +9637,15 @@ export {
9465
9637
  useLanguageStoreWithOut as m,
9466
9638
  newWin as n,
9467
9639
  _sfc_main as o,
9468
- pickMultiple as p,
9469
- useService as q,
9470
- setupStore as r,
9640
+ useService as p,
9641
+ setupStore as q,
9642
+ store as r,
9471
9643
  setConfig as s,
9472
- store as t,
9644
+ useTabsNavStore as t,
9473
9645
  useI18n as u,
9474
- useTabsNavStore as v,
9475
- useUserPermissionStore as w,
9476
- useDictStore as x,
9477
- useLanguageStore as y,
9478
- useCookie as z
9646
+ useUserPermissionStore as v,
9647
+ useDictStore as w,
9648
+ useLanguageStore as x,
9649
+ useCookie as y,
9650
+ useDate as z
9479
9651
  };