bkui-vue 0.0.1-beta.45 → 0.0.1-beta.46

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 (91) hide show
  1. package/dist/index.cjs.js +26 -26
  2. package/dist/index.esm.js +388 -95
  3. package/dist/index.umd.js +27 -27
  4. package/dist/style.css +1 -1
  5. package/lib/button/index.js +1 -1
  6. package/lib/dialog/dialog.css +3 -0
  7. package/lib/dialog/dialog.d.ts +89 -17
  8. package/lib/dialog/dialog.less +4 -0
  9. package/lib/dialog/dialog.variable.css +3 -0
  10. package/lib/dialog/index.d.ts +191 -36
  11. package/lib/dialog/index.js +1 -1
  12. package/lib/icon/funnel.d.ts +4 -0
  13. package/lib/icon/funnel.js +1 -0
  14. package/lib/icon/index.d.ts +1 -0
  15. package/lib/modal/index.d.ts +149 -1
  16. package/lib/modal/modal.css +20 -0
  17. package/lib/modal/modal.d.ts +58 -0
  18. package/lib/modal/modal.less +25 -0
  19. package/lib/modal/modal.variable.css +20 -0
  20. package/lib/modal/props.mixin.d.ts +26 -0
  21. package/lib/popover/index.d.ts +33 -2
  22. package/lib/popover/popover.d.ts +16 -1
  23. package/lib/popover/props.d.ts +12 -0
  24. package/lib/sideslider/index.d.ts +123 -1
  25. package/lib/sideslider/sideslider.d.ts +58 -0
  26. package/lib/switcher/switcher.less +2 -0
  27. package/lib/tab/index.d.ts +1 -1
  28. package/lib/tab/tab-panel.d.ts +1 -1
  29. package/lib/table/plugins/head-filter.css +68 -0
  30. package/lib/table/plugins/head-filter.less +83 -0
  31. package/lib/table/plugins/head-filter.variable.css +162 -0
  32. package/lib/table/plugins/head-sort.css +22 -0
  33. package/lib/table/plugins/head-sort.less +28 -0
  34. package/lib/table/plugins/head-sort.variable.css +116 -0
  35. package/lib/table/props.d.ts +8 -1
  36. package/lib/table/render.d.ts +10 -15
  37. package/lib/table/table.css +4 -26
  38. package/lib/table/table.d.ts +1 -0
  39. package/lib/table/table.less +7 -27
  40. package/lib/table/table.variable.css +4 -26
  41. package/lib/table/utils.d.ts +10 -1
  42. package/package.json +29 -16
  43. package/lib/icon/index.js +0 -1
  44. package/lib/icon/info-line.js +0 -1
  45. package/lib/icon/info.js +0 -1
  46. package/lib/icon/left-shape.js +0 -1
  47. package/lib/icon/play-shape.js +0 -1
  48. package/lib/icon/plus.js +0 -1
  49. package/lib/icon/qq.js +0 -1
  50. package/lib/icon/right-shape.js +0 -1
  51. package/lib/icon/search.js +0 -1
  52. package/lib/icon/share.js +0 -1
  53. package/lib/icon/spinner.js +0 -1
  54. package/lib/icon/success.js +0 -1
  55. package/lib/icon/switcher-loading.js +0 -1
  56. package/lib/icon/text-file.js +0 -1
  57. package/lib/icon/tree-application-shape.js +0 -1
  58. package/lib/icon/unvisible.js +0 -1
  59. package/lib/icon/up-shape.js +0 -1
  60. package/lib/icon/warn.js +0 -1
  61. package/lib/icon/weixin.js +0 -1
  62. package/lib/input/index.js +0 -1
  63. package/lib/link/index.js +0 -1
  64. package/lib/loading/index.js +0 -1
  65. package/lib/menu/index.js +0 -1
  66. package/lib/message/index.js +0 -1
  67. package/lib/modal/index.js +0 -1
  68. package/lib/navigation/index.js +0 -1
  69. package/lib/notify/index.js +0 -1
  70. package/lib/pagination/index.js +0 -1
  71. package/lib/popover/index.js +0 -1
  72. package/lib/process/index.js +0 -1
  73. package/lib/progress/index.js +0 -1
  74. package/lib/radio/index.js +0 -1
  75. package/lib/rate/index.js +0 -1
  76. package/lib/resize-layout/index.js +0 -1
  77. package/lib/select/index.js +0 -1
  78. package/lib/shared/index.js +0 -1
  79. package/lib/sideslider/index.js +0 -1
  80. package/lib/slider/index.js +0 -1
  81. package/lib/steps/index.js +0 -1
  82. package/lib/swiper/index.js +0 -1
  83. package/lib/switcher/index.js +0 -1
  84. package/lib/tab/index.js +0 -1
  85. package/lib/table/index.js +0 -1
  86. package/lib/tag/index.js +0 -1
  87. package/lib/tag-input/index.js +0 -1
  88. package/lib/timeline/index.js +0 -1
  89. package/lib/transfer/index.js +0 -1
  90. package/lib/tree/index.js +0 -1
  91. package/lib/virtual-render/index.js +0 -1
@@ -0,0 +1,116 @@
1
+ :root {
2
+ --bk-prefix: bk;
3
+ --popover-max-height: 216px;
4
+ --primary-color: #3a84ff;
5
+ --success-color: #2dcb56;
6
+ --warning-color: #ff9c01;
7
+ --danger-color: #ea3636;
8
+ --default-color: #63656e;
9
+ --gray-color: #979ba5;
10
+ --light-gray: #c4c6cc;
11
+ --white-color: white;
12
+ --disable-color: #dcdee5;
13
+ --font-size-base: 12px;
14
+ --font-size-medium: 14px;
15
+ --font-size-large: 16px;
16
+ --line-height-base: 16px;
17
+ --line-height-medium: 16px;
18
+ --line-height-large: 18px;
19
+ --component-size-small: 26px;
20
+ --component-size-base: 32px;
21
+ --component-size-large: 38px;
22
+ --border-width-base: 1px;
23
+ --border-style-base: solid;
24
+ --border-radius-base: 2px;
25
+ --input-disabled-bg: #fafbfd;
26
+ --input-disabled-border: var(--disable-color);
27
+ --input-height-base: var(--component-size-base);
28
+ --input-color: var(--default-color);
29
+ --input-bg: white;
30
+ --input-border-color: var(--light-gray);
31
+ --input-broder-radius: 3px;
32
+ --input-shadow-color: #a3c5fd;
33
+ --input-horizontal-padding: 10px;
34
+ --input-block-color: #f4f6fa;
35
+ --input-icon-size: var(--font-size-large);
36
+ --input-maxlength-color: #979ba5;
37
+ --button-primary-hover-color: #5594fa;
38
+ --button-danger-hover-color: #ff5656;
39
+ --button-success-hover-color: #45e35f;
40
+ --button-warning-hover-color: #ffb848;
41
+ --button-default-hover-border-color: #979ba5;
42
+ --button-primary-active-color: #2c77f4;
43
+ --button-danger-active-color: #db2626;
44
+ --button-success-active-color: #1ab943;
45
+ --button-warning-active-color: #eb9000;
46
+ --fixed-navbar-background: #fff;
47
+ --fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
48
+ --switch-default-color: #fff;
49
+ --switch-grey-color: #c4c6cc;
50
+ --breadcrumb-black-color: #979ba5;
51
+ --breadcrumb-primary-hover-color: #0082ff;
52
+ --breadcrumb-fn-main-color: #63656e;
53
+ --link-default-hover-color: #979ba5;
54
+ --link-primary-hover-color: #699df4;
55
+ --link-success-hover-color: #45e35f;
56
+ --link-warning-hover-color: #ffb848;
57
+ --link-danger-hover-color: #ff5656;
58
+ --link-default-disabled-color: #dcdee5;
59
+ --link-primary-disabled-color: #a3c5fd;
60
+ --link-success-disabled-color: #94f5a4;
61
+ --link-warning-disabled-color: #ffd695;
62
+ --link-danger-disabled-color: #fd9c9c;
63
+ --message-color: var(--default-color);
64
+ --message-primary-bg-color: #f0f8ff;
65
+ --message-primary-border-color: #e1ecff;
66
+ --message-warning-bg-color: #fff4e2;
67
+ --message-warning-border-color: #ffe8c3;
68
+ --message-success-bg-color: #f2fff4;
69
+ --message-success-border-color: #dcffe2;
70
+ --message-danger-bg-color: #ffeded;
71
+ --message-danger-border-color: #ffdddd;
72
+ --slider-default-bg: #dcdee5;
73
+ --slider-disable-bar-bg: #979ba5;
74
+ --menu-bg-color: #182132;
75
+ --submenu-bg-color: #151d2c;
76
+ --menu-active-bg-color: linear-gradient(90deg, #3f87ff 0%, #3a84ff 100%);
77
+ --menu-color: #96a2b9;
78
+ --menu-group-color: var(--default-color);
79
+ --menu-width: 260px;
80
+ --menu-collapse-width: 60px;
81
+ --menu-active-color: white;
82
+ --nav-header-bg-color: #182132;
83
+ --nav-bg-color: #182132;
84
+ --date-picker-disabled-bg: #fafbfd;
85
+ --date-picker-dropdown-mb: 4px;
86
+ --date-picker-dropdown-bg: #fff;
87
+ --table-bg-color: var(--white-color);
88
+ --table-border-color: #dcdee5;
89
+ --table-head-bg-color: #fafbfd;
90
+ --table-head-font-color: #313238;
91
+ --table-body-font-color: #575961;
92
+ --table-row-hover-bg-color: #f5f7fa;
93
+ --table-row-active-bg-color: #f0f1f5;
94
+ }
95
+ .bk-head-cell-sort {
96
+ display: flex;
97
+ flex-direction: column;
98
+ margin-left: 4px;
99
+ font-size: 10px;
100
+ }
101
+ .bk-head-cell-sort .sort-action {
102
+ display: flex;
103
+ width: 18px;
104
+ height: calc(var(--row-height)/2);
105
+ color: #c0c4cc;
106
+ cursor: pointer;
107
+ }
108
+ .bk-head-cell-sort .sort-action.active {
109
+ color: #3a84ff;
110
+ }
111
+ .bk-head-cell-sort .sort-action.sort-asc {
112
+ align-items: flex-end;
113
+ }
114
+ .bk-head-cell-sort .sort-action.sort-desc {
115
+ align-items: flex-start;
116
+ }
@@ -3,6 +3,10 @@ export declare enum SortScope {
3
3
  CURRENT = "current",
4
4
  ALL = "all"
5
5
  }
6
+ export declare type ColumnFilterListItem = {
7
+ text?: string;
8
+ value?: string;
9
+ };
6
10
  export declare const tableProps: {
7
11
  /**
8
12
  * 渲染列表
@@ -112,10 +116,13 @@ export declare type Column = {
112
116
  width?: number | string;
113
117
  type?: string;
114
118
  sort?: {
115
- sortby?: string;
116
119
  sortFn?: Function;
117
120
  sortScope?: string;
118
121
  } | boolean;
122
+ filter?: {
123
+ list?: any;
124
+ filterFn?: Function;
125
+ } | boolean;
119
126
  };
120
127
  export declare type Thead = {
121
128
  height?: Number;
@@ -2,12 +2,8 @@ import { TablePlugins } from './plugins/index';
2
2
  import { GroupColumn, IColumnActive, IReactiveProp, TablePropTypes } from './props';
3
3
  export declare const enum EVENTS {
4
4
  /** 点击排序事件 */
5
- ON_SORT_BY_CLICK = "onSortByClick"
6
- }
7
- /** 排序方式 */
8
- export declare const enum SortType {
9
- ASC = "asc",
10
- DESC = "desc"
5
+ ON_SORT_BY_CLICK = "onSortByClick",
6
+ ON_FILTER_CLICK = "onFilterClick"
11
7
  }
12
8
  export default class TableRender {
13
9
  props: TablePropTypes;
@@ -58,6 +54,14 @@ export default class TableRender {
58
54
  * @param index 当前选中列Index
59
55
  */
60
56
  private handleColumnHeadClick;
57
+ /**
58
+ * 获取排序设置表头
59
+ * @param column 当前渲染排序列
60
+ * @param index 排序列所在index
61
+ * @returns
62
+ */
63
+ private getSortCell;
64
+ private getFilterCell;
61
65
  /**
62
66
  * 渲染Table Header
63
67
  * @returns
@@ -85,15 +89,6 @@ export default class TableRender {
85
89
  * @param rows
86
90
  */
87
91
  private handleRowDblClick;
88
- /**
89
- * 获取当前行指定列的内容
90
- * @param row 当前行
91
- * @param key 指定列名
92
- * @param column 列配置
93
- * @param index 当前行Index
94
- * @returns
95
- */
96
- private getRowText;
97
92
  /**
98
93
  * 渲染表格Cell内容
99
94
  * @param row 当前行
@@ -48,32 +48,10 @@
48
48
  .bk-table .bk-table-body table thead th:hover {
49
49
  background: #f0f1f5;
50
50
  }
51
- .bk-table .bk-table-head table thead th .head-cell-sort,
52
- .bk-table .bk-table-body table thead th .head-cell-sort {
53
- display: flex;
54
- flex-direction: column;
55
- margin-left: 4px;
56
- font-size: 10px;
57
- }
58
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action,
59
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action {
60
- display: flex;
61
- width: 18px;
62
- height: calc(var(--row-height)/2);
63
- color: #c0c4cc;
64
- cursor: pointer;
65
- }
66
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action.active,
67
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action.active {
68
- color: #3a84ff;
69
- }
70
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action.sort-asc,
71
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action.sort-asc {
72
- align-items: flex-end;
73
- }
74
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action.sort-desc,
75
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action.sort-desc {
76
- align-items: flex-start;
51
+ .bk-table .bk-table-head table tbody tr td .cell,
52
+ .bk-table .bk-table-body table tbody tr td .cell {
53
+ display: inline-block;
54
+ width: 100%;
77
55
  }
78
56
  .bk-table .bk-table-head table tbody tr:hover td,
79
57
  .bk-table .bk-table-body table tbody tr:hover td {
@@ -1,4 +1,5 @@
1
1
  import { Column } from './props';
2
+ import './plugins/head-filter.less';
2
3
  declare const _default: import("vue").DefineComponent<{
3
4
  data: import("vue-types").VueTypeDef<any[]> & {
4
5
  default: () => any[];
@@ -44,38 +44,18 @@
44
44
  &:hover {
45
45
  background: @table-row-active-bg-color;
46
46
  }
47
-
48
- .head-cell-sort {
49
- display: flex;
50
- flex-direction: column;
51
- margin-left: 4px;
52
- font-size: 10px;
53
-
54
- .sort-action {
55
- display: flex;
56
- width: 18px;
57
- height: calc(var(--row-height)/2);
58
- color: #c0c4cc;
59
- cursor: pointer;
60
-
61
- &.active {
62
- color: #3a84ff;
63
- }
64
-
65
- &.sort-asc {
66
- align-items: flex-end;
67
- }
68
-
69
- &.sort-desc {
70
- align-items: flex-start;
71
- }
72
- }
73
- }
74
47
  }
75
48
  }
76
49
 
77
50
  tbody {
78
51
  tr {
52
+ td {
53
+ .cell {
54
+ display: inline-block;
55
+ width: 100%;
56
+ }
57
+ }
58
+
79
59
  &:hover {
80
60
  td {
81
61
  background: @table-row-hover-bg-color;
@@ -142,32 +142,10 @@
142
142
  .bk-table .bk-table-body table thead th:hover {
143
143
  background: var(--table-row-active-bg-color);
144
144
  }
145
- .bk-table .bk-table-head table thead th .head-cell-sort,
146
- .bk-table .bk-table-body table thead th .head-cell-sort {
147
- display: flex;
148
- flex-direction: column;
149
- margin-left: 4px;
150
- font-size: 10px;
151
- }
152
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action,
153
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action {
154
- display: flex;
155
- width: 18px;
156
- height: calc(var(--row-height)/2);
157
- color: #c0c4cc;
158
- cursor: pointer;
159
- }
160
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action.active,
161
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action.active {
162
- color: #3a84ff;
163
- }
164
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action.sort-asc,
165
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action.sort-asc {
166
- align-items: flex-end;
167
- }
168
- .bk-table .bk-table-head table thead th .head-cell-sort .sort-action.sort-desc,
169
- .bk-table .bk-table-body table thead th .head-cell-sort .sort-action.sort-desc {
170
- align-items: flex-start;
145
+ .bk-table .bk-table-head table tbody tr td .cell,
146
+ .bk-table .bk-table-body table tbody tr td .cell {
147
+ display: inline-block;
148
+ width: 100%;
171
149
  }
172
150
  .bk-table .bk-table-head table tbody tr:hover td,
173
151
  .bk-table .bk-table-body table tbody tr:hover td {
@@ -1,4 +1,4 @@
1
- import { GroupColumn, TablePropTypes } from './props';
1
+ import { Column, GroupColumn, TablePropTypes } from './props';
2
2
  /**
3
3
  * 解析Prop值 | 可能为多种类型 & 函数返回的场景
4
4
  * @param prop 当前Prop
@@ -80,3 +80,12 @@ export declare const resolveHeadConfig: (props: TablePropTypes) => {
80
80
  isShow?: boolean;
81
81
  cellFn?: Function;
82
82
  };
83
+ /**
84
+ * 获取当前行指定列的内容
85
+ * @param row 当前行
86
+ * @param key 指定列名
87
+ * @param column 列配置
88
+ * @param index 当前行Index
89
+ * @returns
90
+ */
91
+ export declare const getRowText: (row: any, key: string, column: Column) => any;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.45",
3
+ "version": "0.0.1-beta.46",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",
7
- "scripts/cli"
7
+ "scripts/*"
8
8
  ]
9
9
  },
10
10
  "files": [
@@ -14,19 +14,26 @@
14
14
  "scripts": {
15
15
  "prepare": "husky install",
16
16
  "dev": "vite serve site",
17
- "build": "yarn build:dist && yarn build:lib",
17
+ "build": "run-p build:dist build:lib",
18
18
  "build:site": "vite build site --mode development",
19
19
  "build:dist": "rimraf dist && lerna run --stream --scope cli dist",
20
20
  "build:lib": "rimraf lib && lerna run --stream --scope cli lib",
21
21
  "help:release": "lerna run --stream --scope cli release",
22
- "release": "yarn build && yarn help:release",
22
+ "release": "run-s build help:release",
23
23
  "analyze:lib": "rimraf lib && lerna run --stream --scope cli lib -- -a",
24
24
  "generate:icon": "lerna run --scope @bkui-vue/icon build",
25
25
  "changelog": "conventional-changelog -c .changelog.config.js -p angular -i CHANGELOG.md -s -l",
26
- "lint": "eslint --ext .js,.ts,.tsx,.vue ./packages ./site ",
27
- "lint:style": "stylelint --fix ./packages/**/*.{css,less} --custom-syntax",
28
- "lint:fix": "eslint --fix ./packages ./site --ext .js,.ts,.tsx,.vue",
29
- "test:unit": "jest --passWithNoTests",
26
+ "lint:packages": "eslint ./packages --ext .js,.ts,.tsx --cache",
27
+ "lint:site": "eslint ./site --ext .js,.ts,.tsx,.vue --cache",
28
+ "lint:scripts": "eslint ./scripts --ext .js,.ts,.tsx --cache",
29
+ "lint": "run-p lint:site lint:packages lint:scripts",
30
+ "fix:packages": "eslint ./packages --ext .js,.ts,.tsx --fix --cache",
31
+ "fix:site": "eslint ./site --ext .js,.ts,.tsx,.vue --fix --cache",
32
+ "fix:scripts": "eslint ./scripts --ext .js,.ts,.tsx --fix --cache",
33
+ "lint:fix": "run-p lint:site lint:packages lint:scripts",
34
+ "stylelint": "eslint --ext .js,.ts,.tsx,.vue ./packages ./site --cache",
35
+ "stylelint:fix": "yarn stylelint -- --fix",
36
+ "test:unit": "jest --passWithNoTests --config=./jest.config.js",
30
37
  "cz": "git-cz"
31
38
  },
32
39
  "devDependencies": {
@@ -34,14 +41,12 @@
34
41
  "@commitlint/config-conventional": "~16.2.1",
35
42
  "@types/jest": "~27.4.1",
36
43
  "@types/node": "~17.0.23",
44
+ "@types/postcss-less": "~4.0.2",
37
45
  "@typescript-eslint/eslint-plugin": "~5.19.0",
38
46
  "@typescript-eslint/parser": "~5.19.0",
39
47
  "@vitejs/plugin-vue": "~2.3.1",
40
48
  "@vitejs/plugin-vue-jsx": "~1.3.9",
41
49
  "@vue/babel-plugin-jsx": "~1.1.1",
42
- "@vue/babel-preset-jsx": "~1.2.4",
43
- "@vue/compiler-sfc": "~3.2.31",
44
- "@vue/component-compiler-utils": "~3.3.0",
45
50
  "@vue/eslint-config-standard": "~6.1.0",
46
51
  "@vue/eslint-config-typescript": "~10.0.0",
47
52
  "@vue/test-utils": "~2.0.0-rc.12",
@@ -69,11 +74,16 @@
69
74
  "lint-staged": "~12.3.7",
70
75
  "markdown-it-container": "~3.0.0",
71
76
  "normalize-wheel": "~1.0.1",
77
+ "npm-run-all": "~4.1.5",
72
78
  "plop": "~3.0.5",
79
+ "postcss": "~8.4.12",
80
+ "postcss-html": "~1.4.1",
81
+ "postcss-less": "~6.0.0",
73
82
  "prettier": "~2.6.2",
74
83
  "prismjs": "~1.27.0",
75
84
  "rimraf": "~3.0.2",
76
85
  "stylelint": "~14.6.1",
86
+ "stylelint-config-recommended-vue": "~1.4.0",
77
87
  "stylelint-order": "~5.0.0",
78
88
  "stylelint-scss": "~4.2.0",
79
89
  "ts-jest": "~27.1.4",
@@ -82,6 +92,7 @@
82
92
  "vite": "~2.9.1",
83
93
  "vite-plugin-md": "~0.12.4",
84
94
  "vue": "^3.2.0",
95
+ "vue-eslint-parser": "~8.3.0",
85
96
  "vue-router": "~4.0.14",
86
97
  "vue-types": "~4.1.1"
87
98
  },
@@ -93,11 +104,13 @@
93
104
  "module": "dist/bkui-vue.esm.js",
94
105
  "typings": "./lib/index.d.ts",
95
106
  "lint-staged": {
96
- "*.css": "stylelint",
97
- "*.less": "stylelint --fix --customSyntax=postcss-less",
98
- "*.{js,ts,tsx,vue}": [
99
- "eslint --fix",
100
- "git add ."
107
+ "*.(vue|ts|tsx|js)": [
108
+ "eslint --ext .js,.tsx,.ts,.vue --cache --fix",
109
+ "git add"
110
+ ],
111
+ "*.(vue|scss|css|sass)": [
112
+ "stylelint --cache --fix",
113
+ "git add"
101
114
  ]
102
115
  },
103
116
  "config": {