@aplus-frontend/ui 6.20.0 → 6.21.0

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 (77) hide show
  1. package/es/index.mjs +159 -155
  2. package/es/src/ap-field/hooks/use-default-presets.d.ts +1 -0
  3. package/es/src/ap-field/hooks/use-default-presets.mjs +18 -12
  4. package/es/src/ap-pro-card/components/card/index.vue.d.ts +25 -0
  5. package/es/src/ap-pro-card/components/card/index.vue.mjs +4 -0
  6. package/es/src/ap-pro-card/components/card/index.vue2.mjs +226 -0
  7. package/es/src/ap-pro-card/index.d.ts +42 -0
  8. package/es/src/ap-pro-card/index.mjs +7 -0
  9. package/es/src/ap-pro-card/interface.d.ts +61 -0
  10. package/es/src/ap-pro-card/style/css.d.ts +0 -0
  11. package/es/src/ap-pro-card/style/css.js +1 -0
  12. package/es/src/ap-pro-card/style/index.d.ts +0 -0
  13. package/es/src/ap-pro-card/style/index.js +1 -0
  14. package/es/src/ap-pro-card/utils/css-var.d.ts +17 -0
  15. package/es/src/ap-pro-card/utils/css-var.mjs +29 -0
  16. package/es/src/business/ap-value-select-card/index.d.ts +8 -0
  17. package/es/src/business/ap-value-select-card/index.mjs +9 -0
  18. package/es/src/business/ap-value-select-card/index.vue.d.ts +48 -0
  19. package/es/src/business/ap-value-select-card/index.vue.mjs +4 -0
  20. package/es/src/business/ap-value-select-card/index.vue2.mjs +186 -0
  21. package/es/src/business/ap-value-select-card/interface.d.ts +107 -0
  22. package/es/src/business/ap-value-select-card/interface.mjs +1 -0
  23. package/es/src/business/ap-value-select-card/style/css.d.ts +0 -0
  24. package/es/src/business/ap-value-select-card/style/css.js +1 -0
  25. package/es/src/business/ap-value-select-card/style/index.d.ts +0 -0
  26. package/es/src/business/ap-value-select-card/style/index.js +1 -0
  27. package/es/src/business/ap-value-select-card/utils.d.ts +7 -0
  28. package/es/src/business/ap-value-select-card/utils.mjs +9 -0
  29. package/es/src/business/index.d.ts +1 -0
  30. package/es/src/business/index.mjs +15 -13
  31. package/es/src/index.d.ts +1 -0
  32. package/es/src/index.mjs +275 -271
  33. package/es/src/path-map.mjs +3 -1
  34. package/es/src/version.d.ts +1 -1
  35. package/es/src/version.mjs +1 -1
  36. package/lib/index.js +1 -1
  37. package/lib/src/ap-field/hooks/use-default-presets.d.ts +1 -0
  38. package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
  39. package/lib/src/ap-pro-card/components/card/index.vue.d.ts +25 -0
  40. package/lib/src/ap-pro-card/components/card/index.vue.js +1 -0
  41. package/lib/src/ap-pro-card/components/card/index.vue2.js +1 -0
  42. package/lib/src/ap-pro-card/index.d.ts +42 -0
  43. package/lib/src/ap-pro-card/index.js +1 -0
  44. package/lib/src/ap-pro-card/interface.d.ts +61 -0
  45. package/lib/src/ap-pro-card/style/css.cjs +1 -0
  46. package/lib/src/ap-pro-card/style/css.d.ts +0 -0
  47. package/lib/src/ap-pro-card/style/index.cjs +1 -0
  48. package/lib/src/ap-pro-card/style/index.d.ts +0 -0
  49. package/lib/src/ap-pro-card/utils/css-var.d.ts +17 -0
  50. package/lib/src/ap-pro-card/utils/css-var.js +1 -0
  51. package/lib/src/business/ap-value-select-card/index.d.ts +8 -0
  52. package/lib/src/business/ap-value-select-card/index.js +1 -0
  53. package/lib/src/business/ap-value-select-card/index.vue.d.ts +48 -0
  54. package/lib/src/business/ap-value-select-card/index.vue.js +1 -0
  55. package/lib/src/business/ap-value-select-card/index.vue2.js +1 -0
  56. package/lib/src/business/ap-value-select-card/interface.d.ts +107 -0
  57. package/lib/src/business/ap-value-select-card/interface.js +1 -0
  58. package/lib/src/business/ap-value-select-card/style/css.cjs +1 -0
  59. package/lib/src/business/ap-value-select-card/style/css.d.ts +0 -0
  60. package/lib/src/business/ap-value-select-card/style/index.cjs +1 -0
  61. package/lib/src/business/ap-value-select-card/style/index.d.ts +0 -0
  62. package/lib/src/business/ap-value-select-card/utils.d.ts +7 -0
  63. package/lib/src/business/ap-value-select-card/utils.js +1 -0
  64. package/lib/src/business/index.d.ts +1 -0
  65. package/lib/src/business/index.js +1 -1
  66. package/lib/src/index.d.ts +1 -0
  67. package/lib/src/index.js +1 -1
  68. package/lib/src/path-map.js +1 -1
  69. package/lib/src/version.d.ts +1 -1
  70. package/lib/src/version.js +1 -1
  71. package/package.json +3 -3
  72. package/theme/ap-pro-card/index.css +259 -0
  73. package/theme/ap-pro-card/index.less +129 -0
  74. package/theme/ap-value-select-card/index.css +163 -0
  75. package/theme/ap-value-select-card/index.less +157 -0
  76. package/theme/index.css +330 -0
  77. package/theme/index.less +2 -0
@@ -0,0 +1,107 @@
1
+ import { ComputedRef, Ref, StyleValue } from 'vue';
2
+ export interface ApValueSelectCardOption<ValueRecord extends Record<string, any> = Record<string, any>> {
3
+ key: string | number;
4
+ label: string;
5
+ value: string | number;
6
+ customClass?: string;
7
+ record?: ValueRecord;
8
+ }
9
+ export interface ApValueSelectCardProps<T extends Record<string, any> = Record<string, any>> {
10
+ /**
11
+ * 所有可用选项
12
+ */
13
+ options: ApValueSelectCardOption<T>[];
14
+ /**
15
+ * 当前选中的选项key
16
+ */
17
+ selectedKeys?: (string | number)[];
18
+ /**
19
+ * 当前高亮的选项key
20
+ */
21
+ highlightedKeys?: (string | number)[];
22
+ /**
23
+ * 最多可选数量
24
+ */
25
+ maxSelected?: number;
26
+ /**
27
+ * 一行最多可显示数量
28
+ */
29
+ maxRowDisplay?: number;
30
+ /**
31
+ * Popover标题
32
+ */
33
+ popoverTitle?: string;
34
+ /**
35
+ * 是否显示Popover标题图标
36
+ */
37
+ showTitleIcon?: boolean;
38
+ /**
39
+ * 是否显示关闭图标
40
+ */
41
+ showCloseIcon?: boolean;
42
+ /**
43
+ * 是否显示添加按钮
44
+ */
45
+ showAddButton?: boolean;
46
+ /**
47
+ * 添加按钮文本
48
+ */
49
+ addButtonText?: string;
50
+ /**
51
+ * 获取容器函数
52
+ */
53
+ getContainer?: (triggerNode: HTMLElement) => HTMLElement;
54
+ /**
55
+ * 自定义卡片样式函数
56
+ */
57
+ getCardStyle?: (key: string | number) => StyleValue;
58
+ /**
59
+ * 自定义卡片外层样式函数
60
+ */
61
+ wrapperStyle?: StyleValue;
62
+ }
63
+ export interface ApValueSelectCardExpose<T extends Record<string, any> = Record<string, any>> {
64
+ /**
65
+ * popover是否显示
66
+ */
67
+ popoverVisible: Ref<boolean, boolean>;
68
+ /**
69
+ * 所有选项
70
+ */
71
+ allOptions: ComputedRef<ApValueSelectCardOption<T>[]>;
72
+ /**
73
+ * 当前选中的选项
74
+ */
75
+ selectedOptions: ComputedRef<ApValueSelectCardOption<T>[]>;
76
+ isSelected: (key: string | number) => boolean;
77
+ /**
78
+ * 检查是否高亮
79
+ * @param { string | number } key
80
+ * @returns void
81
+ */
82
+ isHighlighted: (key: string | number) => boolean;
83
+ /**
84
+ * 切换选项选择状态
85
+ * @param {string | number} key
86
+ * @returns void
87
+ */
88
+ toggleOption: (key: string | number) => void;
89
+ /**
90
+ * 添加选项
91
+ * @param {string | number} key
92
+ * @returns void
93
+ */
94
+ addOption: (key: string | number) => void;
95
+ /**
96
+ * 移除选项
97
+ * @param {string | number} key
98
+ * @returns void
99
+ */
100
+ removeOption: (key: string | number) => void;
101
+ /**
102
+ * 高亮选项
103
+ * @param {string | number} key
104
+ * @returns void
105
+ */
106
+ highlightOption: (key: string | number) => void;
107
+ }
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui/theme/ap-value-select-card/index.css';
@@ -0,0 +1 @@
1
+ import '@aplus-frontend/ui/theme/ap-value-select-card/index.less';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Convert a hex color code to an RGBA color string.
3
+ * @param hex - The hex color code, e.g. "#ff00ff" or "#f0f".
4
+ * @param alpha - The alpha value (optional), default is 1 (fully opaque).
5
+ * @returns The RGBA color string.
6
+ */
7
+ export declare function hexToRgba(hex: string, alpha?: number): string;
@@ -0,0 +1,9 @@
1
+ function g(n, t = 1) {
2
+ if (n = n == null ? void 0 : n.replace(/^#/, ""), n.length === 3 && (n = n.split("").map((r) => r + r).join("")), n.length !== 6)
3
+ throw new Error("Invalid hex color code");
4
+ const s = parseInt(n.substring(0, 2), 16), o = parseInt(n.substring(2, 4), 16), i = parseInt(n.substring(4, 6), 16);
5
+ return `rgba(${s}, ${o}, ${i}, ${t})`;
6
+ }
7
+ export {
8
+ g as hexToRgba
9
+ };
@@ -25,4 +25,5 @@ export * from './ap-view';
25
25
  export * from './ap-radio-group';
26
26
  export * from './ap-keep-alive';
27
27
  export * from './ap-draggable-grid';
28
+ export * from './ap-value-select-card';
28
29
  export { ApTransformDataHelper } from '../utils/ap-trans-data';
@@ -2,19 +2,19 @@ import { default as m } from "./ap-table-modal/index.mjs";
2
2
  import { ApAttachment as f } from "./ap-attachment/index.mjs";
3
3
  import { ApBatchAction as a } from "./ap-batch-action/index.mjs";
4
4
  import { ApBatchActionGroup as i } from "./ap-batch-action-group/index.mjs";
5
- import { ApButtonGroup as l } from "./ap-button-group/index.mjs";
5
+ import { ApButtonGroup as d } from "./ap-button-group/index.mjs";
6
6
  import { ApCard as c } from "./ap-card/index.mjs";
7
7
  import { ApExpandAlert as S } from "./ap-expand-alert/index.mjs";
8
8
  import { ApExportGroup as s } from "./ap-export-group/index.mjs";
9
9
  import { ApImage as L } from "./ap-image/index.mjs";
10
10
  import { ApInputRadio as h } from "./ap-input-radio/index.mjs";
11
- import { ApLabel as B, ApLabelGroup as T } from "./ap-label/index.mjs";
11
+ import { ApLabel as B, ApLabelGroup as C } from "./ap-label/index.mjs";
12
12
  import { ApLadder as D } from "./ap-ladder/index.mjs";
13
13
  import { ApSelectLayout as R } from "./ap-select-layout/index.mjs";
14
- import { ApStatus as w, ApStatusGroup as z } from "./ap-status/index.mjs";
15
- import { ApTitle as K } from "./ap-title/index.mjs";
14
+ import { ApStatus as v, ApStatusGroup as w } from "./ap-status/index.mjs";
15
+ import { ApTitle as H } from "./ap-title/index.mjs";
16
16
  import "./hooks/index.mjs";
17
- import { ApSummary as P } from "./ap-summary/index.mjs";
17
+ import { ApSummary as M } from "./ap-summary/index.mjs";
18
18
  import { ApAppendix as j } from "./ap-appendix/index.mjs";
19
19
  import "./ap-upload-file/index.mjs";
20
20
  import "./batch-input-group/index.mjs";
@@ -25,13 +25,14 @@ import { ApView as U } from "./ap-view/index.mjs";
25
25
  import { ApRadioGroup as X } from "./ap-radio-group/index.mjs";
26
26
  import { ApKeepAlive as Z } from "./ap-keep-alive/index.mjs";
27
27
  import { ApDraggableGrid as $ } from "./ap-draggable-grid/index.mjs";
28
- import { ApTransformDataHelper as po } from "../utils/ap-trans-data/index.mjs";
28
+ import { ApValueSelectCard as ro } from "./ap-value-select-card/index.mjs";
29
+ import { ApTransformDataHelper as to } from "../utils/ap-trans-data/index.mjs";
29
30
  export {
30
31
  j as ApAppendix,
31
32
  f as ApAttachment,
32
33
  a as ApBatchAction,
33
34
  i as ApBatchActionGroup,
34
- l as ApButtonGroup,
35
+ d as ApButtonGroup,
35
36
  c as ApCard,
36
37
  O as ApCopy,
37
38
  $ as ApDraggableGrid,
@@ -41,17 +42,18 @@ export {
41
42
  h as ApInputRadio,
42
43
  Z as ApKeepAlive,
43
44
  B as ApLabel,
44
- T as ApLabelGroup,
45
+ C as ApLabelGroup,
45
46
  D as ApLadder,
46
47
  J as ApProductInfo,
47
48
  X as ApRadioGroup,
48
49
  R as ApSelectLayout,
49
50
  q as ApSizeInput,
50
- w as ApStatus,
51
- z as ApStatusGroup,
52
- P as ApSummary,
51
+ v as ApStatus,
52
+ w as ApStatusGroup,
53
+ M as ApSummary,
53
54
  m as ApTableModal,
54
- K as ApTitle,
55
- po as ApTransformDataHelper,
55
+ H as ApTitle,
56
+ to as ApTransformDataHelper,
57
+ ro as ApValueSelectCard,
56
58
  U as ApView
57
59
  };
package/es/src/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './ap-modal';
12
12
  export * from './ap-list';
13
13
  export * from './ap-button';
14
14
  export * from './ap-drawer';
15
+ export * from './ap-pro-card';
15
16
  export * from './business';
16
17
  export * from './ap-table';
17
18
  export * from './editable-table';