@king-design/react 3.0.1 → 3.1.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/affix/index.d.ts +1 -0
- package/components/affix/index.js +2 -0
- package/components/affix/index.vdt.js +5 -5
- package/components/affix/styles.d.ts +1 -1
- package/components/affix/styles.js +1 -1
- package/components/badge/index.d.ts +1 -0
- package/components/badge/index.js +13 -1
- package/components/badge/index.vdt.js +5 -4
- package/components/badge/styles.d.ts +1 -1
- package/components/badge/styles.js +2 -2
- package/components/breadcrumb/index.d.ts +1 -0
- package/components/breadcrumb/index.js +13 -1
- package/components/breadcrumb/index.vdt.js +4 -5
- package/components/breadcrumb/item.d.ts +1 -0
- package/components/breadcrumb/item.js +2 -0
- package/components/breadcrumb/item.vdt.js +4 -5
- package/components/breadcrumb/styles.d.ts +1 -1
- package/components/breadcrumb/styles.js +2 -2
- package/components/button/group.d.ts +1 -0
- package/components/button/group.js +13 -1
- package/components/button/group.vdt.js +2 -6
- package/components/button/index.d.ts +1 -0
- package/components/button/index.js +2 -0
- package/components/button/index.vdt.js +7 -7
- package/components/button/styles.d.ts +2 -4
- package/components/button/styles.js +19 -20
- package/components/card/column.d.ts +1 -0
- package/components/card/column.js +13 -1
- package/components/card/column.vdt.js +2 -5
- package/components/card/index.d.ts +1 -0
- package/components/card/index.js +13 -1
- package/components/card/index.vdt.js +5 -11
- package/components/card/styles.d.ts +1 -1
- package/components/card/styles.js +2 -2
- package/components/carousel/index.d.ts +1 -0
- package/components/carousel/index.js +2 -0
- package/components/carousel/index.vdt.js +15 -19
- package/components/carousel/item.d.ts +1 -0
- package/components/carousel/item.js +13 -1
- package/components/carousel/item.vdt.js +2 -3
- package/components/carousel/styles.d.ts +2 -2
- package/components/carousel/styles.js +4 -4
- package/components/cascader/index.vdt.js +20 -29
- package/components/cascader/styles.d.ts +2 -2
- package/components/cascader/styles.js +3 -3
- package/components/checkbox/index.d.ts +1 -0
- package/components/checkbox/index.js +2 -0
- package/components/checkbox/index.vdt.js +4 -8
- package/components/checkbox/styles.d.ts +1 -1
- package/components/checkbox/styles.js +2 -2
- package/components/code/index.d.ts +1 -0
- package/components/code/index.js +2 -0
- package/components/code/index.vdt.js +2 -3
- package/components/code/styles.d.ts +1 -1
- package/components/code/styles.js +1 -1
- package/components/collapse/index.d.ts +1 -0
- package/components/collapse/index.js +13 -1
- package/components/collapse/index.vdt.js +2 -3
- package/components/collapse/item.d.ts +1 -0
- package/components/collapse/item.js +2 -0
- package/components/collapse/item.vdt.js +6 -8
- package/components/collapse/styles.d.ts +2 -3
- package/components/collapse/styles.js +5 -9
- package/components/colorpicker/drag.d.ts +1 -0
- package/components/colorpicker/drag.js +2 -0
- package/components/colorpicker/drag.vdt.js +3 -2
- package/components/colorpicker/index.d.ts +1 -0
- package/components/colorpicker/index.js +13 -1
- package/components/colorpicker/index.vdt.js +5 -6
- package/components/colorpicker/panel.d.ts +1 -0
- package/components/colorpicker/panel.js +2 -0
- package/components/colorpicker/panel.vdt.js +16 -19
- package/components/colorpicker/styles.d.ts +3 -3
- package/components/colorpicker/styles.js +8 -8
- package/components/config/index.d.ts +10 -0
- package/components/config/index.js +23 -0
- package/components/config/index.spec.d.ts +1 -0
- package/components/config/index.spec.js +71 -0
- package/components/context.d.ts +2 -1
- package/components/context.js +8 -2
- package/components/copy/index.d.ts +1 -0
- package/components/copy/index.js +2 -0
- package/components/copy/index.vdt.js +9 -9
- package/components/copy/styles.d.ts +1 -1
- package/components/copy/styles.js +1 -1
- package/components/datepicker/calendar.d.ts +1 -0
- package/components/datepicker/calendar.js +2 -0
- package/components/datepicker/calendar.vdt.js +38 -51
- package/components/datepicker/index.vdt.js +13 -16
- package/components/datepicker/styles.d.ts +3 -3
- package/components/datepicker/styles.js +6 -6
- package/components/datepicker/time.d.ts +1 -0
- package/components/datepicker/time.js +2 -0
- package/components/datepicker/time.vdt.js +2 -3
- package/components/diagram/diagram.d.ts +1 -0
- package/components/diagram/diagram.js +2 -0
- package/components/diagram/diagram.vdt.js +3 -4
- package/components/diagram/styles.d.ts +1 -1
- package/components/diagram/styles.js +1 -1
- package/components/dialog/alert.vdt.js +6 -10
- package/components/dialog/base.d.ts +4 -0
- package/components/dialog/base.js +2 -0
- package/components/dialog/base.vdt.js +15 -21
- package/components/dialog/index.d.ts +1 -1
- package/components/dialog/styles.d.ts +3 -3
- package/components/dialog/styles.js +12 -12
- package/components/drawer/index.vdt.js +3 -4
- package/components/drawer/styles.d.ts +1 -1
- package/components/drawer/styles.js +3 -3
- package/components/dropdown/dropdown.d.ts +1 -0
- package/components/dropdown/dropdown.js +4 -3
- package/components/dropdown/item.d.ts +1 -0
- package/components/dropdown/item.js +2 -0
- package/components/dropdown/item.vdt.js +2 -4
- package/components/dropdown/menu.d.ts +1 -0
- package/components/dropdown/menu.js +2 -0
- package/components/dropdown/menu.vdt.js +2 -3
- package/components/dropdown/styles.d.ts +2 -2
- package/components/dropdown/styles.js +4 -4
- package/components/editable/index.d.ts +1 -0
- package/components/editable/index.js +2 -0
- package/components/editable/index.vdt.js +3 -7
- package/components/editable/styles.d.ts +1 -1
- package/components/editable/styles.js +2 -2
- package/components/form/form.d.ts +1 -0
- package/components/form/form.js +2 -0
- package/components/form/form.vdt.js +2 -3
- package/components/form/item.d.ts +1 -0
- package/components/form/item.js +2 -0
- package/components/form/item.vdt.js +13 -19
- package/components/form/styles.d.ts +2 -2
- package/components/form/styles.js +5 -5
- package/components/form/useError.d.ts +1 -0
- package/components/grid/col.d.ts +1 -0
- package/components/grid/col.js +2 -0
- package/components/grid/col.vdt.js +3 -6
- package/components/grid/row.d.ts +1 -0
- package/components/grid/row.js +2 -0
- package/components/grid/row.vdt.js +2 -3
- package/components/grid/styles.d.ts +2 -2
- package/components/grid/styles.js +8 -18
- package/components/grid/useBreakpoints.d.ts +1 -1
- package/components/grid/useBreakpoints.js +2 -2
- package/components/grid/useGutter.d.ts +1 -0
- package/components/icon/index.d.ts +1 -0
- package/components/icon/index.js +2 -0
- package/components/icon/index.vdt.js +7 -11
- package/components/icon/styles.d.ts +1 -2
- package/components/icon/styles.js +7 -5
- package/components/input/index.d.ts +1 -0
- package/components/input/index.js +2 -0
- package/components/input/index.vdt.js +16 -26
- package/components/input/search.d.ts +1 -0
- package/components/input/search.js +2 -0
- package/components/input/search.vdt.js +5 -7
- package/components/input/styles.d.ts +2 -2
- package/components/input/styles.js +11 -11
- package/components/layout/aside.d.ts +1 -0
- package/components/layout/aside.js +2 -0
- package/components/layout/aside.vdt.js +5 -8
- package/components/layout/body.d.ts +1 -0
- package/components/layout/body.js +4 -3
- package/components/layout/footer.d.ts +1 -0
- package/components/layout/footer.js +15 -4
- package/components/layout/header.d.ts +1 -0
- package/components/layout/header.js +4 -6
- package/components/layout/layout.d.ts +1 -0
- package/components/layout/layout.js +4 -3
- package/components/layout/styles.d.ts +3 -3
- package/components/layout/styles.js +8 -8
- package/components/layout/template.vdt.js +2 -1
- package/components/menu/item.d.ts +1 -0
- package/components/menu/item.js +2 -0
- package/components/menu/item.vdt.js +7 -12
- package/components/menu/menu.d.ts +1 -0
- package/components/menu/menu.js +2 -0
- package/components/menu/menu.vdt.js +3 -6
- package/components/menu/styles.d.ts +3 -3
- package/components/menu/styles.js +10 -10
- package/components/message/message.d.ts +1 -0
- package/components/message/message.js +2 -0
- package/components/message/message.vdt.js +12 -17
- package/components/message/messages.d.ts +1 -0
- package/components/message/messages.js +2 -0
- package/components/message/messages.vdt.js +2 -3
- package/components/message/styles.d.ts +2 -2
- package/components/message/styles.js +4 -4
- package/components/pagination/index.d.ts +1 -0
- package/components/pagination/index.js +2 -0
- package/components/pagination/index.vdt.js +14 -17
- package/components/pagination/styles.d.ts +1 -1
- package/components/pagination/styles.js +4 -4
- package/components/popover/content.vdt.js +5 -4
- package/components/popover/styles.d.ts +1 -1
- package/components/popover/styles.js +2 -2
- package/components/portal.d.ts +1 -0
- package/components/portal.js +3 -1
- package/components/progress/index.d.ts +1 -0
- package/components/progress/index.js +2 -0
- package/components/progress/index.vdt.js +14 -17
- package/components/progress/styles.d.ts +1 -1
- package/components/progress/styles.js +6 -6
- package/components/radio/index.d.ts +1 -0
- package/components/radio/index.js +2 -0
- package/components/radio/index.vdt.js +4 -7
- package/components/radio/styles.d.ts +1 -1
- package/components/radio/styles.js +2 -2
- package/components/rate/index.d.ts +1 -0
- package/components/rate/index.js +2 -0
- package/components/rate/index.vdt.js +4 -8
- package/components/rate/styles.d.ts +1 -1
- package/components/rate/styles.js +2 -2
- package/components/scrollSelect/index.d.ts +1 -0
- package/components/scrollSelect/index.js +2 -0
- package/components/scrollSelect/index.vdt.js +7 -12
- package/components/scrollSelect/styles.d.ts +1 -1
- package/components/scrollSelect/styles.js +2 -2
- package/components/select/base.d.ts +4 -0
- package/components/select/base.js +2 -0
- package/components/select/base.vdt.js +17 -21
- package/components/select/group.d.ts +1 -0
- package/components/select/group.js +2 -0
- package/components/select/group.vdt.js +3 -4
- package/components/select/menu.d.ts +1 -0
- package/components/select/menu.js +2 -0
- package/components/select/menu.vdt.js +9 -13
- package/components/select/option.d.ts +1 -0
- package/components/select/option.js +2 -0
- package/components/select/option.vdt.js +6 -8
- package/components/select/styles.d.ts +3 -3
- package/components/select/styles.js +8 -8
- package/components/select/useSearchable.d.ts +1 -0
- package/components/skeleton/item.d.ts +1 -0
- package/components/skeleton/item.js +13 -1
- package/components/skeleton/item.vdt.js +4 -7
- package/components/skeleton/skeleton.d.ts +1 -0
- package/components/skeleton/skeleton.js +13 -1
- package/components/skeleton/skeleton.vdt.js +4 -6
- package/components/skeleton/styles.d.ts +6 -0
- package/components/skeleton/styles.js +35 -0
- package/components/slider/index.d.ts +1 -0
- package/components/slider/index.js +2 -0
- package/components/slider/index.vdt.js +18 -22
- package/components/slider/styles.d.ts +1 -1
- package/components/slider/styles.js +2 -2
- package/components/spin/index.d.ts +1 -0
- package/components/spin/index.js +13 -1
- package/components/spin/index.vdt.js +6 -7
- package/components/spin/styles.d.ts +1 -1
- package/components/spin/styles.js +4 -4
- package/components/spinner/index.d.ts +1 -0
- package/components/spinner/index.js +2 -0
- package/components/spinner/index.vdt.js +15 -21
- package/components/spinner/styles.d.ts +1 -1
- package/components/spinner/styles.js +7 -7
- package/components/split/index.d.ts +2 -1
- package/components/split/index.js +2 -0
- package/components/split/index.vdt.js +7 -9
- package/components/split/styles.d.ts +4 -0
- package/components/split/styles.js +55 -0
- package/components/steps/context.d.ts +1 -0
- package/components/steps/index.d.ts +1 -0
- package/components/steps/index.js +13 -1
- package/components/steps/index.vdt.js +2 -3
- package/components/steps/step.d.ts +1 -0
- package/components/steps/step.js +13 -1
- package/components/steps/step.vdt.js +10 -16
- package/components/steps/styles.d.ts +3 -3
- package/components/steps/styles.js +18 -18
- package/components/switch/index.d.ts +1 -0
- package/components/switch/index.js +2 -0
- package/components/switch/index.vdt.js +6 -7
- package/components/switch/styles.d.ts +1 -1
- package/components/switch/styles.js +4 -4
- package/components/table/cell.d.ts +1 -0
- package/components/table/cell.js +13 -1
- package/components/table/cell.vdt.js +6 -6
- package/components/table/column.d.ts +1 -0
- package/components/table/column.js +2 -0
- package/components/table/column.vdt.js +24 -32
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +13 -1
- package/components/table/row.vdt.js +3 -10
- package/components/table/styles.d.ts +2 -2
- package/components/table/styles.js +6 -6
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +2 -0
- package/components/table/table.vdt.js +16 -20
- package/components/table/useColumns.d.ts +1 -0
- package/components/table/useFixedColumns.d.ts +2 -1
- package/components/table/useGroup.d.ts +1 -0
- package/components/table/useResizable.d.ts +1 -0
- package/components/table/useSortable.d.ts +1 -0
- package/components/tabs/index.d.ts +4 -0
- package/components/tabs/index.js +2 -0
- package/components/tabs/index.vdt.js +9 -10
- package/components/tabs/styles.d.ts +1 -1
- package/components/tabs/styles.js +15 -15
- package/components/tabs/tab.d.ts +1 -0
- package/components/tabs/tab.js +2 -0
- package/components/tabs/tab.vdt.js +3 -5
- package/components/tabs/useActiveBar.js +2 -1
- package/components/tabs/useScroll.js +2 -1
- package/components/tag/base.d.ts +1 -0
- package/components/tag/base.js +13 -1
- package/components/tag/index.vdt.js +4 -5
- package/components/tag/styles.d.ts +2 -2
- package/components/tag/styles.js +7 -7
- package/components/tag/tags.d.ts +1 -0
- package/components/tag/tags.js +2 -0
- package/components/tag/tags.vdt.js +5 -11
- package/components/timeline/item.d.ts +1 -0
- package/components/timeline/item.js +13 -1
- package/components/timeline/item.vdt.js +4 -5
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +6 -6
- package/components/timeline/timeline.d.ts +1 -0
- package/components/timeline/timeline.js +13 -1
- package/components/timeline/timeline.vdt.js +2 -3
- package/components/timepicker/index.d.ts +2 -1
- package/components/timepicker/panelPicker.vdt.js +13 -17
- package/components/timepicker/selectPicker.d.ts +1 -0
- package/components/timepicker/selectPicker.js +2 -0
- package/components/timepicker/selectPicker.vdt.js +4 -4
- package/components/timepicker/styles.d.ts +1 -1
- package/components/timepicker/styles.js +2 -2
- package/components/tip/index.vdt.js +5 -6
- package/components/tip/styles.d.ts +1 -1
- package/components/tip/styles.js +2 -2
- package/components/tooltip/content.vdt.js +4 -9
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +6 -6
- package/components/transfer/index.d.ts +1 -0
- package/components/transfer/index.js +2 -0
- package/components/transfer/index.vdt.js +20 -25
- package/components/transfer/styles.d.ts +1 -1
- package/components/transfer/styles.js +2 -2
- package/components/tree/index.d.ts +1 -0
- package/components/tree/index.js +2 -0
- package/components/tree/index.vdt.js +19 -30
- package/components/tree/styles.d.ts +1 -1
- package/components/tree/styles.js +2 -2
- package/components/treeSelect/index.vdt.js +2 -3
- package/components/treeSelect/styles.d.ts +1 -1
- package/components/treeSelect/styles.js +1 -1
- package/components/upload/index.d.ts +1 -0
- package/components/upload/index.js +2 -0
- package/components/upload/index.vdt.js +39 -50
- package/components/upload/styles.d.ts +2 -2
- package/components/upload/styles.js +3 -3
- package/components/utils.d.ts +2 -1
- package/components/utils.js +20 -9
- package/components/wave/index.d.ts +1 -0
- package/components/wave/index.js +4 -2
- package/components/wave/styles.d.ts +1 -1
- package/components/wave/styles.js +2 -2
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/package.json +1 -1
- package/styles/fonts/iconfont.d.ts +1 -1
- package/styles/fonts/iconfont.js +4 -1
- package/styles/global.js +4 -4
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -53
- package/components/skeleton/style.d.ts +0 -6
- package/components/skeleton/style.js +0 -35
- package/components/split/style.d.ts +0 -4
- package/components/split/style.js +0 -55
package/components/menu/item.js
CHANGED
|
@@ -10,6 +10,7 @@ import { useDropdown } from './useDropdown';
|
|
|
10
10
|
import { useRouter, navigate } from '../../hooks/useRouter';
|
|
11
11
|
import { useRecordItem } from '../../hooks/useRecordComponent';
|
|
12
12
|
import { MENU_RECORD_KEY, useHighlightItem } from './useHighlight';
|
|
13
|
+
import { useConfigContext } from '../config';
|
|
13
14
|
var typeDefs = {
|
|
14
15
|
key: {
|
|
15
16
|
type: [String, Number],
|
|
@@ -43,6 +44,7 @@ export var MenuItem = /*#__PURE__*/function (_Component) {
|
|
|
43
44
|
_this.expanded = useExpanded(_this.rootMenu, _this.parentMenu);
|
|
44
45
|
_this.dropdown = useDropdown(_this.rootMenu, _this.parentMenu);
|
|
45
46
|
_this.router = useRouter();
|
|
47
|
+
_this.config = useConfigContext();
|
|
46
48
|
return _this;
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -8,12 +8,6 @@ import { Menu } from './menu';
|
|
|
8
8
|
import { getRestProps, expandAnimationCallbacks } from '../utils';
|
|
9
9
|
import { isNullOrUndefined } from 'intact-shared';
|
|
10
10
|
import { makeItemStyles, makeTitleStyles } from './styles';
|
|
11
|
-
var _$tmp0 = {
|
|
12
|
-
'className': 'k-menu-dot ion-record'
|
|
13
|
-
};
|
|
14
|
-
var _$tmp1 = {
|
|
15
|
-
'className': 'k-menu-arrow k-icon-down'
|
|
16
|
-
};
|
|
17
11
|
export default function ($props, $blocks, $__proto__) {
|
|
18
12
|
var _classNameObj,
|
|
19
13
|
_this = this;
|
|
@@ -51,17 +45,18 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
51
45
|
position = _this$dropdown.position,
|
|
52
46
|
isCollapse = _this$dropdown.isCollapse;
|
|
53
47
|
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
}, _classNameObj[className] = className, _classNameObj['k-expanded'] = isExpanded, _classNameObj['k-disabled'] = disabled, _classNameObj['k-active'] = isSelected(key), _classNameObj['k-highlighted'] = isHighlighted(key), _classNameObj[makeItemStyles()] = true, _classNameObj);
|
|
48
|
+
var k = this.config.k;
|
|
49
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-menu-item"] = true, _classNameObj[className] = className, _classNameObj[k + "-expanded"] = isExpanded, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-active"] = isSelected(key), _classNameObj[k + "-highlighted"] = isHighlighted(key), _classNameObj[makeItemStyles(k)] = true, _classNameObj);
|
|
57
50
|
var showDot = isTopItem && !iconVNode && isNullOrUndefined(dot) ? rootDot : dot;
|
|
58
51
|
|
|
59
52
|
var title = function title(children) {
|
|
60
53
|
var _$cn2;
|
|
61
54
|
|
|
62
|
-
return _$ce(2, 'div', [showDot ? _$cc(Icon,
|
|
63
|
-
'k-menu-
|
|
64
|
-
}, _$
|
|
55
|
+
return _$ce(2, 'div', [showDot ? _$cc(Icon, {
|
|
56
|
+
'className': _$cn(k + "-menu-dot ion-record")
|
|
57
|
+
}) : undefined, _$ce(2, 'div', children, 0, _$cn(k + "-menu-name")), subMenuVNode ? _$cc(Icon, {
|
|
58
|
+
'className': _$cn(k + "-menu-arrow " + k + "-icon-down")
|
|
59
|
+
}) : undefined], 0, _$cn((_$cn2 = {}, _$cn2[k + "-menu-title"] = true, _$cn2[makeTitleStyles(k)] = true, _$cn2)), {
|
|
65
60
|
'ev-click': _this.onClick.bind(_this, subMenuVNode)
|
|
66
61
|
});
|
|
67
62
|
};
|
package/components/menu/menu.js
CHANGED
|
@@ -3,6 +3,7 @@ import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/con
|
|
|
3
3
|
import { Component, provide, inject } from 'intact-react';
|
|
4
4
|
import template from './menu.vdt';
|
|
5
5
|
import { useHighlight } from './useHighlight';
|
|
6
|
+
import { useConfigContext } from '../config';
|
|
6
7
|
var typeDefs = {
|
|
7
8
|
expandedKeys: Array,
|
|
8
9
|
selectedKey: [String, Number],
|
|
@@ -42,6 +43,7 @@ export var Menu = /*#__PURE__*/function (_Component) {
|
|
|
42
43
|
_this.parentMenu = inject(MENU, null);
|
|
43
44
|
_this.subExpandedKeys = void 0;
|
|
44
45
|
_this.highlight = void 0;
|
|
46
|
+
_this.config = useConfigContext();
|
|
45
47
|
return _this;
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -26,9 +26,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
26
26
|
|
|
27
27
|
var isRootMenu = !this.rootMenu;
|
|
28
28
|
var isDropdownMenu = !isRootMenu && isDropdown(this.rootMenu);
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
}, _classNameObj[className] = className, _classNameObj["k-" + theme] = (isRootMenu || isDropdownMenu) && theme, _classNameObj["k-" + size] = isRootMenu && size !== 'default', _classNameObj['k-collapsed'] = isRootMenu && collapse, _classNameObj["k-" + type] = isRootMenu && type, _classNameObj[makeMenuStyles()] = true, _classNameObj);
|
|
29
|
+
var k = this.config.k;
|
|
30
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-menu"] = true, _classNameObj[className] = className, _classNameObj[k + "-" + theme] = (isRootMenu || isDropdownMenu) && theme, _classNameObj[k + "-" + size] = isRootMenu && size !== 'default', _classNameObj[k + "-collapsed"] = isRootMenu && collapse, _classNameObj[k + "-" + type] = isRootMenu && type, _classNameObj[makeMenuStyles(k)] = true, _classNameObj);
|
|
32
31
|
var header = (_$blocks['header'] = function ($super) {
|
|
33
32
|
return null;
|
|
34
33
|
}, __$blocks['header'] = function ($super, data) {
|
|
@@ -42,9 +41,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
42
41
|
}, __$blocks['header'](_$no));
|
|
43
42
|
var content = [$blocks.header ? _$ce(2, 'div', !collapse ? header : findChildren(header, function (vNode) {
|
|
44
43
|
return isComponentVNode(vNode, Icon);
|
|
45
|
-
}), 0, _$cn((_$cn2 = {
|
|
46
|
-
'k-menu-header': true
|
|
47
|
-
}, _$cn2[makeTitleStyles()] = true, _$cn2))) : undefined, children];
|
|
44
|
+
}), 0, _$cn((_$cn2 = {}, _$cn2[k + "-menu-header"] = true, _$cn2[makeTitleStyles(k)] = true, _$cn2))) : undefined, children];
|
|
48
45
|
return !isDropdownMenu ? _$cv('div', _extends({}, getRestProps(this), {
|
|
49
46
|
'className': _$cn(classNameObj)
|
|
50
47
|
}), [content, null]) : _$cc(DropdownMenu, _extends({}, getRestProps(this), {
|
|
@@ -62,6 +62,6 @@ declare const defaults: {
|
|
|
62
62
|
};
|
|
63
63
|
declare let menu: typeof defaults;
|
|
64
64
|
export { menu };
|
|
65
|
-
export declare function makeMenuStyles(): string;
|
|
66
|
-
export declare function makeTitleStyles(): string;
|
|
67
|
-
export declare function makeItemStyles(): string;
|
|
65
|
+
export declare function makeMenuStyles(k: string): string;
|
|
66
|
+
export declare function makeTitleStyles(k: string): string;
|
|
67
|
+
export declare function makeItemStyles(k: string): string;
|
|
@@ -117,24 +117,24 @@ setDefault(function () {
|
|
|
117
117
|
}).menu;
|
|
118
118
|
});
|
|
119
119
|
export { menu };
|
|
120
|
-
export function makeMenuStyles() {
|
|
120
|
+
export function makeMenuStyles(k) {
|
|
121
121
|
var _context;
|
|
122
122
|
|
|
123
|
-
// we must increase the priority by adding
|
|
123
|
+
// we must increase the priority by adding &.${k}-menu
|
|
124
124
|
// to override the css of dropdownMenu
|
|
125
|
-
return /*#__PURE__*/css("&.k-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";}&:not(.k-dropdown-menu) &:not(.k-dropdown-menu){width:auto;background:", menu.subBgColor, ";.k-menu-title{padding-left:calc(", getLeft(menu.item.padding), " + ", menu.icon.width, " + ", menu.icon.gap, ");}}&:not(.k-dropdown-menu) &:not(.k-dropdown-menu) &:not(.k-dropdown-menu){.k-menu-title{padding-left:calc(", getLeft(menu.item.padding), " + ", menu.icon.width, " * 2 + ", menu.icon.gap, ");}}.k-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.k-menu-header{height:", menu.header.height, ";font-size:", menu.header.fontSize, ";font-weight:bold;border-bottom:", menu.header.borderBottom, ";}", _mapInstanceProperty(_context = ['light', 'white']).call(_context, function (theme) {
|
|
125
|
+
return /*#__PURE__*/css("&.", k, "-menu{width:", menu.width, ";transition:width ", menu.transition, ";background:", menu.bgColor, ";font-size:", menu.fontSize, ";}&:not(.", k, "-dropdown-menu) &:not(.", k, "-dropdown-menu){width:auto;background:", menu.subBgColor, ";.", k, "-menu-title{padding-left:calc(", getLeft(menu.item.padding), " + ", menu.icon.width, " + ", menu.icon.gap, ");}}&:not(.", k, "-dropdown-menu) &:not(.", k, "-dropdown-menu) &:not(.", k, "-dropdown-menu){.", k, "-menu-title{padding-left:calc(", getLeft(menu.item.padding), " + ", menu.icon.width, " * 2 + ", menu.icon.gap, ");}}.", k, "-icon{width:", menu.icon.width, ";margin-right:", menu.icon.gap, ";text-align:center;flex-shrink:0;}.", k, "-menu-header{height:", menu.header.height, ";font-size:", menu.header.fontSize, ";font-weight:bold;border-bottom:", menu.header.borderBottom, ";}", _mapInstanceProperty(_context = ['light', 'white']).call(_context, function (theme) {
|
|
126
126
|
var styles = menu[theme];
|
|
127
|
-
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";.k-menu-header{color:", styles.item.color, ";border-bottom:", styles.border, ";}.k-menu-item{.k-menu-title{color:", styles.item.color, ";&:hover{color:", styles.item.hoverColor, ";}}&.k-highlighted{>.k-menu-title{color:", styles.item.hoverColor, ";}}&.k-disabled{>.k-menu-title{color:", styles.item.disabledColor, "!important;}}}.k-menu:not(.k-dropdown-menu){background:", styles.subBgColor, ";}&.k-horizontal{.k-menu-header{border-right:", styles.border, ";}}}");
|
|
128
|
-
}), " &.k-white{.k-menu-item.k-active{>.k-menu-title{color:", menu.white.active.color, "!important;background:", menu.white.active.bgColor, ";}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
127
|
+
return /*#__PURE__*/css("&.", k, "-", theme, "{background:", styles.bgColor, ";.", k, "-menu-header{color:", styles.item.color, ";border-bottom:", styles.border, ";}.", k, "-menu-item{.", k, "-menu-title{color:", styles.item.color, ";&:hover{color:", styles.item.hoverColor, ";}}&.", k, "-highlighted{>.", k, "-menu-title{color:", styles.item.hoverColor, ";}}&.", k, "-disabled{>.", k, "-menu-title{color:", styles.item.disabledColor, "!important;}}}.", k, "-menu:not(.", k, "-dropdown-menu){background:", styles.subBgColor, ";}&.", k, "-horizontal{.", k, "-menu-header{border-right:", styles.border, ";}}}");
|
|
128
|
+
}), " &.", k, "-white{.", k, "-menu-item.", k, "-active{>.", k, "-menu-title{color:", menu.white.active.color, "!important;background:", menu.white.active.bgColor, ";}}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
129
129
|
var styles = menu[size];
|
|
130
|
-
return /*#__PURE__*/css("&.k-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.k-menu{font-size:", styles.fontSize, ";}}");
|
|
131
|
-
}), "&.k-collapsed{width:calc(", menu.icon.width, " + ", getLeft(menu.item.padding), " * 2);.k-icon{margin-right:0;}.k-menu-arrow{display:none;}}&.k-dropdown-menu{width:auto;min-width:", menu.dropdown.minWidth, ";.k-menu-arrow{transform:rotate(-90deg);}}&.k-horizontal{width:auto;display:flex;align-items:center;.k-menu-header{border-bottom:none;border-right:", menu.header.borderBottom, ";}}");
|
|
130
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{width:", styles.width, ";font-size:", styles.fontSize, ";.", k, "-menu{font-size:", styles.fontSize, ";}}");
|
|
131
|
+
}), "&.", k, "-collapsed{width:calc(", menu.icon.width, " + ", getLeft(menu.item.padding), " * 2);.", k, "-icon{margin-right:0;}.", k, "-menu-arrow{display:none;}}&.", k, "-dropdown-menu{width:auto;min-width:", menu.dropdown.minWidth, ";.", k, "-menu-arrow{transform:rotate(-90deg);}}&.", k, "-horizontal{width:auto;display:flex;align-items:center;.", k, "-menu-header{border-bottom:none;border-right:", menu.header.borderBottom, ";}}");
|
|
132
132
|
}
|
|
133
|
-
export function makeTitleStyles() {
|
|
133
|
+
export function makeTitleStyles(k) {
|
|
134
134
|
var item = menu.item;
|
|
135
135
|
return /*#__PURE__*/css("display:flex;align-items:center;padding:", item.padding, ";color:", item.color, ";white-space:nowrap;overflow:hidden;flex-wrap:nowrap;");
|
|
136
136
|
}
|
|
137
|
-
export function makeItemStyles() {
|
|
137
|
+
export function makeItemStyles(k) {
|
|
138
138
|
var item = menu.item;
|
|
139
|
-
return /*#__PURE__*/css(".k-menu-title{cursor:pointer;height:", menu.item.height, ";transition:all ", menu.transition, ";&:hover{color:", menu.item.hoverColor, ";}}.k-menu-name{flex:1;display:flex;align-items:center;min-width:0;span{overflow:hidden;text-overflow:ellipsis;min-width:0;}}.k-menu-arrow{transition:transform ", menu.transition, ";margin-left:", menu.icon.gap, ";}&.k-expanded{>.k-menu-title{color:", menu.item.hoverColor, ";.k-menu-arrow{transform:rotateX(180deg);}}}&.k-highlighted{>.k-menu-title{color:", menu.item.hoverColor, ";}}&.k-active{>.k-menu-title{color:", menu.item.hoverColor, "!important;background:", menu.item.activeBgColor, ";}}&.k-disabled{>.k-menu-title{color:", menu.item.disabledColor, "!important;cursor:not-allowed;}}.k-menu-dot{font-size:", menu.item.dotFontSize, ";transform:scale(.4);}");
|
|
139
|
+
return /*#__PURE__*/css(".", k, "-menu-title{cursor:pointer;height:", menu.item.height, ";transition:all ", menu.transition, ";&:hover{color:", menu.item.hoverColor, ";}}.", k, "-menu-name{flex:1;display:flex;align-items:center;min-width:0;span{overflow:hidden;text-overflow:ellipsis;min-width:0;}}.", k, "-menu-arrow{transition:transform ", menu.transition, ";margin-left:", menu.icon.gap, ";}&.", k, "-expanded{>.", k, "-menu-title{color:", menu.item.hoverColor, ";.", k, "-menu-arrow{transform:rotateX(180deg);}}}&.", k, "-highlighted{>.", k, "-menu-title{color:", menu.item.hoverColor, ";}}&.", k, "-active{>.", k, "-menu-title{color:", menu.item.hoverColor, "!important;background:", menu.item.activeBgColor, ";}}&.", k, "-disabled{>.", k, "-menu-title{color:", menu.item.disabledColor, "!important;cursor:not-allowed;}}.", k, "-menu-dot{font-size:", menu.item.dotFontSize, ";transform:scale(.4);}");
|
|
140
140
|
}
|
|
@@ -16,5 +16,6 @@ export declare class Message extends Component<MessageProps> {
|
|
|
16
16
|
static success(content: Children | Partial<MessageProps>, duration?: number): void;
|
|
17
17
|
static warning(content: Children | Partial<MessageProps>, duration?: number): void;
|
|
18
18
|
private delayClose;
|
|
19
|
+
private config;
|
|
19
20
|
close(): void;
|
|
20
21
|
}
|
|
@@ -8,6 +8,7 @@ import { Messages } from './messages';
|
|
|
8
8
|
import { useDelayClose } from '../../hooks/useDelayClose';
|
|
9
9
|
import { isObject } from 'intact-shared';
|
|
10
10
|
import { bind } from '../utils';
|
|
11
|
+
import { useConfigContext } from '../config';
|
|
11
12
|
var typeDefs = {
|
|
12
13
|
content: [String, VNode],
|
|
13
14
|
duration: Number,
|
|
@@ -40,6 +41,7 @@ export var Message = /*#__PURE__*/function (_Component) {
|
|
|
40
41
|
|
|
41
42
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
42
43
|
_this.delayClose = useDelayClose(_this.close, _this.get('duration'));
|
|
44
|
+
_this.config = useConfigContext();
|
|
43
45
|
return _this;
|
|
44
46
|
}
|
|
45
47
|
|
|
@@ -4,12 +4,8 @@ import { Button } from '../button';
|
|
|
4
4
|
import { Icon } from '../icon';
|
|
5
5
|
import { getRestProps } from '../utils';
|
|
6
6
|
import { makeMessageStyles } from './styles';
|
|
7
|
-
var _$tmp0 = {
|
|
8
|
-
'className': 'k-icon-close',
|
|
9
|
-
'hoverable': true
|
|
10
|
-
};
|
|
11
7
|
export default function ($props, $blocks, $__proto__) {
|
|
12
|
-
var _classNameObj, _$cn2;
|
|
8
|
+
var _classNameObj, _$cn2, _$cn3;
|
|
13
9
|
|
|
14
10
|
$blocks || ($blocks = {});
|
|
15
11
|
$props || ($props = {});
|
|
@@ -22,9 +18,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
22
18
|
closable = _this$get.closable,
|
|
23
19
|
hideIcon = _this$get.hideIcon;
|
|
24
20
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
}, _classNameObj["k-" + type] = type, _classNameObj[makeMessageStyles()] = true, _classNameObj);
|
|
21
|
+
var k = this.config.k;
|
|
22
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-message"] = true, _classNameObj[k + "-" + type] = type, _classNameObj[makeMessageStyles(k)] = true, _classNameObj);
|
|
28
23
|
var iconMap = {
|
|
29
24
|
info: 'information-fill',
|
|
30
25
|
warning: 'warning-fill',
|
|
@@ -36,18 +31,18 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
36
31
|
'ev-mouseenter': this.delayClose.onMouseEnter,
|
|
37
32
|
'ev-mouseleave': this.delayClose.onMouseLeave
|
|
38
33
|
}), _$ce(2, 'div', [_$ce(2, 'div', [!hideIcon ? _$cc(Icon, {
|
|
39
|
-
'className': _$cn((_$cn2 = {}, _$cn2["
|
|
40
|
-
}) : undefined, typeof content === 'string' || typeof content === 'number' ? _$ce(2, 'div', null, 1,
|
|
34
|
+
'className': _$cn((_$cn2 = {}, _$cn2[k + "-icon-" + (iconMap[type] || iconMap.info)] = true, _$cn2[k + "-message-icon"] = true, _$cn2))
|
|
35
|
+
}) : undefined, typeof content === 'string' || typeof content === 'number' ? _$ce(2, 'div', null, 1, _$cn(k + "-message-content"), {
|
|
41
36
|
'innerHTML': content
|
|
42
|
-
}) : _$ce(2, 'div', children, 0,
|
|
43
|
-
"k-message-wrapper": true,
|
|
44
|
-
"k-with-icon": !hideIcon
|
|
45
|
-
})), closable ? _$cc(Button, {
|
|
37
|
+
}) : _$ce(2, 'div', children, 0, _$cn(k + "-message-content"))], 0, _$cn((_$cn3 = {}, _$cn3[k + "-message-wrapper"] = true, _$cn3[k + "-with-icon"] = !hideIcon, _$cn3))), closable ? _$cc(Button, {
|
|
46
38
|
'type': 'none',
|
|
47
39
|
'icon': true,
|
|
48
|
-
'className':
|
|
40
|
+
'className': _$cn(k + "-message-close"),
|
|
49
41
|
'ev-click': this.close,
|
|
50
|
-
'children': _$cc(Icon,
|
|
51
|
-
|
|
42
|
+
'children': _$cc(Icon, {
|
|
43
|
+
'className': _$cn(k + "-icon-close"),
|
|
44
|
+
'hoverable': true
|
|
45
|
+
})
|
|
46
|
+
}) : undefined], 0, _$cn(k + "-message-container")));
|
|
52
47
|
}
|
|
53
48
|
;
|
|
@@ -3,6 +3,7 @@ import type { Message } from './message';
|
|
|
3
3
|
export declare class Messages extends Component {
|
|
4
4
|
static template: string | import("intact").Template<any>;
|
|
5
5
|
private messages;
|
|
6
|
+
private config;
|
|
6
7
|
notice(message: VNodeComponentClass<Message>): void;
|
|
7
8
|
delete(key: number | string): void;
|
|
8
9
|
}
|
|
@@ -4,6 +4,7 @@ import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js/instance/
|
|
|
4
4
|
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
5
5
|
import { Component } from 'intact-react';
|
|
6
6
|
import template from './messages.vdt';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
7
8
|
export var Messages = /*#__PURE__*/function (_Component) {
|
|
8
9
|
_inheritsLoose(Messages, _Component);
|
|
9
10
|
|
|
@@ -18,6 +19,7 @@ export var Messages = /*#__PURE__*/function (_Component) {
|
|
|
18
19
|
|
|
19
20
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
20
21
|
_this.messages = [];
|
|
22
|
+
_this.config = useConfigContext();
|
|
21
23
|
return _this;
|
|
22
24
|
}
|
|
23
25
|
|
|
@@ -7,12 +7,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
7
7
|
$blocks || ($blocks = {});
|
|
8
8
|
$props || ($props = {});
|
|
9
9
|
var $this = this;
|
|
10
|
+
var k = this.config.k;
|
|
10
11
|
return _$ce(2, 'div', _$cc(TransitionGroup, {
|
|
11
12
|
'children': _$ma(this.messages, function ($value, $key) {
|
|
12
13
|
return $value;
|
|
13
14
|
}, $this)
|
|
14
|
-
}), 2, _$cn((_$cn2 = {
|
|
15
|
-
"k-messages": true
|
|
16
|
-
}, _$cn2[makeMessagesStyles()] = true, _$cn2)));
|
|
15
|
+
}), 2, _$cn((_$cn2 = {}, _$cn2[k + "-messages"] = true, _$cn2[makeMessagesStyles(k)] = true, _$cn2)));
|
|
17
16
|
}
|
|
18
17
|
;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeMessagesStyles(): string;
|
|
3
|
-
export declare function makeMessageStyles(): string;
|
|
2
|
+
export declare function makeMessagesStyles(k: string): string;
|
|
3
|
+
export declare function makeMessageStyles(k: string): string;
|
|
@@ -51,14 +51,14 @@ setDefault(function () {
|
|
|
51
51
|
message: defaults
|
|
52
52
|
}).message;
|
|
53
53
|
});
|
|
54
|
-
export function makeMessagesStyles() {
|
|
54
|
+
export function makeMessagesStyles(k) {
|
|
55
55
|
return /*#__PURE__*/css("position:fixed;top:", message.top, ";left:", message.left, ";width:100%;pointer-events:none;z-index:", theme.maxZIndex + 1, ";");
|
|
56
56
|
}
|
|
57
|
-
export function makeMessageStyles() {
|
|
57
|
+
export function makeMessageStyles(k) {
|
|
58
58
|
var _context;
|
|
59
59
|
|
|
60
|
-
return /*#__PURE__*/css("text-align:center;width:100%;font-size:", message.fontSize, ";color:", message.color, ";.k-message-container{display:inline-block;box-shadow:", message.boxShadow, ";border-radius:", message.borderRadius, ";margin-bottom:", message.gap, ";pointer-events:all;min-width:", message.minWidth, ";max-width:", message.maxWidth, ";position:relative;text-align:", message.textAlign, ";min-height:", message.minHeight, ";}.k-message-wrapper{position:relative;display:inline-block;&.k-with-icon{padding-left:calc(", message.icon.left, " + 14px);}}.k-message-content{display:inline-block;padding:", message.padding, ";vertical-align:middle;word-break:
|
|
60
|
+
return /*#__PURE__*/css("text-align:center;width:100%;font-size:", message.fontSize, ";color:", message.color, ";.", k, "-message-container{display:inline-block;box-shadow:", message.boxShadow, ";border-radius:", message.borderRadius, ";margin-bottom:", message.gap, ";pointer-events:all;min-width:", message.minWidth, ";max-width:", message.maxWidth, ";position:relative;text-align:", message.textAlign, ";min-height:", message.minHeight, ";}.", k, "-message-wrapper{position:relative;display:inline-block;&.", k, "-with-icon{padding-left:calc(", message.icon.left, " + 14px);}}.", k, "-message-content{display:inline-block;padding:", message.padding, ";vertical-align:middle;word-break:bre.", k, "-word;word-wrap:bre.", k, "-word;}.", k, "-message-close{vertical-align:middle;position:absolute;right:0;top:0;&:hover{background:none;}}.", k, "-message-icon{position:absolute;left:", message.icon.left, ";top:", message.icon.top, ";font-size:", message.icon.fontSize, ";}", _mapInstanceProperty(_context = ['info', 'error', 'success', 'warning']).call(_context, function (type) {
|
|
61
61
|
var color = theme.color[type === 'error' ? 'danger' : type];
|
|
62
|
-
return /*#__PURE__*/css("&.k-", type, "{.k-message-container{background:", palette(color, -4), ";}.k-message-icon{color:", color, ";}}");
|
|
62
|
+
return /*#__PURE__*/css("&.", k, "-", type, "{.", k, "-message-container{background:", palette(color, -4), ";}.", k, "-message-icon{color:", color, ";}}");
|
|
63
63
|
}), "&.transition-enter-from,&.transition-leave-to{opacity:0;transform:", message.transform, ";}&.transition-enter-active,&.transition-leave-active{transition:transform ", message.transition, ",opacity ", message.transition, ";}&.transition-move{transition:transform ", message.transition, ";}");
|
|
64
64
|
}
|
|
@@ -29,6 +29,7 @@ export declare class Pagination extends Component<PaginationProps, PaginationEve
|
|
|
29
29
|
static defaults: () => Partial<PaginationProps>;
|
|
30
30
|
static events: Events<PaginationEvents>;
|
|
31
31
|
private ignore;
|
|
32
|
+
private config;
|
|
32
33
|
init(): void;
|
|
33
34
|
changePage(page: number): void;
|
|
34
35
|
private prev;
|
|
@@ -5,6 +5,7 @@ import { Component } from 'intact-react';
|
|
|
5
5
|
import template from './index.vdt';
|
|
6
6
|
import { sizes } from '../../styles/utils';
|
|
7
7
|
import { bind } from '../utils';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
8
9
|
var typeDefs = {
|
|
9
10
|
size: sizes,
|
|
10
11
|
counts: [Number, String],
|
|
@@ -51,6 +52,7 @@ export var Pagination = /*#__PURE__*/function (_Component) {
|
|
|
51
52
|
|
|
52
53
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
53
54
|
_this.ignore = false;
|
|
55
|
+
_this.config = useConfigContext();
|
|
54
56
|
return _this;
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
3
|
-
import { createCommentVNode as _$ccv, createUnknownComponentVNode as _$cc,
|
|
3
|
+
import { createCommentVNode as _$ccv, createUnknownComponentVNode as _$cc, className as _$cn, createElementVNode as _$ce, createTextVNode as _$ct, createVNode as _$cv, map as _$ma } from 'intact-react';
|
|
4
4
|
import { getRestProps, mapChildren } from '../utils';
|
|
5
5
|
import { ButtonGroup, Button } from '../button';
|
|
6
6
|
import { Select, Option } from '../select';
|
|
@@ -8,12 +8,6 @@ import { Input } from '../input';
|
|
|
8
8
|
import { Icon } from '../icon';
|
|
9
9
|
import { _$ } from '../../i18n';
|
|
10
10
|
import { makeStyles } from './styles';
|
|
11
|
-
var _$tmp0 = {
|
|
12
|
-
'className': 'k-icon-left'
|
|
13
|
-
};
|
|
14
|
-
var _$tmp1 = {
|
|
15
|
-
'className': 'k-icon-right'
|
|
16
|
-
};
|
|
17
11
|
export default function ($props, $blocks, $__proto__) {
|
|
18
12
|
var _classNameObj;
|
|
19
13
|
|
|
@@ -38,9 +32,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
38
32
|
disablePage = _this$get.disablePage;
|
|
39
33
|
|
|
40
34
|
if (!total) return _$ccv(' pagination ');
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
}, _classNameObj[className] = className, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-flat'] = flat, _classNameObj['k-simple'] = simple, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
35
|
+
var k = this.config.k;
|
|
36
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-pagination"] = true, _classNameObj[className] = className, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-flat"] = flat, _classNameObj[k + "-simple"] = simple, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
44
37
|
var type = flat ? 'flat' : simple ? 'none' : 'default';
|
|
45
38
|
var totalPages = Math.ceil(total / limit) || 0;
|
|
46
39
|
|
|
@@ -72,7 +65,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
72
65
|
'type': type,
|
|
73
66
|
'size': size,
|
|
74
67
|
'icon': true,
|
|
75
|
-
'className':
|
|
68
|
+
'className': _$cn(k + "-pagination-ellipsis"),
|
|
76
69
|
'ev-click': callback,
|
|
77
70
|
'children': '...'
|
|
78
71
|
});
|
|
@@ -131,14 +124,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
131
124
|
'autoWidth': true,
|
|
132
125
|
'value': value,
|
|
133
126
|
'ev-change': this.goto
|
|
134
|
-
}), _$ce(2, 'span', [_$ct(' / '), totalPages], 0,
|
|
127
|
+
}), _$ce(2, 'span', [_$ct(' / '), totalPages], 0, _$cn(k + "-pagination-text"))];
|
|
135
128
|
}
|
|
136
129
|
|
|
137
130
|
return _$cv('div', _extends({
|
|
138
131
|
'className': _$cn(classNameObj)
|
|
139
132
|
}, getRestProps(this)), [showTotal && !simple ? _$ce(2, 'div', _$('共 {n} 条', {
|
|
140
133
|
n: total
|
|
141
|
-
}), 0,
|
|
134
|
+
}), 0, _$cn(k + "-pagination-total")) : undefined, _$cc(ButtonGroup, {
|
|
142
135
|
'checkType': 'radio',
|
|
143
136
|
'children': [_$cc(Button, {
|
|
144
137
|
'icon': true,
|
|
@@ -146,14 +139,18 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
146
139
|
'type': 'none',
|
|
147
140
|
'disabled': value <= 1 || !!(disablePage && disablePage(value - 1, limit)),
|
|
148
141
|
'ev-click': this.prev,
|
|
149
|
-
'children': _$cc(Icon,
|
|
142
|
+
'children': _$cc(Icon, {
|
|
143
|
+
'className': _$cn(k + "-icon-left")
|
|
144
|
+
})
|
|
150
145
|
}), paginationItems, _$cc(Button, {
|
|
151
146
|
'icon': true,
|
|
152
147
|
'size': size,
|
|
153
148
|
'type': 'none',
|
|
154
149
|
'disabled': value >= totalPages || !!(disablePage && disablePage(value + 1, limit)),
|
|
155
150
|
'ev-click': this.next,
|
|
156
|
-
'children': _$cc(Icon,
|
|
151
|
+
'children': _$cc(Icon, {
|
|
152
|
+
'className': _$cn(k + "-icon-right")
|
|
153
|
+
})
|
|
157
154
|
})],
|
|
158
155
|
'ev-$model:value': function ev$modelValue($v) {
|
|
159
156
|
$this.set('value', $v);
|
|
@@ -174,11 +171,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
174
171
|
$this.set('limit', $v);
|
|
175
172
|
},
|
|
176
173
|
'value': $this.get('limit')
|
|
177
|
-
}), 2,
|
|
174
|
+
}), 2, _$cn(k + "-pagination-limits")) : undefined, showGoto ? _$ce(2, 'div', [_$ce(2, 'span', _$('前往'), 0, 'c-middle'), _$cc(Input, {
|
|
178
175
|
'size': size,
|
|
179
176
|
'value': value,
|
|
180
177
|
'ev-change': this.goto,
|
|
181
178
|
'flat': flat
|
|
182
|
-
}), _$ce(2, 'span', _$('页'), 0, 'c-middle')], 4,
|
|
179
|
+
}), _$ce(2, 'span', _$('页'), 0, 'c-middle')], 4, _$cn(k + "-pagination-goto")) : undefined] : undefined]);
|
|
183
180
|
}
|
|
184
181
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -60,10 +60,10 @@ setDefault(function () {
|
|
|
60
60
|
pagination: defaults
|
|
61
61
|
}).pagination;
|
|
62
62
|
});
|
|
63
|
-
export function makeStyles() {
|
|
64
|
-
return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.k-pagination-ellipsis{background-color:transparent;border-color:transparent;}.k-btns{.k-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}}.k-icon{font-size:18px;}}.k-pagination-goto{.k-input{font-size:inherit;width:", pagination.goto.width, ";margin:", pagination.goto.gap, ";}.k-input-inner{text-align:center;}}.k-select{width:auto;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
63
|
+
export function makeStyles(k) {
|
|
64
|
+
return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.", k, "-pagination-ellipsis{background-color:transparent;border-color:transparent;}.", k, "-btns{.", k, "-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}}.", k, "-icon{font-size:18px;}}.", k, "-pagination-goto{.", k, "-input{font-size:inherit;width:", pagination.goto.width, ";margin:", pagination.goto.gap, ";}.", k, "-input-inner{text-align:center;}}.", k, "-select{width:auto;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
65
65
|
var styles = pagination[size];
|
|
66
66
|
var btnStyles = button[size];
|
|
67
|
-
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";.k-btn{margin-right:", styles.btnGap, ";min-width:", btnStyles.height, ";.k-icon{font-size:", styles.iconFontSize, ";}}}");
|
|
68
|
-
}), "&.k-flat{.k-select{&,&:hover,&.k-show{border-color:transparent;}}}&.k-simple{.k-btn{margin:0;}.k-input-inner{text-align:center;}.k-pagination-text{vertical-align:middle;}}");
|
|
67
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", styles.fontSize, ";.", k, "-btn{margin-right:", styles.btnGap, ";min-width:", btnStyles.height, ";.", k, "-icon{font-size:", styles.iconFontSize, ";}}}");
|
|
68
|
+
}), "&.", k, "-flat{.", k, "-select{&,&:hover,&.", k, "-show{border-color:transparent;}}}&.", k, "-simple{.", k, "-btn{margin:0;}.", k, "-input-inner{text-align:center;}.", k, "-pagination-text{vertical-align:middle;}}");
|
|
69
69
|
}
|
|
@@ -15,13 +15,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
15
15
|
title = _this$get.title,
|
|
16
16
|
content = _this$get.content;
|
|
17
17
|
|
|
18
|
+
var k = this.config.k;
|
|
18
19
|
var iconMap = {
|
|
19
20
|
info: 'information-fill',
|
|
20
21
|
warning: 'warning-fill',
|
|
21
22
|
success: 'success-fill',
|
|
22
23
|
error: 'error-fill'
|
|
23
24
|
};
|
|
24
|
-
var classNameObj = (_classNameObj = {}, _classNameObj[makeStyles()] = true, _classNameObj[
|
|
25
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[makeStyles(k)] = true, _classNameObj[k + "-popover"] = true, _classNameObj);
|
|
25
26
|
return _$su.call($this, {
|
|
26
27
|
'className': _$cn(classNameObj)
|
|
27
28
|
}, function ($blocks) {
|
|
@@ -30,7 +31,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
30
31
|
|
|
31
32
|
return (_$blocks['body'] = function ($super) {
|
|
32
33
|
return [title || $blocks.title ? _$ce(2, 'div', [type ? _$cc(Icon, {
|
|
33
|
-
'className': _$cn("
|
|
34
|
+
'className': _$cn(k + "-icon-" + iconMap[type] + " " + k + "-popover-icon"),
|
|
34
35
|
'color': type === 'error' ? 'danger' : type,
|
|
35
36
|
'size': 'large'
|
|
36
37
|
}) : undefined, (_$blocks['title'] = function ($super) {
|
|
@@ -43,7 +44,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
46
|
-
}, __$blocks['title'](_$no))], 0,
|
|
47
|
+
}, __$blocks['title'](_$no))], 0, _$cn(k + "-popover-title")) : undefined, content || $blocks.content ? _$ce(2, 'div', (_$blocks['content'] = function ($super) {
|
|
47
48
|
return content;
|
|
48
49
|
}, __$blocks['content'] = function ($super, data) {
|
|
49
50
|
var block = $blocks['content'];
|
|
@@ -53,7 +54,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
56
|
-
}, __$blocks['content'](_$no)), 0,
|
|
57
|
+
}, __$blocks['content'](_$no)), 0, _$cn(k + "-popover-content")) : undefined];
|
|
57
58
|
}, __$blocks['body'] = function ($super, data) {
|
|
58
59
|
var block = $blocks['body'];
|
|
59
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function makeStyles(): string;
|
|
1
|
+
export default function makeStyles(k: string): string;
|
|
@@ -17,6 +17,6 @@ setDefault(function () {
|
|
|
17
17
|
popover: defaults
|
|
18
18
|
}).popover;
|
|
19
19
|
});
|
|
20
|
-
export default function makeStyles() {
|
|
21
|
-
return /*#__PURE__*/css("&.k-tooltip-content.k-popover{width:", popover.width, ";padding:", popover.padding, ";.k-popover-title{display:flex;align-items:center;font-size:", popover.title.fontSize, ";line-height:", popover.title.lineHeight, ";font-weight:", popover.title.fontWeight, ";}.k-popover-icon{margin-right:", popover.gap, ";}.k-popover-content{margin-top:", popover.gap, ";}.k-tooltip-footer{text-align:right;}}");
|
|
20
|
+
export default function makeStyles(k) {
|
|
21
|
+
return /*#__PURE__*/css("&.", k, "-tooltip-content.", k, "-popover{width:", popover.width, ";padding:", popover.padding, ";.", k, "-popover-title{display:flex;align-items:center;font-size:", popover.title.fontSize, ";line-height:", popover.title.lineHeight, ";font-weight:", popover.title.fontWeight, ";}.", k, "-popover-icon{margin-right:", popover.gap, ";}.", k, "-popover-content{margin-top:", popover.gap, ";}.", k, "-tooltip-footer{text-align:right;}}");
|
|
22
22
|
}
|
package/components/portal.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class Portal<T extends PortalProps = PortalProps> extends Compone
|
|
|
11
11
|
mountedQueue?: Function[];
|
|
12
12
|
mountedDone?: boolean;
|
|
13
13
|
$isPortal: boolean;
|
|
14
|
+
private config;
|
|
14
15
|
$render(lastVNode: VNodeComponentClass<this> | null, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[] & {
|
|
15
16
|
priority?: Function[];
|
|
16
17
|
}): void;
|
package/components/portal.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Component, createCommentVNode, createTextVNode, mount, patch, remove, i
|
|
|
4
4
|
import { isString } from 'intact-shared';
|
|
5
5
|
import { DIALOG } from './dialog/constants';
|
|
6
6
|
import { BaseDialog } from './dialog/base';
|
|
7
|
+
import { useConfigContext } from './config';
|
|
7
8
|
var typeDefs = {
|
|
8
9
|
container: [String, Function]
|
|
9
10
|
};
|
|
@@ -25,6 +26,7 @@ export var Portal = /*#__PURE__*/function (_Component) {
|
|
|
25
26
|
_this.mountedQueue = void 0;
|
|
26
27
|
_this.mountedDone = void 0;
|
|
27
28
|
_this.$isPortal = true;
|
|
29
|
+
_this.config = useConfigContext();
|
|
28
30
|
return _this;
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -115,7 +117,7 @@ export var Portal = /*#__PURE__*/function (_Component) {
|
|
|
115
117
|
this.container = document.body;
|
|
116
118
|
} else {
|
|
117
119
|
// find the closest dialog if exists
|
|
118
|
-
this.container = parentDom.closest(
|
|
120
|
+
this.container = parentDom.closest(this.config.k + "-dialog") || document.body;
|
|
119
121
|
}
|
|
120
122
|
/**
|
|
121
123
|
* @FIXME: We cannot get parent ref from sub component in Vue
|
|
@@ -23,6 +23,7 @@ export declare class Progress extends Component<ProgressProps> {
|
|
|
23
23
|
static defaults: () => Partial<ProgressProps>;
|
|
24
24
|
status: import("../../hooks/useState").State<Status>;
|
|
25
25
|
color: import("../../hooks/useState").State<string | Color[] | ((percent: number) => string) | undefined>;
|
|
26
|
+
private config;
|
|
26
27
|
init(): void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -4,6 +4,7 @@ import { Component } from 'intact-react';
|
|
|
4
4
|
import template from './index.vdt';
|
|
5
5
|
import { useStatus } from './useStatus';
|
|
6
6
|
import { useColor } from './useColor';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
7
8
|
;
|
|
8
9
|
var typeDefs = {
|
|
9
10
|
type: ['bar', 'circle'],
|
|
@@ -42,6 +43,7 @@ export var Progress = /*#__PURE__*/function (_Component) {
|
|
|
42
43
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
43
44
|
_this.status = useStatus();
|
|
44
45
|
_this.color = useColor();
|
|
46
|
+
_this.config = useConfigContext();
|
|
45
47
|
return _this;
|
|
46
48
|
}
|
|
47
49
|
|