vue2-client 1.3.6 → 1.3.9

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 (74) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +1 -1
  3. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +4 -4
  4. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1 -1
  5. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +1 -1
  6. package/src/base-client/components/common/CustomColumnsDrawer/index.md +46 -46
  7. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  8. package/src/base-client/components/common/Upload/Upload.vue +3 -3
  9. package/src/base-client/components/common/XAddForm/XAddForm.vue +6 -2
  10. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +7 -2
  11. package/src/base-client/components/common/XForm/XForm.vue +1 -1
  12. package/src/base-client/components/common/XForm/XFormItem.vue +4 -2
  13. package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -0
  14. package/src/base-client/components/system/LogDetailsView/LogDetailsView.vue +376 -372
  15. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +1 -1
  16. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +14 -13
  17. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  18. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  19. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +1 -1
  20. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  21. package/src/base-client/plugins/AppData.js +4 -6
  22. package/src/base-client/plugins/GetLoginInfoService.js +252 -252
  23. package/src/base-client/plugins/PagedList.js +3 -3
  24. package/src/base-client/plugins/i18n-extend.js +32 -32
  25. package/src/components/Ellipsis/index.md +38 -38
  26. package/src/components/NumberInfo/index.md +43 -43
  27. package/src/components/STable/README.md +341 -341
  28. package/src/components/Trend/index.md +45 -45
  29. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  30. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  31. package/src/components/exception/ExceptionPage.vue +70 -70
  32. package/src/components/form/FormRow.vue +52 -52
  33. package/src/components/menu/SideMenu.vue +62 -62
  34. package/src/components/menu/menu.js +273 -273
  35. package/src/components/setting/Setting.vue +235 -235
  36. package/src/components/table/advance/ActionColumns.vue +158 -158
  37. package/src/components/table/advance/SearchArea.vue +355 -355
  38. package/src/components/tool/AStepItem.vue +60 -60
  39. package/src/components/tool/AvatarList.vue +68 -69
  40. package/src/components/tool/Drawer.vue +142 -142
  41. package/src/components/transition/PageToggleTransition.vue +97 -97
  42. package/src/config/replacer/resolve.config.js +67 -67
  43. package/src/layouts/AdminLayout.vue +174 -174
  44. package/src/layouts/header/AdminHeader.vue +3 -3
  45. package/src/layouts/header/HeaderNotice.vue +1 -1
  46. package/src/layouts/header/HeaderSearch.vue +67 -67
  47. package/src/layouts/header/InstitutionDetail.vue +3 -3
  48. package/src/layouts/tabs/TabsHead.vue +190 -190
  49. package/src/layouts/tabs/TabsView.vue +379 -379
  50. package/src/mock/goods/index.js +108 -108
  51. package/src/pages/CreateQueryPage.vue +2 -2
  52. package/src/pages/report/ReportTable.js +124 -125
  53. package/src/pages/report/ReportTableHome.vue +28 -28
  54. package/src/pages/system/file/index.vue +3 -3
  55. package/src/pages/system/ticket/index.vue +4 -1
  56. package/src/services/api/DictionaryDetailsViewApi.js +1 -1
  57. package/src/services/api/LogDetailsViewApi.js +3 -3
  58. package/src/services/api/QueryParamsDetailsViewApi.js +1 -1
  59. package/src/services/api/TicketDetailsViewApi.js +15 -23
  60. package/src/services/api/common.js +11 -11
  61. package/src/services/api/commonTempTable.js +3 -3
  62. package/src/services/api/manage.js +2 -2
  63. package/src/theme/default/nprogress.less +76 -76
  64. package/src/utils/colors.js +103 -103
  65. package/src/utils/excel/Blob.js +53 -54
  66. package/src/utils/excel/Export2Excel.js +4 -4
  67. package/src/utils/formatter.js +68 -68
  68. package/src/utils/i18n.js +1 -1
  69. package/src/utils/routerUtil.js +3 -3
  70. package/src/utils/theme-color-replacer-extend.js +3 -3
  71. package/src/utils/themeUtil.js +100 -102
  72. package/src/utils/util.js +2 -2
  73. package/vue.config.js +5 -15
  74. package/vue2-client.iml +9 -0
@@ -1,42 +1,34 @@
1
1
  const TicketDetailsViewApi = {
2
2
  // 查询:获取工单流转详情
3
- getTicketWorkFlowDetails: '/af-system/getTicketWorkFlowDetails',
3
+ getTicketWorkFlowDetails: '/api/af-system/logic/getTicketWorkFlowDetails',
4
4
  // 查询:获取工单详情
5
- getTicketDetails: '/af-system/getTicketDetails',
5
+ getTicketDetails: '/api/af-system/logic/getTicketDetails',
6
6
  // 手动关闭工单
7
- manualCloseTicket: '/af-system/manualCloseTicket',
7
+ manualCloseTicket: '/api/af-system/logic/manualCloseTicket',
8
8
  // 转交工单给其他人
9
- transferTicketToOthers: '/af-system/transferTicketToOthers',
9
+ transferTicketToOthers: '/api/af-system/logic/transferTicketToOthers',
10
10
  // 确认工单,开始处理
11
- confirmTicket: '/af-system/confirmTicket',
12
- // 获取工单序号
13
- getTicketSerialNumber: '/af-system/getTicketSerialNumber',
14
- // 新增工单
15
- addTicket: '/af-system/addTicket',
11
+ confirmTicket: '/api/af-system/logic/confirmTicket',
16
12
  // 查询:获取订单详情用于订单追踪
17
- getTicketDetailsForUploader: '/af-system/getTicketDetailsForUploader',
13
+ getTicketDetailsForUploader: '/api/af-system/logic/getTicketDetailsForUploader',
18
14
  // 更新:将工单优先级增加
19
- rushTicket: '/af-system/rushTicket',
15
+ rushTicket: '/api/af-system/logic/rushTicket',
20
16
  // 客户手动关闭工单
21
- manualCloseTicketByCustomer: '/af-system/manualCloseTicketByCustomer',
22
- // 上传图片
23
- uploadImage: '/af-system/upload',
24
- // 获取工单类别字典
25
- getTicketCategoryDictionary: '/af-system/getTicketCategoryDictionary',
17
+ manualCloseTicketByCustomer: '/api/af-system/logic/manualCloseTicketByCustomer',
26
18
  // 在工单提交页面删除照片
27
- revocationImage: '/af-system/revocationImage',
19
+ revocationImage: '/api/af-system/logic/revocationImage',
28
20
  // 在工单提交页面删除照片
29
- getTicketImages: '/af-system/getTicketImages',
21
+ getTicketImages: '/api/af-system/logic/getTicketImages',
30
22
  // 用户填写附加信息时取消了操作,将已上传的照片清空
31
- removeAllImages: '/af-system/removeAllImages',
23
+ removeAllImages: '/api/af-system/logic/removeAllImages',
32
24
  // 提交用户填写附加信息
33
- AddonDescriptionToTicket: '/af-system/AddonDescriptionToTicket',
25
+ AddonDescriptionToTicket: '/api/af-system/logic/AddonDescriptionToTicket',
34
26
  // 获取用户填写附加信息
35
- getAddonDescription: '/af-system/getAddonDescription',
27
+ getAddonDescription: '/api/af-system/logic/getAddonDescription',
36
28
  // 发起售后工单流程
37
- createTicket: '/af-system/createTicket',
29
+ createTicket: '/api/af-system/logic/createTicket',
38
30
  // 查询:获取所有员工名,供前端展示备选项
39
- getAllEmployeeName: '/af-system/getAllEmployeeName'
31
+ getAllEmployeeName: '/api/af-system/logic/getAllEmployeeName'
40
32
  }
41
33
 
42
34
  export { TicketDetailsViewApi }
@@ -3,19 +3,19 @@ import { indexedDB } from '@vue2-client/utils/indexedDB'
3
3
 
4
4
  const commonApi = {
5
5
  // 获取表格列配置
6
- getColumnsJson: '/af-system/getColumns',
6
+ getColumnsJson: '/api/af-system/logic/getColumns',
7
7
  // 通用查询
8
- query: 'commonQuery',
8
+ query: 'logic/commonQuery',
9
9
  // 表单查询
10
- queryWithResource: 'commonQueryWithResource',
10
+ queryWithResource: 'logic/commonQueryWithResource',
11
11
  // 通用新增/修改
12
- addOrModify: 'commonAddOrModify',
12
+ addOrModify: 'logic/commonAddOrModify',
13
13
  // 通用删除
14
- delete: 'commonDelete',
14
+ delete: 'logic/commonDelete',
15
15
  // 获取字典键列表
16
- getDictionaryParam: '/af-system/getDictionaryParam',
16
+ getDictionaryParam: '/api/af-system/logic/getDictionaryParam',
17
17
  // 获取所有员工及其部门的级联菜单数据
18
- getEmpTree: '/af-system/getEmpTree',
18
+ getEmpTree: '/api/af-system/logic/getEmpTree',
19
19
  }
20
20
 
21
21
  /**
@@ -31,28 +31,28 @@ export function getColumnsJson (queryParamsName, callback) {
31
31
  * 通用查询
32
32
  */
33
33
  export function query (parameter, api = commonApi.query, serviceName = 'af-system') {
34
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
34
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
35
35
  }
36
36
 
37
37
  /**
38
38
  * 通用表单查询
39
39
  */
40
40
  export function queryWithResource (parameter, api = commonApi.queryWithResource, serviceName = 'af-system') {
41
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
41
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
42
42
  }
43
43
 
44
44
  /**
45
45
  * 通用新增/修改
46
46
  */
47
47
  export function addOrModify (parameter, api = commonApi.addOrModify, serviceName = 'af-system') {
48
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
48
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
49
49
  }
50
50
 
51
51
  /**
52
52
  * 通用删除
53
53
  */
54
54
  export function remove (parameter, api = commonApi.delete, serviceName = 'af-system') {
55
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
55
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
56
56
  }
57
57
 
58
58
  export { commonApi }
@@ -1,10 +1,10 @@
1
1
  const CommonTempTable = {
2
2
  // 初始化子表
3
- initApplySubTable: '/af-system/initApplySubTable',
3
+ initApplySubTable: '/api/af-system/logic/initApplySubTable',
4
4
  // 创建临时表,根据配置文件动态生成
5
- createTempTable: '/af-system/createTempTable',
5
+ createTempTable: '/api/af-system/logic/createTempTable',
6
6
  // 向临时表中插入数据
7
- insertDataToTempTable: '/af-system/insertDataToTempTable'
7
+ insertDataToTempTable: '/api/af-system/logic/insertDataToTempTable'
8
8
  }
9
9
 
10
10
  export { CommonTempTable }
@@ -1,8 +1,8 @@
1
1
  const manageApi = {
2
2
  // 查询:获取字典键列表
3
- getDictionaryValue: '/af-system/getDictionaryValue',
3
+ getDictionaryValue: '/api/af-system/logic/getDictionaryValue',
4
4
  // 查询:获取省市区街道三级分类
5
- getDivisionsOhChina: '/af-system/getDivisionsOhChina'
5
+ getDivisionsOhChina: '/api/af-system/logic/getDivisionsOhChina'
6
6
  }
7
7
 
8
8
  export { manageApi }
@@ -1,76 +1,76 @@
1
- @import '~ant-design-vue/lib/style/themes/default';
2
-
3
- /* Make clicks pass-through */
4
- #nprogress {
5
- pointer-events: none;
6
- }
7
-
8
- #nprogress .bar {
9
- background: @primary-color;
10
-
11
- position: fixed;
12
- z-index: 1031;
13
- top: 0;
14
- left: 0;
15
-
16
- width: 100%;
17
- height: 2px;
18
- }
19
-
20
- /* Fancy blur effect */
21
- #nprogress .peg {
22
- display: block;
23
- position: absolute;
24
- right: 0px;
25
- width: 100px;
26
- height: 100%;
27
- box-shadow: 0 0 10px @primary-color, 0 0 5px @primary-color;
28
- opacity: 1.0;
29
-
30
- -webkit-transform: rotate(3deg) translate(0px, -4px);
31
- -ms-transform: rotate(3deg) translate(0px, -4px);
32
- transform: rotate(3deg) translate(0px, -4px);
33
- }
34
-
35
- /* Remove these to get rid of the spinner */
36
- #nprogress .spinner {
37
- display: block;
38
- position: fixed;
39
- z-index: 1031;
40
- top: 15px;
41
- right: 15px;
42
- }
43
-
44
- #nprogress .spinner-icon {
45
- width: 18px;
46
- height: 18px;
47
- box-sizing: border-box;
48
-
49
- border: solid 2px transparent;
50
- border-top-color: @primary-color;
51
- border-left-color: @primary-color;
52
- border-radius: 50%;
53
-
54
- -webkit-animation: nprogress-spinner 400ms linear infinite;
55
- animation: nprogress-spinner 400ms linear infinite;
56
- }
57
-
58
- .nprogress-custom-parent {
59
- overflow: hidden;
60
- position: relative;
61
- }
62
-
63
- .nprogress-custom-parent #nprogress .spinner,
64
- .nprogress-custom-parent #nprogress .bar {
65
- position: absolute;
66
- }
67
-
68
- @-webkit-keyframes nprogress-spinner {
69
- 0% { -webkit-transform: rotate(0deg); }
70
- 100% { -webkit-transform: rotate(360deg); }
71
- }
72
- @keyframes nprogress-spinner {
73
- 0% { transform: rotate(0deg); }
74
- 100% { transform: rotate(360deg); }
75
- }
76
-
1
+ @import '~ant-design-vue/lib/style/themes/default';
2
+
3
+ /* Make clicks pass-through */
4
+ #nprogress {
5
+ pointer-events: none;
6
+ }
7
+
8
+ #nprogress .bar {
9
+ background: @primary-color;
10
+
11
+ position: fixed;
12
+ z-index: 1031;
13
+ top: 0;
14
+ left: 0;
15
+
16
+ width: 100%;
17
+ height: 2px;
18
+ }
19
+
20
+ /* Fancy blur effect */
21
+ #nprogress .peg {
22
+ display: block;
23
+ position: absolute;
24
+ right: 0;
25
+ width: 100px;
26
+ height: 100%;
27
+ box-shadow: 0 0 10px @primary-color, 0 0 5px @primary-color;
28
+ opacity: 1.0;
29
+
30
+ -webkit-transform: rotate(3deg) translate(0px, -4px);
31
+ -ms-transform: rotate(3deg) translate(0px, -4px);
32
+ transform: rotate(3deg) translate(0px, -4px);
33
+ }
34
+
35
+ /* Remove these to get rid of the spinner */
36
+ #nprogress .spinner {
37
+ display: block;
38
+ position: fixed;
39
+ z-index: 1031;
40
+ top: 15px;
41
+ right: 15px;
42
+ }
43
+
44
+ #nprogress .spinner-icon {
45
+ width: 18px;
46
+ height: 18px;
47
+ box-sizing: border-box;
48
+
49
+ border: solid 2px transparent;
50
+ border-top-color: @primary-color;
51
+ border-left-color: @primary-color;
52
+ border-radius: 50%;
53
+
54
+ -webkit-animation: nprogress-spinner 400ms linear infinite;
55
+ animation: nprogress-spinner 400ms linear infinite;
56
+ }
57
+
58
+ .nprogress-custom-parent {
59
+ overflow: hidden;
60
+ position: relative;
61
+ }
62
+
63
+ .nprogress-custom-parent #nprogress .spinner,
64
+ .nprogress-custom-parent #nprogress .bar {
65
+ position: absolute;
66
+ }
67
+
68
+ @-webkit-keyframes nprogress-spinner {
69
+ 0% { -webkit-transform: rotate(0deg); }
70
+ 100% { -webkit-transform: rotate(360deg); }
71
+ }
72
+ @keyframes nprogress-spinner {
73
+ 0% { transform: rotate(0deg); }
74
+ 100% { transform: rotate(360deg); }
75
+ }
76
+
@@ -1,103 +1,103 @@
1
- const varyColor = require('webpack-theme-color-replacer/client/varyColor')
2
- const { generate } = require('@ant-design/colors')
3
- const { ADMIN, ANTD } = require('../config/default')
4
- const Config = require('../config')
5
-
6
- const themeMode = ADMIN.theme.mode
7
-
8
- // 获取 ant design 色系
9
- function getAntdColors (color, mode) {
10
- const options = mode && (mode == themeMode.NIGHT) ? { theme: 'dark' } : undefined
11
- return generate(color, options)
12
- }
13
-
14
- // 获取功能性颜色
15
- function getFunctionalColors (mode) {
16
- const options = mode && (mode == themeMode.NIGHT) ? { theme: 'dark' } : undefined
17
- let { success, warning, error } = ANTD.primary
18
- const { success: s1, warning: w1, error: e1 } = Config.theme
19
- success = success && s1
20
- warning = success && w1
21
- error = success && e1
22
- const successColors = generate(success, options)
23
- const warningColors = generate(warning, options)
24
- const errorColors = generate(error, options)
25
- return {
26
- success: successColors,
27
- warning: warningColors,
28
- error: errorColors
29
- }
30
- }
31
-
32
- // 获取菜单色系
33
- function getMenuColors (color, mode) {
34
- if (mode == themeMode.NIGHT) {
35
- return ANTD.primary.night.menuColors
36
- } else if (color == ANTD.primary.color) {
37
- return ANTD.primary.dark.menuColors
38
- } else {
39
- return [varyColor.darken(color, 0.93), varyColor.darken(color, 0.83), varyColor.darken(color, 0.73)]
40
- }
41
- }
42
-
43
- // 获取主题模式切换色系
44
- function getThemeToggleColors (color, mode) {
45
- // 主色系
46
- const mainColors = getAntdColors(color, mode)
47
- const primary = mainColors[5]
48
- // 辅助色系,因为 antd 目前没针对夜间模式设计,所以增加辅助色系以保证夜间模式的正常切换
49
- const subColors = getAntdColors(primary, themeMode.LIGHT)
50
- // 菜单色系
51
- const menuColors = getMenuColors(color, mode)
52
- // 内容色系(包含背景色、文字颜色等)
53
- const themeCfg = ANTD.theme[mode]
54
- let contentColors = Object.keys(themeCfg)
55
- .map(key => themeCfg[key])
56
- .map(color => isHex(color) ? color : toNum3(color).join(','))
57
- // 内容色去重
58
- contentColors = [...new Set(contentColors)]
59
- // rgb 格式的主题色
60
- const rgbColors = [toNum3(primary).join(',')]
61
- const functionalColors = getFunctionalColors(mode)
62
- return { primary, mainColors, subColors, menuColors, contentColors, rgbColors, functionalColors }
63
- }
64
-
65
- function toNum3 (color) {
66
- if (isHex(color)) {
67
- return varyColor.toNum3(color)
68
- }
69
- let colorStr = ''
70
- if (isRgb(color)) {
71
- colorStr = color.slice(5, color.length)
72
- } else if (isRgba(color)) {
73
- colorStr = color.slice(6, color.lastIndexOf(','))
74
- }
75
- const rgb = colorStr.split(',')
76
- const r = parseInt(rgb[0])
77
- const g = parseInt(rgb[1])
78
- const b = parseInt(rgb[2])
79
- return [r, g, b]
80
- }
81
-
82
- function isHex (color) {
83
- return color.length >= 4 && color[0] == '#'
84
- }
85
-
86
- function isRgb (color) {
87
- return color.length >= 10 && color.slice(0, 3) == 'rgb'
88
- }
89
-
90
- function isRgba (color) {
91
- return color.length >= 13 && color.slice(0, 4) == 'rgba'
92
- }
93
-
94
- module.exports = {
95
- isHex,
96
- isRgb,
97
- isRgba,
98
- toNum3,
99
- getAntdColors,
100
- getMenuColors,
101
- getThemeToggleColors,
102
- getFunctionalColors
103
- }
1
+ const varyColor = require('webpack-theme-color-replacer/client/varyColor')
2
+ const { generate } = require('@ant-design/colors')
3
+ const { ADMIN, ANTD } = require('../config/default')
4
+ const Config = require('../config')
5
+
6
+ const themeMode = ADMIN.theme.mode
7
+
8
+ // 获取 ant design 色系
9
+ function getAntdColors (color, mode) {
10
+ const options = mode && (mode === themeMode.NIGHT) ? { theme: 'dark' } : undefined
11
+ return generate(color, options)
12
+ }
13
+
14
+ // 获取功能性颜色
15
+ function getFunctionalColors (mode) {
16
+ const options = mode && (mode === themeMode.NIGHT) ? { theme: 'dark' } : undefined
17
+ let { success, warning, error } = ANTD.primary
18
+ const { success: s1, warning: w1, error: e1 } = Config.theme
19
+ success = success && s1
20
+ warning = success && w1
21
+ error = success && e1
22
+ const successColors = generate(success, options)
23
+ const warningColors = generate(warning, options)
24
+ const errorColors = generate(error, options)
25
+ return {
26
+ success: successColors,
27
+ warning: warningColors,
28
+ error: errorColors
29
+ }
30
+ }
31
+
32
+ // 获取菜单色系
33
+ function getMenuColors (color, mode) {
34
+ if (mode === themeMode.NIGHT) {
35
+ return ANTD.primary.night.menuColors
36
+ } else if (color === ANTD.primary.color) {
37
+ return ANTD.primary.dark.menuColors
38
+ } else {
39
+ return [varyColor.darken(color, 0.93), varyColor.darken(color, 0.83), varyColor.darken(color, 0.73)]
40
+ }
41
+ }
42
+
43
+ // 获取主题模式切换色系
44
+ function getThemeToggleColors (color, mode) {
45
+ // 主色系
46
+ const mainColors = getAntdColors(color, mode)
47
+ const primary = mainColors[5]
48
+ // 辅助色系,因为 antd 目前没针对夜间模式设计,所以增加辅助色系以保证夜间模式的正常切换
49
+ const subColors = getAntdColors(primary, themeMode.LIGHT)
50
+ // 菜单色系
51
+ const menuColors = getMenuColors(color, mode)
52
+ // 内容色系(包含背景色、文字颜色等)
53
+ const themeCfg = ANTD.theme[mode]
54
+ let contentColors = Object.keys(themeCfg)
55
+ .map(key => themeCfg[key])
56
+ .map(color => isHex(color) ? color : toNum3(color).join(','))
57
+ // 内容色去重
58
+ contentColors = [...new Set(contentColors)]
59
+ // rgb 格式的主题色
60
+ const rgbColors = [toNum3(primary).join(',')]
61
+ const functionalColors = getFunctionalColors(mode)
62
+ return { primary, mainColors, subColors, menuColors, contentColors, rgbColors, functionalColors }
63
+ }
64
+
65
+ function toNum3 (color) {
66
+ if (isHex(color)) {
67
+ return varyColor.toNum3(color)
68
+ }
69
+ let colorStr = ''
70
+ if (isRgb(color)) {
71
+ colorStr = color.slice(5, color.length)
72
+ } else if (isRgba(color)) {
73
+ colorStr = color.slice(6, color.lastIndexOf(','))
74
+ }
75
+ const rgb = colorStr.split(',')
76
+ const r = parseInt(rgb[0])
77
+ const g = parseInt(rgb[1])
78
+ const b = parseInt(rgb[2])
79
+ return [r, g, b]
80
+ }
81
+
82
+ function isHex (color) {
83
+ return color.length >= 4 && color[0] === '#'
84
+ }
85
+
86
+ function isRgb (color) {
87
+ return color.length >= 10 && color.slice(0, 3) === 'rgb'
88
+ }
89
+
90
+ function isRgba (color) {
91
+ return color.length >= 13 && color.slice(0, 4) === 'rgba'
92
+ }
93
+
94
+ module.exports = {
95
+ isHex,
96
+ isRgb,
97
+ isRgba,
98
+ toNum3,
99
+ getAntdColors,
100
+ getMenuColors,
101
+ getThemeToggleColors,
102
+ getFunctionalColors
103
+ }
@@ -31,41 +31,40 @@
31
31
  // Internally we use a BlobBuilder implementation to base Blob off of
32
32
  // in order to support older browsers that only have BlobBuilder
33
33
  const BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function (view) {
34
- var
35
- get_class = function (object) {
36
- return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
37
- }
38
- , FakeBlobBuilder = function BlobBuilder() {
39
- this.data = [];
40
- }
41
- , FakeBlob = function Blob(data, type, encoding) {
42
- this.data = data;
43
- this.size = data.length;
44
- this.type = type;
45
- this.encoding = encoding;
46
- }
47
- , FBB_proto = FakeBlobBuilder.prototype
48
- , FB_proto = FakeBlob.prototype
49
- , FileReaderSync = view.FileReaderSync
50
- , FileException = function (type) {
51
- this.code = this[this.name = type];
52
- }
53
- , file_ex_codes = (
54
- "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
55
- + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
56
- ).split(" ")
57
- , file_ex_code = file_ex_codes.length
58
- , real_URL = view.URL || view.webkitURL || view
59
- , real_create_object_URL = real_URL.createObjectURL
60
- , real_revoke_object_URL = real_URL.revokeObjectURL
61
- , URL = real_URL
62
- , btoa = view.btoa
63
- , atob = view.atob
34
+ const get_class = function (object) {
35
+ return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
36
+ }
37
+ , FakeBlobBuilder = function BlobBuilder() {
38
+ this.data = [];
39
+ }
40
+ , FakeBlob = function Blob(data, type, encoding) {
41
+ this.data = data;
42
+ this.size = data.length;
43
+ this.type = type;
44
+ this.encoding = encoding;
45
+ }
46
+ , FBB_proto = FakeBlobBuilder.prototype
47
+ , FB_proto = FakeBlob.prototype
48
+ , FileReaderSync = view.FileReaderSync
49
+ , FileException = function (type) {
50
+ this.code = this[this.name = type];
51
+ }
52
+ , file_ex_codes = (
53
+ "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
54
+ + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
55
+ ).split(" ")
56
+ ;let file_ex_code = file_ex_codes.length
57
+ ;const real_URL = view.URL || view.webkitURL || view
58
+ , real_create_object_URL = real_URL.createObjectURL
59
+ , real_revoke_object_URL = real_URL.revokeObjectURL
60
+ ;let URL = real_URL
61
+ ;const btoa = view.btoa
62
+ , atob = view.atob
64
63
 
65
- , ArrayBuffer = view.ArrayBuffer
66
- , Uint8Array = view.Uint8Array
67
- ;
68
- FakeBlob.fake = FB_proto.fake = true;
64
+ , ArrayBuffer = view.ArrayBuffer
65
+ , Uint8Array = view.Uint8Array
66
+ ;
67
+ FakeBlob.fake = FB_proto.fake = true;
69
68
  while (file_ex_code--) {
70
69
  FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
71
70
  }
@@ -73,11 +72,10 @@
73
72
  URL = view.URL = {};
74
73
  }
75
74
  URL.createObjectURL = function (blob) {
76
- var
77
- type = blob.type
78
- , data_URI_header
79
- ;
80
- if (type === null) {
75
+ let type = blob.type
76
+ , data_URI_header
77
+ ;
78
+ if (type === null) {
81
79
  type = "application/octet-stream";
82
80
  }
83
81
  if (blob instanceof FakeBlob) {
@@ -102,16 +100,15 @@
102
100
  }
103
101
  };
104
102
  FBB_proto.append = function (data/*, endings*/) {
105
- var bb = this.data;
106
- // decode data to a binary string
103
+ const bb = this.data;
104
+ // decode data to a binary string
107
105
  if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
108
- var
109
- str = ""
110
- , buf = new Uint8Array(data)
111
- , i = 0
112
- , buf_len = buf.length
113
- ;
114
- for (; i < buf_len; i++) {
106
+ let str = ""
107
+ ;const buf = new Uint8Array(data)
108
+ ;let i = 0
109
+ ;const buf_len = buf.length
110
+ ;
111
+ for (; i < buf_len; i++) {
115
112
  str += String.fromCharCode(buf[i]);
116
113
  }
117
114
  bb.push(str);
@@ -149,8 +146,8 @@
149
146
  return "[object BlobBuilder]";
150
147
  };
151
148
  FB_proto.slice = function (start, end, type) {
152
- var args = arguments.length;
153
- if (args < 3) {
149
+ const args = arguments.length;
150
+ if (args < 3) {
154
151
  type = null;
155
152
  }
156
153
  return new FakeBlob(
@@ -169,10 +166,12 @@
169
166
  }(view));
170
167
 
171
168
  view.Blob = function Blob(blobParts, options) {
172
- var type = options ? (options.type || "") : "";
173
- var builder = new BlobBuilder();
174
- if (blobParts) {
175
- for (var i = 0, len = blobParts.length; i < len; i++) {
169
+ const type = options ? (options.type || "") : "";
170
+ const builder = new BlobBuilder();
171
+ if (blobParts) {
172
+ let i = 0;
173
+ const len = blobParts.length;
174
+ for (; i < len; i++) {
176
175
  builder.append(blobParts[i]);
177
176
  }
178
177
  }