@ctzy-web-client/plugin-component-vue 1.0.0 → 1.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/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/advance-select/advance-operation.mjs +43 -0
- package/es/advance-select/advance-option.mjs +125 -0
- package/es/advance-select/advance-select.mjs +359 -0
- package/es/advance-select/events-helpers.mjs +29 -0
- package/es/advance-select/index.mjs +13 -0
- package/es/advance-select/use-advance-option.mjs +43 -0
- package/es/advance-select/use-advance-select.mjs +117 -0
- package/es/application-slot/application-slot.mjs +51 -0
- package/es/application-slot/breadcrumb-item.mjs +23 -0
- package/es/application-slot/header-tools-item.mjs +23 -0
- package/es/application-slot/index.mjs +16 -0
- package/es/breadcrumb-select/breadcrumb-select.mjs +155 -0
- package/es/breadcrumb-select/index.mjs +6 -0
- package/es/components.mjs +22 -0
- package/es/contextmenu/contextmenu-item.mjs +21 -0
- package/es/contextmenu/contextmenu.mjs +64 -0
- package/es/contextmenu/index.mjs +10 -0
- package/es/contextmenu/use-contextmenu.mjs +85 -0
- package/es/data-form/data-form-item.mjs +53 -0
- package/es/data-form/data-form.mjs +175 -0
- package/es/data-form/dynamic-component.mjs +23 -0
- package/es/data-form/form-components/Blots/AtBlot.mjs +25 -0
- package/es/data-form/form-components/bwa-date-picker.mjs +45 -0
- package/es/data-form/form-components/bwa-date-time-picker.mjs +50 -0
- package/es/data-form/form-components/bwa-input-float.mjs +43 -0
- package/es/data-form/form-components/bwa-input-integer.mjs +56 -0
- package/es/data-form/form-components/bwa-input.mjs +38 -0
- package/es/data-form/form-components/bwa-multi-select.mjs +35 -0
- package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +234 -0
- package/es/data-form/form-components/bwa-rich-text.mjs +325 -0
- package/es/data-form/form-components/bwa-select.mjs +76 -0
- package/es/data-form/form-components/bwa-textarea.mjs +33 -0
- package/es/data-form/form-components/bwa-upload.mjs +159 -0
- package/es/data-form/form-components/bwa-user-multi-select.mjs +30 -0
- package/es/data-form/form-components/bwa-user-select.mjs +69 -0
- package/es/data-form/index.mjs +34 -0
- package/es/data-table/data-column-view.mjs +131 -0
- package/es/data-table/data-table-card.mjs +118 -0
- package/es/data-table/data-table-column.mjs +56 -0
- package/es/data-table/data-table.mjs +369 -0
- package/es/data-table/dynamic-component.mjs +48 -0
- package/es/data-table/index.mjs +13 -0
- package/es/data-table/use-datatable-drag.mjs +110 -0
- package/es/datatable-settings/datatable-settings.mjs +309 -0
- package/es/datatable-settings/index.mjs +6 -0
- package/es/date-range/date-picker.mjs +128 -0
- package/es/date-range/date-range.mjs +181 -0
- package/es/date-range/index.mjs +6 -0
- package/es/drag-list/constants.mjs +3 -0
- package/es/drag-list/drag-item.mjs +49 -0
- package/es/drag-list/drag-list.mjs +56 -0
- package/es/drag-list/index.mjs +6 -0
- package/es/drag-list/use-drag-list.mjs +154 -0
- package/es/dragable/constants.mjs +4 -0
- package/es/dragable/dragable-item.mjs +25 -0
- package/es/dragable/dragable-operation.mjs +32 -0
- package/es/dragable/dragable.mjs +31 -0
- package/es/dragable/index.mjs +15 -0
- package/es/dragable/use-dragable.mjs +134 -0
- package/es/filter-panel/conditions/condition.mjs +30 -0
- package/es/filter-panel/conditions/date-range-condition.mjs +46 -0
- package/es/filter-panel/conditions/department-condition/department-condition.mjs +81 -0
- package/es/filter-panel/conditions/department-condition/department-node.mjs +74 -0
- package/es/filter-panel/conditions/index.mjs +21 -0
- package/es/filter-panel/conditions/input-condition.mjs +83 -0
- package/es/filter-panel/conditions/multi-user-condition.mjs +64 -0
- package/es/filter-panel/conditions/multiple-menu-condition.mjs +41 -0
- package/es/filter-panel/conditions/single-menu-condition.mjs +68 -0
- package/es/filter-panel/conditions/single-user-condition.mjs +64 -0
- package/es/filter-panel/filter-panel-item.mjs +47 -0
- package/es/filter-panel/filter-panel.mjs +180 -0
- package/es/filter-panel/index.mjs +15 -0
- package/es/filter-panel/use-filter-panel-item.mjs +52 -0
- package/es/filter-panel/use-filter-panel.mjs +135 -0
- package/es/hooks/use-data/index.mjs +152 -0
- package/es/index.mjs +27 -0
- package/es/layout/index.mjs +6 -0
- package/es/layout/layout.mjs +86 -0
- package/es/make-installer.mjs +34 -0
- package/es/math/Rectangle.mjs +25 -0
- package/es/menu/index.mjs +6 -0
- package/es/menu/menu-item.mjs +75 -0
- package/es/menu/menu.mjs +60 -0
- package/es/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.mjs +6372 -0
- package/es/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.mjs +1517 -0
- package/es/panel/index.mjs +6 -0
- package/es/panel/panel.mjs +55 -0
- package/es/panel-tabs/index.mjs +6 -0
- package/es/panel-tabs/panel-tabs.mjs +66 -0
- package/es/pct-filter-panel/index.mjs +10 -0
- package/es/pct-filter-panel/pct-compents/index.mjs +10 -0
- package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +71 -0
- package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +74 -0
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +186 -0
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +147 -0
- package/es/pct-filter-panel/pct-filter-panel-item.mjs +48 -0
- package/es/pct-filter-panel/pct-filter-panel.mjs +251 -0
- package/es/pct-filter-panel/use-filter-panel-item.mjs +56 -0
- package/es/pct-filter-panel/use-filter-panel.mjs +127 -0
- package/es/plugins.mjs +5 -0
- package/es/progress/index.mjs +10 -0
- package/es/progress/progress-item.mjs +68 -0
- package/es/progress/progress.mjs +74 -0
- package/es/progress/use-progress.mjs +46 -0
- package/es/utils/db.mjs +9 -0
- package/es/utils.mjs +99 -0
- package/es/where-filter-panel/index.mjs +1 -0
- package/es/where-filter-panel/use-where-filter-panel.mjs +18 -0
- package/es/where-filter-panel/where-filter-panel.mjs +17 -0
- package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
- package/lib/advance-select/advance-operation.js +47 -0
- package/lib/advance-select/advance-option.js +129 -0
- package/lib/advance-select/advance-select.js +363 -0
- package/lib/advance-select/events-helpers.js +33 -0
- package/lib/advance-select/index.js +20 -0
- package/lib/advance-select/use-advance-option.js +47 -0
- package/lib/advance-select/use-advance-select.js +122 -0
- package/lib/application-slot/application-slot.js +55 -0
- package/lib/application-slot/breadcrumb-item.js +27 -0
- package/lib/application-slot/header-tools-item.js +27 -0
- package/lib/application-slot/index.js +23 -0
- package/lib/breadcrumb-select/breadcrumb-select.js +159 -0
- package/lib/breadcrumb-select/index.js +11 -0
- package/lib/components.js +26 -0
- package/lib/contextmenu/contextmenu-item.js +25 -0
- package/lib/contextmenu/contextmenu.js +68 -0
- package/lib/contextmenu/index.js +16 -0
- package/lib/contextmenu/use-contextmenu.js +89 -0
- package/lib/data-form/data-form-item.js +57 -0
- package/lib/data-form/data-form.js +179 -0
- package/lib/data-form/dynamic-component.js +27 -0
- package/lib/data-form/form-components/Blots/AtBlot.js +31 -0
- package/lib/data-form/form-components/bwa-date-picker.js +49 -0
- package/lib/data-form/form-components/bwa-date-time-picker.js +54 -0
- package/lib/data-form/form-components/bwa-input-float.js +47 -0
- package/lib/data-form/form-components/bwa-input-integer.js +60 -0
- package/lib/data-form/form-components/bwa-input.js +42 -0
- package/lib/data-form/form-components/bwa-multi-select.js +39 -0
- package/lib/data-form/form-components/bwa-rich-text-tinymce.js +242 -0
- package/lib/data-form/form-components/bwa-rich-text.js +333 -0
- package/lib/data-form/form-components/bwa-select.js +80 -0
- package/lib/data-form/form-components/bwa-textarea.js +37 -0
- package/lib/data-form/form-components/bwa-upload.js +163 -0
- package/lib/data-form/form-components/bwa-user-multi-select.js +34 -0
- package/lib/data-form/form-components/bwa-user-select.js +73 -0
- package/lib/data-form/index.js +40 -0
- package/lib/data-table/data-column-view.js +135 -0
- package/lib/data-table/data-table-card.js +122 -0
- package/lib/data-table/data-table-column.js +60 -0
- package/lib/data-table/data-table.js +373 -0
- package/lib/data-table/dynamic-component.js +56 -0
- package/lib/data-table/index.js +20 -0
- package/lib/data-table/use-datatable-drag.js +114 -0
- package/lib/datatable-settings/datatable-settings.js +313 -0
- package/lib/datatable-settings/index.js +11 -0
- package/lib/date-range/date-picker.js +136 -0
- package/lib/date-range/date-range.js +189 -0
- package/lib/date-range/index.js +11 -0
- package/lib/drag-list/constants.js +7 -0
- package/lib/drag-list/drag-item.js +53 -0
- package/lib/drag-list/drag-list.js +60 -0
- package/lib/drag-list/index.js +11 -0
- package/lib/drag-list/use-drag-list.js +158 -0
- package/lib/dragable/constants.js +9 -0
- package/lib/dragable/dragable-item.js +29 -0
- package/lib/dragable/dragable-operation.js +36 -0
- package/lib/dragable/dragable.js +35 -0
- package/lib/dragable/index.js +22 -0
- package/lib/dragable/use-dragable.js +138 -0
- package/lib/filter-panel/conditions/condition.js +34 -0
- package/lib/filter-panel/conditions/date-range-condition.js +50 -0
- package/lib/filter-panel/conditions/department-condition/department-condition.js +85 -0
- package/lib/filter-panel/conditions/department-condition/department-node.js +78 -0
- package/lib/filter-panel/conditions/index.js +26 -0
- package/lib/filter-panel/conditions/input-condition.js +87 -0
- package/lib/filter-panel/conditions/multi-user-condition.js +68 -0
- package/lib/filter-panel/conditions/multiple-menu-condition.js +45 -0
- package/lib/filter-panel/conditions/single-menu-condition.js +72 -0
- package/lib/filter-panel/conditions/single-user-condition.js +68 -0
- package/lib/filter-panel/filter-panel-item.js +51 -0
- package/lib/filter-panel/filter-panel.js +184 -0
- package/lib/filter-panel/index.js +20 -0
- package/lib/filter-panel/use-filter-panel-item.js +56 -0
- package/lib/filter-panel/use-filter-panel.js +139 -0
- package/lib/hooks/use-data/index.js +157 -0
- package/lib/index.js +60 -0
- package/lib/layout/index.js +11 -0
- package/lib/layout/layout.js +90 -0
- package/lib/make-installer.js +62 -0
- package/lib/math/Rectangle.js +29 -0
- package/lib/menu/index.js +11 -0
- package/lib/menu/menu-item.js +79 -0
- package/lib/menu/menu.js +64 -0
- package/lib/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.js +6635 -0
- package/lib/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.js +1628 -0
- package/lib/panel/index.js +11 -0
- package/lib/panel/panel.js +59 -0
- package/lib/panel-tabs/index.js +11 -0
- package/lib/panel-tabs/panel-tabs.js +70 -0
- package/lib/pct-filter-panel/index.js +14 -0
- package/lib/pct-filter-panel/pct-compents/index.js +16 -0
- package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +75 -0
- package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +78 -0
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +190 -0
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +151 -0
- package/lib/pct-filter-panel/pct-filter-panel-item.js +52 -0
- package/lib/pct-filter-panel/pct-filter-panel.js +255 -0
- package/lib/pct-filter-panel/use-filter-panel-item.js +60 -0
- package/lib/pct-filter-panel/use-filter-panel.js +131 -0
- package/lib/plugins.js +9 -0
- package/lib/progress/index.js +16 -0
- package/lib/progress/progress-item.js +72 -0
- package/lib/progress/progress.js +78 -0
- package/lib/progress/use-progress.js +51 -0
- package/lib/utils/db.js +17 -0
- package/lib/utils.js +110 -0
- package/lib/where-filter-panel/index.js +2 -0
- package/lib/where-filter-panel/use-where-filter-panel.js +22 -0
- package/lib/where-filter-panel/where-filter-panel.js +21 -0
- package/package.json +1 -1
- package/style/advance-select.css +1 -0
- package/style/breadcrumb-select.css +1 -0
- package/style/common.css +1 -0
- package/style/contextmenu.css +1 -0
- package/style/data-form.css +1 -0
- package/style/data-table.css +1 -0
- package/style/datatable-settings.css +1 -0
- package/style/date-range.css +1 -0
- package/style/department-condition.css +1 -0
- package/style/drag-list.css +1 -0
- package/style/dragable.css +1 -0
- package/style/filter-panel.css +1 -0
- package/style/index.css +1 -0
- package/style/input-condition.css +1 -0
- package/style/layout.css +1 -0
- package/style/menu.css +1 -0
- package/style/panel-tabs.css +1 -0
- package/style/panel.css +1 -0
- package/style/pct-filter-panel.css +1 -0
- package/style/progress.css +1 -0
- package/style/rich-text.css +1 -0
- package/style/var.css +1 -0
- /package/style/{advance-select.scss → src/advance-select.scss} +0 -0
- /package/style/{breadcrumb-select.scss → src/breadcrumb-select.scss} +0 -0
- /package/style/{common → src/common}/var.scss +0 -0
- /package/style/{common.scss → src/common.scss} +0 -0
- /package/style/{contextmenu.scss → src/contextmenu.scss} +0 -0
- /package/style/{data-form.scss → src/data-form.scss} +0 -0
- /package/style/{data-table.scss → src/data-table.scss} +0 -0
- /package/style/{datatable-settings.scss → src/datatable-settings.scss} +0 -0
- /package/style/{date-range.scss → src/date-range.scss} +0 -0
- /package/style/{department-condition.scss → src/department-condition.scss} +0 -0
- /package/style/{drag-list.scss → src/drag-list.scss} +0 -0
- /package/style/{dragable.scss → src/dragable.scss} +0 -0
- /package/style/{filter-panel.scss → src/filter-panel.scss} +0 -0
- /package/style/{index.scss → src/index.scss} +0 -0
- /package/style/{input-condition.scss → src/input-condition.scss} +0 -0
- /package/style/{layout.scss → src/layout.scss} +0 -0
- /package/style/{menu.scss → src/menu.scss} +0 -0
- /package/style/{mixins → src/mixins}/_var.scss +0 -0
- /package/style/{mixins → src/mixins}/config.scss +0 -0
- /package/style/{mixins → src/mixins}/function.scss +0 -0
- /package/style/{mixins → src/mixins}/mixins.scss +0 -0
- /package/style/{panel-tabs.scss → src/panel-tabs.scss} +0 -0
- /package/style/{panel.scss → src/panel.scss} +0 -0
- /package/style/{pct-filter-panel.scss → src/pct-filter-panel.scss} +0 -0
- /package/style/{progress.scss → src/progress.scss} +0 -0
- /package/style/{rich-text.scss → src/rich-text.scss} +0 -0
- /package/style/{theme → src/theme}/theme.scss +0 -0
- /package/style/{theme → src/theme}/var.scss +0 -0
- /package/style/{var.scss → src/var.scss} +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var rxjs = require('rxjs');
|
|
7
|
+
var webBaseClientVue = require('web-base-client-vue');
|
|
8
|
+
var index = require('../hooks/use-data/index.js');
|
|
9
|
+
var advanceOperation = require('./advance-operation.js');
|
|
10
|
+
var advanceOption = require('./advance-option.js');
|
|
11
|
+
var useAdvanceSelect = require('./use-advance-select.js');
|
|
12
|
+
var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
|
|
13
|
+
|
|
14
|
+
const __default__ = vue.defineComponent({
|
|
15
|
+
name: "BwaAdvanceSelect"
|
|
16
|
+
});
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
18
|
+
props: {
|
|
19
|
+
...index.dataProps,
|
|
20
|
+
options: {
|
|
21
|
+
type: Array
|
|
22
|
+
},
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: [Array, String, Number, Boolean]
|
|
25
|
+
},
|
|
26
|
+
listHeight: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "300px"
|
|
29
|
+
},
|
|
30
|
+
width: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "240px"
|
|
33
|
+
},
|
|
34
|
+
multiple: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
multipleLimit: {
|
|
39
|
+
type: Number,
|
|
40
|
+
default: 0
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
showSearch: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
searchPlaceholder: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: ""
|
|
53
|
+
},
|
|
54
|
+
showSelection: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: true
|
|
57
|
+
},
|
|
58
|
+
showSelectIcon: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: true
|
|
61
|
+
},
|
|
62
|
+
closeAfterSelection: {
|
|
63
|
+
typoe: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
loading: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
virtualRef: null,
|
|
71
|
+
virtualTriggering: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
75
|
+
source: "",
|
|
76
|
+
borderRadius: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "0px"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
emits: ["update:modelValue", "search", "visible-change"],
|
|
82
|
+
setup(__props, { expose, emit }) {
|
|
83
|
+
const props = __props;
|
|
84
|
+
const debounceDelay = webBaseClientVue.useGlobalConfig("debounceDelay", 500);
|
|
85
|
+
const filterPanelItem = vue.inject(webBaseClientVue.filterPanelItemKey, null);
|
|
86
|
+
const { listHeight, width, showSearch, showSelection, multiple, modelValue, borderRadius } = vue.toRefs(props);
|
|
87
|
+
const slots = vue.useSlots();
|
|
88
|
+
const ns = webBaseClientVue.useNamespace("advance");
|
|
89
|
+
const states = useAdvanceSelect.useAdvanceSelectStates(props);
|
|
90
|
+
const {
|
|
91
|
+
options: optionInstances,
|
|
92
|
+
optionsCount,
|
|
93
|
+
search,
|
|
94
|
+
isShowPopper,
|
|
95
|
+
selected
|
|
96
|
+
} = vue.toRefs(states);
|
|
97
|
+
const column = vue.computed(() => {
|
|
98
|
+
var _a;
|
|
99
|
+
return (_a = filterPanelItem == null ? void 0 : filterPanelItem.column) != null ? _a : null;
|
|
100
|
+
});
|
|
101
|
+
const {
|
|
102
|
+
selectedLabel,
|
|
103
|
+
onOptionCreate,
|
|
104
|
+
onOptionDestroy,
|
|
105
|
+
handleClearClick,
|
|
106
|
+
handleOptionSelect,
|
|
107
|
+
hidePoppper
|
|
108
|
+
} = useAdvanceSelect.useAdvanceSelect(props, states, {
|
|
109
|
+
emit
|
|
110
|
+
});
|
|
111
|
+
const disabled = vue.computed(() => !vue.unref(isShowPopper));
|
|
112
|
+
const { data: itfData, loading: dataLoading } = index.useData(disabled, search);
|
|
113
|
+
const loading = vue.computed(() => props.loading || vue.unref(dataLoading));
|
|
114
|
+
const data = vue.computed(() => props.options || vue.unref(itfData));
|
|
115
|
+
if (multiple.value && !Array.isArray(modelValue.value)) {
|
|
116
|
+
emit("update:modelValue", []);
|
|
117
|
+
}
|
|
118
|
+
if (!multiple.value && Array.isArray(modelValue.value)) {
|
|
119
|
+
emit("update:modelValue", "");
|
|
120
|
+
}
|
|
121
|
+
vue.watch(isShowPopper, (isShowPopper2) => {
|
|
122
|
+
emit("visible-change", isShowPopper2);
|
|
123
|
+
});
|
|
124
|
+
const subscription = new rxjs.Observable(
|
|
125
|
+
(observer) => vue.watch(search, observer.next.bind(observer))
|
|
126
|
+
).pipe(rxjs.debounceTime(vue.unref(debounceDelay))).subscribe(emit.bind(null, "search"));
|
|
127
|
+
vue.onBeforeUnmount(subscription.unsubscribe.bind(subscription));
|
|
128
|
+
vue.provide(
|
|
129
|
+
webBaseClientVue.advanceSelectKey,
|
|
130
|
+
vue.reactive({
|
|
131
|
+
props,
|
|
132
|
+
options: optionInstances,
|
|
133
|
+
selected,
|
|
134
|
+
onOptionCreate,
|
|
135
|
+
onOptionDestroy,
|
|
136
|
+
handleOptionSelect,
|
|
137
|
+
hidePoppper,
|
|
138
|
+
select: vue.getCurrentInstance()
|
|
139
|
+
})
|
|
140
|
+
);
|
|
141
|
+
const popperStyle = vue.reactive({
|
|
142
|
+
padding: "0",
|
|
143
|
+
borderRadius,
|
|
144
|
+
width,
|
|
145
|
+
border: "none",
|
|
146
|
+
boxShadow: `0 3px 12px 0 rgb(0 0 0 / 12%), 0 0.5px 1.5px 0 rgb(0 0 0 / 8%)`
|
|
147
|
+
});
|
|
148
|
+
expose({
|
|
149
|
+
handleClearClick
|
|
150
|
+
});
|
|
151
|
+
return (_ctx, _cache) => {
|
|
152
|
+
const _component_CaretBottom = vue.resolveComponent("CaretBottom");
|
|
153
|
+
const _component_ElIcon = vue.resolveComponent("ElIcon");
|
|
154
|
+
const _component_ElInput = vue.resolveComponent("ElInput");
|
|
155
|
+
const _component_ElButton = vue.resolveComponent("ElButton");
|
|
156
|
+
const _component_ElScrollbar = vue.resolveComponent("ElScrollbar");
|
|
157
|
+
const _component_ElTooltip = vue.resolveComponent("ElTooltip");
|
|
158
|
+
const _directive_loading = vue.resolveDirective("loading");
|
|
159
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
160
|
+
class: vue.normalizeClass(vue.unref(ns).b("select")),
|
|
161
|
+
"data-prefix": "el",
|
|
162
|
+
ref: "selectWrapper"
|
|
163
|
+
}, [
|
|
164
|
+
vue.createVNode(_component_ElTooltip, {
|
|
165
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "tooltip")),
|
|
166
|
+
effect: "light",
|
|
167
|
+
trigger: "click",
|
|
168
|
+
placement: "bottom-start",
|
|
169
|
+
"show-arrow": false,
|
|
170
|
+
"append-to": ".bwa-application",
|
|
171
|
+
"popper-style": popperStyle,
|
|
172
|
+
"popper-class": vue.unref(ns).be("select", "popper"),
|
|
173
|
+
persistent: true,
|
|
174
|
+
visible: vue.unref(isShowPopper),
|
|
175
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => vue.isRef(isShowPopper) ? isShowPopper.value = $event : null),
|
|
176
|
+
"virtual-ref": __props.virtualRef,
|
|
177
|
+
"virtual-triggering": __props.virtualTriggering
|
|
178
|
+
}, {
|
|
179
|
+
default: vue.withCtx(() => [
|
|
180
|
+
vue.renderSlot(_ctx.$slots, "reference", {
|
|
181
|
+
label: vue.unref(selectedLabel),
|
|
182
|
+
column: vue.unref(column)
|
|
183
|
+
}, () => [
|
|
184
|
+
__props.source ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
185
|
+
key: 0,
|
|
186
|
+
class: vue.normalizeClass([
|
|
187
|
+
vue.unref(ns).be("select", "pct-reference"),
|
|
188
|
+
vue.unref(ns).is("active", vue.unref(isShowPopper))
|
|
189
|
+
])
|
|
190
|
+
}, [
|
|
191
|
+
vue.renderSlot(_ctx.$slots, "reference-content", {
|
|
192
|
+
label: vue.unref(selectedLabel),
|
|
193
|
+
column: vue.unref(column),
|
|
194
|
+
selected: vue.unref(selected)
|
|
195
|
+
}, () => [
|
|
196
|
+
vue.renderSlot(_ctx.$slots, "label", {}, () => [
|
|
197
|
+
vue.unref(column) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "label"))
|
|
200
|
+
}, vue.toDisplayString(vue.unref(column).title), 3)) : vue.createCommentVNode("v-if", true)
|
|
201
|
+
]),
|
|
202
|
+
vue.renderSlot(_ctx.$slots, "value", { selected: vue.unref(selected) }, () => [
|
|
203
|
+
vue.unref(multiple) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
204
|
+
key: 0,
|
|
205
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "content"))
|
|
206
|
+
}, vue.toDisplayString(vue.unref(selectedLabel).length ? vue.unref(selectedLabel).join(",") : "\u5168\u90E8"), 3)) : (vue.openBlock(), vue.createElementBlock("span", {
|
|
207
|
+
key: 1,
|
|
208
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "content"))
|
|
209
|
+
}, vue.toDisplayString(vue.unref(selectedLabel) ? vue.unref(selectedLabel) : "\u5168\u90E8"), 3))
|
|
210
|
+
]),
|
|
211
|
+
__props.showSelectIcon ? (vue.openBlock(), vue.createBlock(_component_ElIcon, {
|
|
212
|
+
key: 0,
|
|
213
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "caret"))
|
|
214
|
+
}, {
|
|
215
|
+
default: vue.withCtx(() => [
|
|
216
|
+
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
217
|
+
vue.createVNode(_component_CaretBottom)
|
|
218
|
+
])
|
|
219
|
+
]),
|
|
220
|
+
_: 3
|
|
221
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
|
|
222
|
+
])
|
|
223
|
+
], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
224
|
+
key: 1,
|
|
225
|
+
class: vue.normalizeClass([
|
|
226
|
+
vue.unref(ns).be("select", "reference"),
|
|
227
|
+
vue.unref(ns).is("active", vue.unref(isShowPopper))
|
|
228
|
+
])
|
|
229
|
+
}, [
|
|
230
|
+
vue.renderSlot(_ctx.$slots, "reference-content", {
|
|
231
|
+
label: vue.unref(selectedLabel),
|
|
232
|
+
column: vue.unref(column),
|
|
233
|
+
selected: vue.unref(selected)
|
|
234
|
+
}, () => [
|
|
235
|
+
vue.renderSlot(_ctx.$slots, "label", {}, () => [
|
|
236
|
+
vue.unref(column) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
237
|
+
key: 0,
|
|
238
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "label"))
|
|
239
|
+
}, vue.toDisplayString(vue.unref(column).title), 3)) : vue.createCommentVNode("v-if", true)
|
|
240
|
+
]),
|
|
241
|
+
vue.renderSlot(_ctx.$slots, "value", { selected: vue.unref(selected) }, () => [
|
|
242
|
+
vue.unref(multiple) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "content"))
|
|
245
|
+
}, vue.toDisplayString(vue.unref(selectedLabel).length ? vue.unref(selectedLabel).join(",") : "\u5168\u90E8"), 3)) : (vue.openBlock(), vue.createElementBlock("span", {
|
|
246
|
+
key: 1,
|
|
247
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "content"))
|
|
248
|
+
}, vue.toDisplayString(vue.unref(selectedLabel) ? vue.unref(selectedLabel) : "\u5168\u90E8"), 3))
|
|
249
|
+
])
|
|
250
|
+
]),
|
|
251
|
+
__props.showSelectIcon ? (vue.openBlock(), vue.createBlock(_component_ElIcon, {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "caret"))
|
|
254
|
+
}, {
|
|
255
|
+
default: vue.withCtx(() => [
|
|
256
|
+
vue.renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
257
|
+
vue.createVNode(_component_CaretBottom)
|
|
258
|
+
])
|
|
259
|
+
]),
|
|
260
|
+
_: 3
|
|
261
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
|
|
262
|
+
], 2))
|
|
263
|
+
])
|
|
264
|
+
]),
|
|
265
|
+
content: vue.withCtx(() => [
|
|
266
|
+
vue.createElementVNode("div", {
|
|
267
|
+
class: vue.normalizeClass([vue.unref(ns).be("select", "content"), vue.unref(ns).is("single", !vue.unref(multiple))]),
|
|
268
|
+
style: { "margin": "6px" }
|
|
269
|
+
}, [
|
|
270
|
+
vue.renderSlot(_ctx.$slots, "contentTop"),
|
|
271
|
+
vue.unref(showSearch) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
272
|
+
key: 0,
|
|
273
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "input-wrapper"))
|
|
274
|
+
}, [
|
|
275
|
+
vue.createVNode(_component_ElInput, {
|
|
276
|
+
modelValue: vue.unref(search),
|
|
277
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(search) ? search.value = $event : null),
|
|
278
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "input")),
|
|
279
|
+
placeholder: __props.searchPlaceholder,
|
|
280
|
+
type: "text",
|
|
281
|
+
"prefix-icon": "Search",
|
|
282
|
+
clearable: ""
|
|
283
|
+
}, null, 8, ["modelValue", "class", "placeholder"])
|
|
284
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
285
|
+
vue.createElementVNode("div", {
|
|
286
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "operation-wrapper"))
|
|
287
|
+
}, [
|
|
288
|
+
vue.unref(multiple) || !__props.required ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
289
|
+
vue.unref(showSelection) ? (vue.openBlock(), vue.createBlock(advanceOperation["default"], {
|
|
290
|
+
key: 0,
|
|
291
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "selection-wrapper")),
|
|
292
|
+
type: "selection",
|
|
293
|
+
border: true
|
|
294
|
+
}, {
|
|
295
|
+
default: vue.withCtx(() => [
|
|
296
|
+
vue.unref(multiple) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
297
|
+
key: 0,
|
|
298
|
+
class: vue.normalizeClass([
|
|
299
|
+
vue.unref(ns).be("select", "selection"),
|
|
300
|
+
vue.unref(ns).is("has-selected", !!vue.unref(selected).length)
|
|
301
|
+
])
|
|
302
|
+
}, " \u5DF2\u9009" + vue.toDisplayString(vue.unref(selected).length) + "\u9879 ", 3)) : vue.createCommentVNode("v-if", true),
|
|
303
|
+
!__props.required ? (vue.openBlock(), vue.createBlock(_component_ElButton, {
|
|
304
|
+
key: 1,
|
|
305
|
+
link: "",
|
|
306
|
+
type: "primary",
|
|
307
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "clear")),
|
|
308
|
+
onClick: vue.unref(handleClearClick)
|
|
309
|
+
}, {
|
|
310
|
+
default: vue.withCtx(() => [
|
|
311
|
+
vue.createTextVNode(" \u6E05\u9664\u9009\u9879 ")
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
}, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
|
|
318
|
+
], 64)) : vue.createCommentVNode("v-if", true),
|
|
319
|
+
vue.renderSlot(_ctx.$slots, "operation")
|
|
320
|
+
], 2),
|
|
321
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
322
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "list"))
|
|
323
|
+
}, [
|
|
324
|
+
vue.createVNode(_component_ElScrollbar, { "max-height": vue.unref(listHeight) }, {
|
|
325
|
+
default: vue.withCtx(() => [
|
|
326
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
327
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(data), (item) => {
|
|
328
|
+
return vue.openBlock(), vue.createBlock(advanceOption["default"], {
|
|
329
|
+
key: item.value,
|
|
330
|
+
value: item.value,
|
|
331
|
+
label: item.label
|
|
332
|
+
}, null, 8, ["value", "label"]);
|
|
333
|
+
}), 128))
|
|
334
|
+
])
|
|
335
|
+
]),
|
|
336
|
+
_: 3
|
|
337
|
+
}, 8, ["max-height"]),
|
|
338
|
+
!vue.unref(optionsCount) ? vue.renderSlot(_ctx.$slots, "empy", { key: 0 }, () => [
|
|
339
|
+
vue.createElementVNode("div", {
|
|
340
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "empty"))
|
|
341
|
+
}, "\u672A\u5339\u914D\u5230\u76F8\u5173\u6761\u76EE", 2)
|
|
342
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
343
|
+
], 2)), [
|
|
344
|
+
[_directive_loading, vue.unref(loading)]
|
|
345
|
+
]),
|
|
346
|
+
vue.unref(slots).contentBottom ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
347
|
+
key: 1,
|
|
348
|
+
class: vue.normalizeClass(vue.unref(ns).be("select", "bottom")),
|
|
349
|
+
style: vue.normalizeStyle({ "boxShadow": __props.source ? "none" : "", "padding": __props.source ? "0" : "4px 0px" })
|
|
350
|
+
}, [
|
|
351
|
+
vue.renderSlot(_ctx.$slots, "contentBottom")
|
|
352
|
+
], 6)) : vue.createCommentVNode("v-if", true)
|
|
353
|
+
], 2)
|
|
354
|
+
]),
|
|
355
|
+
_: 3
|
|
356
|
+
}, 8, ["class", "popper-style", "popper-class", "visible", "virtual-ref", "virtual-triggering"])
|
|
357
|
+
], 2);
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
var AdvanceSelect = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "advance-select.vue"]]);
|
|
362
|
+
|
|
363
|
+
exports["default"] = AdvanceSelect;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var webBaseClientVue = require('web-base-client-vue');
|
|
7
|
+
var index = require('element-plus/es/utils/index');
|
|
8
|
+
var util = require('element-plus/es/components/table/src/util');
|
|
9
|
+
|
|
10
|
+
function useEvent(ns) {
|
|
11
|
+
const {
|
|
12
|
+
select: advanceSelect
|
|
13
|
+
} = vue.inject(webBaseClientVue.advanceSelectKey, {});
|
|
14
|
+
const handleOptionMouseEnter = (event, tooltipEffect) => {
|
|
15
|
+
const content = event.target.querySelector("." + ns.be("option", "content"));
|
|
16
|
+
const range = document.createRange();
|
|
17
|
+
range.setStart(content, 0);
|
|
18
|
+
range.setEnd(content, content.childNodes.length);
|
|
19
|
+
const rangeWidth = range.getBoundingClientRect().width;
|
|
20
|
+
const padding = (Number.parseInt(index.getStyle(content, "paddingLeft"), 10) || 0) + Number.parseInt(index.getStyle(content, "paddingRight"), 10) || 0;
|
|
21
|
+
if (rangeWidth + padding > content.offsetWidth || content.scrollWidth > content.offsetWidth) {
|
|
22
|
+
util.createTablePopper(advanceSelect == null ? void 0 : advanceSelect.refs.selectWrapper, content, content.innerText || content.textContent, {
|
|
23
|
+
placement: "top",
|
|
24
|
+
strategy: "fixed"
|
|
25
|
+
}, "dark");
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
handleOptionMouseEnter
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.useEvent = useEvent;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var install = require('element-plus/es/utils/vue/install');
|
|
6
|
+
var advanceSelect = require('./advance-select.js');
|
|
7
|
+
var advanceOption = require('./advance-option.js');
|
|
8
|
+
var advanceOperation = require('./advance-operation.js');
|
|
9
|
+
|
|
10
|
+
const BwaAdvanceSelect = install.withInstall(advanceSelect["default"], {
|
|
11
|
+
AdvanceOption: advanceOption["default"],
|
|
12
|
+
AdvanceOperation: advanceOperation["default"]
|
|
13
|
+
});
|
|
14
|
+
const BwaAdvanceOption = install.withInstall(advanceOption["default"]);
|
|
15
|
+
const BwaAdvanceOperation = install.withInstall(advanceOperation["default"]);
|
|
16
|
+
|
|
17
|
+
exports.BwaAdvanceOperation = BwaAdvanceOperation;
|
|
18
|
+
exports.BwaAdvanceOption = BwaAdvanceOption;
|
|
19
|
+
exports.BwaAdvanceSelect = BwaAdvanceSelect;
|
|
20
|
+
exports["default"] = BwaAdvanceSelect;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var webBaseClientVue = require('web-base-client-vue');
|
|
7
|
+
|
|
8
|
+
const useAdvanceOption = (props) => {
|
|
9
|
+
const advanceSelect = vue.inject(webBaseClientVue.advanceSelectKey);
|
|
10
|
+
const instance = vue.getCurrentInstance();
|
|
11
|
+
const currentLabel = vue.computed(() => props.label || props.value);
|
|
12
|
+
const showSelectIcon = vue.computed(() => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return (_b = (_a = advanceSelect == null ? void 0 : advanceSelect.props) == null ? void 0 : _a.showSelectIcon) != null ? _b : true;
|
|
15
|
+
});
|
|
16
|
+
const itemSelected = vue.computed(() => {
|
|
17
|
+
if (!advanceSelect.props.multiple) {
|
|
18
|
+
return advanceSelect.props.modelValue === props.value || advanceSelect.props.modelValue === props.value + "";
|
|
19
|
+
} else {
|
|
20
|
+
return (advanceSelect.props.modelValue || []).includes(props.value);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const source = vue.computed(() => {
|
|
24
|
+
return advanceSelect.props.source;
|
|
25
|
+
});
|
|
26
|
+
vue.watch(() => props.value, (val, oldVal) => {
|
|
27
|
+
if (!Object.is(val, oldVal)) {
|
|
28
|
+
advanceSelect.onOptionDestroy(oldVal, instance.proxy);
|
|
29
|
+
advanceSelect.onOptionCreate(instance.proxy);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
vue.onMounted(() => {
|
|
33
|
+
advanceSelect.onOptionCreate(instance.proxy);
|
|
34
|
+
});
|
|
35
|
+
vue.onUnmounted(() => {
|
|
36
|
+
advanceSelect.onOptionDestroy(props.value, instance.proxy);
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
advanceSelect,
|
|
40
|
+
itemSelected,
|
|
41
|
+
currentLabel,
|
|
42
|
+
showSelectIcon,
|
|
43
|
+
source
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.useAdvanceOption = useAdvanceOption;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('lodash');
|
|
7
|
+
|
|
8
|
+
const useAdvanceSelectStates = (props) => {
|
|
9
|
+
return vue.reactive({
|
|
10
|
+
options: /* @__PURE__ */ new Map(),
|
|
11
|
+
cachedOptions: /* @__PURE__ */ new Map(),
|
|
12
|
+
optionsCount: 0,
|
|
13
|
+
selected: props.multiple ? [] : {},
|
|
14
|
+
search: "",
|
|
15
|
+
isShowPopper: false
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const useAdvanceSelect = (props, states, ctx) => {
|
|
19
|
+
const cachedOptions = vue.computed(() => Array.from(states.cachedOptions.values()));
|
|
20
|
+
vue.watch(vue.computed(() => states.isShowPopper), (isShowPopper) => {
|
|
21
|
+
if (!isShowPopper) {
|
|
22
|
+
states.search = "";
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
vue.watch(() => props.modelValue, () => {
|
|
26
|
+
setSelected();
|
|
27
|
+
}, {
|
|
28
|
+
flush: "post",
|
|
29
|
+
deep: true
|
|
30
|
+
});
|
|
31
|
+
const selectedLabel = vue.computed(() => {
|
|
32
|
+
return props.multiple ? states.selected.map((selected) => selected.label) : states.selected.label || props.modelValue;
|
|
33
|
+
});
|
|
34
|
+
const getOption = (value) => {
|
|
35
|
+
let option = null;
|
|
36
|
+
for (const item of cachedOptions.value) {
|
|
37
|
+
if (item.value === value) {
|
|
38
|
+
option = {
|
|
39
|
+
value,
|
|
40
|
+
label: item.currentLabel
|
|
41
|
+
};
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (option) {
|
|
46
|
+
return option;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
value,
|
|
50
|
+
label: value
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
const setSelected = () => {
|
|
54
|
+
if (!props.multiple) {
|
|
55
|
+
const option = getOption(props.modelValue);
|
|
56
|
+
states.selected = option;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const result = [];
|
|
60
|
+
if (Array.isArray(props.modelValue)) {
|
|
61
|
+
props.modelValue.forEach((value) => {
|
|
62
|
+
result.push(getOption(value));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
states.selected = result;
|
|
66
|
+
};
|
|
67
|
+
const onOptionCreate = (option) => {
|
|
68
|
+
states.optionsCount++;
|
|
69
|
+
states.options.set(option.value, option);
|
|
70
|
+
states.cachedOptions.set(option.value, option);
|
|
71
|
+
};
|
|
72
|
+
const onOptionDestroy = (key, option) => {
|
|
73
|
+
if (states.options.get(key) === option) {
|
|
74
|
+
states.optionsCount--;
|
|
75
|
+
states.options.delete(key);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const handleClearClick = () => {
|
|
79
|
+
ctx.emit("update:modelValue", props.multiple ? [] : "");
|
|
80
|
+
if (props.closeAfterSelection) {
|
|
81
|
+
states.isShowPopper = false;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const handleOptionSelect = (option) => {
|
|
85
|
+
if (props.multiple) {
|
|
86
|
+
const value = (props.modelValue || []).slice();
|
|
87
|
+
const optionIndex = value.indexOf(option.value);
|
|
88
|
+
if (optionIndex > -1) {
|
|
89
|
+
if (props.required && value.length === 1) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
value.splice(optionIndex, 1);
|
|
93
|
+
} else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) {
|
|
94
|
+
value.push(option.value);
|
|
95
|
+
}
|
|
96
|
+
ctx.emit("update:modelValue", value);
|
|
97
|
+
if (props.closeAfterSelection) {
|
|
98
|
+
states.isShowPopper = false;
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
ctx.emit("update:modelValue", option.value);
|
|
102
|
+
states.isShowPopper = false;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const hidePoppper = () => {
|
|
106
|
+
states.isShowPopper = false;
|
|
107
|
+
};
|
|
108
|
+
vue.watch(vue.computed(() => states.options.entries()), () => {
|
|
109
|
+
setSelected();
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
selectedLabel,
|
|
113
|
+
onOptionCreate,
|
|
114
|
+
onOptionDestroy,
|
|
115
|
+
handleClearClick,
|
|
116
|
+
handleOptionSelect,
|
|
117
|
+
hidePoppper
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.useAdvanceSelect = useAdvanceSelect;
|
|
122
|
+
exports.useAdvanceSelectStates = useAdvanceSelectStates;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var webBaseClientVue = require('web-base-client-vue');
|
|
7
|
+
|
|
8
|
+
let uuid = 1;
|
|
9
|
+
const ApplicationSlot = {
|
|
10
|
+
name: "BwaApplicationSlot",
|
|
11
|
+
props: {
|
|
12
|
+
type: String
|
|
13
|
+
},
|
|
14
|
+
setup(props) {
|
|
15
|
+
let currentUuid = uuid++;
|
|
16
|
+
const slots = vue.useSlots();
|
|
17
|
+
const application = webBaseClientVue.useGlobalConfig(webBaseClientVue.applicationKey);
|
|
18
|
+
const scope = vue.effectScope();
|
|
19
|
+
let container = null;
|
|
20
|
+
vue.onMounted(() => {
|
|
21
|
+
container = document.createElement("div");
|
|
22
|
+
scope.run(() => {
|
|
23
|
+
vue.effect(() => {
|
|
24
|
+
var _a;
|
|
25
|
+
const vnodes = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
26
|
+
let _vnodes = [...vnodes];
|
|
27
|
+
for (let i = 0; i < _vnodes.length; i++) {
|
|
28
|
+
const vnode2 = _vnodes[i];
|
|
29
|
+
vnode2.appContext = ApplicationSlot._context;
|
|
30
|
+
if (Array.isArray(vnode2.children)) {
|
|
31
|
+
_vnodes = _vnodes.concat(vnode2.children);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const vnode = vue.h(vue.Fragment, vnodes);
|
|
35
|
+
vnode.appContext = ApplicationSlot._context;
|
|
36
|
+
vue.render(vnode, container);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
application.value.addApplicationSlot(props.type, currentUuid, container);
|
|
40
|
+
});
|
|
41
|
+
vue.onBeforeUnmount(() => {
|
|
42
|
+
application.value.removeApplicationSlot(props.type, currentUuid);
|
|
43
|
+
vue.render(null, container);
|
|
44
|
+
container = null;
|
|
45
|
+
scope.stop();
|
|
46
|
+
});
|
|
47
|
+
return () => vue.h("i", {
|
|
48
|
+
style: {
|
|
49
|
+
display: "none"
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports["default"] = ApplicationSlot;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var applicationSlot = require('./application-slot.js');
|
|
7
|
+
var _pluginVue_exportHelper = require('../_virtual/_plugin-vue_export-helper.js');
|
|
8
|
+
|
|
9
|
+
const __default__ = vue.defineComponent({
|
|
10
|
+
name: "BwaBreadcrumbItem"
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
13
|
+
setup(__props) {
|
|
14
|
+
;
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return vue.openBlock(), vue.createBlock(vue.unref(applicationSlot["default"]), { type: "breadcrumbItem" }, {
|
|
17
|
+
default: vue.withCtx(() => [
|
|
18
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
19
|
+
]),
|
|
20
|
+
_: 3
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var BreadcrumbItem = /* @__PURE__ */ _pluginVue_exportHelper["default"](_sfc_main, [["__file", "breadcrumb-item.vue"]]);
|
|
26
|
+
|
|
27
|
+
exports["default"] = BreadcrumbItem;
|