From 53c7de78b0c47fa81334cc2f142b3c09f42c594a Mon Sep 17 00:00:00 2001 From: Justineo Date: Wed, 13 Dec 2023 21:34:20 +0800 Subject: [PATCH] refactor!: use theme prop instead of theme:d22 ui, and add back prefix mixin --- packages/veui/demo/cases/ConfigProvider.vue | 7 +- packages/veui/src/components/Accordion.vue | 3 +- packages/veui/src/components/Alert.vue | 2 + packages/veui/src/components/AlertBox.vue | 2 + packages/veui/src/components/Anchor.vue | 3 +- .../components/Autocomplete/Autocomplete.vue | 5 +- packages/veui/src/components/Badge.vue | 2 + packages/veui/src/components/Breadcrumb.vue | 3 +- .../veui/src/components/BreadcrumbItem.vue | 3 +- packages/veui/src/components/Button.vue | 3 +- packages/veui/src/components/ButtonGroup.vue | 3 +- .../veui/src/components/Calendar/Calendar.vue | 2 + .../veui/src/components/Carousel/Carousel.vue | 3 +- .../src/components/Carousel/_Indicator.vue | 5 +- .../veui/src/components/Carousel/_Slide.vue | 1 - .../veui/src/components/Carousel/_mixin.js | 4 +- .../veui/src/components/Cascader/Cascader.vue | 4 +- .../src/components/Cascader/CascaderPane.vue | 2 + .../veui/src/components/CheckButtonGroup.vue | 2 + packages/veui/src/components/Checkbox.vue | 2 + .../veui/src/components/CheckboxGroup.vue | 2 + packages/veui/src/components/Collapse.vue | 2 + packages/veui/src/components/ConfirmBox.vue | 2 + packages/veui/src/components/DatePicker.vue | 2 + packages/veui/src/components/Dialog.vue | 11 +- packages/veui/src/components/Drawer.vue | 4 +- packages/veui/src/components/Dropdown.vue | 2 + packages/veui/src/components/Embedded.vue | 5 +- packages/veui/src/components/Empty.vue | 3 +- packages/veui/src/components/FilterPanel.vue | 3 +- packages/veui/src/components/Form/Field.vue | 2 + .../veui/src/components/Form/Fieldset.vue | 3 +- packages/veui/src/components/Form/Form.vue | 2 + .../veui/src/components/Grid/GridColumn.vue | 5 +- .../src/components/Grid/GridContainer.vue | 5 +- packages/veui/src/components/Grid/GridRow.vue | 5 +- packages/veui/src/components/Icon.vue | 4 +- packages/veui/src/components/Input.vue | 2 + packages/veui/src/components/InputGroup.vue | 3 +- packages/veui/src/components/Label.vue | 3 +- .../veui/src/components/Layout/Content.vue | 5 +- .../veui/src/components/Layout/Footer.vue | 5 +- .../veui/src/components/Layout/Header.vue | 5 +- .../veui/src/components/Layout/Layout.vue | 5 +- .../veui/src/components/Layout/Sidebar.vue | 2 + packages/veui/src/components/Lightbox.vue | 2 + packages/veui/src/components/Link.vue | 3 +- packages/veui/src/components/Loading.vue | 3 +- packages/veui/src/components/LoadingBar.vue | 3 +- packages/veui/src/components/Menu/_mixin.js | 3 +- packages/veui/src/components/Message.vue | 3 +- packages/veui/src/components/NumberInput.vue | 2 + packages/veui/src/components/Overlay.vue | 8 +- packages/veui/src/components/Pagination.vue | 2 + packages/veui/src/components/Popover.vue | 3 +- packages/veui/src/components/Progress.vue | 3 +- packages/veui/src/components/PromptBox.vue | 2 + packages/veui/src/components/Radio.vue | 2 + .../veui/src/components/RadioButtonGroup.vue | 2 + packages/veui/src/components/RadioGroup.vue | 2 + packages/veui/src/components/Rating.vue | 2 + packages/veui/src/components/RegionPicker.vue | 3 +- packages/veui/src/components/Schedule.vue | 3 +- packages/veui/src/components/SearchBox.vue | 2 + .../veui/src/components/Select/Option.vue | 3 +- .../src/components/Select/OptionGroup.vue | 2 + .../veui/src/components/Select/Select.vue | 2 + packages/veui/src/components/Slider.vue | 2 + packages/veui/src/components/Span.vue | 6 +- packages/veui/src/components/Stack.vue | 6 +- packages/veui/src/components/Steps.vue | 3 +- packages/veui/src/components/Switch.vue | 2 + packages/veui/src/components/Table/Table.vue | 4 +- packages/veui/src/components/Table/_Body.js | 4 +- .../veui/src/components/Table/_ColGroup.js | 4 +- packages/veui/src/components/Table/_Foot.js | 4 +- packages/veui/src/components/Table/_Head.js | 4 +- .../veui/src/components/Table/_HeadCell.js | 4 +- packages/veui/src/components/Table/_Row.js | 6 +- .../veui/src/components/Table/_Sorter.vue | 4 +- packages/veui/src/components/Tabs/Tab.vue | 4 +- packages/veui/src/components/Tabs/Tabs.vue | 4 +- packages/veui/src/components/Tag.vue | 2 + packages/veui/src/components/TagInput.vue | 2 + packages/veui/src/components/Textarea.vue | 2 + .../src/components/TimePicker/TimePicker.vue | 2 + packages/veui/src/components/Toast.vue | 2 + packages/veui/src/components/ToastList.vue | 4 +- packages/veui/src/components/Tooltip.vue | 2 + .../veui/src/components/Transfer/Transfer.vue | 8 +- .../components/Transfer/_CandidatePanel.vue | 9 +- .../components/Transfer/_SelectedPanel.vue | 10 +- packages/veui/src/components/Tree/Tree.vue | 2 + .../src/components/Tree/_AbstractTree.vue | 6 +- .../veui/src/components/Uploader/Uploader.vue | 2 + .../src/components/Uploader/_Controls.vue | 4 +- .../src/components/Uploader/_FileUploader.vue | 4 +- .../components/Uploader/_MediaUploader.vue | 4 +- .../veui/src/components/Uploader/_mixin.js | 6 +- .../veui/src/components/_SearchResult.vue | 4 +- .../veui/src/components/_SelectTrigger.vue | 4 +- .../veui/src/directives/drag/SortHandler.js | 2 +- packages/veui/src/managers/context.js | 104 +++++++++--------- packages/veui/src/managers/tooltip.js | 2 +- packages/veui/src/mixins/carousel.js | 3 +- packages/veui/src/mixins/config.js | 41 +++++-- packages/veui/src/mixins/prefix.js | 43 ++++++++ packages/veui/src/mixins/ui.js | 75 +++---------- .../specs/components/ConfigProvider.spec.js | 9 ++ .../veui/test/unit/specs/mixins/ui.spec.js | 15 +-- 110 files changed, 393 insertions(+), 254 deletions(-) create mode 100644 packages/veui/src/mixins/prefix.js diff --git a/packages/veui/demo/cases/ConfigProvider.vue b/packages/veui/demo/cases/ConfigProvider.vue index b2f4571ad..6f4aa45f6 100644 --- a/packages/veui/demo/cases/ConfigProvider.vue +++ b/packages/veui/demo/cases/ConfigProvider.vue @@ -21,11 +21,7 @@
- + OK @@ -172,6 +168,7 @@ export default { { label: '全中有高亮', value: 'all_h' } ], themes: [ + { label: '不设置', value: undefined }, { label: 'D20', value: '' }, { label: 'D22', value: 'd22' }, { label: 'AI', value: 'ai' } diff --git a/packages/veui/src/components/Accordion.vue b/packages/veui/src/components/Accordion.vue index bf3e4ddc8..6736e3ced 100644 --- a/packages/veui/src/components/Accordion.vue +++ b/packages/veui/src/components/Accordion.vue @@ -7,6 +7,7 @@ diff --git a/packages/veui/src/components/Label.vue b/packages/veui/src/components/Label.vue index 52d8ab81e..7f31193b6 100644 --- a/packages/veui/src/components/Label.vue +++ b/packages/veui/src/components/Label.vue @@ -7,12 +7,13 @@ diff --git a/packages/veui/src/components/Layout/Footer.vue b/packages/veui/src/components/Layout/Footer.vue index e5f7d7fd7..cf9320935 100644 --- a/packages/veui/src/components/Layout/Footer.vue +++ b/packages/veui/src/components/Layout/Footer.vue @@ -10,12 +10,11 @@ diff --git a/packages/veui/src/components/Stack.vue b/packages/veui/src/components/Stack.vue index ecc60168a..0d468b4d7 100644 --- a/packages/veui/src/components/Stack.vue +++ b/packages/veui/src/components/Stack.vue @@ -1,5 +1,5 @@