@king-design/intact 3.3.2 → 3.4.0-beta.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.
- package/components/button/demos/basic.md +5 -2
- package/components/button/demos/ghost.md +1 -0
- package/components/button/demos/group.md +7 -0
- package/components/button/group.ts +2 -0
- package/components/button/index.md +1 -0
- package/components/button/index.ts +2 -0
- package/components/button/index.vdt +12 -7
- package/components/button/styles.ts +31 -1
- package/components/dialog/alert.vdt +2 -3
- package/components/dialog/demos/static.md +18 -0
- package/components/switch/demos/beforeChange.md +52 -0
- package/components/switch/index.md +2 -0
- package/components/switch/index.spec.ts +11 -0
- package/components/switch/index.ts +28 -6
- package/components/switch/index.vdt +8 -2
- package/components/switch/styles.ts +15 -1
- package/components/table/cell.vdt +6 -1
- package/components/table/column.ts +2 -0
- package/components/table/column.vdt +2 -1
- package/components/table/demos/hidden.md +44 -0
- package/components/table/index.md +1 -0
- package/components/table/index.spec.ts +63 -0
- package/components/table/styles.ts +6 -3
- package/components/table/table.vdt +4 -2
- package/components/table/useChecked.ts +2 -1
- package/components/table/useColumns.ts +1 -1
- package/components/table/useDisableRow.ts +3 -1
- package/components/table/useMerge.ts +6 -1
- package/components/utils.ts +19 -0
- package/es/components/button/group.d.ts +1 -0
- package/es/components/button/group.js +2 -1
- package/es/components/button/index.d.ts +1 -0
- package/es/components/button/index.js +1 -0
- package/es/components/button/index.vdt.js +13 -6
- package/es/components/button/styles.d.ts +1 -1
- package/es/components/button/styles.js +3 -3
- package/es/components/dialog/alert.vdt.js +2 -2
- package/es/components/switch/index.d.ts +3 -1
- package/es/components/switch/index.js +65 -13
- package/es/components/switch/index.spec.js +21 -0
- package/es/components/switch/index.vdt.js +14 -4
- package/es/components/switch/styles.js +12 -7
- package/es/components/table/cell.vdt.js +3 -1
- package/es/components/table/column.d.ts +1 -0
- package/es/components/table/column.js +1 -0
- package/es/components/table/column.vdt.js +3 -2
- package/es/components/table/index.spec.js +313 -221
- package/es/components/table/styles.js +1 -1
- package/es/components/table/table.vdt.js +1 -1
- package/es/components/table/useChecked.js +3 -1
- package/es/components/table/useColumns.js +1 -1
- package/es/components/table/useDisableRow.js +3 -1
- package/es/components/table/useMerge.js +6 -1
- package/es/components/utils.js +17 -0
- package/es/i18n/en-US.js +6 -2
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/basic/react.js +7 -1
- package/es/site/data/components/button/demos/ghost/react.js +3 -0
- package/es/site/data/components/button/demos/group/react.js +17 -0
- package/es/site/data/components/dialog/demos/static/index.d.ts +1 -0
- package/es/site/data/components/dialog/demos/static/index.js +15 -0
- package/es/site/data/components/dialog/demos/static/react.d.ts +1 -0
- package/es/site/data/components/dialog/demos/static/react.js +18 -1
- package/es/site/data/components/popover/demos/tooltip/index.d.ts +7 -0
- package/es/site/data/components/popover/demos/tooltip/index.js +21 -0
- package/es/site/data/components/popover/demos/tooltip/react.d.ts +6 -0
- package/es/site/data/components/popover/demos/tooltip/react.js +30 -0
- package/es/site/data/components/switch/demos/beforeChange/index.d.ts +12 -0
- package/es/site/data/components/switch/demos/beforeChange/index.js +39 -0
- package/es/site/data/components/switch/demos/beforeChange/react.d.ts +11 -0
- package/es/site/data/components/switch/demos/beforeChange/react.js +62 -0
- package/es/site/data/components/table/demos/hidden/index.d.ts +14 -0
- package/es/site/data/components/table/demos/hidden/index.js +28 -0
- package/es/site/data/components/table/demos/hidden/react.d.ts +13 -0
- package/es/site/data/components/table/demos/hidden/react.js +63 -0
- package/i18n/en-US.ts +5 -2
- package/index.ts +2 -2
- package/package.json +2 -2
- package/components/menu/.DS_Store +0 -0
- package/components/menu/demos/.DS_Store +0 -0
|
@@ -90,7 +90,7 @@ setDefault(function () {
|
|
|
90
90
|
makeGroupMenuStyles == null || makeGroupMenuStyles.clearCache();
|
|
91
91
|
});
|
|
92
92
|
export var makeStyles = cache(function makeStyles(k) {
|
|
93
|
-
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
93
|
+
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-hidden{display:none;}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
94
94
|
return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
|
|
95
95
|
}), ">.", k, "-pagination{margin:16px 0;}&.", k, "-fix-header{min-height:0;.", k, "-table-wrapper{height:100%;}}");
|
|
96
96
|
});
|
|
@@ -84,7 +84,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
84
84
|
var onStart = this.resizable.start;
|
|
85
85
|
var colgroup = _$ce(2, 'colgroup', [checkType !== 'none' ? _$ce(2, 'col', null, 1, null, _$tmp0) : undefined, _$ma(cols, function ($value, $key) {
|
|
86
86
|
var _$cn2;
|
|
87
|
-
return _$ce(2, 'col', null, 1, _$cn((_$cn2 = {}, _$cn2[$value.className] = $value.className, _$cn2)), {
|
|
87
|
+
return _$ce(2, 'col', null, 1, _$cn((_$cn2 = {}, _$cn2[k + "-hidden"] = $value.hidden, _$cn2[$value.className] = $value.className, _$cn2)), {
|
|
88
88
|
'width': $value.width,
|
|
89
89
|
'style': {
|
|
90
90
|
width: getWidth($value.key)
|
|
@@ -4,6 +4,7 @@ import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/spl
|
|
|
4
4
|
import { useInstance } from 'intact';
|
|
5
5
|
import { watchState } from '../../hooks/useState';
|
|
6
6
|
import { toggleArray } from '../utils';
|
|
7
|
+
import { useReceive } from '../../hooks/useReceive';
|
|
7
8
|
export var AllCheckedStatus;
|
|
8
9
|
(function (AllCheckedStatus) {
|
|
9
10
|
AllCheckedStatus[AllCheckedStatus["All"] = 0] = "All";
|
|
@@ -176,7 +177,8 @@ export function useChecked(getEnableKeys, getAllKeys, isDisabledKey, getGrid, lo
|
|
|
176
177
|
function triggerEvent(isChecked, key, rowIndex) {
|
|
177
178
|
instance.trigger(isChecked ? 'checkRow' : 'uncheckRow', data.value[rowIndex], rowIndex, key);
|
|
178
179
|
}
|
|
179
|
-
instance.on('$receive:children', updateAllCheckedStatus);
|
|
180
|
+
// instance.on('$receive:children', updateAllCheckedStatus);
|
|
181
|
+
useReceive(['children'], updateAllCheckedStatus);
|
|
180
182
|
instance.on('$change:checkedKeys', updateAllCheckedStatus);
|
|
181
183
|
// for draggable
|
|
182
184
|
watchState(data, updateAllCheckedStatus);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useInstance } from 'intact';
|
|
2
2
|
import { watchState } from '../../hooks/useState';
|
|
3
|
+
import { useReceive } from '../../hooks/useReceive';
|
|
3
4
|
export function useDisableRow(loopData, data) {
|
|
4
5
|
var instance = useInstance();
|
|
5
6
|
var enabledKeys = [];
|
|
@@ -36,7 +37,8 @@ export function useDisableRow(loopData, data) {
|
|
|
36
37
|
function getAllKeys() {
|
|
37
38
|
return allKeys;
|
|
38
39
|
}
|
|
39
|
-
instance.on('$receive:children', setDisabledKeys);
|
|
40
|
+
// instance.on('$receive:children', setDisabledKeys);
|
|
41
|
+
useReceive(['children'], setDisabledKeys);
|
|
40
42
|
watchState(data, setDisabledKeys);
|
|
41
43
|
return {
|
|
42
44
|
isDisabled: isDisabled,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useInstance } from 'intact';
|
|
2
2
|
import { watchState } from '../../hooks/useState';
|
|
3
|
+
import { useReceive } from '../../hooks/useReceive';
|
|
3
4
|
export function useMerge(getCols, data) {
|
|
4
5
|
var instance = useInstance();
|
|
5
6
|
var grid = [];
|
|
@@ -58,7 +59,11 @@ export function useMerge(getCols, data) {
|
|
|
58
59
|
function getGrid() {
|
|
59
60
|
return grid;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
/**
|
|
63
|
+
* https://github.com/ksc-fe/kpc/issues/1008
|
|
64
|
+
*/
|
|
65
|
+
// instance.on('$receive:children', handleSpans);
|
|
66
|
+
useReceive(['children'], handleSpans);
|
|
62
67
|
watchState(data, handleSpans);
|
|
63
68
|
return {
|
|
64
69
|
getGrid: getGrid
|
package/es/components/utils.js
CHANGED
|
@@ -263,7 +263,24 @@ export function strPad(str, length, pad) {
|
|
|
263
263
|
}
|
|
264
264
|
return str;
|
|
265
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* 在vue3.0中,数组会转成Proxy对象,需要获取原始数据比较
|
|
268
|
+
* https://github.com/ksc-fe/kpc/issues/985
|
|
269
|
+
* https://github.com/vuejs/core/blob/main/packages/reactivity/src/reactive.ts
|
|
270
|
+
*/
|
|
271
|
+
var RAW = '__v_raw';
|
|
272
|
+
function isProxy(value) {
|
|
273
|
+
return value ? !!value[RAW] : false;
|
|
274
|
+
}
|
|
275
|
+
function toRaw(observed) {
|
|
276
|
+
var raw = observed && observed[RAW];
|
|
277
|
+
return raw ? toRaw(raw) : observed;
|
|
278
|
+
}
|
|
266
279
|
export function isEqualArray(a, b) {
|
|
280
|
+
if (a === b) return true;
|
|
281
|
+
// for vue3.0 Proxy object
|
|
282
|
+
if (isProxy(a)) a = toRaw(a);
|
|
283
|
+
if (isProxy(b)) b = toRaw(b);
|
|
267
284
|
if (a === b) return true;
|
|
268
285
|
if (Array.isArray(a) && Array.isArray(b)) {
|
|
269
286
|
if (a.length !== b.length) return false;
|
package/es/i18n/en-US.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _globalThis from "@babel/runtime-corejs3/core-js/global-this";
|
|
1
2
|
var i18n = {
|
|
2
3
|
// datepicker
|
|
3
4
|
'yearMonthFormat': 'MM YYYY',
|
|
@@ -107,6 +108,9 @@ var i18n = {
|
|
|
107
108
|
'复制': 'Copy'
|
|
108
109
|
};
|
|
109
110
|
export default i18n;
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
/**
|
|
112
|
+
* global does not exist in Vite, use standard object globalThis
|
|
113
|
+
*/
|
|
114
|
+
if (typeof _globalThis.Kpc !== 'undefined') {
|
|
115
|
+
_globalThis.Kpc.localize(i18n);
|
|
112
116
|
}
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.4.0-beta.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -63,4 +63,4 @@ export * from './components/treeSelect';
|
|
|
63
63
|
export * from './components/upload';
|
|
64
64
|
export * from './components/view';
|
|
65
65
|
export * from './components/wave';
|
|
66
|
-
export declare const version = "3.
|
|
66
|
+
export declare const version = "3.4.0-beta.0";
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.4.0-beta.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -64,5 +64,5 @@ export * from './components/treeSelect';
|
|
|
64
64
|
export * from './components/upload';
|
|
65
65
|
export * from './components/view';
|
|
66
66
|
export * from './components/wave';
|
|
67
|
-
export var version = '3.
|
|
67
|
+
export var version = '3.4.0-beta.0';
|
|
68
68
|
/* generate end */
|
|
@@ -25,7 +25,13 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
25
25
|
type: "link"
|
|
26
26
|
}, "link"), /*#__PURE__*/React.createElement(Button, {
|
|
27
27
|
type: "flat"
|
|
28
|
-
}, "flat")
|
|
28
|
+
}, "flat"), /*#__PURE__*/React.createElement(Button, {
|
|
29
|
+
color: "red"
|
|
30
|
+
}, "custom"), /*#__PURE__*/React.createElement(Button, {
|
|
31
|
+
color: "#0000ea"
|
|
32
|
+
}, "custom"), /*#__PURE__*/React.createElement(Button, {
|
|
33
|
+
color: "rgb(183, 18, 193)"
|
|
34
|
+
}, "custom"));
|
|
29
35
|
};
|
|
30
36
|
return Demo;
|
|
31
37
|
}(React.Component);
|
|
@@ -30,6 +30,9 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
30
30
|
type: "success",
|
|
31
31
|
ghost: true
|
|
32
32
|
}, "success"), /*#__PURE__*/React.createElement(Button, {
|
|
33
|
+
color: "rgb(183, 18, 193)",
|
|
34
|
+
ghost: true
|
|
35
|
+
}, "custom"), /*#__PURE__*/React.createElement(Button, {
|
|
33
36
|
type: "none",
|
|
34
37
|
ghost: true
|
|
35
38
|
}, "none"), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -142,6 +142,23 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
142
142
|
value: "guangzhou"
|
|
143
143
|
}, "\u5E7F\u5DDE"), /*#__PURE__*/React.createElement(Button, {
|
|
144
144
|
value: "shenzhen"
|
|
145
|
+
}, "\u6DF1\u5733")), /*#__PURE__*/React.createElement("p", null, "\u652F\u6301\u81EA\u5B9A\u4E49ButtonGroup\u4E0B\u7684Button\u5BBD\u5EA6"), /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
146
|
+
checkType: "radio",
|
|
147
|
+
value: this.state.city,
|
|
148
|
+
onChangeValue: function onChangeValue(city) {
|
|
149
|
+
return _this2.setState({
|
|
150
|
+
city: city
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
btnWidth: "100px"
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
155
|
+
value: "beijing"
|
|
156
|
+
}, "\u5317\u4EAC"), /*#__PURE__*/React.createElement(Button, {
|
|
157
|
+
value: "shanghai"
|
|
158
|
+
}, "\u4E0A\u6D77"), /*#__PURE__*/React.createElement(Button, {
|
|
159
|
+
value: "guangzhou"
|
|
160
|
+
}, "\u5E7F\u5DDE"), /*#__PURE__*/React.createElement(Button, {
|
|
161
|
+
value: "shenzhen"
|
|
145
162
|
}, "\u6DF1\u5733")));
|
|
146
163
|
};
|
|
147
164
|
return Demo;
|
|
@@ -33,6 +33,21 @@ var default_1 = /*#__PURE__*/function (_Component) {
|
|
|
33
33
|
Message.info('clicked cancel button');
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
+
_proto.showAsyncCloseConfirm = function showAsyncCloseConfirm() {
|
|
37
|
+
var dialog;
|
|
38
|
+
Dialog.confirm({
|
|
39
|
+
content: '点击确认,异步关闭',
|
|
40
|
+
ref: function ref(_dialog) {
|
|
41
|
+
return dialog = _dialog;
|
|
42
|
+
},
|
|
43
|
+
ok: function ok() {
|
|
44
|
+
dialog.showLoading();
|
|
45
|
+
setTimeout(function () {
|
|
46
|
+
dialog.close();
|
|
47
|
+
}, 3000);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
};
|
|
36
51
|
return default_1;
|
|
37
52
|
}(Component);
|
|
38
53
|
default_1.template = template;
|
|
@@ -38,6 +38,21 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
Message.info('clicked cancel button');
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
+
_proto.showAsyncCloseConfirm = function showAsyncCloseConfirm() {
|
|
42
|
+
var dialog;
|
|
43
|
+
Dialog.confirm({
|
|
44
|
+
content: '点击确认,异步关闭',
|
|
45
|
+
ref: function ref(_dialog) {
|
|
46
|
+
return dialog = _dialog;
|
|
47
|
+
},
|
|
48
|
+
ok: function ok() {
|
|
49
|
+
dialog.showLoading();
|
|
50
|
+
setTimeout(function () {
|
|
51
|
+
dialog.close();
|
|
52
|
+
}, 3000);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
41
56
|
_proto.render = function render() {
|
|
42
57
|
var _context2,
|
|
43
58
|
_this2 = this,
|
|
@@ -50,7 +65,9 @@ var Demo = /*#__PURE__*/function (_React$Component) {
|
|
|
50
65
|
return /*#__PURE__*/React.createElement(Button, {
|
|
51
66
|
onClick: _this2.showDialogWithTitle.bind(_this2, $value)
|
|
52
67
|
}, "Show ", $value[0].toUpperCase() + $value.substring(1), " Dialog with Title");
|
|
53
|
-
})))
|
|
68
|
+
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Button, {
|
|
69
|
+
onClick: this.showAsyncCloseConfirm
|
|
70
|
+
}, "\u5F02\u6B65\u5173\u95EDconfirm\u5F39\u5C42"));
|
|
54
71
|
};
|
|
55
72
|
return Demo;
|
|
56
73
|
}(React.Component);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
import { Message } from 'kpc';
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
function default_1() {
|
|
9
|
+
return _Component.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
var _proto = default_1.prototype;
|
|
12
|
+
_proto.ok = function ok() {
|
|
13
|
+
Message.success('Clicked ok!');
|
|
14
|
+
};
|
|
15
|
+
_proto.cancel = function cancel() {
|
|
16
|
+
Message.info('Clicked cancel!');
|
|
17
|
+
};
|
|
18
|
+
return default_1;
|
|
19
|
+
}(Component);
|
|
20
|
+
default_1.template = template;
|
|
21
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Popover, Tooltip } from '@king-design/react';
|
|
4
|
+
import { Message } from '@king-design/react';
|
|
5
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
|
+
_inheritsLoose(Demo, _React$Component);
|
|
7
|
+
function Demo() {
|
|
8
|
+
return _React$Component.apply(this, arguments) || this;
|
|
9
|
+
}
|
|
10
|
+
var _proto = Demo.prototype;
|
|
11
|
+
_proto.ok = function ok() {
|
|
12
|
+
Message.success('Clicked ok!');
|
|
13
|
+
};
|
|
14
|
+
_proto.cancel = function cancel() {
|
|
15
|
+
Message.info('Clicked cancel!');
|
|
16
|
+
};
|
|
17
|
+
_proto.render = function render() {
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Popover, {
|
|
19
|
+
title: "\u786E\u5B9A\u5220\u9664\uFF1F",
|
|
20
|
+
onOk: this.ok,
|
|
21
|
+
onCancel: this.cancel,
|
|
22
|
+
okText: "confirm",
|
|
23
|
+
cancelText: "cancel"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
25
|
+
content: "\u5220\u9664"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("button", null, "\u5220\u9664"))));
|
|
27
|
+
};
|
|
28
|
+
return Demo;
|
|
29
|
+
}(React.Component);
|
|
30
|
+
export { Demo as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import './index.styl';
|
|
4
|
+
export default class extends Component {
|
|
5
|
+
static template: string | import("intact").Template<any>;
|
|
6
|
+
static defaults(): {
|
|
7
|
+
value1: boolean;
|
|
8
|
+
value2: boolean;
|
|
9
|
+
};
|
|
10
|
+
beforeChange(value: any): Promise<boolean>;
|
|
11
|
+
beforeChangeFalse(value: any): Promise<boolean>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
|
+
export { default as data } from './index.json';
|
|
4
|
+
import { Component } from 'intact';
|
|
5
|
+
import template from './index.vdt';
|
|
6
|
+
import './index.styl';
|
|
7
|
+
import { Message } from 'kpc';
|
|
8
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
9
|
+
_inheritsLoose(default_1, _Component);
|
|
10
|
+
function default_1() {
|
|
11
|
+
return _Component.apply(this, arguments) || this;
|
|
12
|
+
}
|
|
13
|
+
default_1.defaults = function defaults() {
|
|
14
|
+
return {
|
|
15
|
+
value1: false,
|
|
16
|
+
value2: false
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
var _proto = default_1.prototype;
|
|
20
|
+
_proto.beforeChange = function beforeChange(value) {
|
|
21
|
+
return new _Promise(function (resolve) {
|
|
22
|
+
Message.warning("current value is " + value);
|
|
23
|
+
setTimeout(function () {
|
|
24
|
+
resolve(true);
|
|
25
|
+
}, 1000);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
_proto.beforeChangeFalse = function beforeChangeFalse(value) {
|
|
29
|
+
Message.warning("current value is " + value);
|
|
30
|
+
return new _Promise(function (resolve) {
|
|
31
|
+
setTimeout(function () {
|
|
32
|
+
resolve(false);
|
|
33
|
+
}, 1000);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
return default_1;
|
|
37
|
+
}(Component);
|
|
38
|
+
default_1.template = template;
|
|
39
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.styl';
|
|
3
|
+
export default class Demo extends React.Component {
|
|
4
|
+
state: {
|
|
5
|
+
value1: boolean;
|
|
6
|
+
value2: boolean;
|
|
7
|
+
};
|
|
8
|
+
beforeChange(value: any): Promise<boolean>;
|
|
9
|
+
beforeChangeFalse(value: any): Promise<boolean>;
|
|
10
|
+
render(): React.JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Switch } from '@king-design/react';
|
|
6
|
+
import './index.styl';
|
|
7
|
+
import { Message } from '@king-design/react';
|
|
8
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
9
|
+
_inheritsLoose(Demo, _React$Component);
|
|
10
|
+
function Demo() {
|
|
11
|
+
var _context;
|
|
12
|
+
var _this;
|
|
13
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
|
+
args[_key] = arguments[_key];
|
|
15
|
+
}
|
|
16
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
17
|
+
_this.state = {
|
|
18
|
+
value1: false,
|
|
19
|
+
value2: false
|
|
20
|
+
};
|
|
21
|
+
return _this;
|
|
22
|
+
}
|
|
23
|
+
var _proto = Demo.prototype;
|
|
24
|
+
_proto.beforeChange = function beforeChange(value) {
|
|
25
|
+
return new _Promise(function (resolve) {
|
|
26
|
+
Message.warning("current value is " + value);
|
|
27
|
+
setTimeout(function () {
|
|
28
|
+
resolve(true);
|
|
29
|
+
}, 1000);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
_proto.beforeChangeFalse = function beforeChangeFalse(value) {
|
|
33
|
+
Message.warning("current value is " + value);
|
|
34
|
+
return new _Promise(function (resolve) {
|
|
35
|
+
setTimeout(function () {
|
|
36
|
+
resolve(false);
|
|
37
|
+
}, 1000);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
_proto.render = function render() {
|
|
41
|
+
var _this2 = this;
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Switch, {
|
|
43
|
+
value: this.state.value1,
|
|
44
|
+
onChangeValue: function onChangeValue(value1) {
|
|
45
|
+
return _this2.setState({
|
|
46
|
+
value1: value1
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
beforeChange: this.beforeChange
|
|
50
|
+
}), /*#__PURE__*/React.createElement(Switch, {
|
|
51
|
+
value: this.state.value2,
|
|
52
|
+
onChangeValue: function onChangeValue(value2) {
|
|
53
|
+
return _this2.setState({
|
|
54
|
+
value2: value2
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
beforeChange: this.beforeChangeFalse
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
60
|
+
return Demo;
|
|
61
|
+
}(React.Component);
|
|
62
|
+
export { Demo as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as data } from './index.json';
|
|
2
|
+
import { Component } from 'intact';
|
|
3
|
+
import './index.styl';
|
|
4
|
+
export default class extends Component {
|
|
5
|
+
static template: string | import("intact").Template<any>;
|
|
6
|
+
static defaults(): {
|
|
7
|
+
data: {
|
|
8
|
+
a: string;
|
|
9
|
+
b: string;
|
|
10
|
+
c: string;
|
|
11
|
+
}[];
|
|
12
|
+
data2: never[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
function default_1() {
|
|
9
|
+
return _Component.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
default_1.defaults = function defaults() {
|
|
12
|
+
return {
|
|
13
|
+
data: [{
|
|
14
|
+
a: 'Cell 1-1',
|
|
15
|
+
b: 'Cell 1-2',
|
|
16
|
+
c: 'cell 1-3'
|
|
17
|
+
}, {
|
|
18
|
+
a: 'Cell 2-1',
|
|
19
|
+
b: 'Cell 2-2',
|
|
20
|
+
c: 'cell 2-3'
|
|
21
|
+
}],
|
|
22
|
+
data2: []
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
return default_1;
|
|
26
|
+
}(Component);
|
|
27
|
+
default_1.template = template;
|
|
28
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Table, TableColumn } from '@king-design/react';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
function Demo() {
|
|
9
|
+
var _context;
|
|
10
|
+
var _this;
|
|
11
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
12
|
+
args[_key] = arguments[_key];
|
|
13
|
+
}
|
|
14
|
+
_this = _React$Component.call.apply(_React$Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
15
|
+
_this.state = {
|
|
16
|
+
data: [{
|
|
17
|
+
a: 'Cell 1-1',
|
|
18
|
+
b: 'Cell 1-2',
|
|
19
|
+
c: 'cell 1-3'
|
|
20
|
+
}, {
|
|
21
|
+
a: 'Cell 2-1',
|
|
22
|
+
b: 'Cell 2-2',
|
|
23
|
+
c: 'cell 2-3'
|
|
24
|
+
}],
|
|
25
|
+
data2: []
|
|
26
|
+
};
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
var _proto = Demo.prototype;
|
|
30
|
+
_proto.render = function render() {
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
|
|
32
|
+
data: this.state.data,
|
|
33
|
+
resizable: true
|
|
34
|
+
}, /*#__PURE__*/React.createElement(TableColumn, {
|
|
35
|
+
key: "a",
|
|
36
|
+
title: "Title 1",
|
|
37
|
+
minWidth: 200
|
|
38
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
39
|
+
key: "b",
|
|
40
|
+
title: "Title 2",
|
|
41
|
+
minWidth: 300,
|
|
42
|
+
hidden: true
|
|
43
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
44
|
+
key: "c",
|
|
45
|
+
title: "Title 3"
|
|
46
|
+
})), /*#__PURE__*/React.createElement("p", null, "\u65E0\u6570\u636E\u5C55\u793A"), /*#__PURE__*/React.createElement(Table, {
|
|
47
|
+
data: this.state.data2,
|
|
48
|
+
resizable: true
|
|
49
|
+
}, /*#__PURE__*/React.createElement(TableColumn, {
|
|
50
|
+
key: "a",
|
|
51
|
+
title: "Title 1"
|
|
52
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
53
|
+
key: "b",
|
|
54
|
+
title: "Title 2",
|
|
55
|
+
hidden: true
|
|
56
|
+
}), /*#__PURE__*/React.createElement(TableColumn, {
|
|
57
|
+
key: "c",
|
|
58
|
+
title: "Title 3"
|
|
59
|
+
})));
|
|
60
|
+
};
|
|
61
|
+
return Demo;
|
|
62
|
+
}(React.Component);
|
|
63
|
+
export { Demo as default };
|
package/i18n/en-US.ts
CHANGED
|
@@ -120,6 +120,9 @@ const i18n = {
|
|
|
120
120
|
|
|
121
121
|
export default i18n;
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
/**
|
|
124
|
+
* global does not exist in Vite, use standard object globalThis
|
|
125
|
+
*/
|
|
126
|
+
if (typeof (globalThis as any).Kpc !== 'undefined') {
|
|
127
|
+
(globalThis as any).Kpc.localize(i18n);
|
|
125
128
|
}
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.
|
|
2
|
+
* @king-design v3.4.0-beta.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -68,6 +68,6 @@ export * from './components/upload';
|
|
|
68
68
|
export * from './components/view';
|
|
69
69
|
export * from './components/wave';
|
|
70
70
|
|
|
71
|
-
export const version = '3.
|
|
71
|
+
export const version = '3.4.0-beta.0';
|
|
72
72
|
|
|
73
73
|
/* generate end */
|