yc-pro-components 0.0.48 → 0.0.50

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 (45) hide show
  1. package/es/components/yc-config-provider/src/type.d.ts +2 -0
  2. package/es/components/yc-config-provider/src/type.mjs +2 -1
  3. package/es/components/yc-plus-page/src/header-filter-cell.vue.mjs +1 -1
  4. package/es/components/yc-plus-page/src/header-filter-cell.vue2.mjs +34 -14
  5. package/es/components/yc-plus-page/src/index.vue.d.ts +60 -172
  6. package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
  7. package/es/components/yc-plus-page/src/index.vue2.mjs +21 -3
  8. package/es/components/yc-plus-page/src/use-local-header-filter.mjs +7 -1
  9. package/es/index.css +10 -10
  10. package/index.css +19 -13
  11. package/index.js +64 -19
  12. package/index.min.css +2 -2
  13. package/index.min.js +11 -11
  14. package/index.min.mjs +11 -11
  15. package/index.mjs +64 -19
  16. package/lib/components/yc-config-provider/src/type.d.ts +2 -0
  17. package/lib/components/yc-config-provider/src/type.js +2 -1
  18. package/lib/components/yc-plus-page/src/header-filter-cell.vue.js +1 -1
  19. package/lib/components/yc-plus-page/src/header-filter-cell.vue2.js +32 -12
  20. package/lib/components/yc-plus-page/src/index.vue.d.ts +60 -172
  21. package/lib/components/yc-plus-page/src/index.vue.js +1 -1
  22. package/lib/components/yc-plus-page/src/index.vue2.js +20 -2
  23. package/lib/components/yc-plus-page/src/use-local-header-filter.js +7 -1
  24. package/lib/index.css +12 -12
  25. package/locale/en.js +1 -1
  26. package/locale/en.min.js +1 -1
  27. package/locale/en.min.mjs +1 -1
  28. package/locale/en.mjs +1 -1
  29. package/locale/ja.js +1 -1
  30. package/locale/ja.min.js +1 -1
  31. package/locale/ja.min.mjs +1 -1
  32. package/locale/ja.mjs +1 -1
  33. package/locale/ko.js +1 -1
  34. package/locale/ko.min.js +1 -1
  35. package/locale/ko.min.mjs +1 -1
  36. package/locale/ko.mjs +1 -1
  37. package/locale/zh-cn.js +1 -1
  38. package/locale/zh-cn.min.js +1 -1
  39. package/locale/zh-cn.min.mjs +1 -1
  40. package/locale/zh-cn.mjs +1 -1
  41. package/locale/zh-tw.js +1 -1
  42. package/locale/zh-tw.min.js +1 -1
  43. package/locale/zh-tw.min.mjs +1 -1
  44. package/locale/zh-tw.mjs +1 -1
  45. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! yc-pro-components v0.0.48 */
1
+ /*! yc-pro-components v0.0.50 */
2
2
  import { unref, isRef, ref, inject, isReactive, watch, computed, shallowRef, provide, onMounted, nextTick, onBeforeUnmount, defineComponent, useAttrs, watchEffect, openBlock, createBlock, mergeProps, createSlots, withCtx, createElementVNode, renderSlot, normalizeStyle, createVNode, createTextVNode, toDisplayString, createElementBlock, normalizeClass, createCommentVNode, reactive, Fragment, renderList, resolveDynamicComponent, normalizeProps, guardReactiveProps, h, withDirectives, isVNode, withKeys, withModifiers, TransitionGroup, toHandlers, getCurrentInstance, resolveComponent, toRefs, useSlots, onUnmounted, resolveDirective, pushScopeId, popScopeId, onBeforeMount, getCurrentScope, onScopeDispose, toRef, mergeModels, useModel, vShow, createStaticVNode, hasInjectionContext, markRaw, effectScope, toRaw } from 'vue';
3
3
  import { dayjs, localeContextKey, ElDialog, ElButton, ElPagination, ElRadioGroup, ElRadio, ElTableColumn, ElDropdown, ElDropdownMenu, ElDropdownItem, ElIcon, ElTooltip, ElPopconfirm, ElLink, ElMessageBox, useFormDisabled, ElDatePicker, ClickOutside, ElTag, ElInput, ElAutocomplete, ElCascader, ElCheckboxGroup, ElCheckbox, ElColorPicker, ElInputNumber, ElRate, ElSelect, ElOption, ElSlider, ElSwitch, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElSelectV2, ElText, ElDivider, ElFormItem, ElOptionGroup, ElRow, ElCol, ElForm, ElCard, ElMessage, ElImage, ElProgress, ElAvatar, ElPopover, ElTable, vLoading, ElDescriptions, ElDescriptionsItem, ElDrawer, TableV2FixedDir, ElAutoResizer, ElTableV2, ElSteps, ElStep, ElBreadcrumb, ElBreadcrumbItem, ElMenuItem, ElSubMenu, ElMenu, ElScrollbar, ElHeader, ElContainer, ElMain, ElBacktop, ElUpload } from 'element-plus';
4
4
 
@@ -31950,7 +31950,8 @@ const DEFAULT_YC_CONFIG = {
31950
31950
  t: (key) => key,
31951
31951
  components: {
31952
31952
  plusPage: {
31953
- showSearch: true
31953
+ showSearch: true,
31954
+ columnSettingsText: "\u5B57\u6BB5\u7BA1\u7406"
31954
31955
  },
31955
31956
  tabsWithFilter: {
31956
31957
  filterText: "\u7B5B\u9009"
@@ -32392,7 +32393,6 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
32392
32393
  const emit = __emit;
32393
32394
  const { getCdnUrl } = useYcCdnUrl();
32394
32395
  const filterIconUrl = computed(() => getCdnUrl("images", "table_filter_icon.svg"));
32395
- const sortIconUrl = computed(() => getCdnUrl("images", "table_sort_icon.svg"));
32396
32396
  const state = reactive({
32397
32397
  selectedOp: "=",
32398
32398
  inputVal: ""
@@ -32536,6 +32536,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
32536
32536
  modelValue: state.inputVal,
32537
32537
  "onUpdate:modelValue": (v) => state.inputVal = v,
32538
32538
  placeholder: "",
32539
+ maxlength: 50,
32539
32540
  style: "margin-top: 4px; width: 100%"
32540
32541
  });
32541
32542
  };
@@ -32563,7 +32564,10 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
32563
32564
  createElementVNode(
32564
32565
  "span",
32565
32566
  {
32566
- class: normalizeClass(["yc-header-filter-cell__label", { "yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value }]),
32567
+ class: normalizeClass(["yc-header-filter-cell__label", {
32568
+ "yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value,
32569
+ "yc-header-filter-cell__label--active": isAscActive.value || isDescActive.value || isActive.value
32570
+ }]),
32567
32571
  style: {
32568
32572
  userSelect: "none",
32569
32573
  cursor: "pointer"
@@ -32662,19 +32666,35 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
32662
32666
  class: "yc-header-filter-cell__sort",
32663
32667
  style: {
32664
32668
  display: "inline-flex",
32669
+ flexDirection: "column",
32665
32670
  alignItems: "center",
32666
- cursor: "pointer"
32671
+ cursor: "pointer",
32672
+ lineHeight: 1
32667
32673
  },
32668
32674
  onClick: withModifiers(cycleSort, ["stop"])
32669
32675
  }, [
32670
- createVNode(unref(YcSvgIcon), {
32671
- src: sortIconUrl.value,
32672
- size: 14,
32673
- class: normalizeClass({
32674
- "yc-header-filter-cell__sort-icon--asc": isAscActive.value,
32675
- "yc-header-filter-cell__sort-icon--desc": isDescActive.value
32676
- })
32677
- }, null, 8, ["src", "class"])
32676
+ createCommentVNode(" \u5347\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
32677
+ createVNode(unref(ElIcon), {
32678
+ size: 10,
32679
+ style: normalizeStyle({ color: isAscActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)", marginBottom: "-4px" })
32680
+ }, {
32681
+ default: withCtx(() => [
32682
+ createVNode(unref(caret_top_default))
32683
+ ]),
32684
+ _: 1
32685
+ /* STABLE */
32686
+ }, 8, ["style"]),
32687
+ createCommentVNode(" \u964D\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
32688
+ createVNode(unref(ElIcon), {
32689
+ size: 10,
32690
+ style: normalizeStyle({ color: isDescActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)" })
32691
+ }, {
32692
+ default: withCtx(() => [
32693
+ createVNode(unref(caret_bottom_default))
32694
+ ]),
32695
+ _: 1
32696
+ /* STABLE */
32697
+ }, 8, ["style"])
32678
32698
  ]),
32679
32699
  createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
32680
32700
  !_ctx.disableFilter ? (openBlock(), createBlock(unref(ElPopover), {
@@ -32692,8 +32712,9 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
32692
32712
  createVNode(unref(YcSvgIcon), {
32693
32713
  src: filterIconUrl.value,
32694
32714
  size: 14,
32715
+ color: isActive.value ? "var(--el-color-primary)" : "currentColor",
32695
32716
  class: normalizeClass({ "yc-header-filter-cell__filter-icon--active": isActive.value })
32696
- }, null, 8, ["src", "class"])
32717
+ }, null, 8, ["src", "color", "class"])
32697
32718
  ])
32698
32719
  ]),
32699
32720
  default: withCtx(() => [
@@ -32768,7 +32789,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
32768
32789
  }
32769
32790
  });
32770
32791
 
32771
- var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-e0442d8a"], ["__file", "header-filter-cell.vue"]]);
32792
+ var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-3330af37"], ["__file", "header-filter-cell.vue"]]);
32772
32793
 
32773
32794
  const DEFAULT_PAGE_SIZE = 20;
32774
32795
  const COLUMN_CACHE_PREFIX = "yc-column-settings:";
@@ -32798,7 +32819,8 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
32798
32819
  headerFilter: { type: [Object, Boolean], default: false },
32799
32820
  hideHeaderFilter: { type: Boolean, default: true },
32800
32821
  columnCacheKey: { default: void 0 },
32801
- disableColumnCache: { type: Boolean, default: false }
32822
+ disableColumnCache: { type: Boolean, default: false },
32823
+ columnSettingsText: { default: void 0 }
32802
32824
  },
32803
32825
  emits: ["header-filter-confirm", "header-filter-reset"],
32804
32826
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -32940,6 +32962,16 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
32940
32962
  if (customIcon) return customIcon;
32941
32963
  return getCdnUrl("images", "table_value_setting.svg");
32942
32964
  });
32965
+ const resolvedColumnSettingsText = computed(() => {
32966
+ if (props.columnSettingsText !== void 0) {
32967
+ return props.columnSettingsText;
32968
+ }
32969
+ const fromGlobal = plusPageConfig == null ? void 0 : plusPageConfig.columnSettingsText;
32970
+ if (fromGlobal !== void 0) {
32971
+ return fromGlobal;
32972
+ }
32973
+ return "\u5B57\u6BB5\u7BA1\u7406";
32974
+ });
32943
32975
  watch(
32944
32976
  showSearch,
32945
32977
  () => {
@@ -33183,6 +33215,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
33183
33215
  return !((tableConfig == null ? void 0 : tableConfig.border) === true);
33184
33216
  });
33185
33217
  void fieldSettingIconUrl.value;
33218
+ void resolvedColumnSettingsText.value;
33186
33219
  void hasRequest.value;
33187
33220
  void showDefaultColumnSettingsIcon.value;
33188
33221
  __expose({
@@ -33248,7 +33281,13 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
33248
33281
  src: fieldSettingIconUrl.value,
33249
33282
  size: 16
33250
33283
  }, null, 8, ["src"]),
33251
- createElementVNode("span", { class: "column-settings-text" }, "\u5B57\u6BB5\u7BA1\u7406")
33284
+ createElementVNode(
33285
+ "span",
33286
+ { class: "column-settings-text" },
33287
+ toDisplayString(resolvedColumnSettingsText.value),
33288
+ 1
33289
+ /* TEXT */
33290
+ )
33252
33291
  ])
33253
33292
  ]),
33254
33293
  key: "1"
@@ -33270,7 +33309,7 @@ var _sfc_main$f = /* @__PURE__ */ defineComponent({
33270
33309
  }
33271
33310
  });
33272
33311
 
33273
- var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-c7557953"], ["__file", "index.vue"]]);
33312
+ var YcPlusPageComponent = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-bc9aafd7"], ["__file", "index.vue"]]);
33274
33313
 
33275
33314
  function compareValues(a, b) {
33276
33315
  if (a == null && b == null) return 0;
@@ -33316,7 +33355,13 @@ function matchFilter(value, op, filterValue) {
33316
33355
  return !set.includes(strValue);
33317
33356
  }
33318
33357
  case "between": {
33319
- const parts = strFilter.split(",").map((s) => Number(s.trim()));
33358
+ let parts = strFilter.split(",").map((s) => Number(s.trim()));
33359
+ if (parts.length < 2 || isNaN(parts[0]) || isNaN(parts[1])) {
33360
+ const hyphenMatch = strFilter.match(/^(-?\d+(?:\.\d+)?)-(-?\d+(?:\.\d+)?)$/);
33361
+ if (hyphenMatch) {
33362
+ parts = [Number(hyphenMatch[1]), Number(hyphenMatch[2])];
33363
+ }
33364
+ }
33320
33365
  const num = Number(value);
33321
33366
  return parts.length === 2 && !isNaN(num) && !isNaN(parts[0]) && !isNaN(parts[1]) && num >= parts[0] && num <= parts[1];
33322
33367
  }
@@ -60,6 +60,8 @@ export interface YcGlobalConfig {
60
60
  showSearch?: boolean;
61
61
  /** 字段管理图标 URL */
62
62
  fieldSettingIcon?: string;
63
+ /** 工具栏「字段管理」/列设置旁文案,默认「字段管理」 */
64
+ columnSettingsText?: string;
63
65
  };
64
66
  /** YcTabsWithFilter 默认配置 */
65
67
  tabsWithFilter?: {
@@ -14,7 +14,8 @@ const DEFAULT_YC_CONFIG = {
14
14
  t: (key) => key,
15
15
  components: {
16
16
  plusPage: {
17
- showSearch: true
17
+ showSearch: true,
18
+ columnSettingsText: "\u5B57\u6BB5\u7BA1\u7406"
18
19
  },
19
20
  tabsWithFilter: {
20
21
  filterText: "\u7B5B\u9009"
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var headerFilterCell_vue_vue_type_script_setup_true_lang = require('./header-filter-cell.vue2.js');
6
6
  var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
7
7
 
8
- var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(headerFilterCell_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-e0442d8a"], ["__file", "header-filter-cell.vue"]]);
8
+ var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(headerFilterCell_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-3330af37"], ["__file", "header-filter-cell.vue"]]);
9
9
 
10
10
  exports.default = YcTableHeaderFilterCellComponent;
@@ -54,7 +54,6 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
54
54
  const emit = __emit;
55
55
  const { getCdnUrl } = useYcConfig.useYcCdnUrl();
56
56
  const filterIconUrl = vue.computed(() => getCdnUrl("images", "table_filter_icon.svg"));
57
- const sortIconUrl = vue.computed(() => getCdnUrl("images", "table_sort_icon.svg"));
58
57
  const state = vue.reactive({
59
58
  selectedOp: "=",
60
59
  inputVal: ""
@@ -198,6 +197,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
198
197
  modelValue: state.inputVal,
199
198
  "onUpdate:modelValue": (v) => state.inputVal = v,
200
199
  placeholder: "",
200
+ maxlength: 50,
201
201
  style: "margin-top: 4px; width: 100%"
202
202
  });
203
203
  };
@@ -225,7 +225,10 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
225
225
  vue.createElementVNode(
226
226
  "span",
227
227
  {
228
- class: vue.normalizeClass(["yc-header-filter-cell__label", { "yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value }]),
228
+ class: vue.normalizeClass(["yc-header-filter-cell__label", {
229
+ "yc-header-filter-cell__label--ellipsis": shouldShowEllipsis.value,
230
+ "yc-header-filter-cell__label--active": isAscActive.value || isDescActive.value || isActive.value
231
+ }]),
229
232
  style: {
230
233
  userSelect: "none",
231
234
  cursor: "pointer"
@@ -324,19 +327,35 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
324
327
  class: "yc-header-filter-cell__sort",
325
328
  style: {
326
329
  display: "inline-flex",
330
+ flexDirection: "column",
327
331
  alignItems: "center",
328
- cursor: "pointer"
332
+ cursor: "pointer",
333
+ lineHeight: 1
329
334
  },
330
335
  onClick: vue.withModifiers(cycleSort, ["stop"])
331
336
  }, [
332
- vue.createVNode(vue.unref(index$1.default), {
333
- src: sortIconUrl.value,
334
- size: 14,
335
- class: vue.normalizeClass({
336
- "yc-header-filter-cell__sort-icon--asc": isAscActive.value,
337
- "yc-header-filter-cell__sort-icon--desc": isDescActive.value
338
- })
339
- }, null, 8, ["src", "class"])
337
+ vue.createCommentVNode(" \u5347\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
338
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
339
+ size: 10,
340
+ style: vue.normalizeStyle({ color: isAscActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)", marginBottom: "-4px" })
341
+ }, {
342
+ default: vue.withCtx(() => [
343
+ vue.createVNode(vue.unref(ElementPlusIconsVue.CaretTop))
344
+ ]),
345
+ _: 1
346
+ /* STABLE */
347
+ }, 8, ["style"]),
348
+ vue.createCommentVNode(" \u964D\u5E8F\u7BAD\u5934\uFF1A\u6FC0\u6D3B\u65F6\u9AD8\u4EAE "),
349
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
350
+ size: 10,
351
+ style: vue.normalizeStyle({ color: isDescActive.value ? "var(--el-color-primary)" : "var(--el-text-color-placeholder)" })
352
+ }, {
353
+ default: vue.withCtx(() => [
354
+ vue.createVNode(vue.unref(ElementPlusIconsVue.CaretBottom))
355
+ ]),
356
+ _: 1
357
+ /* STABLE */
358
+ }, 8, ["style"])
340
359
  ]),
341
360
  vue.createCommentVNode(" \u7B5B\u9009\u56FE\u6807\u548C\u5F39\u7A97 "),
342
361
  !_ctx.disableFilter ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElPopover), {
@@ -354,8 +373,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
354
373
  vue.createVNode(vue.unref(index$1.default), {
355
374
  src: filterIconUrl.value,
356
375
  size: 14,
376
+ color: isActive.value ? "var(--el-color-primary)" : "currentColor",
357
377
  class: vue.normalizeClass({ "yc-header-filter-cell__filter-icon--active": isActive.value })
358
- }, null, 8, ["src", "class"])
378
+ }, null, 8, ["src", "color", "class"])
359
379
  ])
360
380
  ]),
361
381
  default: vue.withCtx(() => [