fast-element-plus 2.0.19 → 2.0.21

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 (128) hide show
  1. package/CHANGELOG.md +47 -20
  2. package/CONTRIBUTING.md +3 -4
  3. package/README.md +80 -27
  4. package/README.zh.md +66 -27
  5. package/dist/component.d.ts +110 -110
  6. package/dist/components/avatar/src/avatar.d.ts +26 -26
  7. package/dist/components/avatar/src/avatar.mjs +10 -10
  8. package/dist/components/avatar/src/avatar.mjs.map +1 -1
  9. package/dist/components/button/src/button.d.ts +32 -27
  10. package/dist/components/button/src/button.mjs +57 -36
  11. package/dist/components/button/src/button.mjs.map +1 -1
  12. package/dist/components/carNumber/src/carNumber.d.ts +8 -8
  13. package/dist/components/carNumber/src/carNumber.mjs +5 -5
  14. package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
  15. package/dist/components/contextMenu/src/contextMenu.d.ts +6 -6
  16. package/dist/components/contextMenu/src/contextMenu.mjs +5 -5
  17. package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
  18. package/dist/components/contextMenu/src/contextMenu.type.d.ts +7 -7
  19. package/dist/components/dialog/src/dialog.d.ts +74 -74
  20. package/dist/components/dialog/src/dialog.mjs +31 -31
  21. package/dist/components/dialog/src/dialog.mjs.map +1 -1
  22. package/dist/components/drawer/src/drawer.d.ts +57 -57
  23. package/dist/components/drawer/src/drawer.mjs +24 -24
  24. package/dist/components/drawer/src/drawer.mjs.map +1 -1
  25. package/dist/components/form/src/form.d.ts +30 -30
  26. package/dist/components/form/src/form.mjs +16 -16
  27. package/dist/components/form/src/form.mjs.map +1 -1
  28. package/dist/components/form/src/formItem.d.ts +30 -30
  29. package/dist/components/form/src/formItem.mjs +13 -13
  30. package/dist/components/form/src/formItem.mjs.map +1 -1
  31. package/dist/components/formItemTip/src/formItemTip.d.ts +9 -9
  32. package/dist/components/formItemTip/src/formItemTip.mjs +3 -3
  33. package/dist/components/formItemTip/src/formItemTip.mjs.map +1 -1
  34. package/dist/components/icon/src/icon.d.ts +10 -10
  35. package/dist/components/icon/src/icon.mjs +4 -4
  36. package/dist/components/icon/src/icon.mjs.map +1 -1
  37. package/dist/components/iconSelector/src/iconSelector.d.ts +6 -6
  38. package/dist/components/iconSelector/src/iconSelector.mjs +4 -4
  39. package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
  40. package/dist/components/image/src/image.d.ts +36 -36
  41. package/dist/components/image/src/image.mjs +11 -11
  42. package/dist/components/image/src/image.mjs.map +1 -1
  43. package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +37 -37
  44. package/dist/components/inputDialogPage/src/inputDialogPage.mjs +16 -16
  45. package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
  46. package/dist/components/layoutGrid/src/layoutGrid.d.ts +12 -12
  47. package/dist/components/layoutGrid/src/layoutGrid.mjs +6 -6
  48. package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
  49. package/dist/components/layoutGrid/src/layoutGridItem.d.ts +18 -18
  50. package/dist/components/layoutGrid/src/layoutGridItem.mjs +8 -8
  51. package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
  52. package/dist/components/select/src/select.d.ts +88 -88
  53. package/dist/components/select/src/select.mjs +28 -28
  54. package/dist/components/select/src/select.mjs.map +1 -1
  55. package/dist/components/select/src/selectOption.d.ts +13 -13
  56. package/dist/components/select/src/selectOption.mjs +6 -6
  57. package/dist/components/select/src/selectOption.mjs.map +1 -1
  58. package/dist/components/selectPage/src/selectPage.d.ts +78 -84
  59. package/dist/components/selectPage/src/selectPage.mjs +49 -35
  60. package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
  61. package/dist/components/selectV2/index.mjs +2 -1
  62. package/dist/components/selectV2/index.mjs.map +1 -1
  63. package/dist/components/selectV2/src/selectV2.d.ts +160 -851
  64. package/dist/components/selectV2/src/selectV2.mjs +30 -338
  65. package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
  66. package/dist/components/table/index.mjs +3 -2
  67. package/dist/components/table/index.mjs.map +1 -1
  68. package/dist/components/table/src/page.type.d.ts +1 -1
  69. package/dist/components/table/src/table.d.ts +211 -744
  70. package/dist/components/table/src/table.mjs +131 -327
  71. package/dist/components/table/src/table.mjs.map +1 -1
  72. package/dist/components/table/src/table.state.d.ts +3 -3
  73. package/dist/components/table/src/table.type.d.ts +1 -9
  74. package/dist/components/table/src/table.type.mjs.map +1 -1
  75. package/dist/components/table/src/tableColumn.d.ts +102 -399
  76. package/dist/components/table/src/tableColumn.mjs +62 -213
  77. package/dist/components/table/src/tableColumn.mjs.map +1 -1
  78. package/dist/components/table/src/tableColumnSettingDialog.d.ts +4 -4
  79. package/dist/components/table/src/tableColumnSettingDialog.mjs +3 -3
  80. package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
  81. package/dist/components/table/src/tablePagination.d.ts +4 -4
  82. package/dist/components/table/src/tablePagination.mjs +3 -3
  83. package/dist/components/table/src/tablePagination.mjs.map +1 -1
  84. package/dist/components/table/src/tableSearchForm.d.ts +12 -12
  85. package/dist/components/table/src/tableSearchForm.mjs +6 -6
  86. package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
  87. package/dist/components/table/src/tableSearchFormItem.d.ts +4 -4
  88. package/dist/components/table/src/tableSearchFormItem.mjs +2 -2
  89. package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
  90. package/dist/components/table/src/useTable.d.ts +1 -0
  91. package/dist/components/table/src/useTable.mjs +109 -65
  92. package/dist/components/table/src/useTable.mjs.map +1 -1
  93. package/dist/components/table/utils/table.d.ts +4 -4
  94. package/dist/components/table/utils/table.mjs +6 -6
  95. package/dist/components/table/utils/table.mjs.map +1 -1
  96. package/dist/components/tree/src/tree.d.ts +86 -86
  97. package/dist/components/tree/src/tree.mjs +46 -46
  98. package/dist/components/tree/src/tree.mjs.map +1 -1
  99. package/dist/components/treeSelect/src/treeSelect.d.ts +144 -150
  100. package/dist/components/treeSelect/src/treeSelect.mjs +55 -55
  101. package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
  102. package/dist/components/upload/src/upload.d.ts +36 -36
  103. package/dist/components/upload/src/upload.mjs +17 -17
  104. package/dist/components/upload/src/upload.mjs.map +1 -1
  105. package/dist/components/uploadImage/src/uploadImage.d.ts +47 -47
  106. package/dist/components/uploadImage/src/uploadImage.mjs +23 -23
  107. package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
  108. package/dist/components/uploadImages/src/uploadImages.d.ts +41 -41
  109. package/dist/components/uploadImages/src/uploadImages.mjs +21 -21
  110. package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
  111. package/dist/directives/click-debounce/index.mjs +19 -11
  112. package/dist/directives/click-debounce/index.mjs.map +1 -1
  113. package/dist/directives/click-throttle/index.d.ts +4 -2
  114. package/dist/directives/click-throttle/index.mjs +21 -11
  115. package/dist/directives/click-throttle/index.mjs.map +1 -1
  116. package/dist/index.global.min.js +4 -4
  117. package/dist/index.global.min.js.map +1 -1
  118. package/dist/index.mjs +3 -3
  119. package/dist/internal/props.d.ts +685 -0
  120. package/dist/internal/props.mjs +683 -0
  121. package/dist/internal/props.mjs.map +1 -0
  122. package/dist/utils/loading-tasks.d.ts +5 -0
  123. package/dist/utils/loading-tasks.mjs +32 -0
  124. package/dist/utils/loading-tasks.mjs.map +1 -0
  125. package/dist/version.d.ts +1 -1
  126. package/dist/version.mjs +1 -1
  127. package/dist/version.mjs.map +1 -1
  128. package/package.json +5 -10
@@ -1,11 +1,11 @@
1
1
  import type { FaLayoutGridBreakpoint } from "./layoutGrid.type";
2
- /** FaLayoutGrid 的插槽参数。 */
2
+ /** FaLayoutGrid 的插槽参数 */
3
3
  export interface FaLayoutGridSlots extends Record<string, unknown> {
4
- /** @description 默认内容插槽 */
4
+ /** 默认内容插槽 */
5
5
  default: never;
6
6
  }
7
7
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
- /** @description Grid布局列配置 */
8
+ /** Grid布局列配置 */
9
9
  cols: {
10
10
  type: import("vue").PropType<string | number | Partial<Record<FaLayoutGridBreakpoint, number>>>;
11
11
  default: () => {
@@ -16,28 +16,28 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  xl: number;
17
17
  };
18
18
  };
19
- /** @description 折叠 */
19
+ /** 折叠 */
20
20
  collapsed: BooleanConstructor;
21
- /** @description 折叠行数 */
21
+ /** 折叠行数 */
22
22
  collapsedRows: {
23
23
  type: (NumberConstructor | StringConstructor)[];
24
24
  default: number;
25
25
  };
26
- /** @description 间距,偏移 */
26
+ /** 间距,偏移 */
27
27
  gap: {
28
28
  type: import("vue").PropType<number | [number, number]>;
29
29
  default: number;
30
30
  };
31
31
  }>, {
32
- /** @description 响应式断点 */
32
+ /** 响应式断点 */
33
33
  breakpoint: import("vue").Ref<FaLayoutGridBreakpoint, FaLayoutGridBreakpoint>;
34
34
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
35
- /** @description 断点变化事件 */
35
+ /** 断点变化事件 */
36
36
  breakpointChange: ({ breakpoint: _breakpoint }: {
37
37
  breakpoint: FaLayoutGridBreakpoint;
38
38
  }) => true;
39
39
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
- /** @description Grid布局列配置 */
40
+ /** Grid布局列配置 */
41
41
  cols: {
42
42
  type: import("vue").PropType<string | number | Partial<Record<FaLayoutGridBreakpoint, number>>>;
43
43
  default: () => {
@@ -48,14 +48,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
48
48
  xl: number;
49
49
  };
50
50
  };
51
- /** @description 折叠 */
51
+ /** 折叠 */
52
52
  collapsed: BooleanConstructor;
53
- /** @description 折叠行数 */
53
+ /** 折叠行数 */
54
54
  collapsedRows: {
55
55
  type: (NumberConstructor | StringConstructor)[];
56
56
  default: number;
57
57
  };
58
- /** @description 间距,偏移 */
58
+ /** 间距,偏移 */
59
59
  gap: {
60
60
  type: import("vue").PropType<number | [number, number]>;
61
61
  default: number;
@@ -7,7 +7,7 @@ import { computed, createVNode, defineComponent, nextTick, onActivated, onDeacti
7
7
  var layoutGrid_default = defineComponent({
8
8
  name: "FaLayoutGrid",
9
9
  props: {
10
- /** @description Grid布局列配置 */
10
+ /** Grid布局列配置 */
11
11
  cols: {
12
12
  type: definePropType([
13
13
  String,
@@ -22,21 +22,21 @@ var layoutGrid_default = defineComponent({
22
22
  xl: 5
23
23
  })
24
24
  },
25
- /** @description 折叠 */
25
+ /** 折叠 */
26
26
  collapsed: Boolean,
27
- /** @description 折叠行数 */
27
+ /** 折叠行数 */
28
28
  collapsedRows: {
29
29
  type: [String, Number],
30
30
  default: 1
31
31
  },
32
- /** @description 间距,偏移 */
32
+ /** 间距,偏移 */
33
33
  gap: {
34
34
  type: definePropType([Number, Array]),
35
35
  default: 0
36
36
  }
37
37
  },
38
38
  emits: {
39
- /** @description 断点变化事件 */
39
+ /** 断点变化事件 */
40
40
  breakpointChange: ({ breakpoint: _breakpoint }) => true },
41
41
  slots: makeSlots(),
42
42
  setup(props, { slots, emit, expose }) {
@@ -150,7 +150,7 @@ breakpointChange: ({ breakpoint: _breakpoint }) => true },
150
150
  }, [defaultSlot]);
151
151
  });
152
152
  return useExpose(expose, {
153
- /** @description 响应式断点 */
153
+ /** 响应式断点 */
154
154
  breakpoint });
155
155
  }
156
156
  });
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGrid.mjs","names":[],"sources":["../../../../src/components/layoutGrid/src/layoutGrid.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onActivated, onDeactivated, onMounted, onUnmounted, provide, ref, shallowRef, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"../../../utils\";\nimport type { VNode, VNodeArrayChildren } from \"vue\";\nimport type { FaLayoutGridBreakpoint, FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\n\n/** FaLayoutGrid 的插槽参数。 */\nexport interface FaLayoutGridSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaLayoutGrid\",\n\tprops: {\n\t\t/** @description Grid布局列配置 */\n\t\tcols: {\n\t\t\ttype: definePropType<string | number | Partial<Record<FaLayoutGridBreakpoint, number>>>([String, Number, Object]),\n\t\t\tdefault: () => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t\t},\n\t\t/** @description 折叠 */\n\t\tcollapsed: Boolean,\n\t\t/** @description 折叠行数 */\n\t\tcollapsedRows: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 间距,偏移 */\n\t\tgap: {\n\t\t\ttype: definePropType<number | [number, number]>([Number, Array]),\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 断点变化事件 */\n\t\tbreakpointChange: ({ breakpoint: _breakpoint }: { breakpoint: FaLayoutGridBreakpoint }) => true,\n\t},\n\tslots: makeSlots<FaLayoutGridSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst containerRef = shallowRef<HTMLElement | null>(null);\n\n\t\t// 注入响应式横向 gap 间距\n\t\tconst horizontalGap = computed(() => (Array.isArray(props.gap) ? props.gap[0] : props.gap));\n\t\tprovide(\"gap\", horizontalGap);\n\n\t\t// 注入响应式断点\n\t\tconst breakpoint = ref<FaLayoutGridBreakpoint>(\"xl\");\n\t\tprovide(\"breakpoint\", breakpoint);\n\n\t\t// 注入要开始折叠的 index\n\t\tconst firstHiddenIndex = ref(-1);\n\t\tprovide(\"firstHiddenIndex\", firstHiddenIndex);\n\n\t\t// 注入 cols\n\t\tconst cols = computed<string | number>(() => {\n\t\t\tif (typeof props.cols === \"object\" && props.cols !== null) return props.cols[breakpoint.value] ?? 1;\n\t\t\treturn props.cols;\n\t\t});\n\t\tprovide(\"cols\", cols);\n\n\t\tconst collapsedRows = computed(() => (typeof props.collapsedRows === \"number\" ? props.collapsedRows : Number(props.collapsedRows)));\n\n\t\t// 设置间距\n\t\tconst gap = computed(() => {\n\t\t\tif (typeof props.gap === \"number\") return `${props.gap}px`;\n\t\t\tif (Array.isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;\n\t\t\treturn \"unset\";\n\t\t});\n\n\t\t// 设置 style\n\t\tconst style = computed(() => {\n\t\t\treturn {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridGap: gap.value,\n\t\t\t\tgridTemplateColumns: `repeat(${cols.value}, minmax(0, 1fr))`,\n\t\t\t};\n\t\t});\n\n\t\t// 断点映射\n\t\tconst breakpoints = {\n\t\t\t// 小于480屏幕(如手机)\n\t\t\txs: { min: 0, max: 479 },\n\t\t\t// 平板竖屏\n\t\t\tsm: { min: 480, max: 768 },\n\t\t\t// 平板横屏\n\t\t\tmd: { min: 768, max: 1024 },\n\t\t\t// 小型桌面\n\t\t\tlg: { min: 1024, max: 1440 },\n\t\t\t// 大型桌面\n\t\t\txl: { min: 1440, max: Infinity },\n\t\t};\n\n\t\t// 监听屏幕变化\n\t\tconst resize = (e: ResizeObserverEntry[]) => {\n\t\t\t// 当前只监听布局容器,ResizeObserver 每次回调应当只有一个目标。\n\t\t\tif (e.length !== 1 || e[0] === undefined) throw new Error(\"FaLayoutGrid 监听到了非预期数量的布局容器。\");\n\t\t\tconst curEl = e[0];\n\t\t\tconst width = curEl.target.scrollWidth;\n\n\t\t\tfor (const [key, { min, max }] of Object.entries(breakpoints)) {\n\t\t\t\tif (width >= min && width <= max) {\n\t\t\t\t\tbreakpoint.value = key as FaLayoutGridBreakpoint;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet resizeObserver: ResizeObserver | undefined;\n\t\tconst observeResize = () => {\n\t\t\tconst element = containerRef.value;\n\t\t\tif (!element) return;\n\t\t\tresizeObserver?.disconnect();\n\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\tresizeObserver.observe(element);\n\t\t};\n\n\t\twatch(\n\t\t\t() => breakpoint.value,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"breakpointChange\", { breakpoint: newValue });\n\t\t\t}\n\t\t);\n\n\t\tonMounted(() => {\n\t\t\tnextTick(observeResize);\n\t\t\temit(\"breakpointChange\", { breakpoint: breakpoint.value });\n\t\t});\n\n\t\tonActivated(() => nextTick(observeResize));\n\n\t\tonDeactivated(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tuseRender(() => {\n\t\t\tconst defaultSlot = slots.default?.() ?? [];\n\n\t\t\tif (props.collapsed) {\n\t\t\t\tconst fields: VNodeArrayChildren = [];\n\t\t\t\tlet suffix: VNode | undefined;\n\n\t\t\t\tdefaultSlot.forEach((slot) => {\n\t\t\t\t\t// suffix\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof slot.type === \"object\" &&\n\t\t\t\t\t\t\"name\" in slot.type &&\n\t\t\t\t\t\tslot.type.name === \"FaLayoutGridItem\" &&\n\t\t\t\t\t\tslot.props?.[\"suffix\"] !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tsuffix = slot;\n\t\t\t\t\t}\n\t\t\t\t\t// slot children\n\t\t\t\t\tif (typeof slot.type === \"symbol\" && Array.isArray(slot.children)) fields.push(...slot.children);\n\t\t\t\t});\n\n\t\t\t\t// 计算 suffix 所占用的列\n\t\t\t\tlet suffixCols = 0;\n\t\t\t\tif (suffix?.props) {\n\t\t\t\t\tconst activeBreakpointProps = suffix.props[breakpoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\tsuffixCols =\n\t\t\t\t\t\t(activeBreakpointProps?.span ?? Number(suffix.props[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(activeBreakpointProps?.offset ?? Number(suffix.props[\"offset\"] ?? 0));\n\t\t\t\t}\n\n\t\t\t\tlet occupiedCols = 0;\n\t\t\t\tfirstHiddenIndex.value = -1;\n\t\t\t\tfor (const [index, current] of fields.entries()) {\n\t\t\t\t\tconst currentVNode = current as VNode;\n\t\t\t\t\tconst currentProps = currentVNode.props;\n\t\t\t\t\tif (currentProps === null) continue;\n\t\t\t\t\tconst activeBreakpointProps = currentProps[breakpoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\toccupiedCols +=\n\t\t\t\t\t\t(activeBreakpointProps?.span ?? Number(currentProps[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(activeBreakpointProps?.offset ?? Number(currentProps[\"offset\"] ?? 0));\n\t\t\t\t\tif (occupiedCols > collapsedRows.value * Number(cols.value) - suffixCols) {\n\t\t\t\t\t\tfirstHiddenIndex.value = index;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfirstHiddenIndex.value = -1;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div ref={containerRef} style={style.value}>\n\t\t\t\t\t{defaultSlot}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 响应式断点 */\n\t\t\tbreakpoint,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;AAWA,IAAA,qBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,MAAM;GACL,MAAM,eAAkF;IAAC;IAAQ;IAAQ;GAAM,CAAC;GAChH,gBAAgB;IAAE,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;GAAE;EACrD;;EAEA,WAAW;;EAEX,eAAe;GACd,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,KAAK;GACJ,MAAM,eAA0C,CAAC,QAAQ,KAAK,CAAC;GAC/D,SAAS;EACV;CACD;CACA,OAAO;;AAEN,mBAAmB,EAAE,YAAY,kBAA0D,KAC5F;CACA,OAAO,UAA6B;CACpC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,eAAe,WAA+B,IAAI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O,YAAY,OAAO,QAAQ,GAAG;KAEhD,MAAM,eAAe,QAAa;KAClC,IAAI,iBAAiB,MAAM;KAC3B,MAAM,wBAAwB,aAAa,WAAW;KACtD,iBACE,uBAAuB,QAAQ,OAAO,aAAa,WAAW,CAAC,MAC/D,uBAAuB,UAAU,OAAO,aAAa,aAAa,CAAC;KACrE,IAAI,eAAe,cAAc,QAAQ,OAAO,KAAK,KAAK,IAAI,YAAY;MACzE,iBAAiB,QAAQ;MACzB;KACD;IACD;GACD,OACC,iBAAiB,QAAQ;GAG1B,OAAA,YAAA,OAAA;IAAA,OACW;IAAY,SAAS,MAAM;GAAK,GAAA,CACxC,WAAW,CAAA;EAGf,CAAC;EAED,OAAO,UAAU,QAAQ;;AAExB,WACD,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"layoutGrid.mjs","names":[],"sources":["../../../../src/components/layoutGrid/src/layoutGrid.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onActivated, onDeactivated, onMounted, onUnmounted, provide, ref, shallowRef, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"../../../utils\";\nimport type { VNode, VNodeArrayChildren } from \"vue\";\nimport type { FaLayoutGridBreakpoint, FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\n\n/** FaLayoutGrid 的插槽参数 */\nexport interface FaLayoutGridSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaLayoutGrid\",\n\tprops: {\n\t\t/** Grid布局列配置 */\n\t\tcols: {\n\t\t\ttype: definePropType<string | number | Partial<Record<FaLayoutGridBreakpoint, number>>>([String, Number, Object]),\n\t\t\tdefault: () => ({ xs: 1, sm: 2, md: 3, lg: 4, xl: 5 }),\n\t\t},\n\t\t/** 折叠 */\n\t\tcollapsed: Boolean,\n\t\t/** 折叠行数 */\n\t\tcollapsedRows: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** 间距,偏移 */\n\t\tgap: {\n\t\t\ttype: definePropType<number | [number, number]>([Number, Array]),\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\temits: {\n\t\t/** 断点变化事件 */\n\t\tbreakpointChange: ({ breakpoint: _breakpoint }: { breakpoint: FaLayoutGridBreakpoint }) => true,\n\t},\n\tslots: makeSlots<FaLayoutGridSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst containerRef = shallowRef<HTMLElement | null>(null);\n\n\t\t// 注入响应式横向 gap 间距\n\t\tconst horizontalGap = computed(() => (Array.isArray(props.gap) ? props.gap[0] : props.gap));\n\t\tprovide(\"gap\", horizontalGap);\n\n\t\t// 注入响应式断点\n\t\tconst breakpoint = ref<FaLayoutGridBreakpoint>(\"xl\");\n\t\tprovide(\"breakpoint\", breakpoint);\n\n\t\t// 注入要开始折叠的 index\n\t\tconst firstHiddenIndex = ref(-1);\n\t\tprovide(\"firstHiddenIndex\", firstHiddenIndex);\n\n\t\t// 注入 cols\n\t\tconst cols = computed<string | number>(() => {\n\t\t\tif (typeof props.cols === \"object\" && props.cols !== null) return props.cols[breakpoint.value] ?? 1;\n\t\t\treturn props.cols;\n\t\t});\n\t\tprovide(\"cols\", cols);\n\n\t\tconst collapsedRows = computed(() => (typeof props.collapsedRows === \"number\" ? props.collapsedRows : Number(props.collapsedRows)));\n\n\t\t// 设置间距\n\t\tconst gap = computed(() => {\n\t\t\tif (typeof props.gap === \"number\") return `${props.gap}px`;\n\t\t\tif (Array.isArray(props.gap)) return `${props.gap[1]}px ${props.gap[0]}px`;\n\t\t\treturn \"unset\";\n\t\t});\n\n\t\t// 设置 style\n\t\tconst style = computed(() => {\n\t\t\treturn {\n\t\t\t\tdisplay: \"grid\",\n\t\t\t\tgridGap: gap.value,\n\t\t\t\tgridTemplateColumns: `repeat(${cols.value}, minmax(0, 1fr))`,\n\t\t\t};\n\t\t});\n\n\t\t// 断点映射\n\t\tconst breakpoints = {\n\t\t\t// 小于480屏幕(如手机)\n\t\t\txs: { min: 0, max: 479 },\n\t\t\t// 平板竖屏\n\t\t\tsm: { min: 480, max: 768 },\n\t\t\t// 平板横屏\n\t\t\tmd: { min: 768, max: 1024 },\n\t\t\t// 小型桌面\n\t\t\tlg: { min: 1024, max: 1440 },\n\t\t\t// 大型桌面\n\t\t\txl: { min: 1440, max: Infinity },\n\t\t};\n\n\t\t// 监听屏幕变化\n\t\tconst resize = (e: ResizeObserverEntry[]) => {\n\t\t\t// 当前只监听布局容器,ResizeObserver 每次回调应当只有一个目标。\n\t\t\tif (e.length !== 1 || e[0] === undefined) throw new Error(\"FaLayoutGrid 监听到了非预期数量的布局容器。\");\n\t\t\tconst curEl = e[0];\n\t\t\tconst width = curEl.target.scrollWidth;\n\n\t\t\tfor (const [key, { min, max }] of Object.entries(breakpoints)) {\n\t\t\t\tif (width >= min && width <= max) {\n\t\t\t\t\tbreakpoint.value = key as FaLayoutGridBreakpoint;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tlet resizeObserver: ResizeObserver | undefined;\n\t\tconst observeResize = () => {\n\t\t\tconst element = containerRef.value;\n\t\t\tif (!element) return;\n\t\t\tresizeObserver?.disconnect();\n\t\t\tresizeObserver = new ResizeObserver(resize);\n\t\t\tresizeObserver.observe(element);\n\t\t};\n\n\t\twatch(\n\t\t\t() => breakpoint.value,\n\t\t\t(newValue) => {\n\t\t\t\temit(\"breakpointChange\", { breakpoint: newValue });\n\t\t\t}\n\t\t);\n\n\t\tonMounted(() => {\n\t\t\tnextTick(observeResize);\n\t\t\temit(\"breakpointChange\", { breakpoint: breakpoint.value });\n\t\t});\n\n\t\tonActivated(() => nextTick(observeResize));\n\n\t\tonDeactivated(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tonUnmounted(() => {\n\t\t\tresizeObserver?.disconnect();\n\t\t});\n\n\t\tuseRender(() => {\n\t\t\tconst defaultSlot = slots.default?.() ?? [];\n\n\t\t\tif (props.collapsed) {\n\t\t\t\tconst fields: VNodeArrayChildren = [];\n\t\t\t\tlet suffix: VNode | undefined;\n\n\t\t\t\tdefaultSlot.forEach((slot) => {\n\t\t\t\t\t// suffix\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof slot.type === \"object\" &&\n\t\t\t\t\t\t\"name\" in slot.type &&\n\t\t\t\t\t\tslot.type.name === \"FaLayoutGridItem\" &&\n\t\t\t\t\t\tslot.props?.[\"suffix\"] !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tsuffix = slot;\n\t\t\t\t\t}\n\t\t\t\t\t// slot children\n\t\t\t\t\tif (typeof slot.type === \"symbol\" && Array.isArray(slot.children)) fields.push(...slot.children);\n\t\t\t\t});\n\n\t\t\t\t// 计算 suffix 所占用的列\n\t\t\t\tlet suffixCols = 0;\n\t\t\t\tif (suffix?.props) {\n\t\t\t\t\tconst activeBreakpointProps = suffix.props[breakpoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\tsuffixCols =\n\t\t\t\t\t\t(activeBreakpointProps?.span ?? Number(suffix.props[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(activeBreakpointProps?.offset ?? Number(suffix.props[\"offset\"] ?? 0));\n\t\t\t\t}\n\n\t\t\t\tlet occupiedCols = 0;\n\t\t\t\tfirstHiddenIndex.value = -1;\n\t\t\t\tfor (const [index, current] of fields.entries()) {\n\t\t\t\t\tconst currentVNode = current as VNode;\n\t\t\t\t\tconst currentProps = currentVNode.props;\n\t\t\t\t\tif (currentProps === null) continue;\n\t\t\t\t\tconst activeBreakpointProps = currentProps[breakpoint.value] as FaLayoutGridItemResponsive | undefined;\n\t\t\t\t\toccupiedCols +=\n\t\t\t\t\t\t(activeBreakpointProps?.span ?? Number(currentProps[\"span\"] ?? 1)) +\n\t\t\t\t\t\t(activeBreakpointProps?.offset ?? Number(currentProps[\"offset\"] ?? 0));\n\t\t\t\t\tif (occupiedCols > collapsedRows.value * Number(cols.value) - suffixCols) {\n\t\t\t\t\t\tfirstHiddenIndex.value = index;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfirstHiddenIndex.value = -1;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div ref={containerRef} style={style.value}>\n\t\t\t\t\t{defaultSlot}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 响应式断点 */\n\t\t\tbreakpoint,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;AAWA,IAAA,qBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,MAAM;GACL,MAAM,eAAkF;IAAC;IAAQ;IAAQ;GAAM,CAAC;GAChH,gBAAgB;IAAE,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;GAAE;EACrD;;EAEA,WAAW;;EAEX,eAAe;GACd,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,KAAK;GACJ,MAAM,eAA0C,CAAC,QAAQ,KAAK,CAAC;GAC/D,SAAS;EACV;CACD;CACA,OAAO;;AAEN,mBAAmB,EAAE,YAAY,kBAA0D,KAC5F;CACA,OAAO,UAA6B;CACpC,MAAM,OAAO,EAAE,OAAO,MAAM,UAAU;EACrC,MAAM,eAAe,WAA+B,IAAI;EAGxD,MAAM,gBAAgB,eAAgB,MAAM,QAAQ,MAAM,GAAG,IAAI,MAAM,IAAI,KAAK,MAAM,GAAI;EAC1F,QAAQ,OAAO,aAAa;EAG5B,MAAM,aAAa,IAA4B,IAAI;EACnD,QAAQ,cAAc,UAAU;EAGhC,MAAM,mBAAmB,IAAI,EAAE;EAC/B,QAAQ,oBAAoB,gBAAgB;EAG5C,MAAM,OAAO,eAAgC;GAC5C,IAAI,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,MAAM,OAAO,MAAM,KAAK,WAAW,UAAU;GAClG,OAAO,MAAM;EACd,CAAC;EACD,QAAQ,QAAQ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,CACxC,WAAW,CAAA;EAGf,CAAC;EAED,OAAO,UAAU,QAAQ;;AAExB,WACD,CAAC;CACF;AACD,CAAC"}
@@ -1,46 +1,46 @@
1
1
  import type { FaLayoutGridItemResponsive } from "./layoutGrid.type";
2
- /** FaLayoutGridItem 的插槽参数。 */
2
+ /** FaLayoutGridItem 的插槽参数 */
3
3
  export interface FaLayoutGridItemSlots extends Record<string, unknown> {
4
- /** @description 默认内容插槽 */
4
+ /** 默认内容插槽 */
5
5
  default: never;
6
6
  }
7
7
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
- /** @description 偏移 */
8
+ /** 偏移 */
9
9
  offset: {
10
10
  type: (NumberConstructor | StringConstructor)[];
11
11
  default: number;
12
12
  };
13
- /** @description 占位 */
13
+ /** 占位 */
14
14
  span: {
15
15
  type: (NumberConstructor | StringConstructor)[];
16
16
  default: number;
17
17
  };
18
- /** @description 后缀 */
18
+ /** 后缀 */
19
19
  suffix: {
20
20
  type: BooleanConstructor;
21
21
  default: boolean;
22
22
  };
23
- /** @description 响应式,小于480px屏幕配置 */
23
+ /** 响应式,小于480px屏幕配置 */
24
24
  xs: {
25
25
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
26
26
  default: undefined;
27
27
  };
28
- /** @description 响应式,平板竖屏配置 */
28
+ /** 响应式,平板竖屏配置 */
29
29
  sm: {
30
30
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
31
31
  default: undefined;
32
32
  };
33
- /** @description 响应式,平板横屏配置 */
33
+ /** 响应式,平板横屏配置 */
34
34
  md: {
35
35
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
36
36
  default: undefined;
37
37
  };
38
- /** @description 响应式,小型桌面配置 */
38
+ /** 响应式,小型桌面配置 */
39
39
  lg: {
40
40
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
41
41
  default: undefined;
42
42
  };
43
- /** @description 响应式,大型桌面配置 */
43
+ /** 响应式,大型桌面配置 */
44
44
  xl: {
45
45
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
46
46
  default: undefined;
@@ -48,42 +48,42 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
48
48
  }>, {
49
49
  show: import("vue").ComputedRef<boolean>;
50
50
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
- /** @description 偏移 */
51
+ /** 偏移 */
52
52
  offset: {
53
53
  type: (NumberConstructor | StringConstructor)[];
54
54
  default: number;
55
55
  };
56
- /** @description 占位 */
56
+ /** 占位 */
57
57
  span: {
58
58
  type: (NumberConstructor | StringConstructor)[];
59
59
  default: number;
60
60
  };
61
- /** @description 后缀 */
61
+ /** 后缀 */
62
62
  suffix: {
63
63
  type: BooleanConstructor;
64
64
  default: boolean;
65
65
  };
66
- /** @description 响应式,小于480px屏幕配置 */
66
+ /** 响应式,小于480px屏幕配置 */
67
67
  xs: {
68
68
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
69
69
  default: undefined;
70
70
  };
71
- /** @description 响应式,平板竖屏配置 */
71
+ /** 响应式,平板竖屏配置 */
72
72
  sm: {
73
73
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
74
74
  default: undefined;
75
75
  };
76
- /** @description 响应式,平板横屏配置 */
76
+ /** 响应式,平板横屏配置 */
77
77
  md: {
78
78
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
79
79
  default: undefined;
80
80
  };
81
- /** @description 响应式,小型桌面配置 */
81
+ /** 响应式,小型桌面配置 */
82
82
  lg: {
83
83
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
84
84
  default: undefined;
85
85
  };
86
- /** @description 响应式,大型桌面配置 */
86
+ /** 响应式,大型桌面配置 */
87
87
  xl: {
88
88
  type: import("vue").PropType<FaLayoutGridItemResponsive>;
89
89
  default: undefined;
@@ -7,42 +7,42 @@ import { computed, createVNode, defineComponent, inject, reactive, ref, vShow, w
7
7
  var layoutGridItem_default = defineComponent({
8
8
  name: "FaLayoutGridItem",
9
9
  props: {
10
- /** @description 偏移 */
10
+ /** 偏移 */
11
11
  offset: {
12
12
  type: [String, Number],
13
13
  default: 0
14
14
  },
15
- /** @description 占位 */
15
+ /** 占位 */
16
16
  span: {
17
17
  type: [String, Number],
18
18
  default: 1
19
19
  },
20
- /** @description 后缀 */
20
+ /** 后缀 */
21
21
  suffix: {
22
22
  type: Boolean,
23
23
  default: false
24
24
  },
25
- /** @description 响应式,小于480px屏幕配置 */
25
+ /** 响应式,小于480px屏幕配置 */
26
26
  xs: {
27
27
  type: definePropType(Object),
28
28
  default: void 0
29
29
  },
30
- /** @description 响应式,平板竖屏配置 */
30
+ /** 响应式,平板竖屏配置 */
31
31
  sm: {
32
32
  type: definePropType(Object),
33
33
  default: void 0
34
34
  },
35
- /** @description 响应式,平板横屏配置 */
35
+ /** 响应式,平板横屏配置 */
36
36
  md: {
37
37
  type: definePropType(Object),
38
38
  default: void 0
39
39
  },
40
- /** @description 响应式,小型桌面配置 */
40
+ /** 响应式,小型桌面配置 */
41
41
  lg: {
42
42
  type: definePropType(Object),
43
43
  default: void 0
44
44
  },
45
- /** @description 响应式,大型桌面配置 */
45
+ /** 响应式,大型桌面配置 */
46
46
  xl: {
47
47
  type: definePropType(Object),
48
48
  default: void 0
@@ -1 +1 @@
1
- {"version":3,"file":"layoutGridItem.mjs","names":[],"sources":["../../../../src/components/layoutGrid/src/layoutGridItem.tsx"],"sourcesContent":["import { computed, defineComponent, inject, reactive, ref, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"../../../utils\";\nimport type { Ref } from \"vue\";\nimport type { FaLayoutGridBreakpoint, FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\n\n/** FaLayoutGridItem 的插槽参数。 */\nexport interface FaLayoutGridItemSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaLayoutGridItem\",\n\tprops: {\n\t\t/** @description 偏移 */\n\t\toffset: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 0,\n\t\t},\n\t\t/** @description 占位 */\n\t\tspan: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** @description 后缀 */\n\t\tsuffix: { type: Boolean, default: false },\n\t\t/** @description 响应式,小于480px屏幕配置 */\n\t\txs: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** @description 响应式,平板竖屏配置 */\n\t\tsm: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** @description 响应式,平板横屏配置 */\n\t\tmd: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** @description 响应式,小型桌面配置 */\n\t\tlg: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** @description 响应式,大型桌面配置 */\n\t\txl: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\tslots: makeSlots<FaLayoutGridItemSlots>(),\n\tsetup(props, { attrs, slots, expose }) {\n\t\tconst attrsObj = attrs as Record<string, unknown>;\n\n\t\t// 注入布局状态\n\t\tconst breakpoint = inject<Ref<FaLayoutGridBreakpoint>>(\"breakpoint\", ref(\"xl\"));\n\t\tconst firstHiddenIndex = inject<Ref<number>>(\"firstHiddenIndex\", ref(-1));\n\t\tconst gap = inject<Ref<number>>(\"gap\", ref(0));\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(5));\n\n\t\tconst state = reactive({\n\t\t\tshow: true,\n\t\t});\n\n\t\tconst style = computed(() => {\n\t\t\tconst activeBreakpointProps = props[breakpoint.value];\n\t\t\tconst span = activeBreakpointProps?.span ?? (typeof props.span === \"number\" ? props.span : Number(props.span));\n\t\t\tconst offset = activeBreakpointProps?.offset ?? (typeof props.offset === \"number\" ? props.offset : Number(props.offset));\n\t\t\tif (props.suffix) {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumnStart: cols.value - span - offset + 1,\n\t\t\t\t\tgridColumnEnd: `span ${span + offset}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap.value}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${\n\t\t\t\t\t\tspan + offset > cols.value ? cols.value : span + offset\n\t\t\t\t\t}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap.value}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\twatch(\n\t\t\t() => [firstHiddenIndex.value, breakpoint.value],\n\t\t\t(n) => {\n\t\t\t\tconst index = Number(attrsObj[\"data-index\"] ?? attrsObj[\"index\"]);\n\t\t\t\tif (Number.isInteger(index)) {\n\t\t\t\t\tstate.show = !(n[0] !== -1 && index >= Number(n[0]));\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tuseRender(() => (\n\t\t\t<div style={style.value} vShow={state.show}>\n\t\t\t\t{slots.default?.()}\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\tshow: computed(() => state.show),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;AAWA,IAAA,yBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,QAAQ;GACP,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,MAAM;GACL,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,QAAQ;GAAE,MAAM;GAAS,SAAS;EAAM;;EAExC,IAAI;GACH,MAAM,eAA2C,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KAAM;GAC/F;EAEF,CAAC;EAED,YACO,CAAC,iBAAiB,OAAO,WAAW,KAAK,IAC9C,MAAM;GACN,MAAM,QAAQ,OAAO,SAAS,iBAAiB,SAAS,QAAQ;GAChE,IAAI,OAAO,UAAU,KAAK,GACzB,MAAM,OAAO,EAAE,EAAE,OAAO,MAAM,SAAS,OAAO,EAAE,EAAE;EAEpD,GACA,EAAE,WAAW,KAAK,CACnB;EAEA,gBAAU,eAAA,YAAA,OAAA,EAAA,SACG,MAAM,MAAK,GAAA,CACrB,MAAM,UAAU,CAAC,CAAA,GAAA,CAAA,CAAA,OADa,MAAM,IAAI,CAAA,CAAA,CAG1C;EAED,OAAO,UAAU,QAAQ,EACxB,MAAM,eAAe,MAAM,IAAI,EAChC,CAAC;CACF;AACD,CAAC"}
1
+ {"version":3,"file":"layoutGridItem.mjs","names":[],"sources":["../../../../src/components/layoutGrid/src/layoutGridItem.tsx"],"sourcesContent":["import { computed, defineComponent, inject, reactive, ref, watch } from \"vue\";\nimport { definePropType, makeSlots, useExpose, useRender } from \"../../../utils\";\nimport type { Ref } from \"vue\";\nimport type { FaLayoutGridBreakpoint, FaLayoutGridItemResponsive } from \"./layoutGrid.type\";\n\n/** FaLayoutGridItem 的插槽参数 */\nexport interface FaLayoutGridItemSlots extends Record<string, unknown> {\n\t/** 默认内容插槽 */\n\tdefault: never;\n}\n\nexport default defineComponent({\n\tname: \"FaLayoutGridItem\",\n\tprops: {\n\t\t/** 偏移 */\n\t\toffset: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 0,\n\t\t},\n\t\t/** 占位 */\n\t\tspan: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: 1,\n\t\t},\n\t\t/** 后缀 */\n\t\tsuffix: { type: Boolean, default: false },\n\t\t/** 响应式,小于480px屏幕配置 */\n\t\txs: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** 响应式,平板竖屏配置 */\n\t\tsm: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** 响应式,平板横屏配置 */\n\t\tmd: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** 响应式,小型桌面配置 */\n\t\tlg: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t\t/** 响应式,大型桌面配置 */\n\t\txl: {\n\t\t\ttype: definePropType<FaLayoutGridItemResponsive>(Object),\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\tslots: makeSlots<FaLayoutGridItemSlots>(),\n\tsetup(props, { attrs, slots, expose }) {\n\t\tconst attrsObj = attrs as Record<string, unknown>;\n\n\t\t// 注入布局状态\n\t\tconst breakpoint = inject<Ref<FaLayoutGridBreakpoint>>(\"breakpoint\", ref(\"xl\"));\n\t\tconst firstHiddenIndex = inject<Ref<number>>(\"firstHiddenIndex\", ref(-1));\n\t\tconst gap = inject<Ref<number>>(\"gap\", ref(0));\n\t\tconst cols = inject<Ref<number>>(\"cols\", ref(5));\n\n\t\tconst state = reactive({\n\t\t\tshow: true,\n\t\t});\n\n\t\tconst style = computed(() => {\n\t\t\tconst activeBreakpointProps = props[breakpoint.value];\n\t\t\tconst span = activeBreakpointProps?.span ?? (typeof props.span === \"number\" ? props.span : Number(props.span));\n\t\t\tconst offset = activeBreakpointProps?.offset ?? (typeof props.offset === \"number\" ? props.offset : Number(props.offset));\n\t\t\tif (props.suffix) {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumnStart: cols.value - span - offset + 1,\n\t\t\t\t\tgridColumnEnd: `span ${span + offset}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap.value}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\treturn {\n\t\t\t\t\tgridColumn: `span ${span + offset > cols.value ? cols.value : span + offset}/span ${\n\t\t\t\t\t\tspan + offset > cols.value ? cols.value : span + offset\n\t\t\t\t\t}`,\n\t\t\t\t\tmarginLeft: offset !== 0 ? `calc(((100% + ${gap.value}px) / ${span + offset}) * ${offset})` : \"unset\",\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\n\t\twatch(\n\t\t\t() => [firstHiddenIndex.value, breakpoint.value],\n\t\t\t(n) => {\n\t\t\t\tconst index = Number(attrsObj[\"data-index\"] ?? attrsObj[\"index\"]);\n\t\t\t\tif (Number.isInteger(index)) {\n\t\t\t\t\tstate.show = !(n[0] !== -1 && index >= Number(n[0]));\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\tuseRender(() => (\n\t\t\t<div style={style.value} vShow={state.show}>\n\t\t\t\t{slots.default?.()}\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\tshow: computed(() => state.show),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;AAWA,IAAA,yBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,QAAQ;GACP,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,MAAM;GACL,MAAM,CAAC,QAAQ,MAAM;GACrB,SAAS;EACV;;EAEA,QAAQ;GAAE,MAAM;GAAS,SAAS;EAAM;;EAExC,IAAI;GACH,MAAM,eAA2C,MAAM;GACvD,SAAS,KAAA;EACV;;EAEA,IAAI;GACH,MAAM,eAA2C,MAAM;GACvD,SAAS,KAAA;EACV;;EAEA,IAAI;GACH,MAAM,eAA2C,MAAM;GACvD,SAAS,KAAA;EACV;;EAEA,IAAI;GACH,MAAM,eAA2C,MAAM;GACvD,SAAS,KAAA;EACV;;EAEA,IAAI;GACH,MAAM,eAA2C,MAAM;GACvD,SAAS,KAAA;EACV;CACD;CACA,OAAO,UAAiC;CACxC,MAAM,OAAO,EAAE,OAAO,OAAO,UAAU;EACtC,MAAM,WAAW;EA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