vue-devui 1.0.0-beta.2 → 1.0.0-beta.220808
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 +163 -172
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +79 -51
- 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 +9053 -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 +154 -147
- 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 +46 -21
- 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 +5921 -146
- 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 +64 -36
- 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 +8122 -255
- 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/{cascader → 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 +12035 -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 +205 -154
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +736 -0
- package/dropdown/index.umd.js +1 -0
- package/{carousel → dropdown}/package.json +1 -1
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +908 -461
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2439 -1995
- package/form/index.umd.js +29 -18
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +138 -125
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- 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 +200 -56
- 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 +154 -62
- 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 +8269 -145
- 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 +260 -191
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +41 -26
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +89 -73
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8326 -0
- package/mention/index.umd.js +47 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +891 -0
- package/menu/index.umd.js +1 -0
- package/{anchor → menu}/package.json +1 -1
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +533 -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 +611 -877
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- 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/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.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/SubMenu.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/mentionProps.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/treeNodeProps.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 +245 -303
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +16 -84
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +333 -155
- 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 +48 -35
- 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 +6035 -204
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +111 -57
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +8015 -182
- 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 +78 -56
- 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/{sticky → result}/package.json +1 -1
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +56 -61
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +8381 -406
- package/search/index.umd.js +38 -1
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +9331 -576
- 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 +115 -145
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +148 -142
- 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 +6308 -181
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +253 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +29 -8
- 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 +7819 -65
- 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 +11435 -204
- package/table/index.umd.js +38 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +356 -143
- 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 +7989 -0
- package/textarea/index.umd.js +46 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9126 -597
- package/time-picker/index.umd.js +38 -1
- package/time-picker/style.css +1 -1
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9606 -0
- package/time-select/index.umd.js +38 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- 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 +5870 -141
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +11504 -692
- package/tree/index.umd.js +38 -1
- package/tree/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +968 -2748
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22816 -16568
- package/vue-devui.umd.js +42 -20
- package/accordion/index.es.js +0 -190
- package/accordion/index.umd.js +0 -1
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.es.js +0 -328
- package/carousel/index.umd.js +0 -1
- package/carousel/style.css +0 -1
- package/cascader/index.es.js +0 -187
- package/cascader/index.umd.js +0 -1
- package/cascader/style.css +0 -1
- package/date-picker/index.es.js +0 -1171
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/nav-sprite/index.es.js +0 -742
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/quadrant-diagram/index.es.js +0 -489
- package/quadrant-diagram/index.umd.js +0 -1
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/steps-guide/index.es.js +0 -211
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/tag-input/index.es.js +0 -341
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.es.js +0 -79
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/toast/index.es.js +0 -2059
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
- package/transfer/index.es.js +0 -1446
- package/transfer/index.umd.js +0 -1
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.es.js +0 -203
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/nav-sprite/index.es.js
DELETED
|
@@ -1,742 +0,0 @@
|
|
|
1
|
-
const EMPTY_OBJ = {};
|
|
2
|
-
const NOOP = () => {
|
|
3
|
-
};
|
|
4
|
-
const extend = Object.assign;
|
|
5
|
-
const remove = (arr, el) => {
|
|
6
|
-
const i = arr.indexOf(el);
|
|
7
|
-
if (i > -1) {
|
|
8
|
-
arr.splice(i, 1);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
const isArray = Array.isArray;
|
|
12
|
-
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
13
|
-
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
14
|
-
const isFunction = (val) => typeof val === "function";
|
|
15
|
-
const isString = (val) => typeof val === "string";
|
|
16
|
-
const isSymbol = (val) => typeof val === "symbol";
|
|
17
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
|
18
|
-
const isPromise = (val) => {
|
|
19
|
-
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
20
|
-
};
|
|
21
|
-
const objectToString = Object.prototype.toString;
|
|
22
|
-
const toTypeString = (value) => objectToString.call(value);
|
|
23
|
-
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
24
|
-
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
25
|
-
const def = (obj, key, value) => {
|
|
26
|
-
Object.defineProperty(obj, key, {
|
|
27
|
-
configurable: true,
|
|
28
|
-
enumerable: false,
|
|
29
|
-
value
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
let activeEffectScope;
|
|
33
|
-
function recordEffectScope(effect, scope) {
|
|
34
|
-
scope = scope || activeEffectScope;
|
|
35
|
-
if (scope && scope.active) {
|
|
36
|
-
scope.effects.push(effect);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
40
|
-
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
41
|
-
const initDepMarkers = ({ deps }) => {
|
|
42
|
-
if (deps.length) {
|
|
43
|
-
for (let i = 0; i < deps.length; i++) {
|
|
44
|
-
deps[i].w |= trackOpBit;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const finalizeDepMarkers = (effect) => {
|
|
49
|
-
const { deps } = effect;
|
|
50
|
-
if (deps.length) {
|
|
51
|
-
let ptr = 0;
|
|
52
|
-
for (let i = 0; i < deps.length; i++) {
|
|
53
|
-
const dep = deps[i];
|
|
54
|
-
if (wasTracked(dep) && !newTracked(dep)) {
|
|
55
|
-
dep.delete(effect);
|
|
56
|
-
} else {
|
|
57
|
-
deps[ptr++] = dep;
|
|
58
|
-
}
|
|
59
|
-
dep.w &= ~trackOpBit;
|
|
60
|
-
dep.n &= ~trackOpBit;
|
|
61
|
-
}
|
|
62
|
-
deps.length = ptr;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
let effectTrackDepth = 0;
|
|
66
|
-
let trackOpBit = 1;
|
|
67
|
-
const maxMarkerBits = 30;
|
|
68
|
-
const effectStack = [];
|
|
69
|
-
let activeEffect;
|
|
70
|
-
class ReactiveEffect {
|
|
71
|
-
constructor(fn, scheduler = null, scope) {
|
|
72
|
-
this.fn = fn;
|
|
73
|
-
this.scheduler = scheduler;
|
|
74
|
-
this.active = true;
|
|
75
|
-
this.deps = [];
|
|
76
|
-
recordEffectScope(this, scope);
|
|
77
|
-
}
|
|
78
|
-
run() {
|
|
79
|
-
if (!this.active) {
|
|
80
|
-
return this.fn();
|
|
81
|
-
}
|
|
82
|
-
if (!effectStack.includes(this)) {
|
|
83
|
-
try {
|
|
84
|
-
effectStack.push(activeEffect = this);
|
|
85
|
-
enableTracking();
|
|
86
|
-
trackOpBit = 1 << ++effectTrackDepth;
|
|
87
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
88
|
-
initDepMarkers(this);
|
|
89
|
-
} else {
|
|
90
|
-
cleanupEffect(this);
|
|
91
|
-
}
|
|
92
|
-
return this.fn();
|
|
93
|
-
} finally {
|
|
94
|
-
if (effectTrackDepth <= maxMarkerBits) {
|
|
95
|
-
finalizeDepMarkers(this);
|
|
96
|
-
}
|
|
97
|
-
trackOpBit = 1 << --effectTrackDepth;
|
|
98
|
-
resetTracking();
|
|
99
|
-
effectStack.pop();
|
|
100
|
-
const n = effectStack.length;
|
|
101
|
-
activeEffect = n > 0 ? effectStack[n - 1] : void 0;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
stop() {
|
|
106
|
-
if (this.active) {
|
|
107
|
-
cleanupEffect(this);
|
|
108
|
-
if (this.onStop) {
|
|
109
|
-
this.onStop();
|
|
110
|
-
}
|
|
111
|
-
this.active = false;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function cleanupEffect(effect) {
|
|
116
|
-
const { deps } = effect;
|
|
117
|
-
if (deps.length) {
|
|
118
|
-
for (let i = 0; i < deps.length; i++) {
|
|
119
|
-
deps[i].delete(effect);
|
|
120
|
-
}
|
|
121
|
-
deps.length = 0;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
let shouldTrack = true;
|
|
125
|
-
const trackStack = [];
|
|
126
|
-
function enableTracking() {
|
|
127
|
-
trackStack.push(shouldTrack);
|
|
128
|
-
shouldTrack = true;
|
|
129
|
-
}
|
|
130
|
-
function resetTracking() {
|
|
131
|
-
const last = trackStack.pop();
|
|
132
|
-
shouldTrack = last === void 0 ? true : last;
|
|
133
|
-
}
|
|
134
|
-
new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
|
|
135
|
-
function isReactive(value) {
|
|
136
|
-
if (isReadonly(value)) {
|
|
137
|
-
return isReactive(value["__v_raw"]);
|
|
138
|
-
}
|
|
139
|
-
return !!(value && value["__v_isReactive"]);
|
|
140
|
-
}
|
|
141
|
-
function isReadonly(value) {
|
|
142
|
-
return !!(value && value["__v_isReadonly"]);
|
|
143
|
-
}
|
|
144
|
-
function markRaw(value) {
|
|
145
|
-
def(value, "__v_skip", true);
|
|
146
|
-
return value;
|
|
147
|
-
}
|
|
148
|
-
function isRef(r) {
|
|
149
|
-
return Boolean(r && r.__v_isRef === true);
|
|
150
|
-
}
|
|
151
|
-
function unref(ref) {
|
|
152
|
-
return isRef(ref) ? ref.value : ref;
|
|
153
|
-
}
|
|
154
|
-
const shallowUnwrapHandlers = {
|
|
155
|
-
get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
|
|
156
|
-
set: (target, key, value, receiver) => {
|
|
157
|
-
const oldValue = target[key];
|
|
158
|
-
if (isRef(oldValue) && !isRef(value)) {
|
|
159
|
-
oldValue.value = value;
|
|
160
|
-
return true;
|
|
161
|
-
} else {
|
|
162
|
-
return Reflect.set(target, key, value, receiver);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
function proxyRefs(objectWithRefs) {
|
|
167
|
-
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
168
|
-
}
|
|
169
|
-
Promise.resolve();
|
|
170
|
-
function queueEffectWithSuspense(fn, suspense) {
|
|
171
|
-
if (suspense && suspense.pendingBranch) {
|
|
172
|
-
if (isArray(fn)) {
|
|
173
|
-
suspense.effects.push(...fn);
|
|
174
|
-
} else {
|
|
175
|
-
suspense.effects.push(fn);
|
|
176
|
-
}
|
|
177
|
-
} else {
|
|
178
|
-
queuePostFlushCb(fn);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
function defineComponent(options) {
|
|
182
|
-
return isFunction(options) ? { setup: options, name: options.name } : options;
|
|
183
|
-
}
|
|
184
|
-
function resolveMergedOptions(instance) {
|
|
185
|
-
const base = instance.type;
|
|
186
|
-
const { mixins, extends: extendsOptions } = base;
|
|
187
|
-
const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
|
|
188
|
-
const cached = cache.get(base);
|
|
189
|
-
let resolved;
|
|
190
|
-
if (cached) {
|
|
191
|
-
resolved = cached;
|
|
192
|
-
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
193
|
-
{
|
|
194
|
-
resolved = base;
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
resolved = {};
|
|
198
|
-
if (globalMixins.length) {
|
|
199
|
-
globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
200
|
-
}
|
|
201
|
-
mergeOptions(resolved, base, optionMergeStrategies);
|
|
202
|
-
}
|
|
203
|
-
cache.set(base, resolved);
|
|
204
|
-
return resolved;
|
|
205
|
-
}
|
|
206
|
-
function mergeOptions(to, from, strats, asMixin = false) {
|
|
207
|
-
const { mixins, extends: extendsOptions } = from;
|
|
208
|
-
if (extendsOptions) {
|
|
209
|
-
mergeOptions(to, extendsOptions, strats, true);
|
|
210
|
-
}
|
|
211
|
-
if (mixins) {
|
|
212
|
-
mixins.forEach((m) => mergeOptions(to, m, strats, true));
|
|
213
|
-
}
|
|
214
|
-
for (const key in from) {
|
|
215
|
-
if (asMixin && key === "expose")
|
|
216
|
-
;
|
|
217
|
-
else {
|
|
218
|
-
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
219
|
-
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return to;
|
|
223
|
-
}
|
|
224
|
-
const internalOptionMergeStrats = {
|
|
225
|
-
data: mergeDataFn,
|
|
226
|
-
props: mergeObjectOptions,
|
|
227
|
-
emits: mergeObjectOptions,
|
|
228
|
-
methods: mergeObjectOptions,
|
|
229
|
-
computed: mergeObjectOptions,
|
|
230
|
-
beforeCreate: mergeAsArray,
|
|
231
|
-
created: mergeAsArray,
|
|
232
|
-
beforeMount: mergeAsArray,
|
|
233
|
-
mounted: mergeAsArray,
|
|
234
|
-
beforeUpdate: mergeAsArray,
|
|
235
|
-
updated: mergeAsArray,
|
|
236
|
-
beforeDestroy: mergeAsArray,
|
|
237
|
-
beforeUnmount: mergeAsArray,
|
|
238
|
-
destroyed: mergeAsArray,
|
|
239
|
-
unmounted: mergeAsArray,
|
|
240
|
-
activated: mergeAsArray,
|
|
241
|
-
deactivated: mergeAsArray,
|
|
242
|
-
errorCaptured: mergeAsArray,
|
|
243
|
-
serverPrefetch: mergeAsArray,
|
|
244
|
-
components: mergeObjectOptions,
|
|
245
|
-
directives: mergeObjectOptions,
|
|
246
|
-
watch: mergeWatchOptions,
|
|
247
|
-
provide: mergeDataFn,
|
|
248
|
-
inject: mergeInject
|
|
249
|
-
};
|
|
250
|
-
function mergeDataFn(to, from) {
|
|
251
|
-
if (!from) {
|
|
252
|
-
return to;
|
|
253
|
-
}
|
|
254
|
-
if (!to) {
|
|
255
|
-
return from;
|
|
256
|
-
}
|
|
257
|
-
return function mergedDataFn() {
|
|
258
|
-
return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function mergeInject(to, from) {
|
|
262
|
-
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
263
|
-
}
|
|
264
|
-
function normalizeInject(raw) {
|
|
265
|
-
if (isArray(raw)) {
|
|
266
|
-
const res = {};
|
|
267
|
-
for (let i = 0; i < raw.length; i++) {
|
|
268
|
-
res[raw[i]] = raw[i];
|
|
269
|
-
}
|
|
270
|
-
return res;
|
|
271
|
-
}
|
|
272
|
-
return raw;
|
|
273
|
-
}
|
|
274
|
-
function mergeAsArray(to, from) {
|
|
275
|
-
return to ? [...new Set([].concat(to, from))] : from;
|
|
276
|
-
}
|
|
277
|
-
function mergeObjectOptions(to, from) {
|
|
278
|
-
return to ? extend(extend(Object.create(null), to), from) : from;
|
|
279
|
-
}
|
|
280
|
-
function mergeWatchOptions(to, from) {
|
|
281
|
-
if (!to)
|
|
282
|
-
return from;
|
|
283
|
-
if (!from)
|
|
284
|
-
return to;
|
|
285
|
-
const merged = extend(Object.create(null), to);
|
|
286
|
-
for (const key in from) {
|
|
287
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
288
|
-
}
|
|
289
|
-
return merged;
|
|
290
|
-
}
|
|
291
|
-
const queuePostRenderEffect = queueEffectWithSuspense;
|
|
292
|
-
const getPublicInstance = (i) => {
|
|
293
|
-
if (!i)
|
|
294
|
-
return null;
|
|
295
|
-
if (isStatefulComponent(i))
|
|
296
|
-
return getExposeProxy(i) || i.proxy;
|
|
297
|
-
return getPublicInstance(i.parent);
|
|
298
|
-
};
|
|
299
|
-
const publicPropertiesMap = extend(Object.create(null), {
|
|
300
|
-
$: (i) => i,
|
|
301
|
-
$el: (i) => i.vnode.el,
|
|
302
|
-
$data: (i) => i.data,
|
|
303
|
-
$props: (i) => i.props,
|
|
304
|
-
$attrs: (i) => i.attrs,
|
|
305
|
-
$slots: (i) => i.slots,
|
|
306
|
-
$refs: (i) => i.refs,
|
|
307
|
-
$parent: (i) => getPublicInstance(i.parent),
|
|
308
|
-
$root: (i) => getPublicInstance(i.root),
|
|
309
|
-
$emit: (i) => i.emit,
|
|
310
|
-
$options: (i) => resolveMergedOptions(i),
|
|
311
|
-
$forceUpdate: (i) => () => queueJob(i.update),
|
|
312
|
-
$nextTick: (i) => nextTick.bind(i.proxy),
|
|
313
|
-
$watch: (i) => instanceWatch.bind(i)
|
|
314
|
-
});
|
|
315
|
-
let currentInstance = null;
|
|
316
|
-
const setCurrentInstance = (instance) => {
|
|
317
|
-
currentInstance = instance;
|
|
318
|
-
instance.scope.on();
|
|
319
|
-
};
|
|
320
|
-
const unsetCurrentInstance = () => {
|
|
321
|
-
currentInstance && currentInstance.scope.off();
|
|
322
|
-
currentInstance = null;
|
|
323
|
-
};
|
|
324
|
-
function isStatefulComponent(instance) {
|
|
325
|
-
return instance.vnode.shapeFlag & 4;
|
|
326
|
-
}
|
|
327
|
-
function getExposeProxy(instance) {
|
|
328
|
-
if (instance.exposed) {
|
|
329
|
-
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
330
|
-
get(target, key) {
|
|
331
|
-
if (key in target) {
|
|
332
|
-
return target[key];
|
|
333
|
-
} else if (key in publicPropertiesMap) {
|
|
334
|
-
return publicPropertiesMap[key](instance);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}));
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
function callWithErrorHandling(fn, instance, type, args) {
|
|
341
|
-
let res;
|
|
342
|
-
try {
|
|
343
|
-
res = args ? fn(...args) : fn();
|
|
344
|
-
} catch (err) {
|
|
345
|
-
handleError(err, instance, type);
|
|
346
|
-
}
|
|
347
|
-
return res;
|
|
348
|
-
}
|
|
349
|
-
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
350
|
-
if (isFunction(fn)) {
|
|
351
|
-
const res = callWithErrorHandling(fn, instance, type, args);
|
|
352
|
-
if (res && isPromise(res)) {
|
|
353
|
-
res.catch((err) => {
|
|
354
|
-
handleError(err, instance, type);
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
return res;
|
|
358
|
-
}
|
|
359
|
-
const values = [];
|
|
360
|
-
for (let i = 0; i < fn.length; i++) {
|
|
361
|
-
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
362
|
-
}
|
|
363
|
-
return values;
|
|
364
|
-
}
|
|
365
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
366
|
-
const contextVNode = instance ? instance.vnode : null;
|
|
367
|
-
if (instance) {
|
|
368
|
-
let cur = instance.parent;
|
|
369
|
-
const exposedInstance = instance.proxy;
|
|
370
|
-
const errorInfo = type;
|
|
371
|
-
while (cur) {
|
|
372
|
-
const errorCapturedHooks = cur.ec;
|
|
373
|
-
if (errorCapturedHooks) {
|
|
374
|
-
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
375
|
-
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
cur = cur.parent;
|
|
381
|
-
}
|
|
382
|
-
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
383
|
-
if (appErrorHandler) {
|
|
384
|
-
callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
logError(err, type, contextVNode, throwInDev);
|
|
389
|
-
}
|
|
390
|
-
function logError(err, type, contextVNode, throwInDev = true) {
|
|
391
|
-
{
|
|
392
|
-
console.error(err);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
let isFlushing = false;
|
|
396
|
-
let isFlushPending = false;
|
|
397
|
-
const queue = [];
|
|
398
|
-
let flushIndex = 0;
|
|
399
|
-
const pendingPreFlushCbs = [];
|
|
400
|
-
let activePreFlushCbs = null;
|
|
401
|
-
let preFlushIndex = 0;
|
|
402
|
-
const pendingPostFlushCbs = [];
|
|
403
|
-
let activePostFlushCbs = null;
|
|
404
|
-
let postFlushIndex = 0;
|
|
405
|
-
const resolvedPromise = Promise.resolve();
|
|
406
|
-
let currentFlushPromise = null;
|
|
407
|
-
let currentPreFlushParentJob = null;
|
|
408
|
-
function nextTick(fn) {
|
|
409
|
-
const p = currentFlushPromise || resolvedPromise;
|
|
410
|
-
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
411
|
-
}
|
|
412
|
-
function findInsertionIndex(id) {
|
|
413
|
-
let start = flushIndex + 1;
|
|
414
|
-
let end = queue.length;
|
|
415
|
-
while (start < end) {
|
|
416
|
-
const middle = start + end >>> 1;
|
|
417
|
-
const middleJobId = getId(queue[middle]);
|
|
418
|
-
middleJobId < id ? start = middle + 1 : end = middle;
|
|
419
|
-
}
|
|
420
|
-
return start;
|
|
421
|
-
}
|
|
422
|
-
function queueJob(job) {
|
|
423
|
-
if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
|
|
424
|
-
if (job.id == null) {
|
|
425
|
-
queue.push(job);
|
|
426
|
-
} else {
|
|
427
|
-
queue.splice(findInsertionIndex(job.id), 0, job);
|
|
428
|
-
}
|
|
429
|
-
queueFlush();
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
function queueFlush() {
|
|
433
|
-
if (!isFlushing && !isFlushPending) {
|
|
434
|
-
isFlushPending = true;
|
|
435
|
-
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
function queueCb(cb, activeQueue, pendingQueue, index2) {
|
|
439
|
-
if (!isArray(cb)) {
|
|
440
|
-
if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index2 + 1 : index2)) {
|
|
441
|
-
pendingQueue.push(cb);
|
|
442
|
-
}
|
|
443
|
-
} else {
|
|
444
|
-
pendingQueue.push(...cb);
|
|
445
|
-
}
|
|
446
|
-
queueFlush();
|
|
447
|
-
}
|
|
448
|
-
function queuePreFlushCb(cb) {
|
|
449
|
-
queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
|
|
450
|
-
}
|
|
451
|
-
function queuePostFlushCb(cb) {
|
|
452
|
-
queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
|
|
453
|
-
}
|
|
454
|
-
function flushPreFlushCbs(seen, parentJob = null) {
|
|
455
|
-
if (pendingPreFlushCbs.length) {
|
|
456
|
-
currentPreFlushParentJob = parentJob;
|
|
457
|
-
activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
|
|
458
|
-
pendingPreFlushCbs.length = 0;
|
|
459
|
-
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
460
|
-
activePreFlushCbs[preFlushIndex]();
|
|
461
|
-
}
|
|
462
|
-
activePreFlushCbs = null;
|
|
463
|
-
preFlushIndex = 0;
|
|
464
|
-
currentPreFlushParentJob = null;
|
|
465
|
-
flushPreFlushCbs(seen, parentJob);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
function flushPostFlushCbs(seen) {
|
|
469
|
-
if (pendingPostFlushCbs.length) {
|
|
470
|
-
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
471
|
-
pendingPostFlushCbs.length = 0;
|
|
472
|
-
if (activePostFlushCbs) {
|
|
473
|
-
activePostFlushCbs.push(...deduped);
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
activePostFlushCbs = deduped;
|
|
477
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
478
|
-
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
479
|
-
activePostFlushCbs[postFlushIndex]();
|
|
480
|
-
}
|
|
481
|
-
activePostFlushCbs = null;
|
|
482
|
-
postFlushIndex = 0;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
486
|
-
function flushJobs(seen) {
|
|
487
|
-
isFlushPending = false;
|
|
488
|
-
isFlushing = true;
|
|
489
|
-
flushPreFlushCbs(seen);
|
|
490
|
-
queue.sort((a, b) => getId(a) - getId(b));
|
|
491
|
-
const check = NOOP;
|
|
492
|
-
try {
|
|
493
|
-
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
494
|
-
const job = queue[flushIndex];
|
|
495
|
-
if (job && job.active !== false) {
|
|
496
|
-
if (false)
|
|
497
|
-
;
|
|
498
|
-
callWithErrorHandling(job, null, 14);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
} finally {
|
|
502
|
-
flushIndex = 0;
|
|
503
|
-
queue.length = 0;
|
|
504
|
-
flushPostFlushCbs();
|
|
505
|
-
isFlushing = false;
|
|
506
|
-
currentFlushPromise = null;
|
|
507
|
-
if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
|
|
508
|
-
flushJobs(seen);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
const INITIAL_WATCHER_VALUE = {};
|
|
513
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
514
|
-
const instance = currentInstance;
|
|
515
|
-
let getter;
|
|
516
|
-
let forceTrigger = false;
|
|
517
|
-
let isMultiSource = false;
|
|
518
|
-
if (isRef(source)) {
|
|
519
|
-
getter = () => source.value;
|
|
520
|
-
forceTrigger = !!source._shallow;
|
|
521
|
-
} else if (isReactive(source)) {
|
|
522
|
-
getter = () => source;
|
|
523
|
-
deep = true;
|
|
524
|
-
} else if (isArray(source)) {
|
|
525
|
-
isMultiSource = true;
|
|
526
|
-
forceTrigger = source.some(isReactive);
|
|
527
|
-
getter = () => source.map((s) => {
|
|
528
|
-
if (isRef(s)) {
|
|
529
|
-
return s.value;
|
|
530
|
-
} else if (isReactive(s)) {
|
|
531
|
-
return traverse(s);
|
|
532
|
-
} else if (isFunction(s)) {
|
|
533
|
-
return callWithErrorHandling(s, instance, 2);
|
|
534
|
-
} else
|
|
535
|
-
;
|
|
536
|
-
});
|
|
537
|
-
} else if (isFunction(source)) {
|
|
538
|
-
if (cb) {
|
|
539
|
-
getter = () => callWithErrorHandling(source, instance, 2);
|
|
540
|
-
} else {
|
|
541
|
-
getter = () => {
|
|
542
|
-
if (instance && instance.isUnmounted) {
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
if (cleanup) {
|
|
546
|
-
cleanup();
|
|
547
|
-
}
|
|
548
|
-
return callWithAsyncErrorHandling(source, instance, 3, [onInvalidate]);
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
} else {
|
|
552
|
-
getter = NOOP;
|
|
553
|
-
}
|
|
554
|
-
if (cb && deep) {
|
|
555
|
-
const baseGetter = getter;
|
|
556
|
-
getter = () => traverse(baseGetter());
|
|
557
|
-
}
|
|
558
|
-
let cleanup;
|
|
559
|
-
let onInvalidate = (fn) => {
|
|
560
|
-
cleanup = effect.onStop = () => {
|
|
561
|
-
callWithErrorHandling(fn, instance, 4);
|
|
562
|
-
};
|
|
563
|
-
};
|
|
564
|
-
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
565
|
-
const job = () => {
|
|
566
|
-
if (!effect.active) {
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
if (cb) {
|
|
570
|
-
const newValue = effect.run();
|
|
571
|
-
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
|
|
572
|
-
if (cleanup) {
|
|
573
|
-
cleanup();
|
|
574
|
-
}
|
|
575
|
-
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
576
|
-
newValue,
|
|
577
|
-
oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
|
|
578
|
-
onInvalidate
|
|
579
|
-
]);
|
|
580
|
-
oldValue = newValue;
|
|
581
|
-
}
|
|
582
|
-
} else {
|
|
583
|
-
effect.run();
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
job.allowRecurse = !!cb;
|
|
587
|
-
let scheduler;
|
|
588
|
-
if (flush === "sync") {
|
|
589
|
-
scheduler = job;
|
|
590
|
-
} else if (flush === "post") {
|
|
591
|
-
scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
|
|
592
|
-
} else {
|
|
593
|
-
scheduler = () => {
|
|
594
|
-
if (!instance || instance.isMounted) {
|
|
595
|
-
queuePreFlushCb(job);
|
|
596
|
-
} else {
|
|
597
|
-
job();
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
const effect = new ReactiveEffect(getter, scheduler);
|
|
602
|
-
if (cb) {
|
|
603
|
-
if (immediate) {
|
|
604
|
-
job();
|
|
605
|
-
} else {
|
|
606
|
-
oldValue = effect.run();
|
|
607
|
-
}
|
|
608
|
-
} else if (flush === "post") {
|
|
609
|
-
queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);
|
|
610
|
-
} else {
|
|
611
|
-
effect.run();
|
|
612
|
-
}
|
|
613
|
-
return () => {
|
|
614
|
-
effect.stop();
|
|
615
|
-
if (instance && instance.scope) {
|
|
616
|
-
remove(instance.scope.effects, effect);
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
function instanceWatch(source, value, options) {
|
|
621
|
-
const publicThis = this.proxy;
|
|
622
|
-
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
623
|
-
let cb;
|
|
624
|
-
if (isFunction(value)) {
|
|
625
|
-
cb = value;
|
|
626
|
-
} else {
|
|
627
|
-
cb = value.handler;
|
|
628
|
-
options = value;
|
|
629
|
-
}
|
|
630
|
-
const cur = currentInstance;
|
|
631
|
-
setCurrentInstance(this);
|
|
632
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
633
|
-
if (cur) {
|
|
634
|
-
setCurrentInstance(cur);
|
|
635
|
-
} else {
|
|
636
|
-
unsetCurrentInstance();
|
|
637
|
-
}
|
|
638
|
-
return res;
|
|
639
|
-
}
|
|
640
|
-
function createPathGetter(ctx, path) {
|
|
641
|
-
const segments = path.split(".");
|
|
642
|
-
return () => {
|
|
643
|
-
let cur = ctx;
|
|
644
|
-
for (let i = 0; i < segments.length && cur; i++) {
|
|
645
|
-
cur = cur[segments[i]];
|
|
646
|
-
}
|
|
647
|
-
return cur;
|
|
648
|
-
};
|
|
649
|
-
}
|
|
650
|
-
function traverse(value, seen) {
|
|
651
|
-
if (!isObject(value) || value["__v_skip"]) {
|
|
652
|
-
return value;
|
|
653
|
-
}
|
|
654
|
-
seen = seen || new Set();
|
|
655
|
-
if (seen.has(value)) {
|
|
656
|
-
return value;
|
|
657
|
-
}
|
|
658
|
-
seen.add(value);
|
|
659
|
-
if (isRef(value)) {
|
|
660
|
-
traverse(value.value, seen);
|
|
661
|
-
} else if (isArray(value)) {
|
|
662
|
-
for (let i = 0; i < value.length; i++) {
|
|
663
|
-
traverse(value[i], seen);
|
|
664
|
-
}
|
|
665
|
-
} else if (isSet(value) || isMap(value)) {
|
|
666
|
-
value.forEach((v) => {
|
|
667
|
-
traverse(v, seen);
|
|
668
|
-
});
|
|
669
|
-
} else if (isPlainObject(value)) {
|
|
670
|
-
for (const key in value) {
|
|
671
|
-
traverse(value[key], seen);
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
return value;
|
|
675
|
-
}
|
|
676
|
-
const navSpriteProps = {
|
|
677
|
-
target: {
|
|
678
|
-
type: Object
|
|
679
|
-
},
|
|
680
|
-
scrollTarget: {
|
|
681
|
-
type: Object
|
|
682
|
-
},
|
|
683
|
-
view: {
|
|
684
|
-
type: Object,
|
|
685
|
-
default: { top: 0, bottom: 0 }
|
|
686
|
-
},
|
|
687
|
-
hashSupport: {
|
|
688
|
-
type: Boolean,
|
|
689
|
-
default: false
|
|
690
|
-
},
|
|
691
|
-
mode: {
|
|
692
|
-
type: String,
|
|
693
|
-
default: "default"
|
|
694
|
-
},
|
|
695
|
-
maxLevel: {
|
|
696
|
-
type: Number,
|
|
697
|
-
default: 3
|
|
698
|
-
},
|
|
699
|
-
title: {
|
|
700
|
-
type: String,
|
|
701
|
-
default: "menu"
|
|
702
|
-
},
|
|
703
|
-
indent: {
|
|
704
|
-
type: Number,
|
|
705
|
-
default: 2
|
|
706
|
-
},
|
|
707
|
-
width: {
|
|
708
|
-
type: Number,
|
|
709
|
-
default: 300
|
|
710
|
-
},
|
|
711
|
-
height: {
|
|
712
|
-
type: Number,
|
|
713
|
-
default: 400
|
|
714
|
-
},
|
|
715
|
-
isOpen: {
|
|
716
|
-
type: Boolean,
|
|
717
|
-
default: true
|
|
718
|
-
},
|
|
719
|
-
spriteOption: {
|
|
720
|
-
type: Object
|
|
721
|
-
}
|
|
722
|
-
};
|
|
723
|
-
var NavSprite = defineComponent({
|
|
724
|
-
name: "DNavSprite",
|
|
725
|
-
props: navSpriteProps,
|
|
726
|
-
emits: ["afterNavInit"],
|
|
727
|
-
setup(props) {
|
|
728
|
-
return {};
|
|
729
|
-
}
|
|
730
|
-
});
|
|
731
|
-
NavSprite.install = function(app) {
|
|
732
|
-
app.component(NavSprite.name, NavSprite);
|
|
733
|
-
};
|
|
734
|
-
var index = {
|
|
735
|
-
title: "NavSprite \u5BFC\u822A\u7CBE\u7075",
|
|
736
|
-
category: "\u5BFC\u822A",
|
|
737
|
-
status: "10%",
|
|
738
|
-
install(app) {
|
|
739
|
-
app.use(NavSprite);
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
export { NavSprite, index as default };
|