@king-design/react 3.0.0 → 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/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +268 -268
- 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/dropdown/usePosition.js +2 -2
- 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 +2 -0
- package/components/layout/body.js +11 -5
- package/components/layout/footer.d.ts +1 -0
- package/components/layout/footer.js +15 -4
- package/components/layout/header.d.ts +3 -0
- package/components/layout/header.js +10 -6
- package/components/layout/helpers.d.ts +1 -0
- package/components/layout/helpers.js +1 -0
- package/components/layout/index.spec.d.ts +1 -0
- package/components/layout/index.spec.js +53 -0
- package/components/layout/layout.d.ts +2 -0
- package/components/layout/layout.js +7 -5
- package/components/layout/styles.d.ts +3 -3
- package/components/layout/styles.js +11 -11
- 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 +11 -11
- package/components/menu/useDropdown.js +6 -1
- 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/index.spec.js +1 -1
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +21 -2
- 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 +2 -1
- package/components/table/table.js +3 -1
- 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/usePagination.js +1 -1
- 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 +3 -1
- package/components/utils.js +36 -9
- package/components/virtual.js +5 -2
- 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 +2 -2
- 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/styles/utils.d.ts +1 -0
- package/styles/utils.js +3 -0
- 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
|
@@ -5,30 +5,6 @@ import { Icon } from '../icon';
|
|
|
5
5
|
import { _$ } from '../../i18n';
|
|
6
6
|
import { makeCalendarStyles } from './styles';
|
|
7
7
|
import { getNowDate } from './helpers';
|
|
8
|
-
var _$tmp0 = {
|
|
9
|
-
'className': 'k-icon-left',
|
|
10
|
-
'size': 'small'
|
|
11
|
-
};
|
|
12
|
-
var _$tmp1 = {
|
|
13
|
-
'className': 'k-icon-left',
|
|
14
|
-
'size': 'small'
|
|
15
|
-
};
|
|
16
|
-
var _$tmp2 = {
|
|
17
|
-
'className': 'k-icon-left',
|
|
18
|
-
'size': 'small'
|
|
19
|
-
};
|
|
20
|
-
var _$tmp3 = {
|
|
21
|
-
'className': 'k-icon-right',
|
|
22
|
-
'size': 'small'
|
|
23
|
-
};
|
|
24
|
-
var _$tmp4 = {
|
|
25
|
-
'className': 'k-icon-right',
|
|
26
|
-
'size': 'small'
|
|
27
|
-
};
|
|
28
|
-
var _$tmp5 = {
|
|
29
|
-
'className': 'k-icon-right',
|
|
30
|
-
'size': 'small'
|
|
31
|
-
};
|
|
32
8
|
export default function ($props, $blocks, $__proto__) {
|
|
33
9
|
var _classNameObj;
|
|
34
10
|
|
|
@@ -38,9 +14,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
38
14
|
var type = this.type.value;
|
|
39
15
|
var isYear = type === 'year';
|
|
40
16
|
var isYearOrMonth = isYear || type === 'month';
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
}, _classNameObj[makeCalendarStyles()] = true, _classNameObj);
|
|
17
|
+
var k = this.config.k;
|
|
18
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-datepicker-calendar"] = true, _classNameObj[makeCalendarStyles(k)] = true, _classNameObj);
|
|
44
19
|
var now = getNowDate();
|
|
45
20
|
var _this$datepicker$focu = this.datepicker.focusDate,
|
|
46
21
|
focusDate = _this$datepicker$focu.focusDate,
|
|
@@ -48,15 +23,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
48
23
|
|
|
49
24
|
var getItems = function getItems(data, onClick) {
|
|
50
25
|
return _$ma(data, function ($value, $key) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"k-active": $value.isActive,
|
|
55
|
-
"k-today": $value.isToday,
|
|
56
|
-
"k-disabled": $value.isDisabled,
|
|
57
|
-
"k-hover": $value.isHover,
|
|
58
|
-
"k-in-range": $value.isInRange
|
|
59
|
-
}), {
|
|
26
|
+
var _$cn2;
|
|
27
|
+
|
|
28
|
+
return _$ce(2, 'div', _$ce(2, 'div', $value.label, 0, _$cn(k + "-value")), 2, _$cn((_$cn2 = {}, _$cn2[k + "-calendar-item"] = true, _$cn2[k + "-exceed"] = $value.isExceed, _$cn2[k + "-active"] = $value.isActive, _$cn2[k + "-today"] = $value.isToday, _$cn2[k + "-disabled"] = $value.isDisabled, _$cn2[k + "-hover"] = $value.isHover, _$cn2[k + "-in-range"] = $value.isInRange, _$cn2)), {
|
|
60
29
|
'ev-click': !$value.isDisabled ? function (e) {
|
|
61
30
|
e._ignore = true;
|
|
62
31
|
onClick($value.value);
|
|
@@ -83,43 +52,61 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
83
52
|
'icon': true,
|
|
84
53
|
'type': 'none',
|
|
85
54
|
'size': 'small',
|
|
86
|
-
'className':
|
|
55
|
+
'className': _$cn(k + "-prev"),
|
|
87
56
|
'tagName': 'div',
|
|
88
57
|
'ev-click': isYear ? prevTenYears : prevYear,
|
|
89
|
-
'children': [_$cc(Icon,
|
|
58
|
+
'children': [_$cc(Icon, {
|
|
59
|
+
'className': _$cn(k + "-icon-left"),
|
|
60
|
+
'size': 'small'
|
|
61
|
+
}), _$cc(Icon, {
|
|
62
|
+
'className': _$cn(k + "-icon-left"),
|
|
63
|
+
'size': 'small'
|
|
64
|
+
})]
|
|
90
65
|
}), !isYearOrMonth ? _$cc(Button, {
|
|
91
66
|
'icon': true,
|
|
92
67
|
'type': 'none',
|
|
93
68
|
'size': 'small',
|
|
94
|
-
'className':
|
|
69
|
+
'className': _$cn(k + "-prev"),
|
|
95
70
|
'tagName': 'div',
|
|
96
71
|
'ev-click': prevMonth,
|
|
97
|
-
'children': _$cc(Icon,
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
'children': _$cc(Icon, {
|
|
73
|
+
'className': _$cn(k + "-icon-left"),
|
|
74
|
+
'size': 'small'
|
|
75
|
+
})
|
|
76
|
+
}) : undefined], 0, _$cn(k + "-left-btns")), _$ce(2, 'div', !isYear ? _$ma(getDateLabel(), function ($value, $key) {
|
|
77
|
+
return _$ce(2, 'span', $value.value, 0, _$cn(k + "-month-value"), {
|
|
100
78
|
'ev-click': $value.onClick
|
|
101
79
|
});
|
|
102
|
-
}, $this) : _$ce(2, 'span', this.years.getYearLabel(), 0,
|
|
80
|
+
}, $this) : _$ce(2, 'span', this.years.getYearLabel(), 0, _$cn(k + "-month-value")), 0, _$cn(k + "-month-values")), _$ce(2, 'div', [!isYearOrMonth ? _$cc(Button, {
|
|
103
81
|
'icon': true,
|
|
104
82
|
'type': 'none',
|
|
105
83
|
'size': 'small',
|
|
106
|
-
'className':
|
|
84
|
+
'className': _$cn(k + "-next"),
|
|
107
85
|
'tagName': 'div',
|
|
108
86
|
'ev-click': nextMonth,
|
|
109
|
-
'children': _$cc(Icon,
|
|
87
|
+
'children': _$cc(Icon, {
|
|
88
|
+
'className': _$cn(k + "-icon-right"),
|
|
89
|
+
'size': 'small'
|
|
90
|
+
})
|
|
110
91
|
}) : undefined, _$cc(Button, {
|
|
111
92
|
'icon': true,
|
|
112
93
|
'type': 'none',
|
|
113
94
|
'size': 'small',
|
|
114
|
-
'className':
|
|
95
|
+
'className': _$cn(k + "-next"),
|
|
115
96
|
'tagName': 'div',
|
|
116
97
|
'ev-click': isYear ? nextTenYears : nextYear,
|
|
117
|
-
'children': [_$cc(Icon,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
'children': [_$cc(Icon, {
|
|
99
|
+
'className': _$cn(k + "-icon-right"),
|
|
100
|
+
'size': 'small'
|
|
101
|
+
}), _$cc(Icon, {
|
|
102
|
+
'className': _$cn(k + "-icon-right"),
|
|
103
|
+
'size': 'small'
|
|
104
|
+
})]
|
|
105
|
+
})], 0, _$cn(k + "-right-btns"))], 4, _$cn(k + "-datepicker-month")), !isYearOrMonth ? [_$ce(2, 'div', _$ma([_$('日'), _$('一'), _$('二'), _$('三'), _$('四'), _$('五'), _$('六')], function ($value, $key) {
|
|
106
|
+
return _$ce(2, 'div', $value, 0, _$cn(k + "-weekday"));
|
|
107
|
+
}, $this), 4, _$cn(k + "-weekdays")), _$ce(2, 'div', getItems(getDays(now), onClickDay), 0, _$cn(k + "-days"), {
|
|
121
108
|
'ev-mouseleave': resetFocusDate
|
|
122
|
-
})] : _$ce(2, 'div', isYear ? getItems(this.years.getYears(now), this.years.onClick) : getItems(this.months.getMonths(now), this.months.onClick), 0,
|
|
109
|
+
})] : _$ce(2, 'div', isYear ? getItems(this.years.getYears(now), this.years.onClick) : getItems(this.months.getMonths(now), this.months.onClick), 0, _$cn(k + "-years"), {
|
|
123
110
|
'ev-mouseleave': resetFocusDate
|
|
124
111
|
})], 0, _$cn(classNameObj));
|
|
125
112
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
|
-
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc,
|
|
2
|
+
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, createTextVNode as _$ct } from 'intact-react';
|
|
3
3
|
import { linkEvent } from 'intact';
|
|
4
4
|
import { DropdownMenu } from '../dropdown';
|
|
5
5
|
import { DatepickerCalendar } from './calendar';
|
|
@@ -11,12 +11,6 @@ import { makePanelStyles } from './styles';
|
|
|
11
11
|
import { PanelTypes, PanelFlags } from './usePanel';
|
|
12
12
|
import { isFunction } from 'intact-shared';
|
|
13
13
|
import { Tabs, Tab } from '../tabs';
|
|
14
|
-
var _$tmp0 = {
|
|
15
|
-
'className': 'k-datepicker'
|
|
16
|
-
};
|
|
17
|
-
var _$tmp1 = {
|
|
18
|
-
'className': 'k-icon-calendar'
|
|
19
|
-
};
|
|
20
14
|
export default function ($props, $blocks, $__proto__) {
|
|
21
15
|
var _classNameObj,
|
|
22
16
|
_this = this;
|
|
@@ -39,9 +33,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
33
|
onChangeTime = _this$value.onChangeTime,
|
|
40
34
|
onChangeDateForRange = _this$value.onChangeDateForRange,
|
|
41
35
|
getTimeValue = _this$value.getTimeValue;
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
}, _classNameObj[className] = className, _classNameObj[makePanelStyles()] = true, _classNameObj);
|
|
36
|
+
var k = this.config.k;
|
|
37
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-datepicker-content"] = true, _classNameObj[className] = className, _classNameObj[makePanelStyles(k)] = true, _classNameObj);
|
|
45
38
|
var _this$disabled = this.disabled,
|
|
46
39
|
isDisabledTime = _this$disabled.isDisabledTime,
|
|
47
40
|
isDisabledConfirm = _this$disabled.isDisabledConfirm;
|
|
@@ -95,10 +88,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
95
88
|
'format': _this.formats.getValueFormat(),
|
|
96
89
|
'flag': flag,
|
|
97
90
|
'isDisabledTime': isDisabledTime
|
|
98
|
-
})], 0,
|
|
91
|
+
})], 0, _$cn(k + "-datepicker-calendar-wrapper"));
|
|
99
92
|
};
|
|
100
93
|
|
|
101
|
-
return _$su.call($this,
|
|
94
|
+
return _$su.call($this, {
|
|
95
|
+
'className': _$cn(k + "-datepicker")
|
|
96
|
+
}, function ($blocks) {
|
|
102
97
|
var _$blocks = {},
|
|
103
98
|
__$blocks = _$ex({}, $blocks);
|
|
104
99
|
|
|
@@ -109,17 +104,17 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
109
104
|
'className': _$cn(classNameObj),
|
|
110
105
|
'children': [shortcuts && shortcuts.length ? _$ce(2, 'div', _mapInstanceProperty(shortcuts).call(shortcuts, function ($value) {
|
|
111
106
|
var label = isFunction($value.label) ? $value.label() : $value.label;
|
|
112
|
-
return _$ce(2, 'div', label, 0,
|
|
107
|
+
return _$ce(2, 'div', label, 0, _$cn(k + "-datepicker-shortcut c-ellipsis"), {
|
|
113
108
|
'title': label,
|
|
114
109
|
'ev-click': linkEvent($value, _this2.setByShortcut)
|
|
115
110
|
});
|
|
116
|
-
}), 0,
|
|
111
|
+
}), 0, _$cn(k + "-datepicker-shortcuts")) : undefined, _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, _$cn(k + "-datepicker-calendars")), type === 'datetime' ? _$ce(2, 'div', _$cc(Button, {
|
|
117
112
|
'type': 'primary',
|
|
118
113
|
'size': 'small',
|
|
119
114
|
'disabled': isDisabledConfirm(),
|
|
120
115
|
'ev-click': onConfirm,
|
|
121
116
|
'children': _$('确定')
|
|
122
|
-
}), 2,
|
|
117
|
+
}), 2, _$cn(k + "-datepicker-footer")) : undefined], 0, _$cn(k + "-datepicker-wrapper"))]
|
|
123
118
|
});
|
|
124
119
|
}, __$blocks['base-menu'] = function ($super, data) {
|
|
125
120
|
var block = $blocks['base-menu'];
|
|
@@ -130,7 +125,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
130
125
|
|
|
131
126
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
132
127
|
}), (_$blocks['suffix'] = function ($super) {
|
|
133
|
-
return _$cc(Icon,
|
|
128
|
+
return _$cc(Icon, {
|
|
129
|
+
'className': _$cn(k + "-icon-calendar")
|
|
130
|
+
});
|
|
134
131
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
135
132
|
var block = $blocks['suffix'];
|
|
136
133
|
|
|
@@ -46,6 +46,6 @@ declare const defaults: {
|
|
|
46
46
|
};
|
|
47
47
|
declare let datepicker: typeof defaults;
|
|
48
48
|
export { datepicker };
|
|
49
|
-
export declare function makePanelStyles(): string;
|
|
50
|
-
export declare function makeCalendarStyles(): string;
|
|
51
|
-
export declare function makeTimeStyles(): string;
|
|
49
|
+
export declare function makePanelStyles(k: string): string;
|
|
50
|
+
export declare function makeCalendarStyles(k: string): string;
|
|
51
|
+
export declare function makeTimeStyles(k: string): string;
|
|
@@ -79,12 +79,12 @@ setDefault(function () {
|
|
|
79
79
|
}).datepicker;
|
|
80
80
|
});
|
|
81
81
|
export { datepicker };
|
|
82
|
-
export function makePanelStyles() {
|
|
83
|
-
return /*#__PURE__*/css("display:flex;.k-datepicker-shortcuts{width:", datepicker.shortcuts.width, ";padding:", datepicker.shortcuts.padding, ";border-right:", datepicker.border, ";}.k-datepicker-shortcut{height:", datepicker.shortcuts.shortcut.height, ";line-height:", datepicker.shortcuts.shortcut.height, ";padding:", datepicker.shortcuts.shortcut.padding, ";cursor:pointer;&:hover{background:", datepicker.shortcuts.shortcut.hoverBgcolor, ";}}.k-datepicker-calendars{display:flex;}.k-datepicker-calendar-wrapper{&:nth-child(2){border-left:", datepicker.border, ";}.k-tabs{border:none;.k-tabs-wrapper{float:none;}.k-tab{width:50%;}}}.k-datepicker-footer{border-top:", datepicker.border, ";padding:", datepicker.footer.padding, ";text-align:right;}");
|
|
82
|
+
export function makePanelStyles(k) {
|
|
83
|
+
return /*#__PURE__*/css("display:flex;.", k, "-datepicker-shortcuts{width:", datepicker.shortcuts.width, ";padding:", datepicker.shortcuts.padding, ";border-right:", datepicker.border, ";}.", k, "-datepicker-shortcut{height:", datepicker.shortcuts.shortcut.height, ";line-height:", datepicker.shortcuts.shortcut.height, ";padding:", datepicker.shortcuts.shortcut.padding, ";cursor:pointer;&:hover{background:", datepicker.shortcuts.shortcut.hoverBgcolor, ";}}.", k, "-datepicker-calendars{display:flex;}.", k, "-datepicker-calendar-wrapper{&:nth-child(2){border-left:", datepicker.border, ";}.", k, "-tabs{border:none;.", k, "-tabs-wrapper{float:none;}.", k, "-tab{width:50%;}}}.", k, "-datepicker-footer{border-top:", datepicker.border, ";padding:", datepicker.footer.padding, ";text-align:right;}");
|
|
84
84
|
}
|
|
85
|
-
export function makeCalendarStyles() {
|
|
86
|
-
return /*#__PURE__*/css("padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-datepicker-month{display:flex;padding:", datepicker.month.padding, ";}.k-prev .k-icon,.k-next .k-icon{margin:0 -5px!important;}.k-month-values{flex:1;font-size:14px;text-align:center;cursor:pointer;overflow:hidden;position:relative;}.k-month-value{margin:0 ", datepicker.month.valueGap, ";line-height:", theme.small.height, ";&:hover{color:", theme.color.primary, ";}},.k-weekdays{display:flex;border-bottom:", datepicker.border, ";padding:", datepicker.weekday.padding, ";}.k-weekday{flex:1;text-align:center;}.k-calendar-item{text-align:center;margin:", datepicker.item.gutter, ";aspect-ratio:1;display:flex;align-items:center;cursor:pointer;position:relative;border-radius:", datepicker.item.borderRadius, ";.k-value{border-radius:", datepicker.item.borderRadius, ";}&.k-hover{background:", datepicker.item.hoverBgColor, ";}&.k-exceed{color:", datepicker.item.exceedColor, ";}&.k-today .k-value{border:", datepicker.item.todayBorder, ";}&.k-active{background:", datepicker.item.active.bgColor, ";color:", datepicker.item.active.color, ";&.k-today .k-value{border-color:", datepicker.item.active.todayBorderColor, ";}}&.k-disabled{color:", datepicker.item.disabled.color, ";cursor:not-allowed;background:", datepicker.item.disabled.hoverBgColor, ";}&.k-in-range:after{content:'';display:block;position:absolute;box-sizing:content-box;background:", datepicker.item.range.bgColor, ";width:100%;height:100%;left:-", datepicker.item.gutter, ";padding:0 ", datepicker.item.gutter, ";z-index:-1;}.k-value{flex:1;display:flex;align-items:center;justify-content:center;height:100%;}}.k-days{display:grid;grid-template-columns:repeat(7, 1fr);}.k-years{display:grid;grid-template-columns:repeat(4, 1fr);}");
|
|
85
|
+
export function makeCalendarStyles(k) {
|
|
86
|
+
return /*#__PURE__*/css("padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.", k, "-datepicker-month{display:flex;padding:", datepicker.month.padding, ";}.", k, "-prev .", k, "-icon,.", k, "-next .", k, "-icon{margin:0 -5px!important;}.", k, "-month-values{flex:1;font-size:14px;text-align:center;cursor:pointer;overflow:hidden;position:relative;}.", k, "-month-value{margin:0 ", datepicker.month.valueGap, ";line-height:", theme.small.height, ";&:hover{color:", theme.color.primary, ";}},.", k, "-weekdays{display:flex;border-bottom:", datepicker.border, ";padding:", datepicker.weekday.padding, ";}.", k, "-weekday{flex:1;text-align:center;}.", k, "-calendar-item{text-align:center;margin:", datepicker.item.gutter, ";aspect-ratio:1;display:flex;align-items:center;cursor:pointer;position:relative;border-radius:", datepicker.item.borderRadius, ";.", k, "-value{border-radius:", datepicker.item.borderRadius, ";}&.", k, "-hover{background:", datepicker.item.hoverBgColor, ";}&.", k, "-exceed{color:", datepicker.item.exceedColor, ";}&.", k, "-today .", k, "-value{border:", datepicker.item.todayBorder, ";}&.", k, "-active{background:", datepicker.item.active.bgColor, ";color:", datepicker.item.active.color, ";&.", k, "-today .", k, "-value{border-color:", datepicker.item.active.todayBorderColor, ";}}&.", k, "-disabled{color:", datepicker.item.disabled.color, ";cursor:not-allowed;background:", datepicker.item.disabled.hoverBgColor, ";}&.", k, "-in-range:after{content:'';display:block;position:absolute;box-sizing:content-box;background:", datepicker.item.range.bgColor, ";width:100%;height:100%;left:-", datepicker.item.gutter, ";padding:0 ", datepicker.item.gutter, ";z-index:-1;}.", k, "-value{flex:1;display:flex;align-items:center;justify-content:center;height:100%;}}.", k, "-days{display:grid;grid-template-columns:repeat(7, 1fr);}.", k, "-years{display:grid;grid-template-columns:repeat(4, 1fr);}");
|
|
87
87
|
}
|
|
88
|
-
export function makeTimeStyles() {
|
|
89
|
-
return /*#__PURE__*/css("display:flex;padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-scroll-select{flex:1;height:305px;}");
|
|
88
|
+
export function makeTimeStyles(k) {
|
|
89
|
+
return /*#__PURE__*/css("display:flex;padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.", k, "-scroll-select{flex:1;height:305px;}");
|
|
90
90
|
}
|
|
@@ -21,6 +21,7 @@ export declare class DatepickerTime extends Component<DatepickerTimeProps> {
|
|
|
21
21
|
disableHours: import("../../hooks/useState").State<boolean>;
|
|
22
22
|
disableItem: (v: number, type: keyof Value) => boolean;
|
|
23
23
|
};
|
|
24
|
+
private config;
|
|
24
25
|
init(): void;
|
|
25
26
|
changeHour(v: number): void;
|
|
26
27
|
changeMinute(v: number): void;
|
|
@@ -7,6 +7,7 @@ import template from './time.vdt';
|
|
|
7
7
|
import { useState } from '../../hooks/useState';
|
|
8
8
|
import { bind } from '../utils';
|
|
9
9
|
import { getNowDate } from './helpers';
|
|
10
|
+
import { useConfigContext } from '../config';
|
|
10
11
|
var defaultValue = {
|
|
11
12
|
h: 0,
|
|
12
13
|
m: 0,
|
|
@@ -27,6 +28,7 @@ export var DatepickerTime = /*#__PURE__*/function (_Component) {
|
|
|
27
28
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
28
29
|
_this.value = useState(defaultValue);
|
|
29
30
|
_this.disabled = useDisable(_assertThisInitialized(_this));
|
|
31
|
+
_this.config = useConfigContext();
|
|
30
32
|
return _this;
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -14,9 +14,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
14
14
|
disableMinutes = _this$disabled.disableMinutes,
|
|
15
15
|
disableSeconds = _this$disabled.disableSeconds,
|
|
16
16
|
disableItem = _this$disabled.disableItem;
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
}, _classNameObj[makeTimeStyles()] = true, _classNameObj);
|
|
17
|
+
var k = this.config.k;
|
|
18
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-datepicker-time"] = true, _classNameObj[makeTimeStyles(k)] = true, _classNameObj);
|
|
20
19
|
return _$ce(2, 'div', [_$cc(ScrollSelect, {
|
|
21
20
|
'data': hours,
|
|
22
21
|
'value': value.h,
|
|
@@ -10,6 +10,7 @@ import mx from './mxgraph';
|
|
|
10
10
|
import { bind } from '../utils';
|
|
11
11
|
import { DIAGRAM } from './constants';
|
|
12
12
|
import { error, isNullOrUndefined } from 'intact-shared';
|
|
13
|
+
import { useConfigContext } from '../config';
|
|
13
14
|
var mxRubberband = mx.mxRubberband,
|
|
14
15
|
mxEvent = mx.mxEvent;
|
|
15
16
|
var events = {
|
|
@@ -35,6 +36,7 @@ export var Diagram = /*#__PURE__*/function (_Component) {
|
|
|
35
36
|
_this.lines = new _Set();
|
|
36
37
|
_this.layouts = new _Set();
|
|
37
38
|
_this.canvasRef = createRef();
|
|
39
|
+
_this.config = useConfigContext();
|
|
38
40
|
_this.isCellSelectable = void 0;
|
|
39
41
|
_this.isCellRotatable = void 0;
|
|
40
42
|
_this.isCellMovable = void 0;
|
|
@@ -13,11 +13,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
13
13
|
className = _this$get.className,
|
|
14
14
|
children = _this$get.children;
|
|
15
15
|
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
}, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
16
|
+
var k = this.config.k;
|
|
17
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-diagram"] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
19
18
|
return _$cv('div', _extends({
|
|
20
19
|
'className': _$cn(classNameObj)
|
|
21
|
-
}, getRestProps(this)), [_$ce(2, 'div', children, 0,
|
|
20
|
+
}, getRestProps(this)), [_$ce(2, 'div', children, 0, _$cn(k + "-diagram-scheme")), _$ce(2, 'div', null, 1, _$cn(k + "-diagram-canvas"), null, null, this.canvasRef)]);
|
|
22
21
|
}
|
|
23
22
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -2,7 +2,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
2
2
|
|
|
3
3
|
import { css } from '@emotion/css';
|
|
4
4
|
import '../../styles/global';
|
|
5
|
-
export function makeStyles() {
|
|
5
|
+
export function makeStyles(k) {
|
|
6
6
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
|
|
7
7
|
name: "ohhwil",
|
|
8
8
|
styles: "display:inline-block;overflow:auto;.mxRubberband{position:absolute;overflow:hidden;border-style:solid;border-width:1px;border-color:#0000ff;background:#0077ff;}.mxCellEditor{background:url(\"data:image/gif;base64,R0lGODlhMAAwAIAAAP///wAAACH5BAEAAAAALAAAAAAwADAAAAIxhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8egpAAA7\");border-color:transparent;border-style:solid;display:inline-block;position:absolute;overflow:visible;word-wrap:normal;border-width:0;min-width:1px;resize:none;padding:0;margin:0;}.mxPlainTextEditor{padding:0;margin:0;}"
|
|
@@ -19,9 +19,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
19
19
|
iconClassName = _this$get.iconClassName,
|
|
20
20
|
icon = _this$get.icon;
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
}, _classNameObj["k-" + type] = true, _classNameObj['k-with-title'] = title, _classNameObj[makeAlertStyles()] = true, _classNameObj);
|
|
22
|
+
var k = this.config.k;
|
|
23
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-alert-dialog"] = true, _classNameObj[k + "-" + type] = true, _classNameObj[k + "-with-title"] = title, _classNameObj[makeAlertStyles(k)] = true, _classNameObj);
|
|
25
24
|
return _$su.call($this, {
|
|
26
25
|
'className': _$cn(classNameObj)
|
|
27
26
|
}, function ($blocks) {
|
|
@@ -39,15 +38,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
38
|
|
|
40
39
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
41
40
|
}), (_$blocks['body'] = function ($super) {
|
|
41
|
+
var _ref;
|
|
42
|
+
|
|
42
43
|
return [_$ce(2, 'div', [!hideIcon && !icon ? _$cc(Icon, {
|
|
43
|
-
'className': _$cn(iconClassName || {
|
|
44
|
-
"k-icon-success-fill": type === 'success',
|
|
45
|
-
"k-icon-warning-fill": type === 'warning',
|
|
46
|
-
"k-icon-error-fill": type === 'error',
|
|
47
|
-
"k-icon-question-fill": type === 'confirm'
|
|
48
|
-
}),
|
|
44
|
+
'className': _$cn(iconClassName || (_ref = {}, _ref[k + "-icon-success-fill"] = type === 'success', _ref[k + "-icon-warning-fill"] = type === 'warning', _ref[k + "-icon-error-fill"] = type === 'error', _ref[k + "-icon-question-fill"] = type === 'confirm', _ref)),
|
|
49
45
|
'color': type === 'error' ? 'danger' : type === 'confirm' ? 'primary' : type
|
|
50
|
-
}) : undefined, icon], 0,
|
|
46
|
+
}) : undefined, icon], 0, _$cn(k + "-dialog-tip-icon")), _$ce(2, 'div', [title ? _$ce(2, 'div', title, 0, _$cn(k + "-alert-dialog-title")) : undefined, content], 0, _$cn(k + "-alert-dialog-wrapper"))];
|
|
51
47
|
}, __$blocks['body'] = function ($super, data) {
|
|
52
48
|
var block = $blocks['body'];
|
|
53
49
|
|
|
@@ -49,6 +49,10 @@ export declare class BaseDialog<T extends BaseDialogProps = BaseDialogProps, E e
|
|
|
49
49
|
private overlayRef;
|
|
50
50
|
private drag;
|
|
51
51
|
private mouseOutsidable;
|
|
52
|
+
protected config: {
|
|
53
|
+
cls: (name: string) => string;
|
|
54
|
+
readonly k: string;
|
|
55
|
+
};
|
|
52
56
|
init(): void;
|
|
53
57
|
show(props?: T): void;
|
|
54
58
|
close(): void;
|
|
@@ -13,6 +13,7 @@ import { useDraggable } from './useDraggable';
|
|
|
13
13
|
import { useEscClosable } from './useEscClosable';
|
|
14
14
|
import { SHOW, HIDE, DIALOG } from './constants';
|
|
15
15
|
import { useFixBody, setHooks } from './useFixBody';
|
|
16
|
+
import { useConfigContext } from '../config';
|
|
16
17
|
var typeDefs = {
|
|
17
18
|
title: String,
|
|
18
19
|
value: Boolean,
|
|
@@ -74,6 +75,7 @@ export var BaseDialog = /*#__PURE__*/function (_Component) {
|
|
|
74
75
|
_this.overlayRef = createRef();
|
|
75
76
|
_this.drag = useDraggable(_this.dialogRef, _this.overlayRef);
|
|
76
77
|
_this.mouseOutsidable = useMouseOutsidable(_this.dialogRef, false);
|
|
78
|
+
_this.config = useConfigContext();
|
|
77
79
|
return _this;
|
|
78
80
|
}
|
|
79
81
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce,
|
|
1
|
+
import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, className as _$cn, noop as _$no } from 'intact-react';
|
|
2
2
|
import { Button } from '../button';
|
|
3
3
|
import { Icon } from '../icon';
|
|
4
4
|
import { Portal } from '../portal';
|
|
@@ -6,9 +6,6 @@ import { _$ } from '../../i18n';
|
|
|
6
6
|
import { Transition } from 'intact';
|
|
7
7
|
import { getRestProps, stopPropagation } from '../utils';
|
|
8
8
|
import { makeDialogStyles, makeWrapperStyles } from './styles';
|
|
9
|
-
var _$tmp0 = {
|
|
10
|
-
'className': 'k-icon-close'
|
|
11
|
-
};
|
|
12
9
|
export default function ($props, $blocks, $__proto__) {
|
|
13
10
|
var _classNameObj, _$cn2;
|
|
14
11
|
|
|
@@ -35,10 +32,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
35
32
|
children = _this$get.children;
|
|
36
33
|
|
|
37
34
|
var isHide = mode === 'hide';
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
'k-dragging': this.drag.dragging.value
|
|
41
|
-
}, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj["k-" + size] = size !== 'default', _classNameObj[makeDialogStyles()] = true, _classNameObj);
|
|
35
|
+
var k = this.config.k;
|
|
36
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-dialog"] = true, _classNameObj[k + "-dragging"] = this.drag.dragging.value, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[makeDialogStyles(k)] = true, _classNameObj);
|
|
42
37
|
|
|
43
38
|
var dialog = _$cc(Transition, {
|
|
44
39
|
'show': value,
|
|
@@ -47,7 +42,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
47
42
|
'onAfterLeave': this.onAfterLeave,
|
|
48
43
|
'children': (isHide ? true : value) ? _$ce(2, 'div', (_$blocks['content'] = function ($super) {
|
|
49
44
|
return [_$ce(2, 'div', [(_$blocks['header'] = function ($super) {
|
|
50
|
-
return _$ce(2, 'span', title, 0,
|
|
45
|
+
return _$ce(2, 'span', title, 0, _$cn(k + "-dialog-title"));
|
|
51
46
|
}, __$blocks['header'] = function ($super, data) {
|
|
52
47
|
var block = $blocks['header'];
|
|
53
48
|
|
|
@@ -60,11 +55,13 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
60
55
|
'type': 'none',
|
|
61
56
|
'icon': true,
|
|
62
57
|
'title': _$("关闭"),
|
|
63
|
-
'className':
|
|
58
|
+
'className': _$cn(k + "-dialog-close"),
|
|
64
59
|
'ev-click': this.terminate,
|
|
65
60
|
'ev-mousedown': stopPropagation,
|
|
66
|
-
'children': _$cc(Icon,
|
|
67
|
-
|
|
61
|
+
'children': _$cc(Icon, {
|
|
62
|
+
'className': _$cn(k + "-icon-close")
|
|
63
|
+
})
|
|
64
|
+
}) : undefined], 0, _$cn(k + "-dialog-header"), {
|
|
68
65
|
'ev-mousedown': this.drag.start
|
|
69
66
|
}), _$ce(2, 'div', (_$blocks['body'] = function ($super) {
|
|
70
67
|
return children;
|
|
@@ -76,14 +73,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
76
73
|
};
|
|
77
74
|
|
|
78
75
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
79
|
-
}, __$blocks['body'](_$no)), 0,
|
|
76
|
+
}, __$blocks['body'](_$no)), 0, _$cn(k + "-dialog-body")), (_$blocks['footer-wrapper'] = function ($super) {
|
|
80
77
|
return _$ce(2, 'div', (_$blocks['footer'] = function ($super) {
|
|
81
78
|
return [_$cc(Button, {
|
|
82
|
-
'className':
|
|
79
|
+
'className': _$cn(k + "-dialog-cancel"),
|
|
83
80
|
'ev-click': this.cancel,
|
|
84
81
|
'children': cancelText
|
|
85
82
|
}), _$cc(Button, {
|
|
86
|
-
'className':
|
|
83
|
+
'className': _$cn(k + "-dialog-ok"),
|
|
87
84
|
'type': 'primary',
|
|
88
85
|
'ev-click': this.ok,
|
|
89
86
|
'loading': loading,
|
|
@@ -98,7 +95,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
98
95
|
};
|
|
99
96
|
|
|
100
97
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
101
|
-
}, __$blocks['footer'](_$no)), 0,
|
|
98
|
+
}, __$blocks['footer'](_$no)), 0, _$cn(k + "-dialog-footer"));
|
|
102
99
|
}, __$blocks['footer-wrapper'] = function ($super, data) {
|
|
103
100
|
var block = $blocks['footer-wrapper'];
|
|
104
101
|
|
|
@@ -131,13 +128,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
131
128
|
'show': overlay ? value : false,
|
|
132
129
|
'appear': value,
|
|
133
130
|
'name': 'k-fade',
|
|
134
|
-
'children': _$ce(2, 'div', null, 1,
|
|
131
|
+
'children': _$ce(2, 'div', null, 1, _$cn(k + "-dialog-overlay"), {
|
|
135
132
|
'ev-click': this.onClickWrapper
|
|
136
133
|
}, null, this.overlayRef)
|
|
137
|
-
}, 'overlay') : undefined, dialog], 0, _$cn((_$cn2 = {
|
|
138
|
-
'k-dialog-wrapper': true,
|
|
139
|
-
'k-open': value
|
|
140
|
-
}, _$cn2[makeWrapperStyles()] = true, _$cn2)))
|
|
134
|
+
}, 'overlay') : undefined, dialog], 0, _$cn((_$cn2 = {}, _$cn2[k + "-dialog-wrapper"] = true, _$cn2[k + "-open"] = value, _$cn2[makeWrapperStyles(k)] = true, _$cn2)))
|
|
141
135
|
});
|
|
142
136
|
}
|
|
143
137
|
;
|
|
@@ -7,7 +7,7 @@ export interface DialogEvents extends BaseDialogEvents {
|
|
|
7
7
|
}
|
|
8
8
|
export interface DialogBlocks extends BaseDialogBlocks {
|
|
9
9
|
}
|
|
10
|
-
export declare class BaseDialog<P extends DialogProps = DialogProps, E extends DialogEvents = DialogEvents, B extends DialogBlocks = DialogBlocks> extends _BaseDialog<P, E> {
|
|
10
|
+
export declare class BaseDialog<P extends DialogProps = DialogProps, E extends DialogEvents = DialogEvents, B extends DialogBlocks = DialogBlocks> extends _BaseDialog<P, E, B> {
|
|
11
11
|
useAsComponent: boolean;
|
|
12
12
|
constructor(props?: Props<P, BaseDialog> | null | undefined, $vNode?: VNodeComponentClass, $SVG?: boolean, $mountedQueue?: Function[], $senior?: ComponentClass | null);
|
|
13
13
|
init(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeDialogStyles(): string;
|
|
3
|
-
export declare function makeWrapperStyles(): string;
|
|
4
|
-
export declare function makeAlertStyles(): string;
|
|
2
|
+
export declare function makeDialogStyles(k: string): string;
|
|
3
|
+
export declare function makeWrapperStyles(k: string): string;
|
|
4
|
+
export declare function makeAlertStyles(k: string): string;
|
|
@@ -82,23 +82,23 @@ setDefault(function () {
|
|
|
82
82
|
dialog: defaults
|
|
83
83
|
}).dialog;
|
|
84
84
|
});
|
|
85
|
-
export function makeDialogStyles() {
|
|
85
|
+
export function makeDialogStyles(k) {
|
|
86
86
|
var _context;
|
|
87
87
|
|
|
88
|
-
return /*#__PURE__*/css("position:absolute;width:", dialog.width, ";border-radius:", dialog.borderRadius, ";background:", dialog.bgColor, ";font-size:", dialog.fontSize, ";color:", dialog.color, ";box-shadow:", dialog.boxShadow, ";max-width:100%;z-index:", theme.maxZIndex, ";&.k-dragging{cursor:move;user-select:none;}&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:all ", dialog.transition, ";}&.transition-enter-from,&.transition-leave-to,&.transition-appear-from{transform:", dialog.transform, ";opacity:0;}", _mapInstanceProperty(_context = ['large', 'small', 'mini']).call(_context, function (size) {
|
|
89
|
-
return /*#__PURE__*/css("&.k-", size, "{width:", dialog[size + "Width"], ";}");
|
|
90
|
-
}), ".k-dialog-header{padding:0 ", dialog.padding, ";margin:", dialog.margin, ";border-bottom:", dialog.header.border, ";height:", dialog.header.height, ";line-height:", dialog.header.height, ";font-size:", dialog.header.fontSize, ";color:", dialog.header.color, ";position:relative;font-weight:", dialog.header.fontWeight, ";}.k-dialog-title{display:inline-block;}.k-dialog-close{position:absolute;right:", dialog.header.closeRight, ";top:", dialog.header.closeTop, ";.k-icon{font-size:", dialog.header.closeIconFontSize, ";}}.k-dialog-body{padding:", dialog.body.padding, ";}.k-dialog-footer{text-align:right;padding:", dialog.footer.padding, ";margin:", dialog.margin, ";border-top:", dialog.footer.border, ";.k-btn{margin-left:", dialog.footer.btnGap, ";}}");
|
|
88
|
+
return /*#__PURE__*/css("position:absolute;width:", dialog.width, ";border-radius:", dialog.borderRadius, ";background:", dialog.bgColor, ";font-size:", dialog.fontSize, ";color:", dialog.color, ";box-shadow:", dialog.boxShadow, ";max-width:100%;z-index:", theme.maxZIndex, ";&.", k, "-dragging{cursor:move;user-select:none;}&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:all ", dialog.transition, ";}&.transition-enter-from,&.transition-leave-to,&.transition-appear-from{transform:", dialog.transform, ";opacity:0;}", _mapInstanceProperty(_context = ['large', 'small', 'mini']).call(_context, function (size) {
|
|
89
|
+
return /*#__PURE__*/css("&.", k, "-", size, "{width:", dialog[size + "Width"], ";}");
|
|
90
|
+
}), ".", k, "-dialog-header{padding:0 ", dialog.padding, ";margin:", dialog.margin, ";border-bottom:", dialog.header.border, ";height:", dialog.header.height, ";line-height:", dialog.header.height, ";font-size:", dialog.header.fontSize, ";color:", dialog.header.color, ";position:relative;font-weight:", dialog.header.fontWeight, ";}.", k, "-dialog-title{display:inline-block;}.", k, "-dialog-close{position:absolute;right:", dialog.header.closeRight, ";top:", dialog.header.closeTop, ";.", k, "-icon{font-size:", dialog.header.closeIconFontSize, ";}}.", k, "-dialog-body{padding:", dialog.body.padding, ";}.", k, "-dialog-footer{text-align:right;padding:", dialog.footer.padding, ";margin:", dialog.margin, ";border-top:", dialog.footer.border, ";.", k, "-btn{margin-left:", dialog.footer.btnGap, ";}}");
|
|
91
91
|
}
|
|
92
|
-
export function makeWrapperStyles() {
|
|
93
|
-
|
|
94
|
-
// so we must set fixed with important to
|
|
95
|
-
return /*#__PURE__*/css("position:absolute;z-index:", theme.maxZIndex, ";top:0;left:0;width:100%;.k-dialog-overlay{position:fixed!important;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, .5);}");
|
|
92
|
+
export function makeWrapperStyles(k) {
|
|
93
|
+
//.${k}-fade-leave-active will add position absolute to the styles
|
|
94
|
+
// so we must set fixed with important to .${k}-dialog-overlay
|
|
95
|
+
return /*#__PURE__*/css("position:absolute;z-index:", theme.maxZIndex, ";top:0;left:0;width:100%;.", k, "-dialog-overlay{position:fixed!important;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, .5);}");
|
|
96
96
|
}
|
|
97
|
-
export function makeAlertStyles() {
|
|
97
|
+
export function makeAlertStyles(k) {
|
|
98
98
|
var _context2;
|
|
99
99
|
|
|
100
|
-
return /*#__PURE__*/css("&.k-alert-dialog{.k-dialog-body{margin-top:", dialog.alert.bodyMarginTop, ";padding:", dialog.alert.padding, ";text-align:center;position:relative;z-index:1;}.k-dialog-header,.k-dialog-footer{border:none;}.k-dialog-tip-icon{margin-bottom:", dialog.alert.tipIconMarginBottom, ";.k-icon{font-size:", dialog.alert.tipIconFontSize, ";line-height:", dialog.alert.tipIconLineHeight, ";}}", _mapInstanceProperty(_context2 = ['success', 'warning', 'error', 'confirm']).call(_context2, function (type) {
|
|
100
|
+
return /*#__PURE__*/css("&.", k, "-alert-dialog{.", k, "-dialog-body{margin-top:", dialog.alert.bodyMarginTop, ";padding:", dialog.alert.padding, ";text-align:center;position:relative;z-index:1;}.", k, "-dialog-header,.", k, "-dialog-footer{border:none;}.", k, "-dialog-tip-icon{margin-bottom:", dialog.alert.tipIconMarginBottom, ";.", k, "-icon{font-size:", dialog.alert.tipIconFontSize, ";line-height:", dialog.alert.tipIconLineHeight, ";}}", _mapInstanceProperty(_context2 = ['success', 'warning', 'error', 'confirm']).call(_context2, function (type) {
|
|
101
101
|
var color = type === 'error' ? theme.color.danger : type === 'confirm' ? theme.color.primary : theme.color[type];
|
|
102
|
-
return /*#__PURE__*/css("&.k-", type, "{.k-dialog-tip-icon{color:", color, ";}}");
|
|
103
|
-
}), " &:not(.k-confirm){.k-dialog-cancel{display:none;}}&.k-with-title{.k-dialog-body{margin-top:", dialog.alert.titleBodyMarginTop, ";text-align:left;}.k-dialog-tip-icon{float:left;.k-icon{font-size:", dialog.alert.titleTipIconFontSize, ";}}.k-alert-dialog-wrapper{overflow:hidden;padding-left:", dialog.alert.wrapperPaddingLeft, ";}.k-alert-dialog-title{line-height:", dialog.alert.tipIconLineHeight, ";font-size:", dialog.alert.titleFontSize, ";font-weight:", dialog.alert.titleFontWeight, ";}}}");
|
|
102
|
+
return /*#__PURE__*/css("&.", k, "-", type, "{.", k, "-dialog-tip-icon{color:", color, ";}}");
|
|
103
|
+
}), " &:not(.", k, "-confirm){.", k, "-dialog-cancel{display:none;}}&.", k, "-with-title{.", k, "-dialog-body{margin-top:", dialog.alert.titleBodyMarginTop, ";text-align:left;}.", k, "-dialog-tip-icon{float:left;.", k, "-icon{font-size:", dialog.alert.titleTipIconFontSize, ";}}.", k, "-alert-dialog-wrapper{overflow:hidden;padding-left:", dialog.alert.wrapperPaddingLeft, ";}.", k, "-alert-dialog-title{line-height:", dialog.alert.tipIconLineHeight, ";font-size:", dialog.alert.titleFontSize, ";font-weight:", dialog.alert.titleFontWeight, ";}}}");
|
|
104
104
|
}
|
|
@@ -11,9 +11,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
11
11
|
placement = _this$get.placement,
|
|
12
12
|
overlay = _this$get.overlay;
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
}, _classNameObj["k-" + placement] = true, _classNameObj[makeStyles(overlay)] = true, _classNameObj);
|
|
14
|
+
var k = this.config.k;
|
|
15
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-drawer"] = true, _classNameObj[k + "-" + placement] = true, _classNameObj[makeStyles(overlay, k)] = true, _classNameObj);
|
|
17
16
|
return _$su.call($this, {
|
|
18
17
|
'className': _$cn(classNameObj)
|
|
19
18
|
}, function ($blocks) {
|
|
@@ -21,7 +20,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
21
20
|
__$blocks = _$ex({}, $blocks);
|
|
22
21
|
|
|
23
22
|
return (_$blocks['content'] = function ($super) {
|
|
24
|
-
return _$ce(2, 'div', $super(), 0,
|
|
23
|
+
return _$ce(2, 'div', $super(), 0, _$cn(k + "-drawer-content"));
|
|
25
24
|
}, __$blocks['content'] = function ($super, data) {
|
|
26
25
|
var block = $blocks['content'];
|
|
27
26
|
|
|
@@ -2,5 +2,5 @@ import '../../styles/global';
|
|
|
2
2
|
declare type ValueOf<T extends readonly any[]> = T[number];
|
|
3
3
|
export declare type Placement = ValueOf<typeof placements>;
|
|
4
4
|
export declare const placements: readonly ["top", "right", "bottom", "left"];
|
|
5
|
-
export declare function makeStyles(overlay: boolean): string;
|
|
5
|
+
export declare function makeStyles(overlay: boolean, k: string): string;
|
|
6
6
|
export {};
|