z-ui-pc 0.3.0 → 0.3.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.
@@ -1,4 +1,12 @@
1
- import type { ZAutoTooltip, ZClassifyTitle, ZEmpty, ZForm, ZTable, ZTableLinkButton } from "./index";
1
+ import type {
2
+ ZAutoTooltip,
3
+ ZClassifyTitle,
4
+ ZEmpty,
5
+ ZForm,
6
+ ZTable,
7
+ ZTableLinkButton,
8
+ ZTipsFormItem,
9
+ } from "./index";
2
10
 
3
11
  declare module "vue" {
4
12
  export interface GlobalComponents {
@@ -8,5 +16,6 @@ declare module "vue" {
8
16
  ZForm: typeof ZForm;
9
17
  ZTable: typeof ZTable;
10
18
  ZTableLinkButton: typeof ZTableLinkButton;
19
+ ZTipsFormItem: typeof ZTipsFormItem;
11
20
  }
12
21
  }
package/dist/index.css CHANGED
@@ -887,13 +887,13 @@
887
887
  }
888
888
  .table-link__button[data-v-a44085cd]:hover {
889
889
  color: #4080ff;
890
- }.base-table__container[data-v-f40a3c88] {
890
+ }.base-table__container[data-v-a76e1df8] {
891
891
  width: 100%;
892
892
  height: 100%;
893
893
  display: flex;
894
894
  flex-direction: column;
895
895
  }
896
- .base-table__header[data-v-f40a3c88] {
896
+ .base-table__header[data-v-a76e1df8] {
897
897
  display: flex;
898
898
  justify-content: flex-end;
899
899
  align-items: center;
@@ -901,10 +901,10 @@
901
901
  padding: 0 24px;
902
902
  height: 64px;
903
903
  }
904
- .base-table__header .base-table__header-slot[data-v-f40a3c88] {
904
+ .base-table__header .base-table__header-slot[data-v-a76e1df8] {
905
905
  flex: 1;
906
906
  }
907
- .base-table__header .select-count[data-v-f40a3c88] {
907
+ .base-table__header .select-count[data-v-a76e1df8] {
908
908
  flex: 1;
909
909
  height: 40px;
910
910
  display: flex;
@@ -913,15 +913,15 @@
913
913
  border-radius: 2px;
914
914
  padding: 0 12px;
915
915
  }
916
- .base-table__header .select-count.select-count--auto-width[data-v-f40a3c88] {
916
+ .base-table__header .select-count.select-count--auto-width[data-v-a76e1df8] {
917
917
  width: max-content;
918
918
  background-color: #fff;
919
919
  flex: unset;
920
920
  }
921
- .base-table__header .select-count .el-button + .el-button[data-v-f40a3c88] {
921
+ .base-table__header .select-count .el-button + .el-button[data-v-a76e1df8] {
922
922
  margin-left: 24px;
923
923
  }
924
- .base-table__header .select-count .select-count__count[data-v-f40a3c88] {
924
+ .base-table__header .select-count .select-count__count[data-v-a76e1df8] {
925
925
  display: flex;
926
926
  align-items: center;
927
927
  gap: 12px;
@@ -929,15 +929,15 @@
929
929
  font-size: 14px;
930
930
  margin-right: 24px;
931
931
  }
932
- .base-table__header .select-count .select-count__count .el-icon[data-v-f40a3c88] {
932
+ .base-table__header .select-count .select-count__count .el-icon[data-v-a76e1df8] {
933
933
  color: #999;
934
934
  cursor: pointer;
935
935
  }
936
- .base-table__header .select-count .select-count__count.has-select-slot[data-v-f40a3c88] {
936
+ .base-table__header .select-count .select-count__count.has-select-slot[data-v-a76e1df8] {
937
937
  position: relative;
938
938
  margin-right: 42px;
939
939
  }
940
- .base-table__header .select-count .select-count__count.has-select-slot[data-v-f40a3c88]::after {
940
+ .base-table__header .select-count .select-count__count.has-select-slot[data-v-a76e1df8]::after {
941
941
  content: "";
942
942
  position: absolute;
943
943
  width: 2px;
@@ -945,75 +945,69 @@
945
945
  background-color: #e5e6eb;
946
946
  right: -24px;
947
947
  }
948
- .base-table__header-operation[data-v-f40a3c88] {
948
+ .base-table__header-operation[data-v-a76e1df8] {
949
949
  display: flex;
950
950
  justify-content: flex-end;
951
951
  align-items: center;
952
952
  padding: 16px 0;
953
953
  gap: 10px;
954
954
  }
955
- .base-table__header-operation[data-v-f40a3c88] .el-button + .el-button {
955
+ .base-table__header-operation[data-v-a76e1df8] .el-button + .el-button {
956
956
  margin-left: 0;
957
957
  }
958
- .base-table__table-header-cell[data-v-f40a3c88] {
958
+ .base-table__table-header-cell[data-v-a76e1df8] {
959
959
  display: contents;
960
960
  }
961
- .base-table__table-header-content[data-v-f40a3c88] {
961
+ .base-table__table-header-content[data-v-a76e1df8] {
962
962
  display: contents;
963
963
  }
964
- .base-table__body[data-v-f40a3c88] {
964
+ .base-table__body[data-v-a76e1df8] {
965
965
  flex: 1;
966
966
  }
967
- .base-table__body[data-v-f40a3c88] .el-table__header-wrapper .base-table__table-column-operation {
967
+ .base-table__body[data-v-a76e1df8] .el-table__header-wrapper .base-table__table-column-operation {
968
968
  padding: 0;
969
969
  }
970
- .base-table__body[data-v-f40a3c88] .el-table__header-wrapper .el-table__cell__search-result .base-table__table-header-content {
970
+ .base-table__body[data-v-a76e1df8] .el-table__header-wrapper .el-table__cell__search-result .base-table__table-header-content {
971
971
  background-color: rgb(244, 154, 70);
972
972
  display: unset;
973
973
  }
974
- .base-table__body[data-v-f40a3c88] .el-table__inner-wrapper .el-scrollbar__bar.is-horizontal {
975
- left: var(--c6dace06);
976
- z-index: 20;
977
- position: fixed;
978
- bottom: 98px;
979
- }
980
- .base-table__body[data-v-f40a3c88] .base-table__table-column-operation .cell {
974
+ .base-table__body[data-v-a76e1df8] .base-table__table-column-operation .cell {
981
975
  padding-right: 0;
982
976
  height: 100%;
983
977
  }
984
- .base-table__body[data-v-f40a3c88] .el-table__empty-block {
978
+ .base-table__body[data-v-a76e1df8] .el-table__empty-block {
985
979
  height: 200px !important;
986
980
  overflow: hidden;
987
981
  }
988
- .base-table__body[data-v-f40a3c88] .custom-status__color {
982
+ .base-table__body[data-v-a76e1df8] .custom-status__color {
989
983
  display: flex;
990
984
  gap: 6px;
991
985
  align-items: center;
992
986
  }
993
- .base-table__body[data-v-f40a3c88] .custom-status__color:before {
987
+ .base-table__body[data-v-a76e1df8] .custom-status__color:before {
994
988
  content: "";
995
989
  width: 8px;
996
990
  height: 8px;
997
991
  background-color: var(--status-color);
998
992
  border-radius: 50%;
999
993
  }
1000
- .base-table__body[data-v-f40a3c88] .el-loading-mask {
994
+ .base-table__body[data-v-a76e1df8] .el-loading-mask {
1001
995
  display: flex;
1002
996
  align-items: center;
1003
997
  justify-content: center;
1004
998
  }
1005
- .base-table__body .base-table__table-header-cell--operation[data-v-f40a3c88] {
999
+ .base-table__body .base-table__table-header-cell--operation[data-v-a76e1df8] {
1006
1000
  display: flex;
1007
1001
  align-items: center;
1008
1002
  }
1009
- .base-table__body .base-table__table-header-cell--operation .base-table__table-header-content[data-v-f40a3c88] {
1003
+ .base-table__body .base-table__table-header-cell--operation .base-table__table-header-content[data-v-a76e1df8] {
1010
1004
  flex: 1;
1011
1005
  display: block;
1012
1006
  overflow: hidden;
1013
1007
  text-overflow: ellipsis;
1014
1008
  white-space: nowrap;
1015
1009
  }
1016
- .base-table__body .base-table__table-header-cell--operation .base-table__table-header-operation[data-v-f40a3c88] {
1010
+ .base-table__body .base-table__table-header-cell--operation .base-table__table-header-operation[data-v-a76e1df8] {
1017
1011
  width: 40px;
1018
1012
  display: flex;
1019
1013
  justify-content: center;
@@ -1021,32 +1015,38 @@
1021
1015
  height: 40px;
1022
1016
  cursor: pointer;
1023
1017
  }
1024
- .base-table__body .base-table__table-header-cell--operation .base-table__table-header-operation[data-v-f40a3c88]:hover {
1018
+ .base-table__body .base-table__table-header-cell--operation .base-table__table-header-operation[data-v-a76e1df8]:hover {
1025
1019
  background-color: #e8e8e9;
1026
1020
  }
1027
- .base-table__body.base-table__body__fix-pagination[data-v-f40a3c88] {
1021
+ .base-table__body.base-table__body__fix-pagination[data-v-a76e1df8] {
1028
1022
  padding: 0 24px 16px;
1029
1023
  }
1030
- .base-table__body .base-table__draggable[data-v-f40a3c88] {
1024
+ .base-table__body.base-table__body__update-scroll[data-v-a76e1df8] .el-table__inner-wrapper .el-scrollbar__bar.is-horizontal {
1025
+ left: var(--4f0be7e2);
1026
+ z-index: 20;
1027
+ position: fixed;
1028
+ bottom: 80px;
1029
+ }
1030
+ .base-table__body .base-table__draggable[data-v-a76e1df8] {
1031
1031
  height: 100%;
1032
1032
  }
1033
- .base-table__body .base-table__table[data-v-f40a3c88] {
1033
+ .base-table__body .base-table__table[data-v-a76e1df8] {
1034
1034
  --el-table-text-color: var(--app-primary-text-color);
1035
1035
  }
1036
- .base-table__pagination[data-v-f40a3c88] {
1036
+ .base-table__pagination[data-v-a76e1df8] {
1037
1037
  height: 48px;
1038
1038
  background-color: #fff;
1039
1039
  position: relative;
1040
1040
  }
1041
- .base-table__base-pagination[data-v-f40a3c88] {
1041
+ .base-table__base-pagination[data-v-a76e1df8] {
1042
1042
  background-color: #fff;
1043
1043
  padding: 16px 24px;
1044
1044
  box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.08);
1045
1045
  }
1046
- .base-table__base-pagination[data-v-f40a3c88] .el-pagination .el-pager li:hover {
1046
+ .base-table__base-pagination[data-v-a76e1df8] .el-pagination .el-pager li:hover {
1047
1047
  background-color: #e8f3ff;
1048
1048
  }
1049
- .base-table__base-pagination[data-v-f40a3c88] .el-pagination .el-select__wrapper {
1049
+ .base-table__base-pagination[data-v-a76e1df8] .el-pagination .el-select__wrapper {
1050
1050
  width: 90px;
1051
1051
  gap: 0;
1052
1052
  box-shadow: none;
@@ -1055,22 +1055,22 @@
1055
1055
  padding: 0 6px;
1056
1056
  text-align: center;
1057
1057
  }
1058
- .base-table__base-pagination[data-v-f40a3c88] .el-pagination .el-select {
1058
+ .base-table__base-pagination[data-v-a76e1df8] .el-pagination .el-select {
1059
1059
  width: 90px;
1060
1060
  }
1061
- .base-table__pagination-fixed[data-v-f40a3c88] {
1061
+ .base-table__pagination-fixed[data-v-a76e1df8] {
1062
1062
  background-color: #fff;
1063
- width: var(--dac55732);
1063
+ width: var(--4516a34c);
1064
1064
  position: fixed;
1065
1065
  bottom: 16px;
1066
1066
  z-index: 6;
1067
1067
  }
1068
- .base-table__pagination-right[data-v-f40a3c88] {
1068
+ .base-table__pagination-right[data-v-a76e1df8] {
1069
1069
  display: flex;
1070
1070
  justify-content: flex-end;
1071
1071
  }
1072
- .base-table__container[data-v-f40a3c88] .el-loading-spinner {
1073
- width: calc(100vw - var(--c6dace06));
1072
+ .base-table__container[data-v-a76e1df8] .el-loading-spinner {
1073
+ width: calc(100vw - var(--4f0be7e2));
1074
1074
  position: fixed;
1075
1075
  top: 60%;
1076
1076
  }.z-tips-form-item__form-item[data-v-af10c35f] .el-form-item__label {
package/dist/index.d.ts CHANGED
@@ -1367,6 +1367,11 @@ export declare interface IBaseTableProps extends Partial<TableProps<TObj>> {
1367
1367
  * @default false
1368
1368
  */
1369
1369
  enableColumnSearch?: boolean;
1370
+ /**
1371
+ * 是否需要表格因为分页自带的间距
1372
+ * @default false
1373
+ */
1374
+ whenFixedPaginationNoPadding?: boolean;
1370
1375
  }
1371
1376
 
1372
1377
  /**
@@ -1468,7 +1473,7 @@ export declare interface ICustomComponentDefinition {
1468
1473
  /**
1469
1474
  * EFormComponentType 类型扩展
1470
1475
  * @example
1471
- * declare module "module-platform-common" {
1476
+ * declare module "z-ui-pc" {
1472
1477
  * export interface ICustomFormComponentType {
1473
1478
  * // 也可以自定义对应枚举作为相应的 key
1474
1479
  * 'SELECT_STAFF': {
@@ -1484,7 +1489,12 @@ export declare interface ICustomFormComponentType {
1484
1489
  * @example
1485
1490
  */
1486
1491
  __example__: {
1487
- exampleProps: boolean;
1492
+ attrs: {
1493
+ exampleProps: boolean;
1494
+ };
1495
+ componentProps: {
1496
+ exampleProps2: boolean;
1497
+ };
1488
1498
  };
1489
1499
  }
1490
1500
 
@@ -1845,10 +1855,16 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
1845
1855
  componentProps?: Partial<ExtractPropTypes<PropsOf<T>>>;
1846
1856
  };
1847
1857
 
1848
- declare type TCreateCustomFormItemParamsByDefinition<T extends TKeyofCustomFormComponentType, U extends TObj = TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
1858
+ export declare type TCreateCustomFormItemParamsByDefinition<T extends TKeyofCustomFormComponentType, U extends TObj = TObj> = Omit<IBaseFormItem<U>, "tag" | "attrs" | "componentProps"> & {
1849
1859
  tag: T;
1850
- attrs?: Partial<ICustomFormComponentType[T]>;
1851
- componentProps?: Partial<ICustomFormComponentType[T]>;
1860
+ /**
1861
+ * 如果组件定义中存在 attrs 类型,则提供该类型的 Partial 作为提示,否则回退到 TObj。
1862
+ */
1863
+ attrs?: "attrs" extends keyof ICustomFormComponentType[T] ? Partial<ICustomFormComponentType[T]["attrs"]> : TObj;
1864
+ /**
1865
+ * 如果组件定义中存在 componentProps 类型,则提供该类型的 Partial 作为提示,否则回退到 TObj。
1866
+ */
1867
+ componentProps?: "componentProps" extends keyof ICustomFormComponentType[T] ? Partial<ICustomFormComponentType[T]["componentProps"]> : TObj;
1852
1868
  };
1853
1869
 
1854
1870
  export declare const TEMP_GROUP_ID = "-2";
@@ -2083,8 +2099,8 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
2083
2099
  };
2084
2100
 
2085
2101
  export declare const useOpenDialog: () => {
2086
- openDialog: <V = TAllType<string | number | boolean | object | null | undefined>, T extends Component = Component>(loader: AsyncComponentLoader<T> | T, props?: Partial<ExtractPropTypes<PropsOf_2<T>>>, closeId?: number) => Promise<V>;
2087
- createDialog: <V = TAllType<string | number | boolean | object | null | undefined>, T extends Component = Component>(loader: AsyncComponentLoader<T> | T, props?: Partial<ExtractPropTypes<PropsOf_2<T>>>) => {
2102
+ openDialog: <V = TAllType<string | number | boolean | object | null | undefined>, T extends Component = Component>(loader: AsyncComponentLoader<T> | T, props?: Partial<PropsOf_2<T>>, closeId?: number) => Promise<V>;
2103
+ createDialog: <V = TAllType<string | number | boolean | object | null | undefined>, T extends Component = Component>(loader: AsyncComponentLoader<T> | T, props?: Partial<PropsOf_2<T>>) => {
2088
2104
  confirm: (callBack: (data: V) => void) => /*elided*/ any;
2089
2105
  cancel: (callBack: (data: V) => void) => /*elided*/ any;
2090
2106
  finally: (callBack: () => void) => /*elided*/ any;
@@ -2279,6 +2295,7 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
2279
2295
  fixedPagination: boolean;
2280
2296
  stickyHeader: boolean;
2281
2297
  enableColumnSearch: boolean;
2298
+ whenFixedPaginationNoPadding: boolean;
2282
2299
  }, false, {}, {}, GlobalComponents, GlobalDirectives, string, {
2283
2300
  baseTableContainerRef: HTMLDivElement;
2284
2301
  baseTableOperationElement: HTMLDivElement;
@@ -2365,6 +2382,7 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
2365
2382
  fixedPagination: boolean;
2366
2383
  stickyHeader: boolean;
2367
2384
  enableColumnSearch: boolean;
2385
+ whenFixedPaginationNoPadding: boolean;
2368
2386
  }>;
2369
2387
  __isFragment?: never;
2370
2388
  __isTeleport?: never;
@@ -2449,6 +2467,7 @@ export declare type TCreateBaseFormItemParams<T extends keyof IComponentProps, U
2449
2467
  fixedPagination: boolean;
2450
2468
  stickyHeader: boolean;
2451
2469
  enableColumnSearch: boolean;
2470
+ whenFixedPaginationNoPadding: boolean;
2452
2471
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & (new () => {
2453
2472
  $slots: Readonly<{
2454
2473
  header: (_props: {
package/dist/index.js CHANGED
@@ -5054,7 +5054,9 @@ const useBaseTable = (props) => {
5054
5054
  tableData.value = result;
5055
5055
  pagination.value.total = isNaN(numberTotal) ? 0 : numberTotal;
5056
5056
  } else {
5057
- tableData.value = props.tableData ?? [];
5057
+ watchEffect(() => {
5058
+ tableData.value = props.tableData ?? [];
5059
+ });
5058
5060
  }
5059
5061
  } finally {
5060
5062
  loadDataLoading.value = false;
@@ -5516,6 +5518,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5516
5518
  enableDragProps: {},
5517
5519
  draggableAttrs: {},
5518
5520
  enableColumnSearch: { type: Boolean, default: false },
5521
+ whenFixedPaginationNoPadding: { type: Boolean, default: false },
5519
5522
  data: {},
5520
5523
  size: {},
5521
5524
  width: {},
@@ -5578,8 +5581,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5578
5581
  ], ["update:selectList"]),
5579
5582
  setup(__props, { expose: __expose, emit: __emit }) {
5580
5583
  useCssVars((_ctx) => ({
5581
- "c6dace06": tableScrollLeft.value,
5582
- "dac55732": unref(paginationWidth)
5584
+ "4f0be7e2": tableScrollLeft.value,
5585
+ "4516a34c": unref(paginationWidth)
5583
5586
  }));
5584
5587
  const props = __props;
5585
5588
  const selectList = useModel(__props, "selectList");
@@ -5841,7 +5844,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5841
5844
  class: normalizeClass([
5842
5845
  "base-table__body",
5843
5846
  {
5844
- "base-table__body__fix-pagination": _ctx.fixedPagination
5847
+ "base-table__body__fix-pagination": !_ctx.whenFixedPaginationNoPadding && _ctx.fixedPagination,
5848
+ "base-table__body__update-scroll": _ctx.hasPagination && _ctx.fixedPagination
5845
5849
  }
5846
5850
  ])
5847
5851
  }, [
@@ -5967,7 +5971,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5967
5971
  };
5968
5972
  }
5969
5973
  });
5970
- const ZTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f40a3c88"]]);
5974
+ const ZTable = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-a76e1df8"]]);
5971
5975
  const installer$3 = withInstallComponent(ZTable, "ZTable");
5972
5976
  const installer$2 = withInstallComponent(ZTableLinkButton, "ZTableLinkButton");
5973
5977
  const _hoisted_1 = { class: "z-tips-form-item__container" };
@@ -6168,7 +6172,7 @@ const getInstallConfig = (config) => ({
6168
6172
  ...defaultConfig,
6169
6173
  ...config ?? {}
6170
6174
  });
6171
- const version = "0.3.0";
6175
+ const version = "0.3.1";
6172
6176
  const pkg = {
6173
6177
  version
6174
6178
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "z-ui-pc",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "适用于pc端的前端组件库",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",