plain-design 1.0.0-beta.4 → 1.0.0-beta.40
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/plain-design.commonjs.min.js +3 -3
- package/dist/plain-design.min.css +37 -29
- package/dist/plain-design.min.js +3 -3
- package/dist/report.html +5 -5
- package/package.json +9 -8
- package/src/packages/build.ts +2 -10
- package/src/packages/components/$object/createObjectService.tsx +31 -20
- package/src/packages/components/$object/object.service.utils.ts +7 -3
- package/src/packages/components/$previewer/ImagePreviewerFixedContainer.tsx +108 -0
- package/src/packages/components/$previewer/image-previewer-fixed-container.scss +18 -0
- package/src/packages/components/$previewer/index.tsx +52 -0
- package/src/packages/components/Alert/alert.scss +3 -3
- package/src/packages/components/Application/service/useApplicationService.tsx +2 -0
- package/src/packages/components/Application/theme/theme.ts +3 -3
- package/src/packages/components/ArrowStepGroup/arrow-step.scss +4 -4
- package/src/packages/components/AutoTable/filter/useTableOption.filter.form.tsx +1 -0
- package/src/packages/components/AutoTable/use/useTableOption.methods.tsx +2 -0
- package/src/packages/components/AutoTable/use/useTableOption.state.tsx +1 -0
- package/src/packages/components/AutoTable/use/useTableOption.table.tsx +3 -3
- package/src/packages/components/AutoTable/utils/TableOption.space.tsx +4 -0
- package/src/packages/components/Badge/badge.scss +1 -1
- package/src/packages/components/Button/button.scss +2 -2
- package/src/packages/components/Card/card.scss +1 -1
- package/src/packages/components/Carousel/carousel.scss +391 -0
- package/src/packages/components/Carousel/index.tsx +569 -22
- package/src/packages/components/CarouselItem/index.tsx +77 -0
- package/src/packages/components/CascadePanel/list/CascadeListPanelItem.tsx +3 -3
- package/src/packages/components/CheckboxInner/checkbox-inner.scss +1 -1
- package/src/packages/components/ColorPicker/sub/ColorSlider.tsx +8 -5
- package/src/packages/components/ColorPicker/sub/ColorSvPanel.tsx +7 -4
- package/src/packages/components/DatePicker/date.scss +1 -1
- package/src/packages/components/Dialog/dialog.scss +1 -1
- package/src/packages/components/Dialog/index.tsx +4 -3
- package/src/packages/components/Dialog/useDialogMovable.tsx +7 -4
- package/src/packages/components/Dialog/utils/dialog.mouse.ts +4 -2
- package/src/packages/components/Dropdown/dropdown.public.scss +10 -0
- package/src/packages/components/Dropdown/dropdown.utils.tsx +3 -1
- package/src/packages/components/Dropdown/index.tsx +2 -2
- package/src/packages/components/DropdownOption/index.tsx +3 -3
- package/src/packages/components/DropdownSeparator/index.tsx +8 -0
- package/src/packages/components/FilterFormMultiple/index.tsx +31 -10
- package/src/packages/components/Image/image.scss +3 -3
- package/src/packages/components/ImagePreviewer/ImagePreviewer.tsx +574 -0
- package/src/packages/components/ImagePreviewer/ImagePreviewerButtonBar.tsx +140 -0
- package/src/packages/components/ImagePreviewer/ImagePreviewerCarouselImage.tsx +54 -0
- package/src/packages/components/ImagePreviewer/ImagePreviewerGallery.tsx +202 -0
- package/src/packages/components/ImagePreviewer/PreviewerLoading.tsx +26 -0
- package/src/packages/components/ImagePreviewer/image-previewer.scss +244 -0
- package/src/packages/components/ImagePreviewer/image-previewer.utils.tsx +135 -0
- package/src/packages/components/ImagePreviewer/index.tsx +5 -0
- package/src/packages/components/ImagePreviewer/previewer-loading.scss +52 -0
- package/src/packages/components/Input/index.scss +2 -2
- package/src/packages/components/Input/useMultipleInput.tsx +2 -76
- package/src/packages/components/Input/useTextareaInput.tsx +10 -5
- package/src/packages/components/Input/uses/useInputHooks.tsx +11 -11
- package/src/packages/components/InputNumber/NumberResize.tsx +20 -3
- package/src/packages/components/InputNumber/input-number.utils.tsx +7 -5
- package/src/packages/components/InputNumber/number.scss +10 -1
- package/src/packages/components/InputNumber/useInputNumber.public.tsx +25 -6
- package/src/packages/components/Layout/index.tsx +31 -0
- package/src/packages/components/Layout/layout.scss +227 -0
- package/src/packages/components/Layout/layout.utils.ts +3 -0
- package/src/packages/components/LayoutSection/index.tsx +67 -0
- package/src/packages/components/LayoutSection/useLayoutSectionResizer.tsx +184 -0
- package/src/packages/components/LoadingMask/index.tsx +1 -1
- package/src/packages/components/PageThemeUtils/index.tsx +54 -14
- package/src/packages/components/Pagination/pagination.scss +2 -2
- package/src/packages/components/PlcOv/index.tsx +14 -4
- package/src/packages/components/Popup/index.tsx +24 -10
- package/src/packages/components/ProgressBar/progress-bar.scss +1 -1
- package/src/packages/components/Rate/index.tsx +3 -1
- package/src/packages/components/Scroll/HorizontalScrollbar.tsx +7 -3
- package/src/packages/components/Scroll/VerticalScrollbar.tsx +7 -3
- package/src/packages/components/Scroll/index.tsx +6 -6
- package/src/packages/components/Select/createPublicSelectRender.tsx +1 -1
- package/src/packages/components/Slider/slider.scss +1 -1
- package/src/packages/components/Slider/useSliderDotDragier.tsx +7 -4
- package/src/packages/components/SortList/index.tsx +191 -0
- package/src/packages/components/SortList/sort-list.scss +11 -0
- package/src/packages/components/StackCard/index.tsx +416 -0
- package/src/packages/components/StackCard/stack-card.scss +40 -0
- package/src/packages/components/StackCardItem/index.tsx +24 -0
- package/src/packages/components/StepGroup/step-group.scss +9 -9
- package/src/packages/components/TabGroup/TabsInner.tsx +5 -3
- package/src/packages/components/TabGroup/header/horizontal/tabs-header-horizontal.scss +0 -1
- package/src/packages/components/TabGroup/index.tsx +5 -1
- package/src/packages/components/TabGroup/tabs.scss +3 -0
- package/src/packages/components/Table/standard/PlcExpand.tsx +12 -20
- package/src/packages/components/Table/standard/PlcOperation/PlcOperation.tsx +1 -1
- package/src/packages/components/Table/standard/PlcOperation/outer-operation.scss +2 -0
- package/src/packages/components/Table/standard/PlcTree/RenderPlcTreeNode.tsx +2 -1
- package/src/packages/components/Table/table/Table.tsx +10 -3
- package/src/packages/components/Table/table/body/row.tsx +1 -1
- package/src/packages/components/Table/table/body/useCellValue.tsx +10 -6
- package/src/packages/components/Table/table/head/useHeadCellResize.ts +8 -3
- package/src/packages/components/Table/table/table.scss +2 -1
- package/src/packages/components/Table/table/use/useTableDraggier.col.tsx +10 -5
- package/src/packages/components/Table/table/use/useTableDraggier.row.tsx +12 -7
- package/src/packages/components/Table/table/use/useTableFormEditor.tsx +1 -1
- package/src/packages/components/Table/table/use/useTableModifyEditor.tsx +1 -1
- package/src/packages/components/Table/table/utils/createTableHooks.ts +4 -2
- package/src/packages/components/Table/table/utils/table.utils.ts +6 -1
- package/src/packages/components/ThemeEditor/index.tsx +173 -0
- package/src/packages/components/ThemeEditor/theme-editor.scss +105 -0
- package/src/packages/components/ThemePrimaryColors/index.ts +5 -0
- package/src/packages/components/Tree/RenderTreeNode.tsx +8 -3
- package/src/packages/components/Tree/index.tsx +4 -3
- package/src/packages/components/Tree/tree.scss +42 -9
- package/src/packages/components/TreeCore/TreeCore.type.tsx +2 -0
- package/src/packages/components/TreeCore/createTreeCore.tsx +5 -1
- package/src/packages/components/TreeCore/createTreeDraggier.tsx +70 -56
- package/src/packages/components/TreeCore/createTreeMethods.tsx +1 -0
- package/src/packages/components/TreeCore/createTreeProps.ts +2 -1
- package/src/packages/components/TreeNodeWithMenu/index.tsx +91 -0
- package/src/packages/components/TreeNodeWithMenu/tree-node-with-menu.scss +39 -0
- package/src/packages/components/TreeNodeWithMenu/treeNodeWithMenu.utils.ts +12 -0
- package/src/packages/components/VirtualList/index.tsx +15 -6
- package/src/packages/components/VirtualList/useVirtualList.tsx +182 -107
- package/src/packages/components/VirtualList/virtual-list.scss +31 -17
- package/src/packages/components/VirtualTable/index.tsx +7 -7
- package/src/packages/components/VirtualTable/virtual-table.scss +1 -2
- package/src/packages/components/createProvider/index.ts +5 -0
- package/src/packages/components/nextPopupId/index.ts +5 -0
- package/src/packages/components/useDialog/DialogService.tsx +13 -1
- package/src/packages/components/useDialog/index.tsx +1 -1
- package/src/packages/components/useImage/ImageService.tsx +7 -4
- package/src/packages/components/useMessage/Message.tsx +5 -1
- package/src/packages/components/useMessage/message.scss +5 -1
- package/src/packages/components/useNotice/notice.scss +2 -2
- package/src/packages/components/usePopup/PopupItem.tsx +45 -26
- package/src/packages/components/usePopup/popup-item.scss +5 -1
- package/src/packages/components/usePopup/usePopupManager.tsx +2 -1
- package/src/packages/components/usePopup/utils/popup.utils.ts +2 -1
- package/src/packages/components/usePopupManager/index.ts +5 -0
- package/src/packages/components/usePopupTrigger/index.tsx +5 -0
- package/src/packages/components/useReferenceTrigger/index.tsx +5 -0
- package/src/packages/components/useTooltip/index.tsx +2 -0
- package/src/packages/components/useWatchAutoClear/index.ts +5 -0
- package/src/packages/entry.tsx +48 -2
- package/src/packages/i18n/lang/en-us.ts +36 -0
- package/src/packages/i18n/lang/zh-cn.ts +36 -0
- package/src/packages/uses/useDragHorizontalScroll.ts +82 -0
- package/src/packages/uses/useEdit.ts +5 -1
- package/src/packages/uses/useStyle.tsx +10 -2
- package/src/packages/utils/ClientZoom.ts +24 -2
- package/src/packages/utils/ComponentUtils.ts +10 -0
- package/src/packages/utils/buildCycleIndexList.ts +31 -0
- package/src/packages/utils/getDeviceInfo.ts +44 -44
- package/src/packages/utils/getRectAutoFormat.ts +9 -0
- package/src/packages/utils/inheritSlots.ts +28 -0
- package/src/packages/utils/notNull.ts +9 -0
- package/src/packages/utils/useMove.tsx +10 -4
- package/src/packages/components/CarouselGroup/carousel.scss +0 -143
- package/src/packages/components/CarouselGroup/index.tsx +0 -274
- package/src/pages/data/address.json +0 -39317
- package/src/pages/data/data-1.json +0 -754
- package/src/pages/data/data-2.json +0 -3006
- package/src/pages/data/data-200.json +0 -5206
- package/src/pages/data/data-2000.json +0 -51954
- package/src/pages/data/data-50.json +0 -2075
- package/src/pages/data/data.json +0 -30002
- package/src/pages/data/demo.json +0 -1702
- package/src/pages/data/mock.database.js +0 -43
- package/src/pages/data/mock.js +0 -141
- package/src/pages/data/tree.data.json +0 -87
- package/src/pages/env/config/local.js +0 -3
- package/src/pages/env/config/prod.js +0 -3
- package/src/pages/env/config/undefined.js +0 -1
- package/src/pages/env/env.d.ts +0 -4
- package/src/pages/env/index.ts +0 -1
- package/src/pages/history/createHistory.ts +0 -94
- package/src/pages/history/history.utils.ts +0 -64
- package/src/pages/index/App.tsx +0 -17
- package/src/pages/index/Demo/DemoLine.tsx +0 -23
- package/src/pages/index/Demo/DemoRow.scss +0 -128
- package/src/pages/index/Demo/DemoRow.tsx +0 -71
- package/src/pages/index/Demo/DemoRow.utils.ts +0 -23
- package/src/pages/index/Demo/DemoRowController.tsx +0 -45
- package/src/pages/index/Demo/index.ts +0 -8
- package/src/pages/index/app.scss +0 -192
- package/src/pages/index/components/AutoTable/AutoHeightAutoRow.tsx +0 -51
- package/src/pages/index/components/AutoTable/AutoHeightFixedRow.tsx +0 -50
- package/src/pages/index/components/AutoTable/AutoTableBasicUsage.tsx +0 -75
- package/src/pages/index/components/AutoTable/AutoTableCascade.tsx +0 -99
- package/src/pages/index/components/AutoTable/AutoTableDefaultSearch.tsx +0 -73
- package/src/pages/index/components/AutoTable/AutoTableFiles.tsx +0 -26
- package/src/pages/index/components/AutoTable/AutoTableFill.tsx +0 -51
- package/src/pages/index/components/AutoTable/AutoTableGroupUsage.tsx +0 -71
- package/src/pages/index/components/AutoTable/AutoTableObjectPicker.tsx +0 -181
- package/src/pages/index/components/AutoTable/AutoTableOvList.tsx +0 -80
- package/src/pages/index/components/AutoTable/AutoTableProductList.tsx +0 -98
- package/src/pages/index/components/AutoTable/AutoTableRowFormatter.tsx +0 -58
- package/src/pages/index/components/AutoTable/FixedHeightAutoRow.tsx +0 -50
- package/src/pages/index/components/AutoTable/FixedHeightFixedRow.tsx +0 -49
- package/src/pages/index/components/bus/DemoAddress.tsx +0 -181
- package/src/pages/index/components/bus/DemoAddressCascade.tsx +0 -132
- package/src/pages/index/components/bus/DemoFilter.tsx +0 -184
- package/src/pages/index/components/columns/DemoPlcAddress.tsx +0 -161
- package/src/pages/index/components/columns/DemoPlcDate.tsx +0 -363
- package/src/pages/index/components/columns/DemoPlcSelect.tsx +0 -505
- package/src/pages/index/components/columns/DemoPlcTime.tsx +0 -293
- package/src/pages/index/components/columns/DemoTableColumns.tsx +0 -88
- package/src/pages/index/components/form/DemoFormBasic.tsx +0 -516
- package/src/pages/index/components/form/DemoFormBlur.tsx +0 -204
- package/src/pages/index/components/form/DemoFormDynamicFields.tsx +0 -54
- package/src/pages/index/components/form/DemoFormEditControl.tsx +0 -164
- package/src/pages/index/components/form/DemoFormElement.tsx +0 -207
- package/src/pages/index/components/form/DemoFormLayout.scss +0 -7
- package/src/pages/index/components/form/DemoFormLayout.tsx +0 -311
- package/src/pages/index/components/form/DemoFormSimplify.tsx +0 -587
- package/src/pages/index/components/form/DemoFormSize.tsx +0 -274
- package/src/pages/index/components/form/DemoFormVertical.tsx +0 -280
- package/src/pages/index/components/normal/DemoAlert.tsx +0 -66
- package/src/pages/index/components/normal/DemoBadge.tsx +0 -53
- package/src/pages/index/components/normal/DemoButton.tsx +0 -300
- package/src/pages/index/components/normal/DemoCard.tsx +0 -176
- package/src/pages/index/components/normal/DemoCarousel.tsx +0 -125
- package/src/pages/index/components/normal/DemoCascade.tsx +0 -880
- package/src/pages/index/components/normal/DemoCheckbox.scss +0 -24
- package/src/pages/index/components/normal/DemoCheckbox.tsx +0 -294
- package/src/pages/index/components/normal/DemoCollapse.tsx +0 -104
- package/src/pages/index/components/normal/DemoColor.scss +0 -20
- package/src/pages/index/components/normal/DemoColor.tsx +0 -82
- package/src/pages/index/components/normal/DemoColorPicker.tsx +0 -163
- package/src/pages/index/components/normal/DemoDate.tsx +0 -443
- package/src/pages/index/components/normal/DemoDialog.tsx +0 -507
- package/src/pages/index/components/normal/DemoDropdown.tsx +0 -463
- package/src/pages/index/components/normal/DemoGrid.scss +0 -26
- package/src/pages/index/components/normal/DemoGrid.tsx +0 -181
- package/src/pages/index/components/normal/DemoIcon.tsx +0 -39
- package/src/pages/index/components/normal/DemoImage.tsx +0 -122
- package/src/pages/index/components/normal/DemoInput.scss +0 -0
- package/src/pages/index/components/normal/DemoInput.tsx +0 -790
- package/src/pages/index/components/normal/DemoKeepAlive.tsx +0 -505
- package/src/pages/index/components/normal/DemoList.scss +0 -15
- package/src/pages/index/components/normal/DemoList.tsx +0 -82
- package/src/pages/index/components/normal/DemoLoading.tsx +0 -83
- package/src/pages/index/components/normal/DemoNumber.tsx +0 -266
- package/src/pages/index/components/normal/DemoPagination.tsx +0 -164
- package/src/pages/index/components/normal/DemoPopup.tsx +0 -695
- package/src/pages/index/components/normal/DemoProgress.tsx +0 -133
- package/src/pages/index/components/normal/DemoRadio.scss +0 -16
- package/src/pages/index/components/normal/DemoRadio.tsx +0 -188
- package/src/pages/index/components/normal/DemoRate.tsx +0 -77
- package/src/pages/index/components/normal/DemoScroll.scss +0 -22
- package/src/pages/index/components/normal/DemoScroll.tsx +0 -300
- package/src/pages/index/components/normal/DemoSegment.tsx +0 -71
- package/src/pages/index/components/normal/DemoSelect.tsx +0 -819
- package/src/pages/index/components/normal/DemoSlider.tsx +0 -128
- package/src/pages/index/components/normal/DemoStep.scss +0 -18
- package/src/pages/index/components/normal/DemoStep.tsx +0 -291
- package/src/pages/index/components/normal/DemoTab.tsx +0 -338
- package/src/pages/index/components/normal/DemoTag.tsx +0 -100
- package/src/pages/index/components/normal/DemoTime.tsx +0 -403
- package/src/pages/index/components/normal/DemoToggle.tsx +0 -56
- package/src/pages/index/components/normal/DemoTooltip.tsx +0 -120
- package/src/pages/index/components/normal/DemoTree.tsx +0 -1099
- package/src/pages/index/components/normal/DemoUpload.tsx +0 -484
- package/src/pages/index/components/normal/DemoVirtualList.tsx +0 -378
- package/src/pages/index/components/service/DemoDialogService.tsx +0 -248
- package/src/pages/index/components/service/DemoFileService.tsx +0 -110
- package/src/pages/index/components/service/DemoMessageService.tsx +0 -100
- package/src/pages/index/components/service/DemoNoticeService.tsx +0 -99
- package/src/pages/index/components/service/DemoPopupService.tsx +0 -322
- package/src/pages/index/components/table/DemoPlcOperation.tsx +0 -307
- package/src/pages/index/components/table/DemoTableBasic.tsx +0 -220
- package/src/pages/index/components/table/DemoTableCheck.tsx +0 -78
- package/src/pages/index/components/table/DemoTableClassAndStyle.scss +0 -18
- package/src/pages/index/components/table/DemoTableClassAndStyle.tsx +0 -112
- package/src/pages/index/components/table/DemoTableColDraggable.tsx +0 -80
- package/src/pages/index/components/table/DemoTableEdit.tsx +0 -136
- package/src/pages/index/components/table/DemoTableExpand.tsx +0 -181
- package/src/pages/index/components/table/DemoTableFixed.tsx +0 -131
- package/src/pages/index/components/table/DemoTableFormatter.tsx +0 -66
- package/src/pages/index/components/table/DemoTableOverflowTooltip.tsx +0 -67
- package/src/pages/index/components/table/DemoTableRowDraggable.tsx +0 -106
- package/src/pages/index/components/table/DemoTableSlots.tsx +0 -153
- package/src/pages/index/components/table/DemoTableSpan.tsx +0 -167
- package/src/pages/index/components/table/DemoTableTree.tsx +0 -976
- package/src/pages/index/components/table/DemoVirtualTable.tsx +0 -274
- package/src/pages/index/components/test/DemoI18n.tsx +0 -27
- package/src/pages/index/components/test/DemoI18n2.jsx +0 -11
- package/src/pages/index/home/AppContent.tsx +0 -69
- package/src/pages/index/home/AppHead.tsx +0 -104
- package/src/pages/index/home/AppHome.tsx +0 -16
- package/src/pages/index/home/AppMenu.tsx +0 -38
- package/src/pages/index/home/menus.tsx +0 -217
- package/src/pages/index/main.tsx +0 -23
- package/src/pages/index/nav/$nav.ts +0 -41
- package/src/pages/index/pages.d.ts +0 -6
- package/src/pages/libs/iconfont-fontcls/demo.css +0 -539
- package/src/pages/libs/iconfont-fontcls/demo_index.html +0 -303
- package/src/pages/libs/iconfont-fontcls/iconfont.css +0 -35
- package/src/pages/libs/iconfont-fontcls/iconfont.js +0 -1
- package/src/pages/libs/iconfont-fontcls/iconfont.json +0 -44
- package/src/pages/libs/iconfont-fontcls/iconfont.ttf +0 -0
- package/src/pages/libs/iconfont-fontcls/iconfont.woff +0 -0
- package/src/pages/libs/iconfont-fontcls/iconfont.woff2 +0 -0
- package/src/pages/libs/iconfont-symbol/demo.css +0 -539
- package/src/pages/libs/iconfont-symbol/demo_index.html +0 -303
- package/src/pages/libs/iconfont-symbol/iconfont.css +0 -35
- package/src/pages/libs/iconfont-symbol/iconfont.js +0 -1
- package/src/pages/libs/iconfont-symbol/iconfont.json +0 -44
- package/src/pages/libs/iconfont-symbol/iconfont.ttf +0 -0
- package/src/pages/libs/iconfont-symbol/iconfont.woff +0 -0
- package/src/pages/libs/iconfont-symbol/iconfont.woff2 +0 -0
- package/src/pages/libs/install.iconfont-fontcls.tsx +0 -11
- package/src/pages/libs/install.iconfont-symbol.scss +0 -7
- package/src/pages/libs/install.iconfont-symbol.tsx +0 -14
- package/src/pages/module/address.ts +0 -27
- package/src/pages/module/http.ts +0 -24
- package/src/pages/module/index.ts +0 -19
- package/src/pages/module/object.ts +0 -5
- package/src/pages/module/ov.tsx +0 -13
- package/src/pages/module/upload.ts +0 -9
- package/src/pages/module/useTableOption.ts +0 -28
@@ -1,24 +0,0 @@
|
|
1
|
-
.demo-checkbox-row {
|
2
|
-
& > * {
|
3
|
-
margin-right: 1em;
|
4
|
-
}
|
5
|
-
}
|
6
|
-
|
7
|
-
.demo-checkbox-custom-item {
|
8
|
-
display: inline-flex;
|
9
|
-
height: 80px;
|
10
|
-
width: 80px;
|
11
|
-
border-radius: 4px;
|
12
|
-
border: solid 1px plv(border-color);
|
13
|
-
align-items: center;
|
14
|
-
justify-content: center;
|
15
|
-
background-color: plv(background-lite);
|
16
|
-
cursor: pointer;
|
17
|
-
user-select: none;
|
18
|
-
transition: all 300ms ease;
|
19
|
-
|
20
|
-
&.demo-checkbox-custom-item-active {
|
21
|
-
background-color: plv(primary-7);
|
22
|
-
color: white;
|
23
|
-
}
|
24
|
-
}
|
@@ -1,294 +0,0 @@
|
|
1
|
-
import {classnames, designPage, reactive} from "plain-design-composition";
|
2
|
-
import {DemoRow} from "../../Demo/DemoRow";
|
3
|
-
import {Button, Checkbox, CheckboxGroup} from "../../../../packages";
|
4
|
-
import './DemoCheckbox.scss';
|
5
|
-
import {DemoLine} from "../../Demo/DemoLine";
|
6
|
-
|
7
|
-
export const demo1 = designPage(() => {
|
8
|
-
|
9
|
-
const state = reactive({ flag: null });
|
10
|
-
|
11
|
-
return () => (
|
12
|
-
<DemoRow title="基本用法">
|
13
|
-
<Checkbox v-model={state.flag} label="订阅邮件"/>
|
14
|
-
<br/>
|
15
|
-
<div>{String(state.flag)}</div>
|
16
|
-
</DemoRow>
|
17
|
-
);
|
18
|
-
});
|
19
|
-
|
20
|
-
export const demo2 = designPage(() => {
|
21
|
-
|
22
|
-
const state = reactive({ flag: true });
|
23
|
-
|
24
|
-
return () => (
|
25
|
-
<DemoRow title="状态">
|
26
|
-
<Checkbox v-model={state.flag} label="Primary" status="primary"/>
|
27
|
-
<Checkbox v-model={state.flag} label="Success" status="success"/>
|
28
|
-
<Checkbox v-model={state.flag} label="Warn" status="warn"/>
|
29
|
-
<Checkbox v-model={state.flag} label="Error" status="error"/>
|
30
|
-
</DemoRow>
|
31
|
-
);
|
32
|
-
});
|
33
|
-
export const demo3 = designPage(() => {
|
34
|
-
|
35
|
-
const state = reactive({ flag: true });
|
36
|
-
|
37
|
-
return () => (
|
38
|
-
<DemoRow title="禁用状态">
|
39
|
-
<Checkbox v-model={state.flag} label="Primary" status="primary" disabled/>
|
40
|
-
<Checkbox v-model={state.flag} label="Success" status="success" disabled/>
|
41
|
-
<Checkbox v-model={state.flag} label="Warn" status="warn" disabled/>
|
42
|
-
<Checkbox v-model={state.flag} label="Error" status="error" disabled/>
|
43
|
-
<Checkbox label="uncheck" status="primary" disabled/>
|
44
|
-
</DemoRow>
|
45
|
-
);
|
46
|
-
});
|
47
|
-
|
48
|
-
export const demo4 = designPage(() => {
|
49
|
-
|
50
|
-
const state = reactive({ flag: null });
|
51
|
-
|
52
|
-
return () => (
|
53
|
-
<DemoRow title="真假值">
|
54
|
-
<Checkbox v-model={state.flag} label="订阅邮件" trueValue="Y" falseValue="N"/>
|
55
|
-
<br/>
|
56
|
-
<div>{String(state.flag)}</div>
|
57
|
-
</DemoRow>
|
58
|
-
);
|
59
|
-
});
|
60
|
-
|
61
|
-
export const demo5 = designPage(() => {
|
62
|
-
|
63
|
-
const state = reactive({ flag: null });
|
64
|
-
|
65
|
-
return () => (
|
66
|
-
<DemoRow title={'大小'}>
|
67
|
-
<Checkbox label={'mini'} size={'mini'} v-model={state.flag}/>
|
68
|
-
<Checkbox label={'small'} size={'small'} v-model={state.flag}/>
|
69
|
-
<Checkbox label={'normal'} size={'normal'} v-model={state.flag}/>
|
70
|
-
<Checkbox label={'large'} size={'large'} v-model={state.flag}/>
|
71
|
-
<Checkbox label={'32px'} v-model={state.flag} style={{ fontSize: '32px' }}/>
|
72
|
-
</DemoRow>
|
73
|
-
);
|
74
|
-
});
|
75
|
-
|
76
|
-
export const demo6 = designPage(() => {
|
77
|
-
|
78
|
-
const state = reactive({ val: undefined });
|
79
|
-
|
80
|
-
return () => (
|
81
|
-
<DemoRow title={'复选框组'}>
|
82
|
-
<CheckboxGroup v-model={state.val}>
|
83
|
-
<Checkbox checkboxForAll/>
|
84
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
85
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
86
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
87
|
-
</CheckboxGroup>
|
88
|
-
{String(state.val)}
|
89
|
-
</DemoRow>
|
90
|
-
);
|
91
|
-
});
|
92
|
-
export const demo7 = designPage(() => {
|
93
|
-
|
94
|
-
const state = reactive({ val: undefined });
|
95
|
-
|
96
|
-
return () => (
|
97
|
-
<DemoRow title={'复选框组:自定义渲染内容'} className="demo-checkbox-row">
|
98
|
-
<CheckboxGroup v-model={state.val}>
|
99
|
-
<Checkbox checkboxForAll v-slots={{
|
100
|
-
default: ({ status, click }) => (
|
101
|
-
<div onClick={click} className={classnames(
|
102
|
-
['demo-checkbox-custom-item', { 'demo-checkbox-custom-item-active': status === 'check' }]
|
103
|
-
)}>
|
104
|
-
{({
|
105
|
-
check: '以全选',
|
106
|
-
uncheck: '未选中',
|
107
|
-
minus: '半选',
|
108
|
-
})[status]}
|
109
|
-
</div>
|
110
|
-
)
|
111
|
-
}}/>
|
112
|
-
{['tag1', 'tag2', 'tag3'].map(tag => (
|
113
|
-
<Checkbox val={tag} key={tag} v-slots={{
|
114
|
-
default: ({ checked, click }) => (
|
115
|
-
<div
|
116
|
-
onClick={click}
|
117
|
-
className={classnames(
|
118
|
-
[
|
119
|
-
'demo-checkbox-custom-item',
|
120
|
-
{ 'demo-checkbox-custom-item-active': checked },
|
121
|
-
]
|
122
|
-
)}>
|
123
|
-
{tag}
|
124
|
-
</div>
|
125
|
-
)
|
126
|
-
}}/>
|
127
|
-
))}
|
128
|
-
</CheckboxGroup>
|
129
|
-
</DemoRow>
|
130
|
-
);
|
131
|
-
});
|
132
|
-
|
133
|
-
|
134
|
-
export const demo8 = designPage(() => {
|
135
|
-
|
136
|
-
const state = reactive({ val: ['tag1', 'tag2'] });
|
137
|
-
|
138
|
-
return () => (
|
139
|
-
<DemoRow title={'复选框组:状态大小'}>
|
140
|
-
<DemoLine>
|
141
|
-
<Button label="mini button" size="mini" style={{ width: '180px' }}/>
|
142
|
-
<CheckboxGroup v-model={state.val} status={'primary'} size="mini">
|
143
|
-
<Checkbox checkboxForAll/>
|
144
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
145
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
146
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
147
|
-
</CheckboxGroup>
|
148
|
-
</DemoLine>
|
149
|
-
<DemoLine>
|
150
|
-
<Button label="small button" size="small" style={{ width: '180px' }}/>
|
151
|
-
<CheckboxGroup v-model={state.val} status={'success'} size="small">
|
152
|
-
<Checkbox checkboxForAll/>
|
153
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
154
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
155
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
156
|
-
</CheckboxGroup>
|
157
|
-
</DemoLine>
|
158
|
-
<DemoLine>
|
159
|
-
<Button label="normal button" size="normal" style={{ width: '180px' }}/>
|
160
|
-
<CheckboxGroup v-model={state.val} status={'warn'} size="normal">
|
161
|
-
<Checkbox checkboxForAll/>
|
162
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
163
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
164
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
165
|
-
</CheckboxGroup>
|
166
|
-
</DemoLine>
|
167
|
-
<DemoLine>
|
168
|
-
<Button size="large" label="large button" style={{ width: '180px' }}/>
|
169
|
-
<CheckboxGroup v-model={state.val} status={'error'} size={'large'}>
|
170
|
-
<Checkbox checkboxForAll/>
|
171
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
172
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
173
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
174
|
-
</CheckboxGroup>
|
175
|
-
</DemoLine>
|
176
|
-
</DemoRow>
|
177
|
-
);
|
178
|
-
});
|
179
|
-
|
180
|
-
|
181
|
-
export const demo9 = designPage(() => {
|
182
|
-
return () => (
|
183
|
-
<DemoRow title={'复选框组:禁用以及只读'}>
|
184
|
-
<CheckboxGroup disabled modelValue={['tag1', 'tag2']}>
|
185
|
-
<Checkbox checkboxForAll/>
|
186
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
187
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
188
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
189
|
-
</CheckboxGroup>
|
190
|
-
<br/>
|
191
|
-
<br/>
|
192
|
-
<CheckboxGroup readonly modelValue={['tag1', 'tag2']}>
|
193
|
-
<Checkbox checkboxForAll/>
|
194
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
195
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
196
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
197
|
-
</CheckboxGroup>
|
198
|
-
</DemoRow>
|
199
|
-
);
|
200
|
-
});
|
201
|
-
|
202
|
-
export const demo10 = designPage(() => {
|
203
|
-
|
204
|
-
const state = reactive({ val: undefined });
|
205
|
-
|
206
|
-
return () => (
|
207
|
-
<DemoRow title={'复选框组:最大最小勾选个数(全选会勾选最大可勾选个数)'}>
|
208
|
-
<CheckboxGroup v-model={state.val} max={2} min={1}>
|
209
|
-
<Checkbox checkboxForAll/>
|
210
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
211
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
212
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
213
|
-
</CheckboxGroup>
|
214
|
-
{String(state.val)}
|
215
|
-
</DemoRow>
|
216
|
-
);
|
217
|
-
});
|
218
|
-
|
219
|
-
export const demo11 = designPage(() => {
|
220
|
-
|
221
|
-
const state = reactive({ val: undefined });
|
222
|
-
|
223
|
-
return () => (
|
224
|
-
<DemoRow title={'复选框组:设置选项宽度使其对其'}>
|
225
|
-
<div style={{ width: '300px' }}>
|
226
|
-
<CheckboxGroup v-model={state.val} itemWidth="50%">
|
227
|
-
<Checkbox checkboxForAll/>
|
228
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
229
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
230
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
231
|
-
</CheckboxGroup>
|
232
|
-
{JSON.stringify(state.val)}
|
233
|
-
</div>
|
234
|
-
</DemoRow>
|
235
|
-
);
|
236
|
-
});
|
237
|
-
|
238
|
-
|
239
|
-
export const demo12 = designPage(() => {
|
240
|
-
|
241
|
-
const state = reactive({ val: undefined });
|
242
|
-
|
243
|
-
return () => (
|
244
|
-
<DemoRow title={'复选框组:arraystring'}>
|
245
|
-
<div style={{ width: '300px' }}>
|
246
|
-
<CheckboxGroup v-model={state.val} valueType="arraystring" itemWidth="50%">
|
247
|
-
<Checkbox checkboxForAll/>
|
248
|
-
<Checkbox label={'标签一'} val={'tag1'}/>
|
249
|
-
<Checkbox label={'标签二'} val={'tag2'}/>
|
250
|
-
<Checkbox label={'标签三'} val={'tag3'}/>
|
251
|
-
</CheckboxGroup>
|
252
|
-
{JSON.stringify(state.val)}
|
253
|
-
</div>
|
254
|
-
</DemoRow>
|
255
|
-
);
|
256
|
-
});
|
257
|
-
|
258
|
-
|
259
|
-
export const demo13 = designPage(() => {
|
260
|
-
|
261
|
-
const options = [
|
262
|
-
{ name: '支付宝', code: 'alipay', version: '1' },
|
263
|
-
{ name: '微信支付', code: 'wechat_pay', version: '1' },
|
264
|
-
{ name: '财付通', code: 'qq_pay', version: '1' },
|
265
|
-
{ name: '快支付', code: 'fast_pay', version: '1' },
|
266
|
-
{ name: '云闪付', code: 'cloud_pay', version: '1' },
|
267
|
-
{ name: '网银支付', code: 'net_pay', version: '1' },
|
268
|
-
{ name: '快捷支付', code: 'convince_pay', version: '1' },
|
269
|
-
{ name: 'paypal', code: 'paypal', version: '1' },
|
270
|
-
] as any[];
|
271
|
-
|
272
|
-
const state = reactive({
|
273
|
-
val: [
|
274
|
-
{ name: '支付宝', code: 'alipay', version: '2' },
|
275
|
-
{ name: '微信支付', code: 'wechat_pay', version: '2' },
|
276
|
-
] as any[],
|
277
|
-
});
|
278
|
-
|
279
|
-
const isMatch = ({ value, option }: any) => !!value && !!option && (value.code == option.code);
|
280
|
-
|
281
|
-
return () => (
|
282
|
-
<DemoRow title={'复选框组:绑定值为对象'}>
|
283
|
-
<div style={{ width: '300px' }}>
|
284
|
-
<CheckboxGroup v-model={state.val} itemWidth="50%" isMatch={isMatch}>
|
285
|
-
<Checkbox checkboxForAll/>
|
286
|
-
{options.map((option) => (
|
287
|
-
<Checkbox label={option.name} val={option} key={option.code}/>
|
288
|
-
))}
|
289
|
-
</CheckboxGroup>
|
290
|
-
<div>{JSON.stringify(state.val)}</div>
|
291
|
-
</div>
|
292
|
-
</DemoRow>
|
293
|
-
);
|
294
|
-
});
|
@@ -1,104 +0,0 @@
|
|
1
|
-
import {designPage, reactive} from "plain-design-composition";
|
2
|
-
import {DemoRow} from "../../Demo/DemoRow";
|
3
|
-
import {Collapse, CollapseGroup, Icon} from "../../../../packages";
|
4
|
-
|
5
|
-
export default designPage(() => {
|
6
|
-
|
7
|
-
const val = reactive({
|
8
|
-
val: {} as any
|
9
|
-
}).val;
|
10
|
-
|
11
|
-
return () => (
|
12
|
-
<div>
|
13
|
-
<DemoRow title={'Collapse:基本用法'}>
|
14
|
-
<Collapse title={'前端工程师'}>
|
15
|
-
<div>
|
16
|
-
<p>前端工程师是互联网时代软件产品研发中不可缺少的一种专业研发角色;</p>
|
17
|
-
<p>从狭义上讲,前端工程师使用 HTML、CSS、JavaScript 等专业技能和工具将产品UI设计稿实现成网站产品,涵盖用户PC端、移动端网页,处理视觉和交互问题;</p>
|
18
|
-
<p>从广义上来讲,所有用户终端产品与视觉和交互有关的部分,都是前端工程师的专业领域。</p>
|
19
|
-
</div>
|
20
|
-
</Collapse>
|
21
|
-
</DemoRow>
|
22
|
-
<DemoRow title={'Collapse:自定义标题'}>
|
23
|
-
<Collapse>
|
24
|
-
{{
|
25
|
-
default: () => <>
|
26
|
-
<div>
|
27
|
-
<p>前端工程师是互联网时代软件产品研发中不可缺少的一种专业研发角色;</p>
|
28
|
-
<p>从狭义上讲,前端工程师使用 HTML、CSS、JavaScript 等专业技能和工具将产品UI设计稿实现成网站产品,涵盖用户PC端、移动端网页,处理视觉和交互问题;</p>
|
29
|
-
<p>从广义上来讲,所有用户终端产品与视觉和交互有关的部分,都是前端工程师的专业领域。</p>
|
30
|
-
</div>
|
31
|
-
</>,
|
32
|
-
head: () => <>
|
33
|
-
<div style={{ lineHeight: '1.5715' }}>
|
34
|
-
<span>前端工程师</span>
|
35
|
-
<Icon icon={'pi-info-circle-fill'} style={{ marginLeft: '4px' }}/>
|
36
|
-
</div>
|
37
|
-
</>
|
38
|
-
}}
|
39
|
-
</Collapse>
|
40
|
-
</DemoRow>
|
41
|
-
<DemoRow title={'CollapseGroup:基本用法'}>
|
42
|
-
<CollapseGroup>
|
43
|
-
<Collapse title={'专家方向'}>
|
44
|
-
<p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
|
45
|
-
<p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
|
46
|
-
<p>走专家路线可能是大多数技术人的选择;</p>
|
47
|
-
</Collapse>
|
48
|
-
<Collapse title={'管理方向'}>
|
49
|
-
<p>另一个职业方向就是技术管理;</p>
|
50
|
-
<p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
|
51
|
-
<p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
|
52
|
-
<p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
|
53
|
-
</Collapse>
|
54
|
-
<Collapse title={'产品&业务方向'}>
|
55
|
-
<p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
|
56
|
-
<p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
|
57
|
-
<p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
|
58
|
-
</Collapse>
|
59
|
-
</CollapseGroup>
|
60
|
-
</DemoRow>
|
61
|
-
|
62
|
-
<DemoRow title={'CollapseGroup:限制展开的个数'}>
|
63
|
-
<p>{JSON.stringify(val[2] || [])}</p>
|
64
|
-
<CollapseGroup v-model={val[2]} style={{ marginBottom: '20px' }} limit={2}>
|
65
|
-
<Collapse title={'专家方向'}>
|
66
|
-
<p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
|
67
|
-
<p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
|
68
|
-
<p>走专家路线可能是大多数技术人的选择;</p>
|
69
|
-
</Collapse>
|
70
|
-
<Collapse title={'管理方向'}>
|
71
|
-
<p>另一个职业方向就是技术管理;</p>
|
72
|
-
<p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
|
73
|
-
<p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
|
74
|
-
<p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
|
75
|
-
</Collapse>
|
76
|
-
<Collapse title={'产品&业务方向'}>
|
77
|
-
<p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
|
78
|
-
<p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
|
79
|
-
<p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
|
80
|
-
</Collapse>
|
81
|
-
</CollapseGroup>
|
82
|
-
<p>禁用的 CollapseGroup</p>
|
83
|
-
<CollapseGroup v-model={val[2]} disabled>
|
84
|
-
<Collapse title={'专家方向'}>
|
85
|
-
<p>经过几年的技术积累,大量的项目历练,很自然地就朝着专家的方向过渡了;</p>
|
86
|
-
<p>技术人普遍具有的一个特征就是不喜欢管一些乱七八糟的事,更愿意钻研感兴趣的技术,解决一些技术难题;</p>
|
87
|
-
<p>走专家路线可能是大多数技术人的选择;</p>
|
88
|
-
</Collapse>
|
89
|
-
<Collapse title={'管理方向'}>
|
90
|
-
<p>另一个职业方向就是技术管理;</p>
|
91
|
-
<p>技术管理要求的更综合,日常的工作涉及项目管理,跨部门沟通,团队管理,技术体系建设等方面;</p>
|
92
|
-
<p>做技术管理意味着远离一线coding,渐渐失去自己的技术优势,80%的精力是帮助团队同学成长,通过团队完成既定目标;</p>
|
93
|
-
<p>技术人要经历一个心态的转变。但企业招人过去最主要的目的是解决实际面临的技术问题,所以对于技术管理来说,技术还是一个基本面,不能完全放下,还是要时刻关注技术大方向;</p>
|
94
|
-
</Collapse>
|
95
|
-
<Collapse title={'产品&业务方向'}>
|
96
|
-
<p>还有一个职业方向是转型做产品经理更多地贴近业务;</p>
|
97
|
-
<p>我身边有越来越多的前端做了几年的研发后转型做了产品;</p>
|
98
|
-
<p>技术人转型做产品,其实是比较有优势的,一方面懂技术能更好地和研发沟通,另一方面产品设计上更容易落地;</p>
|
99
|
-
</Collapse>
|
100
|
-
</CollapseGroup>
|
101
|
-
</DemoRow>
|
102
|
-
</div>
|
103
|
-
);
|
104
|
-
});
|
@@ -1,20 +0,0 @@
|
|
1
|
-
.demo-color-palette-container {
|
2
|
-
display: inline-flex;
|
3
|
-
flex-direction: column;
|
4
|
-
align-items: stretch;
|
5
|
-
margin-right: 10px;
|
6
|
-
margin-bottom: 10px;
|
7
|
-
font-size: 14px;
|
8
|
-
|
9
|
-
& > div {
|
10
|
-
padding: 16px 18px;
|
11
|
-
font-size: 12px;
|
12
|
-
}
|
13
|
-
|
14
|
-
.text {
|
15
|
-
position: absolute;
|
16
|
-
top: 0;
|
17
|
-
left: 100%;
|
18
|
-
padding: 16px 18px;
|
19
|
-
}
|
20
|
-
}
|
@@ -1,82 +0,0 @@
|
|
1
|
-
import './DemoColor.scss';
|
2
|
-
import {computed, designPage, getComponentCls, getComponentPrefix, reactive} from "plain-design-composition";
|
3
|
-
import {$message, ApplicationConfigurationProvider, Button, ColorPicker} from "../../../../packages";
|
4
|
-
import {copyToClipboard} from 'plain-utils/dom/copyToClipboard';
|
5
|
-
import {ThemeColorNum} from "../../../../packages/components/Application/theme/theme.utils";
|
6
|
-
import {DemoRow} from "../../Demo/DemoRow";
|
7
|
-
import {buildColor} from "../../../../packages/utils/color.utils";
|
8
|
-
import {BaseColors} from "../../../../packages/components/Application/theme/theme";
|
9
|
-
|
10
|
-
export const demoGenerate = designPage(() => {
|
11
|
-
|
12
|
-
const configuration = ApplicationConfigurationProvider.inject();
|
13
|
-
|
14
|
-
const defaultColor = '#888888';
|
15
|
-
|
16
|
-
const state = reactive({
|
17
|
-
text: defaultColor,
|
18
|
-
color: defaultColor,
|
19
|
-
});
|
20
|
-
|
21
|
-
const colors = computed(() => {
|
22
|
-
// return new Array(10).fill(null).map((_, i) => (configuration.value.theme.dark ? darken : lighter)(state.color, i));
|
23
|
-
return buildColor({
|
24
|
-
color: state.text,
|
25
|
-
isDark: configuration.value.theme.dark
|
26
|
-
});
|
27
|
-
});
|
28
|
-
|
29
|
-
const generateColor = () => {
|
30
|
-
if (!state.text) {
|
31
|
-
return $message.warn('请输入颜色!');
|
32
|
-
}
|
33
|
-
state.color = state.text;
|
34
|
-
};
|
35
|
-
|
36
|
-
return () => (
|
37
|
-
<DemoRow title="颜色生成器">
|
38
|
-
<ColorPicker v-model={state.text} width="200px"/>
|
39
|
-
<Button label="生成" onClick={generateColor}/>
|
40
|
-
<div className="demo-color-palette-container">
|
41
|
-
{colors.value.map((color, index) => {
|
42
|
-
return (
|
43
|
-
<div key={color} style={{ backgroundColor: color, color: index >= colors.value.length / 2 || configuration.value.theme.dark ? 'white' || 'black' : 'black' || 'white', position: 'relative' }}>
|
44
|
-
<span onClick={() => copyToClipboard(color)}>{color}</span>
|
45
|
-
<span className="text" style={{ color }}>{color}</span>
|
46
|
-
</div>
|
47
|
-
);
|
48
|
-
})}
|
49
|
-
</div>
|
50
|
-
</DemoRow>
|
51
|
-
);
|
52
|
-
});
|
53
|
-
|
54
|
-
export const demo1 = designPage(() => {
|
55
|
-
|
56
|
-
const configuration = ApplicationConfigurationProvider.inject();
|
57
|
-
|
58
|
-
const renderPalette = (baseColorName: string, arr: Readonly<any[]>, options?: { prevColor?: string, lastColor?: string }) => (
|
59
|
-
<div className="demo-color-palette-container" key={baseColorName}>
|
60
|
-
{arr.map((index) => {
|
61
|
-
const varName = `${baseColorName}-${index}`;
|
62
|
-
const varFullName = `${getComponentPrefix()}-${varName}`;
|
63
|
-
const value = (configuration.value.theme.vars as any)[varName];
|
64
|
-
return (
|
65
|
-
<div key={index} style={{ backgroundColor: `var(--${varFullName})`, color: index > 6 ? options?.prevColor || `var(--${getComponentCls('gray-1')})` : options?.lastColor || `var(--${getComponentCls('gray-10')})` }}>
|
66
|
-
<span onClick={() => copyToClipboard(value)}>{value}</span>
|
67
|
-
<span onClick={() => copyToClipboard(varFullName)}>{varFullName}</span>
|
68
|
-
</div>
|
69
|
-
);
|
70
|
-
})}
|
71
|
-
</div>
|
72
|
-
);
|
73
|
-
|
74
|
-
return () => <>
|
75
|
-
<DemoRow title="以下为可用的css变量颜色">
|
76
|
-
{Object.keys(BaseColors).map((baseColorName) => renderPalette(baseColorName, ThemeColorNum))}
|
77
|
-
{Object.keys(BaseColors).map((baseColorName) => renderPalette(`${baseColorName}-light`, ThemeColorNum))}
|
78
|
-
{renderPalette('text', [4, 3, 2, 1], { lastColor: 'white' })}
|
79
|
-
</DemoRow>
|
80
|
-
|
81
|
-
</>;
|
82
|
-
});
|