@ibiz-template/vue3-components 0.7.31-alpha.0 → 0.7.37-alpha.5
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/dist/chart-IZpj2cdX.js +1 -0
- package/dist/index-2J-iBLG-.js +1 -0
- package/dist/index-Yhyr5LJS.js +1 -0
- package/dist/index-p59-xI3J.js +4 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-OUxT4A8O.js → xlsx-util-rAKH_Qlc.js} +1 -1
- package/es/_virtual/_dayjs.mjs +1 -0
- package/es/_virtual/zh-cn.mjs +3 -0
- package/es/common/action-toolbar/action-toolbar.css +1 -1
- package/es/common/action-toolbar/action-toolbar.mjs +2 -2
- package/es/common/coop-alert/coop-alert.d.ts +3 -3
- package/es/common/custom-filter-condition/custom-filter-condition.css +1 -0
- package/es/common/custom-filter-condition/custom-filter-condition.d.ts +998 -0
- package/es/common/custom-filter-condition/custom-filter-condition.mjs +286 -0
- package/es/common/custom-theme/custom-theme-model.mjs +62 -0
- package/es/common/custom-theme/custom-theme.controller.mjs +6 -5
- package/es/common/custom-theme/custom-theme.css +1 -1
- package/es/common/emoji-select/emoji-select.d.ts +1 -1
- package/es/common/index.mjs +2 -0
- package/es/common/pagination/pagination.css +1 -1
- package/es/common/pagination/pagination.mjs +1 -1
- package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.css +1 -1
- package/es/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.mjs +4 -1
- package/es/common/pql-editor/pql-editor.d.ts +6 -0
- package/es/common/pql-editor/pql-editor.mjs +229 -130
- package/es/common/pql-editor/utils/index.d.ts +8 -4
- package/es/common/pql-editor/utils/index.mjs +193 -69
- package/es/common/rawitem/rawitem.mjs +16 -0
- package/es/common/split/split.d.ts +1 -1
- package/es/control/app-menu/app-menu.css +1 -1
- package/es/control/app-menu/app-menu.mjs +3 -2
- package/es/control/caption-bar/caption-bar.css +1 -1
- package/es/control/caption-bar/caption-bar.d.ts +1 -0
- package/es/control/caption-bar/caption-bar.mjs +12 -3
- package/es/control/caption-bar/index.d.ts +1 -0
- package/es/control/chart/chart.mjs +1 -1
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +21 -3
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.mjs +35 -10
- package/es/control/dashboard/dashboard-design/dashboard-design.css +1 -1
- package/es/control/dashboard/dashboard-design/dashboard-design.mjs +2 -2
- package/es/control/dashboard/dashboard.d.ts +2 -2
- package/es/control/dashboard/dashboard.mjs +41 -7
- package/es/control/dashboard/index.d.ts +1 -1
- package/es/control/dashboard/index.mjs +4 -1
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.css +1 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.d.ts +64 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.mjs +341 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-design/index.d.ts +0 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-design/index.mjs +1 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-item/filter-portlet-item.css +1 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-item/filter-portlet-item.d.ts +41 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet-item/filter-portlet-item.mjs +130 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet.css +1 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet.d.ts +30 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet.mjs +87 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet.provider.d.ts +15 -0
- package/es/control/dashboard/portlet/filter-portlet/filter-portlet.provider.mjs +21 -0
- package/es/control/dashboard/portlet/filter-portlet/index.d.ts +28 -0
- package/es/control/dashboard/portlet/filter-portlet/index.mjs +14 -0
- package/es/control/dashboard/portlet/index.d.ts +1 -0
- package/es/control/dashboard/portlet/index.mjs +2 -0
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +1 -1
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/form/form-detail/form-druipart/form-druipart.css +1 -1
- package/es/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
- package/es/control/form/form-detail/form-group-panel/form-group-panel.mjs +6 -2
- package/es/control/form/form-detail/form-item/form-item-container/form-item-container.css +1 -1
- package/es/control/form/form-detail/form-item/form-item.mjs +8 -3
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +6 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.mjs +4 -3
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.mjs +6 -12
- package/es/control/form/form-detail/form-rawitem/form-rawitem.css +1 -1
- package/es/control/form/form-detail/form-rawitem/form-rawitem.mjs +8 -1
- package/es/control/grid/grid/grid-control.util.mjs +1 -1
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/grid/grid/grid.mjs +5 -1
- package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.mjs +2 -2
- package/es/control/index.mjs +2 -0
- package/es/control/search-bar/filter-tree/filter-tree.d.ts +16 -1
- package/es/control/search-bar/filter-tree/filter-tree.mjs +12 -4
- package/es/control/search-bar/quick-search-select/quick-search-select.css +1 -1
- package/es/control/search-bar/quick-search-select/quick-search-select.mjs +1 -0
- package/es/control/search-bar/search-bar.css +1 -1
- package/es/control/search-bar/search-bar.mjs +2 -0
- package/es/control/search-bar/search-groups/search-groups.mjs +8 -5
- package/es/control/toolbar/export-excel/export-excel.css +1 -1
- package/es/control/toolbar/toolbar.css +1 -1
- package/es/control/tree/tree.css +1 -1
- package/es/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/tree-grid-ex-edit-column.mjs +2 -2
- package/es/control/tree-grid-ex/tree-grid-ex.mjs +1 -1
- package/es/control/wizard-panel/wizard-panel.css +1 -1
- package/es/editor/cascader/ibiz-cascader/ibiz-cascader.d.ts +1 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.d.ts +35 -1
- package/es/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.mjs +26 -55
- package/es/editor/date-range-select/date-range-select-picker/components/quarter-range-select/quarter-range-select.css +1 -0
- package/es/editor/date-range-select/date-range-select-picker/components/quarter-range-select/quarter-range-select.d.ts +51 -0
- package/es/editor/date-range-select/date-range-select-picker/components/quarter-range-select/quarter-range-select.mjs +335 -0
- package/es/editor/date-range-select/date-range-select-picker/components/week-range-select/week-range-select.css +1 -0
- package/es/editor/date-range-select/date-range-select-picker/components/week-range-select/week-range-select.d.ts +65 -0
- package/es/editor/date-range-select/date-range-select-picker/components/week-range-select/week-range-select.mjs +260 -0
- package/es/editor/date-range-select/date-range-select-picker/components/year-range-select/year-range-select.css +1 -0
- package/es/editor/date-range-select/date-range-select-picker/components/year-range-select/year-range-select.d.ts +52 -0
- package/es/editor/date-range-select/date-range-select-picker/components/year-range-select/year-range-select.mjs +258 -0
- package/es/editor/date-range-select/date-range-select-picker/date-range-select.css +1 -0
- package/es/editor/date-range-select/date-range-select-picker/date-range-select.d.ts +64 -0
- package/es/editor/date-range-select/date-range-select-picker/date-range-select.mjs +339 -0
- package/es/editor/date-range-select/date-range-select.controller.d.ts +328 -0
- package/es/editor/date-range-select/date-range-select.controller.mjs +859 -0
- package/es/editor/date-range-select/date-range-select.provider.d.ts +8 -0
- package/es/editor/date-range-select/date-range-select.provider.mjs +25 -0
- package/es/editor/date-range-select/index.d.ts +3 -0
- package/es/editor/date-range-select/index.mjs +5 -0
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.d.ts +3 -0
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +48 -22
- package/es/editor/index.mjs +8 -0
- package/es/editor/list-box/ibiz-list-box/ibiz-list-box.mjs +32 -32
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
- package/es/editor/radio-button-list/ibiz-radio/ibiz-radio.mjs +17 -2
- package/es/editor/raw/ibiz-raw/ibiz-raw.mjs +6 -7
- package/es/editor/span/span/span.css +1 -1
- package/es/editor/span/span/span.mjs +2 -0
- package/es/editor/upload/ibiz-file-upload/ibiz-file-upload.d.ts +1 -0
- package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.d.ts +1 -0
- package/es/editor/upload/ibiz-image-upload/ibiz-image-upload.mjs +4 -2
- package/es/editor/upload/use/use-iview-upload.d.ts +1 -0
- package/es/editor/upload/use/use-iview-upload.mjs +37 -0
- package/es/index.mjs +2 -0
- package/es/interface/i-field.d.ts +66 -0
- package/es/interface/i-field.mjs +1 -0
- package/es/interface/i-filter-condition.d.ts +52 -0
- package/es/interface/i-filter-condition.mjs +1 -0
- package/es/interface/i-pql-item.d.ts +1 -0
- package/es/interface/i-pql-node-item.d.ts +35 -0
- package/es/interface/i-pql-node-item.mjs +1 -0
- package/es/interface/index.d.ts +3 -0
- package/es/interface/index.mjs +3 -0
- package/es/locale/en/index.d.ts +78 -1
- package/es/locale/en/index.mjs +74 -3
- package/es/locale/zh-CN/index.d.ts +78 -1
- package/es/locale/zh-CN/index.mjs +74 -3
- package/es/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs +15 -0
- package/es/panel-component/auth-userinfo/auth-userinfo.css +1 -1
- package/es/panel-component/coop-pos/coop-pos.controller.d.ts +17 -4
- package/es/panel-component/coop-pos/coop-pos.controller.mjs +48 -4
- package/es/panel-component/coop-pos/coop-pos.css +1 -1
- package/es/panel-component/coop-pos/coop-pos.d.ts +12 -0
- package/es/panel-component/coop-pos/coop-pos.mjs +20 -4
- package/es/panel-component/coop-pos/coop-pos.state.d.ts +14 -0
- package/es/panel-component/coop-pos/coop-pos.state.mjs +14 -0
- package/es/panel-component/coop-pos/index.d.ts +1 -0
- package/es/panel-component/nav-tabs/nav-tabs.css +1 -1
- package/es/panel-component/panel-app-login-view/panel-app-login-view.css +1 -1
- package/es/panel-component/panel-app-title/panel-app-title.controller.d.ts +18 -3
- package/es/panel-component/panel-app-title/panel-app-title.controller.mjs +28 -0
- package/es/panel-component/panel-app-title/panel-app-title.css +1 -1
- package/es/panel-component/panel-app-title/panel-app-title.mjs +46 -3
- package/es/panel-component/panel-button/index.d.ts +1 -1
- package/es/panel-component/panel-button/panel-button.d.ts +1 -1
- package/es/panel-component/panel-exp-header/panel-exp-header.css +1 -1
- package/es/panel-component/panel-index-view-search/panel-index-view-search.css +1 -1
- package/es/panel-component/short-cut/short-cut.css +1 -1
- package/es/util/app-modal/app-modal-component.css +1 -1
- package/es/util/fullscreen/fullscreen-util.d.ts +7 -0
- package/es/util/fullscreen/fullscreen-util.mjs +9 -0
- package/es/util/open-view-util/open-view-util.d.ts +11 -0
- package/es/util/open-view-util/open-view-util.mjs +21 -0
- package/es/util/wang-editor-util/wang-editor-util.d.ts +1 -0
- package/es/util/wang-editor-util/wang-editor-util.mjs +12 -7
- package/es/view/login-view/login-view.css +1 -1
- package/es/view/share-view/share-view.css +1 -1
- package/es/view-engine/edit-view.engine.d.ts +17 -0
- package/es/view-engine/edit-view.engine.mjs +73 -36
- package/es/web-app/components/modal-router-shell/modal-router-shell.mjs +1 -1
- package/es/web-app/create-vue-app.mjs +8 -0
- package/lib/_virtual/_dayjs.cjs +9 -0
- package/lib/_virtual/zh-cn.cjs +5 -0
- package/lib/common/action-toolbar/action-toolbar.cjs +2 -2
- package/lib/common/action-toolbar/action-toolbar.css +1 -1
- package/lib/common/custom-filter-condition/custom-filter-condition.cjs +288 -0
- package/lib/common/custom-filter-condition/custom-filter-condition.css +1 -0
- package/lib/common/custom-theme/custom-theme-model.cjs +62 -0
- package/lib/common/custom-theme/custom-theme.controller.cjs +6 -5
- package/lib/common/custom-theme/custom-theme.css +1 -1
- package/lib/common/index.cjs +2 -0
- package/lib/common/pagination/pagination.cjs +1 -1
- package/lib/common/pagination/pagination.css +1 -1
- package/lib/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.cjs +4 -1
- package/lib/common/pql-editor/components/pql-editor-suggestion/pql-editor-suggestion.css +1 -1
- package/lib/common/pql-editor/pql-editor.cjs +228 -129
- package/lib/common/pql-editor/utils/index.cjs +195 -68
- package/lib/common/rawitem/rawitem.cjs +16 -0
- package/lib/control/app-menu/app-menu.cjs +3 -2
- package/lib/control/app-menu/app-menu.css +1 -1
- package/lib/control/caption-bar/caption-bar.cjs +11 -2
- package/lib/control/caption-bar/caption-bar.css +1 -1
- package/lib/control/chart/chart.cjs +1 -1
- package/lib/control/dashboard/custom-dashboard-container/custom-dashboard-container.cjs +34 -9
- package/lib/control/dashboard/dashboard-design/dashboard-design.cjs +2 -2
- package/lib/control/dashboard/dashboard-design/dashboard-design.css +1 -1
- package/lib/control/dashboard/dashboard.cjs +40 -6
- package/lib/control/dashboard/index.cjs +5 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.cjs +343 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet-design/filter-portlet-design.css +1 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet-design/index.cjs +3 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet-item/filter-portlet-item.cjs +132 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet-item/filter-portlet-item.css +1 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet.cjs +89 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet.css +1 -0
- package/lib/control/dashboard/portlet/filter-portlet/filter-portlet.provider.cjs +23 -0
- package/lib/control/dashboard/portlet/filter-portlet/index.cjs +20 -0
- package/lib/control/dashboard/portlet/index.cjs +4 -0
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +1 -1
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/form/form-detail/form-druipart/form-druipart.css +1 -1
- package/lib/control/form/form-detail/form-group-panel/form-group-panel.cjs +6 -2
- package/lib/control/form/form-detail/form-group-panel/form-group-panel.css +1 -1
- package/lib/control/form/form-detail/form-item/form-item-container/form-item-container.css +1 -1
- package/lib/control/form/form-detail/form-item/form-item.cjs +8 -3
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.cjs +3 -2
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.cjs +5 -11
- package/lib/control/form/form-detail/form-rawitem/form-rawitem.cjs +8 -1
- package/lib/control/form/form-detail/form-rawitem/form-rawitem.css +1 -1
- package/lib/control/grid/grid/grid-control.util.cjs +1 -1
- package/lib/control/grid/grid/grid.cjs +5 -1
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.cjs +2 -2
- package/lib/control/index.cjs +22 -18
- package/lib/control/search-bar/filter-tree/filter-tree.cjs +12 -4
- package/lib/control/search-bar/quick-search-select/quick-search-select.cjs +1 -0
- package/lib/control/search-bar/quick-search-select/quick-search-select.css +1 -1
- package/lib/control/search-bar/search-bar.cjs +2 -0
- package/lib/control/search-bar/search-bar.css +1 -1
- package/lib/control/search-bar/search-groups/search-groups.cjs +8 -5
- package/lib/control/toolbar/export-excel/export-excel.css +1 -1
- package/lib/control/toolbar/toolbar.css +1 -1
- package/lib/control/tree/tree.css +1 -1
- package/lib/control/tree-grid-ex/tree-grid-ex-column/tree-grid-ex-edit-column/tree-grid-ex-edit-column.cjs +2 -2
- package/lib/control/tree-grid-ex/tree-grid-ex.cjs +1 -1
- package/lib/control/wizard-panel/wizard-panel.css +1 -1
- package/lib/editor/check-box-list/ibiz-checkbox-list/ibiz-checkbox-list.cjs +26 -55
- package/lib/editor/date-range-select/date-range-select-picker/components/quarter-range-select/quarter-range-select.cjs +339 -0
- package/lib/editor/date-range-select/date-range-select-picker/components/quarter-range-select/quarter-range-select.css +1 -0
- package/lib/editor/date-range-select/date-range-select-picker/components/week-range-select/week-range-select.cjs +264 -0
- package/lib/editor/date-range-select/date-range-select-picker/components/week-range-select/week-range-select.css +1 -0
- package/lib/editor/date-range-select/date-range-select-picker/components/year-range-select/year-range-select.cjs +262 -0
- package/lib/editor/date-range-select/date-range-select-picker/components/year-range-select/year-range-select.css +1 -0
- package/lib/editor/date-range-select/date-range-select-picker/date-range-select.cjs +341 -0
- package/lib/editor/date-range-select/date-range-select-picker/date-range-select.css +1 -0
- package/lib/editor/date-range-select/date-range-select.controller.cjs +861 -0
- package/lib/editor/date-range-select/date-range-select.provider.cjs +27 -0
- package/lib/editor/date-range-select/index.cjs +11 -0
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +47 -21
- package/lib/editor/index.cjs +8 -0
- package/lib/editor/list-box/ibiz-list-box/ibiz-list-box.cjs +32 -32
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.cjs +17 -2
- package/lib/editor/radio-button-list/ibiz-radio/ibiz-radio.css +1 -1
- package/lib/editor/raw/ibiz-raw/ibiz-raw.cjs +6 -7
- package/lib/editor/span/span/span.cjs +2 -0
- package/lib/editor/span/span/span.css +1 -1
- package/lib/editor/upload/ibiz-image-upload/ibiz-image-upload.cjs +4 -2
- package/lib/editor/upload/use/use-iview-upload.cjs +37 -0
- package/lib/index.cjs +52 -48
- package/lib/interface/i-field.cjs +3 -0
- package/lib/interface/i-filter-condition.cjs +3 -0
- package/lib/interface/i-pql-node-item.cjs +3 -0
- package/lib/interface/index.cjs +3 -0
- package/lib/locale/en/index.cjs +74 -3
- package/lib/locale/zh-CN/index.cjs +74 -3
- package/lib/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.cjs +19 -0
- package/lib/panel-component/auth-userinfo/auth-userinfo.css +1 -1
- package/lib/panel-component/coop-pos/coop-pos.cjs +19 -3
- package/lib/panel-component/coop-pos/coop-pos.controller.cjs +48 -4
- package/lib/panel-component/coop-pos/coop-pos.css +1 -1
- package/lib/panel-component/coop-pos/coop-pos.state.cjs +14 -0
- package/lib/panel-component/nav-tabs/nav-tabs.css +1 -1
- package/lib/panel-component/panel-app-login-view/panel-app-login-view.css +1 -1
- package/lib/panel-component/panel-app-title/panel-app-title.cjs +46 -3
- package/lib/panel-component/panel-app-title/panel-app-title.controller.cjs +28 -0
- package/lib/panel-component/panel-app-title/panel-app-title.css +1 -1
- package/lib/panel-component/panel-exp-header/panel-exp-header.css +1 -1
- package/lib/panel-component/panel-index-view-search/panel-index-view-search.css +1 -1
- package/lib/panel-component/short-cut/short-cut.css +1 -1
- package/lib/util/app-modal/app-modal-component.css +1 -1
- package/lib/util/fullscreen/fullscreen-util.cjs +9 -0
- package/lib/util/open-view-util/open-view-util.cjs +21 -0
- package/lib/util/wang-editor-util/wang-editor-util.cjs +12 -7
- package/lib/view/login-view/login-view.css +1 -1
- package/lib/view/share-view/share-view.css +1 -1
- package/lib/view-engine/edit-view.engine.cjs +72 -35
- package/lib/web-app/components/modal-router-shell/modal-router-shell.cjs +1 -1
- package/lib/web-app/create-vue-app.cjs +8 -0
- package/package.json +9 -8
- package/dist/chart-0UV2FAN6.js +0 -1
- package/dist/index-YQyitjSg.js +0 -1
- package/dist/index-maJGu4b8.js +0 -4
- package/dist/index-trS6uS3E.js +0 -1
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.30_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.35-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.30_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.35-alpha.1_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { ref, watch, createVNode, resolveComponent, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import './quarter-range-select.css';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
var quarterRangeSelect = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "BIQuarterRangeSelect",
|
|
8
|
+
props: {
|
|
9
|
+
value: {
|
|
10
|
+
type: Array,
|
|
11
|
+
default: () => []
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
emits: ["change", "visibleChange"],
|
|
15
|
+
setup(props, {
|
|
16
|
+
emit
|
|
17
|
+
}) {
|
|
18
|
+
const ns = useNamespace("bi-quarter-range-select");
|
|
19
|
+
const leftYear = ref();
|
|
20
|
+
const rightYear = ref();
|
|
21
|
+
const startQuarter = ref();
|
|
22
|
+
const endQuarter = ref();
|
|
23
|
+
const hoverItem = ref();
|
|
24
|
+
const visible = ref(false);
|
|
25
|
+
const quarterItems = ["Q1", "Q2", "Q3", "Q4"];
|
|
26
|
+
const computedDate = (year, index, mode) => {
|
|
27
|
+
let month = index * 3;
|
|
28
|
+
if (mode === "START") {
|
|
29
|
+
month -= 2;
|
|
30
|
+
}
|
|
31
|
+
const tempDate = new Date("".concat(year, "-").concat(month));
|
|
32
|
+
if (mode === "START") {
|
|
33
|
+
tempDate.setDate(1);
|
|
34
|
+
tempDate.setHours(0, 0, 0, 0);
|
|
35
|
+
} else {
|
|
36
|
+
const big = [1, 3, 5, 7, 8, 10, 12];
|
|
37
|
+
if (big.includes(month)) {
|
|
38
|
+
tempDate.setDate(31);
|
|
39
|
+
} else {
|
|
40
|
+
tempDate.setDate(30);
|
|
41
|
+
}
|
|
42
|
+
tempDate.setHours(23, 59, 59, 0);
|
|
43
|
+
}
|
|
44
|
+
return tempDate;
|
|
45
|
+
};
|
|
46
|
+
const init = () => {
|
|
47
|
+
leftYear.value = (/* @__PURE__ */ new Date()).getFullYear();
|
|
48
|
+
rightYear.value = (/* @__PURE__ */ new Date()).getFullYear() + 1;
|
|
49
|
+
startQuarter.value = null;
|
|
50
|
+
endQuarter.value = null;
|
|
51
|
+
};
|
|
52
|
+
watch(() => props.value, (newVal) => {
|
|
53
|
+
if (newVal && Array.isArray(newVal) && newVal.length > 0) {
|
|
54
|
+
const startDate = new Date(newVal[0]);
|
|
55
|
+
const endDate = new Date(newVal[1]);
|
|
56
|
+
leftYear.value = startDate.getFullYear();
|
|
57
|
+
const tempEnd = endDate.getFullYear();
|
|
58
|
+
if (leftYear.value === tempEnd) {
|
|
59
|
+
rightYear.value = leftYear.value + 1;
|
|
60
|
+
} else {
|
|
61
|
+
rightYear.value = tempEnd;
|
|
62
|
+
}
|
|
63
|
+
const startIndex = Math.ceil((startDate.getMonth() + 1) / 3);
|
|
64
|
+
const endIndex = Math.ceil((endDate.getMonth() + 1) / 3);
|
|
65
|
+
startQuarter.value = computedDate(leftYear.value, startIndex, "START");
|
|
66
|
+
endQuarter.value = computedDate(tempEnd, endIndex, "END");
|
|
67
|
+
} else {
|
|
68
|
+
init();
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
immediate: true,
|
|
72
|
+
deep: true
|
|
73
|
+
});
|
|
74
|
+
const onReduce = (tag) => {
|
|
75
|
+
if (tag === "left") {
|
|
76
|
+
leftYear.value -= 1;
|
|
77
|
+
} else {
|
|
78
|
+
rightYear.value -= 1;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const onAdd = (tag) => {
|
|
82
|
+
if (tag === "left") {
|
|
83
|
+
leftYear.value += 1;
|
|
84
|
+
} else {
|
|
85
|
+
rightYear.value += 1;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const renderLeftIcon = (tag) => {
|
|
89
|
+
if (tag === "right" && leftYear.value === rightYear.value) {
|
|
90
|
+
return createVNode("div", null, null);
|
|
91
|
+
}
|
|
92
|
+
return createVNode("svg", {
|
|
93
|
+
"onClick": () => onReduce(tag),
|
|
94
|
+
"viewBox": "0 0 16 16",
|
|
95
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
96
|
+
"height": "1em",
|
|
97
|
+
"width": "1em",
|
|
98
|
+
"focusable": "false",
|
|
99
|
+
"fill": "currentColor"
|
|
100
|
+
}, [createVNode("g", {
|
|
101
|
+
"id": "aav1.icon\u56FE\u6807/5.navigation/angle-double-left",
|
|
102
|
+
"stroke-width": "1",
|
|
103
|
+
"fill-rule": "evenodd"
|
|
104
|
+
}, [createVNode("path", {
|
|
105
|
+
"d": "M7.984 7l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7l.005.006L7.984 7zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3l.005.006L7.984 3z",
|
|
106
|
+
"id": "aav\u5F62\u72B6\u7ED3\u5408",
|
|
107
|
+
"transform": "rotate(-90 7.949 7.822)"
|
|
108
|
+
}, null)])]);
|
|
109
|
+
};
|
|
110
|
+
const renderRightIcon = (tag) => {
|
|
111
|
+
if (tag === "left" && leftYear.value === rightYear.value) {
|
|
112
|
+
return createVNode("div", null, null);
|
|
113
|
+
}
|
|
114
|
+
return createVNode("svg", {
|
|
115
|
+
"onClick": () => onAdd(tag),
|
|
116
|
+
"viewBox": "0 0 16 16",
|
|
117
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
118
|
+
"height": "1em",
|
|
119
|
+
"width": "1em",
|
|
120
|
+
"focusable": "false",
|
|
121
|
+
"fill": "currentColor"
|
|
122
|
+
}, [createVNode("g", {
|
|
123
|
+
"id": "aaw1.icon\u56FE\u6807/5.navigation/angle-double-right",
|
|
124
|
+
"stroke-width": "1",
|
|
125
|
+
"fill-rule": "evenodd"
|
|
126
|
+
}, [createVNode("path", {
|
|
127
|
+
"d": "M7.984 7.3l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7.3l.005.006.006-.006zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3.3l.005.006.006-.006z",
|
|
128
|
+
"id": "aaw\u5F62\u72B6\u7ED3\u5408",
|
|
129
|
+
"transform": "rotate(90 7.949 8.122)"
|
|
130
|
+
}, null)])]);
|
|
131
|
+
};
|
|
132
|
+
const emitFunc = () => {
|
|
133
|
+
emit("change", [startQuarter.value.toLocaleDateString(), endQuarter.value.toLocaleDateString()]);
|
|
134
|
+
visible.value = false;
|
|
135
|
+
};
|
|
136
|
+
const onItemClick = (year, index) => {
|
|
137
|
+
if (startQuarter.value && endQuarter.value) {
|
|
138
|
+
startQuarter.value = null;
|
|
139
|
+
endQuarter.value = null;
|
|
140
|
+
}
|
|
141
|
+
if (!startQuarter.value) {
|
|
142
|
+
startQuarter.value = computedDate(year, index, "START");
|
|
143
|
+
} else {
|
|
144
|
+
const tempStartYear = startQuarter.value.getFullYear();
|
|
145
|
+
const tempStartMonth = startQuarter.value.getMonth() + 1;
|
|
146
|
+
const tempStartQuarter = Math.ceil(tempStartMonth / 3);
|
|
147
|
+
if (year > tempStartYear) {
|
|
148
|
+
endQuarter.value = computedDate(year, index, "END");
|
|
149
|
+
} else if (year < tempStartYear) {
|
|
150
|
+
endQuarter.value = computedDate(tempStartYear, tempStartQuarter, "END");
|
|
151
|
+
startQuarter.value = computedDate(year, index, "START");
|
|
152
|
+
} else if (index >= tempStartQuarter) {
|
|
153
|
+
endQuarter.value = computedDate(year, index, "END");
|
|
154
|
+
} else {
|
|
155
|
+
endQuarter.value = computedDate(tempStartYear, tempStartQuarter, "END");
|
|
156
|
+
startQuarter.value = computedDate(year, index, "START");
|
|
157
|
+
}
|
|
158
|
+
emitFunc();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const computedSelectArea = (year, index) => {
|
|
162
|
+
if (leftYear.value && rightYear.value && startQuarter.value && endQuarter.value) {
|
|
163
|
+
const tempStartYear = startQuarter.value.getFullYear();
|
|
164
|
+
const tempEndYear = endQuarter.value.getFullYear();
|
|
165
|
+
const tempStartMonth = startQuarter.value.getMonth() + 1;
|
|
166
|
+
const tempEndMonth = endQuarter.value.getMonth() + 1;
|
|
167
|
+
const tempStartQuarter = Math.ceil(tempStartMonth / 3);
|
|
168
|
+
const tempEndQuarter = Math.ceil(tempEndMonth / 3);
|
|
169
|
+
if (year > tempStartYear && year < tempEndYear) {
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
if (year === tempStartYear && year < tempEndYear && index >= tempStartQuarter) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
if (year === tempEndYear && year > tempStartYear && index <= tempEndQuarter) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
if (year === tempStartYear && year === tempEndYear && index <= tempEndQuarter && index >= tempStartQuarter) {
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return false;
|
|
183
|
+
};
|
|
184
|
+
const computedHoverSelectArea = (year, index) => {
|
|
185
|
+
if (leftYear.value && rightYear.value && startQuarter.value && !endQuarter.value && hoverItem.value) {
|
|
186
|
+
const tempHoverYear = hoverItem.value.getFullYear();
|
|
187
|
+
const tempHoverMonth = hoverItem.value.getMonth() + 1;
|
|
188
|
+
const tempHoverQuarter = Math.ceil(tempHoverMonth / 3);
|
|
189
|
+
let tempStart = startQuarter.value;
|
|
190
|
+
let tempEnd = hoverItem.value;
|
|
191
|
+
const startDateYear = startQuarter.value.getFullYear();
|
|
192
|
+
const startDateMonth = startQuarter.value.getMonth() + 1;
|
|
193
|
+
const startDateQuarter = Math.ceil(startDateMonth / 3);
|
|
194
|
+
if (tempHoverYear <= startDateYear && tempHoverQuarter <= startDateQuarter) {
|
|
195
|
+
tempEnd = startQuarter.value;
|
|
196
|
+
tempStart = hoverItem.value;
|
|
197
|
+
}
|
|
198
|
+
const tempStartYear = tempStart.getFullYear();
|
|
199
|
+
const tempEndYear = tempEnd.getFullYear();
|
|
200
|
+
const tempStartMonth = tempStart.getMonth() + 1;
|
|
201
|
+
const tempEndMonth = tempEnd.getMonth() + 1;
|
|
202
|
+
const tempStartQuarter = Math.ceil(tempStartMonth / 3);
|
|
203
|
+
const tempEndQuarter = Math.ceil(tempEndMonth / 3);
|
|
204
|
+
if (year > tempStartYear && year < tempEndYear) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
if (year === tempStartYear && year < tempEndYear && index >= tempStartQuarter) {
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
if (year === tempEndYear && year > tempStartYear && index <= tempEndQuarter) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
if (tempHoverYear <= startDateYear && tempHoverQuarter < startDateQuarter && year === tempHoverYear && index >= tempHoverQuarter && index <= startDateQuarter) {
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
if (tempHoverYear >= startDateYear && tempHoverQuarter > startDateQuarter && year === tempHoverYear && index <= tempHoverQuarter && index >= startDateQuarter) {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
};
|
|
222
|
+
const computedSelected = (year, index) => {
|
|
223
|
+
if (startQuarter.value) {
|
|
224
|
+
const tempStartYear = startQuarter.value.getFullYear();
|
|
225
|
+
const tempStartMonth = startQuarter.value.getMonth() + 1;
|
|
226
|
+
const tempStartQuarter = Math.ceil(tempStartMonth / 3);
|
|
227
|
+
if (year === tempStartYear && tempStartQuarter === index) {
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (endQuarter.value) {
|
|
232
|
+
const tempEndYear = endQuarter.value.getFullYear();
|
|
233
|
+
const tempEndMonth = endQuarter.value.getMonth() + 1;
|
|
234
|
+
const tempEndQuarter = Math.ceil(tempEndMonth / 3);
|
|
235
|
+
if (year === tempEndYear && tempEndQuarter === index) {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return false;
|
|
240
|
+
};
|
|
241
|
+
const computedHover = (year, index) => {
|
|
242
|
+
if (hoverItem.value) {
|
|
243
|
+
return hoverItem.value.getTime() === computedDate(year, index, "START").getTime();
|
|
244
|
+
}
|
|
245
|
+
return false;
|
|
246
|
+
};
|
|
247
|
+
const computedCurQuarter = (year, index) => {
|
|
248
|
+
const curDate = computedDate(year, index, "START");
|
|
249
|
+
const toDay = /* @__PURE__ */ new Date();
|
|
250
|
+
const tempStartMonth = curDate.getMonth() + 1;
|
|
251
|
+
const tempStartQuarter = Math.ceil(tempStartMonth / 3);
|
|
252
|
+
const toYear = toDay.getFullYear();
|
|
253
|
+
const tempToDayMonth = toDay.getMonth() + 1;
|
|
254
|
+
const tempToDayQuarter = Math.ceil(tempToDayMonth / 3);
|
|
255
|
+
return year === toYear && tempStartQuarter === tempToDayQuarter;
|
|
256
|
+
};
|
|
257
|
+
const onMouseHover = (year, index) => {
|
|
258
|
+
hoverItem.value = computedDate(year, index, "START");
|
|
259
|
+
};
|
|
260
|
+
const onMouseleave = () => {
|
|
261
|
+
hoverItem.value = null;
|
|
262
|
+
};
|
|
263
|
+
const renderSelect = () => {
|
|
264
|
+
return createVNode("div", {
|
|
265
|
+
"class": ns.e("date-panel")
|
|
266
|
+
}, [createVNode("div", {
|
|
267
|
+
"class": ns.em("date-panel", "left")
|
|
268
|
+
}, [createVNode("div", {
|
|
269
|
+
"class": ns.em("date-panel", "left-header")
|
|
270
|
+
}, [renderLeftIcon("left"), createVNode("span", null, [leftYear.value, ibiz.i18n.t("editor.dateRangeSelect.year")]), renderRightIcon("left")]), createVNode("div", {
|
|
271
|
+
"class": ns.em("date-panel", "left-content")
|
|
272
|
+
}, [quarterItems.map((item, index) => {
|
|
273
|
+
return createVNode("div", {
|
|
274
|
+
"class": [ns.em("date-panel", "left-item"), ns.is("include", computedSelectArea(leftYear.value, index + 1)), ns.is("selected", computedSelected(leftYear.value, index + 1)), ns.is("hoverinclude", computedHoverSelectArea(leftYear.value, index + 1)), ns.is("curquarter", computedCurQuarter(leftYear.value, index + 1)), ns.is("hover", computedHover(leftYear.value, index + 1))],
|
|
275
|
+
"onClick": () => onItemClick(leftYear.value, index + 1),
|
|
276
|
+
"onMouseenter": () => onMouseHover(leftYear.value, index + 1),
|
|
277
|
+
"onMouseleave": () => onMouseleave()
|
|
278
|
+
}, [item]);
|
|
279
|
+
})])]), createVNode("div", {
|
|
280
|
+
"class": ns.em("date-panel", "right")
|
|
281
|
+
}, [createVNode("div", {
|
|
282
|
+
"class": ns.em("date-panel", "right-header")
|
|
283
|
+
}, [renderLeftIcon("right"), createVNode("span", null, [rightYear.value, ibiz.i18n.t("editor.dateRangeSelect.year")]), renderRightIcon("right")]), createVNode("div", {
|
|
284
|
+
"class": ns.em("date-panel", "right-content")
|
|
285
|
+
}, [quarterItems.map((item, index) => {
|
|
286
|
+
return createVNode("div", {
|
|
287
|
+
"class": [ns.em("date-panel", "right-item"), ns.is("selected", computedSelected(rightYear.value, index + 1)), ns.is("include", computedSelectArea(rightYear.value, index + 1)), ns.is("hoverinclude", computedHoverSelectArea(rightYear.value, index + 1)), ns.is("curquarter", computedCurQuarter(rightYear.value, index + 1)), ns.is("hover", computedHover(rightYear.value, index + 1))],
|
|
288
|
+
"onClick": () => onItemClick(rightYear.value, index + 1),
|
|
289
|
+
"onMouseenter": () => onMouseHover(rightYear.value, index + 1),
|
|
290
|
+
"onMouseleave": () => onMouseleave()
|
|
291
|
+
}, [item]);
|
|
292
|
+
})])])]);
|
|
293
|
+
};
|
|
294
|
+
const handleClose = () => {
|
|
295
|
+
visible.value = false;
|
|
296
|
+
};
|
|
297
|
+
const handleOpen = () => {
|
|
298
|
+
visible.value = true;
|
|
299
|
+
};
|
|
300
|
+
const visibleChange = (_visible) => {
|
|
301
|
+
emit("visibleChange", _visible);
|
|
302
|
+
};
|
|
303
|
+
return {
|
|
304
|
+
ns,
|
|
305
|
+
renderSelect,
|
|
306
|
+
visible,
|
|
307
|
+
handleClose,
|
|
308
|
+
handleOpen,
|
|
309
|
+
visibleChange
|
|
310
|
+
};
|
|
311
|
+
},
|
|
312
|
+
render() {
|
|
313
|
+
return createVNode("div", {
|
|
314
|
+
"class": this.ns.b()
|
|
315
|
+
}, [createVNode(resolveComponent("el-popover"), {
|
|
316
|
+
"visible": this.visible,
|
|
317
|
+
"onUpdate:visible": ($event) => this.visible = $event,
|
|
318
|
+
"trigger": "click",
|
|
319
|
+
"width": 600,
|
|
320
|
+
"popper-class": this.ns.b("quarter-pop"),
|
|
321
|
+
"placement": "right",
|
|
322
|
+
"onAfterEnter": () => this.visibleChange(true),
|
|
323
|
+
"onAfterLeave": () => this.visibleChange(false)
|
|
324
|
+
}, {
|
|
325
|
+
default: () => {
|
|
326
|
+
return this.renderSelect();
|
|
327
|
+
},
|
|
328
|
+
reference: () => {
|
|
329
|
+
return createVNode("div", null, null);
|
|
330
|
+
}
|
|
331
|
+
})]);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
export { quarterRangeSelect as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-bi-week-range{width:100%;height:100%;cursor:pointer}.ibiz-bi-week-range .el-date-editor{width:0;height:0;cursor:pointer}.ibiz-bi-week-range__cell-item{box-sizing:border-box;height:30px;padding:var(--ibiz-spacing-super-tight) 0}.ibiz-bi-week-range__cell-item--text{position:absolute;left:50%;display:block;width:24px;height:24px;margin:0 auto;line-height:24px;border-radius:50%;transform:translateX(-50%)}.ibiz-bi-week-range__cell-item--text.is-today{color:var(--ibiz-color-primary)}.ibiz-bi-week-range__cell-item.is-started{width:100%;margin-left:5px;color:var(--ibiz-color-primary-text);background:var(--ibiz-color-primary)}.ibiz-bi-week-range__cell-item.is-started .ibiz-bi-week-range__cell-item--text{color:var(--ibiz-color-primary-text);background:var(--ibiz-color-primary)}.ibiz-bi-week-range__cell-item.is-started.is-monday{border-top-left-radius:var(--ibiz-border-radius-small);border-bottom-left-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-started.is-left{border-top-left-radius:var(--ibiz-border-radius-small);border-bottom-left-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-started.is-sunday{position:relative;z-index:10;border-top-right-radius:var(--ibiz-border-radius-small);border-bottom-right-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-started.is-right{border-top-right-radius:var(--ibiz-border-radius-small);border-bottom-right-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-ended{z-index:10;width:100%;margin-right:var(--ibiz-spacing-extra-tight);color:var(--ibiz-color-primary-text);background:var(--ibiz-color-primary)}.ibiz-bi-week-range__cell-item.is-ended .ibiz-bi-week-range__cell-item--text{color:var(--ibiz-color-primary-text);background:var(--ibiz-color-primary)}.ibiz-bi-week-range__cell-item.is-ended.is-monday{border-top-left-radius:5px;border-bottom-left-radius:5px}.ibiz-bi-week-range__cell-item.is-ended.is-left{border-top-left-radius:var(--ibiz-border-radius-small);border-bottom-left-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-ended.is-sunday{border-top-right-radius:5px;border-bottom-right-radius:5px}.ibiz-bi-week-range__cell-item.is-ended.is-right{border-top-right-radius:var(--ibiz-border-radius-small);border-bottom-right-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-inrange{color:var(--ibiz-color-text-0);background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-week-range__cell-item.is-inrange.is-hover{background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-week-range__cell-item.is-hover{color:var(--ibiz-color-primary);background:0 0}.ibiz-bi-week-range__cell-item.is-inhoverrange{color:var(--ibiz-color-text-0);background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-week-range__cell-item.is-inhoverrange.is-hover{color:var(--ibiz-color-primary-text);background:var(--ibiz-color-primary)}.ibiz-bi-week-range__cell-item.is-inhoverrange.is-left{border-top-left-radius:var(--ibiz-border-radius-small);border-bottom-left-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range__cell-item.is-inhoverrange.is-right{border-top-right-radius:var(--ibiz-border-radius-small);border-bottom-right-radius:var(--ibiz-border-radius-small)}.ibiz-bi-week-range-picker-pop .el-date-table tr:hover{background-color:unset!important}.ibiz-bi-week-range-picker-pop.el-picker__popper .el-date-table__row .is-started{padding-left:5px;margin-left:0}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import 'dayjs/locale/zh-cn';
|
|
2
|
+
import './week-range-select.scss';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
value: {
|
|
5
|
+
type: {
|
|
6
|
+
(arrayLength: number): string[];
|
|
7
|
+
(...items: string[]): string[];
|
|
8
|
+
new (arrayLength: number): string[];
|
|
9
|
+
new (...items: string[]): string[];
|
|
10
|
+
isArray(arg: any): arg is any[];
|
|
11
|
+
readonly prototype: any[];
|
|
12
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
13
|
+
from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
14
|
+
from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
15
|
+
from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
16
|
+
of<T_4>(...items: T_4[]): T_4[];
|
|
17
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
18
|
+
};
|
|
19
|
+
default: () => never[];
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
23
|
+
curValue: import("vue").Ref<any>;
|
|
24
|
+
weekRangeRef: import("vue").Ref<any>;
|
|
25
|
+
isInRange: (cell: IData) => boolean;
|
|
26
|
+
isInHoverRange: (cell: IData) => boolean;
|
|
27
|
+
isEnded: (cell: IData) => boolean | undefined;
|
|
28
|
+
isStarted: (cell: IData) => boolean | undefined;
|
|
29
|
+
isToday: (cell: IData) => boolean;
|
|
30
|
+
weekRangeClick: () => void;
|
|
31
|
+
cellClick: (cell: IData) => void;
|
|
32
|
+
visibleChange: (tag: boolean) => void;
|
|
33
|
+
handleChange: () => void;
|
|
34
|
+
handleClose: () => void;
|
|
35
|
+
handleOpen: () => void;
|
|
36
|
+
isHover: (cell: IData) => boolean;
|
|
37
|
+
isMonday: (cell: IData) => boolean;
|
|
38
|
+
isSunday: (cell: IData) => boolean;
|
|
39
|
+
onMouseHover: (cell: IData) => void;
|
|
40
|
+
onMouseleave: () => void;
|
|
41
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "visibleChange")[], "change" | "visibleChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
42
|
+
value: {
|
|
43
|
+
type: {
|
|
44
|
+
(arrayLength: number): string[];
|
|
45
|
+
(...items: string[]): string[];
|
|
46
|
+
new (arrayLength: number): string[];
|
|
47
|
+
new (...items: string[]): string[];
|
|
48
|
+
isArray(arg: any): arg is any[];
|
|
49
|
+
readonly prototype: any[];
|
|
50
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
51
|
+
from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
52
|
+
from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
53
|
+
from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
54
|
+
of<T_4>(...items: T_4[]): T_4[];
|
|
55
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
56
|
+
};
|
|
57
|
+
default: () => never[];
|
|
58
|
+
};
|
|
59
|
+
}>> & {
|
|
60
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
61
|
+
onVisibleChange?: ((...args: any[]) => any) | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
value: string[];
|
|
64
|
+
}, {}>;
|
|
65
|
+
export default _default;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { ref, watch, resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import '../../../../../node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/locale/zh-cn.mjs';
|
|
5
|
+
import './week-range-select.css';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var weekRangeSelect = /* @__PURE__ */ defineComponent({
|
|
9
|
+
props: {
|
|
10
|
+
value: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
emits: ["change", "visibleChange"],
|
|
16
|
+
setup(props, {
|
|
17
|
+
emit
|
|
18
|
+
}) {
|
|
19
|
+
const ns = useNamespace("bi-week-range");
|
|
20
|
+
const curValue = ref();
|
|
21
|
+
const weekRangeRef = ref();
|
|
22
|
+
const visible = ref(false);
|
|
23
|
+
const Today = dayjs(/* @__PURE__ */ new Date()).format("YYYY/MM/DD");
|
|
24
|
+
const start = ref();
|
|
25
|
+
const end = ref();
|
|
26
|
+
let clicked = false;
|
|
27
|
+
const hoverItem = ref();
|
|
28
|
+
const initSelectDate = () => {
|
|
29
|
+
start.value = null;
|
|
30
|
+
end.value = null;
|
|
31
|
+
};
|
|
32
|
+
watch(() => props.value, (newVal) => {
|
|
33
|
+
if (newVal && Array.isArray(newVal)) {
|
|
34
|
+
start.value = new Date(newVal[0]);
|
|
35
|
+
end.value = new Date(newVal[1]);
|
|
36
|
+
} else {
|
|
37
|
+
initSelectDate();
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
40
|
+
immediate: true,
|
|
41
|
+
deep: true
|
|
42
|
+
});
|
|
43
|
+
const computedDateWeekSunday = (date) => {
|
|
44
|
+
const day = date.getDay();
|
|
45
|
+
let weekday = day;
|
|
46
|
+
if (day === 0) {
|
|
47
|
+
weekday = 7;
|
|
48
|
+
}
|
|
49
|
+
const sunday = date.getTime() + (7 - weekday) * 24 * 60 * 60 * 1e3;
|
|
50
|
+
const tempEnd = new Date(sunday);
|
|
51
|
+
tempEnd.setHours(23, 59, 59, 0);
|
|
52
|
+
return tempEnd;
|
|
53
|
+
};
|
|
54
|
+
const computedDateWeekMonday = (date) => {
|
|
55
|
+
const day = date.getDay();
|
|
56
|
+
let weekday = day;
|
|
57
|
+
if (day === 0) {
|
|
58
|
+
weekday = 7;
|
|
59
|
+
}
|
|
60
|
+
const monday = date.getTime() - (weekday - 1) * 24 * 60 * 60 * 1e3;
|
|
61
|
+
const tempStart = new Date(monday);
|
|
62
|
+
tempStart.setHours(0, 0, 0, 0);
|
|
63
|
+
return tempStart;
|
|
64
|
+
};
|
|
65
|
+
const isInRange = (cell) => {
|
|
66
|
+
const {
|
|
67
|
+
date
|
|
68
|
+
} = cell;
|
|
69
|
+
const curTime = date.getTime();
|
|
70
|
+
if (start.value && end.value) {
|
|
71
|
+
const startTime = start.value.getTime();
|
|
72
|
+
const endTime = end.value.getTime();
|
|
73
|
+
if (curTime >= startTime && curTime <= endTime) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
};
|
|
79
|
+
const isEnded = (cell) => {
|
|
80
|
+
const {
|
|
81
|
+
date
|
|
82
|
+
} = cell;
|
|
83
|
+
if (end.value) {
|
|
84
|
+
const sunday = computedDateWeekSunday(end.value);
|
|
85
|
+
const monday = computedDateWeekMonday(end.value);
|
|
86
|
+
if (date.getTime() >= monday.getTime() && date.getTime() <= sunday.getTime()) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const isStarted = (cell) => {
|
|
93
|
+
const {
|
|
94
|
+
date
|
|
95
|
+
} = cell;
|
|
96
|
+
if (start.value) {
|
|
97
|
+
const sunday = computedDateWeekSunday(start.value);
|
|
98
|
+
const monday = computedDateWeekMonday(start.value);
|
|
99
|
+
if (date.getTime() >= monday.getTime() && date.getTime() <= sunday.getTime()) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const isToday = (cell) => {
|
|
106
|
+
const format = "YYYY/MM/DD";
|
|
107
|
+
return cell.dayjs.format(format) === Today;
|
|
108
|
+
};
|
|
109
|
+
const handleChange = () => {
|
|
110
|
+
if (start.value && end.value) {
|
|
111
|
+
const startDate = start.value.toLocaleDateString();
|
|
112
|
+
const endDate = end.value.toLocaleDateString();
|
|
113
|
+
emit("change", [startDate, endDate]);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const cellClick = (cell) => {
|
|
117
|
+
const {
|
|
118
|
+
date
|
|
119
|
+
} = cell;
|
|
120
|
+
if (!clicked) {
|
|
121
|
+
initSelectDate();
|
|
122
|
+
start.value = computedDateWeekMonday(date);
|
|
123
|
+
clicked = true;
|
|
124
|
+
} else {
|
|
125
|
+
const tempSunday = computedDateWeekSunday(date);
|
|
126
|
+
const tempMonday = computedDateWeekMonday(date);
|
|
127
|
+
if (tempMonday.getTime() > start.value.getTime()) {
|
|
128
|
+
end.value = tempSunday;
|
|
129
|
+
} else {
|
|
130
|
+
end.value = computedDateWeekSunday(start.value);
|
|
131
|
+
start.value = tempMonday;
|
|
132
|
+
}
|
|
133
|
+
clicked = false;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const weekRangeClick = () => {
|
|
137
|
+
if (visible.value) {
|
|
138
|
+
weekRangeRef.value.handleClose();
|
|
139
|
+
} else {
|
|
140
|
+
weekRangeRef.value.handleOpen();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const visibleChange = (tag) => {
|
|
144
|
+
visible.value = tag;
|
|
145
|
+
emit("visibleChange", tag);
|
|
146
|
+
};
|
|
147
|
+
const handleClose = () => {
|
|
148
|
+
weekRangeRef.value.handleClose();
|
|
149
|
+
};
|
|
150
|
+
const handleOpen = () => {
|
|
151
|
+
weekRangeRef.value.handleOpen();
|
|
152
|
+
};
|
|
153
|
+
const isHover = (cell) => {
|
|
154
|
+
const {
|
|
155
|
+
date
|
|
156
|
+
} = cell;
|
|
157
|
+
if (hoverItem.value) {
|
|
158
|
+
const monday = computedDateWeekMonday(hoverItem.value);
|
|
159
|
+
const sunday = computedDateWeekSunday(hoverItem.value);
|
|
160
|
+
const currentTime = date.getTime();
|
|
161
|
+
if (monday.getTime() <= currentTime && sunday.getTime() >= currentTime) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return false;
|
|
166
|
+
};
|
|
167
|
+
const isInHoverRange = (cell) => {
|
|
168
|
+
var _a;
|
|
169
|
+
const {
|
|
170
|
+
date
|
|
171
|
+
} = cell;
|
|
172
|
+
const curTime = date.getTime();
|
|
173
|
+
if (start.value && !end.value && hoverItem.value) {
|
|
174
|
+
const curHoverTime = (_a = hoverItem.value) == null ? void 0 : _a.getTime();
|
|
175
|
+
let tempStart = start.value;
|
|
176
|
+
let tempEnd = hoverItem.value;
|
|
177
|
+
if (curHoverTime < start.value.getTime()) {
|
|
178
|
+
tempEnd = start.value;
|
|
179
|
+
tempStart = hoverItem.value;
|
|
180
|
+
}
|
|
181
|
+
const startTime = tempStart.getTime();
|
|
182
|
+
const endTime = tempEnd.getTime();
|
|
183
|
+
if (curTime >= startTime && curTime <= endTime) {
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
return isHover(cell);
|
|
187
|
+
}
|
|
188
|
+
return false;
|
|
189
|
+
};
|
|
190
|
+
const onMouseHover = (cell) => {
|
|
191
|
+
const {
|
|
192
|
+
date
|
|
193
|
+
} = cell;
|
|
194
|
+
hoverItem.value = date;
|
|
195
|
+
};
|
|
196
|
+
const onMouseleave = () => {
|
|
197
|
+
hoverItem.value = null;
|
|
198
|
+
};
|
|
199
|
+
const isMonday = (cell) => {
|
|
200
|
+
const {
|
|
201
|
+
date
|
|
202
|
+
} = cell;
|
|
203
|
+
return date.getDay() === 1;
|
|
204
|
+
};
|
|
205
|
+
const isSunday = (cell) => {
|
|
206
|
+
const {
|
|
207
|
+
date
|
|
208
|
+
} = cell;
|
|
209
|
+
return date.getDay() === 0;
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
ns,
|
|
213
|
+
curValue,
|
|
214
|
+
weekRangeRef,
|
|
215
|
+
isInRange,
|
|
216
|
+
isInHoverRange,
|
|
217
|
+
isEnded,
|
|
218
|
+
isStarted,
|
|
219
|
+
isToday,
|
|
220
|
+
weekRangeClick,
|
|
221
|
+
cellClick,
|
|
222
|
+
visibleChange,
|
|
223
|
+
handleChange,
|
|
224
|
+
handleClose,
|
|
225
|
+
handleOpen,
|
|
226
|
+
isHover,
|
|
227
|
+
isMonday,
|
|
228
|
+
isSunday,
|
|
229
|
+
onMouseHover,
|
|
230
|
+
onMouseleave
|
|
231
|
+
};
|
|
232
|
+
},
|
|
233
|
+
render() {
|
|
234
|
+
return createVNode("div", {
|
|
235
|
+
"class": this.ns.b(),
|
|
236
|
+
"onClick": this.weekRangeClick
|
|
237
|
+
}, [createVNode(resolveComponent("el-date-picker"), {
|
|
238
|
+
"ref": "weekRangeRef",
|
|
239
|
+
"modelValue": this.curValue,
|
|
240
|
+
"onUpdate:modelValue": ($event) => this.curValue = $event,
|
|
241
|
+
"popper-class": this.ns.b("picker-pop"),
|
|
242
|
+
"type": "daterange",
|
|
243
|
+
"onChange": this.handleChange,
|
|
244
|
+
"onVisibleChange": this.visibleChange
|
|
245
|
+
}, {
|
|
246
|
+
default: (cell) => {
|
|
247
|
+
return createVNode("div", {
|
|
248
|
+
"class": [this.ns.e("cell-item"), this.ns.is("inrange", this.isInRange(cell) && !this.isEnded(cell) && !this.isStarted(cell)), this.ns.is("inhoverrange", this.isInHoverRange(cell) && !this.isEnded(cell) && !this.isStarted(cell)), this.ns.is("hover", this.isHover(cell) && !this.isEnded(cell) && !this.isStarted(cell)), this.ns.is("left", cell.column === 0), this.ns.is("right", cell.column === 6), this.ns.is("ended", this.isEnded(cell)), this.ns.is("started", this.isStarted(cell)), this.ns.is("monday", this.isMonday(cell)), this.ns.is("sunday", this.isSunday(cell))],
|
|
249
|
+
"onMouseenter": () => this.onMouseHover(cell),
|
|
250
|
+
"onMouseleave": () => this.onMouseleave(),
|
|
251
|
+
"onClick": () => this.cellClick(cell)
|
|
252
|
+
}, [createVNode("span", {
|
|
253
|
+
"class": [this.ns.em("cell-item", "text"), this.ns.is("today", this.isToday(cell))]
|
|
254
|
+
}, [cell.text])]);
|
|
255
|
+
}
|
|
256
|
+
})]);
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
export { weekRangeSelect as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-bi-year-range-select__date-panel{display:flex;height:200px}.ibiz-bi-year-range-select__date-panel--left{flex:1}.ibiz-bi-year-range-select__date-panel--left-header{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 var(--ibiz-spacing-base-loose);color:var(--ibiz-color-primary-light-active);border-bottom:1px solid var(--ibiz-color-border)}.ibiz-bi-year-range-select__date-panel--left-header svg{color:var(--ibiz-color-black);cursor:pointer}.ibiz-bi-year-range-select__date-panel--left-header svg:hover{color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-content{padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base-loose)}.ibiz-bi-year-range-select__date-panel--left-item{position:relative;display:inline-flex;align-items:center;justify-content:center;width:48px;height:var(--ibiz-height-control-default);margin-top:var(--ibiz-spacing-extra-tight);margin-left:var(--ibiz-spacing-loose);cursor:pointer;border-radius:var(--ibiz-border-radius-small)}.ibiz-bi-year-range-select__date-panel--left-item::before{position:absolute;right:0;display:inline-block;width:calc(100% + var(--ibiz-spacing-loose));height:calc(100% + var(--ibiz-spacing-extra-tight));content:""}.ibiz-bi-year-range-select__date-panel--left-item.is-include{background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-year-range-select__date-panel--left-item.is-selected{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-item.is-selected.is-curyear{color:var(--ibiz-color-primary-text)}.ibiz-bi-year-range-select__date-panel--left-item.is-hoverinclude{background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-year-range-select__date-panel--left-item.is-hoverinclude.is-include{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-item.is-hoverinclude.is-hover{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-item.is-hoverinclude.is-selected{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-item.is-hover{color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-item.is-hover.is-selected{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--left-item.is-curyear{font-weight:700;color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right{flex:1}.ibiz-bi-year-range-select__date-panel--right-header{display:flex;align-items:center;justify-content:space-between;height:40px;padding:0 var(--ibiz-spacing-base-loose);color:var(--ibiz-color-primary-light-active);border-bottom:1px solid var(--ibiz-color-border)}.ibiz-bi-year-range-select__date-panel--right-header svg{color:var(--ibiz-color-black);cursor:pointer}.ibiz-bi-year-range-select__date-panel--right-header svg:hover{color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-content{padding:var(--ibiz-spacing-tight) var(--ibiz-spacing-base-loose)}.ibiz-bi-year-range-select__date-panel--right-item{position:relative;display:inline-flex;align-items:center;justify-content:center;width:48px;height:var(--ibiz-height-control-default);margin-top:var(--ibiz-spacing-extra-tight);margin-left:var(--ibiz-spacing-loose);cursor:pointer;border-radius:var(--ibiz-border-radius-small)}.ibiz-bi-year-range-select__date-panel--right-item::before{position:absolute;right:0;display:inline-block;width:calc(100% + var(--ibiz-spacing-loose));height:calc(100% + var(--ibiz-spacing-extra-tight));content:""}.ibiz-bi-year-range-select__date-panel--right-item.is-include{background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-year-range-select__date-panel--right-item.is-selected{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-item.is-selected.is-curyear{color:var(--ibiz-color-primary-text)}.ibiz-bi-year-range-select__date-panel--right-item.is-hoverinclude{background:var(--ibiz-color-secondary-light-default)}.ibiz-bi-year-range-select__date-panel--right-item.is-hoverinclude.is-include{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-item.is-hoverinclude.is-hover{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-item.is-hoverinclude.is-selected{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-item.is-hover{color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-item.is-hover.is-selected{color:var(--ibiz-color-primary-text);background-color:var(--ibiz-color-primary)}.ibiz-bi-year-range-select__date-panel--right-item.is-curyear{font-weight:700;color:var(--ibiz-color-primary)}
|