naive-ui 2.21.2 → 2.22.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/es/_internal/close/src/styles/index.cssr.js +6 -5
- package/es/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/es/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/es/_internal/selection/src/Selection.js +11 -9
- package/es/_internal/selection/src/styles/index.cssr.js +6 -2
- package/es/alert/src/Alert.d.ts +20 -20
- package/es/alert/src/Alert.js +22 -22
- package/es/alert/src/styles/index.cssr.js +45 -45
- package/es/anchor/src/AnchorAdapter.js +12 -12
- package/es/anchor/src/styles/index.cssr.js +41 -41
- package/es/avatar/src/Avatar.d.ts +5 -3
- package/es/avatar/src/Avatar.js +7 -5
- package/es/avatar/src/styles/index.cssr.js +3 -5
- package/es/button/src/Button.d.ts +60 -60
- package/es/button/src/Button.js +107 -106
- package/es/button/src/styles/button.cssr.js +83 -80
- package/es/button/styles/dark.js +3 -3
- package/es/button/styles/light.d.ts +3 -3
- package/es/button/styles/light.js +1 -1
- package/es/calendar/src/Calendar.d.ts +37 -30
- package/es/calendar/styles/light.d.ts +3 -3
- package/es/cascader/src/Cascader.d.ts +135 -0
- package/es/cascader/src/Cascader.js +2 -4
- package/es/cascader/src/CascaderMenu.d.ts +345 -0
- package/es/cascader/src/CascaderMenu.js +6 -5
- package/es/cascader/src/CascaderOption.d.ts +18 -0
- package/es/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/es/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/es/cascader/styles/dark.js +3 -1
- package/es/cascader/styles/light.d.ts +13 -0
- package/es/cascader/styles/light.js +3 -1
- package/es/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/es/color-picker/src/ColorPicker.d.ts +27 -27
- package/es/color-picker/styles/light.d.ts +3 -3
- package/es/config-provider/src/ConfigProvider.d.ts +21 -0
- package/es/data-table/src/DataTable.d.ts +30 -30
- package/es/data-table/src/DataTable.js +7 -14
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/es/data-table/src/MainTable.js +2 -3
- package/es/data-table/src/TableParts/Body.d.ts +18 -7
- package/es/data-table/src/TableParts/Body.js +80 -28
- package/es/data-table/src/TableParts/Cell.d.ts +6 -6
- package/es/data-table/src/TableParts/Header.d.ts +3 -3
- package/es/data-table/src/TableParts/Header.js +1 -1
- package/es/data-table/src/interface.d.ts +4 -1
- package/es/data-table/src/styles/index.cssr.js +9 -12
- package/es/data-table/src/use-check.js +6 -2
- package/es/data-table/src/use-scroll.d.ts +2 -0
- package/es/data-table/src/use-scroll.js +34 -4
- package/es/data-table/src/use-table-data.js +4 -1
- package/es/data-table/styles/_common.js +1 -1
- package/es/data-table/styles/light.d.ts +3 -3
- package/es/date-picker/src/DatePicker.d.ts +94 -69
- package/es/date-picker/src/DatePicker.js +47 -20
- package/es/date-picker/src/config.d.ts +1 -9
- package/es/date-picker/src/config.js +0 -8
- package/es/date-picker/src/interface.d.ts +2 -1
- package/es/date-picker/src/panel/date.d.ts +23 -10
- package/es/date-picker/src/panel/date.js +2 -2
- package/es/date-picker/src/panel/daterange.d.ts +21 -9
- package/es/date-picker/src/panel/daterange.js +2 -2
- package/es/date-picker/src/panel/datetime.d.ts +23 -16
- package/es/date-picker/src/panel/datetime.js +2 -2
- package/es/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/es/date-picker/src/panel/datetimerange.js +2 -2
- package/es/date-picker/src/panel/month.d.ts +27 -20
- package/es/date-picker/src/panel/month.js +23 -12
- package/es/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/es/date-picker/src/panel/use-calendar.js +35 -18
- package/es/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/es/date-picker/src/panel/use-dual-calendar.js +23 -8
- package/es/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/es/date-picker/src/panel/use-panel-common.js +2 -2
- package/es/date-picker/src/utils.d.ts +19 -3
- package/es/date-picker/src/utils.js +40 -5
- package/es/date-picker/styles/_common.d.ts +2 -0
- package/es/date-picker/styles/_common.js +3 -1
- package/es/date-picker/styles/light.d.ts +10 -6
- package/es/dialog/src/Dialog.d.ts +21 -21
- package/es/dialog/src/styles/index.cssr.js +1 -0
- package/es/dialog/styles/light.d.ts +3 -3
- package/es/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/es/dynamic-input/src/InputPreset.d.ts +3 -3
- package/es/dynamic-input/src/PairPreset.d.ts +3 -3
- package/es/dynamic-input/styles/light.d.ts +3 -3
- package/es/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/es/dynamic-tags/styles/light.d.ts +3 -3
- package/es/element/index.d.ts +1 -0
- package/es/element/index.js +1 -0
- package/es/form/src/interface.d.ts +5 -4
- package/es/image/src/Image.d.ts +25 -16
- package/es/image/src/Image.js +35 -11
- package/es/image/src/ImageGroup.js +2 -2
- package/es/image/src/styles/index.cssr.js +4 -3
- package/es/input/src/Input.js +2 -0
- package/es/input/src/styles/input.cssr.js +2 -1
- package/es/input-number/src/InputNumber.d.ts +30 -30
- package/es/input-number/src/InputNumber.js +10 -5
- package/es/input-number/src/utils.d.ts +1 -0
- package/es/input-number/src/utils.js +4 -0
- package/es/input-number/styles/light.d.ts +3 -3
- package/es/locales/common/deDE.js +8 -0
- package/es/locales/common/enUS.d.ts +7 -0
- package/es/locales/common/enUS.js +8 -1
- package/es/locales/common/frFR.d.ts +3 -0
- package/es/locales/common/frFR.js +101 -0
- package/es/locales/common/idID.d.ts +2 -93
- package/es/locales/common/idID.js +8 -0
- package/es/locales/common/jaJP.js +8 -0
- package/es/locales/common/nbNO.js +8 -0
- package/es/locales/common/ruRU.js +8 -0
- package/es/locales/common/ukUA.js +8 -0
- package/es/locales/common/zhCN.js +7 -0
- package/es/locales/common/zhTW.d.ts +3 -0
- package/es/locales/common/zhTW.js +100 -0
- package/es/locales/date/frFR.d.ts +3 -0
- package/es/locales/date/frFR.js +6 -0
- package/es/locales/date/idID.d.ts +1 -6
- package/es/locales/date/zhTW.d.ts +3 -0
- package/es/locales/date/zhTW.js +6 -0
- package/es/locales/index.d.ts +4 -0
- package/es/locales/index.js +4 -0
- package/es/modal/src/BodyWrapper.d.ts +6 -6
- package/es/modal/src/Modal.d.ts +36 -36
- package/es/modal/styles/light.d.ts +3 -3
- package/es/page-header/src/PageHeader.js +3 -3
- package/es/page-header/src/styles/index.cssr.js +2 -4
- package/es/popconfirm/src/Popconfirm.d.ts +30 -30
- package/es/popconfirm/styles/light.d.ts +3 -3
- package/es/popover/src/Popover.js +4 -1
- package/es/popover/src/PopoverBody.js +3 -3
- package/es/popselect/src/Popselect.d.ts +2 -11
- package/es/popselect/src/Popselect.js +2 -2
- package/es/popselect/src/PopselectPanel.d.ts +3 -11
- package/es/popselect/src/PopselectPanel.js +17 -11
- package/es/radio/src/Radio.js +3 -3
- package/es/radio/src/RadioButton.js +4 -5
- package/es/radio/src/styles/radio-group.cssr.js +8 -4
- package/es/radio/src/styles/radio.cssr.js +8 -4
- package/es/radio/src/use-radio.d.ts +0 -3
- package/es/radio/src/use-radio.js +1 -26
- package/es/switch/src/Switch.d.ts +16 -1
- package/es/switch/src/Switch.js +17 -4
- package/es/switch/src/styles/index.cssr.js +1 -1
- package/es/tabs/src/styles/index.cssr.js +1 -0
- package/es/tag/src/styles/index.cssr.js +1 -1
- package/es/theme-editor/src/ThemeEditor.js +9 -2
- package/es/time-picker/src/Panel.d.ts +3 -3
- package/es/time-picker/src/TimePicker.d.ts +30 -30
- package/es/time-picker/styles/light.d.ts +3 -3
- package/es/transfer/src/Transfer.d.ts +30 -30
- package/es/transfer/src/TransferFilter.d.ts +3 -3
- package/es/transfer/src/TransferList.d.ts +3 -3
- package/es/transfer/src/TransferListItem.d.ts +3 -3
- package/es/transfer/styles/light.d.ts +3 -3
- package/es/tree/src/Tree.d.ts +8 -4
- package/es/tree/src/Tree.js +32 -6
- package/es/tree-select/src/TreeSelect.d.ts +38 -1
- package/es/tree-select/src/TreeSelect.js +25 -10
- package/es/tree-select/src/styles/index.cssr.js +11 -2
- package/es/tree-select/styles/light.d.ts +6 -0
- package/es/tree-select/styles/light.js +5 -2
- package/es/upload/src/Upload.d.ts +41 -30
- package/es/upload/src/Upload.js +33 -23
- package/es/upload/src/UploadFile.d.ts +4 -4
- package/es/upload/src/UploadFileList.js +4 -2
- package/es/upload/src/UploadProgress.d.ts +3 -3
- package/es/upload/src/interface.d.ts +1 -0
- package/es/upload/src/styles/index.cssr.js +2 -3
- package/es/upload/styles/light.d.ts +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/close/src/styles/index.cssr.js +6 -5
- package/lib/_internal/scrollbar/src/ScrollBar.d.ts +15 -0
- package/lib/_internal/scrollbar/src/ScrollBar.js +13 -7
- package/lib/_internal/selection/src/Selection.js +11 -9
- package/lib/_internal/selection/src/styles/index.cssr.js +6 -2
- package/lib/alert/src/Alert.d.ts +20 -20
- package/lib/alert/src/Alert.js +22 -22
- package/lib/alert/src/styles/index.cssr.js +45 -45
- package/lib/anchor/src/AnchorAdapter.js +12 -12
- package/lib/anchor/src/styles/index.cssr.js +41 -41
- package/lib/avatar/src/Avatar.d.ts +5 -3
- package/lib/avatar/src/Avatar.js +7 -5
- package/lib/avatar/src/styles/index.cssr.js +3 -5
- package/lib/button/src/Button.d.ts +60 -60
- package/lib/button/src/Button.js +107 -106
- package/lib/button/src/styles/button.cssr.js +83 -80
- package/lib/button/styles/dark.js +3 -3
- package/lib/button/styles/light.d.ts +3 -3
- package/lib/button/styles/light.js +1 -1
- package/lib/calendar/src/Calendar.d.ts +37 -30
- package/lib/calendar/styles/light.d.ts +3 -3
- package/lib/cascader/src/Cascader.d.ts +135 -0
- package/lib/cascader/src/Cascader.js +2 -4
- package/lib/cascader/src/CascaderMenu.d.ts +345 -0
- package/lib/cascader/src/CascaderMenu.js +6 -5
- package/lib/cascader/src/CascaderOption.d.ts +18 -0
- package/lib/cascader/src/CascaderSelectMenu.d.ts +18 -0
- package/lib/cascader/src/CascaderSubmenu.d.ts +18 -0
- package/lib/cascader/styles/dark.js +3 -1
- package/lib/cascader/styles/light.d.ts +13 -0
- package/lib/cascader/styles/light.js +3 -1
- package/lib/color-picker/src/ColorInputUnit.d.ts +3 -3
- package/lib/color-picker/src/ColorPicker.d.ts +27 -27
- package/lib/color-picker/styles/light.d.ts +3 -3
- package/lib/config-provider/src/ConfigProvider.d.ts +21 -0
- package/lib/data-table/src/DataTable.d.ts +30 -30
- package/lib/data-table/src/DataTable.js +6 -13
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +3 -3
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +3 -3
- package/lib/data-table/src/MainTable.js +1 -2
- package/lib/data-table/src/TableParts/Body.d.ts +18 -7
- package/lib/data-table/src/TableParts/Body.js +78 -26
- package/lib/data-table/src/TableParts/Cell.d.ts +6 -6
- package/lib/data-table/src/TableParts/Header.d.ts +3 -3
- package/lib/data-table/src/TableParts/Header.js +1 -1
- package/lib/data-table/src/interface.d.ts +4 -1
- package/lib/data-table/src/styles/index.cssr.js +9 -12
- package/lib/data-table/src/use-check.js +6 -2
- package/lib/data-table/src/use-scroll.d.ts +2 -0
- package/lib/data-table/src/use-scroll.js +34 -4
- package/lib/data-table/src/use-table-data.js +4 -1
- package/lib/data-table/styles/_common.js +1 -1
- package/lib/data-table/styles/light.d.ts +3 -3
- package/lib/date-picker/src/DatePicker.d.ts +94 -69
- package/lib/date-picker/src/DatePicker.js +46 -19
- package/lib/date-picker/src/config.d.ts +1 -9
- package/lib/date-picker/src/config.js +1 -9
- package/lib/date-picker/src/interface.d.ts +2 -1
- package/lib/date-picker/src/panel/date.d.ts +23 -10
- package/lib/date-picker/src/panel/date.js +1 -1
- package/lib/date-picker/src/panel/daterange.d.ts +21 -9
- package/lib/date-picker/src/panel/daterange.js +1 -1
- package/lib/date-picker/src/panel/datetime.d.ts +23 -16
- package/lib/date-picker/src/panel/datetime.js +1 -1
- package/lib/date-picker/src/panel/datetimerange.d.ts +21 -9
- package/lib/date-picker/src/panel/datetimerange.js +2 -2
- package/lib/date-picker/src/panel/month.d.ts +27 -20
- package/lib/date-picker/src/panel/month.js +23 -12
- package/lib/date-picker/src/panel/use-calendar.d.ts +25 -43
- package/lib/date-picker/src/panel/use-calendar.js +34 -16
- package/lib/date-picker/src/panel/use-dual-calendar.d.ts +21 -40
- package/lib/date-picker/src/panel/use-dual-calendar.js +22 -6
- package/lib/date-picker/src/panel/use-panel-common.d.ts +21 -36
- package/lib/date-picker/src/panel/use-panel-common.js +3 -2
- package/lib/date-picker/src/utils.d.ts +19 -3
- package/lib/date-picker/src/utils.js +41 -4
- package/lib/date-picker/styles/_common.d.ts +2 -0
- package/lib/date-picker/styles/_common.js +3 -1
- package/lib/date-picker/styles/light.d.ts +10 -6
- package/lib/dialog/src/Dialog.d.ts +21 -21
- package/lib/dialog/src/styles/index.cssr.js +1 -0
- package/lib/dialog/styles/light.d.ts +3 -3
- package/lib/dynamic-input/src/DynamicInput.d.ts +30 -30
- package/lib/dynamic-input/src/InputPreset.d.ts +3 -3
- package/lib/dynamic-input/src/PairPreset.d.ts +3 -3
- package/lib/dynamic-input/styles/light.d.ts +3 -3
- package/lib/dynamic-tags/src/DynamicTags.d.ts +30 -30
- package/lib/dynamic-tags/styles/light.d.ts +3 -3
- package/lib/element/index.d.ts +1 -0
- package/lib/element/index.js +3 -1
- package/lib/form/src/interface.d.ts +5 -4
- package/lib/image/src/Image.d.ts +25 -16
- package/lib/image/src/Image.js +34 -10
- package/lib/image/src/ImageGroup.js +2 -2
- package/lib/image/src/styles/index.cssr.js +3 -2
- package/lib/input/src/Input.js +2 -0
- package/lib/input/src/styles/input.cssr.js +2 -1
- package/lib/input-number/src/InputNumber.d.ts +30 -30
- package/lib/input-number/src/InputNumber.js +9 -4
- package/lib/input-number/src/utils.d.ts +1 -0
- package/lib/input-number/src/utils.js +6 -1
- package/lib/input-number/styles/light.d.ts +3 -3
- package/lib/locales/common/deDE.js +8 -0
- package/lib/locales/common/enUS.d.ts +7 -0
- package/lib/locales/common/enUS.js +8 -1
- package/lib/locales/common/frFR.d.ts +3 -0
- package/lib/locales/common/frFR.js +103 -0
- package/lib/locales/common/idID.d.ts +2 -93
- package/lib/locales/common/idID.js +8 -0
- package/lib/locales/common/jaJP.js +8 -0
- package/lib/locales/common/nbNO.js +8 -0
- package/lib/locales/common/ruRU.js +8 -0
- package/lib/locales/common/ukUA.js +8 -0
- package/lib/locales/common/zhCN.js +7 -0
- package/lib/locales/common/zhTW.d.ts +3 -0
- package/lib/locales/common/zhTW.js +102 -0
- package/lib/locales/date/frFR.d.ts +3 -0
- package/lib/locales/date/frFR.js +11 -0
- package/lib/locales/date/idID.d.ts +1 -6
- package/lib/locales/date/zhTW.d.ts +3 -0
- package/lib/locales/date/zhTW.js +11 -0
- package/lib/locales/index.d.ts +4 -0
- package/lib/locales/index.js +9 -1
- package/lib/modal/src/BodyWrapper.d.ts +6 -6
- package/lib/modal/src/Modal.d.ts +36 -36
- package/lib/modal/styles/light.d.ts +3 -3
- package/lib/page-header/src/PageHeader.js +3 -3
- package/lib/page-header/src/styles/index.cssr.js +2 -4
- package/lib/popconfirm/src/Popconfirm.d.ts +30 -30
- package/lib/popconfirm/styles/light.d.ts +3 -3
- package/lib/popover/src/Popover.js +4 -1
- package/lib/popover/src/PopoverBody.js +3 -3
- package/lib/popselect/src/Popselect.d.ts +2 -11
- package/lib/popselect/src/Popselect.js +2 -2
- package/lib/popselect/src/PopselectPanel.d.ts +3 -11
- package/lib/popselect/src/PopselectPanel.js +16 -10
- package/lib/radio/src/Radio.js +3 -3
- package/lib/radio/src/RadioButton.js +4 -5
- package/lib/radio/src/styles/radio-group.cssr.js +8 -4
- package/lib/radio/src/styles/radio.cssr.js +8 -4
- package/lib/radio/src/use-radio.d.ts +0 -3
- package/lib/radio/src/use-radio.js +1 -26
- package/lib/switch/src/Switch.d.ts +16 -1
- package/lib/switch/src/Switch.js +17 -4
- package/lib/switch/src/styles/index.cssr.js +1 -1
- package/lib/tabs/src/styles/index.cssr.js +1 -0
- package/lib/tag/src/styles/index.cssr.js +1 -1
- package/lib/theme-editor/src/ThemeEditor.js +9 -2
- package/lib/time-picker/src/Panel.d.ts +3 -3
- package/lib/time-picker/src/TimePicker.d.ts +30 -30
- package/lib/time-picker/styles/light.d.ts +3 -3
- package/lib/transfer/src/Transfer.d.ts +30 -30
- package/lib/transfer/src/TransferFilter.d.ts +3 -3
- package/lib/transfer/src/TransferList.d.ts +3 -3
- package/lib/transfer/src/TransferListItem.d.ts +3 -3
- package/lib/transfer/styles/light.d.ts +3 -3
- package/lib/tree/src/Tree.d.ts +8 -4
- package/lib/tree/src/Tree.js +32 -6
- package/lib/tree-select/src/TreeSelect.d.ts +38 -1
- package/lib/tree-select/src/TreeSelect.js +24 -9
- package/lib/tree-select/src/styles/index.cssr.js +11 -2
- package/lib/tree-select/styles/light.d.ts +6 -0
- package/lib/tree-select/styles/light.js +5 -2
- package/lib/upload/src/Upload.d.ts +41 -30
- package/lib/upload/src/Upload.js +33 -23
- package/lib/upload/src/UploadFile.d.ts +4 -4
- package/lib/upload/src/UploadFileList.js +4 -2
- package/lib/upload/src/UploadProgress.d.ts +3 -3
- package/lib/upload/src/interface.d.ts +1 -0
- package/lib/upload/src/styles/index.cssr.js +2 -3
- package/lib/upload/styles/light.d.ts +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/web-types.json +99 -7
|
@@ -4,8 +4,8 @@ const vue_1 = require("vue");
|
|
|
4
4
|
const vueuc_1 = require("vueuc");
|
|
5
5
|
const button_1 = require("../../../button");
|
|
6
6
|
const _internal_1 = require("../../../_internal");
|
|
7
|
-
const use_calendar_1 = require("./use-calendar");
|
|
8
7
|
const config_1 = require("../config");
|
|
8
|
+
const use_calendar_1 = require("./use-calendar");
|
|
9
9
|
/**
|
|
10
10
|
* Month Panel
|
|
11
11
|
* Update picker value on:
|
|
@@ -14,32 +14,41 @@ const config_1 = require("../config");
|
|
|
14
14
|
*/
|
|
15
15
|
exports.default = (0, vue_1.defineComponent)({
|
|
16
16
|
name: 'MonthPanel',
|
|
17
|
-
props: Object.assign(Object.assign({}, use_calendar_1.
|
|
17
|
+
props: Object.assign(Object.assign({}, use_calendar_1.useCalendarProps), { type: {
|
|
18
18
|
type: String,
|
|
19
19
|
required: true
|
|
20
20
|
} }),
|
|
21
21
|
setup(props) {
|
|
22
22
|
const useCalendarRef = (0, use_calendar_1.useCalendar)(props, props.type);
|
|
23
|
+
const getRenderContent = (item) => {
|
|
24
|
+
switch (item.type) {
|
|
25
|
+
case 'year':
|
|
26
|
+
return item.dateObject.year;
|
|
27
|
+
case 'month':
|
|
28
|
+
return item.dateObject.month + 1;
|
|
29
|
+
case 'quarter':
|
|
30
|
+
return `Q ${item.dateObject.quarter}`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
23
33
|
const renderItem = (item, i, mergedClsPrefix) => {
|
|
24
34
|
const { mergedIsDateDisabled, handleDateClick } = useCalendarRef;
|
|
25
35
|
return ((0, vue_1.h)("div", { "data-n-date": true, key: i, class: [
|
|
26
36
|
`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item`,
|
|
27
37
|
{
|
|
28
|
-
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--current`]: item.
|
|
29
|
-
? item.isCurrentMonth
|
|
30
|
-
: item.isCurrentYear,
|
|
38
|
+
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--current`]: item.isCurrent,
|
|
31
39
|
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--selected`]: item.selected,
|
|
32
40
|
[`${mergedClsPrefix}-date-panel-month-calendar__picker-col-item--disabled`]: mergedIsDateDisabled(item.ts)
|
|
33
41
|
}
|
|
34
|
-
], onClick: () => handleDateClick(item) }, item
|
|
35
|
-
? item.dateObject.month + 1
|
|
36
|
-
: item.dateObject.year));
|
|
42
|
+
], onClick: () => handleDateClick(item) }, getRenderContent(item)));
|
|
37
43
|
};
|
|
38
44
|
return Object.assign(Object.assign({}, useCalendarRef), { renderItem });
|
|
39
45
|
},
|
|
40
46
|
render() {
|
|
41
47
|
const { mergedClsPrefix, mergedTheme, shortcuts, actions, renderItem, type } = this;
|
|
42
|
-
return ((0, vue_1.h)("div", { ref: "selfRef", tabindex: 0, class:
|
|
48
|
+
return ((0, vue_1.h)("div", { ref: "selfRef", tabindex: 0, class: [
|
|
49
|
+
`${mergedClsPrefix}-date-panel`,
|
|
50
|
+
`${mergedClsPrefix}-date-panel--month`
|
|
51
|
+
], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
|
|
43
52
|
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-month-calendar` },
|
|
44
53
|
(0, vue_1.h)(_internal_1.NScrollbar, { ref: "scrollbarInstRef", class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col`, theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, container: this.virtualListContainer, content: this.virtualListContent, horizontalRailStyle: { zIndex: 1 }, verticalRailStyle: { zIndex: 1 } }, {
|
|
45
54
|
default: () => ((0, vue_1.h)(vueuc_1.VirtualList, { ref: "yearScrollRef", items: this.yearArray, itemSize: config_1.MONTH_ITEM_HEIGHT, showScrollbar: false, keyField: "ts", onScroll: this.handleVirtualListScroll, paddingBottom: 4 }, {
|
|
@@ -48,11 +57,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
48
57
|
}
|
|
49
58
|
}))
|
|
50
59
|
}),
|
|
51
|
-
type === 'month' ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col` },
|
|
60
|
+
type === 'month' || type === 'quarter' ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__picker-col` },
|
|
52
61
|
(0, vue_1.h)(_internal_1.NScrollbar, { ref: "monthScrollRef", theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar }, {
|
|
53
62
|
default: () => [
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
(type === 'month'
|
|
64
|
+
? this.monthArray
|
|
65
|
+
: this.quarterArray).map((item, i) => renderItem(item, i, mergedClsPrefix)),
|
|
66
|
+
(0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-${type}-calendar__padding` })
|
|
56
67
|
]
|
|
57
68
|
}))) : null),
|
|
58
69
|
this.datePickerSlots.footer ? ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-date-panel-footer` }, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { Shortcuts } from '../interface';
|
|
3
|
-
import type { DateItem, MonthItem, YearItem } from '../utils';
|
|
2
|
+
import type { Shortcuts } from '../interface';
|
|
3
|
+
import type { DateItem, MonthItem, YearItem, QuarterItem } from '../utils';
|
|
4
4
|
declare const useCalendarProps: {
|
|
5
5
|
readonly actions: {
|
|
6
6
|
readonly type: PropType<string[]>;
|
|
@@ -20,6 +20,7 @@ declare const useCalendarProps: {
|
|
|
20
20
|
readonly default: null;
|
|
21
21
|
};
|
|
22
22
|
readonly shortcuts: PropType<Shortcuts>;
|
|
23
|
+
readonly defaultTime: PropType<import("../interface").DefaultTime>;
|
|
23
24
|
readonly onConfirm: FunctionConstructor;
|
|
24
25
|
readonly onClose: PropType<import("../interface").OnClose>;
|
|
25
26
|
readonly onTabOut: FunctionConstructor;
|
|
@@ -28,8 +29,8 @@ declare const useCalendarProps: {
|
|
|
28
29
|
readonly required: true;
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
|
-
declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year'): {
|
|
32
|
-
handleDateClick: (dateItem: DateItem | MonthItem | YearItem) => void;
|
|
32
|
+
declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year' | 'quarter'): {
|
|
33
|
+
handleDateClick: (dateItem: DateItem | MonthItem | YearItem | QuarterItem) => void;
|
|
33
34
|
handleDateInputBlur: () => void;
|
|
34
35
|
handleDateInput: (value: string) => void;
|
|
35
36
|
handleTimePickerChange: (value: number | null) => void;
|
|
@@ -212,12 +213,14 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
212
213
|
calendarLeftPaddingDatetimerange: string;
|
|
213
214
|
calendarLeftPaddingMonth: string;
|
|
214
215
|
calendarLeftPaddingYear: string;
|
|
216
|
+
calendarLeftPaddingQuarter: string;
|
|
215
217
|
calendarRightPaddingDate: string;
|
|
216
218
|
calendarRightPaddingDatetime: string;
|
|
217
219
|
calendarRightPaddingDaterange: string;
|
|
218
220
|
calendarRightPaddingDatetimerange: string;
|
|
219
221
|
calendarRightPaddingMonth: string;
|
|
220
222
|
calendarRightPaddingYear: string;
|
|
223
|
+
calendarRightPaddingQuarter: string;
|
|
221
224
|
};
|
|
222
225
|
peers: {
|
|
223
226
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -294,9 +297,9 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
294
297
|
fontSizeMedium: string;
|
|
295
298
|
fontSizeLarge: string;
|
|
296
299
|
opacityDisabled: string;
|
|
297
|
-
colorOpacitySecondary:
|
|
298
|
-
colorOpacitySecondaryHover:
|
|
299
|
-
colorOpacitySecondaryPressed:
|
|
300
|
+
colorOpacitySecondary: string;
|
|
301
|
+
colorOpacitySecondaryHover: string;
|
|
302
|
+
colorOpacitySecondaryPressed: string;
|
|
300
303
|
colorSecondary: string;
|
|
301
304
|
colorSecondaryHover: string;
|
|
302
305
|
colorSecondaryPressed: string;
|
|
@@ -519,9 +522,9 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
519
522
|
fontSizeMedium: string;
|
|
520
523
|
fontSizeLarge: string;
|
|
521
524
|
opacityDisabled: string;
|
|
522
|
-
colorOpacitySecondary:
|
|
523
|
-
colorOpacitySecondaryHover:
|
|
524
|
-
colorOpacitySecondaryPressed:
|
|
525
|
+
colorOpacitySecondary: string;
|
|
526
|
+
colorOpacitySecondaryHover: string;
|
|
527
|
+
colorOpacitySecondaryPressed: string;
|
|
525
528
|
colorSecondary: string;
|
|
526
529
|
colorSecondaryHover: string;
|
|
527
530
|
colorSecondaryPressed: string;
|
|
@@ -806,9 +809,9 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
806
809
|
fontSizeMedium: string;
|
|
807
810
|
fontSizeLarge: string;
|
|
808
811
|
opacityDisabled: string;
|
|
809
|
-
colorOpacitySecondary:
|
|
810
|
-
colorOpacitySecondaryHover:
|
|
811
|
-
colorOpacitySecondaryPressed:
|
|
812
|
+
colorOpacitySecondary: string;
|
|
813
|
+
colorOpacitySecondaryHover: string;
|
|
814
|
+
colorOpacitySecondaryPressed: string;
|
|
812
815
|
colorSecondary: string;
|
|
813
816
|
colorSecondaryHover: string;
|
|
814
817
|
colorSecondaryPressed: string;
|
|
@@ -1074,6 +1077,11 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1074
1077
|
yearFormat: string;
|
|
1075
1078
|
monthFormat: string;
|
|
1076
1079
|
dayFormat: string;
|
|
1080
|
+
yearTypeFormat: string;
|
|
1081
|
+
monthTypeFormat: string;
|
|
1082
|
+
dateFormat: string;
|
|
1083
|
+
dateTimeFormat: string;
|
|
1084
|
+
quarterFormat: string;
|
|
1077
1085
|
clear: string;
|
|
1078
1086
|
now: string;
|
|
1079
1087
|
confirm: string;
|
|
@@ -1082,6 +1090,8 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1082
1090
|
datePlaceholder: string;
|
|
1083
1091
|
datetimePlaceholder: string;
|
|
1084
1092
|
monthPlaceholder: string;
|
|
1093
|
+
yearPlaceholder: string;
|
|
1094
|
+
quarterPlaceholder: string;
|
|
1085
1095
|
startDatePlaceholder: string;
|
|
1086
1096
|
endDatePlaceholder: string;
|
|
1087
1097
|
startDatetimePlaceholder: string;
|
|
@@ -1115,6 +1125,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1115
1125
|
dateArray: import("vue").ComputedRef<DateItem[]>;
|
|
1116
1126
|
monthArray: import("vue").ComputedRef<MonthItem[]>;
|
|
1117
1127
|
yearArray: import("vue").ComputedRef<YearItem[]>;
|
|
1128
|
+
quarterArray: import("vue").ComputedRef<QuarterItem[]>;
|
|
1118
1129
|
calendarYear: import("vue").ComputedRef<string>;
|
|
1119
1130
|
calendarMonth: import("vue").ComputedRef<string>;
|
|
1120
1131
|
weekdays: import("vue").ComputedRef<string[]>;
|
|
@@ -1128,33 +1139,4 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
|
|
|
1128
1139
|
handleSingleShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
|
|
1129
1140
|
handleSingleShortcutClick: (shortcut: Shortcuts[string]) => void;
|
|
1130
1141
|
};
|
|
1131
|
-
|
|
1132
|
-
var props: {
|
|
1133
|
-
readonly actions: {
|
|
1134
|
-
readonly type: PropType<string[]>;
|
|
1135
|
-
readonly default: () => string[];
|
|
1136
|
-
};
|
|
1137
|
-
readonly active: BooleanConstructor;
|
|
1138
|
-
readonly dateFormat: {
|
|
1139
|
-
readonly type: StringConstructor;
|
|
1140
|
-
readonly default: "yyyy-MM-dd";
|
|
1141
|
-
};
|
|
1142
|
-
readonly timeFormat: {
|
|
1143
|
-
readonly type: StringConstructor;
|
|
1144
|
-
readonly default: "HH:mm:ss";
|
|
1145
|
-
};
|
|
1146
|
-
readonly value: {
|
|
1147
|
-
readonly type: PropType<import("../interface").Value | null>;
|
|
1148
|
-
readonly default: null;
|
|
1149
|
-
};
|
|
1150
|
-
readonly shortcuts: PropType<Shortcuts>;
|
|
1151
|
-
readonly onConfirm: FunctionConstructor;
|
|
1152
|
-
readonly onClose: PropType<import("../interface").OnClose>;
|
|
1153
|
-
readonly onTabOut: FunctionConstructor;
|
|
1154
|
-
readonly onUpdateValue: {
|
|
1155
|
-
readonly type: PropType<import("../interface").OnPanelUpdateValue>;
|
|
1156
|
-
readonly required: true;
|
|
1157
|
-
};
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
export { useCalendar };
|
|
1142
|
+
export { useCalendar, useCalendarProps };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCalendar = void 0;
|
|
3
|
+
exports.useCalendarProps = exports.useCalendar = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const date_fns_1 = require("date-fns");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
-
const use_panel_common_1 = require("./use-panel-common");
|
|
8
7
|
const interface_1 = require("../interface");
|
|
9
|
-
const
|
|
8
|
+
const use_panel_common_1 = require("./use-panel-common");
|
|
9
|
+
const useCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommonProps), { actions: {
|
|
10
10
|
type: Array,
|
|
11
11
|
default: () => ['now', 'clear', 'confirm']
|
|
12
12
|
} });
|
|
13
|
+
exports.useCalendarProps = useCalendarProps;
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
14
15
|
function useCalendar(props, type) {
|
|
15
16
|
const panelCommon = (0, use_panel_common_1.usePanelCommon)(props);
|
|
16
|
-
const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots,
|
|
17
|
+
const { isValueInvalidRef, isDateDisabledRef, isDateInvalidRef, isTimeInvalidRef, isDateTimeInvalidRef, isHourDisabledRef, isMinuteDisabledRef, isSecondDisabledRef, localeRef, firstDayOfWeekRef, datePickerSlots, scrollPickerColumns
|
|
17
18
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
18
19
|
} = (0, vue_1.inject)(interface_1.datePickerInjectionKey);
|
|
19
20
|
const validation = {
|
|
@@ -46,6 +47,9 @@ function useCalendar(props, type) {
|
|
|
46
47
|
const yearArrayRef = (0, vue_1.computed)(() => {
|
|
47
48
|
return (0, utils_1.yearArray)(calendarValueRef.value, props.value, nowRef.value);
|
|
48
49
|
});
|
|
50
|
+
const querterArrayRef = (0, vue_1.computed)(() => {
|
|
51
|
+
return (0, utils_1.quarterArray)(calendarValueRef.value, props.value, nowRef.value);
|
|
52
|
+
});
|
|
49
53
|
const weekdaysRef = (0, vue_1.computed)(() => {
|
|
50
54
|
return dateArrayRef.value.slice(0, 7).map((dateItem) => {
|
|
51
55
|
const { ts } = dateItem;
|
|
@@ -79,6 +83,8 @@ function useCalendar(props, type) {
|
|
|
79
83
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfMonth)(value));
|
|
80
84
|
if (type === 'year')
|
|
81
85
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfYear)(value));
|
|
86
|
+
if (type === 'quarter')
|
|
87
|
+
return (0, date_fns_1.getTime)((0, date_fns_1.startOfQuarter)(value));
|
|
82
88
|
return (0, date_fns_1.getTime)((0, date_fns_1.startOfDay)(value));
|
|
83
89
|
}
|
|
84
90
|
function mergedIsDateDisabled(ts) {
|
|
@@ -146,17 +152,30 @@ function useCalendar(props, type) {
|
|
|
146
152
|
else {
|
|
147
153
|
newValue = Date.now();
|
|
148
154
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
scrollYearMonth(newValue);
|
|
155
|
+
if (type === 'datetime' &&
|
|
156
|
+
props.defaultTime !== null &&
|
|
157
|
+
!Array.isArray(props.defaultTime)) {
|
|
158
|
+
const time = (0, utils_1.getDefaultTime)(props.defaultTime);
|
|
159
|
+
if (time) {
|
|
160
|
+
newValue = (0, date_fns_1.getTime)((0, date_fns_1.set)(newValue, time)); // setDate getTime(addMilliseconds(startOfDay(newValue), time))
|
|
161
|
+
}
|
|
157
162
|
}
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
newValue = (0, date_fns_1.getTime)(dateItem.type === 'quarter' && dateItem.dateObject.quarter
|
|
164
|
+
? (0, date_fns_1.setQuarter)((0, date_fns_1.setYear)(newValue, dateItem.dateObject.year), dateItem.dateObject.quarter)
|
|
165
|
+
: (0, date_fns_1.set)(newValue, dateItem.dateObject));
|
|
166
|
+
panelCommon.doUpdateValue(sanitizeValue(newValue), type === 'date' || type === 'year');
|
|
167
|
+
switch (type) {
|
|
168
|
+
case 'date':
|
|
169
|
+
case 'year':
|
|
170
|
+
panelCommon.doClose();
|
|
171
|
+
break;
|
|
172
|
+
case 'month':
|
|
173
|
+
panelCommon.disableTransitionOneTick();
|
|
174
|
+
scrollPickerColumns(newValue);
|
|
175
|
+
break;
|
|
176
|
+
case 'quarter':
|
|
177
|
+
scrollPickerColumns(newValue);
|
|
178
|
+
break;
|
|
160
179
|
}
|
|
161
180
|
}
|
|
162
181
|
function deriveDateInputValue(time) {
|
|
@@ -230,7 +249,7 @@ function useCalendar(props, type) {
|
|
|
230
249
|
panelCommon.clearPendingValue();
|
|
231
250
|
handleConfirmClick();
|
|
232
251
|
}
|
|
233
|
-
return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
|
|
252
|
+
return Object.assign(Object.assign(Object.assign({ dateArray: dateArrayRef, monthArray: monthArrayRef, yearArray: yearArrayRef, quarterArray: querterArrayRef, calendarYear: calendarYearRef, calendarMonth: calendarMonthRef, weekdays: weekdaysRef, mergedIsDateDisabled,
|
|
234
253
|
nextYear,
|
|
235
254
|
prevYear,
|
|
236
255
|
nextMonth,
|
|
@@ -253,4 +272,3 @@ function useCalendar(props, type) {
|
|
|
253
272
|
scrollbarInstRef });
|
|
254
273
|
}
|
|
255
274
|
exports.useCalendar = useCalendar;
|
|
256
|
-
useCalendar.props = useCalendarProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
2
|
import { DateItem } from '../utils';
|
|
3
|
-
import { Shortcuts } from '../interface';
|
|
3
|
+
import type { Shortcuts } from '../interface';
|
|
4
4
|
declare const useDualCalendarProps: {
|
|
5
5
|
readonly actions: {
|
|
6
6
|
readonly type: ArrayConstructor;
|
|
@@ -20,6 +20,7 @@ declare const useDualCalendarProps: {
|
|
|
20
20
|
readonly default: null;
|
|
21
21
|
};
|
|
22
22
|
readonly shortcuts: import("vue").PropType<Shortcuts>;
|
|
23
|
+
readonly defaultTime: import("vue").PropType<import("../interface").DefaultTime>;
|
|
23
24
|
readonly onConfirm: FunctionConstructor;
|
|
24
25
|
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
25
26
|
readonly onTabOut: FunctionConstructor;
|
|
@@ -210,12 +211,14 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
210
211
|
calendarLeftPaddingDatetimerange: string;
|
|
211
212
|
calendarLeftPaddingMonth: string;
|
|
212
213
|
calendarLeftPaddingYear: string;
|
|
214
|
+
calendarLeftPaddingQuarter: string;
|
|
213
215
|
calendarRightPaddingDate: string;
|
|
214
216
|
calendarRightPaddingDatetime: string;
|
|
215
217
|
calendarRightPaddingDaterange: string;
|
|
216
218
|
calendarRightPaddingDatetimerange: string;
|
|
217
219
|
calendarRightPaddingMonth: string;
|
|
218
220
|
calendarRightPaddingYear: string;
|
|
221
|
+
calendarRightPaddingQuarter: string;
|
|
219
222
|
};
|
|
220
223
|
peers: {
|
|
221
224
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -292,9 +295,9 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
292
295
|
fontSizeMedium: string;
|
|
293
296
|
fontSizeLarge: string;
|
|
294
297
|
opacityDisabled: string;
|
|
295
|
-
colorOpacitySecondary:
|
|
296
|
-
colorOpacitySecondaryHover:
|
|
297
|
-
colorOpacitySecondaryPressed:
|
|
298
|
+
colorOpacitySecondary: string;
|
|
299
|
+
colorOpacitySecondaryHover: string;
|
|
300
|
+
colorOpacitySecondaryPressed: string;
|
|
298
301
|
colorSecondary: string;
|
|
299
302
|
colorSecondaryHover: string;
|
|
300
303
|
colorSecondaryPressed: string;
|
|
@@ -517,9 +520,9 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
517
520
|
fontSizeMedium: string;
|
|
518
521
|
fontSizeLarge: string;
|
|
519
522
|
opacityDisabled: string;
|
|
520
|
-
colorOpacitySecondary:
|
|
521
|
-
colorOpacitySecondaryHover:
|
|
522
|
-
colorOpacitySecondaryPressed:
|
|
523
|
+
colorOpacitySecondary: string;
|
|
524
|
+
colorOpacitySecondaryHover: string;
|
|
525
|
+
colorOpacitySecondaryPressed: string;
|
|
523
526
|
colorSecondary: string;
|
|
524
527
|
colorSecondaryHover: string;
|
|
525
528
|
colorSecondaryPressed: string;
|
|
@@ -804,9 +807,9 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
804
807
|
fontSizeMedium: string;
|
|
805
808
|
fontSizeLarge: string;
|
|
806
809
|
opacityDisabled: string;
|
|
807
|
-
colorOpacitySecondary:
|
|
808
|
-
colorOpacitySecondaryHover:
|
|
809
|
-
colorOpacitySecondaryPressed:
|
|
810
|
+
colorOpacitySecondary: string;
|
|
811
|
+
colorOpacitySecondaryHover: string;
|
|
812
|
+
colorOpacitySecondaryPressed: string;
|
|
810
813
|
colorSecondary: string;
|
|
811
814
|
colorSecondaryHover: string;
|
|
812
815
|
colorSecondaryPressed: string;
|
|
@@ -1072,6 +1075,11 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
1072
1075
|
yearFormat: string;
|
|
1073
1076
|
monthFormat: string;
|
|
1074
1077
|
dayFormat: string;
|
|
1078
|
+
yearTypeFormat: string;
|
|
1079
|
+
monthTypeFormat: string;
|
|
1080
|
+
dateFormat: string;
|
|
1081
|
+
dateTimeFormat: string;
|
|
1082
|
+
quarterFormat: string;
|
|
1075
1083
|
clear: string;
|
|
1076
1084
|
now: string;
|
|
1077
1085
|
confirm: string;
|
|
@@ -1080,6 +1088,8 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
1080
1088
|
datePlaceholder: string;
|
|
1081
1089
|
datetimePlaceholder: string;
|
|
1082
1090
|
monthPlaceholder: string;
|
|
1091
|
+
yearPlaceholder: string;
|
|
1092
|
+
quarterPlaceholder: string;
|
|
1083
1093
|
startDatePlaceholder: string;
|
|
1084
1094
|
endDatePlaceholder: string;
|
|
1085
1095
|
startDatetimePlaceholder: string;
|
|
@@ -1128,33 +1138,4 @@ declare function useDualCalendar(props: ExtractPropTypes<typeof useDualCalendarP
|
|
|
1128
1138
|
handleRangeShortcutMouseenter: (shortcut: Shortcuts[string]) => void;
|
|
1129
1139
|
handleRangeShortcutClick: (shortcut: Shortcuts[string]) => void;
|
|
1130
1140
|
};
|
|
1131
|
-
|
|
1132
|
-
var props: {
|
|
1133
|
-
readonly actions: {
|
|
1134
|
-
readonly type: ArrayConstructor;
|
|
1135
|
-
readonly default: () => string[];
|
|
1136
|
-
};
|
|
1137
|
-
readonly active: BooleanConstructor;
|
|
1138
|
-
readonly dateFormat: {
|
|
1139
|
-
readonly type: StringConstructor;
|
|
1140
|
-
readonly default: "yyyy-MM-dd";
|
|
1141
|
-
};
|
|
1142
|
-
readonly timeFormat: {
|
|
1143
|
-
readonly type: StringConstructor;
|
|
1144
|
-
readonly default: "HH:mm:ss";
|
|
1145
|
-
};
|
|
1146
|
-
readonly value: {
|
|
1147
|
-
readonly type: import("vue").PropType<import("../interface").Value | null>;
|
|
1148
|
-
readonly default: null;
|
|
1149
|
-
};
|
|
1150
|
-
readonly shortcuts: import("vue").PropType<Shortcuts>;
|
|
1151
|
-
readonly onConfirm: FunctionConstructor;
|
|
1152
|
-
readonly onClose: import("vue").PropType<import("../interface").OnClose>;
|
|
1153
|
-
readonly onTabOut: FunctionConstructor;
|
|
1154
|
-
readonly onUpdateValue: {
|
|
1155
|
-
readonly type: import("vue").PropType<import("../interface").OnPanelUpdateValue>;
|
|
1156
|
-
readonly required: true;
|
|
1157
|
-
};
|
|
1158
|
-
};
|
|
1159
|
-
}
|
|
1160
|
-
export { useDualCalendar };
|
|
1141
|
+
export { useDualCalendar, useDualCalendarProps };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useDualCalendar = void 0;
|
|
3
|
+
exports.useDualCalendarProps = exports.useDualCalendar = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const date_fns_1 = require("date-fns");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
|
-
const use_panel_common_1 = require("./use-panel-common");
|
|
8
7
|
const interface_1 = require("../interface");
|
|
9
|
-
const
|
|
8
|
+
const use_panel_common_1 = require("./use-panel-common");
|
|
9
|
+
const useDualCalendarProps = Object.assign(Object.assign({}, use_panel_common_1.usePanelCommonProps), { actions: {
|
|
10
10
|
type: Array,
|
|
11
11
|
default: () => ['clear', 'confirm']
|
|
12
12
|
} });
|
|
13
|
+
exports.useDualCalendarProps = useDualCalendarProps;
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
14
15
|
function useDualCalendar(props, type = 'datetime') {
|
|
15
16
|
const { isDateDisabledRef, isStartHourDisabledRef, isEndHourDisabledRef, isStartMinuteDisabledRef, isEndMinuteDisabledRef, isStartSecondDisabledRef, isEndSecondDisabledRef, isStartDateInvalidRef, isEndDateInvalidRef, isStartTimeInvalidRef, isEndTimeInvalidRef, isStartValueInvalidRef, isEndValueInvalidRef, isRangeInvalidRef, localeRef, rangesRef, closeOnSelectRef, updateValueOnCloseRef, firstDayOfWeekRef, datePickerSlots
|
|
@@ -290,8 +291,24 @@ function useDualCalendar(props, type = 'datetime') {
|
|
|
290
291
|
if (typeof startTime !== 'number') {
|
|
291
292
|
startTime = (0, date_fns_1.getTime)(startTime);
|
|
292
293
|
}
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
let startDefaultTime;
|
|
295
|
+
let endDefaultTime;
|
|
296
|
+
if (type === 'datetimerange') {
|
|
297
|
+
const { defaultTime } = props;
|
|
298
|
+
if (Array.isArray(defaultTime)) {
|
|
299
|
+
startDefaultTime = (0, utils_1.getDefaultTime)(defaultTime[0]);
|
|
300
|
+
endDefaultTime = (0, utils_1.getDefaultTime)(defaultTime[1]);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
startDefaultTime = (0, utils_1.getDefaultTime)(defaultTime);
|
|
304
|
+
endDefaultTime = startDefaultTime;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (startDefaultTime) {
|
|
308
|
+
startTime = (0, date_fns_1.getTime)((0, date_fns_1.set)(startTime, startDefaultTime));
|
|
309
|
+
}
|
|
310
|
+
if (endDefaultTime) {
|
|
311
|
+
endTime = (0, date_fns_1.getTime)((0, date_fns_1.set)(endTime, endDefaultTime));
|
|
295
312
|
}
|
|
296
313
|
panelCommon.doUpdateValue([startTime, endTime], false);
|
|
297
314
|
}
|
|
@@ -471,4 +488,3 @@ function useDualCalendar(props, type = 'datetime') {
|
|
|
471
488
|
datePickerSlots, shortcuts: shortcutsRef });
|
|
472
489
|
}
|
|
473
490
|
exports.useDualCalendar = useDualCalendar;
|
|
474
|
-
useDualCalendar.props = useDualCalendarProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import { Value, OnPanelUpdateValue, OnClose, Shortcuts } from '../interface';
|
|
2
|
+
import { Value, OnPanelUpdateValue, OnClose, Shortcuts, DefaultTime } from '../interface';
|
|
3
3
|
declare const usePanelCommonProps: {
|
|
4
4
|
readonly active: BooleanConstructor;
|
|
5
5
|
readonly dateFormat: {
|
|
@@ -15,6 +15,7 @@ declare const usePanelCommonProps: {
|
|
|
15
15
|
readonly default: null;
|
|
16
16
|
};
|
|
17
17
|
readonly shortcuts: PropType<Shortcuts>;
|
|
18
|
+
readonly defaultTime: PropType<DefaultTime>;
|
|
18
19
|
readonly onConfirm: FunctionConstructor;
|
|
19
20
|
readonly onClose: PropType<OnClose>;
|
|
20
21
|
readonly onTabOut: FunctionConstructor;
|
|
@@ -176,12 +177,14 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
176
177
|
calendarLeftPaddingDatetimerange: string;
|
|
177
178
|
calendarLeftPaddingMonth: string;
|
|
178
179
|
calendarLeftPaddingYear: string;
|
|
180
|
+
calendarLeftPaddingQuarter: string;
|
|
179
181
|
calendarRightPaddingDate: string;
|
|
180
182
|
calendarRightPaddingDatetime: string;
|
|
181
183
|
calendarRightPaddingDaterange: string;
|
|
182
184
|
calendarRightPaddingDatetimerange: string;
|
|
183
185
|
calendarRightPaddingMonth: string;
|
|
184
186
|
calendarRightPaddingYear: string;
|
|
187
|
+
calendarRightPaddingQuarter: string;
|
|
185
188
|
};
|
|
186
189
|
peers: {
|
|
187
190
|
Input: import("../../../_mixins").Theme<"Input", {
|
|
@@ -258,9 +261,9 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
258
261
|
fontSizeMedium: string;
|
|
259
262
|
fontSizeLarge: string;
|
|
260
263
|
opacityDisabled: string;
|
|
261
|
-
colorOpacitySecondary:
|
|
262
|
-
colorOpacitySecondaryHover:
|
|
263
|
-
colorOpacitySecondaryPressed:
|
|
264
|
+
colorOpacitySecondary: string;
|
|
265
|
+
colorOpacitySecondaryHover: string;
|
|
266
|
+
colorOpacitySecondaryPressed: string;
|
|
264
267
|
colorSecondary: string;
|
|
265
268
|
colorSecondaryHover: string;
|
|
266
269
|
colorSecondaryPressed: string;
|
|
@@ -483,9 +486,9 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
483
486
|
fontSizeMedium: string;
|
|
484
487
|
fontSizeLarge: string;
|
|
485
488
|
opacityDisabled: string;
|
|
486
|
-
colorOpacitySecondary:
|
|
487
|
-
colorOpacitySecondaryHover:
|
|
488
|
-
colorOpacitySecondaryPressed:
|
|
489
|
+
colorOpacitySecondary: string;
|
|
490
|
+
colorOpacitySecondaryHover: string;
|
|
491
|
+
colorOpacitySecondaryPressed: string;
|
|
489
492
|
colorSecondary: string;
|
|
490
493
|
colorSecondaryHover: string;
|
|
491
494
|
colorSecondaryPressed: string;
|
|
@@ -770,9 +773,9 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
770
773
|
fontSizeMedium: string;
|
|
771
774
|
fontSizeLarge: string;
|
|
772
775
|
opacityDisabled: string;
|
|
773
|
-
colorOpacitySecondary:
|
|
774
|
-
colorOpacitySecondaryHover:
|
|
775
|
-
colorOpacitySecondaryPressed:
|
|
776
|
+
colorOpacitySecondary: string;
|
|
777
|
+
colorOpacitySecondaryHover: string;
|
|
778
|
+
colorOpacitySecondaryPressed: string;
|
|
776
779
|
colorSecondary: string;
|
|
777
780
|
colorSecondaryHover: string;
|
|
778
781
|
colorSecondaryPressed: string;
|
|
@@ -1039,6 +1042,11 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
1039
1042
|
yearFormat: string;
|
|
1040
1043
|
monthFormat: string;
|
|
1041
1044
|
dayFormat: string;
|
|
1045
|
+
yearTypeFormat: string;
|
|
1046
|
+
monthTypeFormat: string;
|
|
1047
|
+
dateFormat: string;
|
|
1048
|
+
dateTimeFormat: string;
|
|
1049
|
+
quarterFormat: string;
|
|
1042
1050
|
clear: string;
|
|
1043
1051
|
now: string;
|
|
1044
1052
|
confirm: string;
|
|
@@ -1047,6 +1055,8 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
1047
1055
|
datePlaceholder: string;
|
|
1048
1056
|
datetimePlaceholder: string;
|
|
1049
1057
|
monthPlaceholder: string;
|
|
1058
|
+
yearPlaceholder: string;
|
|
1059
|
+
quarterPlaceholder: string;
|
|
1050
1060
|
startDatePlaceholder: string;
|
|
1051
1061
|
endDatePlaceholder: string;
|
|
1052
1062
|
startDatetimePlaceholder: string;
|
|
@@ -1070,29 +1080,4 @@ declare function usePanelCommon(props: UsePanelCommonProps): {
|
|
|
1070
1080
|
getShortcutValue: (shortcut: Shortcuts[string]) => number | [number, number];
|
|
1071
1081
|
handleShortcutMouseleave: () => void;
|
|
1072
1082
|
};
|
|
1073
|
-
|
|
1074
|
-
var props: {
|
|
1075
|
-
readonly active: BooleanConstructor;
|
|
1076
|
-
readonly dateFormat: {
|
|
1077
|
-
readonly type: StringConstructor;
|
|
1078
|
-
readonly default: "yyyy-MM-dd";
|
|
1079
|
-
};
|
|
1080
|
-
readonly timeFormat: {
|
|
1081
|
-
readonly type: StringConstructor;
|
|
1082
|
-
readonly default: "HH:mm:ss";
|
|
1083
|
-
};
|
|
1084
|
-
readonly value: {
|
|
1085
|
-
readonly type: PropType<Value | null>;
|
|
1086
|
-
readonly default: null;
|
|
1087
|
-
};
|
|
1088
|
-
readonly shortcuts: PropType<Shortcuts>;
|
|
1089
|
-
readonly onConfirm: FunctionConstructor;
|
|
1090
|
-
readonly onClose: PropType<OnClose>;
|
|
1091
|
-
readonly onTabOut: FunctionConstructor;
|
|
1092
|
-
readonly onUpdateValue: {
|
|
1093
|
-
readonly type: PropType<OnPanelUpdateValue>;
|
|
1094
|
-
readonly required: true;
|
|
1095
|
-
};
|
|
1096
|
-
};
|
|
1097
|
-
}
|
|
1098
|
-
export { usePanelCommon };
|
|
1083
|
+
export { usePanelCommon, usePanelCommonProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePanelCommon = void 0;
|
|
3
|
+
exports.usePanelCommonProps = exports.usePanelCommon = void 0;
|
|
4
4
|
const vue_1 = require("vue");
|
|
5
5
|
const vooks_1 = require("vooks");
|
|
6
6
|
const interface_1 = require("../interface");
|
|
@@ -21,6 +21,7 @@ const usePanelCommonProps = {
|
|
|
21
21
|
default: null
|
|
22
22
|
},
|
|
23
23
|
shortcuts: Object,
|
|
24
|
+
defaultTime: [Number, String, Array],
|
|
24
25
|
onConfirm: Function,
|
|
25
26
|
onClose: Function,
|
|
26
27
|
onTabOut: Function,
|
|
@@ -29,6 +30,7 @@ const usePanelCommonProps = {
|
|
|
29
30
|
required: true
|
|
30
31
|
}
|
|
31
32
|
};
|
|
33
|
+
exports.usePanelCommonProps = usePanelCommonProps;
|
|
32
34
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
33
35
|
function usePanelCommon(props) {
|
|
34
36
|
const { dateLocaleRef, timePickerSizeRef, localeRef, mergedClsPrefixRef, mergedThemeRef
|
|
@@ -143,4 +145,3 @@ function usePanelCommon(props) {
|
|
|
143
145
|
};
|
|
144
146
|
}
|
|
145
147
|
exports.usePanelCommon = usePanelCommon;
|
|
146
|
-
usePanelCommon.props = usePanelCommonProps;
|