@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
|
@@ -101,11 +101,11 @@ setDefault(function () {
|
|
|
101
101
|
table: defaults
|
|
102
102
|
}).table;
|
|
103
103
|
});
|
|
104
|
-
export function makeStyles() {
|
|
105
|
-
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.k-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;td,th{transition:all ", table.transition, ";}}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.k-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.k-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:
|
|
106
|
-
return /*#__PURE__*/css(".k-align-", type, "{text-align:", type, ";}");
|
|
107
|
-
}), ">.k-pagination{margin:16px 0;}");
|
|
104
|
+
export function makeStyles(k) {
|
|
105
|
+
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;td,th{transition:all ", table.transition, ";}}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:bre.", k, "-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
106
|
+
return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
|
|
107
|
+
}), ">.", k, "-pagination{margin:16px 0;}");
|
|
108
108
|
}
|
|
109
|
-
export function makeGroupMenuStyles() {
|
|
110
|
-
return /*#__PURE__*/css("
|
|
109
|
+
export function makeGroupMenuStyles(k) {
|
|
110
|
+
return /*#__PURE__*/css("min-width:", table.group.menuMinWidth, "!important;.", k, "-dropdown-item.", k, "-active{color:", table.group.activeColor, ";}.", k, "-table-group-header{padding:", table.group.headerPadding, ";border-bottom:", table.group.headerBorder, ";}.", k, "-table-group-body{max-height:", table.group.menuMaxHeight, ";overflow:auto;}.", k, "-table-group-footer{text-align:right;border-top:", table.group.headerBorder, ";padding:8px;.", k, "-btn{margin-left:8px;}}");
|
|
111
111
|
}
|
|
@@ -54,7 +54,7 @@ export interface TableEvents<T = any, K extends TableRowKey = number> {
|
|
|
54
54
|
uncheckRow: [T, number, K];
|
|
55
55
|
checkAll: [];
|
|
56
56
|
uncheckAll: [];
|
|
57
|
-
|
|
57
|
+
page: [PaginationChangeData];
|
|
58
58
|
}
|
|
59
59
|
export interface TableBlocks<T = unknown> {
|
|
60
60
|
empty: null;
|
|
@@ -97,6 +97,7 @@ export declare class Table<T = any, RowKey extends TableRowKey = TableRowKey, Ch
|
|
|
97
97
|
private resetRowStatus;
|
|
98
98
|
private draggable;
|
|
99
99
|
private stickyScrollbar;
|
|
100
|
+
private config;
|
|
100
101
|
checkAll(): void;
|
|
101
102
|
uncheckAll(): void;
|
|
102
103
|
getCheckedData(): any[];
|
|
@@ -26,6 +26,7 @@ import { useStickyScrollbar } from './useStickyScrollbar';
|
|
|
26
26
|
import { useWidth } from './useWidth';
|
|
27
27
|
import { useScroll } from './useScroll';
|
|
28
28
|
import { usePagination } from './usePagination';
|
|
29
|
+
import { useConfigContext } from '../config';
|
|
29
30
|
var typeDefs = {
|
|
30
31
|
data: Array,
|
|
31
32
|
fixHeader: [Boolean, String, Number],
|
|
@@ -87,7 +88,7 @@ var events = {
|
|
|
87
88
|
uncheckRow: true,
|
|
88
89
|
checkAll: true,
|
|
89
90
|
uncheckAll: true,
|
|
90
|
-
|
|
91
|
+
page: true
|
|
91
92
|
};
|
|
92
93
|
export var Table = /*#__PURE__*/function (_Component) {
|
|
93
94
|
_inheritsLoose(Table, _Component);
|
|
@@ -119,6 +120,7 @@ export var Table = /*#__PURE__*/function (_Component) {
|
|
|
119
120
|
_this.resetRowStatus = useRestRowStatus(_this.disableRow.getAllKeys);
|
|
120
121
|
_this.draggable = useDraggable(_this.pagination.data);
|
|
121
122
|
_this.stickyScrollbar = useStickyScrollbar(_this.stickyHeader.elementRef, _this.scroll, _this.width.tableRef, _this.fixedColumns.setScrollPosition);
|
|
123
|
+
_this.config = useConfigContext();
|
|
122
124
|
return _this;
|
|
123
125
|
}
|
|
124
126
|
|
|
@@ -23,11 +23,6 @@ import { Pagination } from '../pagination';
|
|
|
23
23
|
var _$tmp0 = {
|
|
24
24
|
'width': '40'
|
|
25
25
|
};
|
|
26
|
-
var _$tmp1 = {
|
|
27
|
-
'overlay': true,
|
|
28
|
-
'size': 'small',
|
|
29
|
-
'className': 'k-table-spin'
|
|
30
|
-
};
|
|
31
26
|
export default function ($props, $blocks, $__proto__) {
|
|
32
27
|
var _classNameObj,
|
|
33
28
|
_this = this;
|
|
@@ -82,10 +77,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
82
77
|
excludeStickHeader = _this$stickyHeader.excludeStickHeader,
|
|
83
78
|
elementRef = _this$stickyHeader.elementRef,
|
|
84
79
|
headRef = _this$stickyHeader.headRef;
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
'k-fix-header': fixHeader
|
|
88
|
-
}, _classNameObj["k-scroll-" + scrollPosition.value] = scrollPosition.value, _classNameObj['k-fix-columns'] = hasFixed.value, _classNameObj["k-" + type] = type && type !== 'default', _classNameObj['k-stripe'] = stripe, _classNameObj['k-with-expand'] = $blocks.expand, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
80
|
+
var k = this.config.k;
|
|
81
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-table"] = true, _classNameObj[k + "-fix-header"] = fixHeader, _classNameObj[k + "-scroll-" + scrollPosition.value] = scrollPosition.value, _classNameObj[k + "-fix-columns"] = hasFixed.value, _classNameObj[k + "-" + type] = type && type !== 'default', _classNameObj[k + "-stripe"] = stripe, _classNameObj[k + "-with-expand"] = $blocks.expand, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
89
82
|
var style = isStringOrNumber(fixHeader) ? {
|
|
90
83
|
maxHeight: fixHeader + "px"
|
|
91
84
|
} : null;
|
|
@@ -186,7 +179,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
186
179
|
};
|
|
187
180
|
|
|
188
181
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
189
|
-
}, __$blocks['empty'](_$no)), 0,
|
|
182
|
+
}, __$blocks['empty'](_$no)), 0, _$cn(k + "-table-empty"), {
|
|
190
183
|
'colspan': colCount
|
|
191
184
|
}), 2, null, null, 'table-empty') : function () {
|
|
192
185
|
var rows = [];
|
|
@@ -269,6 +262,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
269
262
|
rows.push(row);
|
|
270
263
|
|
|
271
264
|
if ($blocks.expand) {
|
|
265
|
+
var _$cn3;
|
|
266
|
+
|
|
272
267
|
var expanded = isExpanded(key);
|
|
273
268
|
rows.push(_$ce(2, 'tr', _$ce(2, 'td', _$cc(Transition, _extends({}, expandAnimationCallbacks, {
|
|
274
269
|
'children': expanded ? _$ce(2, 'div', (_$blocks['expand'] = function ($super) {
|
|
@@ -281,13 +276,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
281
276
|
};
|
|
282
277
|
|
|
283
278
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
284
|
-
}, __$blocks['expand'](_$no, [value, index])), 0,
|
|
279
|
+
}, __$blocks['expand'](_$no, [value, index])), 0, _$cn(k + "-table-expand")) : undefined
|
|
285
280
|
})), 2, null, {
|
|
286
281
|
'colspan': colCount
|
|
287
|
-
}), 2, _$cn({
|
|
288
|
-
"k-expand": true,
|
|
289
|
-
'k-expanded': expanded
|
|
290
|
-
}), null, key + ".$expand"));
|
|
282
|
+
}), 2, _$cn((_$cn3 = {}, _$cn3[k + "-expand"] = true, _$cn3[k + "-expanded"] = expanded, _$cn3)), null, key + ".$expand"));
|
|
291
283
|
}
|
|
292
284
|
|
|
293
285
|
return hidden || !spreaded;
|
|
@@ -315,7 +307,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
315
307
|
return _$ce(2, 'div', [_$ce(2, 'div', [!isNull(stickHeader.value) ? _$cc(Affix, {
|
|
316
308
|
'top': stickHeader.value,
|
|
317
309
|
'exclude': excludeStickHeader,
|
|
318
|
-
'className':
|
|
310
|
+
'className': _$cn(k + "-table-affix-header"),
|
|
319
311
|
'children': _$ce(2, 'table', [colgroup, thead], 0, null, {
|
|
320
312
|
'style': {
|
|
321
313
|
width: tableWidthPx
|
|
@@ -325,7 +317,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
325
317
|
'style': {
|
|
326
318
|
width: tableWidthPx
|
|
327
319
|
}
|
|
328
|
-
}, null, tableRef)], 0,
|
|
320
|
+
}, null, tableRef)], 0, _$cn(k + "-table-wrapper"), {
|
|
329
321
|
'style': style
|
|
330
322
|
}, null, scrollRef), pagination ? _$cc(Pagination, _extends({
|
|
331
323
|
'ref': paginationRef,
|
|
@@ -337,16 +329,20 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
337
329
|
'ev-change': onPageChange
|
|
338
330
|
}), null, paginationRef) : undefined, _$cc(Transition, {
|
|
339
331
|
'name': 'k-fade',
|
|
340
|
-
'children': loading ? _$cc(Spin,
|
|
332
|
+
'children': loading ? _$cc(Spin, {
|
|
333
|
+
'overlay': true,
|
|
334
|
+
'size': 'small',
|
|
335
|
+
'className': _$cn(k + "-table-spin")
|
|
336
|
+
}) : undefined
|
|
341
337
|
}), !isNull(stickScrollbar.value) ? _$cc(Affix, {
|
|
342
338
|
'bottom': stickScrollbar.value,
|
|
343
339
|
'shouldFix': shouldStickScrollbar,
|
|
344
340
|
'style': stickScrollbarStyle.value,
|
|
345
|
-
'children': _$ce(2, 'div', _$ce(2, 'div', null, 1,
|
|
341
|
+
'children': _$ce(2, 'div', _$ce(2, 'div', null, 1, _$cn(k + "-table-scrollbar-inner"), {
|
|
346
342
|
'style': {
|
|
347
343
|
width: tableActualWidth.value
|
|
348
344
|
}
|
|
349
|
-
}), 2,
|
|
345
|
+
}), 2, _$cn(k + "-table-scrollbar"), {
|
|
350
346
|
'ev-scroll': onScrollbarScroll
|
|
351
347
|
}, null, scrollbarRef)
|
|
352
348
|
}) : undefined], 0, _$cn(classNameObj), null, null, elementRef);
|
|
@@ -3,6 +3,7 @@ import { TableColumn, TableColumnProps } from './column';
|
|
|
3
3
|
export declare const context: {
|
|
4
4
|
Provider: import("intact").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<("none" | "radio" | "checkbox") | undefined>, {}, {}, {}>>;
|
|
5
5
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<("none" | "radio" | "checkbox") | undefined>, {}, {}, {}>>;
|
|
6
|
+
useContext: () => import("intact").RefObject<("none" | "radio" | "checkbox") | undefined>;
|
|
6
7
|
};
|
|
7
8
|
export declare function useColumns(): {
|
|
8
9
|
getColumns: () => VNodeComponentClass<TableColumn<any>>[][];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VNodeComponentClass, Props, Key } from 'intact-react';
|
|
1
|
+
import { VNodeComponentClass, Props, RefObject, Key } from 'intact-react';
|
|
2
2
|
import { TableColumn, TableColumnProps } from './column';
|
|
3
3
|
import type { TableProps, TableRowKey } from './table';
|
|
4
4
|
import { State } from '../../hooks/useState';
|
|
@@ -7,6 +7,7 @@ declare type ScrollPosition = 'left' | 'middle' | 'right';
|
|
|
7
7
|
export declare const context: {
|
|
8
8
|
Provider: import("intact").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
9
9
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
10
|
+
useContext: () => RefObject<any>;
|
|
10
11
|
};
|
|
11
12
|
export declare function useFixedColumns(getColumns: () => VNodeComponentClass<TableColumn>[][], { scrollRef, callbacks }: ReturnType<typeof useScroll>, widthMap: State<Record<TableRowKey, number>>): {
|
|
12
13
|
scrollPosition: State<ScrollPosition | null>;
|
|
@@ -7,6 +7,7 @@ declare type ContextValue = {
|
|
|
7
7
|
export declare const context: {
|
|
8
8
|
Provider: import('intact-react').ComponentConstructor<import("intact").Component<import("../context").ProviderProps<ContextValue>, {}, {}, {}>>;
|
|
9
9
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<ContextValue>, {}, {}, {}>>;
|
|
10
|
+
useContext: () => import("intact").RefObject<ContextValue | undefined>;
|
|
10
11
|
};
|
|
11
12
|
export declare function useGroup(): {
|
|
12
13
|
onSelect: (value: any, onChange: ContextValue['onChange']) => void;
|
|
@@ -4,6 +4,7 @@ import { State } from '../../hooks/useState';
|
|
|
4
4
|
export declare const context: {
|
|
5
5
|
Provider: import("intact").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
6
6
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
7
|
+
useContext: () => RefObject<any>;
|
|
7
8
|
};
|
|
8
9
|
export declare function useResizable(scrollRef: RefObject<HTMLElement>, tableRef: RefObject<HTMLElement>, tableWidth: State<number | null>, widthMap: State<Record<TableRowKey, number>>, storeWidth: () => void): {
|
|
9
10
|
start: (e: MouseEvent) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const context: {
|
|
2
2
|
Provider: import('intact-react').ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
3
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
|
+
useContext: () => import("intact").RefObject<any>;
|
|
4
5
|
};
|
|
5
6
|
export declare function useSortable(): {
|
|
6
7
|
onChange: (key: string, event: Event & {
|
|
@@ -21,6 +21,10 @@ export declare class Tabs<T = any> extends Component<TabsProps<T>, TabsEvents<T>
|
|
|
21
21
|
static events: Events<TabsEvents<any>>;
|
|
22
22
|
private activeBar;
|
|
23
23
|
private scroll;
|
|
24
|
+
config: {
|
|
25
|
+
cls: (name: string) => string;
|
|
26
|
+
readonly k: string;
|
|
27
|
+
};
|
|
24
28
|
init(): void;
|
|
25
29
|
changeTab(tabProps: TabProps): Promise<void>;
|
|
26
30
|
remove(value: T): void;
|
package/components/tabs/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { TABS } from './constants';
|
|
|
8
8
|
import { sizes } from '../../styles/utils';
|
|
9
9
|
import { useActiveBar } from './useActiveBar';
|
|
10
10
|
import { useScroll } from './useScroll';
|
|
11
|
+
import { useConfigContext } from '../config';
|
|
11
12
|
export * from './tab';
|
|
12
13
|
var typeDefs = {
|
|
13
14
|
value: null,
|
|
@@ -43,6 +44,7 @@ export var Tabs = /*#__PURE__*/function (_Component) {
|
|
|
43
44
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
44
45
|
_this.activeBar = useActiveBar();
|
|
45
46
|
_this.scroll = useScroll();
|
|
47
|
+
_this.config = useConfigContext();
|
|
46
48
|
return _this;
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -27,13 +27,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
27
27
|
next = _this$scroll.next,
|
|
28
28
|
scrollRef = _this$scroll.scrollRef,
|
|
29
29
|
wrapperRef = _this$scroll.wrapperRef;
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
}, _classNameObj["k-size-" + size] = size, _classNameObj['k-vertical'] = vertical, _classNameObj["k-type-" + type] = true, _classNameObj["k-is-scroll"] = isScroll.value, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
30
|
+
var k = this.config.k;
|
|
31
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-tabs"] = true, _classNameObj[k + "-size-" + size] = size, _classNameObj[k + "-vertical"] = vertical, _classNameObj[k + "-type-" + type] = true, _classNameObj[k + "-is-scroll"] = isScroll.value, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
33
32
|
return _$cv('div', _extends({
|
|
34
33
|
'className': _$cn(classNameObj)
|
|
35
34
|
}, getRestProps(this)), [isScroll.value ? _$cc(Button, {
|
|
36
|
-
'className':
|
|
35
|
+
'className': _$cn(k + "-tabs-prev"),
|
|
37
36
|
'type': 'none',
|
|
38
37
|
'icon': true,
|
|
39
38
|
'key': 'prev',
|
|
@@ -41,16 +40,16 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
41
40
|
'disabled': !enablePrev.value,
|
|
42
41
|
'ev-click': prev,
|
|
43
42
|
'children': _$cc(Icon, {
|
|
44
|
-
'className': _$cn(vertical ? "
|
|
43
|
+
'className': _$cn(vertical ? k + "-icon-up" : k + "-icon-left")
|
|
45
44
|
})
|
|
46
|
-
}, 'prev') : undefined, _$ce(2, 'div', _$ce(2, 'div', [children, _$ce(2, 'div', null, 1,
|
|
45
|
+
}, 'prev') : undefined, _$ce(2, 'div', _$ce(2, 'div', [children, _$ce(2, 'div', null, 1, _$cn(k + "-tabs-active-bar"), {
|
|
47
46
|
'style': this.activeBar.value
|
|
48
|
-
})], 0,
|
|
47
|
+
})], 0, _$cn(k + "-tabs-wrapper"), {
|
|
49
48
|
'style': {
|
|
50
49
|
transform: vertical ? "translateY(" + offset.value + "px)" : "translateX(" + offset.value + "px)"
|
|
51
50
|
}
|
|
52
|
-
}, null, wrapperRef), 2,
|
|
53
|
-
'className':
|
|
51
|
+
}, null, wrapperRef), 2, _$cn(k + "-tabs-scroll c-clearfix"), null, null, scrollRef), isScroll.value ? _$cc(Button, {
|
|
52
|
+
'className': _$cn(k + "-tabs-next"),
|
|
54
53
|
'type': 'none',
|
|
55
54
|
'icon': true,
|
|
56
55
|
'key': 'next',
|
|
@@ -58,7 +57,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
58
57
|
'disabled': !enableNext.value,
|
|
59
58
|
'ev-click': next,
|
|
60
59
|
'children': _$cc(Icon, {
|
|
61
|
-
'className': _$cn(vertical ? "
|
|
60
|
+
'className': _$cn(vertical ? k + "-icon-down" : k + "-icon-right")
|
|
62
61
|
})
|
|
63
62
|
}, 'next') : undefined]);
|
|
64
63
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
export declare function makeStyles(): string;
|
|
2
|
+
export declare function makeStyles(k: string): string;
|
|
@@ -108,37 +108,37 @@ setDefault(function () {
|
|
|
108
108
|
tabs: defaults
|
|
109
109
|
}).tabs;
|
|
110
110
|
});
|
|
111
|
-
export function makeStyles() {
|
|
112
|
-
return /*#__PURE__*/css(makeCommonStyles(), ";", makeScrollStyles(), ";&.k-type-default{", makeDefaultStyles(), ";}&.k-type-card{", makeCardStyles(), ";}&.k-type-flat-card{", makeFlatCardStyles(), ";}");
|
|
111
|
+
export function makeStyles(k) {
|
|
112
|
+
return /*#__PURE__*/css(makeCommonStyles(k), ";", makeScrollStyles(k), ";&.", k, "-type-default{", makeDefaultStyles(k), ";}&.", k, "-type-card{", makeCardStyles(k), ";}&.", k, "-type-flat-card{", makeFlatCardStyles(k), ";}");
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
function makeCommonStyles() {
|
|
115
|
+
function makeCommonStyles(k) {
|
|
116
116
|
var active = tabs.active;
|
|
117
117
|
var bar = active.bar;
|
|
118
|
-
return /*#__PURE__*/css("position:relative;.k-tab{display:inline-flex;cursor:pointer;text-align:center;align-items:center;color:", tabs.color, ";white-space:nowrap;text-overflow:ellipsis;&:hover,&.k-active{color:", active.color, ";}&.k-disabled{color:", theme.color.disabled, ";cursor:not-allowed;}}.k-tab-close{margin-right:-", tabs.closeGap, ";margin-left:", tabs.closeGap, ";color:", theme.color.lightBlack, ";}.k-tabs-active-bar{transition:all ", tabs.transition, ";position:absolute;left:0;height:", bar.height, ";background:", bar.bgColor, ";bottom:0;}&.k-vertical{display:inline-block;.k-tab{display:block;}.k-tabs-active-bar{left:auto;top:0;right:0;width:", bar.height, ";height:auto;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
118
|
+
return /*#__PURE__*/css("position:relative;.", k, "-tab{display:inline-flex;cursor:pointer;text-align:center;align-items:center;color:", tabs.color, ";white-space:nowrap;text-overflow:ellipsis;&:hover,&.", k, "-active{color:", active.color, ";}&.", k, "-disabled{color:", theme.color.disabled, ";cursor:not-allowed;}}.", k, "-tab-close{margin-right:-", tabs.closeGap, ";margin-left:", tabs.closeGap, ";color:", theme.color.lightBlack, ";}.", k, "-tabs-active-bar{transition:all ", tabs.transition, ";position:absolute;left:0;height:", bar.height, ";background:", bar.bgColor, ";bottom:0;}&.", k, "-vertical{display:inline-block;.", k, "-tab{display:block;}.", k, "-tabs-active-bar{left:auto;top:0;right:0;width:", bar.height, ";height:auto;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
119
119
|
var styles = tabs[size];
|
|
120
|
-
return "
|
|
120
|
+
return /*#__PURE__*/css("&.", k, "-size-", size, "{.", k, "-tab{font-size:", styles.fontSize, ";height:", styles.height, ";line-height:", styles.height, ";padding:", styles.padding, ";}.", k, "-tab-close .", k, "-icon{font-size:", styles.closeFontSize, ";}&:not(.", k, "-vertical).", k, "-is-scroll{padding:0 ", styles.navigatorWidth, ";}&.", k, "-vertical.", k, "-is-scroll{padding:", styles.navigatorWidth, " 0;}}");
|
|
121
121
|
}), ";");
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
function makeScrollStyles() {
|
|
125
|
-
return /*#__PURE__*/css("overflow:hidden;.k-tabs-scroll{overflow:hidden;position:relative;padding-bottom:1px;margin-bottom:-1px;}&.k-type-card,&.k-type-flat-card{.k-tabs-scroll{padding-bottom:0;margin-bottom:0;}}.k-tabs-wrapper{white-space:nowrap;transition:transform ", tabs.transition, ";}.k-tabs-prev,.k-tabs-next{position:absolute;&:not(.k-disabled){box-shadow:", theme.boxShadow, ";}}&:not(.k-vertical){.k-tabs-wrapper{float:left;}.k-tabs-prev,.k-tabs-next{top:0;}.k-tabs-prev{left:0;}.k-tabs-next{right:0;}}&.k-vertical{&,.k-tabs-scroll{height:100%;}.k-tabs-prev,.k-tabs-next{width:100%!important;left:0;}.k-tabs-prev{top:0;}.k-tabs-next{bottom:0;}}");
|
|
124
|
+
function makeScrollStyles(k) {
|
|
125
|
+
return /*#__PURE__*/css("overflow:hidden;.", k, "-tabs-scroll{overflow:hidden;position:relative;padding-bottom:1px;margin-bottom:-1px;}&.", k, "-type-card,&.", k, "-type-flat-card{.", k, "-tabs-scroll{padding-bottom:0;margin-bottom:0;}}.", k, "-tabs-wrapper{white-space:nowrap;transition:transform ", tabs.transition, ";}.", k, "-tabs-prev,.", k, "-tabs-next{position:absolute;&:not(.", k, "-disabled){box-shadow:", theme.boxShadow, ";}}&:not(.", k, "-vertical){.", k, "-tabs-wrapper{float:left;}.", k, "-tabs-prev,.", k, "-tabs-next{top:0;}.", k, "-tabs-prev{left:0;}.", k, "-tabs-next{right:0;}}&.", k, "-vertical{&,.", k, "-tabs-scroll{height:100%;}.", k, "-tabs-prev,.", k, "-tabs-next{width:100%!important;left:0;}.", k, "-tabs-prev{top:0;}.", k, "-tabs-next{bottom:0;}}");
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
function makeDefaultStyles() {
|
|
129
|
-
return /*#__PURE__*/css("border-bottom:", tabs.border, ";&.k-vertical{border-bottom:none;border-right:", tabs.border, ";}");
|
|
128
|
+
function makeDefaultStyles(k) {
|
|
129
|
+
return /*#__PURE__*/css("border-bottom:", tabs.border, ";&.", k, "-vertical{border-bottom:none;border-right:", tabs.border, ";}");
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
function makeCardCommonStyles() {
|
|
133
|
-
return /*#__PURE__*/css("border-radius:", tabs.card.borderRadius, ";background-color:", tabs.card.bgColor, ";.k-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;}");
|
|
132
|
+
function makeCardCommonStyles(k) {
|
|
133
|
+
return /*#__PURE__*/css("border-radius:", tabs.card.borderRadius, ";background-color:", tabs.card.bgColor, ";.", k, "-tabs-active-bar{background:#fff;top:0;height:auto;z-index:-1;}");
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
function makeCardStyles() {
|
|
136
|
+
function makeCardStyles(k) {
|
|
137
137
|
var borderRadius = tabs.card.borderRadius;
|
|
138
|
-
return /*#__PURE__*/css(makeCardCommonStyles(), ";.k-tabs-active-bar{border-radius:", borderRadius, " ", borderRadius, " 0px 0px;box-shadow:", theme.boxShadow, ";}&.k-vertical{.k-tabs-active-bar{width:100%;left:0;border-radius:", borderRadius, " 0px 0px ", borderRadius, ";}}");
|
|
138
|
+
return /*#__PURE__*/css(makeCardCommonStyles(k), ";.", k, "-tabs-active-bar{border-radius:", borderRadius, " ", borderRadius, " 0px 0px;box-shadow:", theme.boxShadow, ";}&.", k, "-vertical{.", k, "-tabs-active-bar{width:100%;left:0;border-radius:", borderRadius, " 0px 0px ", borderRadius, ";}}");
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function makeFlatCardStyles() {
|
|
141
|
+
function makeFlatCardStyles(k) {
|
|
142
142
|
var padding = tabs.flatCard.padding;
|
|
143
|
-
return /*#__PURE__*/css(makeCardCommonStyles(), ";padding:0 ", padding, ";.k-tabs-active-bar{top:", padding, ";height:calc(100% - ", padding, " * 2);border-radius:", tabs.card.borderRadius, ";}&.k-vertical{padding:", padding, " 0;.k-tabs-active-bar{left:", padding, ";width:calc(100% - ", padding, " * 2);}}");
|
|
143
|
+
return /*#__PURE__*/css(makeCardCommonStyles(k), ";padding:0 ", padding, ";.", k, "-tabs-active-bar{top:", padding, ";height:calc(100% - ", padding, " * 2);border-radius:", tabs.card.borderRadius, ";}&.", k, "-vertical{padding:", padding, " 0;.", k, "-tabs-active-bar{left:", padding, ";width:calc(100% - ", padding, " * 2);}}");
|
|
144
144
|
}
|
package/components/tabs/tab.d.ts
CHANGED
package/components/tabs/tab.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Component, inject } from 'intact-react';
|
|
|
5
5
|
import template from './tab.vdt';
|
|
6
6
|
import { TABS } from './constants';
|
|
7
7
|
import { bind } from '../utils';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
8
9
|
var typeDefs = {
|
|
9
10
|
value: null,
|
|
10
11
|
disabled: Boolean,
|
|
@@ -25,6 +26,7 @@ export var Tab = /*#__PURE__*/function (_Component) {
|
|
|
25
26
|
|
|
26
27
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
27
28
|
_this.tabs = inject(TABS);
|
|
29
|
+
_this.config = useConfigContext();
|
|
28
30
|
return _this;
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -25,10 +25,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
25
25
|
var _this$tabs$get = this.tabs.get(),
|
|
26
26
|
currentValue = _this$tabs$get.value;
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
'k-active': !isNullOrUndefined(value) && value === currentValue
|
|
31
|
-
}, _classNameObj[className] = className, _classNameObj['k-disabled'] = disabled, _classNameObj);
|
|
28
|
+
var k = this.config.k;
|
|
29
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-tab"] = true, _classNameObj[k + "-active"] = !isNullOrUndefined(value) && value === currentValue, _classNameObj[className] = className, _classNameObj[k + "-disabled"] = disabled, _classNameObj);
|
|
32
30
|
return _$cv('div', _extends({}, getRestProps(this), {
|
|
33
31
|
'className': _$cn(classNameObj),
|
|
34
32
|
'ev-click': this.onClick
|
|
@@ -37,7 +35,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
37
35
|
'icon': true,
|
|
38
36
|
'disabled': disabled,
|
|
39
37
|
'size': 'mini',
|
|
40
|
-
'className':
|
|
38
|
+
'className': _$cn(k + "-tab-close"),
|
|
41
39
|
'ev-click': this.remove,
|
|
42
40
|
'children': _$cc(Icon, _$tmp0)
|
|
43
41
|
}) : undefined]);
|
|
@@ -14,7 +14,8 @@ export function useActiveBar() {
|
|
|
14
14
|
|
|
15
15
|
function generateStyle() {
|
|
16
16
|
var element = findDomFromVNode(instance.$lastInput, true);
|
|
17
|
-
var
|
|
17
|
+
var k = instance.config.k;
|
|
18
|
+
var activeTab = element.querySelector("." + k + "-tab." + k + "-active");
|
|
18
19
|
|
|
19
20
|
if (!activeTab) {
|
|
20
21
|
var oldStyles = styles.value;
|
|
@@ -79,7 +79,8 @@ export function useScroll() {
|
|
|
79
79
|
var _instance$get2 = instance.get(),
|
|
80
80
|
vertical = _instance$get2.vertical;
|
|
81
81
|
|
|
82
|
-
var
|
|
82
|
+
var k = instance.config.k;
|
|
83
|
+
var activeTab = scrollRef.value.querySelector("." + k + "-tab." + k + "-active");
|
|
83
84
|
|
|
84
85
|
if (activeTab) {
|
|
85
86
|
var _offset = offset.value; // don't use getBoundingClientRect, it has transform and will return digital number
|
package/components/tag/base.d.ts
CHANGED
package/components/tag/base.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
3
|
import { __decorate } from "tslib";
|
|
3
4
|
import { Component } from 'intact-react';
|
|
4
5
|
import { bind } from '../utils';
|
|
5
6
|
import template from './index.vdt';
|
|
6
7
|
import { sizes } from '../../styles/utils';
|
|
8
|
+
import { useConfigContext } from '../config';
|
|
7
9
|
export var typeDefs = {
|
|
8
10
|
type: ['default', 'primary', 'danger', 'success', 'warning'],
|
|
9
11
|
closable: Boolean,
|
|
@@ -28,7 +30,17 @@ export var Tag = /*#__PURE__*/function (_Component) {
|
|
|
28
30
|
_inheritsLoose(Tag, _Component);
|
|
29
31
|
|
|
30
32
|
function Tag() {
|
|
31
|
-
|
|
33
|
+
var _context;
|
|
34
|
+
|
|
35
|
+
var _this;
|
|
36
|
+
|
|
37
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
|
+
args[_key] = arguments[_key];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
42
|
+
_this.config = useConfigContext();
|
|
43
|
+
return _this;
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
var _proto = Tag.prototype;
|
|
@@ -23,11 +23,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
23
23
|
closed = _this$get.closed,
|
|
24
24
|
size = _this$get.size;
|
|
25
25
|
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
}, _classNameObj[className] = className, _classNameObj["k-" + type] = type !== 'default', _classNameObj["k-" + size] = size !== 'default', _classNameObj["k-" + border] = border, _classNameObj['k-disabled'] = disabled, _classNameObj['k-closable'] = closable, _classNameObj[makeStyles()] = true, _classNameObj[$props.className] = $props.className, _classNameObj);
|
|
26
|
+
var k = this.config.k;
|
|
27
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-tag"] = !$props.className, _classNameObj[className] = className, _classNameObj[k + "-" + type] = type !== 'default', _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-" + border] = border, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-closable"] = closable, _classNameObj[makeStyles(k)] = true, _classNameObj[$props.className] = $props.className, _classNameObj);
|
|
29
28
|
return _$cc(Transition, {
|
|
30
|
-
'name': $props.name ||
|
|
29
|
+
'name': $props.name || k + "-scale",
|
|
31
30
|
'children': !closed ? _$cv('div', _extends({
|
|
32
31
|
'className': _$cn(classNameObj)
|
|
33
32
|
}, getRestProps(this)), [(_$blocks['body'] = function ($super) {
|
|
@@ -42,7 +41,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
42
41
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
43
42
|
}, __$blocks['body'](_$no)), (_$blocks['_close'] = function ($super) {
|
|
44
43
|
return closable ? _$cc(Icon, {
|
|
45
|
-
'className':
|
|
44
|
+
'className': _$cn(k + "-tag-close ion-ios-close-empty"),
|
|
46
45
|
'color': type,
|
|
47
46
|
'hoverable': !disabled,
|
|
48
47
|
'ev-click': this.onClose
|
|
@@ -65,5 +65,5 @@ declare const defaults: {
|
|
|
65
65
|
};
|
|
66
66
|
declare let tag: typeof defaults;
|
|
67
67
|
export { tag };
|
|
68
|
-
export declare function makeStyles(): string;
|
|
69
|
-
export declare function makeTagsStyles(): string;
|
|
68
|
+
export declare function makeStyles(k: string): string;
|
|
69
|
+
export declare function makeTagsStyles(k: string): string;
|
package/components/tag/styles.js
CHANGED
|
@@ -114,16 +114,16 @@ setDefault(function () {
|
|
|
114
114
|
}).tag;
|
|
115
115
|
});
|
|
116
116
|
export { tag };
|
|
117
|
-
export function makeStyles() {
|
|
118
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;padding:", tag.padding, ";border:", tag.border, ";border-radius:", tag.borderRadius, ";font-size:", tag.fontSize, ";height:", tag.height, ";.k-tag-close{font-size:", tag.close.fontSize, ";margin-left:", tag.close.gap, ";width:", tag.close.width, ";}&.k-none{border:none;background:", tag.none.bgColor, ";}", _mapInstanceProperty(types).call(types, function (t) {
|
|
117
|
+
export function makeStyles(k) {
|
|
118
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;padding:", tag.padding, ";border:", tag.border, ";border-radius:", tag.borderRadius, ";font-size:", tag.fontSize, ";height:", tag.height, ";.", k, "-tag-close{font-size:", tag.close.fontSize, ";margin-left:", tag.close.gap, ";width:", tag.close.width, ";}&.", k, "-none{border:none;background:", tag.none.bgColor, ";}", _mapInstanceProperty(types).call(types, function (t) {
|
|
119
119
|
var styles = tag[t];
|
|
120
|
-
return /*#__PURE__*/css("&.k-", t, "{color:", styles.color, ";border-color:", styles.color, ";background:", styles.bgColor, ";}");
|
|
120
|
+
return /*#__PURE__*/css("&.", k, "-", t, "{color:", styles.color, ";border-color:", styles.color, ";background:", styles.bgColor, ";}");
|
|
121
121
|
}), " ", _mapInstanceProperty(sizes).call(sizes, function (s) {
|
|
122
122
|
if (s === 'default') return;
|
|
123
123
|
var styles = tag[s];
|
|
124
|
-
return /*#__PURE__*/css("&.k-", s, "{padding:", styles.padding, ";height:", styles.height, ";font-size:", styles.fontSize, ";.k-tag-close{font-size:", styles.close.fontSize, ";margin-left:", styles.close.gap, ";}}");
|
|
125
|
-
}), "&.k-dashed{border-style:dashed;}&.k-dragging{opacity:0;}");
|
|
124
|
+
return /*#__PURE__*/css("&.", k, "-", s, "{padding:", styles.padding, ";height:", styles.height, ";font-size:", styles.fontSize, ";.", k, "-tag-close{font-size:", styles.close.fontSize, ";margin-left:", styles.close.gap, ";}}");
|
|
125
|
+
}), "&.", k, "-dashed{border-style:dashed;}&.", k, "-dragging{opacity:0;}");
|
|
126
126
|
}
|
|
127
|
-
export function makeTagsStyles() {
|
|
128
|
-
return /*#__PURE__*/css("display:flex;flex-wrap:wrap;gap:", defaults.tags.gap, ";position:relative;overflow:hidden;&.k-nowrap{flex-wrap:nowrap;.k-tag{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;}}.k-tags-more{cursor:default;font-family:monospace;}.k-tag.k-draggable{cursor:move;}");
|
|
127
|
+
export function makeTagsStyles(k) {
|
|
128
|
+
return /*#__PURE__*/css("display:flex;flex-wrap:wrap;gap:", defaults.tags.gap, ";position:relative;overflow:hidden;&.", k, "-nowrap{flex-wrap:nowrap;.", k, "-tag{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;}}.", k, "-tags-more{cursor:default;font-family:monospace;}.", k, "-tag.", k, "-draggable{cursor:move;}");
|
|
129
129
|
}
|
package/components/tag/tags.d.ts
CHANGED
package/components/tag/tags.js
CHANGED
|
@@ -6,6 +6,7 @@ import { useNowrap } from './useNowrap';
|
|
|
6
6
|
import { typeDefs as tagTypeDefs } from './base';
|
|
7
7
|
import { useChildren } from './useChildren';
|
|
8
8
|
import { useDraggable } from './useDraggable';
|
|
9
|
+
import { useConfigContext } from '../config';
|
|
9
10
|
var typeDefs = {
|
|
10
11
|
nowrap: Boolean,
|
|
11
12
|
draggable: Boolean,
|
|
@@ -40,6 +41,7 @@ export var Tags = /*#__PURE__*/function (_Component) {
|
|
|
40
41
|
_this.children = useChildren();
|
|
41
42
|
_this.draggable = useDraggable(_this.children);
|
|
42
43
|
_this.nowrap = useNowrap(_this.draggable);
|
|
44
|
+
_this.config = useConfigContext();
|
|
43
45
|
return _this;
|
|
44
46
|
}
|
|
45
47
|
|