misp-ui-library-test 0.0.1
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 +113 -0
- package/dist/theme-chalk/alert/index.scss +152 -0
- package/dist/theme-chalk/avatar/index.scss +51 -0
- package/dist/theme-chalk/backtop/index.scss +38 -0
- package/dist/theme-chalk/badge/index.scss +63 -0
- package/dist/theme-chalk/breadcrumb/index.scss +36 -0
- package/dist/theme-chalk/breadcrumb-item/index.scss +36 -0
- package/dist/theme-chalk/button/index.scss +157 -0
- package/dist/theme-chalk/card/index.scss +38 -0
- package/dist/theme-chalk/chart/index.scss +21 -0
- package/dist/theme-chalk/checkbox/index.scss +358 -0
- package/dist/theme-chalk/col/index.scss +131 -0
- package/dist/theme-chalk/container/index.scss +40 -0
- package/dist/theme-chalk/css/alert.css +484 -0
- package/dist/theme-chalk/css/avatar.css +409 -0
- package/dist/theme-chalk/css/backtop.css +401 -0
- package/dist/theme-chalk/css/badge.css +419 -0
- package/dist/theme-chalk/css/breadcrumb-item.css +395 -0
- package/dist/theme-chalk/css/breadcrumb.css +395 -0
- package/dist/theme-chalk/css/button.css +587 -0
- package/dist/theme-chalk/css/card.css +397 -0
- package/dist/theme-chalk/css/chart.css +386 -0
- package/dist/theme-chalk/css/checkbox.css +648 -0
- package/dist/theme-chalk/css/col.css +2111 -0
- package/dist/theme-chalk/css/container.css +404 -0
- package/dist/theme-chalk/css/dialog.css +505 -0
- package/dist/theme-chalk/css/divider.css +405 -0
- package/dist/theme-chalk/css/drawer.css +546 -0
- package/dist/theme-chalk/css/empty.css +394 -0
- package/dist/theme-chalk/css/form.css +561 -0
- package/dist/theme-chalk/css/icon.css +1534 -0
- package/dist/theme-chalk/css/image.css +400 -0
- package/dist/theme-chalk/css/input-number.css +424 -0
- package/dist/theme-chalk/css/input.css +721 -0
- package/dist/theme-chalk/css/link.css +424 -0
- package/dist/theme-chalk/css/loading.css +483 -0
- package/dist/theme-chalk/css/message-box.css +479 -0
- package/dist/theme-chalk/css/message.css +456 -0
- package/dist/theme-chalk/css/no-data.css +397 -0
- package/dist/theme-chalk/css/notification.css +431 -0
- package/dist/theme-chalk/css/page-header.css +396 -0
- package/dist/theme-chalk/css/pagination.css +565 -0
- package/dist/theme-chalk/css/popover.css +421 -0
- package/dist/theme-chalk/css/popper.css +454 -0
- package/dist/theme-chalk/css/progress.css +451 -0
- package/dist/theme-chalk/css/radio.css +626 -0
- package/dist/theme-chalk/css/rate.css +414 -0
- package/dist/theme-chalk/css/result.css +403 -0
- package/dist/theme-chalk/css/row.css +433 -0
- package/dist/theme-chalk/css/scrollbar.css +422 -0
- package/dist/theme-chalk/css/select.css +1897 -0
- package/dist/theme-chalk/css/skeleton-item.css +407 -0
- package/dist/theme-chalk/css/skeleton.css +390 -0
- package/dist/theme-chalk/css/slider.css +460 -0
- package/dist/theme-chalk/css/spinner.css +403 -0
- package/dist/theme-chalk/css/statistic.css +396 -0
- package/dist/theme-chalk/css/status-timeline-chart.css +388 -0
- package/dist/theme-chalk/css/step.css +496 -0
- package/dist/theme-chalk/css/steps.css +496 -0
- package/dist/theme-chalk/css/switch.css +507 -0
- package/dist/theme-chalk/css/tab-pane.css +457 -0
- package/dist/theme-chalk/css/table.css +461 -0
- package/dist/theme-chalk/css/tabs-navigation.css +925 -0
- package/dist/theme-chalk/css/tabs.css +457 -0
- package/dist/theme-chalk/css/tag.css +599 -0
- package/dist/theme-chalk/css/time-picker.css +683 -0
- package/dist/theme-chalk/css/timeline-item.css +459 -0
- package/dist/theme-chalk/css/timeline.css +459 -0
- package/dist/theme-chalk/css/tooltip.css +485 -0
- package/dist/theme-chalk/css/tree.css +473 -0
- package/dist/theme-chalk/css/upload.css +665 -0
- package/dist/theme-chalk/dialog/index.scss +168 -0
- package/dist/theme-chalk/divider/index.scss +46 -0
- package/dist/theme-chalk/drawer/index.scss +172 -0
- package/dist/theme-chalk/empty/index.scss +36 -0
- package/dist/theme-chalk/fonts/element-icons.ttf +0 -0
- package/dist/theme-chalk/fonts/element-icons.woff +0 -0
- package/dist/theme-chalk/form/index.scss +220 -0
- package/dist/theme-chalk/icon/index.scss +1171 -0
- package/dist/theme-chalk/image/index.scss +39 -0
- package/dist/theme-chalk/index.scss +127 -0
- package/dist/theme-chalk/input/index.scss +363 -0
- package/dist/theme-chalk/input-number/index.scss +71 -0
- package/dist/theme-chalk/link/index.scss +75 -0
- package/dist/theme-chalk/loading/index.scss +131 -0
- package/dist/theme-chalk/message/index.scss +100 -0
- package/dist/theme-chalk/message-box/index.scss +131 -0
- package/dist/theme-chalk/mixins.scss +203 -0
- package/dist/theme-chalk/no-data/index.scss +36 -0
- package/dist/theme-chalk/notification/index.scss +76 -0
- package/dist/theme-chalk/page-header/index.scss +36 -0
- package/dist/theme-chalk/pagination/index.scss +225 -0
- package/dist/theme-chalk/popover/index.scss +56 -0
- package/dist/theme-chalk/popper/index.scss +89 -0
- package/dist/theme-chalk/progress/index.scss +105 -0
- package/dist/theme-chalk/radio/index.scss +328 -0
- package/dist/theme-chalk/rate/index.scss +56 -0
- package/dist/theme-chalk/reset.scss +262 -0
- package/dist/theme-chalk/result/index.scss +46 -0
- package/dist/theme-chalk/row/index.scss +88 -0
- package/dist/theme-chalk/scrollbar/index.scss +67 -0
- package/dist/theme-chalk/select/index.scss +223 -0
- package/dist/theme-chalk/skeleton/index.scss +30 -0
- package/dist/theme-chalk/skeleton-item/index.scss +49 -0
- package/dist/theme-chalk/slider/index.scss +113 -0
- package/dist/theme-chalk/spinner/index.scss +40 -0
- package/dist/theme-chalk/statistic/index.scss +38 -0
- package/dist/theme-chalk/status-timeline-chart/index.scss +23 -0
- package/dist/theme-chalk/step/index.scss +160 -0
- package/dist/theme-chalk/steps/index.scss +160 -0
- package/dist/theme-chalk/switch/index.scss +153 -0
- package/dist/theme-chalk/tab-pane/index.scss +112 -0
- package/dist/theme-chalk/table/index.scss +110 -0
- package/dist/theme-chalk/tabs/index.scss +112 -0
- package/dist/theme-chalk/tabs-navigation/index.scss +631 -0
- package/dist/theme-chalk/tag/index.scss +138 -0
- package/dist/theme-chalk/themes/blue.scss +76 -0
- package/dist/theme-chalk/themes/dark.scss +99 -0
- package/dist/theme-chalk/themes/index.scss +260 -0
- package/dist/theme-chalk/themes/light.scss +99 -0
- package/dist/theme-chalk/time-picker/index.scss +332 -0
- package/dist/theme-chalk/timeline/index.scss +119 -0
- package/dist/theme-chalk/timeline-item/index.scss +119 -0
- package/dist/theme-chalk/tooltip/index.scss +122 -0
- package/dist/theme-chalk/tree/index.scss +125 -0
- package/dist/theme-chalk/upload/index.scss +348 -0
- package/dist/theme-chalk/variables.scss +93 -0
- package/dist/vue2-ui-library.cjs.temp.js.map +1 -0
- package/dist/vue2-ui-library.common.js +28 -0
- package/dist/vue2-ui-library.common.js.map +1 -0
- package/dist/vue2-ui-library.esm.js +29 -0
- package/dist/vue2-ui-library.umd.js +27 -0
- package/package.json +161 -0
- package/src/directives/clickoutside/index.js +111 -0
- package/src/directives/init/index.js +50 -0
- package/src/directives/resize/index.js +69 -0
- package/src/index.js +174 -0
- package/src/mixins/emitter.js +47 -0
- package/src/mixins/focus.js +42 -0
- package/src/mixins/locale.js +24 -0
- package/src/mixins/migrating.js +46 -0
- package/src/packages/alert/index.js +12 -0
- package/src/packages/alert/src/main.vue +98 -0
- package/src/packages/aside/index.js +12 -0
- package/src/packages/aside/src/main.vue +20 -0
- package/src/packages/auto-grid-layout/index.js +18 -0
- package/src/packages/auto-grid-layout/prop.js +92 -0
- package/src/packages/auto-grid-layout/src/components/GridItem.vue +759 -0
- package/src/packages/auto-grid-layout/src/components/GridLayout.vue +367 -0
- package/src/packages/auto-grid-layout/src/main.vue +287 -0
- package/src/packages/auto-grid-layout/src/utils/DOM.js +46 -0
- package/src/packages/auto-grid-layout/src/utils/interact.js +333 -0
- package/src/packages/auto-grid-layout/src/utils/responsiveUtils.js +75 -0
- package/src/packages/auto-grid-layout/src/utils/utils.js +339 -0
- package/src/packages/autocomplete/index.js +12 -0
- package/src/packages/autocomplete/src/main.vue +170 -0
- package/src/packages/avatar/index.js +12 -0
- package/src/packages/avatar/src/main.vue +87 -0
- package/src/packages/backtop/index.js +12 -0
- package/src/packages/backtop/src/main.vue +120 -0
- package/src/packages/badge/index.js +12 -0
- package/src/packages/badge/src/main.vue +53 -0
- package/src/packages/breadcrumb/index.js +12 -0
- package/src/packages/breadcrumb/src/main.vue +34 -0
- package/src/packages/breadcrumb-item/index.js +12 -0
- package/src/packages/breadcrumb-item/src/main.vue +41 -0
- package/src/packages/button/index.js +13 -0
- package/src/packages/button/src/main.vue +106 -0
- package/src/packages/calendar/index.js +12 -0
- package/src/packages/calendar/src/main.vue +173 -0
- package/src/packages/card/index.js +12 -0
- package/src/packages/card/src/main.vue +26 -0
- package/src/packages/carousel/index.js +12 -0
- package/src/packages/carousel/src/main.vue +186 -0
- package/src/packages/carousel-item/index.js +12 -0
- package/src/packages/carousel-item/src/main.vue +34 -0
- package/src/packages/cascader/index.js +12 -0
- package/src/packages/cascader/src/main.vue +232 -0
- package/src/packages/chart/index.js +7 -0
- package/src/packages/chart/src/axis-chart.js +700 -0
- package/src/packages/chart/src/main.vue +828 -0
- package/src/packages/chart/src/utils.js +21 -0
- package/src/packages/checkbox/index.js +44 -0
- package/src/packages/checkbox/src/main.vue +312 -0
- package/src/packages/col/index.js +12 -0
- package/src/packages/col/src/main.vue +85 -0
- package/src/packages/collapse/index.js +12 -0
- package/src/packages/collapse/src/main.vue +69 -0
- package/src/packages/collapse-item/index.js +12 -0
- package/src/packages/collapse-item/src/main.vue +75 -0
- package/src/packages/color-picker/index.js +12 -0
- package/src/packages/color-picker/src/main.vue +206 -0
- package/src/packages/container/index.js +12 -0
- package/src/packages/container/src/main.vue +33 -0
- package/src/packages/date-picker/index.js +12 -0
- package/src/packages/date-picker/src/main.vue +246 -0
- package/src/packages/descriptions/index.js +12 -0
- package/src/packages/descriptions/src/main.vue +89 -0
- package/src/packages/descriptions-item/index.js +12 -0
- package/src/packages/descriptions-item/src/main.vue +26 -0
- package/src/packages/dialog/index.js +12 -0
- package/src/packages/dialog/src/main.vue +336 -0
- package/src/packages/divider/index.js +12 -0
- package/src/packages/divider/src/main.vue +37 -0
- package/src/packages/drawer/index.js +7 -0
- package/src/packages/drawer/src/main.vue +310 -0
- package/src/packages/dropdown/index.js +12 -0
- package/src/packages/dropdown/src/main.vue +82 -0
- package/src/packages/dropdown-menu-item/index.js +12 -0
- package/src/packages/dropdown-menu-item/src/main.vue +29 -0
- package/src/packages/empty/index.js +12 -0
- package/src/packages/empty/src/img-empty.vue +12 -0
- package/src/packages/empty/src/main.vue +49 -0
- package/src/packages/footer/index.js +12 -0
- package/src/packages/footer/src/main.vue +20 -0
- package/src/packages/form/index.js +13 -0
- package/src/packages/form/src/form-field.vue +790 -0
- package/src/packages/form/src/form-item.vue +464 -0
- package/src/packages/form/src/label-wrap.vue +127 -0
- package/src/packages/form/src/main.vue +442 -0
- package/src/packages/form-item/index.js +11 -0
- package/src/packages/header/index.js +12 -0
- package/src/packages/header/src/main.vue +20 -0
- package/src/packages/icon/index.js +12 -0
- package/src/packages/icon/src/main.vue +48 -0
- package/src/packages/image/index.js +12 -0
- package/src/packages/image/src/main.vue +224 -0
- package/src/packages/input/index.js +13 -0
- package/src/packages/input/src/calcTextareaHeight.js +123 -0
- package/src/packages/input/src/main.vue +510 -0
- package/src/packages/input-number/index.js +12 -0
- package/src/packages/input-number/src/main.vue +121 -0
- package/src/packages/link/index.js +12 -0
- package/src/packages/link/src/main.vue +53 -0
- package/src/packages/loading/index.js +17 -0
- package/src/packages/loading/src/directive.js +54 -0
- package/src/packages/loading/src/main.vue +38 -0
- package/src/packages/loading/src/service.js +63 -0
- package/src/packages/main/index.js +12 -0
- package/src/packages/main/src/main.vue +12 -0
- package/src/packages/menu/index.js +12 -0
- package/src/packages/menu/src/main.vue +117 -0
- package/src/packages/menu-item/index.js +12 -0
- package/src/packages/menu-item/src/main.vue +61 -0
- package/src/packages/message/index.js +95 -0
- package/src/packages/message/src/main.vue +131 -0
- package/src/packages/message-box/index.js +75 -0
- package/src/packages/message-box/src/main.vue +207 -0
- package/src/packages/no-data/index.js +8 -0
- package/src/packages/no-data/src/main.vue +23 -0
- package/src/packages/notification/index.js +72 -0
- package/src/packages/notification/src/main.vue +139 -0
- package/src/packages/option/index.js +13 -0
- package/src/packages/page-header/index.js +12 -0
- package/src/packages/page-header/src/main.vue +27 -0
- package/src/packages/pagination/index.js +12 -0
- package/src/packages/pagination/src/main.vue +255 -0
- package/src/packages/popconfirm/index.js +12 -0
- package/src/packages/popconfirm/src/main.vue +89 -0
- package/src/packages/popover/index.js +12 -0
- package/src/packages/popover/src/main.vue +452 -0
- package/src/packages/progress/index.js +12 -0
- package/src/packages/progress/src/main.vue +236 -0
- package/src/packages/radio/index.js +44 -0
- package/src/packages/radio/src/main.vue +291 -0
- package/src/packages/rate/index.js +12 -0
- package/src/packages/rate/src/main.vue +129 -0
- package/src/packages/result/index.js +12 -0
- package/src/packages/result/src/main.vue +52 -0
- package/src/packages/row/index.js +12 -0
- package/src/packages/row/src/main.vue +57 -0
- package/src/packages/scrollbar/index.js +12 -0
- package/src/packages/scrollbar/src/bar.vue +116 -0
- package/src/packages/scrollbar/src/main.vue +124 -0
- package/src/packages/select/index.js +15 -0
- package/src/packages/select/src/clickoutside.js +20 -0
- package/src/packages/select/src/main.vue +1055 -0
- package/src/packages/select/src/navigation-mixin.js +49 -0
- package/src/packages/select/src/option.vue +249 -0
- package/src/packages/select/src/select-dropdown.vue +95 -0
- package/src/packages/select/src/utils.js +5 -0
- package/src/packages/skeleton/index.js +12 -0
- package/src/packages/skeleton/src/main.vue +76 -0
- package/src/packages/skeleton-item/index.js +12 -0
- package/src/packages/skeleton-item/src/img-placeholder.vue +13 -0
- package/src/packages/skeleton-item/src/main.vue +22 -0
- package/src/packages/slider/index.js +12 -0
- package/src/packages/slider/src/main.vue +176 -0
- package/src/packages/spinner/index.js +12 -0
- package/src/packages/spinner/src/main.vue +27 -0
- package/src/packages/statistic/index.js +12 -0
- package/src/packages/statistic/src/main.vue +100 -0
- package/src/packages/status-timeline-chart/index.js +7 -0
- package/src/packages/status-timeline-chart/src/constants.js +20 -0
- package/src/packages/status-timeline-chart/src/main.vue +499 -0
- package/src/packages/status-timeline-chart/src/option-builder.js +475 -0
- package/src/packages/step/index.js +12 -0
- package/src/packages/step/src/main.vue +183 -0
- package/src/packages/steps/index.js +12 -0
- package/src/packages/steps/src/main.vue +57 -0
- package/src/packages/submenu/index.js +12 -0
- package/src/packages/submenu/src/main.vue +68 -0
- package/src/packages/switch/index.js +12 -0
- package/src/packages/switch/src/main.vue +166 -0
- package/src/packages/tab-pane/index.js +12 -0
- package/src/packages/tab-pane/src/main.vue +74 -0
- package/src/packages/table/index.js +8 -0
- package/src/packages/table/src/components/PagePagination.vue +82 -0
- package/src/packages/table/src/main.vue +153 -0
- package/src/packages/tabs/index.js +12 -0
- package/src/packages/tabs/src/main.vue +167 -0
- package/src/packages/tabs-navigation/index.js +7 -0
- package/src/packages/tabs-navigation/src/main.vue +462 -0
- package/src/packages/tag/index.js +12 -0
- package/src/packages/tag/src/main.vue +194 -0
- package/src/packages/time-picker/index.js +17 -0
- package/src/packages/time-picker/src/date-utils.js +455 -0
- package/src/packages/time-picker/src/main.vue +321 -0
- package/src/packages/time-picker/src/pane/date-range.vue +193 -0
- package/src/packages/time-picker/src/pane/date-time-range.vue +362 -0
- package/src/packages/time-picker/src/pane/date-time.vue +362 -0
- package/src/packages/time-picker/src/pane/date.vue +441 -0
- package/src/packages/time-picker/src/pane/time.vue +260 -0
- package/src/packages/time-picker/src/time-input.vue +203 -0
- package/src/packages/time-picker/src/time-range-input.vue +170 -0
- package/src/packages/timeline/index.js +12 -0
- package/src/packages/timeline/src/main.vue +24 -0
- package/src/packages/timeline-item/index.js +12 -0
- package/src/packages/timeline-item/src/main.vue +78 -0
- package/src/packages/tooltip/index.js +12 -0
- package/src/packages/tooltip/src/main.js +367 -0
- package/src/packages/transfer/index.js +8 -0
- package/src/packages/transfer/src/main.vue +229 -0
- package/src/packages/transfer/src/transfer-panel.vue +245 -0
- package/src/packages/transitions/collapse-transition.js +75 -0
- package/src/packages/tree/index.js +12 -0
- package/src/packages/tree/src/main.vue +322 -0
- package/src/packages/tree/src/model/node.js +348 -0
- package/src/packages/tree/src/model/tree-store.js +354 -0
- package/src/packages/tree/src/model/util.js +10 -0
- package/src/packages/tree/src/tree-node.vue +262 -0
- package/src/packages/upload/index.js +9 -0
- package/src/packages/upload/src/main.vue +415 -0
- package/src/playground/mixins/element.js +98 -0
- package/src/playground/types/element.js +197 -0
- package/src/playground/types/layout.js +80 -0
- package/src/plugins/i18n.js +125 -0
- package/src/styles/fonts/element-icons.ttf +0 -0
- package/src/styles/fonts/element-icons.woff +0 -0
- package/src/styles/index.scss +138 -0
- package/src/styles/reset.scss +257 -0
- package/src/styles/themes/blue.scss +75 -0
- package/src/styles/themes/dark.scss +98 -0
- package/src/styles/themes/index.scss +34 -0
- package/src/styles/themes/light.scss +98 -0
- package/src/styles/themes/variables.scss +233 -0
- package/src/styles/variables.scss +146 -0
- package/src/utils/async-validator/index.js +659 -0
- package/src/utils/browser/index.js +39 -0
- package/src/utils/color.js +76 -0
- package/src/utils/dom/index.js +421 -0
- package/src/utils/dom/scrollbar-width.js +49 -0
- package/src/utils/draggable/core.js +379 -0
- package/src/utils/draggable/draggable.js +478 -0
- package/src/utils/draggable/index.js +61 -0
- package/src/utils/draggable/sortable.js +751 -0
- package/src/utils/lodash/index.js +2395 -0
- package/src/utils/moment/index.js +909 -0
- package/src/utils/playground/index.js +37 -0
- package/src/utils/popper/index.js +308 -0
- package/src/utils/popper/popper.js +1132 -0
- package/src/utils/popper/popup-manager.js +288 -0
- package/src/utils/popper/popup.js +344 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 布局工具函数
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export function bottom(layout) {
|
|
6
|
+
let max = 0
|
|
7
|
+
let bottomY = 0
|
|
8
|
+
for (let i = 0, len = layout.length; i < len; i++) {
|
|
9
|
+
bottomY = layout[i].y + layout[i].h
|
|
10
|
+
if (bottomY > max) max = bottomY
|
|
11
|
+
}
|
|
12
|
+
return max
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function cloneLayout(layout) {
|
|
16
|
+
const newLayout = Array(layout.length)
|
|
17
|
+
for (let i = 0, len = layout.length; i < len; i++) {
|
|
18
|
+
newLayout[i] = cloneLayoutItem(layout[i])
|
|
19
|
+
}
|
|
20
|
+
return newLayout
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function cloneLayoutItem(layoutItem) {
|
|
24
|
+
return JSON.parse(JSON.stringify(layoutItem))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function collides(l1, l2) {
|
|
28
|
+
if (l1 === l2) return false
|
|
29
|
+
if (l1.x + l1.w <= l2.x) return false
|
|
30
|
+
if (l1.x >= l2.x + l2.w) return false
|
|
31
|
+
if (l1.y + l1.h <= l2.y) return false
|
|
32
|
+
if (l1.y >= l2.y + l2.h) return false
|
|
33
|
+
return true
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function compact(layout, verticalCompact) {
|
|
37
|
+
const compareWith = getStatics(layout)
|
|
38
|
+
const sorted = sortLayoutItemsByRowCol(layout)
|
|
39
|
+
const out = Array(layout.length)
|
|
40
|
+
|
|
41
|
+
for (let i = 0, len = sorted.length; i < len; i++) {
|
|
42
|
+
let l = sorted[i]
|
|
43
|
+
if (!l.static) {
|
|
44
|
+
l = compactItem(compareWith, l, verticalCompact)
|
|
45
|
+
compareWith.push(l)
|
|
46
|
+
}
|
|
47
|
+
out[layout.indexOf(l)] = l
|
|
48
|
+
l.moved = false
|
|
49
|
+
}
|
|
50
|
+
return out
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function compactItem(compareWith, l, verticalCompact) {
|
|
54
|
+
if (verticalCompact) {
|
|
55
|
+
while (l.y > 0 && !getFirstCollision(compareWith, l)) {
|
|
56
|
+
l.y--
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
let collides
|
|
60
|
+
while ((collides = getFirstCollision(compareWith, l))) {
|
|
61
|
+
l.y = collides.y + collides.h
|
|
62
|
+
}
|
|
63
|
+
return l
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function correctBounds(layout, bounds) {
|
|
67
|
+
const collidesWith = getStatics(layout)
|
|
68
|
+
for (let i = 0, len = layout.length; i < len; i++) {
|
|
69
|
+
const l = layout[i]
|
|
70
|
+
if (l.x + l.w > bounds.cols) l.x = bounds.cols - l.w
|
|
71
|
+
if (l.x < 0) {
|
|
72
|
+
l.x = 0
|
|
73
|
+
l.w = bounds.cols
|
|
74
|
+
}
|
|
75
|
+
if (!l.static) collidesWith.push(l)
|
|
76
|
+
else {
|
|
77
|
+
while (getFirstCollision(collidesWith, l)) {
|
|
78
|
+
l.y++
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return layout
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function getLayoutItem(layout, id) {
|
|
86
|
+
for (let i = 0, len = layout.length; i < len; i++) {
|
|
87
|
+
if (layout[i].i === id) return layout[i]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function getFirstCollision(layout, layoutItem) {
|
|
92
|
+
for (let i = 0, len = layout.length; i < len; i++) {
|
|
93
|
+
if (collides(layout[i], layoutItem)) return layout[i]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function getAllCollisions(layout, layoutItem) {
|
|
98
|
+
return layout.filter((l) => collides(l, layoutItem))
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function getStatics(layout) {
|
|
102
|
+
return layout.filter((l) => l.static)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function moveElement(layout, l, x, y, isUserAction, preventCollision) {
|
|
106
|
+
if (l.static) return layout
|
|
107
|
+
|
|
108
|
+
const oldX = l.x
|
|
109
|
+
const oldY = l.y
|
|
110
|
+
|
|
111
|
+
const movingUp = y && l.y > y
|
|
112
|
+
if (typeof x === 'number') l.x = x
|
|
113
|
+
if (typeof y === 'number') l.y = y
|
|
114
|
+
l.moved = true
|
|
115
|
+
|
|
116
|
+
let sorted = sortLayoutItemsByRowCol(layout)
|
|
117
|
+
if (movingUp) sorted = sorted.reverse()
|
|
118
|
+
const collisions = getAllCollisions(sorted, l)
|
|
119
|
+
|
|
120
|
+
if (preventCollision && collisions.length) {
|
|
121
|
+
l.x = oldX
|
|
122
|
+
l.y = oldY
|
|
123
|
+
l.moved = false
|
|
124
|
+
return layout
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (let i = 0, len = collisions.length; i < len; i++) {
|
|
128
|
+
const collision = collisions[i]
|
|
129
|
+
|
|
130
|
+
if (collision.moved) continue
|
|
131
|
+
|
|
132
|
+
if (l.y > collision.y && l.y - collision.y > collision.h / 4) continue
|
|
133
|
+
|
|
134
|
+
if (collision.static) {
|
|
135
|
+
layout = moveElementAwayFromCollision(layout, collision, l, isUserAction)
|
|
136
|
+
} else {
|
|
137
|
+
layout = moveElementAwayFromCollision(layout, l, collision, isUserAction)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return layout
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function moveElementAwayFromCollision(layout, collidesWith, itemToMove, isUserAction) {
|
|
145
|
+
const preventCollision = false
|
|
146
|
+
if (isUserAction) {
|
|
147
|
+
const fakeItem = {
|
|
148
|
+
x: itemToMove.x,
|
|
149
|
+
y: itemToMove.y,
|
|
150
|
+
w: itemToMove.w,
|
|
151
|
+
h: itemToMove.h,
|
|
152
|
+
i: '-1',
|
|
153
|
+
}
|
|
154
|
+
fakeItem.y = Math.max(collidesWith.y - itemToMove.h, 0)
|
|
155
|
+
if (!getFirstCollision(layout, fakeItem)) {
|
|
156
|
+
return moveElement(layout, itemToMove, undefined, fakeItem.y, preventCollision)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return moveElement(layout, itemToMove, undefined, itemToMove.y + 1, preventCollision)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function perc(num) {
|
|
164
|
+
return num * 100 + '%'
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function setTransform(top, left, width, height) {
|
|
168
|
+
const translate = 'translate3d(' + left + 'px,' + top + 'px, 0)'
|
|
169
|
+
return {
|
|
170
|
+
transform: translate,
|
|
171
|
+
WebkitTransform: translate,
|
|
172
|
+
MozTransform: translate,
|
|
173
|
+
msTransform: translate,
|
|
174
|
+
OTransform: translate,
|
|
175
|
+
width: width + 'px',
|
|
176
|
+
height: height + 'px',
|
|
177
|
+
position: 'absolute',
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function setTransformRtl(top, right, width, height) {
|
|
182
|
+
const translate = 'translate3d(' + right * -1 + 'px,' + top + 'px, 0)'
|
|
183
|
+
return {
|
|
184
|
+
transform: translate,
|
|
185
|
+
WebkitTransform: translate,
|
|
186
|
+
MozTransform: translate,
|
|
187
|
+
msTransform: translate,
|
|
188
|
+
OTransform: translate,
|
|
189
|
+
width: width + 'px',
|
|
190
|
+
height: height + 'px',
|
|
191
|
+
position: 'absolute',
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function setTopLeft(top, left, width, height) {
|
|
196
|
+
return {
|
|
197
|
+
top: top + 'px',
|
|
198
|
+
left: left + 'px',
|
|
199
|
+
width: width + 'px',
|
|
200
|
+
height: height + 'px',
|
|
201
|
+
position: 'absolute',
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function setTopRight(top, right, width, height) {
|
|
206
|
+
return {
|
|
207
|
+
top: top + 'px',
|
|
208
|
+
right: right + 'px',
|
|
209
|
+
width: width + 'px',
|
|
210
|
+
height: height + 'px',
|
|
211
|
+
position: 'absolute',
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function sortLayoutItemsByRowCol(layout) {
|
|
216
|
+
return [].concat(layout).sort(function (a, b) {
|
|
217
|
+
if (a.y === b.y && a.x === b.x) {
|
|
218
|
+
return 0
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (a.y > b.y || (a.y === b.y && a.x > b.x)) {
|
|
222
|
+
return 1
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return -1
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function validateLayout(layout, contextName) {
|
|
230
|
+
contextName = contextName || 'Layout'
|
|
231
|
+
const subProps = ['x', 'y', 'w', 'h']
|
|
232
|
+
let keyArr = []
|
|
233
|
+
if (!Array.isArray(layout)) throw new Error(contextName + ' must be an array!')
|
|
234
|
+
for (let i = 0, len = layout.length; i < len; i++) {
|
|
235
|
+
const item = layout[i]
|
|
236
|
+
for (let j = 0; j < subProps.length; j++) {
|
|
237
|
+
if (typeof item[subProps[j]] !== 'number') {
|
|
238
|
+
throw new Error('VueGridLayout: ' + contextName + '[' + i + '].' + subProps[j] + ' must be a number!')
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (item.i === undefined || item.i === null) {
|
|
243
|
+
throw new Error('VueGridLayout: ' + contextName + '[' + i + '].i cannot be null!')
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (typeof item.i !== 'number' && typeof item.i !== 'string') {
|
|
247
|
+
throw new Error('VueGridLayout: ' + contextName + '[' + i + '].i must be a string or number!')
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (keyArr.indexOf(item.i) >= 0) {
|
|
251
|
+
throw new Error('VueGridLayout: ' + contextName + '[' + i + '].i must be unique!')
|
|
252
|
+
}
|
|
253
|
+
keyArr.push(item.i)
|
|
254
|
+
|
|
255
|
+
if (item.static !== undefined && typeof item.static !== 'boolean') {
|
|
256
|
+
throw new Error('VueGridLayout: ' + contextName + '[' + i + '].static must be a boolean!')
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function autoBindHandlers(el, fns) {
|
|
262
|
+
fns.forEach((key) => (el[key] = el[key].bind(el)))
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function createMarkup(obj) {
|
|
266
|
+
var keys = Object.keys(obj)
|
|
267
|
+
if (!keys.length) return ''
|
|
268
|
+
var i,
|
|
269
|
+
len = keys.length
|
|
270
|
+
var result = ''
|
|
271
|
+
|
|
272
|
+
for (i = 0; i < len; i++) {
|
|
273
|
+
var key = keys[i]
|
|
274
|
+
var val = obj[key]
|
|
275
|
+
result += hyphenate(key) + ':' + addPx(key, val) + ';'
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return result
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export var IS_UNITLESS = {
|
|
282
|
+
animationIterationCount: true,
|
|
283
|
+
boxFlex: true,
|
|
284
|
+
boxFlexGroup: true,
|
|
285
|
+
boxOrdinalGroup: true,
|
|
286
|
+
columnCount: true,
|
|
287
|
+
flex: true,
|
|
288
|
+
flexGrow: true,
|
|
289
|
+
flexPositive: true,
|
|
290
|
+
flexShrink: true,
|
|
291
|
+
flexNegative: true,
|
|
292
|
+
flexOrder: true,
|
|
293
|
+
gridRow: true,
|
|
294
|
+
gridColumn: true,
|
|
295
|
+
fontWeight: true,
|
|
296
|
+
lineClamp: true,
|
|
297
|
+
lineHeight: true,
|
|
298
|
+
opacity: true,
|
|
299
|
+
order: true,
|
|
300
|
+
orphans: true,
|
|
301
|
+
tabSize: true,
|
|
302
|
+
widows: true,
|
|
303
|
+
zIndex: true,
|
|
304
|
+
zoom: true,
|
|
305
|
+
|
|
306
|
+
fillOpacity: true,
|
|
307
|
+
stopOpacity: true,
|
|
308
|
+
strokeDashoffset: true,
|
|
309
|
+
strokeOpacity: true,
|
|
310
|
+
strokeWidth: true,
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export function addPx(name, value) {
|
|
314
|
+
if (typeof value === 'number' && !IS_UNITLESS[name]) {
|
|
315
|
+
return value + 'px'
|
|
316
|
+
} else {
|
|
317
|
+
return value
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export var hyphenateRE = /([a-z\d])([A-Z])/g
|
|
322
|
+
|
|
323
|
+
export function hyphenate(str) {
|
|
324
|
+
return str.replace(hyphenateRE, '$1-$2').toLowerCase()
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export function findItemInArray(array, property, value) {
|
|
328
|
+
for (var i = 0; i < array.length; i++) if (array[i][property] == value) return true
|
|
329
|
+
|
|
330
|
+
return false
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export function findAndRemove(array, property, value) {
|
|
334
|
+
array.forEach(function (result, index) {
|
|
335
|
+
if (result[property] === value) {
|
|
336
|
+
array.splice(index, 1)
|
|
337
|
+
}
|
|
338
|
+
})
|
|
339
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-autocomplete" :class="{ 'ui-autocomplete--suggestion': showSuggestions }">
|
|
3
|
+
<ui-input
|
|
4
|
+
ref="input"
|
|
5
|
+
v-model="value"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
:autocomplete="autocomplete"
|
|
8
|
+
@focus="handleFocus"
|
|
9
|
+
@blur="handleBlur"
|
|
10
|
+
@keydown.up.prevent="highlight(highlightedIndex - 1)"
|
|
11
|
+
@keydown.down.prevent="highlight(highlightedIndex + 1)"
|
|
12
|
+
@keydown.enter="handleKeyEnter"
|
|
13
|
+
@keydown.esc="closeSuggestions"
|
|
14
|
+
>
|
|
15
|
+
<template slot="prefix" v-if="$slots.prefix">
|
|
16
|
+
<slot name="prefix"></slot>
|
|
17
|
+
</template>
|
|
18
|
+
<template slot="suffix" v-if="$slots.suffix">
|
|
19
|
+
<slot name="suffix"></slot>
|
|
20
|
+
</template>
|
|
21
|
+
</ui-input>
|
|
22
|
+
<transition name="ui-zoom-in-top">
|
|
23
|
+
<ul
|
|
24
|
+
v-if="showSuggestions"
|
|
25
|
+
ref="suggestions"
|
|
26
|
+
class="ui-autocomplete__suggestions"
|
|
27
|
+
:style="{ top: suggestionsTop + 'px', zIndex: zIndex }"
|
|
28
|
+
>
|
|
29
|
+
<li
|
|
30
|
+
v-for="(item, index) in suggestions"
|
|
31
|
+
:key="index"
|
|
32
|
+
class="ui-autocomplete__suggestion"
|
|
33
|
+
:class="{ 'is-highlighted': highlightedIndex === index }"
|
|
34
|
+
@click="handleSelect(item)"
|
|
35
|
+
>
|
|
36
|
+
<slot :item="item">{{ item[valueKey] || item }}</slot>
|
|
37
|
+
</li>
|
|
38
|
+
</ul>
|
|
39
|
+
</transition>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script>
|
|
44
|
+
export default {
|
|
45
|
+
name: 'UiAutocomplete',
|
|
46
|
+
|
|
47
|
+
componentName: 'UiAutocomplete',
|
|
48
|
+
|
|
49
|
+
props: {
|
|
50
|
+
value: {},
|
|
51
|
+
fetchSuggestions: {
|
|
52
|
+
type: Function,
|
|
53
|
+
required: true
|
|
54
|
+
},
|
|
55
|
+
placeholder: String,
|
|
56
|
+
triggerOnFocus: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true
|
|
59
|
+
},
|
|
60
|
+
selectWhenUnmatched: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
popperClass: String,
|
|
65
|
+
debounce: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 300
|
|
68
|
+
},
|
|
69
|
+
valueKey: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: 'value'
|
|
72
|
+
},
|
|
73
|
+
autocomplete: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: 'off'
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
suggestions: [],
|
|
82
|
+
highlightedIndex: -1,
|
|
83
|
+
showSuggestions: false,
|
|
84
|
+
suggestionsTop: 0,
|
|
85
|
+
zIndex: 2000,
|
|
86
|
+
inputValue: this.value,
|
|
87
|
+
timer: null
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
watch: {
|
|
92
|
+
value(val) {
|
|
93
|
+
this.inputValue = val;
|
|
94
|
+
},
|
|
95
|
+
inputValue(val) {
|
|
96
|
+
this.$emit('input', val);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
created() {
|
|
101
|
+
this.debouncedFetchSuggestions = this.debounce((queryString) => {
|
|
102
|
+
this.fetchSuggestions(queryString, (data) => {
|
|
103
|
+
this.suggestions = data || [];
|
|
104
|
+
this.showSuggestions = this.suggestions.length > 0;
|
|
105
|
+
this.highlightedIndex = -1;
|
|
106
|
+
});
|
|
107
|
+
}, this.debounce);
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
methods: {
|
|
111
|
+
debounce(fn, delay) {
|
|
112
|
+
let timer = null;
|
|
113
|
+
return function(...args) {
|
|
114
|
+
if (timer) clearTimeout(timer);
|
|
115
|
+
timer = setTimeout(() => {
|
|
116
|
+
fn.apply(this, args);
|
|
117
|
+
}, delay);
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
handleFocus(event) {
|
|
121
|
+
this.$emit('focus', event);
|
|
122
|
+
if (this.triggerOnFocus) {
|
|
123
|
+
this.handleInputChange(this.inputValue);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
handleBlur(event) {
|
|
127
|
+
this.$emit('blur', event);
|
|
128
|
+
this.closeSuggestions();
|
|
129
|
+
},
|
|
130
|
+
handleKeyEnter() {
|
|
131
|
+
if (this.showSuggestions && this.highlightedIndex >= 0) {
|
|
132
|
+
this.handleSelect(this.suggestions[this.highlightedIndex]);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
handleSelect(item) {
|
|
136
|
+
this.$emit('input', item[this.valueKey] || item);
|
|
137
|
+
this.$emit('select', item);
|
|
138
|
+
this.showSuggestions = false;
|
|
139
|
+
},
|
|
140
|
+
handleInputChange(value) {
|
|
141
|
+
this.debouncedFetchSuggestions(value);
|
|
142
|
+
},
|
|
143
|
+
highlight(index) {
|
|
144
|
+
if (!this.showSuggestions) return;
|
|
145
|
+
const len = this.suggestions.length;
|
|
146
|
+
if (index > len - 1) {
|
|
147
|
+
index = 0;
|
|
148
|
+
} else if (index < 0) {
|
|
149
|
+
index = len - 1;
|
|
150
|
+
}
|
|
151
|
+
this.highlightedIndex = index;
|
|
152
|
+
},
|
|
153
|
+
closeSuggestions() {
|
|
154
|
+
this.showSuggestions = false;
|
|
155
|
+
this.highlightedIndex = -1;
|
|
156
|
+
},
|
|
157
|
+
calculateSuggestionsTop() {
|
|
158
|
+
const inputEl = this.$refs.input.$el;
|
|
159
|
+
if (inputEl) {
|
|
160
|
+
const rect = inputEl.getBoundingClientRect();
|
|
161
|
+
this.suggestionsTop = rect.height + 5;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
mounted() {
|
|
167
|
+
this.calculateSuggestionsTop();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
</script>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="ui-avatar" :class="avatarClass" :style="sizeStyle">
|
|
3
|
+
<img v-if="isImageExist && src" :src="src" :alt="alt" :srcset="srcSet" @error="handleError" :style="{ 'object-fit': fit }" />
|
|
4
|
+
<i v-else-if="icon" :class="icon"></i>
|
|
5
|
+
<slot v-else></slot>
|
|
6
|
+
</span>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'UiAvatar',
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
size: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
validator(val) {
|
|
17
|
+
if (typeof val === 'string') {
|
|
18
|
+
return ['large', 'medium', 'small'].includes(val);
|
|
19
|
+
}
|
|
20
|
+
return typeof val === 'number';
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
shape: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'circle',
|
|
26
|
+
validator(val) {
|
|
27
|
+
return ['circle', 'square'].includes(val);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
icon: String,
|
|
31
|
+
src: String,
|
|
32
|
+
alt: String,
|
|
33
|
+
srcSet: String,
|
|
34
|
+
error: Function,
|
|
35
|
+
fit: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'cover'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
data() {
|
|
42
|
+
return {
|
|
43
|
+
isImageExist: true
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
computed: {
|
|
48
|
+
avatarClass() {
|
|
49
|
+
const { size, icon, shape } = this;
|
|
50
|
+
let classList = ['ui-avatar'];
|
|
51
|
+
|
|
52
|
+
if (size && typeof size === 'string') {
|
|
53
|
+
classList.push(`ui-avatar--${size}`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (icon) {
|
|
57
|
+
classList.push('ui-avatar--icon');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (shape) {
|
|
61
|
+
classList.push(`ui-avatar--${shape}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return classList.join(' ');
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
sizeStyle() {
|
|
68
|
+
const { size } = this;
|
|
69
|
+
return typeof size === 'number' ? {
|
|
70
|
+
height: `${size}px`,
|
|
71
|
+
width: `${size}px`,
|
|
72
|
+
lineHeight: `${size}px`
|
|
73
|
+
} : {};
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
methods: {
|
|
78
|
+
handleError() {
|
|
79
|
+
const { error } = this;
|
|
80
|
+
const errorFlag = error ? error() : undefined;
|
|
81
|
+
if (errorFlag !== false) {
|
|
82
|
+
this.isImageExist = false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
</script>
|