@cmstops/pro-compo 3.9.1-rc.6 → 3.9.1-stable.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 (36) hide show
  1. package/README.md +76 -103
  2. package/dist/index.css +4 -45
  3. package/dist/index.min.css +1 -1
  4. package/es/config.js +1 -1
  5. package/es/contentDetailList/component.js +0 -24
  6. package/es/contentDetailList/components/Content/index.js +1 -2
  7. package/es/contentDetailList/components/Doc/index.js +0 -6
  8. package/es/hooks/usePopper.d.ts +1 -1
  9. package/es/hooks/usePopper.js +3 -3
  10. package/es/index.css +4 -45
  11. package/es/selectResourceModal/components/List/ListNormal/Filter.js +90 -192
  12. package/es/selectResourceModal/components/List/ListNormal/index.js +7 -23
  13. package/es/selectResourceModal/style/index.css +4 -45
  14. package/es/selectResourceModal/style/index.less +0 -14
  15. package/es/selectResourceModal/style/list.less +4 -40
  16. package/es/selectThumb/component.js +18 -7
  17. package/es/utils/index.js +6 -6
  18. package/lib/config.js +1 -1
  19. package/lib/contentDetailList/component.js +0 -24
  20. package/lib/contentDetailList/components/Content/index.js +1 -2
  21. package/lib/contentDetailList/components/Doc/index.js +0 -6
  22. package/lib/hooks/usePopper.js +3 -3
  23. package/lib/index.css +4 -45
  24. package/lib/selectResourceModal/components/List/ListNormal/Filter.js +87 -189
  25. package/lib/selectResourceModal/components/List/ListNormal/index.js +6 -22
  26. package/lib/selectResourceModal/style/index.css +4 -45
  27. package/lib/selectResourceModal/style/index.less +0 -14
  28. package/lib/selectResourceModal/style/list.less +4 -40
  29. package/lib/selectThumb/component.js +18 -7
  30. package/lib/utils/index.js +6 -6
  31. package/package.json +1 -1
  32. package/es/selectResourceModal/__demo__/module/DivWrapper.d.ts +0 -268
  33. package/es/selectResourceModal/__demo__/module/basic.d.ts +0 -299
  34. package/es/selectResourceModal/hooks/useResponsiveFilter.d.ts +0 -21
  35. package/es/selectResourceModal/hooks/useResponsiveFilter.js +0 -142
  36. package/lib/selectResourceModal/hooks/useResponsiveFilter.js +0 -144
package/README.md CHANGED
@@ -1,134 +1,107 @@
1
- # 智媒管家业务组件库
1
+ # Arco 物料项目
2
2
 
3
- > 快速上手:[传送门](/docs/get-start.md)
3
+ [物料平台文档中心](https://arco.design/docs/material/guide)
4
4
 
5
- ## 模块介绍
5
+ ## 快速开始
6
6
 
7
- 业务组件库基于 Vue3 + Storybook 搭建,结合 ArcoDesgin,包含智媒管家平台核心业务相关组件
7
+ **在 `npm run dev` 前,请运行 `npm run add:component -- ComponentName` 创建第一个组件,否则 dev 将会因缺少 Story 入口而报错。**
8
8
 
9
- ## 版本规范
10
-
11
- 关于版本,这里需要提一下
12
-
13
- 按理论来讲业务组件的版本和产品的版本不应该有强关联(即产品的版本是 3.0,业务组件可以是 1.0)
14
- 但是因为产品的买家(即甲方爸爸)使用的产品可能是 3.1、3.2、3.3...,并且会有强定制的情况
15
-
16
- 所以这里我们需要有一个约定,以便研发人员更好的溯源 & 协作 & 维护~
9
+ ```
10
+ # 添加组件
11
+ npm run add:component -- YourComponentName
17
12
 
18
- 当前约定如下:
13
+ # 开发
14
+ npm run dev
19
15
 
20
- | 分支类型 | 分支名称 | 描述 | 使用位置 | 版本号规则 |
21
- | ------------ | ---------------------------- | -------------------------------- | ------------- | ---------------------------- |
22
- | **主分支** | main | 研发自测完毕并 _可以上线_ 的需求 | 预发布环境 | x.x.x-**rc**.y |
23
- | **版本分支** | release/xxx | 经过完整测试的需求 | 线上/项目环境 | x.x.x-**stable**.y |
24
- | **定制分支** | release/xxx-{{project.name}} | 经过测试的 _定制_ 需求 | 项目环境 | x.x.x-**{{project.name}}**.y |
25
- | **开发分支** | develop | 研发自测完毕的需求 | 测试环境 | x.x.x-**alpha**.y |
16
+ # 构建
17
+ npm run build
26
18
 
27
- > 所谓 "可以上线",有两种情况:
28
- >
29
- > 1. 是指当前产品发布计划中是否有该功能,如果有,则可以合并至 main,否则不可以
30
- > 2. 该功能是所有版本通用的功能,无论产品版本是多少,都可以合并至 main
19
+ # 发布前预览
20
+ npm run prepublishOnly && arco preview
31
21
 
32
- ### 版本发布示例
22
+ # 发布至物料平台(需先发布 NPM 包)
23
+ arco sync
24
+ ```
33
25
 
34
- 假设当前产品版本是 3.2.0
35
- 此时:
36
26
 
37
- - 主分支 main 版本号为 3.2.0-rc.0
38
- - 版本分支 release/v3.2.0 版本号为 3.2.0-stable.0
39
- - 开发分支 develop 版本号为 3.2.0-alpha.0
27
+ ## 提供 Demo
40
28
 
41
- #### 示例 1:当前版本 bug 修复 A 功能和 B 功能
29
+ Demo 目录位于 `src/demo`。你可以在此目录中加入多个 Demo,它们将被展示在物料平台的预览页。在 `src/demo/index.js` 中,通过 JSDoc 的语法提供物料及各个 Demo 的相关信息。
42
30
 
43
- 1. 第一步:基于 release/v3.2.0 版本切出:hotfix/v3.2.0-A,hotfix/v3.2.0-B
44
- 2. 第二步:bug-A 修复后,将 hotfix/v3.2.0-A 合并至 develop 自测并发布 3.2.0-alpha.**1**
45
- 3. 第三步:bug-B 修复后,将 hotfix/v3.2.0-B 合并至 develop 自测并发布 3.2.0-alpha.**2**
46
- 4. 第四步:自测完毕后,将 hotfix/v3.2.0-A & hotfix/v3.2.0-B 合并至 main 并发布 3.2.0-rc.**1** 交付测试
47
- 5. 第五步:测试完毕后,将 hotfix/v3.2.0-A & hotfix/v3.2.0-B 合并至 release/v3.2.0 并发布 3.2.0-stable.**1** 交付线上
31
+ ```javascript
32
+ // src/demo/index.js
48
33
 
49
- > 注意:第二步第三步可以分开 publish,也可以都合并到 develop 之后再 publish,因为两个 bug 不一定是同一个人修复,所以会有个先后顺序
50
- > 但是尽量 rc 和 stable 尽量统一发布,减少版本号的迭代,方便维护和问题追溯
34
+ /**
35
+ * @file
36
+ * @title 组件名
37
+ * @memberOf 组件类型,例如:数据输入
38
+ * @description 描述你的组件。
39
+ */
51
40
 
52
- 功能分支走向图:
41
+ /**
42
+ * @title 基本用法
43
+ * @description 描述你的例子
44
+ */
45
+ import Basic from './basic.vue';
53
46
 
54
- ```mermaid
55
- graph TD
56
- A[release/v3.2.0] --> B[hotfix/v3.2.0-A]
57
- A --> C[hotfix/v3.2.0-B]
58
- B --> D[develop 3.2.0-alpha.1]
59
- C --> E[develop 3.2.0-alpha.2]
60
- D --> F[main 3.2.0-rc.1]
61
- E --> F
62
- F --> G[release/v3.2.0 3.2.0-stable.1]
47
+ export const BasicDemo = () => Basic;
63
48
  ```
64
49
 
65
- #### 示例 2:历史版本 release/v3.0.0 bug 修复 C 功能
66
-
67
- 1. 第一步:基于 release/v3.0.0 版本分支切出:hotfix/v3.0.0-C
68
- 2. 第二步:bug-C 修复后,将 hotfix/v3.0.0-C 合并至 develop 自测,并发布 3.2.0-alpha.**3**
69
- 3. 第三步:自测完毕后,将 hotfix/v3.0.0-C 合并至 main 并发布 3.2.0-rc.**2** 交付测试
70
- 4. 第四步:测试完毕后,将 hotfix/v3.0.0-C 合并至 release/v3.0.0、release/v3.0.0、release/v3.1.0、release/v3.2.0;并发布:3.0.0-stable.x、3.1.0-stable.y、3.2.0-stable.**2**
71
-
72
- 功能分支走向图:
73
-
74
- ```mermaid
75
- graph TD
76
- A[release/v3.0.0] --> B[hotfix/v3.0.0-C]
77
- B --> C[develop 3.2.0-alpha.3]
78
- C --> D[main 3.2.0-rc.2]
79
- D --> E[release/v3.0.0 3.0.0-stable.x]
80
- D --> F[release/v3.1.0 3.1.0-stable.y]
81
- D --> G[release/v3.2.0 3.2.0-stable.2]
50
+ ## API 文档
51
+
52
+ **为了帮助他人更好地使用你的组件,请提供详细的 API 文档。**
53
+
54
+ ### 书写注释
55
+
56
+ 我们使用了 [Vue Styleguidist](https://vue-styleguidist.github.io/) 来提取组件 Props 的注释,然后自动生成组件的 API 文档。为此,如果你想对外暴露一个 Property,请参照Vue Styleguidist 的规则书写注释:
57
+
58
+ ```vue
59
+ // ✅ 可以被正确提取的注释
60
+ props: {
61
+ /**
62
+ * 提示文字
63
+ */
64
+ tip: String,
65
+ /**
66
+ * 按钮组件Props
67
+ */
68
+ buttonProps: {
69
+ // 如果使用PropType,请使用对象的形式定义
70
+ type: Object as PropType<Record<string, any>>,
71
+ },
72
+ },
73
+
74
+ // ❌ 没有书写注释的属性会被忽略
75
+ props: {
76
+ disabled: Boolean,
77
+ },
82
78
  ```
83
79
 
84
- > 注意:如果是低版本的问题,尽可能的在出问题的版本处理,然后逐层向上合并(如果新版本已经修复并且代码改动较多,有冲突时,解决冲突并保留新版本原逻辑即可)
85
- > **如果按照社区常见的版本迭代规则,bug 的解决应该是在最新版本,旧版本的代码是不会改动的。**
86
- > **但是实际我们自己的业务场景必须低版本也要能解决,为了尽量不去重复写代码,只能去手动的维护一下该操作。**
80
+ ### 扩展 TEMPLATE.md
87
81
 
88
- #### 示例 3:新版本 release/v3.3.0 功能 D 开发
82
+ `TEMPLATE.md` 是用于自动文档生成的模板,你可以修改此文件添加更多组件的使用帮助信息,但请不要删除其原有的内容,否则可能导致内容替换失败。
89
83
 
90
- 1. 第一步:基于 release/v3.2.0 版本切出:feature/v3.3.0-D
91
- 2. 第二步:Feat-D 开发完毕后,将 feature/v3.3.0-D 合并至 develop 自测,并发布 3.3.0-alpha.**0**
92
- 3. 第三步:自测完毕后,将 feature/v3.3.0-D 合并至 main,并发布 3.3.0-rc.**0**
93
- 4. 第四步:测试完毕后,基于 release/v3.2.0 切出 release/v3.3.0,将 feature/v3.3.0-D 合并至 release/v3.3.0
84
+ ```markdown
85
+ // TEMPLATE.md
86
+ ---
87
+ file: index
88
+ ---
94
89
 
95
- 功能分支走向图:
90
+ # TooltipButton
96
91
 
97
- ```mermaid
98
- graph TD
99
- A[release/v3.2.0] --> B[feature/v3.3.0-D]
100
- B --> C[develop 3.3.0-alpha.0]
101
- C --> D[main 3.3.0-rc.0]
102
- A --> E[release/v3.3.0]
103
- D --> E
104
- ```
92
+ ## 属性/Props
105
93
 
106
- #### 示例 4:通用功能 E 开发
94
+ %%Props%%
107
95
 
108
- 1. 第一步:基于最早版本 release/v3.0.0 切出:feature/v3.0.0-E
109
- 2. 第二步:Feat-E 开发完毕后,将 feature/v3.0.0-E 合并至 develop 自测,并发布 3.3.0-alpha.**1**
110
- 3. 第三步:自测完毕后,将 feature/v3.0.0-E 合并至 main,并发布 3.3.0-rc.**1**
111
- 4. 第四步:测试完毕后,将 feature/v3.0.0-E 合并至 release/v3.0.0、releaes/v3.1.0、release/v3.2.0、release/v3.3.0
96
+ ### OtherProps
112
97
 
113
- > 业务组件库这个项目和其他模块的不同之处在于,如果这里说是新功能
114
- > 一般是指又抽离出了一个产品的核心业务,而这个核心业务与产品的 **版本** 关联性不强,所有版本均可使用的这种功能
98
+ 在这里你可以书写更多组件帮助文档。
115
99
 
116
- 功能分支走向图:
100
+ ## Demos
117
101
 
118
- ```mermaid
119
- graph TD
120
- A[release/v3.0.0] --> B[feature/v3.0.0-E]
121
- B --> C[develop 3.3.0-alpha.1]
122
- C --> D[main 3.3.0-rc.1]
123
- D --> E[release/v3.0.0]
124
- D --> F[release/v3.1.0]
125
- D --> G[release/v3.2.0]
126
- D --> H[release/v3.3.0]
102
+ %%Demos%%
127
103
  ```
128
104
 
129
- #### 示例 5:3.1.0 版本 _G_ 项目定制 功能 F 开发
130
-
131
- 1. 第一步:基于 release/v3.1.0 切出:feature/v3.1.0-G-F
132
- 2. 第二步:Feat-F 开发完毕后,基于 release/v3.1.0 切出 release/v3.1.0-G,将 feature/v3.1.0-G-F 合并至 release/v3.1.0-G,并发布 3.1.0-G.**0**
105
+ ## 测试
133
106
 
134
- > 注意:如果有项目有定制,后续的任何通用更新不会覆盖该版本,所以在定制之前需和产品 **再三确认**
107
+ 测试目录位于 `src/__test__`。你可以在 `index.test.tsx` 中编写你的测试用例,在 `demo.test.tsx` 中可以进行基于 Demo 的快照测试。
package/dist/index.css CHANGED
@@ -4529,13 +4529,11 @@
4529
4529
  }
4530
4530
  .resource-list-footer,
4531
4531
  .resource-list-header,
4532
- .resource-list-content .resource-list-content-empty,
4533
4532
  .resource-list-content .arco-scrollbar-container {
4534
4533
  padding: 0 40px;
4535
4534
  }
4536
4535
  .resource-list-footer {
4537
4536
  display: flex;
4538
- flex-wrap: wrap;
4539
4537
  justify-content: space-between;
4540
4538
  padding-bottom: 20px;
4541
4539
  }
@@ -4545,10 +4543,6 @@
4545
4543
  gap: 10px;
4546
4544
  align-items: center;
4547
4545
  justify-content: flex-end;
4548
- margin-top: 10px;
4549
- }
4550
- .resource-list-footer .footer-right .list-selected-wrapper {
4551
- font-size: 12px;
4552
4546
  }
4553
4547
  .resource-list-content-loading {
4554
4548
  display: flex;
@@ -4560,7 +4554,7 @@
4560
4554
  .resource-list .list-item-grid {
4561
4555
  display: grid;
4562
4556
  grid-gap: 20px;
4563
- grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
4557
+ grid-template-columns: repeat(5, 1fr);
4564
4558
  }
4565
4559
  .resource-list .list-content {
4566
4560
  margin-top: 30px;
@@ -4603,8 +4597,7 @@
4603
4597
  }
4604
4598
  .resource-list .list-filter-wrapper .list-filter-tags {
4605
4599
  display: flex;
4606
- flex-wrap: wrap;
4607
- gap: 10px;
4600
+ justify-content: space-between;
4608
4601
  margin-top: 10px;
4609
4602
  }
4610
4603
  .resource-list .list-filter-wrapper .list-filter-tags .list-filter-tag {
@@ -4625,41 +4618,16 @@
4625
4618
  justify-content: space-between;
4626
4619
  }
4627
4620
  .resource-list .list-filter-wrapper .list-filter .filter-list {
4628
- position: relative;
4629
- /** 给 popup 一个参考 */
4630
4621
  display: flex;
4622
+ flex-wrap: wrap;
4623
+ gap: 10px;
4631
4624
  }
4632
4625
  .resource-list .list-filter-wrapper .list-filter .filter-list .filter-item {
4633
4626
  width: 100px;
4634
- margin-right: 10px;
4635
- }
4636
- .resource-list .list-filter-wrapper .list-filter .filter-list .arco-trigger-popup {
4637
- z-index: 100000 !important;
4638
4627
  }
4639
4628
  .resource-list .list-filter-wrapper .list-filter .arco-input-prepend {
4640
4629
  padding: 0;
4641
4630
  }
4642
- .resource-list .list-filter-wrapper .list-filter .more-btn {
4643
- position: relative;
4644
- /** 给 poperjs 一个参考 */
4645
- }
4646
- .resource-list .list-filter-wrapper .list-filter .more-btn .filter-pannel {
4647
- inset: 40px auto auto auto !important;
4648
- }
4649
- .resource-list .list-filter-wrapper .filter-extra {
4650
- display: flex;
4651
- gap: 10px;
4652
- }
4653
- .resource-list .list-filter-wrapper .filter-pannel {
4654
- z-index: 100000;
4655
- display: flex;
4656
- flex-direction: column;
4657
- gap: 10px;
4658
- padding: 10px;
4659
- background-color: #fff;
4660
- border-radius: 4px;
4661
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
4662
- }
4663
4631
  .resource-list .title {
4664
4632
  display: flex;
4665
4633
  gap: 8px;
@@ -4673,10 +4641,6 @@
4673
4641
  height: 16px;
4674
4642
  background-color: #4886ff;
4675
4643
  }
4676
- .resource-select-wrap {
4677
- width: 100%;
4678
- height: 100%;
4679
- }
4680
4644
  .resource-select-modal-body {
4681
4645
  height: 80vh;
4682
4646
  padding: 0;
@@ -4705,11 +4669,6 @@
4705
4669
  .resource-select-container .resource-select-header .arco-tabs-content {
4706
4670
  display: none !important;
4707
4671
  }
4708
- .resource-select-container .resource-list-content .resource-list-content-empty {
4709
- box-sizing: border-box;
4710
- width: 100%;
4711
- height: 100%;
4712
- }
4713
4672
  .iframe-container {
4714
4673
  position: relative;
4715
4674
  height: 95vh;