@oinone/kunlun-vue-ui-antd 6.2.0
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 +1 -0
- package/dist/oinone-kunlun-vue-ui-antd.css +1 -0
- package/dist/oinone-kunlun-vue-ui-antd.esm.js +16 -0
- package/dist/oinone-kunlun-vue-ui-antd.scss +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/component/index.d.ts +31 -0
- package/dist/types/src/component/oio-block/index.d.ts +3 -0
- package/dist/types/src/component/oio-block/oio-block.vue.d.ts +39 -0
- package/dist/types/src/component/oio-block/oio-col.vue.d.ts +86 -0
- package/dist/types/src/component/oio-block/oio-row.vue.d.ts +34 -0
- package/dist/types/src/component/oio-breadcrumb/index.d.ts +2 -0
- package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb-item.vue.d.ts +14 -0
- package/dist/types/src/component/oio-breadcrumb/oio-breadcrumb.vue.d.ts +14 -0
- package/dist/types/src/component/oio-button/index.d.ts +1 -0
- package/dist/types/src/component/oio-button/oio-button.vue.d.ts +136 -0
- package/dist/types/src/component/oio-cascader/index.d.ts +1 -0
- package/dist/types/src/component/oio-cascader/oio-cascader.vue.d.ts +236 -0
- package/dist/types/src/component/oio-checkbox/index.d.ts +1 -0
- package/dist/types/src/component/oio-checkbox/oio-checkbox.vue.d.ts +56 -0
- package/dist/types/src/component/oio-collapse/index.d.ts +2 -0
- package/dist/types/src/component/oio-collapse/oio-collapse-panel.vue.d.ts +86 -0
- package/dist/types/src/component/oio-collapse/oio-collapse.vue.d.ts +103 -0
- package/dist/types/src/component/oio-date-time-picker/index.d.ts +5 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-picker.vue.d.ts +182 -0
- package/dist/types/src/component/oio-date-time-picker/oio-date-time-picker.vue.d.ts +240 -0
- package/dist/types/src/component/oio-date-time-picker/oio-time-picker.vue.d.ts +176 -0
- package/dist/types/src/component/oio-date-time-picker/oio-year-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-picker/use-date-time-picker-props.d.ts +15 -0
- package/dist/types/src/component/oio-date-time-range-picker/index.d.ts +5 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-date-range-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue.d.ts +195 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-time-range-picker.vue.d.ts +139 -0
- package/dist/types/src/component/oio-date-time-range-picker/oio-year-range-picker.vue.d.ts +124 -0
- package/dist/types/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.d.ts +12 -0
- package/dist/types/src/component/oio-divider/index.d.ts +2 -0
- package/dist/types/src/component/oio-divider/oio-divider.vue.d.ts +38 -0
- package/dist/types/src/component/oio-drawer/index.d.ts +1 -0
- package/dist/types/src/component/oio-drawer/oio-drawer.vue.d.ts +227 -0
- package/dist/types/src/component/oio-dropdown/index.d.ts +1 -0
- package/dist/types/src/component/oio-dropdown/oio-dropdown.vue.d.ts +78 -0
- package/dist/types/src/component/oio-empty/index.d.ts +1 -0
- package/dist/types/src/component/oio-empty/oio-empty-data.vue.d.ts +42 -0
- package/dist/types/src/component/oio-form/index.d.ts +2 -0
- package/dist/types/src/component/oio-form/oio-form-item.vue.d.ts +126 -0
- package/dist/types/src/component/oio-form/oio-form.vue.d.ts +100 -0
- package/dist/types/src/component/oio-gallery/index.d.ts +1 -0
- package/dist/types/src/component/oio-gallery/oio-gallery.vue.d.ts +98 -0
- package/dist/types/src/component/oio-group/index.d.ts +2 -0
- package/dist/types/src/component/oio-group/oio-group-help.vue.d.ts +65 -0
- package/dist/types/src/component/oio-group/oio-group.vue.d.ts +113 -0
- package/dist/types/src/component/oio-inner-popup/index.d.ts +1 -0
- package/dist/types/src/component/oio-inner-popup/oio-inner-popup.vue.d.ts +195 -0
- package/dist/types/src/component/oio-input/index.d.ts +5 -0
- package/dist/types/src/component/oio-input/oio-input-group.vue.d.ts +16 -0
- package/dist/types/src/component/oio-input/oio-input-number.vue.d.ts +167 -0
- package/dist/types/src/component/oio-input/oio-input-password.vue.d.ts +111 -0
- package/dist/types/src/component/oio-input/oio-input-search.vue.d.ts +106 -0
- package/dist/types/src/component/oio-input/oio-input.vue.d.ts +107 -0
- package/dist/types/src/component/oio-modal/index.d.ts +1 -0
- package/dist/types/src/component/oio-modal/oio-modal.vue.d.ts +230 -0
- package/dist/types/src/component/oio-notification/index.d.ts +116 -0
- package/dist/types/src/component/oio-pagination/index.d.ts +1 -0
- package/dist/types/src/component/oio-pagination/oio-pagination.vue.d.ts +107 -0
- package/dist/types/src/component/oio-popconfirm/index.d.ts +1 -0
- package/dist/types/src/component/oio-popconfirm/oio-popconfirm.vue.d.ts +119 -0
- package/dist/types/src/component/oio-select/index.d.ts +1 -0
- package/dist/types/src/component/oio-select/oio-select.vue.d.ts +153 -0
- package/dist/types/src/component/oio-slider/index.d.ts +1 -0
- package/dist/types/src/component/oio-slider/oio-slider.vue.d.ts +155 -0
- package/dist/types/src/component/oio-spin/index.d.ts +1 -0
- package/dist/types/src/component/oio-spin/oio-spin.vue.d.ts +54 -0
- package/dist/types/src/component/oio-switch/index.d.ts +1 -0
- package/dist/types/src/component/oio-switch/oio-switch.vue.d.ts +92 -0
- package/dist/types/src/component/oio-tabs/index.d.ts +3 -0
- package/dist/types/src/component/oio-tabs/oio-tab.vue.d.ts +67 -0
- package/dist/types/src/component/oio-tabs/oio-tabs.vue.d.ts +93 -0
- package/dist/types/src/component/oio-tabs/use-tab-bar.d.ts +5 -0
- package/dist/types/src/component/oio-textarea/index.d.ts +1 -0
- package/dist/types/src/component/oio-textarea/oio-textarea.vue.d.ts +100 -0
- package/dist/types/src/component/oio-tooltip/index.d.ts +2 -0
- package/dist/types/src/component/oio-tooltip/oio-tooltip-help.vue.d.ts +12 -0
- package/dist/types/src/component/oio-tooltip/oio-tooltip.vue.d.ts +76 -0
- package/dist/types/src/component/oio-tree/index.d.ts +1 -0
- package/dist/types/src/component/oio-tree/oio-tree.vue.d.ts +171 -0
- package/dist/types/src/component/oio-tree-select/index.d.ts +1 -0
- package/dist/types/src/component/oio-tree-select/oio-tree-select.vue.d.ts +226 -0
- package/dist/types/src/component/oio-upload/index.d.ts +1 -0
- package/dist/types/src/component/oio-upload/oio-upload.vue.d.ts +187 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/theme/index.d.ts +1 -0
- package/dist/types/src/vc-component/index.d.ts +1 -0
- package/dist/types/src/vc-component/use-max-tag-placeholder.d.ts +7 -0
- package/index.ts +3 -0
- package/package.json +36 -0
- package/rollup.config.js +15 -0
- package/src/component/index.ts +32 -0
- package/src/component/oio-block/index.ts +3 -0
- package/src/component/oio-block/oio-block.vue +77 -0
- package/src/component/oio-block/oio-col.vue +32 -0
- package/src/component/oio-block/oio-row.vue +42 -0
- package/src/component/oio-block/style/a-col.scss +18 -0
- package/src/component/oio-block/style/index.scss +42 -0
- package/src/component/oio-block/style/parameters.scss +13 -0
- package/src/component/oio-breadcrumb/index.ts +2 -0
- package/src/component/oio-breadcrumb/oio-breadcrumb-item.vue +30 -0
- package/src/component/oio-breadcrumb/oio-breadcrumb.vue +30 -0
- package/src/component/oio-button/index.ts +1 -0
- package/src/component/oio-button/oio-button.vue +154 -0
- package/src/component/oio-button/style/a-button.scss +210 -0
- package/src/component/oio-button/style/index.scss +21 -0
- package/src/component/oio-button/style/parameters.scss +5 -0
- package/src/component/oio-cascader/index.ts +1 -0
- package/src/component/oio-cascader/oio-cascader.vue +171 -0
- package/src/component/oio-cascader/style/index.scss +59 -0
- package/src/component/oio-cascader/style/parameters.scss +5 -0
- package/src/component/oio-checkbox/index.ts +1 -0
- package/src/component/oio-checkbox/oio-checkbox.vue +69 -0
- package/src/component/oio-checkbox/style/index.scss +8 -0
- package/src/component/oio-checkbox/style/parameters.scss +5 -0
- package/src/component/oio-collapse/index.ts +2 -0
- package/src/component/oio-collapse/oio-collapse-panel.vue +92 -0
- package/src/component/oio-collapse/oio-collapse.vue +138 -0
- package/src/component/oio-collapse/style/index.scss +59 -0
- package/src/component/oio-collapse/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/index.ts +5 -0
- package/src/component/oio-date-time-picker/oio-date-picker.vue +34 -0
- package/src/component/oio-date-time-picker/oio-date-time-picker.vue +91 -0
- package/src/component/oio-date-time-picker/oio-time-picker.vue +34 -0
- package/src/component/oio-date-time-picker/oio-year-picker.vue +34 -0
- package/src/component/oio-date-time-picker/style/index.scss +348 -0
- package/src/component/oio-date-time-picker/style/mixin.scss +16 -0
- package/src/component/oio-date-time-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-picker/use-date-time-picker-props.ts +151 -0
- package/src/component/oio-date-time-range-picker/index.ts +5 -0
- package/src/component/oio-date-time-range-picker/oio-date-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/oio-date-time-range-picker.vue +82 -0
- package/src/component/oio-date-time-range-picker/oio-time-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/oio-year-range-picker.vue +29 -0
- package/src/component/oio-date-time-range-picker/style/index.scss +227 -0
- package/src/component/oio-date-time-range-picker/style/parameters.scss +5 -0
- package/src/component/oio-date-time-range-picker/use-date-time-range-picker-props.ts +138 -0
- package/src/component/oio-divider/index.ts +3 -0
- package/src/component/oio-divider/oio-divider.vue +31 -0
- package/src/component/oio-divider/style/index.scss +7 -0
- package/src/component/oio-divider/style/parameters.scss +5 -0
- package/src/component/oio-drawer/index.ts +1 -0
- package/src/component/oio-drawer/oio-drawer.vue +120 -0
- package/src/component/oio-drawer/style/index.scss +93 -0
- package/src/component/oio-drawer/style/parameters.scss +5 -0
- package/src/component/oio-dropdown/index.ts +1 -0
- package/src/component/oio-dropdown/oio-dropdown.vue +81 -0
- package/src/component/oio-dropdown/style/index.scss +30 -0
- package/src/component/oio-dropdown/style/parameters.scss +5 -0
- package/src/component/oio-empty/index.ts +1 -0
- package/src/component/oio-empty/oio-empty-data.vue +47 -0
- package/src/component/oio-empty/style/index.scss +6 -0
- package/src/component/oio-form/index.ts +2 -0
- package/src/component/oio-form/oio-form-item.vue +81 -0
- package/src/component/oio-form/oio-form.vue +102 -0
- package/src/component/oio-form/style/animation.scss +17 -0
- package/src/component/oio-form/style/index.scss +135 -0
- package/src/component/oio-form/style/parameters.scss +9 -0
- package/src/component/oio-gallery/index.ts +1 -0
- package/src/component/oio-gallery/oio-gallery.vue +158 -0
- package/src/component/oio-group/index.ts +2 -0
- package/src/component/oio-group/oio-group-help.vue +28 -0
- package/src/component/oio-group/oio-group.vue +140 -0
- package/src/component/oio-group/style/index.scss +98 -0
- package/src/component/oio-group/style/parameters.scss +5 -0
- package/src/component/oio-inner-popup/index.ts +1 -0
- package/src/component/oio-inner-popup/oio-inner-popup.vue +230 -0
- package/src/component/oio-inner-popup/style/index.scss +147 -0
- package/src/component/oio-inner-popup/style/parameters.scss +5 -0
- package/src/component/oio-input/index.ts +5 -0
- package/src/component/oio-input/oio-input-group.vue +40 -0
- package/src/component/oio-input/oio-input-number.vue +374 -0
- package/src/component/oio-input/oio-input-password.vue +67 -0
- package/src/component/oio-input/oio-input-search.vue +107 -0
- package/src/component/oio-input/oio-input.vue +124 -0
- package/src/component/oio-input/style/a-input.scss +103 -0
- package/src/component/oio-input/style/index.scss +198 -0
- package/src/component/oio-input/style/mixin.scss +50 -0
- package/src/component/oio-input/style/oio-input-group.scss +31 -0
- package/src/component/oio-input/style/oio-input-number.scss +13 -0
- package/src/component/oio-input/style/oio-input-search.scss +94 -0
- package/src/component/oio-input/style/parameters.scss +21 -0
- package/src/component/oio-modal/index.ts +1 -0
- package/src/component/oio-modal/index.zh-CN.md +167 -0
- package/src/component/oio-modal/oio-modal.vue +184 -0
- package/src/component/oio-modal/style/index.scss +167 -0
- package/src/component/oio-modal/style/parameters.scss +5 -0
- package/src/component/oio-notification/index.ts +197 -0
- package/src/component/oio-notification/style/index.scss +67 -0
- package/src/component/oio-notification/style/parameters.scss +5 -0
- package/src/component/oio-pagination/index.ts +1 -0
- package/src/component/oio-pagination/oio-pagination.vue +105 -0
- package/src/component/oio-pagination/style/index.scss +181 -0
- package/src/component/oio-pagination/style/parameters.scss +5 -0
- package/src/component/oio-popconfirm/index.ts +1 -0
- package/src/component/oio-popconfirm/oio-popconfirm.vue +192 -0
- package/src/component/oio-popconfirm/style/index.scss +54 -0
- package/src/component/oio-popconfirm/style/parameters.scss +5 -0
- package/src/component/oio-popover/style/index.scss +16 -0
- package/src/component/oio-popover/style/parameters.scss +5 -0
- package/src/component/oio-radio/style/index.scss +24 -0
- package/src/component/oio-radio/style/parameters.scss +5 -0
- package/src/component/oio-select/index.ts +1 -0
- package/src/component/oio-select/oio-select.vue +104 -0
- package/src/component/oio-select/style/a-select.scss +102 -0
- package/src/component/oio-select/style/index.scss +129 -0
- package/src/component/oio-select/style/mixin.scss +18 -0
- package/src/component/oio-select/style/parameters.scss +5 -0
- package/src/component/oio-slider/index.ts +1 -0
- package/src/component/oio-slider/oio-slider.vue +81 -0
- package/src/component/oio-slider/style/index.scss +100 -0
- package/src/component/oio-slider/style/parameters.scss +5 -0
- package/src/component/oio-spin/index.ts +1 -0
- package/src/component/oio-spin/oio-spin.vue +87 -0
- package/src/component/oio-spin/style/index.scss +48 -0
- package/src/component/oio-spin/style/parameters.scss +5 -0
- package/src/component/oio-switch/index.ts +1 -0
- package/src/component/oio-switch/oio-switch.vue +42 -0
- package/src/component/oio-switch/style/index.scss +36 -0
- package/src/component/oio-switch/style/parameters.scss +5 -0
- package/src/component/oio-tabs/index.ts +3 -0
- package/src/component/oio-tabs/oio-tab.vue +99 -0
- package/src/component/oio-tabs/oio-tabs.vue +188 -0
- package/src/component/oio-tabs/style/index.scss +274 -0
- package/src/component/oio-tabs/style/parameters.scss +9 -0
- package/src/component/oio-tabs/use-tab-bar.ts +69 -0
- package/src/component/oio-textarea/index.ts +1 -0
- package/src/component/oio-textarea/oio-textarea.vue +76 -0
- package/src/component/oio-textarea/style/index.scss +108 -0
- package/src/component/oio-textarea/style/parameters.scss +5 -0
- package/src/component/oio-tooltip/index.ts +2 -0
- package/src/component/oio-tooltip/oio-tooltip-help.vue +40 -0
- package/src/component/oio-tooltip/oio-tooltip.vue +59 -0
- package/src/component/oio-tooltip/style/index.scss +8 -0
- package/src/component/oio-tooltip/style/parameters.scss +9 -0
- package/src/component/oio-tree/index.ts +1 -0
- package/src/component/oio-tree/oio-tree.vue +181 -0
- package/src/component/oio-tree/style/index.scss +51 -0
- package/src/component/oio-tree/style/parameters.scss +5 -0
- package/src/component/oio-tree-select/index.ts +1 -0
- package/src/component/oio-tree-select/oio-tree-select.vue +180 -0
- package/src/component/oio-tree-select/style/index.scss +92 -0
- package/src/component/oio-tree-select/style/parameters.scss +5 -0
- package/src/component/oio-upload/index.ts +1 -0
- package/src/component/oio-upload/oio-upload.vue +232 -0
- package/src/component/oio-upload/style/index.scss +66 -0
- package/src/component/oio-upload/style/parameters.scss +5 -0
- package/src/index.ts +3 -0
- package/src/shim-translate.d.ts +7 -0
- package/src/shim-vue.d.ts +6 -0
- package/src/style/global-parameters.scss +9 -0
- package/src/style/index.scss +31 -0
- package/src/style/mixin.scss +135 -0
- package/src/theme/index.ts +1 -0
- package/src/vc-component/index.ts +1 -0
- package/src/vc-component/use-max-tag-placeholder.ts +38 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import {
|
|
4
|
+
convertAntdDropdownPlacement,
|
|
5
|
+
OioDropdownPlacement,
|
|
6
|
+
OioDropdownProps,
|
|
7
|
+
OioDropdownTrigger,
|
|
8
|
+
PropRecordHelper
|
|
9
|
+
} from '@oinone/kunlun-vue-ui-common';
|
|
10
|
+
import { Dropdown as ADropdown } from 'ant-design-vue';
|
|
11
|
+
import { isNil, isString } from 'lodash-es';
|
|
12
|
+
import { computed, createVNode, defineComponent } from 'vue';
|
|
13
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
14
|
+
|
|
15
|
+
export default defineComponent({
|
|
16
|
+
name: 'OioDropdown',
|
|
17
|
+
components: {
|
|
18
|
+
ADropdown
|
|
19
|
+
},
|
|
20
|
+
inheritAttrs: false,
|
|
21
|
+
props: {
|
|
22
|
+
...OioDropdownProps
|
|
23
|
+
},
|
|
24
|
+
slots: ['default', 'overlay'],
|
|
25
|
+
emits: ['update:value'],
|
|
26
|
+
setup(props, context) {
|
|
27
|
+
const trigger = computed<string[]>(() => {
|
|
28
|
+
const triggers: string[] = [];
|
|
29
|
+
const triggerProp = props.trigger;
|
|
30
|
+
if (isNil(triggerProp)) {
|
|
31
|
+
triggers.push(OioDropdownTrigger.hover);
|
|
32
|
+
triggers.push(OioDropdownTrigger.click);
|
|
33
|
+
} else if (isString(triggerProp)) {
|
|
34
|
+
triggers.push(triggerProp);
|
|
35
|
+
} else {
|
|
36
|
+
for (const tgr of triggerProp) {
|
|
37
|
+
triggers.push(tgr);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return triggers;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const placement = computed<string | undefined>(() => {
|
|
44
|
+
return convertAntdDropdownPlacement(props.placement as OioDropdownPlacement);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const onUpdateValue = (val: boolean) => {
|
|
48
|
+
context.emit('update:value', val);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
trigger,
|
|
53
|
+
placement,
|
|
54
|
+
|
|
55
|
+
onUpdateValue
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
render() {
|
|
59
|
+
const componentData: Record<string, unknown> = {
|
|
60
|
+
...PropRecordHelper.collectionBasicProps(this.$attrs, [`${DEFAULT_PREFIX}-dropdown`]),
|
|
61
|
+
disabled: this.disabled,
|
|
62
|
+
trigger: this.trigger,
|
|
63
|
+
placement: this.placement,
|
|
64
|
+
overlayStyle: this.overlayStyle,
|
|
65
|
+
forceRender: this.forceRender,
|
|
66
|
+
destroyPopupOnHide: this.destroyOnHide,
|
|
67
|
+
getPopupContainer: this.getTriggerContainer,
|
|
68
|
+
'onUpdate:visible': () => {},
|
|
69
|
+
onVisibleChange: this.onUpdateValue,
|
|
70
|
+
overlayClassName: StringHelper.append(
|
|
71
|
+
[`${DEFAULT_PREFIX}-dropdown-overlay`],
|
|
72
|
+
CastHelper.cast(this.overlayClassName)
|
|
73
|
+
).join(' ')
|
|
74
|
+
};
|
|
75
|
+
if (this.value != null) {
|
|
76
|
+
componentData.visible = this.value;
|
|
77
|
+
}
|
|
78
|
+
return createVNode(ADropdown, componentData, PropRecordHelper.collectionSlots(this.$slots, ['default', 'overlay']));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import '../../../style/mixin.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
|
|
4
|
+
.#{$dropdownClassPrefix}-overlay {
|
|
5
|
+
.ant-dropdown-menu {
|
|
6
|
+
background-color: var(--oio-dropdown-background-color);
|
|
7
|
+
box-shadow: var(--oio-dropdown-box-shadow);
|
|
8
|
+
border-radius: var(--oio-border-radius);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ant-dropdown-menu-item,
|
|
12
|
+
.ant-dropdown-menu-submenu-title {
|
|
13
|
+
color: var(--oio-dropdown-color);
|
|
14
|
+
|
|
15
|
+
&:hover {
|
|
16
|
+
background-color: var(--oio-dropdown-item-background-color-hover);
|
|
17
|
+
color: var(--oio-dropdown-color-hover);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ant-dropdown-menu-item-disabled,
|
|
22
|
+
.ant-dropdown-menu-submenu-title-disabled {
|
|
23
|
+
color: var(--oio-dropdown-color-disabled);
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
background-color: var(--oio-dropdown-item-background-color-disabled-hover);
|
|
27
|
+
color: var(--oio-dropdown-color-disabled-hover);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioEmptyData } from './oio-empty-data.vue';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { OioEmptyDataProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
3
|
+
import { Empty as AEmpty } from 'ant-design-vue';
|
|
4
|
+
import { createVNode, defineComponent } from 'vue';
|
|
5
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
6
|
+
import { OioSpin } from '../oio-spin';
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
name: 'OioEmptyData',
|
|
10
|
+
components: {
|
|
11
|
+
AEmpty,
|
|
12
|
+
OioSpin
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
...OioEmptyDataProps
|
|
16
|
+
},
|
|
17
|
+
slots: ['image', 'description'],
|
|
18
|
+
render() {
|
|
19
|
+
const { loading, loadingIndicator, wrapperClassName, image } = this;
|
|
20
|
+
const slots = PropRecordHelper.collectionSlots(this.$slots, [{ origin: 'image' }, { origin: 'description' }]);
|
|
21
|
+
let { description } = this;
|
|
22
|
+
if (!slots.description && !description) {
|
|
23
|
+
description = this.$translate('暂无数据');
|
|
24
|
+
}
|
|
25
|
+
const componentProps = {
|
|
26
|
+
...PropRecordHelper.collectionBasicProps(this.$attrs, [`${DEFAULT_PREFIX}-empty-data`]),
|
|
27
|
+
image,
|
|
28
|
+
description
|
|
29
|
+
};
|
|
30
|
+
const component = createVNode(AEmpty, componentProps, slots);
|
|
31
|
+
if (loading == null) {
|
|
32
|
+
return component;
|
|
33
|
+
}
|
|
34
|
+
return createVNode(
|
|
35
|
+
OioSpin,
|
|
36
|
+
{
|
|
37
|
+
loading,
|
|
38
|
+
loadingIndicator,
|
|
39
|
+
wrapperClassName
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
default: () => [component]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import {
|
|
4
|
+
AFormItemProps,
|
|
5
|
+
FormLayout,
|
|
6
|
+
OioFormItemProps,
|
|
7
|
+
PropRecordHelper,
|
|
8
|
+
useInjectOioFormContext
|
|
9
|
+
} from '@oinone/kunlun-vue-ui-common';
|
|
10
|
+
import { FormItem as AFormItem } from 'ant-design-vue';
|
|
11
|
+
import { computed, createVNode, defineComponent, ref } from 'vue';
|
|
12
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
13
|
+
|
|
14
|
+
export default defineComponent({
|
|
15
|
+
name: 'OioFormItem',
|
|
16
|
+
components: {
|
|
17
|
+
AFormItem
|
|
18
|
+
},
|
|
19
|
+
inheritAttrs: false,
|
|
20
|
+
props: {
|
|
21
|
+
...OioFormItemProps
|
|
22
|
+
},
|
|
23
|
+
slots: ['default', 'label', 'extra', 'help'],
|
|
24
|
+
setup(props, context) {
|
|
25
|
+
const origin = ref();
|
|
26
|
+
const formContext = useInjectOioFormContext();
|
|
27
|
+
|
|
28
|
+
const vertical = computed(() => {
|
|
29
|
+
let layout = props.layout;
|
|
30
|
+
if (!layout && formContext) {
|
|
31
|
+
layout = formContext.layout.value;
|
|
32
|
+
}
|
|
33
|
+
return layout === FormLayout.vertical;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// fixme @zbh 打包后 useInjectForm获取的对象与FormItem使用useInjectForm获取的对象不一致,目前使用自定义的OioFormContext进行处理
|
|
37
|
+
// const subFormContext = { ...formContext };
|
|
38
|
+
// subFormContext.vertical = vertical;
|
|
39
|
+
// useProvideForm(subFormContext);
|
|
40
|
+
|
|
41
|
+
context.expose({
|
|
42
|
+
isVertical: () => vertical.value,
|
|
43
|
+
onFieldBlur: () => origin.value.onFieldBlur(),
|
|
44
|
+
onFieldChange: () => origin.value.onFieldChange(),
|
|
45
|
+
clearValidate: () => origin.value.clearValidate(),
|
|
46
|
+
resetField: () => origin.value.resetField()
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
origin,
|
|
51
|
+
vertical
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
render() {
|
|
55
|
+
const formItemClassList = [`${DEFAULT_PREFIX}-form-item`];
|
|
56
|
+
if (this.vertical) {
|
|
57
|
+
formItemClassList.push(`${DEFAULT_PREFIX}-form-item-vertical`);
|
|
58
|
+
} else {
|
|
59
|
+
formItemClassList.push(`${DEFAULT_PREFIX}-form-item-horizontal`);
|
|
60
|
+
}
|
|
61
|
+
return createVNode(
|
|
62
|
+
AFormItem,
|
|
63
|
+
{
|
|
64
|
+
...PropRecordHelper.convert(AFormItemProps, CastHelper.cast(this)),
|
|
65
|
+
...this.$attrs,
|
|
66
|
+
class: StringHelper.append(formItemClassList, CastHelper.cast(this.$attrs.class)),
|
|
67
|
+
ref: 'origin'
|
|
68
|
+
},
|
|
69
|
+
PropRecordHelper.collectionSlots(this.$slots, [
|
|
70
|
+
{
|
|
71
|
+
origin: 'default',
|
|
72
|
+
isNotNull: true
|
|
73
|
+
},
|
|
74
|
+
'label',
|
|
75
|
+
'extra',
|
|
76
|
+
'help'
|
|
77
|
+
])
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import {
|
|
4
|
+
NamePath,
|
|
5
|
+
OioFormInstance,
|
|
6
|
+
OioFormProps,
|
|
7
|
+
PropRecordHelper,
|
|
8
|
+
useOioFormLayoutContext
|
|
9
|
+
} from '@oinone/kunlun-vue-ui-common';
|
|
10
|
+
import { Form as AForm, FormInstance as AFormInstance } from 'ant-design-vue';
|
|
11
|
+
import { isNil } from 'lodash-es';
|
|
12
|
+
import { createVNode, defineComponent, ref, VNode } from 'vue';
|
|
13
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
14
|
+
import { OioSpin } from '../oio-spin';
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'OioForm',
|
|
18
|
+
components: {
|
|
19
|
+
AForm,
|
|
20
|
+
OioSpin
|
|
21
|
+
},
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
props: {
|
|
24
|
+
...OioFormProps
|
|
25
|
+
},
|
|
26
|
+
setup(props, context) {
|
|
27
|
+
useOioFormLayoutContext(props);
|
|
28
|
+
|
|
29
|
+
const origin = ref<AFormInstance>();
|
|
30
|
+
|
|
31
|
+
const instance: OioFormInstance<AFormInstance> = {
|
|
32
|
+
getOrigin(): AFormInstance {
|
|
33
|
+
return origin.value!;
|
|
34
|
+
},
|
|
35
|
+
resetFields: async (names?: NamePath) => {
|
|
36
|
+
origin.value!.resetFields(CastHelper.cast(names));
|
|
37
|
+
},
|
|
38
|
+
clearValidate: async (names?: NamePath) => {
|
|
39
|
+
origin.value!.clearValidate(CastHelper.cast(names));
|
|
40
|
+
},
|
|
41
|
+
validate: async (names?: NamePath) => {
|
|
42
|
+
return origin.value!.validate(CastHelper.cast(names));
|
|
43
|
+
},
|
|
44
|
+
validateFields: async (names?: NamePath) => {
|
|
45
|
+
return origin.value!.validateFields(CastHelper.cast(names));
|
|
46
|
+
},
|
|
47
|
+
scrollToField: async (names?: NamePath) => {
|
|
48
|
+
origin.value!.scrollToField(CastHelper.cast(names));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
context.expose(instance);
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
origin
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
render() {
|
|
59
|
+
const formComponent: VNode = createVNode(
|
|
60
|
+
AForm,
|
|
61
|
+
{
|
|
62
|
+
name: this.name,
|
|
63
|
+
rules: this.rules,
|
|
64
|
+
layout: this.layout,
|
|
65
|
+
labelCol: this.labelCol,
|
|
66
|
+
wrapperCol: this.wrapperCol,
|
|
67
|
+
labelAlign: this.labelAlign,
|
|
68
|
+
colon: this.colon,
|
|
69
|
+
validateTrigger: this.validateTrigger,
|
|
70
|
+
validateOnRuleChange: this.validateOnRuleChange,
|
|
71
|
+
...this.$attrs,
|
|
72
|
+
model: this.data,
|
|
73
|
+
class: StringHelper.append([`${DEFAULT_PREFIX}-form`], CastHelper.cast(this.$attrs.class)),
|
|
74
|
+
ref: 'origin'
|
|
75
|
+
},
|
|
76
|
+
PropRecordHelper.collectionSlots(this.$slots, [
|
|
77
|
+
{
|
|
78
|
+
origin: 'default',
|
|
79
|
+
isNotNull: true
|
|
80
|
+
}
|
|
81
|
+
])
|
|
82
|
+
);
|
|
83
|
+
if (isNil(this.loading)) {
|
|
84
|
+
return formComponent;
|
|
85
|
+
}
|
|
86
|
+
return createVNode(
|
|
87
|
+
OioSpin,
|
|
88
|
+
{
|
|
89
|
+
loading: this.loading,
|
|
90
|
+
loadingIndicator: this.loadingIndicator,
|
|
91
|
+
wrapperClassName: StringHelper.append(
|
|
92
|
+
[`${DEFAULT_PREFIX}-form-wrapper`],
|
|
93
|
+
CastHelper.cast(this.wrapperClassName)
|
|
94
|
+
).join(' ')
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
default: () => [formComponent]
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
@import '../../oio-input/style/parameters.scss';
|
|
2
|
+
@import './parameters.scss';
|
|
3
|
+
@import './animation.scss';
|
|
4
|
+
|
|
5
|
+
@mixin form-item-label {
|
|
6
|
+
max-height: var(--oio-horizontal-label-height);
|
|
7
|
+
height: auto;
|
|
8
|
+
min-height: var($parameterPrefix + -height);
|
|
9
|
+
max-width: var(--ss-ant-form-item-label-width);
|
|
10
|
+
margin-bottom: 0;
|
|
11
|
+
padding-bottom: 0;
|
|
12
|
+
text-align: right;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: flex-end;
|
|
16
|
+
|
|
17
|
+
& > label {
|
|
18
|
+
max-height: var(--oio-horizontal-label-height);
|
|
19
|
+
height: auto;
|
|
20
|
+
line-height: var($parameterPrefix + -height-sm);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.#{$formClassPrefix} {
|
|
25
|
+
.oio-form-item {
|
|
26
|
+
margin-bottom: var($parameterPrefix + -margin-lg);
|
|
27
|
+
|
|
28
|
+
&.ant-form-item-with-help {
|
|
29
|
+
margin-bottom: var($parameterPrefix + -margin-lg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.#{$formItemClassPrefix}.#{$formItemClassPrefix}-horizontal {
|
|
34
|
+
flex-flow: row nowrap;
|
|
35
|
+
align-items: center;
|
|
36
|
+
|
|
37
|
+
& > .ant-form-item-label {
|
|
38
|
+
@include form-item-label;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.#{$formItemClassPrefix}-vertical {
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.#{$formItemClassPrefix} {
|
|
47
|
+
& > .ant-form-item-label {
|
|
48
|
+
align-self: flex-start;
|
|
49
|
+
|
|
50
|
+
& > label {
|
|
51
|
+
font-size: var($parameterPrefix + -font-size);
|
|
52
|
+
color: var($parameterPrefix + -text-color);
|
|
53
|
+
font-weight: var($parameterPrefix + -font-weight);
|
|
54
|
+
height: var($parameterPrefix + -height);
|
|
55
|
+
line-height: var($parameterPrefix + -height);
|
|
56
|
+
vertical-align: top;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-form-item-explain,
|
|
61
|
+
.ant-form-item-extra {
|
|
62
|
+
margin-top: 4px;
|
|
63
|
+
width: 100%;
|
|
64
|
+
min-height: var($parameterPrefix + -line-height-sm);
|
|
65
|
+
line-height: var($parameterPrefix + -line-height-sm);
|
|
66
|
+
font-size: var($parameterPrefix + -font-size-sm);
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
color: var(--oio-placeholder-color);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&.ant-form-vertical {
|
|
75
|
+
.#{$formItemClassPrefix}-vertical {
|
|
76
|
+
& > .ant-form-item-label {
|
|
77
|
+
height: var(--oio-label-height);
|
|
78
|
+
line-height: 18px;
|
|
79
|
+
flex-basis: var(--oio-label-height);
|
|
80
|
+
padding: 0;
|
|
81
|
+
margin-bottom: var($parameterPrefix + -margin-xs);
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
word-break: break-all;
|
|
86
|
+
|
|
87
|
+
& > label {
|
|
88
|
+
height: var(--oio-label-height);
|
|
89
|
+
line-height: var(--oio-label-height);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ant-form-item-extra,
|
|
94
|
+
.ant-form-item-explain {
|
|
95
|
+
margin-top: 4px;
|
|
96
|
+
min-height: var($parameterPrefix + -line-height-xxs);
|
|
97
|
+
font-size: var($parameterPrefix + -font-size-sm);
|
|
98
|
+
line-height: var($parameterPrefix + -line-height-xxs);
|
|
99
|
+
color: var(--oio-placeholder-color);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.#{$formItemClassPrefix}-horizontal {
|
|
104
|
+
flex-flow: row nowrap;
|
|
105
|
+
|
|
106
|
+
& > .ant-form-item-label {
|
|
107
|
+
@include form-item-label;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.#{$formItemClassPrefix} {
|
|
114
|
+
&.ant-form-item-has-error {
|
|
115
|
+
& > .ant-form-item-control > .ant-form-item-extra {
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.oio-input,
|
|
120
|
+
.ant-calendar-picker-input {
|
|
121
|
+
border-color: var($inputParameterPrefix + -error-border-color);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector {
|
|
125
|
+
background: var(--oio-select-background);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.ant-form-item-has-error .ant-input-number:not([disabled]):hover,
|
|
131
|
+
.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor,
|
|
132
|
+
.ant-form-item-has-error .ant-mention-wrapper .ant-mention-editor:not([disabled]):hover,
|
|
133
|
+
.ant-form-item-has-error .ant-picker:not([disabled]):hover {
|
|
134
|
+
background-color: var(--oio-input-background-hover);
|
|
135
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@import '../../../style/global-parameters.scss';
|
|
2
|
+
|
|
3
|
+
$formPrefix: $prefix + -form;
|
|
4
|
+
$formParameterPrefix: $parameterPrefix + -form;
|
|
5
|
+
$formClassPrefix: $formPrefix;
|
|
6
|
+
|
|
7
|
+
$formItemPrefix: $prefix + -form-item;
|
|
8
|
+
$formItemParameterPrefix: $parameterPrefix + -form-item;
|
|
9
|
+
$formItemClassPrefix: $formItemPrefix;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as OioGallery } from './oio-gallery.vue';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CastHelper, CSSStyle, StringHelper } from '@oinone/kunlun-shared';
|
|
3
|
+
import { OioGalleryItem, OioGalleryProps, PropRecordHelper } from '@oinone/kunlun-vue-ui-common';
|
|
4
|
+
import { isNil, isObject, isString } from 'lodash-es';
|
|
5
|
+
import { computed, createVNode, defineComponent, VNode } from 'vue';
|
|
6
|
+
import { DEFAULT_PREFIX } from '../../theme';
|
|
7
|
+
import { OioCol, OioRow } from '../oio-block';
|
|
8
|
+
import { OioEmptyData } from '../oio-empty';
|
|
9
|
+
import { OioSpin } from '../oio-spin';
|
|
10
|
+
|
|
11
|
+
function generatorKey(data: Record<string, unknown>, itemKey: string): string | undefined {
|
|
12
|
+
const key = data[itemKey];
|
|
13
|
+
if (isString(key)) {
|
|
14
|
+
return key;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default defineComponent({
|
|
20
|
+
name: 'OioGallery',
|
|
21
|
+
inheritAttrs: false,
|
|
22
|
+
components: {
|
|
23
|
+
OioCol,
|
|
24
|
+
OioEmptyData,
|
|
25
|
+
OioRow,
|
|
26
|
+
OioSpin
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
...OioGalleryProps
|
|
30
|
+
},
|
|
31
|
+
slots: ['default', 'header', 'footer'],
|
|
32
|
+
setup(props) {
|
|
33
|
+
const cols = computed(() => props.cols || 4);
|
|
34
|
+
|
|
35
|
+
const gutter = computed(() => {
|
|
36
|
+
if (props.gutter == null) {
|
|
37
|
+
return '16,16';
|
|
38
|
+
}
|
|
39
|
+
return props.gutter;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const flexBasic = computed(() => {
|
|
43
|
+
return 100 / cols.value;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const flex = computed(() => {
|
|
47
|
+
return `1 0 ${flexBasic.value}%`;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const rowStyle = computed(() => {
|
|
51
|
+
const style = {} as CSSStyle;
|
|
52
|
+
if (cols.value === 1) {
|
|
53
|
+
style.flexDirection = 'column';
|
|
54
|
+
style.alignItems = 'center';
|
|
55
|
+
}
|
|
56
|
+
return style;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const colStyle = computed(() => {
|
|
60
|
+
let style = {} as CSSStyle;
|
|
61
|
+
const defaultWidth = `${flexBasic.value}%`;
|
|
62
|
+
style.minWidth = defaultWidth;
|
|
63
|
+
style.maxWidth = defaultWidth;
|
|
64
|
+
if (isObject(props.itemStyle)) {
|
|
65
|
+
const hasWidth = !isNil(props.itemStyle?.width);
|
|
66
|
+
const hasMinWidth = !isNil(props.itemStyle?.minWidth);
|
|
67
|
+
const hasMaxWidth = !isNil(props.itemStyle?.maxWidth);
|
|
68
|
+
if (hasWidth) {
|
|
69
|
+
style.minWidth = CastHelper.cast(null);
|
|
70
|
+
style.maxWidth = CastHelper.cast(null);
|
|
71
|
+
} else if (hasMaxWidth && !hasMinWidth) {
|
|
72
|
+
style.minWidth = CastHelper.cast(null);
|
|
73
|
+
}
|
|
74
|
+
style = {
|
|
75
|
+
...style,
|
|
76
|
+
...props.itemStyle
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return style;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
gutter,
|
|
84
|
+
flex,
|
|
85
|
+
rowStyle,
|
|
86
|
+
colStyle
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
render() {
|
|
90
|
+
const {
|
|
91
|
+
default: defaultSlot,
|
|
92
|
+
header: headerSlot,
|
|
93
|
+
footer: footerSlot
|
|
94
|
+
} = PropRecordHelper.collectionSlots(this.$slots, [
|
|
95
|
+
{ origin: 'default', isNotNull: true },
|
|
96
|
+
{ origin: 'header' },
|
|
97
|
+
{ origin: 'footer' }
|
|
98
|
+
]);
|
|
99
|
+
const children: VNode[] = [];
|
|
100
|
+
if (headerSlot) {
|
|
101
|
+
children.push(createVNode('div', { class: `${DEFAULT_PREFIX}-gallery-header` }, headerSlot()));
|
|
102
|
+
}
|
|
103
|
+
const rowChildren: VNode[] = [];
|
|
104
|
+
this.list?.forEach((data: Record<string, unknown>, index) => {
|
|
105
|
+
const key = generatorKey(data, this.itemKey);
|
|
106
|
+
const colChildren = defaultSlot({ key, data, index } as OioGalleryItem);
|
|
107
|
+
rowChildren.push(
|
|
108
|
+
createVNode(
|
|
109
|
+
OioCol,
|
|
110
|
+
{
|
|
111
|
+
key,
|
|
112
|
+
flex: this.flex,
|
|
113
|
+
class: StringHelper.append([`${DEFAULT_PREFIX}-gallery-item`], CastHelper.cast(this.itemClassName)),
|
|
114
|
+
style: this.colStyle
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
default: () => colChildren
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
if (rowChildren.length) {
|
|
123
|
+
children.push(
|
|
124
|
+
createVNode(
|
|
125
|
+
OioRow,
|
|
126
|
+
{ class: `${DEFAULT_PREFIX}-gallery-content`, gutter: this.gutter, wrap: true, style: this.rowStyle },
|
|
127
|
+
{ default: () => rowChildren }
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
} else {
|
|
131
|
+
children.push(createVNode(OioEmptyData, { class: `${DEFAULT_PREFIX}-gallery-content` }));
|
|
132
|
+
}
|
|
133
|
+
if (footerSlot) {
|
|
134
|
+
children.push(createVNode('div', { class: `${DEFAULT_PREFIX}-gallery-footer` }, footerSlot()));
|
|
135
|
+
}
|
|
136
|
+
const gallery = createVNode(
|
|
137
|
+
'div',
|
|
138
|
+
PropRecordHelper.collectionBasicProps(this.$attrs, [`${DEFAULT_PREFIX}-gallery`]),
|
|
139
|
+
children
|
|
140
|
+
);
|
|
141
|
+
if (isNil(this.loading)) {
|
|
142
|
+
return gallery;
|
|
143
|
+
}
|
|
144
|
+
return createVNode(
|
|
145
|
+
OioSpin,
|
|
146
|
+
{
|
|
147
|
+
class: 'default-main-view-spin',
|
|
148
|
+
loading: this.loading,
|
|
149
|
+
loadingIndicator: this.loadingIndicator,
|
|
150
|
+
wrapperClassName: StringHelper.append([`${DEFAULT_PREFIX}-gallery-wrapper`], this.wrapperClassName)
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
default: () => [gallery]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
</script>
|