yc-pro-components 0.0.44 → 0.0.45

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 (41) hide show
  1. package/es/components/display-item/src/index.vue2.mjs +16 -3
  2. package/es/components/yc-drawer/src/index.vue.mjs +1 -1
  3. package/es/components/yc-drawer/src/index.vue2.mjs +37 -10
  4. package/es/components/yc-drawer/src/type.d.ts +17 -0
  5. package/es/components/yc-drawer/store.d.ts +6 -0
  6. package/es/dict/createDictStore.d.ts +1 -1
  7. package/es/index.css +8 -8
  8. package/index.css +6 -6
  9. package/index.js +66 -25
  10. package/index.min.css +1 -1
  11. package/index.min.js +11 -11
  12. package/index.min.mjs +11 -11
  13. package/index.mjs +66 -25
  14. package/lib/components/display-item/src/index.vue2.js +16 -3
  15. package/lib/components/yc-drawer/src/index.vue.js +1 -1
  16. package/lib/components/yc-drawer/src/index.vue2.js +36 -9
  17. package/lib/components/yc-drawer/src/type.d.ts +17 -0
  18. package/lib/components/yc-drawer/store.d.ts +6 -0
  19. package/lib/dict/createDictStore.d.ts +1 -1
  20. package/lib/index.css +8 -8
  21. package/locale/en.js +1 -1
  22. package/locale/en.min.js +1 -1
  23. package/locale/en.min.mjs +1 -1
  24. package/locale/en.mjs +1 -1
  25. package/locale/ja.js +1 -1
  26. package/locale/ja.min.js +1 -1
  27. package/locale/ja.min.mjs +1 -1
  28. package/locale/ja.mjs +1 -1
  29. package/locale/ko.js +1 -1
  30. package/locale/ko.min.js +1 -1
  31. package/locale/ko.min.mjs +1 -1
  32. package/locale/ko.mjs +1 -1
  33. package/locale/zh-cn.js +1 -1
  34. package/locale/zh-cn.min.js +1 -1
  35. package/locale/zh-cn.min.mjs +1 -1
  36. package/locale/zh-cn.mjs +1 -1
  37. package/locale/zh-tw.js +1 -1
  38. package/locale/zh-tw.min.js +1 -1
  39. package/locale/zh-tw.min.mjs +1 -1
  40. package/locale/zh-tw.mjs +1 -1
  41. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! yc-pro-components v0.0.44 */
1
+ /*! yc-pro-components v0.0.45 */
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, 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 } from 'element-plus';
4
4
 
@@ -20,8 +20,10 @@ var freeSelf = typeof self == 'object' && self && self.Object === Object && self
20
20
  /** Used as a reference to the global object. */
21
21
  var root = freeGlobal || freeSelf || Function('return this')();
22
22
 
23
+ var root$1 = root;
24
+
23
25
  /** Built-in value references. */
24
- var Symbol$1 = root.Symbol;
26
+ var Symbol$1 = root$1.Symbol;
25
27
 
26
28
  /** Used for built-in method references. */
27
29
  var objectProto$f = Object.prototype;
@@ -416,7 +418,7 @@ function isFunction$1(value) {
416
418
  }
417
419
 
418
420
  /** Used to detect overreaching core-js shims. */
419
- var coreJsData = root['__core-js_shared__'];
421
+ var coreJsData = root$1['__core-js_shared__'];
420
422
 
421
423
  /** Used to detect methods masquerading as native. */
422
424
  var maskSrcKey = (function() {
@@ -527,7 +529,7 @@ function getNative(object, key) {
527
529
  }
528
530
 
529
531
  /* Built-in method references that are verified to be native. */
530
- var WeakMap$1 = getNative(root, 'WeakMap');
532
+ var WeakMap$1 = getNative(root$1, 'WeakMap');
531
533
 
532
534
  /** Built-in value references. */
533
535
  var objectCreate = Object.create;
@@ -1128,7 +1130,7 @@ var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !modu
1128
1130
  var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
1129
1131
 
1130
1132
  /** Built-in value references. */
1131
- var Buffer$1 = moduleExports$2 ? root.Buffer : undefined;
1133
+ var Buffer$1 = moduleExports$2 ? root$1.Buffer : undefined;
1132
1134
 
1133
1135
  /* Built-in method references for those with the same name as other `lodash` methods. */
1134
1136
  var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
@@ -1747,7 +1749,7 @@ ListCache.prototype.has = listCacheHas;
1747
1749
  ListCache.prototype.set = listCacheSet;
1748
1750
 
1749
1751
  /* Built-in method references that are verified to be native. */
1750
- var Map$1 = getNative(root, 'Map');
1752
+ var Map$1 = getNative(root$1, 'Map');
1751
1753
 
1752
1754
  /**
1753
1755
  * Removes all key-value entries from the map.
@@ -2322,7 +2324,7 @@ var freeModule = freeExports && typeof module == 'object' && module && !module.n
2322
2324
  var moduleExports = freeModule && freeModule.exports === freeExports;
2323
2325
 
2324
2326
  /** Built-in value references. */
2325
- var Buffer = moduleExports ? root.Buffer : undefined,
2327
+ var Buffer = moduleExports ? root$1.Buffer : undefined,
2326
2328
  allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
2327
2329
 
2328
2330
  /**
@@ -2499,13 +2501,13 @@ function getAllKeysIn(object) {
2499
2501
  }
2500
2502
 
2501
2503
  /* Built-in method references that are verified to be native. */
2502
- var DataView$1 = getNative(root, 'DataView');
2504
+ var DataView$1 = getNative(root$1, 'DataView');
2503
2505
 
2504
2506
  /* Built-in method references that are verified to be native. */
2505
- var Promise$1 = getNative(root, 'Promise');
2507
+ var Promise$1 = getNative(root$1, 'Promise');
2506
2508
 
2507
2509
  /* Built-in method references that are verified to be native. */
2508
- var Set$1 = getNative(root, 'Set');
2510
+ var Set$1 = getNative(root$1, 'Set');
2509
2511
 
2510
2512
  /** `Object#toString` result references. */
2511
2513
  var mapTag$4 = '[object Map]',
@@ -2584,7 +2586,7 @@ function initCloneArray(array) {
2584
2586
  }
2585
2587
 
2586
2588
  /** Built-in value references. */
2587
- var Uint8Array$1 = root.Uint8Array;
2589
+ var Uint8Array$1 = root$1.Uint8Array;
2588
2590
 
2589
2591
  /**
2590
2592
  * Creates a clone of `arrayBuffer`.
@@ -3871,7 +3873,7 @@ var baseEach = createBaseEach(baseForOwn);
3871
3873
  * // => Logs the number of milliseconds it took for the deferred invocation.
3872
3874
  */
3873
3875
  var now = function() {
3874
- return root.Date.now();
3876
+ return root$1.Date.now();
3875
3877
  };
3876
3878
 
3877
3879
  /** Error message constants. */
@@ -17529,11 +17531,24 @@ var _sfc_main$B = /* @__PURE__ */ defineComponent({
17529
17531
  class: { "is-list": unref(isArray)(getStatus.value) }
17530
17532
  }),
17531
17533
  [
17532
- createCommentVNode(" \u591A\u9009 "),
17533
- unref(isArray)(getStatus.value) ? (openBlock(), createElementBlock(
17534
+ createCommentVNode(" \u7A7A\u503C\u5904\u7406\uFF1A\u5F53 displayValue \u4E3A null/undefined/'' \u65F6\u663E\u793A emptyText "),
17535
+ displayValue.value === null || displayValue.value === void 0 || displayValue.value === "" ? (openBlock(), createElementBlock(
17534
17536
  Fragment,
17535
17537
  { key: 0 },
17536
17538
  [
17539
+ createTextVNode(
17540
+ toDisplayString(handleEmptyValue(displayValue.value)),
17541
+ 1
17542
+ /* TEXT */
17543
+ )
17544
+ ],
17545
+ 64
17546
+ /* STABLE_FRAGMENT */
17547
+ )) : unref(isArray)(getStatus.value) ? (openBlock(), createElementBlock(
17548
+ Fragment,
17549
+ { key: 1 },
17550
+ [
17551
+ createCommentVNode(" \u591A\u9009 "),
17537
17552
  unref(isFunction)(_ctx.column.formatter) ? (openBlock(), createElementBlock(
17538
17553
  Fragment,
17539
17554
  { key: 0 },
@@ -17582,7 +17597,7 @@ var _sfc_main$B = /* @__PURE__ */ defineComponent({
17582
17597
  /* STABLE_FRAGMENT */
17583
17598
  )) : (openBlock(), createElementBlock(
17584
17599
  Fragment,
17585
- { key: 1 },
17600
+ { key: 2 },
17586
17601
  [
17587
17602
  createCommentVNode(" \u5355\u9009 "),
17588
17603
  getStatus.value.color || getStatus.value.type ? (openBlock(), createElementBlock(
@@ -59667,7 +59682,7 @@ const closeAllDrawer = () => {
59667
59682
  drawerStore.value = [];
59668
59683
  };
59669
59684
 
59670
- const _withScopeId$1 = (n) => (pushScopeId("data-v-e05479bb"), n = n(), popScopeId(), n);
59685
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-f6f2fd13"), n = n(), popScopeId(), n);
59671
59686
  const _hoisted_1$4 = { class: "custom-drawer-header" };
59672
59687
  const _hoisted_2$4 = { class: "header-content" };
59673
59688
  const _hoisted_3$4 = ["id"];
@@ -59685,6 +59700,24 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
59685
59700
  },
59686
59701
  __name: "index",
59687
59702
  setup(__props) {
59703
+ const DictStoreProvider = defineComponent({
59704
+ name: "DictStoreProvider",
59705
+ props: {
59706
+ dictStore: {
59707
+ type: Object,
59708
+ default: null
59709
+ }
59710
+ },
59711
+ setup(props) {
59712
+ if (props.dictStore) {
59713
+ provide(DictStoreInjectionKey, props.dictStore);
59714
+ }
59715
+ },
59716
+ render() {
59717
+ var _a, _b;
59718
+ return (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a);
59719
+ }
59720
+ });
59688
59721
  const sureBtnMap = ref({});
59689
59722
  const footerButtons = computed(() => {
59690
59723
  return (options) => {
@@ -59796,14 +59829,22 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
59796
59829
  _hoisted_4$2
59797
59830
  ])
59798
59831
  ]),
59799
- default: withCtx(() => {
59800
- var _a, _b;
59801
- return [
59802
- (openBlock(), createBlock(resolveDynamicComponent((_a = options == null ? void 0 : options.contentRenderer) == null ? void 0 : _a.call(options, { options, index })), mergeProps((_b = options == null ? void 0 : options.props) != null ? _b : {}, {
59803
- onClose: (args) => handleClose(options, index, args)
59804
- }), null, 16, ["onClose"]))
59805
- ];
59806
- }),
59832
+ default: withCtx(() => [
59833
+ createVNode(unref(DictStoreProvider), {
59834
+ "dict-store": options == null ? void 0 : options.dictStore
59835
+ }, {
59836
+ default: withCtx(() => {
59837
+ var _a, _b;
59838
+ return [
59839
+ (openBlock(), createBlock(resolveDynamicComponent((_a = options == null ? void 0 : options.contentRenderer) == null ? void 0 : _a.call(options, { options, index })), mergeProps((_b = options == null ? void 0 : options.props) != null ? _b : {}, {
59840
+ onClose: (args) => handleClose(options, index, args)
59841
+ }), null, 16, ["onClose"]))
59842
+ ];
59843
+ }),
59844
+ _: 2
59845
+ /* DYNAMIC */
59846
+ }, 1032, ["dict-store"])
59847
+ ]),
59807
59848
  _: 2
59808
59849
  /* DYNAMIC */
59809
59850
  }, [
@@ -59891,7 +59932,7 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
59891
59932
  }
59892
59933
  });
59893
59934
 
59894
- var YcDrawerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-e05479bb"], ["__file", "index.vue"]]);
59935
+ var YcDrawerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f6f2fd13"], ["__file", "index.vue"]]);
59895
59936
 
59896
59937
  const YcDrawer = YcDrawerComponent;
59897
59938
  const ReDrawer = YcDrawerComponent;
@@ -442,11 +442,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
442
442
  class: { "is-list": vue.unref(is.isArray)(getStatus.value) }
443
443
  }),
444
444
  [
445
- vue.createCommentVNode(" \u591A\u9009 "),
446
- vue.unref(is.isArray)(getStatus.value) ? (vue.openBlock(), vue.createElementBlock(
445
+ vue.createCommentVNode(" \u7A7A\u503C\u5904\u7406\uFF1A\u5F53 displayValue \u4E3A null/undefined/'' \u65F6\u663E\u793A emptyText "),
446
+ displayValue.value === null || displayValue.value === void 0 || displayValue.value === "" ? (vue.openBlock(), vue.createElementBlock(
447
447
  vue.Fragment,
448
448
  { key: 0 },
449
449
  [
450
+ vue.createTextVNode(
451
+ vue.toDisplayString(handleEmptyValue(displayValue.value)),
452
+ 1
453
+ /* TEXT */
454
+ )
455
+ ],
456
+ 64
457
+ /* STABLE_FRAGMENT */
458
+ )) : vue.unref(is.isArray)(getStatus.value) ? (vue.openBlock(), vue.createElementBlock(
459
+ vue.Fragment,
460
+ { key: 1 },
461
+ [
462
+ vue.createCommentVNode(" \u591A\u9009 "),
450
463
  vue.unref(is.isFunction)(_ctx.column.formatter) ? (vue.openBlock(), vue.createElementBlock(
451
464
  vue.Fragment,
452
465
  { key: 0 },
@@ -495,7 +508,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
495
508
  /* STABLE_FRAGMENT */
496
509
  )) : (vue.openBlock(), vue.createElementBlock(
497
510
  vue.Fragment,
498
- { key: 1 },
511
+ { key: 2 },
499
512
  [
500
513
  vue.createCommentVNode(" \u5355\u9009 "),
501
514
  getStatus.value.color || getStatus.value.type ? (vue.openBlock(), vue.createElementBlock(
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var index_vue_vue_type_script_setup_true_lang = require('./index.vue2.js');
6
6
  var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
7
7
 
8
- var YcDrawerComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-e05479bb"], ["__file", "index.vue"]]);
8
+ var YcDrawerComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-f6f2fd13"], ["__file", "index.vue"]]);
9
9
 
10
10
  exports.default = YcDrawerComponent;
@@ -6,8 +6,9 @@ var vue = require('vue');
6
6
  var lodashEs = require('lodash-es');
7
7
  var ElementPlusIconsVue = require('@element-plus/icons-vue');
8
8
  var store = require('../store.js');
9
+ var dict = require('../../../constants/dict.js');
9
10
 
10
- const _withScopeId = (n) => (vue.pushScopeId("data-v-e05479bb"), n = n(), vue.popScopeId(), n);
11
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-f6f2fd13"), n = n(), vue.popScopeId(), n);
11
12
  const _hoisted_1 = { class: "custom-drawer-header" };
12
13
  const _hoisted_2 = { class: "header-content" };
13
14
  const _hoisted_3 = ["id"];
@@ -25,6 +26,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
25
26
  },
26
27
  __name: "index",
27
28
  setup(__props) {
29
+ const DictStoreProvider = vue.defineComponent({
30
+ name: "DictStoreProvider",
31
+ props: {
32
+ dictStore: {
33
+ type: Object,
34
+ default: null
35
+ }
36
+ },
37
+ setup(props) {
38
+ if (props.dictStore) {
39
+ vue.provide(dict.DictStoreInjectionKey, props.dictStore);
40
+ }
41
+ },
42
+ render() {
43
+ var _a, _b;
44
+ return (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a);
45
+ }
46
+ });
28
47
  const sureBtnMap = vue.ref({});
29
48
  const footerButtons = vue.computed(() => {
30
49
  return (options) => {
@@ -136,14 +155,22 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
136
155
  _hoisted_4
137
156
  ])
138
157
  ]),
139
- default: vue.withCtx(() => {
140
- var _a, _b;
141
- return [
142
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a = options == null ? void 0 : options.contentRenderer) == null ? void 0 : _a.call(options, { options, index })), vue.mergeProps((_b = options == null ? void 0 : options.props) != null ? _b : {}, {
143
- onClose: (args) => handleClose(options, index, args)
144
- }), null, 16, ["onClose"]))
145
- ];
146
- }),
158
+ default: vue.withCtx(() => [
159
+ vue.createVNode(vue.unref(DictStoreProvider), {
160
+ "dict-store": options == null ? void 0 : options.dictStore
161
+ }, {
162
+ default: vue.withCtx(() => {
163
+ var _a, _b;
164
+ return [
165
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a = options == null ? void 0 : options.contentRenderer) == null ? void 0 : _a.call(options, { options, index })), vue.mergeProps((_b = options == null ? void 0 : options.props) != null ? _b : {}, {
166
+ onClose: (args) => handleClose(options, index, args)
167
+ }), null, 16, ["onClose"]))
168
+ ];
169
+ }),
170
+ _: 2
171
+ /* DYNAMIC */
172
+ }, 1032, ["dict-store"])
173
+ ]),
147
174
  _: 2
148
175
  /* DYNAMIC */
149
176
  }, [
@@ -1,3 +1,4 @@
1
+ import { DictStoreInterface } from 'yc-pro-components/es/constants';
1
2
  import { CSSProperties, VNode, Component } from 'vue';
2
3
 
3
4
  type DoneFn = (cancel?: boolean) => void;
@@ -202,5 +203,21 @@ interface DrawerOptions extends DrawerProps {
202
203
  index: number;
203
204
  closeLoading: () => void;
204
205
  }) => void;
206
+ /**
207
+ * 字典 Store 实例
208
+ * @description 当传入时,会将此 dictStore 通过 provide 注入到 Drawer 内容的组件树中,
209
+ * 使内容组件中 autoDict: true 的列配置可以正常获取字典数据。
210
+ * @example
211
+ * ```ts
212
+ * import { useDictStore } from '@/store/modules/dict'
213
+ *
214
+ * addDrawer({
215
+ * title: '详情',
216
+ * dictStore: useDictStore(),
217
+ * contentRenderer: () => h(YourContent, { ... })
218
+ * })
219
+ * ```
220
+ */
221
+ dictStore?: DictStoreInterface;
205
222
  }
206
223
  export type { ButtonProps, DrawerOptions, ArgsType, DrawerProps, EventType };
@@ -1,4 +1,5 @@
1
1
  import { Globals } from 'csstype';
2
+ import { OptionsRow } from 'packages/yc-components';
2
3
  import { NavigationGuardWithThis, NavigationGuard } from 'vue-router';
3
4
  import { LooseRequired } from '@vue/shared';
4
5
  import { Ref, FunctionalComponent, Slot, Component, ComputedOptions, MethodOptions, Directive, WatchCallback, WatchOptions, ComponentProvideOptions, DebuggerEvent, ComponentPublicInstance, ComponentOptionsBase, VNode, RendererNode, RendererElement } from 'vue';
@@ -721,6 +722,11 @@ export declare const drawerStore: Ref<{
721
722
  index: number;
722
723
  closeLoading: () => void;
723
724
  }) => void) | undefined;
725
+ dictStore?: {
726
+ getDictData: (field: string) => OptionsRow<undefined>[];
727
+ hasDict?: ((field: string) => boolean) | undefined;
728
+ getDictLabel?: ((field: string, value: string | number) => string) | undefined;
729
+ } | undefined;
724
730
  visible?: boolean | undefined;
725
731
  appendToBody?: boolean | undefined;
726
732
  appendTo?: string | undefined;
@@ -52,4 +52,4 @@ export declare function createDictStore(config: CreateDictStoreConfig): StoreDef
52
52
  getDictLabel: (dictField: string, value: string | number) => string;
53
53
  getDictValue: (dictField: string, label: string) => string | number | undefined;
54
54
  hasDict: (field: string) => boolean;
55
- }, "loadDict" | "loadDicts" | "clearDict" | "reloadDict" | "getDictLabel" | "getDictValue" | "hasDict">>;
55
+ }, "hasDict" | "getDictLabel" | "loadDict" | "loadDicts" | "clearDict" | "reloadDict" | "getDictValue">>;