vue-devui 1.0.0-alpha.0 → 1.0.0-alpha.11
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/README.md +140 -38
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +204 -1
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +9051 -0
- package/auto-complete/index.umd.js +40 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +308 -1
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +120 -1
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +5964 -1
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +89 -1
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +8207 -1
- package/checkbox/index.umd.js +38 -1
- package/checkbox/style.css +1 -1
- package/collapse/index.d.ts +7 -0
- package/collapse/index.es.js +195 -0
- package/collapse/index.umd.js +1 -0
- package/{carousel → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +217 -0
- package/countdown/index.umd.js +1 -0
- package/{accordion → countdown}/package.json +1 -1
- package/countdown/style.css +1 -0
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12031 -0
- package/date-picker-pro/index.umd.js +38 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +248 -0
- package/drawer/index.umd.js +1 -0
- package/{anchor → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +743 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +991 -0
- package/editable-select/index.umd.js +1 -0
- package/editable-select/package.json +7 -0
- package/editable-select/style.css +1 -0
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7751 -0
- package/form/index.umd.js +38 -0
- package/{theme → form}/package.json +1 -1
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +166 -0
- package/fullscreen/index.umd.js +1 -0
- package/fullscreen/package.json +7 -0
- package/fullscreen/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +271 -0
- package/grid/index.umd.js +1 -0
- package/{toast → grid}/package.json +1 -1
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +218 -1
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +511 -1
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +8311 -1
- package/input/index.umd.js +38 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +308 -0
- package/input-number/index.umd.js +1 -0
- package/input-number/package.json +7 -0
- package/input-number/style.css +1 -0
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +115 -0
- package/layout/index.umd.js +1 -0
- package/layout/package.json +7 -0
- package/layout/style.css +1 -0
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +272 -1
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +741 -0
- package/modal/index.umd.js +1 -0
- package/modal/package.json +7 -0
- package/modal/style.css +1 -0
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +528 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/Icon.js +3 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +293 -1
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +17 -78
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +820 -1
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +218 -1
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +6062 -0
- package/popover/index.umd.js +27 -0
- package/popover/package.json +7 -0
- package/popover/style.css +1 -0
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +207 -1
- package/progress/index.umd.js +3 -1
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8056 -1
- package/radio/index.umd.js +38 -1
- package/radio/style.css +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +242 -1
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +248 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +173 -0
- package/ripple/index.umd.js +1 -0
- package/ripple/package.json +7 -0
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8504 -2
- package/search/index.umd.js +38 -10
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9423 -1
- package/select/index.umd.js +38 -1
- package/select/style.css +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +145 -0
- package/skeleton/index.umd.js +1 -0
- package/skeleton/package.json +7 -0
- package/skeleton/style.css +1 -0
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +203 -1
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +6754 -0
- package/splitter/index.umd.js +27 -0
- package/splitter/package.json +7 -0
- package/splitter/style.css +1 -0
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +253 -0
- package/statistic/index.umd.js +1 -0
- package/{tag-input → statistic}/package.json +1 -1
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +63 -1
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +7852 -1
- package/switch/index.umd.js +38 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +11527 -0
- package/table/index.umd.js +38 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +407 -1
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +156 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +7986 -0
- package/textarea/index.umd.js +46 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9556 -0
- package/time-picker/index.umd.js +38 -0
- package/{date-picker → time-picker}/package.json +1 -1
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9604 -0
- package/time-select/index.umd.js +38 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.d.ts +7 -0
- package/timeline/index.es.js +427 -0
- package/timeline/index.umd.js +1 -0
- package/timeline/package.json +7 -0
- package/timeline/style.css +1 -0
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5900 -0
- package/tooltip/index.umd.js +27 -0
- package/tooltip/package.json +7 -0
- package/tooltip/style.css +1 -0
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +10336 -0
- package/tree/index.umd.js +38 -0
- package/tree/package.json +7 -0
- package/tree/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +1398 -15
- package/upload/index.umd.js +1 -15
- package/upload/style.css +1 -1
- package/vue-devui.es.js +27443 -16
- package/vue-devui.umd.js +50 -24
- package/accordion/index.es.js +0 -1
- package/accordion/index.umd.js +0 -1
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -1
- package/anchor/index.umd.js +0 -1
- package/carousel/index.es.js +0 -1
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/date-picker/index.es.js +0 -1
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/quadrant-diagram/index.es.js +0 -10
- package/quadrant-diagram/index.umd.js +0 -10
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/tag-input/index.es.js +0 -1
- package/tag-input/index.umd.js +0 -1
- package/tag-input/style.css +0 -1
- package/theme/index.es.js +0 -1
- package/theme/index.umd.js +0 -1
- package/toast/index.es.js +0 -1
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { createVNode, computed, ref, toRefs, reactive, watch, defineComponent, mergeProps } from "vue";
|
|
2
|
+
const inputNumberProps = {
|
|
3
|
+
placeholder: {
|
|
4
|
+
type: String
|
|
5
|
+
},
|
|
6
|
+
disabled: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false
|
|
9
|
+
},
|
|
10
|
+
step: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 1
|
|
13
|
+
},
|
|
14
|
+
max: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: Infinity
|
|
17
|
+
},
|
|
18
|
+
min: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: -Infinity
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: Number
|
|
28
|
+
},
|
|
29
|
+
precision: {
|
|
30
|
+
type: Number
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
function createBem(namespace, element, modifier) {
|
|
34
|
+
let cls = namespace;
|
|
35
|
+
if (element) {
|
|
36
|
+
cls += `__${element}`;
|
|
37
|
+
}
|
|
38
|
+
if (modifier) {
|
|
39
|
+
cls += `--${modifier}`;
|
|
40
|
+
}
|
|
41
|
+
return cls;
|
|
42
|
+
}
|
|
43
|
+
function useNamespace(block, needDot = false) {
|
|
44
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
45
|
+
const b = () => createBem(namespace);
|
|
46
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
47
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
48
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
49
|
+
return {
|
|
50
|
+
b,
|
|
51
|
+
e,
|
|
52
|
+
m,
|
|
53
|
+
em
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const ns$1 = useNamespace("input-number");
|
|
57
|
+
function IncIcon() {
|
|
58
|
+
return createVNode("svg", {
|
|
59
|
+
"class": ns$1.e("icon-arrow"),
|
|
60
|
+
"width": "1em",
|
|
61
|
+
"height": "1em",
|
|
62
|
+
"viewBox": "0 0 16 16",
|
|
63
|
+
"version": "1.1",
|
|
64
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
65
|
+
}, [createVNode("g", {
|
|
66
|
+
"stroke": "none",
|
|
67
|
+
"stroke-width": "1",
|
|
68
|
+
"fill": "none",
|
|
69
|
+
"fill-rule": "evenodd"
|
|
70
|
+
}, [createVNode("path", {
|
|
71
|
+
"d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
|
|
72
|
+
"fill-rule": "nonzero"
|
|
73
|
+
}, null)])]);
|
|
74
|
+
}
|
|
75
|
+
function DecIcon() {
|
|
76
|
+
return createVNode("svg", {
|
|
77
|
+
"class": ns$1.e("icon-arrow"),
|
|
78
|
+
"width": "1em",
|
|
79
|
+
"height": "1em",
|
|
80
|
+
"viewBox": "0 0 16 16",
|
|
81
|
+
"version": "1.1",
|
|
82
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
83
|
+
}, [createVNode("g", {
|
|
84
|
+
"stroke": "none",
|
|
85
|
+
"stroke-width": "1",
|
|
86
|
+
"fill": "none",
|
|
87
|
+
"fill-rule": "evenodd"
|
|
88
|
+
}, [createVNode("path", {
|
|
89
|
+
"d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
|
|
90
|
+
"fill-rule": "nonzero"
|
|
91
|
+
}, null)])]);
|
|
92
|
+
}
|
|
93
|
+
const isNumber = (value) => typeof value === "number";
|
|
94
|
+
const isUndefined = (value) => value === void 0;
|
|
95
|
+
const isNull = (value) => value === null;
|
|
96
|
+
const ns = useNamespace("input-number");
|
|
97
|
+
function useRender(props, ctx) {
|
|
98
|
+
const { style, class: customClass, ...otherAttrs } = ctx.attrs;
|
|
99
|
+
const customStyle = { style };
|
|
100
|
+
const wrapClass = computed(() => [
|
|
101
|
+
{
|
|
102
|
+
[ns.b()]: true
|
|
103
|
+
},
|
|
104
|
+
customClass
|
|
105
|
+
]);
|
|
106
|
+
const controlButtonsClass = computed(() => ({
|
|
107
|
+
[ns.e("control-buttons")]: true,
|
|
108
|
+
disabled: props.disabled,
|
|
109
|
+
[ns.m(props.size)]: true
|
|
110
|
+
}));
|
|
111
|
+
const inputWrapClass = computed(() => ({
|
|
112
|
+
[ns.e("input-wrap")]: true,
|
|
113
|
+
[ns.m(props.size)]: true
|
|
114
|
+
}));
|
|
115
|
+
const inputInnerClass = computed(() => ({
|
|
116
|
+
[ns.e("input-box")]: true,
|
|
117
|
+
disabled: props.disabled
|
|
118
|
+
}));
|
|
119
|
+
return { wrapClass, customStyle, otherAttrs, controlButtonsClass, inputWrapClass, inputInnerClass };
|
|
120
|
+
}
|
|
121
|
+
function useExpose(ctx) {
|
|
122
|
+
const inputRef = ref();
|
|
123
|
+
const focus = () => {
|
|
124
|
+
inputRef.value.focus();
|
|
125
|
+
};
|
|
126
|
+
const blur = () => {
|
|
127
|
+
inputRef.value.blur();
|
|
128
|
+
};
|
|
129
|
+
const select = () => {
|
|
130
|
+
inputRef.value.select();
|
|
131
|
+
};
|
|
132
|
+
ctx.expose({ focus, blur, select });
|
|
133
|
+
return { inputRef };
|
|
134
|
+
}
|
|
135
|
+
function getPrecision(pre) {
|
|
136
|
+
let precision = 0;
|
|
137
|
+
if (isUndefined(pre)) {
|
|
138
|
+
return precision;
|
|
139
|
+
}
|
|
140
|
+
const preString = pre.toString();
|
|
141
|
+
const dotIndex = preString.indexOf(".");
|
|
142
|
+
if (dotIndex !== -1) {
|
|
143
|
+
precision = preString.length - dotIndex - 1;
|
|
144
|
+
}
|
|
145
|
+
return precision;
|
|
146
|
+
}
|
|
147
|
+
function useEvent(props, ctx, inputRef) {
|
|
148
|
+
const { min, max, step, disabled } = toRefs(props);
|
|
149
|
+
const state = reactive({
|
|
150
|
+
currentValue: props.modelValue || "",
|
|
151
|
+
userInputValue: void 0
|
|
152
|
+
});
|
|
153
|
+
const numPrecision = computed(() => {
|
|
154
|
+
if (!isUndefined(props.precision)) {
|
|
155
|
+
return props.precision;
|
|
156
|
+
} else {
|
|
157
|
+
return Math.max(getPrecision(props.modelValue), getPrecision(step.value));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const inputVal = computed(() => {
|
|
161
|
+
if (!isUndefined(state.userInputValue)) {
|
|
162
|
+
return state.userInputValue;
|
|
163
|
+
}
|
|
164
|
+
let currentValue = state.currentValue;
|
|
165
|
+
if (currentValue === "" || isUndefined(currentValue) || Number.isNaN(currentValue)) {
|
|
166
|
+
return "";
|
|
167
|
+
}
|
|
168
|
+
if (isNumber(currentValue)) {
|
|
169
|
+
currentValue = currentValue.toFixed(numPrecision.value);
|
|
170
|
+
}
|
|
171
|
+
return currentValue;
|
|
172
|
+
});
|
|
173
|
+
const toPrecision = (num) => {
|
|
174
|
+
return Number.parseFloat(num.toFixed(numPrecision.value));
|
|
175
|
+
};
|
|
176
|
+
const computeByStep = (val, addOrNot = 1) => {
|
|
177
|
+
if (!isNumber(val)) {
|
|
178
|
+
return state.currentValue;
|
|
179
|
+
}
|
|
180
|
+
return toPrecision(val + step.value * addOrNot);
|
|
181
|
+
};
|
|
182
|
+
const correctValue = (value, shouldUpdate) => {
|
|
183
|
+
if (value === "" || isUndefined(value) || isNull(value) || Number.isNaN(value)) {
|
|
184
|
+
return void 0;
|
|
185
|
+
}
|
|
186
|
+
let newVal = Number(value);
|
|
187
|
+
newVal = toPrecision(newVal);
|
|
188
|
+
if (newVal > max.value || newVal < min.value) {
|
|
189
|
+
newVal = newVal > max.value ? max.value : min.value;
|
|
190
|
+
shouldUpdate && ctx.emit("update:modelValue", newVal);
|
|
191
|
+
}
|
|
192
|
+
return newVal;
|
|
193
|
+
};
|
|
194
|
+
const setCurrentValue = (value) => {
|
|
195
|
+
const oldVal = state.currentValue;
|
|
196
|
+
const newVal = correctValue(value);
|
|
197
|
+
if (oldVal === newVal) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
state.userInputValue = void 0;
|
|
201
|
+
ctx.emit("update:modelValue", newVal);
|
|
202
|
+
ctx.emit("input", newVal);
|
|
203
|
+
ctx.emit("change", newVal, oldVal);
|
|
204
|
+
state.currentValue = newVal;
|
|
205
|
+
};
|
|
206
|
+
const minDisabled = computed(() => isNumber(state.currentValue) && computeByStep(state.currentValue, -1) < props.min);
|
|
207
|
+
const maxDisabled = computed(() => isNumber(state.currentValue) && computeByStep(state.currentValue) > props.max);
|
|
208
|
+
const onAdd = () => {
|
|
209
|
+
if (disabled.value || maxDisabled.value) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
inputRef.value.focus();
|
|
213
|
+
const newVal = computeByStep(state.currentValue || 0);
|
|
214
|
+
setCurrentValue(newVal);
|
|
215
|
+
};
|
|
216
|
+
const onSubtract = () => {
|
|
217
|
+
if (disabled.value || minDisabled.value) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
inputRef.value.focus();
|
|
221
|
+
const newVal = computeByStep(state.currentValue || 0, -1);
|
|
222
|
+
setCurrentValue(newVal);
|
|
223
|
+
};
|
|
224
|
+
watch(() => props.modelValue, (val) => {
|
|
225
|
+
state.currentValue = correctValue(val, true);
|
|
226
|
+
state.userInputValue = void 0;
|
|
227
|
+
}, { immediate: true });
|
|
228
|
+
const onInput = (event) => {
|
|
229
|
+
const value = event.target.value;
|
|
230
|
+
state.userInputValue = value;
|
|
231
|
+
};
|
|
232
|
+
const onChange = (event) => {
|
|
233
|
+
const value = event.target.value;
|
|
234
|
+
const newVal = value !== "" ? Number(value) : "";
|
|
235
|
+
if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
|
|
236
|
+
setCurrentValue(newVal);
|
|
237
|
+
}
|
|
238
|
+
state.userInputValue = void 0;
|
|
239
|
+
};
|
|
240
|
+
return { inputVal, minDisabled, maxDisabled, onAdd, onSubtract, onInput, onChange };
|
|
241
|
+
}
|
|
242
|
+
var inputNumber = "";
|
|
243
|
+
var InputNumber = defineComponent({
|
|
244
|
+
name: "DInputNumber",
|
|
245
|
+
props: inputNumberProps,
|
|
246
|
+
emits: ["update:modelValue", "change", "input"],
|
|
247
|
+
setup(props, ctx) {
|
|
248
|
+
const {
|
|
249
|
+
disabled
|
|
250
|
+
} = toRefs(props);
|
|
251
|
+
const {
|
|
252
|
+
wrapClass,
|
|
253
|
+
customStyle,
|
|
254
|
+
otherAttrs,
|
|
255
|
+
controlButtonsClass,
|
|
256
|
+
inputWrapClass,
|
|
257
|
+
inputInnerClass
|
|
258
|
+
} = useRender(props, ctx);
|
|
259
|
+
const {
|
|
260
|
+
inputRef
|
|
261
|
+
} = useExpose(ctx);
|
|
262
|
+
const {
|
|
263
|
+
inputVal,
|
|
264
|
+
minDisabled,
|
|
265
|
+
maxDisabled,
|
|
266
|
+
onAdd,
|
|
267
|
+
onSubtract,
|
|
268
|
+
onInput,
|
|
269
|
+
onChange
|
|
270
|
+
} = useEvent(props, ctx, inputRef);
|
|
271
|
+
return () => createVNode("div", mergeProps({
|
|
272
|
+
"class": wrapClass.value
|
|
273
|
+
}, customStyle), [createVNode("div", {
|
|
274
|
+
"class": controlButtonsClass.value
|
|
275
|
+
}, [createVNode("span", {
|
|
276
|
+
"class": ["control-button control-inc", {
|
|
277
|
+
disabled: maxDisabled.value
|
|
278
|
+
}],
|
|
279
|
+
"onClick": onAdd
|
|
280
|
+
}, [createVNode(IncIcon, null, null)]), createVNode("span", {
|
|
281
|
+
"class": ["control-button control-dec", {
|
|
282
|
+
disabled: minDisabled.value
|
|
283
|
+
}],
|
|
284
|
+
"onClick": onSubtract
|
|
285
|
+
}, [createVNode(DecIcon, null, null)])]), createVNode("div", {
|
|
286
|
+
"class": inputWrapClass.value
|
|
287
|
+
}, [createVNode("input", mergeProps({
|
|
288
|
+
"type": "number",
|
|
289
|
+
"ref": inputRef,
|
|
290
|
+
"value": inputVal.value,
|
|
291
|
+
"placeholder": props.placeholder,
|
|
292
|
+
"disabled": disabled.value,
|
|
293
|
+
"class": inputInnerClass.value
|
|
294
|
+
}, otherAttrs, {
|
|
295
|
+
"onInput": onInput,
|
|
296
|
+
"onChange": onChange
|
|
297
|
+
}), null)])]);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
var index = {
|
|
301
|
+
title: "InputNumber \u6570\u5B57\u8F93\u5165\u6846",
|
|
302
|
+
category: "\u6570\u636E\u5F55\u5165",
|
|
303
|
+
status: "50%",
|
|
304
|
+
install(app) {
|
|
305
|
+
app.component(InputNumber.name, InputNumber);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
export { InputNumber, index as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.index={},d.Vue))})(this,function(d,t){"use strict";const L={placeholder:{type:String},disabled:{type:Boolean,default:!1},step:{type:Number,default:1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},size:{type:String,default:""},modelValue:{type:Number},precision:{type:Number}};function v(e,o,r){let s=e;return o&&(s+=`__${o}`),r&&(s+=`--${r}`),s}function B(e,o=!1){const r=o?`.devui-${e}`:`devui-${e}`;return{b:()=>v(r),e:n=>n?v(r,n):"",m:n=>n?v(r,"",n):"",em:(n,i)=>n&&i?v(r,n,i):""}}const P=B("input-number");function k(){return t.createVNode("svg",{class:P.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}function z(){return t.createVNode("svg",{class:P.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}const N=e=>typeof e=="number",h=e=>e===void 0,F=e=>e===null,f=B("input-number");function M(e,o){const{style:r,class:s,...c}=o.attrs,m={style:r},p=t.computed(()=>[{[f.b()]:!0},s]),n=t.computed(()=>({[f.e("control-buttons")]:!0,disabled:e.disabled,[f.m(e.size)]:!0})),i=t.computed(()=>({[f.e("input-wrap")]:!0,[f.m(e.size)]:!0})),V=t.computed(()=>({[f.e("input-box")]:!0,disabled:e.disabled}));return{wrapClass:p,customStyle:m,otherAttrs:c,controlButtonsClass:n,inputWrapClass:i,inputInnerClass:V}}function $(e){const o=t.ref(),r=()=>{o.value.focus()},s=()=>{o.value.blur()},c=()=>{o.value.select()};return e.expose({focus:r,blur:s,select:c}),{inputRef:o}}function D(e){let o=0;if(h(e))return o;const r=e.toString(),s=r.indexOf(".");return s!==-1&&(o=r.length-s-1),o}function A(e,o,r){const{min:s,max:c,step:m,disabled:p}=t.toRefs(e),n=t.reactive({currentValue:e.modelValue||"",userInputValue:void 0}),i=t.computed(()=>h(e.precision)?Math.max(D(e.modelValue),D(m.value)):e.precision),V=t.computed(()=>{if(!h(n.userInputValue))return n.userInputValue;let u=n.currentValue;return u===""||h(u)||Number.isNaN(u)?"":(N(u)&&(u=u.toFixed(i.value)),u)}),C=u=>Number.parseFloat(u.toFixed(i.value)),b=(u,a=1)=>N(u)?C(u+m.value*a):n.currentValue,w=(u,a)=>{if(u===""||h(u)||F(u)||Number.isNaN(u))return;let l=Number(u);return l=C(l),(l>c.value||l<s.value)&&(l=l>c.value?c.value:s.value,a&&o.emit("update:modelValue",l)),l},g=u=>{const a=n.currentValue,l=w(u);a!==l&&(n.userInputValue=void 0,o.emit("update:modelValue",l),o.emit("input",l),o.emit("change",l,a),n.currentValue=l)},I=t.computed(()=>N(n.currentValue)&&b(n.currentValue,-1)<e.min),y=t.computed(()=>N(n.currentValue)&&b(n.currentValue)>e.max),S=()=>{if(p.value||y.value)return;r.value.focus();const u=b(n.currentValue||0);g(u)},_=()=>{if(p.value||I.value)return;r.value.focus();const u=b(n.currentValue||0,-1);g(u)};return t.watch(()=>e.modelValue,u=>{n.currentValue=w(u,!0),n.userInputValue=void 0},{immediate:!0}),{inputVal:V,minDisabled:I,maxDisabled:y,onAdd:S,onSubtract:_,onInput:u=>{const a=u.target.value;n.userInputValue=a},onChange:u=>{const a=u.target.value,l=a!==""?Number(a):"";(N(l)&&!Number.isNaN(l)||a==="")&&g(l),n.userInputValue=void 0}}}var E="",x=t.defineComponent({name:"DInputNumber",props:L,emits:["update:modelValue","change","input"],setup(e,o){const{disabled:r}=t.toRefs(e),{wrapClass:s,customStyle:c,otherAttrs:m,controlButtonsClass:p,inputWrapClass:n,inputInnerClass:i}=M(e,o),{inputRef:V}=$(o),{inputVal:C,minDisabled:b,maxDisabled:w,onAdd:g,onSubtract:I,onInput:y,onChange:S}=A(e,o,V);return()=>t.createVNode("div",t.mergeProps({class:s.value},c),[t.createVNode("div",{class:p.value},[t.createVNode("span",{class:["control-button control-inc",{disabled:w.value}],onClick:g},[t.createVNode(k,null,null)]),t.createVNode("span",{class:["control-button control-dec",{disabled:b.value}],onClick:I},[t.createVNode(z,null,null)])]),t.createVNode("div",{class:n.value},[t.createVNode("input",t.mergeProps({type:"number",ref:V,value:C.value,placeholder:e.placeholder,disabled:r.value,class:i.value},m,{onInput:y,onChange:S}),null)])])}}),R={title:"InputNumber \u6570\u5B57\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"50%",install(e){e.component(x.name,x)}};d.InputNumber=x,d.default=R,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.devui-input-number{position:relative;display:inline-block;width:80px}.devui-input-number:hover .devui-input-number__input-box:not(.disabled){border:1px solid var(--devui-form-control-line-hover, #575d6c);padding-right:24px}.devui-input-number:hover .devui-input-number__control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-hover, #575d6c)}.devui-input-number:focus-within .devui-input-number__input-box:not(.disabled){border:1px solid var(--devui-form-control-line-active, #5e7ce0);padding-right:24px}.devui-input-number:focus-within .devui-input-number__control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-active, #5e7ce0)}.devui-input-number.devui-input-number--md{width:80px}.devui-input-number.devui-input-number--md .devui-input-number__input-box{height:32px;line-height:32px}.devui-input-number .devui-input-number__input-box{box-sizing:border-box;padding:4px 8px;font-size:var(--devui-font-size, 14px);border-radius:var(--devui-border-radius, 4px);border:1px solid var(--devui-form-control-line, #d7d8da);outline:none;width:100%;line-height:20px;height:28px;display:block;cursor:text;-moz-appearance:textfield;transition:border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-input-number .devui-input-number__input-box:not(.disabled){background-color:var(--devui-base-bg, #ffffff);border-color:var(--devui-line, #d7d8da);color:var(--devui-text, #252b3a)}.devui-input-number .devui-input-number__input-box::-webkit-inner-spin-button,.devui-input-number .devui-input-number__input-box::-webkit-outer-spin-button{-webkit-appearance:none}.devui-input-number .devui-input-number__control-buttons{display:none;position:absolute;right:0;width:22px;height:100%;flex-direction:column;justify-content:center;align-items:center;border:1px solid transparent;border-left-color:var(--devui-line, #d7d8da);box-sizing:border-box;line-height:100%;border-radius:0 var(--devui-border-radius, 4px) var(--devui-border-radius, 4px) 0}.devui-input-number .devui-input-number__control-buttons.disabled{border-left-color:var(--devui-disabled-line, #dfe1e6)}.devui-input-number .devui-input-number__control-buttons .control-button{user-select:none;box-sizing:border-box;height:50%;line-height:50%;border-width:0 1px;transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1));display:flex;justify-content:center;align-items:center;background-color:var(--devui-base-bg, #ffffff)}.devui-input-number .devui-input-number__control-buttons .control-button.control-inc svg{position:relative;top:2px;transform:rotate(180deg)}.devui-input-number .devui-input-number__control-buttons .control-button.control-dec svg{position:relative;bottom:2px}.devui-input-number .devui-input-number__control-buttons .control-button svg path{fill:var(--devui-text-weak, #575d6c)}.devui-input-number .devui-input-number__control-buttons .control-button:not(.disabled){cursor:pointer}.devui-input-number .devui-input-number__control-buttons .control-button:not(.disabled):hover>svg path{fill:var(--devui-icon-fill-active-hover, #252b3a)}.devui-input-number .devui-input-number__control-buttons .control-button.disabled>svg path{fill:var(--devui-disabled-text, #adb0b8)}.devui-input-number .devui-input-number--lg>.devui-input-number__input-box{font-size:var(--devui-font-size-lg, 14px);line-height:24px;height:46px}.devui-input-number .devui-input-number--lg.devui-input-number__control-buttons .control-button .devui-input-number__icon-arrow{width:16px;height:16px}.devui-input-number .devui-input-number--md>.devui-input-number__input-box{font-size:var(--devui-font-size, 14px);line-height:20px;height:28px}.devui-input-number .devui-input-number--sm>.devui-input-number__input-box{font-size:var(--devui-font-size-sm, 12px);line-height:18px;height:26px}.devui-input-number .devui-input-number--sm.devui-input-number__control-buttons .control-button:first-child .devui-input-number__icon-arrow{width:14px;height:14px}.devui-input-number .devui-input-number--sm.devui-input-number__control-buttons .control-button:last-child .devui-input-number__icon-arrow{width:14px;height:14px}.devui-input-number .devui-input-number__input-wrap{line-height:100%}.devui-input-number .disabled{cursor:not-allowed}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { defineComponent, createVNode } from "vue";
|
|
2
|
+
function createBem(namespace, element, modifier) {
|
|
3
|
+
let cls = namespace;
|
|
4
|
+
if (element) {
|
|
5
|
+
cls += `__${element}`;
|
|
6
|
+
}
|
|
7
|
+
if (modifier) {
|
|
8
|
+
cls += `--${modifier}`;
|
|
9
|
+
}
|
|
10
|
+
return cls;
|
|
11
|
+
}
|
|
12
|
+
function useNamespace(block, needDot = false) {
|
|
13
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
14
|
+
const b = () => createBem(namespace);
|
|
15
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
16
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
17
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
18
|
+
return {
|
|
19
|
+
b,
|
|
20
|
+
e,
|
|
21
|
+
m,
|
|
22
|
+
em
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var layout = "";
|
|
26
|
+
var Layout = defineComponent({
|
|
27
|
+
name: "DLayout",
|
|
28
|
+
emits: [],
|
|
29
|
+
setup(props, {
|
|
30
|
+
slots
|
|
31
|
+
}) {
|
|
32
|
+
const ns = useNamespace("layout");
|
|
33
|
+
return () => {
|
|
34
|
+
var _a;
|
|
35
|
+
const slotDefault = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
36
|
+
const isAside = slotDefault.some((item) => item.type.name === "DAside");
|
|
37
|
+
const classNames = `${isAside ? ns.e("aside") : ""} ${ns.b()}`;
|
|
38
|
+
return createVNode("div", {
|
|
39
|
+
"class": classNames
|
|
40
|
+
}, [slotDefault]);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
var content = "";
|
|
45
|
+
var Content = defineComponent({
|
|
46
|
+
name: "DContent",
|
|
47
|
+
setup(props, {
|
|
48
|
+
slots
|
|
49
|
+
}) {
|
|
50
|
+
const ns = useNamespace("layout");
|
|
51
|
+
return () => {
|
|
52
|
+
var _a;
|
|
53
|
+
return createVNode("div", {
|
|
54
|
+
"class": ns.e("content")
|
|
55
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var header = "";
|
|
60
|
+
var Header = defineComponent({
|
|
61
|
+
name: "DHeader",
|
|
62
|
+
setup(props, {
|
|
63
|
+
slots
|
|
64
|
+
}) {
|
|
65
|
+
const ns = useNamespace("layout");
|
|
66
|
+
return () => {
|
|
67
|
+
var _a;
|
|
68
|
+
return createVNode("div", {
|
|
69
|
+
"class": ns.e("header")
|
|
70
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var footer = "";
|
|
75
|
+
var Footer = defineComponent({
|
|
76
|
+
name: "DFooter",
|
|
77
|
+
setup(props, {
|
|
78
|
+
slots
|
|
79
|
+
}) {
|
|
80
|
+
const ns = useNamespace("layout");
|
|
81
|
+
return () => {
|
|
82
|
+
var _a;
|
|
83
|
+
return createVNode("div", {
|
|
84
|
+
"class": ns.e("footer")
|
|
85
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
var Aside = defineComponent({
|
|
90
|
+
name: "DAside",
|
|
91
|
+
setup(props, {
|
|
92
|
+
slots
|
|
93
|
+
}) {
|
|
94
|
+
const ns = useNamespace("layout");
|
|
95
|
+
return () => {
|
|
96
|
+
var _a;
|
|
97
|
+
return createVNode("div", {
|
|
98
|
+
"class": ns.em("aside", "inner")
|
|
99
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
var index = {
|
|
104
|
+
title: "Layout \u5E03\u5C40",
|
|
105
|
+
category: "\u5E03\u5C40",
|
|
106
|
+
status: "100%",
|
|
107
|
+
install(app) {
|
|
108
|
+
app.component(Layout.name, Layout);
|
|
109
|
+
app.component(Content.name, Content);
|
|
110
|
+
app.component(Header.name, Header);
|
|
111
|
+
app.component(Footer.name, Footer);
|
|
112
|
+
app.component(Aside.name, Aside);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
export { Aside, Content, Footer, Header, Layout, index as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(r,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(r=typeof globalThis!="undefined"?globalThis:r||self,o(r.index={},r.Vue))})(this,function(r,o){"use strict";function i(a,e,t){let n=a;return e&&(n+=`__${e}`),t&&(n+=`--${t}`),n}function u(a,e=!1){const t=e?`.devui-${a}`:`devui-${a}`;return{b:()=>i(t),e:d=>d?i(t,d):"",m:d=>d?i(t,"",d):"",em:(d,C)=>d&&C?i(t,d,C):""}}var N="",c=o.defineComponent({name:"DLayout",emits:[],setup(a,{slots:e}){const t=u("layout");return()=>{var y;const n=(y=e.default)==null?void 0:y.call(e),v=`${n.some(d=>d.type.name==="DAside")?t.e("aside"):""} ${t.b()}`;return o.createVNode("div",{class:v},[n])}}}),A="",m=o.defineComponent({name:"DContent",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("content")},[(n=e.default)==null?void 0:n.call(e)])}}}),V="",f=o.defineComponent({name:"DHeader",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("header")},[(n=e.default)==null?void 0:n.call(e)])}}}),$="",s=o.defineComponent({name:"DFooter",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.e("footer")},[(n=e.default)==null?void 0:n.call(e)])}}}),p=o.defineComponent({name:"DAside",setup(a,{slots:e}){const t=u("layout");return()=>{var n;return o.createVNode("div",{class:t.em("aside","inner")},[(n=e.default)==null?void 0:n.call(e)])}}}),l={title:"Layout \u5E03\u5C40",category:"\u5E03\u5C40",status:"100%",install(a){a.component(c.name,c),a.component(m.name,m),a.component(f.name,f),a.component(s.name,s),a.component(p.name,p)}};r.Aside=p,r.Content=m,r.Footer=s,r.Header=f,r.Layout=c,r.default=l,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/layout/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.devui-layout{display:flex;flex-direction:column;flex:auto}.devui-layout__aside{flex-direction:row}.devui-layout__content{flex:auto;min-height:0}.devui-layout__header{min-height:40px;flex:auto}.devui-layout__footer{text-align:center;line-height:1.5}
|