@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
|
@@ -62,6 +62,6 @@ setDefault(function () {
|
|
|
62
62
|
transfer: defaults
|
|
63
63
|
}).transfer;
|
|
64
64
|
});
|
|
65
|
-
export function makeStyles() {
|
|
66
|
-
return /*#__PURE__*/css("font-size:", transfer.fontSize, ";.k-transfer-panel,.k-transfer-arrows{display:inline-block;vertical-align:middle;}.k-transfer-panel{width:", transfer.panel.width, ";border:", transfer.panel.border, ";border-radius:", transfer.panel.borderRadius, ";height:", transfer.panel.height, ";display:inline-flex;flex-direction:column;overflow:auto;}.k-transfer-title{line-height:", transfer.title.lineHeight, ";background:", transfer.title.bgColor, ";padding:", transfer.title.padding, ";.k-checkbox{color:", transfer.title.color, ";font-size:", transfer.title.fontSize, ";}}.k-transfer-count{float:right;margin-left:", transfer.title.countGap, ";}.k-transfer-list{overflow:auto;position:relative;flex:1;}.k-transfer-item{color:", transfer.item.color, ";background:", transfer.item.bgColor, ";user-select:none;width:100%;&:not(.k-disabled):hover{background:", transfer.item.hoverBgColor, ";color:", transfer.item.hoverColor, ";p{color:", transfer.item.hoverColor, ";}}.k-checkbox{padding:", transfer.item.padding, ";display:flex;}p{margin:0;color:", transfer.item.descColor, ";}&.k-disabled{p{color:", theme.color.disabled, ";}}}.k-input{width:auto;margin:", transfer.searchGap, ";}.k-transfer-arrows{.k-btn{display:flex;margin:", transfer.arrow.gap, ";}}");
|
|
65
|
+
export function makeStyles(k) {
|
|
66
|
+
return /*#__PURE__*/css("font-size:", transfer.fontSize, ";.", k, "-transfer-panel,.", k, "-transfer-arrows{display:inline-block;vertical-align:middle;}.", k, "-transfer-panel{width:", transfer.panel.width, ";border:", transfer.panel.border, ";border-radius:", transfer.panel.borderRadius, ";height:", transfer.panel.height, ";display:inline-flex;flex-direction:column;overflow:auto;}.", k, "-transfer-title{line-height:", transfer.title.lineHeight, ";background:", transfer.title.bgColor, ";padding:", transfer.title.padding, ";.", k, "-checkbox{color:", transfer.title.color, ";font-size:", transfer.title.fontSize, ";}}.", k, "-transfer-count{float:right;margin-left:", transfer.title.countGap, ";}.", k, "-transfer-list{overflow:auto;position:relative;flex:1;}.", k, "-transfer-item{color:", transfer.item.color, ";background:", transfer.item.bgColor, ";user-select:none;width:100%;&:not(.", k, "-disabled):hover{background:", transfer.item.hoverBgColor, ";color:", transfer.item.hoverColor, ";p{color:", transfer.item.hoverColor, ";}}.", k, "-checkbox{padding:", transfer.item.padding, ";display:flex;}p{margin:0;color:", transfer.item.descColor, ";}&.", k, "-disabled{p{color:", theme.color.disabled, ";}}}.", k, "-input{width:auto;margin:", transfer.searchGap, ";}.", k, "-transfer-arrows{.", k, "-btn{display:flex;margin:", transfer.arrow.gap, ";}}");
|
|
67
67
|
}
|
|
@@ -48,6 +48,7 @@ export declare class Tree<K extends Key = Key> extends Component<TreeProps<K>, T
|
|
|
48
48
|
private filter;
|
|
49
49
|
private draggable;
|
|
50
50
|
private transition;
|
|
51
|
+
private config;
|
|
51
52
|
getCheckedData(leafOnly?: boolean): DataItem<Key>[];
|
|
52
53
|
getSelectedData(): DataItem<Key>[];
|
|
53
54
|
expand(key: K): void;
|
package/components/tree/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { useSelected } from './useSelected';
|
|
|
12
12
|
import { useFilter } from './useFilter';
|
|
13
13
|
import { useDraggable, Mode } from './useDraggable';
|
|
14
14
|
import { useTransitionEvent } from './useTransitionEvent';
|
|
15
|
+
import { useConfigContext } from '../config';
|
|
15
16
|
var typeDefs = {
|
|
16
17
|
data: Array,
|
|
17
18
|
filter: Function,
|
|
@@ -63,6 +64,7 @@ export var Tree = /*#__PURE__*/function (_Component) {
|
|
|
63
64
|
_this.filter = useFilter(_this.nodes.getNodes, _this.expanded.get);
|
|
64
65
|
_this.draggable = useDraggable();
|
|
65
66
|
_this.transition = useTransitionEvent();
|
|
67
|
+
_this.config = useConfigContext();
|
|
66
68
|
return _this;
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
3
3
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js/instance/filter";
|
|
4
|
-
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc,
|
|
4
|
+
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, className as _$cn, noop as _$no, createVNode as _$cv } from 'intact-react';
|
|
5
5
|
import { Transition, TransitionGroup, linkEvent } from 'intact';
|
|
6
6
|
import { Checkbox } from '../checkbox';
|
|
7
7
|
import { getRestProps } from '../utils';
|
|
8
8
|
import { makeStyles } from './styles';
|
|
9
9
|
import { Icon } from '../icon';
|
|
10
10
|
import { Mode } from './useDraggable';
|
|
11
|
-
var _$tmp0 = {
|
|
12
|
-
'className': 'k-tree-icon ion-load-c',
|
|
13
|
-
'rotate': true
|
|
14
|
-
};
|
|
15
11
|
export default function ($props, $blocks, $__proto__) {
|
|
16
12
|
var _this = this,
|
|
17
|
-
|
|
13
|
+
_classNameObj2;
|
|
18
14
|
|
|
19
15
|
$blocks || ($blocks = {});
|
|
20
16
|
$props || ($props = {});
|
|
@@ -41,59 +37,56 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
41
37
|
draggingKey = _this$draggable.draggingKey,
|
|
42
38
|
overKey = _this$draggable.overKey,
|
|
43
39
|
mode = _this$draggable.mode;
|
|
40
|
+
var k = this.config.k;
|
|
44
41
|
|
|
45
42
|
var treeNodes = function treeNodes(nodes) {
|
|
46
43
|
return _mapInstanceProperty(nodes).call(nodes, function (node, index) {
|
|
44
|
+
var _classNameObj, _labelClassNameObj;
|
|
45
|
+
|
|
47
46
|
if (!_filterInstanceProperty(node)) return;
|
|
48
47
|
var key = node.key;
|
|
49
48
|
var expanded = expandedKeys.has(key);
|
|
50
49
|
var data = node.data;
|
|
51
50
|
var disabled = data.disabled;
|
|
52
51
|
var selected = selectable && selectedKeys.has(key);
|
|
53
|
-
var classNameObj = {
|
|
54
|
-
|
|
55
|
-
'k-expanded': expanded,
|
|
56
|
-
'k-disabled': disabled,
|
|
57
|
-
'k-selected': selected,
|
|
58
|
-
'k-dragging': key === draggingKey.value
|
|
59
|
-
};
|
|
60
|
-
var labelClassNameObj = {
|
|
61
|
-
'k-tree-label': true,
|
|
62
|
-
'k-tree-leaf': !node.children
|
|
63
|
-
};
|
|
52
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-tree-node"] = true, _classNameObj[k + "-expanded"] = expanded, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-selected"] = selected, _classNameObj[k + "-dragging"] = key === draggingKey.value, _classNameObj);
|
|
53
|
+
var labelClassNameObj = (_labelClassNameObj = {}, _labelClassNameObj[k + "-tree-label"] = true, _labelClassNameObj[k + "-tree-leaf"] = !node.children, _labelClassNameObj);
|
|
64
54
|
|
|
65
55
|
if (key === overKey.value) {
|
|
66
56
|
switch (mode.value) {
|
|
67
57
|
case Mode.Before:
|
|
68
|
-
labelClassNameObj[
|
|
58
|
+
labelClassNameObj[[k + "-before"]] = true;
|
|
69
59
|
break;
|
|
70
60
|
|
|
71
61
|
case Mode.After:
|
|
72
|
-
labelClassNameObj[
|
|
62
|
+
labelClassNameObj[[k + "-after"]] = true;
|
|
73
63
|
break;
|
|
74
64
|
|
|
75
65
|
case Mode.Inner:
|
|
76
|
-
labelClassNameObj[
|
|
66
|
+
labelClassNameObj[[k + "-inner"]] = true;
|
|
77
67
|
break;
|
|
78
68
|
}
|
|
79
69
|
}
|
|
80
70
|
|
|
81
71
|
return _$ce(2, 'div', [_$ce(2, 'div', [node.children && node.loaded !== false ? _$cc(Icon, {
|
|
82
|
-
'className':
|
|
72
|
+
'className': _$cn(k + "-tree-icon ion-android-arrow-dropdown"),
|
|
83
73
|
'hoverable': true,
|
|
84
74
|
'ev-click': function evClick(e) {
|
|
85
75
|
// it may be in dropdownMenu, e.g. TreeSelect
|
|
86
76
|
e._ignore = true;
|
|
87
77
|
toggleExpanded(node);
|
|
88
78
|
}
|
|
89
|
-
}) : undefined, node.loaded === false ? _$cc(Icon,
|
|
79
|
+
}) : undefined, node.loaded === false ? _$cc(Icon, {
|
|
80
|
+
'className': _$cn(k + "-tree-icon ion-load-c"),
|
|
81
|
+
'rotate': true
|
|
82
|
+
}) : undefined, checkbox ? _$cc(Checkbox, {
|
|
90
83
|
'value': node.checked,
|
|
91
84
|
'disabled': disabled,
|
|
92
85
|
'indeterminate': node.indeterminate,
|
|
93
86
|
'ev-$change:value': function ev$changeValue() {
|
|
94
87
|
return toggleChecked(node);
|
|
95
88
|
},
|
|
96
|
-
'className':
|
|
89
|
+
'className': _$cn(k + "-tree-checkbox")
|
|
97
90
|
}) : undefined, _$ce(2, 'div', (_$blocks['label'] = function ($super) {
|
|
98
91
|
return data.label;
|
|
99
92
|
}, __$blocks['label'] = function ($super, data) {
|
|
@@ -104,12 +97,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
104
97
|
};
|
|
105
98
|
|
|
106
99
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
107
|
-
}, __$blocks['label'](_$no, [data, node, index])), 0,
|
|
100
|
+
}, __$blocks['label'](_$no, [data, node, index])), 0, _$cn(k + "-tree-text c-ellipsis"), {
|
|
108
101
|
'ev-click': linkEvent(node, _this.onClick)
|
|
109
102
|
})], 0, _$cn(labelClassNameObj)), _$cc(Transition, _extends({}, _this.transition, {
|
|
110
103
|
'children': expanded && node.children ? _$ce(2, 'div', _$cc(TransitionGroup, _extends({}, _this.transition, {
|
|
111
104
|
'children': treeNodes(node.children)
|
|
112
|
-
})), 2,
|
|
105
|
+
})), 2, _$cn(k + "-tree")) : undefined
|
|
113
106
|
}))], 4, _$cn(classNameObj), {
|
|
114
107
|
'draggable': draggable ? true : null,
|
|
115
108
|
'ev-dragstart': draggable && linkEvent(node, onDragStart),
|
|
@@ -119,11 +112,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
119
112
|
});
|
|
120
113
|
};
|
|
121
114
|
|
|
122
|
-
var classNameObj = (
|
|
123
|
-
'k-tree': true,
|
|
124
|
-
'k-line': showLine,
|
|
125
|
-
'k-selectable': selectable
|
|
126
|
-
}, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
115
|
+
var classNameObj = (_classNameObj2 = {}, _classNameObj2[k + "-tree"] = true, _classNameObj2[k + "-line"] = showLine, _classNameObj2[k + "-selectable"] = selectable, _classNameObj2[className] = className, _classNameObj2[makeStyles(k)] = true, _classNameObj2);
|
|
127
116
|
return _$cv('div', _extends({
|
|
128
117
|
'className': _$cn(classNameObj)
|
|
129
118
|
}, getRestProps(this)), _$cc(TransitionGroup, _extends({}, this.transition, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -68,6 +68,6 @@ setDefault(function () {
|
|
|
68
68
|
tree: defaults
|
|
69
69
|
}).tree;
|
|
70
70
|
});
|
|
71
|
-
export function makeStyles() {
|
|
72
|
-
return /*#__PURE__*/css("font-size:", tree.fontSize, ";line-height:", tree.lineHeight, ";position:relative;.k-tree-label{position:relative;display:flex;align-items:center;&.k-before,&.k-after{&:before{position:absolute;content:'';display:block;border-top:", tree.dragging.border, ";width:100%;left:0;}}&.k-before:before{top:0;}&.k-after:before{bottom:0;}&.k-inner{background:", tree.selected.bgColor, ";}}.k-tree-icon,.k-tree-text{cursor:pointer;}.k-tree-text{padding:", tree.textPadding, ";border-radius:", tree.borderRadius, ";flex:1;}.k-tree-leaf{padding-left:", tree.leafIndent, ";}.k-tree-icon{width:", tree.iconWidth, ";text-align:center;color:", tree.iconColor, ";&:before{transform:rotate(-90deg);transition:transform ", tree.transition, ";}}.k-tree-checkbox{margin-right:", tree.checkboxGap, ";}&.k-selectable{.k-tree-node{&.k-selected{>.k-tree-label .k-tree-text{background:", tree.selected.bgColor, "!important;}}}}.k-tree-node{background:#fff;&:not(.k-disabled){>.k-tree-label .k-tree-text:hover{background:", theme.color.bg, ";}}&.k-expanded{>.k-tree-label .k-tree-icon:before{transform:rotate(0);}}&.k-disabled{>.k-tree-label{color:", tree.disabledColor, ";.k-tree-text{cursor:not-allowed;}}}&.k-dragging{background:", tree.dragging.bgColor, ";.k-tree-node{background:", tree.dragging.bgColor, ";}}}.k-tree{margin-left:", tree.marginLeft, ";padding-left:", tree.paddingLeft, ";}&.k-line .k-tree{border-left:", tree.line, ";}");
|
|
71
|
+
export function makeStyles(k) {
|
|
72
|
+
return /*#__PURE__*/css("font-size:", tree.fontSize, ";line-height:", tree.lineHeight, ";position:relative;.", k, "-tree-label{position:relative;display:flex;align-items:center;&.", k, "-before,&.", k, "-after{&:before{position:absolute;content:'';display:block;border-top:", tree.dragging.border, ";width:100%;left:0;}}&.", k, "-before:before{top:0;}&.", k, "-after:before{bottom:0;}&.", k, "-inner{background:", tree.selected.bgColor, ";}}.", k, "-tree-icon,.", k, "-tree-text{cursor:pointer;}.", k, "-tree-text{padding:", tree.textPadding, ";border-radius:", tree.borderRadius, ";flex:1;}.", k, "-tree-leaf{padding-left:", tree.leafIndent, ";}.", k, "-tree-icon{width:", tree.iconWidth, ";text-align:center;color:", tree.iconColor, ";&:before{transform:rotate(-90deg);transition:transform ", tree.transition, ";}}.", k, "-tree-checkbox{margin-right:", tree.checkboxGap, ";}&.", k, "-selectable{.", k, "-tree-node{&.", k, "-selected{>.", k, "-tree-label .", k, "-tree-text{background:", tree.selected.bgColor, "!important;}}}}.", k, "-tree-node{background:#fff;&:not(.", k, "-disabled){>.", k, "-tree-label .", k, "-tree-text:hover{background:", theme.color.bg, ";}}&.", k, "-expanded{>.", k, "-tree-label .", k, "-tree-icon:before{transform:rotate(0);}}&.", k, "-disabled{>.", k, "-tree-label{color:", tree.disabledColor, ";.", k, "-tree-text{cursor:not-allowed;}}}&.", k, "-dragging{background:", tree.dragging.bgColor, ";.", k, "-tree-node{background:", tree.dragging.bgColor, ";}}}.", k, "-tree{margin-left:", tree.marginLeft, ";padding-left:", tree.paddingLeft, ";}&.", k, "-line .", k, "-tree{border-left:", tree.line, ";}");
|
|
73
73
|
}
|
|
@@ -24,6 +24,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
24
24
|
treeRef = _this$value.treeRef,
|
|
25
25
|
onChangeCheckedKeys = _this$value.onChangeCheckedKeys,
|
|
26
26
|
onChangeSelectedKeys = _this$value.onChangeSelectedKeys;
|
|
27
|
+
var k = this.config.k;
|
|
27
28
|
return _$su.call($this, null, function ($blocks) {
|
|
28
29
|
var _$blocks = {},
|
|
29
30
|
__$blocks = _$ex({}, $blocks);
|
|
@@ -32,9 +33,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
32
33
|
var _$cn2;
|
|
33
34
|
|
|
34
35
|
return _$cc(DropdownMenu, {
|
|
35
|
-
'className': _$cn((_$cn2 = {
|
|
36
|
-
'k-tree-select-menu': true
|
|
37
|
-
}, _$cn2[makeStyles()] = true, _$cn2)),
|
|
36
|
+
'className': _$cn((_$cn2 = {}, _$cn2[k + "-tree-select-menu"] = true, _$cn2[makeStyles(k)] = true, _$cn2)),
|
|
38
37
|
'children': _$cc(Tree, {
|
|
39
38
|
'ref': treeRef,
|
|
40
39
|
'data': data,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -16,6 +16,6 @@ setDefault(function () {
|
|
|
16
16
|
treeSelect: defaults
|
|
17
17
|
}).treeSelect;
|
|
18
18
|
});
|
|
19
|
-
export function makeStyles() {
|
|
19
|
+
export function makeStyles(k) {
|
|
20
20
|
return /*#__PURE__*/css("min-width:auto;max-height:", treeSelect.maxHeight, ";padding:", treeSelect.padding, ";overflow:auto;&:not([class*=\"-active\"]){transition:left ", treeSelect.transition, ",top ", treeSelect.transition, ";}");
|
|
21
21
|
}
|
|
@@ -9,6 +9,7 @@ import { useFiles } from './useFiles';
|
|
|
9
9
|
import { bind } from '../utils';
|
|
10
10
|
import { useDrag } from './useDrag';
|
|
11
11
|
import { useShowImage } from './useShowImage';
|
|
12
|
+
import { useConfigContext } from '../config';
|
|
12
13
|
var typeDefs = {
|
|
13
14
|
accept: String,
|
|
14
15
|
files: Array,
|
|
@@ -61,6 +62,7 @@ export var Upload = /*#__PURE__*/function (_Component) {
|
|
|
61
62
|
_this.files = useFiles(_this.accept.isValidType, _this.upload);
|
|
62
63
|
_this.drag = useDrag(_this.files.addFiles);
|
|
63
64
|
_this.showImage = useShowImage();
|
|
65
|
+
_this.config = useConfigContext();
|
|
64
66
|
return _this;
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import { createVNode as _$cv,
|
|
2
|
+
import { createVNode as _$cv, className as _$cn, noop as _$no, createUnknownComponentVNode as _$cc, createElementVNode as _$ce, map as _$ma } from 'intact-react';
|
|
3
3
|
import { Button } from '../button';
|
|
4
4
|
import { Progress } from '../progress';
|
|
5
5
|
import { Dialog } from '../dialog';
|
|
@@ -9,27 +9,8 @@ import { TransitionGroup, Transition, linkEvent } from 'intact';
|
|
|
9
9
|
import { _$ } from '../../i18n';
|
|
10
10
|
import { Icon } from '../icon';
|
|
11
11
|
import { UploadFileStatus } from './useUpload';
|
|
12
|
-
var _$tmp0 = {
|
|
13
|
-
'className': 'k-icon-upload'
|
|
14
|
-
};
|
|
15
|
-
var _$tmp1 = {
|
|
16
|
-
'className': 'k-icon-add-bold'
|
|
17
|
-
};
|
|
18
|
-
var _$tmp2 = {
|
|
19
|
-
'className': 'k-icon-add-bold',
|
|
20
|
-
'size': 'large'
|
|
21
|
-
};
|
|
22
|
-
var _$tmp3 = {
|
|
23
|
-
'className': 'k-upload-file-icon ion-document'
|
|
24
|
-
};
|
|
25
|
-
var _$tmp4 = {
|
|
26
|
-
'className': 'k-upload-status-icon k-icon-success-fill'
|
|
27
|
-
};
|
|
28
|
-
var _$tmp5 = {
|
|
29
|
-
'className': 'k-upload-status-icon k-icon-error-fill'
|
|
30
|
-
};
|
|
31
12
|
export default function ($props, $blocks, $__proto__) {
|
|
32
|
-
var _classNameObj, _$
|
|
13
|
+
var _classNameObj, _$cn4;
|
|
33
14
|
|
|
34
15
|
$blocks || ($blocks = {});
|
|
35
16
|
$props || ($props = {});
|
|
@@ -48,9 +29,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
48
29
|
directory = _this$get.directory;
|
|
49
30
|
|
|
50
31
|
var drag = this.drag;
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
}, _classNameObj[className] = className, _classNameObj['k-drag'] = type === 'drag', _classNameObj['k-dragover'] = drag.dragOver.value, _classNameObj['k-gallery'] = type === 'gallery', _classNameObj[makeStyles()] = true, _classNameObj);
|
|
32
|
+
var k = this.config.k;
|
|
33
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-upload"] = true, _classNameObj[className] = className, _classNameObj[k + "-drag"] = type === 'drag', _classNameObj[k + "-dragover"] = drag.dragOver.value, _classNameObj[k + "-gallery"] = type === 'gallery', _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
54
34
|
var events = {
|
|
55
35
|
'ev-click': this.selectFile
|
|
56
36
|
};
|
|
@@ -63,7 +43,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
63
43
|
}
|
|
64
44
|
|
|
65
45
|
var handle = _$cv('div', _extends({
|
|
66
|
-
'className':
|
|
46
|
+
'className': _$cn(k + "-upload-handle")
|
|
67
47
|
}, events), (_$blocks['content'] = function ($super) {
|
|
68
48
|
return children ? (_$blocks['children'] = function ($super) {
|
|
69
49
|
return children;
|
|
@@ -76,10 +56,17 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
76
56
|
|
|
77
57
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
78
58
|
}, __$blocks['children'](_$no)) : type !== 'gallery' ? type === 'select' ? _$cc(Button, {
|
|
79
|
-
'children': [_$cc(Icon,
|
|
80
|
-
|
|
59
|
+
'children': [_$cc(Icon, {
|
|
60
|
+
'className': _$cn(k + "-icon-upload")
|
|
61
|
+
}), _$('点击上传')]
|
|
62
|
+
}) : _$ce(2, 'div', [_$cc(Icon, {
|
|
63
|
+
'className': _$cn(k + "-icon-add-bold")
|
|
64
|
+
}), _$ce(2, 'div', null, 1, null, {
|
|
81
65
|
'innerHTML': _$('将文件拖到此处,或<a>点击上传</a>')
|
|
82
|
-
})], 4,
|
|
66
|
+
})], 4, _$cn(k + "-upload-area")) : _$ce(2, 'div', [_$cc(Icon, {
|
|
67
|
+
'className': _$cn(k + "-icon-add-bold"),
|
|
68
|
+
'size': 'large'
|
|
69
|
+
}), _$ce(2, 'div', _$('上传图片'), 0)], 4, _$cn(k + "-upload-picture-card " + k + "-upload-add"));
|
|
83
70
|
}, __$blocks['content'] = function ($super, data) {
|
|
84
71
|
var block = $blocks['content'];
|
|
85
72
|
|
|
@@ -94,7 +81,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
94
81
|
|
|
95
82
|
var closeBtn = function closeBtn(value, index) {
|
|
96
83
|
return _$cc(Icon, {
|
|
97
|
-
'className':
|
|
84
|
+
'className': _$cn(k + "-upload-close " + k + "-icon-delete"),
|
|
98
85
|
'ev-click': function evClick() {
|
|
99
86
|
return removeFile(value, index);
|
|
100
87
|
},
|
|
@@ -119,28 +106,27 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
119
106
|
}, null, this.inputRef), type === 'gallery' ? _$ce(2, 'div', _$cc(TransitionGroup, {
|
|
120
107
|
'name': 'k-dropdown',
|
|
121
108
|
'children': [_$ma(files, function ($value, $key) {
|
|
122
|
-
|
|
109
|
+
var _$cn2;
|
|
110
|
+
|
|
111
|
+
return _$ce(2, 'div', [_$ce(2, 'img', null, 1, _$cn(k + "-upload-img"), {
|
|
123
112
|
'src': $value.url
|
|
124
113
|
}), _$cc(Transition, {
|
|
125
114
|
'name': 'k-fade',
|
|
126
115
|
'children': $value.status === UploadFileStatus.Ready || $value.status === UploadFileStatus.Uploading ? _$ce(2, 'div', _$cc(Progress, {
|
|
127
116
|
'percent': $value.percent,
|
|
128
117
|
'size': 'mini',
|
|
129
|
-
'className':
|
|
130
|
-
}), 2,
|
|
131
|
-
'className':
|
|
118
|
+
'className': _$cn(k + "-upload-progress")
|
|
119
|
+
}), 2, _$cn(k + "-upload-overlap"), null, 'overlap') : _$ce(2, 'div', [_$cc(Icon, {
|
|
120
|
+
'className': _$cn(k + "-upload-zoom ion-ios-eye-outline"),
|
|
132
121
|
'size': 'large',
|
|
133
122
|
'hoverable': true,
|
|
134
123
|
'ev-click': function evClick() {
|
|
135
124
|
return show($value);
|
|
136
125
|
}
|
|
137
|
-
}), closeBtn($value, $key)], 0,
|
|
138
|
-
})], 4, _$cn({
|
|
139
|
-
"k-upload-picture k-upload-picture-card": true,
|
|
140
|
-
'k-error': $value.status === UploadFileStatus.Error
|
|
141
|
-
}), null, $value.uid);
|
|
126
|
+
}), closeBtn($value, $key)], 0, _$cn(k + "-upload-overlap " + k + "-upload-icons"))
|
|
127
|
+
})], 4, _$cn((_$cn2 = {}, _$cn2[k + "-upload-picture " + k + "-upload-picture-card"] = true, _$cn2[k + "-error"] = $value.status === UploadFileStatus.Error, _$cn2)), null, $value.uid);
|
|
142
128
|
}, $this), !limit || files.length < limit ? _$ce(2, 'div', handle, 0, 'c-middle', null, 'handle') : undefined]
|
|
143
|
-
}), 2,
|
|
129
|
+
}), 2, _$cn(k + "-upload-pictures")) : handle, $blocks.tip ? _$ce(2, 'div', (_$blocks['tip'] = function ($super) {
|
|
144
130
|
return null;
|
|
145
131
|
}, __$blocks['tip'] = function ($super, data) {
|
|
146
132
|
var block = $blocks['tip'];
|
|
@@ -150,27 +136,30 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
150
136
|
};
|
|
151
137
|
|
|
152
138
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
153
|
-
}, __$blocks['tip'](_$no)), 0,
|
|
139
|
+
}, __$blocks['tip'](_$no)), 0, _$cn(k + "-upload-tip")) : undefined, type !== 'gallery' ? _$ce(2, 'div', _$cc(TransitionGroup, _extends({}, expandAnimationCallbacks, {
|
|
154
140
|
'children': _$ma(files, function ($value, $key) {
|
|
155
|
-
|
|
141
|
+
var _$cn3;
|
|
142
|
+
|
|
143
|
+
return _$ce(2, 'div', [_$ce(2, 'div', [_$ce(2, 'div', [_$cc(Icon, {
|
|
144
|
+
'className': _$cn(k + "-upload-file-icon ion-document")
|
|
145
|
+
}), _$ce(2, 'span', $value.name, 0, _$cn(k + "-upload-file-name")), $value.status === UploadFileStatus.Done ? _$cc(Icon, {
|
|
146
|
+
'className': _$cn(k + "-upload-status-icon " + k + "-icon-success-fill")
|
|
147
|
+
}) : $value.status === UploadFileStatus.Error ? _$cc(Icon, {
|
|
148
|
+
'className': _$cn(k + "-upload-status-icon " + k + "-icon-error-fill")
|
|
149
|
+
}) : undefined], 0, _$cn(k + "-upload-name c-ellipsis")), _$cc(Transition, _extends({}, expandAnimationCallbacks, {
|
|
156
150
|
'children': $value.status === UploadFileStatus.Ready || $value.status === UploadFileStatus.Uploading ? _$cc(Progress, {
|
|
157
151
|
'percent': $value.percent,
|
|
158
152
|
'size': 'mini',
|
|
159
|
-
'className':
|
|
153
|
+
'className': _$cn(k + "-upload-progress")
|
|
160
154
|
}) : undefined
|
|
161
|
-
}))], 4,
|
|
162
|
-
"k-upload-file": true,
|
|
163
|
-
'k-error': $value.status === UploadFileStatus.Error
|
|
164
|
-
}), null, $value.uid);
|
|
155
|
+
}))], 4, _$cn(k + "-upload-file-main")), closeBtn($value, $key)], 0, _$cn((_$cn3 = {}, _$cn3[k + "-upload-file"] = true, _$cn3[k + "-error"] = $value.status === UploadFileStatus.Error, _$cn3)), null, $value.uid);
|
|
165
156
|
}, $this)
|
|
166
|
-
})), 2,
|
|
157
|
+
})), 2, _$cn(k + "-upload-files")) : undefined, _$cc(Dialog, {
|
|
167
158
|
'title': _$("查看图片"),
|
|
168
159
|
'key': 'dialog',
|
|
169
160
|
'value': isShow.value,
|
|
170
161
|
'ev-close': close,
|
|
171
|
-
'className': _$cn((_$
|
|
172
|
-
"k-upload-dialog": true
|
|
173
|
-
}, _$cn2[makeUploadDialogStyles()] = true, _$cn2)),
|
|
162
|
+
'className': _$cn((_$cn4 = {}, _$cn4[k + "-upload-dialog"] = true, _$cn4[makeUploadDialogStyles(k)] = true, _$cn4)),
|
|
174
163
|
'children': image.value ? _$ce(2, 'a', _$ce(2, 'img', null, 1, null, {
|
|
175
164
|
'src': image.value.url
|
|
176
165
|
}), 2, null, {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
3
|
-
export declare function makeUploadDialogStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
3
|
+
export declare function makeUploadDialogStyles(k: string): string;
|
|
@@ -135,10 +135,10 @@ setDefault(function () {
|
|
|
135
135
|
upload: defaults
|
|
136
136
|
}).upload;
|
|
137
137
|
});
|
|
138
|
-
export function makeStyles() {
|
|
139
|
-
return /*#__PURE__*/css("font-size:", upload.fontSize, ";position:relative;.k-icon-upload{position:relative;top:-1px;}.k-upload-handle{display:inline-block;vertical-align:middle;color:", upload.color, ";}.k-upload-tip{margin-top:", upload.tip.gap, ";color:", upload.color, ";}.k-upload-files{margin-top:", upload.filesGap, ";}.k-upload-file{margin:", upload.file.margin, ";padding-right:", upload.file.delete.width, ";position:relative;&:hover{.k-upload-close{display:inline-flex;position:absolute;right:", upload.file.delete.right, ";top:", upload.file.delete.top, ";}.k-upload-file-main{background:", upload.file.bgColor, ";}}}.k-upload-file-main{padding:", upload.file.padding, ";border-radius:", upload.file.borderRadius, ";}.k-upload-name{display:flex;align-items:center;height:", upload.file.height, ";}.k-upload-file-icon{margin-right:", upload.file.fileIconGap, ";}.k-upload-file-name{flex:1;}.k-upload-status-icon{color:", upload.file.status.color, ";margin-right:", upload.file.status.offsetRight, ";}.k-upload-close{display:none;}.k-upload-file.k-error{color:", upload.file.errorColor, ";.k-upload-status-icon{color:", upload.file.status.errorColor, ";}}.k-upload-progress{.k-progress-text{width:auto!important;}}&.k-drag{.k-upload-handle{display:block;border:", upload.drag.border, ";border-radius:", upload.drag.borderRadius, ";cursor:pointer;text-align:center;transition:border-color ", upload.transition, ";background:", upload.drag.bgColor, ";&:hover{border-color:", upload.drag.hoverBorderColor, ";}}.k-upload-area{padding:", upload.drag.padding, ";.k-icon{display:inline-block;font-size:", upload.drag.icon.fontSize, ";margin-bottom:", upload.drag.icon.gap, ";}}&.k-dragover{.k-upload-handle{border-color:", upload.drag.overBorderColor, ";}}}.k-upload-pictures{display:inline-block;vertical-align:middle;}.k-upload-picture{padding:", upload.gallery.padding, ";position:relative;vertical-align:middle;&.k-error{border-color:", upload.gallery.errorBorderColor, ";}.k-upload-close{display:inline-flex;}&:hover{.k-upload-icons{opacity:1;}}.k-upload-img{display:inline-block;width:100%;height:100%;}.k-upload-icons{opacity:0;transition:opacity ", upload.transition, ";}}.k-upload-picture-card{display:inline-flex;width:", upload.gallery.width, ";height:", upload.gallery.height, ";border-radius:", upload.gallery.borderRadius, ";border:", upload.gallery.border, ";margin:", upload.gallery.margin, ";background:", upload.gallery.bgColor, ";align-items:center;justify-content:center;flex-direction:column;}.k-upload-add{border:", upload.gallery.add.border, ";cursor:pointer;&:hover{border-color:", upload.gallery.add.hoverBorderColor, ";}}.k-upload-overlap{position:absolute;width:100%;height:100%;left:0;top:0;background:", upload.overlap.bgColor, ";display:flex;align-items:center;justify-content:center;gap:", upload.overlap.iconGap, ";color:", upload.overlap.color, ";.k-icon:not(:hover){color:inherit;}.k-upload-progress{position:absolute;width:100%;top:50%;padding:", upload.gallery.padding, ";transform:translateY(-50%);}}");
|
|
138
|
+
export function makeStyles(k) {
|
|
139
|
+
return /*#__PURE__*/css("font-size:", upload.fontSize, ";position:relative;.", k, "-icon-upload{position:relative;top:-1px;}.", k, "-upload-handle{display:inline-block;vertical-align:middle;color:", upload.color, ";}.", k, "-upload-tip{margin-top:", upload.tip.gap, ";color:", upload.color, ";}.", k, "-upload-files{margin-top:", upload.filesGap, ";}.", k, "-upload-file{margin:", upload.file.margin, ";padding-right:", upload.file.delete.width, ";position:relative;&:hover{.", k, "-upload-close{display:inline-flex;position:absolute;right:", upload.file.delete.right, ";top:", upload.file.delete.top, ";}.", k, "-upload-file-main{background:", upload.file.bgColor, ";}}}.", k, "-upload-file-main{padding:", upload.file.padding, ";border-radius:", upload.file.borderRadius, ";}.", k, "-upload-name{display:flex;align-items:center;height:", upload.file.height, ";}.", k, "-upload-file-icon{margin-right:", upload.file.fileIconGap, ";}.", k, "-upload-file-name{flex:1;}.", k, "-upload-status-icon{color:", upload.file.status.color, ";margin-right:", upload.file.status.offsetRight, ";}.", k, "-upload-close{display:none;}.", k, "-upload-file.", k, "-error{color:", upload.file.errorColor, ";.", k, "-upload-status-icon{color:", upload.file.status.errorColor, ";}}.", k, "-upload-progress{.", k, "-progress-text{width:auto!important;}}&.", k, "-drag{.", k, "-upload-handle{display:block;border:", upload.drag.border, ";border-radius:", upload.drag.borderRadius, ";cursor:pointer;text-align:center;transition:border-color ", upload.transition, ";background:", upload.drag.bgColor, ";&:hover{border-color:", upload.drag.hoverBorderColor, ";}}.", k, "-upload-area{padding:", upload.drag.padding, ";.", k, "-icon{display:inline-block;font-size:", upload.drag.icon.fontSize, ";margin-bottom:", upload.drag.icon.gap, ";}}&.", k, "-dragover{.", k, "-upload-handle{border-color:", upload.drag.overBorderColor, ";}}}.", k, "-upload-pictures{display:inline-block;vertical-align:middle;}.", k, "-upload-picture{padding:", upload.gallery.padding, ";position:relative;vertical-align:middle;&.", k, "-error{border-color:", upload.gallery.errorBorderColor, ";}.", k, "-upload-close{display:inline-flex;}&:hover{.", k, "-upload-icons{opacity:1;}}.", k, "-upload-img{display:inline-block;width:100%;height:100%;}.", k, "-upload-icons{opacity:0;transition:opacity ", upload.transition, ";}}.", k, "-upload-picture-card{display:inline-flex;width:", upload.gallery.width, ";height:", upload.gallery.height, ";border-radius:", upload.gallery.borderRadius, ";border:", upload.gallery.border, ";margin:", upload.gallery.margin, ";background:", upload.gallery.bgColor, ";align-items:center;justify-content:center;flex-direction:column;}.", k, "-upload-add{border:", upload.gallery.add.border, ";cursor:pointer;&:hover{border-color:", upload.gallery.add.hoverBorderColor, ";}}.", k, "-upload-overlap{position:absolute;width:100%;height:100%;left:0;top:0;background:", upload.overlap.bgColor, ";display:flex;align-items:center;justify-content:center;gap:", upload.overlap.iconGap, ";color:", upload.overlap.color, ";.", k, "-icon:not(:hover){color:inherit;}.", k, "-upload-progress{position:absolute;width:100%;top:50%;padding:", upload.gallery.padding, ";transform:translateY(-50%);}}");
|
|
140
140
|
}
|
|
141
|
-
export function makeUploadDialogStyles() {
|
|
141
|
+
export function makeUploadDialogStyles(k) {
|
|
142
142
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
|
|
143
143
|
name: "18e4bfd",
|
|
144
144
|
styles: "img{width:100%;}"
|
package/components/utils.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Component, VNode, Children, VNodeComponentClass, ComponentConstructor } from 'intact-react';
|
|
2
2
|
export declare function bind<T extends Function>(target: any, key: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
|
|
3
3
|
export declare function addStyle(style: string | Record<string, string | null> | undefined, extra: Record<string, string | null>): string | Record<string, string | null>;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function cache(callback: (...args: string[]) => any): (...args: string[]) => string;
|
|
5
|
+
export declare const kebabCase: (...args: string[]) => string;
|
|
5
6
|
export declare function isTextChildren(o: any): boolean;
|
|
6
7
|
export declare function isTextVNode(o: VNode): boolean;
|
|
7
8
|
export declare function isTextBlock(o: any): boolean;
|
|
@@ -24,6 +25,7 @@ export declare function range(start: number, end: number): number[];
|
|
|
24
25
|
export declare function strPad(str: number | string, length: number, pad?: string): string;
|
|
25
26
|
declare type EqualArrayValue = any | EqualArrayValue[];
|
|
26
27
|
export declare function isEqualArray(a: EqualArrayValue, b: EqualArrayValue): boolean;
|
|
28
|
+
export declare function isEqualObject(a: Record<string, any>, b: Record<string, any>): boolean;
|
|
27
29
|
export declare function last<T>(arr: T[]): T | undefined;
|
|
28
30
|
export declare const expandAnimationCallbacks: {
|
|
29
31
|
name: string;
|
package/components/utils.js
CHANGED
|
@@ -5,7 +5,7 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slic
|
|
|
5
5
|
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
6
6
|
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
|
|
7
7
|
import { isText } from 'intact-react';
|
|
8
|
-
import { isStringOrNumber, isString, isNullOrUndefined, isInvalid } from 'intact-shared'; // @reference https://github.com/andreypopp/autobind-decorator/blob/master/src/index.js
|
|
8
|
+
import { isStringOrNumber, isString, isNullOrUndefined, isInvalid, hasOwn } from 'intact-shared'; // @reference https://github.com/andreypopp/autobind-decorator/blob/master/src/index.js
|
|
9
9
|
// for loose mode
|
|
10
10
|
|
|
11
11
|
export function bind(target, key, descriptor) {
|
|
@@ -97,16 +97,27 @@ export function addStyle(style, extra) {
|
|
|
97
97
|
return style;
|
|
98
98
|
}
|
|
99
99
|
var _cache = {};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
106
|
-
}
|
|
100
|
+
export function cache(callback) {
|
|
101
|
+
return function () {
|
|
102
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
103
|
+
args[_key] = arguments[_key];
|
|
104
|
+
}
|
|
107
105
|
|
|
108
|
-
|
|
106
|
+
var cacheId = args.join('~');
|
|
107
|
+
|
|
108
|
+
if (!hasOwn.call(_cache, cacheId)) {
|
|
109
|
+
_cache[cacheId] = callback.apply(void 0, args);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return _cache[cacheId];
|
|
113
|
+
};
|
|
109
114
|
}
|
|
115
|
+
var uppercasePattern = /[A-Z]/g;
|
|
116
|
+
export var kebabCase = cache(function (word) {
|
|
117
|
+
return word.replace(uppercasePattern, function (item) {
|
|
118
|
+
return "-" + item.toLowerCase();
|
|
119
|
+
});
|
|
120
|
+
});
|
|
110
121
|
export function isTextChildren(o) {
|
|
111
122
|
if (isStringOrNumber(o)) return true;
|
|
112
123
|
|
|
@@ -290,6 +301,22 @@ export function isEqualArray(a, b) {
|
|
|
290
301
|
|
|
291
302
|
return false;
|
|
292
303
|
}
|
|
304
|
+
export function isEqualObject(a, b) {
|
|
305
|
+
if (a === b) return true;
|
|
306
|
+
|
|
307
|
+
if (a && b) {
|
|
308
|
+
var keysA = _Object$keys(a);
|
|
309
|
+
|
|
310
|
+
var keysB = _Object$keys(b);
|
|
311
|
+
|
|
312
|
+
if (keysA.length !== keysB.length) return false;
|
|
313
|
+
return keysA.every(function (key) {
|
|
314
|
+
return a[key] === b[key];
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
293
320
|
export function last(arr) {
|
|
294
321
|
return arr[arr.length - 1];
|
|
295
322
|
}
|
package/components/virtual.js
CHANGED
|
@@ -82,14 +82,17 @@ export var Virtual = /*#__PURE__*/function (_Component) {
|
|
|
82
82
|
/* vue2 vnode */
|
|
83
83
|
) {
|
|
84
84
|
var data = vnode.data;
|
|
85
|
-
|
|
85
|
+
if (!data) return props;
|
|
86
|
+
var on = data.on || EMPTY_OBJ;
|
|
86
87
|
var _events = {};
|
|
87
88
|
|
|
88
89
|
for (var _key2 in on) {
|
|
89
90
|
_events["ev-" + _key2] = on[_key2];
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
return _extends({}, props, _events
|
|
93
|
+
return _extends({}, props, _events, {
|
|
94
|
+
className: data.staticClass
|
|
95
|
+
});
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
return props;
|
package/components/wave/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { isArray } from 'intact-shared';
|
|
|
6
6
|
import { bind } from '../utils';
|
|
7
7
|
import { makeStyles } from './styles';
|
|
8
8
|
import { theme } from '../../styles/theme';
|
|
9
|
+
import { useConfigContext } from '../config';
|
|
9
10
|
var typeDefs = {
|
|
10
11
|
disabled: Boolean,
|
|
11
12
|
color: String,
|
|
@@ -35,6 +36,7 @@ export var Wave = /*#__PURE__*/function (_Component) {
|
|
|
35
36
|
_this.instance = null;
|
|
36
37
|
_this.className = void 0;
|
|
37
38
|
_this.timer = 0;
|
|
39
|
+
_this.config = useConfigContext();
|
|
38
40
|
return _this;
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -45,7 +47,7 @@ export var Wave = /*#__PURE__*/function (_Component) {
|
|
|
45
47
|
color = _this$get.color,
|
|
46
48
|
inset = _this$get.inset;
|
|
47
49
|
|
|
48
|
-
this.className = makeStyles(color || theme.color.primary, inset);
|
|
50
|
+
this.className = makeStyles(color || theme.color.primary, inset, this.config.k);
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
_proto.mounted = function mounted() {
|
|
@@ -80,7 +82,7 @@ export var Wave = /*#__PURE__*/function (_Component) {
|
|
|
80
82
|
var node = e.target; // 点击输入框中的icon时,此时输入框不需要动效
|
|
81
83
|
|
|
82
84
|
var isInput = instance.classList.contains('k-input-wrapper');
|
|
83
|
-
if (disabled || isInput && node.classList.contains('
|
|
85
|
+
if (disabled || isInput && node.classList.contains(this.config.cls('icon'))) return;
|
|
84
86
|
this.resetAnimation();
|
|
85
87
|
instance.addEventListener('animationend', this.resetAnimation);
|
|
86
88
|
this.timer = window.setTimeout(function () {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(color: string, inset: string): string;
|
|
2
|
+
export declare function makeStyles(color: string, inset: string, k: string): string;
|
|
@@ -11,7 +11,7 @@ setDefault(function () {
|
|
|
11
11
|
wave: defaults
|
|
12
12
|
}).wave;
|
|
13
13
|
});
|
|
14
|
-
export function makeStyles(color, inset) {
|
|
14
|
+
export function makeStyles(color, inset, k) {
|
|
15
15
|
var waveEffect = /*#__PURE__*/keyframes("100%{top:calc(", inset, " + ", wave.inset, ");bottom:calc(", inset, " + ", wave.inset, ");left:calc(", inset, " + ", wave.inset, ");right:calc(", inset, " + ", wave.inset, ");opacity:0.05;}");
|
|
16
|
-
return /*#__PURE__*/css("position:relative;&::after{display:block;content:'';position:absolute;top:", inset, ";bottom:", inset, ";left:", inset, ";right:", inset, ";opacity:0.4;border-radius:4px;z-index:2;animation:", waveEffect, " .2s ease-in;animation-fill-mode:forwards;border:2px solid ", color, ";pointer-events:none;}&.k-circle,&.k-radio-wrapper{&:after{border-radius:calc(", theme.large.height, " / 2 + 4px);}}");
|
|
16
|
+
return /*#__PURE__*/css("position:relative;&::after{display:block;content:'';position:absolute;top:", inset, ";bottom:", inset, ";left:", inset, ";right:", inset, ";opacity:0.4;border-radius:4px;z-index:2;animation:", waveEffect, " .2s ease-in;animation-fill-mode:forwards;border:2px solid ", color, ";pointer-events:none;}&.", k, "-circle,&.", k, "-radio-wrapper{&:after{border-radius:calc(", theme.large.height, " / 2 + 4px);}}");
|
|
17
17
|
}
|