@sdata/web-vue 4.4.1 → 4.4.3
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/dist/sd.css +20 -5
- package/dist/sd.min.css +2 -2
- package/es/_utils/global-config.js +9 -5
- package/es/anchor/anchor.vue_vue_type_script_setup_true_lang.js +5 -8
- package/es/anchor/utils.d.ts +1 -1
- package/es/anchor/utils.js +6 -1
- package/es/auto-complete/auto-complete.vue.d.ts +6 -6
- package/es/auto-complete/auto-complete.vue_vue_type_script_setup_true_lang.js +22 -6
- package/es/avatar/avatar-group.vue_vue_type_script_setup_true_lang.js +2 -1
- package/es/avatar/avatar.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/avatar/style/index.css +1 -1
- package/es/avatar/style/index.scss +2 -1
- package/es/badge/badge.vue_vue_type_script_setup_true_lang.js +59 -42
- package/es/basic-crud-table/basic-crud-modal.vue.d.ts +22 -22
- package/es/basic-crud-table/basic-crud-table.vue.d.ts +66 -66
- package/es/basic-crud-table/index.d.ts +198 -198
- package/es/bloom-menu/bloom-menu.vue.d.ts +1 -1
- package/es/bloom-menu/bloom-menu.vue_vue_type_script_setup_true_lang.js +16 -3
- package/es/border-beam/border-beam.vue_vue_type_script_setup_true_lang.js +32 -18
- package/es/breadcrumb/breadcrumb-item.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/calendar/components/cell.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/calendar/components/event.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/calendar/core/config.js +4 -1
- package/es/calendar/core/events.js +22 -2
- package/es/calendar/default-theme.scss +1 -1
- package/es/calendar/style/index.css +2 -2
- package/es/carousel/carousel.vue.d.ts +5 -1
- package/es/carousel/carousel.vue_vue_type_script_setup_true_lang.js +55 -12
- package/es/carousel/index.d.ts +15 -3
- package/es/cascader/cascader-panel.vue_vue_type_script_setup_true_lang.js +6 -3
- package/es/checkbox/checkbox.vue.d.ts +2 -0
- package/es/checkbox/checkbox.vue_vue_type_script_setup_true_lang.js +12 -6
- package/es/checkbox/index.d.ts +6 -0
- package/es/color-picker/color-picker.vue_vue_type_script_setup_true_lang.js +13 -5
- package/es/color-picker/control-bar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/color-picker/hooks/use-control-block.d.ts +1 -1
- package/es/color-picker/hooks/use-control-block.js +6 -6
- package/es/color-picker/palette.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/comment/comment.vue_vue_type_script_setup_true_lang.js +7 -2
- package/es/config-provider/config-provider.vue_vue_type_script_setup_true_lang.js +7 -6
- package/es/config-provider/theme-provider.vue_vue_type_script_setup_true_lang.js +3 -0
- package/es/copy/copy.vue_vue_type_script_setup_true_lang.js +23 -8
- package/es/cropper/cropper.vue_vue_type_script_setup_true_lang.js +16 -7
- package/es/drawer/drawer.vue.d.ts +2 -2
- package/es/drawer/drawer.vue_vue_type_script_setup_true_lang.js +5 -12
- package/es/drawer/index.d.ts +3 -3
- package/es/dropdown/dropdown-panel.vue.d.ts +0 -9
- package/es/dropdown/dropdown-panel.vue_vue_type_script_setup_true_lang.js +0 -4
- package/es/dropdown/dropdown.vue.d.ts +16 -3
- package/es/dropdown/dropdown.vue_vue_type_script_setup_true_lang.js +24 -3
- package/es/dropdown/index.d.ts +25 -0
- package/es/dropdown/interface.d.ts +2 -0
- package/es/ellipsis/ellipsis.vue.d.ts +2 -0
- package/es/ellipsis/ellipsis.vue_vue_type_script_setup_true_lang.js +37 -8
- package/es/ellipsis/index.d.ts +3 -0
- package/es/ellipsis/performant-ellipsis.vue_vue_type_script_setup_true_lang.js +3 -0
- package/es/empty/empty.vue.d.ts +9 -8
- package/es/empty/empty.vue_vue_type_script_setup_true_lang.js +9 -6
- package/es/file-previewer/file-previewer.vue.d.ts +0 -3
- package/es/file-previewer/file-previewer.vue_vue_type_script_setup_true_lang.js +3 -6
- package/es/file-previewer/index.d.ts +0 -9
- package/es/form/context.d.ts +1 -2
- package/es/form/form-item.vue_vue_type_script_setup_true_lang.js +6 -6
- package/es/form/form.vue.d.ts +3 -3
- package/es/form/form.vue_vue_type_script_setup_true_lang.js +5 -7
- package/es/form/index.d.ts +6 -6
- package/es/grid/grid-col.vue_vue_type_script_setup_true_lang.js +5 -4
- package/es/grid/hook/use-responsive-state.js +15 -4
- package/es/grid/hook/use-responsive-value.js +3 -2
- package/es/icon/icon-arrow-up/icon-arrow-up.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-calendar/icon-calendar.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-caret-down/icon-caret-down.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-caret-left/icon-caret-left.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-caret-right/icon-caret-right.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-caret-up/icon-caret-up.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-check/icon-check.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-check-circle-fill/icon-check-circle-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-clock-circle/icon-clock-circle.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-close/icon-close.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-close-circle-fill/icon-close-circle-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-components.d.ts +1 -1
- package/es/icon/icon-copy/icon-copy.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-delete/icon-delete.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-double-left/icon-double-left.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-double-right/icon-double-right.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-down/icon-down.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-drag-dot/icon-drag-dot.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-drag-dot-vertical/icon-drag-dot-vertical.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-edit/icon-edit.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-empty/icon-empty.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-exclamation/icon-exclamation.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-exclamation-circle-fill/icon-exclamation-circle-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-eye/icon-eye.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-eye-invisible/icon-eye-invisible.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-face-frown-fill/icon-face-frown-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-face-meh-fill/icon-face-meh-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-face-smile-fill/icon-face-smile-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/{icon-faceBook-circle-fill → icon-facebook-circle-fill}/index.d.ts +5 -5
- package/es/icon/icon-file/icon-file.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-file-audio/icon-file-audio.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-file-image/icon-file-image.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-file-pdf/icon-file-pdf.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-file-video/icon-file-video.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-filter/icon-filter.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-fullscreen/icon-fullscreen.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-image-close/icon-image-close.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-info/icon-info.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-info-circle-fill/icon-info-circle-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-left/icon-left.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-link/icon-link.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-list/icon-list.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-loading/icon-loading.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-menu/icon-menu.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-menu-fold/icon-menu-fold.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-menu-unfold/icon-menu-unfold.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-minus/icon-minus.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-more/icon-more.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-mute/icon-mute.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-oblique-line/icon-oblique-line.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-original-size/icon-original-size.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-pause/icon-pause.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-play-arrow-fill/icon-play-arrow-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-plus/icon-plus.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-question-circle/icon-question-circle.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-right/icon-right.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-rotate-left/icon-rotate-left.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-rotate-right/icon-rotate-right.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-search/icon-search.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-star-fill/icon-star-fill.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-to-top/icon-to-top.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-up/icon-up.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-upload/icon-upload.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-voice/icon-voice.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-zoom-in/icon-zoom-in.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/icon-zoom-out/icon-zoom-out.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/icon/index.d.ts +1 -1
- package/es/icon.js +1162 -300
- package/es/image/image.vue_vue_type_script_setup_true_lang.js +5 -3
- package/es/image/preview.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/index.css +20 -5
- package/es/input/input-password.vue_vue_type_script_setup_true_lang.js +4 -4
- package/es/input-mask/input-mask.vue_vue_type_script_setup_true_lang.js +25 -11
- package/es/input-mask/mask-engine.d.ts +4 -0
- package/es/input-mask/mask-engine.js +12 -1
- package/es/input-number/index.d.ts +15 -0
- package/es/input-number/input-number.vue.d.ts +9 -0
- package/es/input-number/input-number.vue_vue_type_script_setup_true_lang.js +47 -14
- package/es/json-form/index.d.ts +11 -11
- package/es/json-form/json-form-item.vue.d.ts +3 -6
- package/es/json-form/json-form-item.vue_vue_type_script_setup_true_lang.js +14 -15
- package/es/json-form/json-form.vue.d.ts +7 -10
- package/es/json-form/json-form.vue_vue_type_script_setup_true_lang.js +17 -16
- package/es/json-form/style/index.css +15 -0
- package/es/json-form/style/index.scss +21 -0
- package/es/json-form/types.d.ts +1 -0
- package/es/json-form/utils.d.ts +1 -1
- package/es/json-form/utils.js +20 -13
- package/es/kv-list/kv-list.vue_vue_type_script_setup_true_lang.js +1 -0
- package/es/layout/hooks/use-has-sider.js +23 -2
- package/es/layout/interface.d.ts +1 -1
- package/es/layout/sider.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/list/list-item-meta.vue_vue_type_script_setup_true_lang.js +3 -3
- package/es/locale/interface.d.ts +7 -0
- package/es/locale/lang/en-us.js +5 -0
- package/es/locale/lang/zh-cn.js +5 -0
- package/es/mention/index.d.ts +15 -0
- package/es/mention/mention.vue.d.ts +10 -1
- package/es/mention/mention.vue_vue_type_script_setup_true_lang.js +16 -9
- package/es/message/index.js +1 -1
- package/es/modal/index.js +9 -1
- package/es/modal/modal.vue_vue_type_script_setup_true_lang.js +15 -16
- package/es/model-selector/model-selector-input.vue_vue_type_script_setup_true_lang.js +4 -1
- package/es/model-selector/model-selector-item.vue_vue_type_script_setup_true_lang.js +27 -3
- package/es/model-selector/model-selector.vue_vue_type_script_setup_true_lang.js +15 -3
- package/es/notification/index.js +5 -2
- package/es/notification/notification-list.vue_vue_type_script_setup_true_lang.js +5 -5
- package/es/number-flow/number-flow.vue_vue_type_script_setup_true_lang.js +27 -8
- package/es/page-header/page-header.vue_vue_type_script_setup_true_lang.js +2 -1
- package/es/pagination/page-item-ellipsis.vue.d.ts +9 -0
- package/es/pagination/page-item-ellipsis.vue_vue_type_script_setup_true_lang.js +19 -3
- package/es/pagination/page-jumper.vue_vue_type_script_setup_true_lang.js +3 -2
- package/es/pagination/pagination.vue_vue_type_script_setup_true_lang.js +10 -0
- package/es/popconfirm/popconfirm.vue_vue_type_script_setup_true_lang.js +4 -11
- package/es/popover/index.d.ts +2 -0
- package/es/popover/popover.vue.d.ts +4 -2
- package/es/popover/popover.vue_vue_type_script_setup_true_lang.js +10 -3
- package/es/qr-code/qr-code.vue_vue_type_script_setup_true_lang.js +1 -0
- package/es/rate/rate.vue_vue_type_script_setup_true_lang.js +1 -2
- package/es/resize-box/resize-box.vue_vue_type_script_setup_true_lang.js +10 -10
- package/es/result/result.vue_vue_type_script_setup_true_lang.js +6 -4
- package/es/skeleton/line.vue_vue_type_script_setup_true_lang.js +16 -13
- package/es/slider/slider-button.vue_vue_type_script_setup_true_lang.js +2 -0
- package/es/slider/slider.vue_vue_type_script_setup_true_lang.js +20 -9
- package/es/slider/utils.js +1 -1
- package/es/spin/spin.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/split/split.vue_vue_type_script_setup_true_lang.js +3 -1
- package/es/statistic/countdown.vue_vue_type_script_setup_true_lang.js +7 -0
- package/es/statistic/index.d.ts +0 -3
- package/es/statistic/statistic.vue.d.ts +0 -2
- package/es/statistic/statistic.vue_vue_type_script_setup_true_lang.js +0 -5
- package/es/style/icon.scss +2 -2
- package/es/switch/switch.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/tag/index.d.ts +8 -8
- package/es/tag/tag.vue.d.ts +4 -4
- package/es/tag/tag.vue_vue_type_script_setup_true_lang.js +1 -2
- package/es/timeline/timeline.vue_vue_type_script_setup_true_lang.js +2 -2
- package/es/tour/tour.vue_vue_type_script_setup_true_lang.js +14 -8
- package/es/transfer/transfer-view.vue_vue_type_script_setup_true_lang.js +1 -1
- package/es/tree-select/tree-select.vue_vue_type_script_setup_true_lang.js +10 -3
- package/es/trigger/index.d.ts +0 -6
- package/es/trigger/interface.d.ts +1 -2
- package/es/trigger/trigger.vue.d.ts +0 -2
- package/es/trigger/trigger.vue_vue_type_script_setup_true_lang.js +0 -4
- package/es/typography/base.vue_vue_type_script_setup_true_lang.js +1 -0
- package/es/typography/interface.d.ts +0 -4
- package/es/typography/utils/getInnerText.js +11 -10
- package/es/upload/upload.vue_vue_type_script_setup_true_lang.js +7 -5
- package/es/upload/utils.d.ts +1 -2
- package/es/verification-code/index.d.ts +12 -3
- package/es/verification-code/verification-code.vue.d.ts +6 -1
- package/es/verification-code/verification-code.vue_vue_type_script_setup_true_lang.js +29 -5
- package/es/watermark/watermark.vue_vue_type_script_setup_true_lang.js +4 -2
- package/json/vetur-attributes.json +22 -10
- package/json/vetur-tags.json +10 -4
- package/json/web-types.json +43 -17
- package/package.json +1 -1
- /package/es/icon/{icon-faceBook-circle-fill/icon-faceBook-circle-fill.vue.d.ts → icon-facebook-circle-fill/icon-facebook-circle-fill.vue.d.ts} +0 -0
|
@@ -5,11 +5,12 @@ import form_item_default from "../form/form-item.js";
|
|
|
5
5
|
import { JSON_FORM_COMPONENT_TYPES } from "./types.js";
|
|
6
6
|
import { getJsonFormValue, setJsonFormValue } from "./utils.js";
|
|
7
7
|
import json_form_component_default from "./json-form-component.js";
|
|
8
|
-
import { Fragment, computed, createBlock, createElementBlock, createSlots, createVNode, defineComponent, guardReactiveProps,
|
|
8
|
+
import { Fragment, computed, createBlock, createElementBlock, createSlots, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toHandlers, unref, useSlots, withCtx } from "vue";
|
|
9
9
|
//#region components/json-form/json-form-item.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var json_form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "JsonFormItem" }), {}, {
|
|
11
11
|
__name: "json-form-item",
|
|
12
|
-
props:
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {},
|
|
13
14
|
schema: {},
|
|
14
15
|
adapter: {},
|
|
15
16
|
components: {},
|
|
@@ -26,23 +27,21 @@ var json_form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
26
27
|
type: Boolean,
|
|
27
28
|
default: false
|
|
28
29
|
}
|
|
29
|
-
},
|
|
30
|
-
"modelValue": { required: true },
|
|
31
|
-
"modelModifiers": {}
|
|
32
|
-
}),
|
|
30
|
+
},
|
|
33
31
|
emits: ["update:modelValue"],
|
|
34
|
-
setup(__props) {
|
|
32
|
+
setup(__props, { emit: __emit }) {
|
|
35
33
|
const props = __props;
|
|
36
|
-
const
|
|
34
|
+
const emit = __emit;
|
|
37
35
|
const normalizedField = computed(() => {
|
|
38
36
|
return props.adapter === "a2ui-0.9.1" ? props.schema.field.replace(/^\//, "").replaceAll("/", ".") : props.schema.field;
|
|
39
37
|
});
|
|
40
38
|
const fieldModel = computed({
|
|
41
39
|
get() {
|
|
42
|
-
return getJsonFormValue(
|
|
40
|
+
return getJsonFormValue(props.modelValue, props.schema.field, props.adapter);
|
|
43
41
|
},
|
|
44
42
|
set(value) {
|
|
45
|
-
setJsonFormValue(
|
|
43
|
+
setJsonFormValue(props.modelValue, props.schema.field, value, props.adapter);
|
|
44
|
+
emit("update:modelValue", _objectSpread2({}, props.modelValue));
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
const resolvedRules = computed(() => {
|
|
@@ -76,7 +75,7 @@ var json_form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
76
75
|
}, void 0, void 0, 1) : __props.schema.slotName && _ctx.$slots[__props.schema.slotName] ? (openBlock(), createBlock(unref(form_item_default), mergeProps({
|
|
77
76
|
key: 2,
|
|
78
77
|
label: __props.schema.label,
|
|
79
|
-
field:
|
|
78
|
+
field: normalizedField.value,
|
|
80
79
|
"hide-label": (_props$schema$formIte = (_props$schema$formIte2 = __props.schema.formItemProps) === null || _props$schema$formIte2 === void 0 ? void 0 : _props$schema$formIte2.hideLabel) !== null && _props$schema$formIte !== void 0 ? _props$schema$formIte : __props.hideLabel,
|
|
81
80
|
"hide-asterisk": (_props$schema$formIte3 = (_props$schema$formIte4 = __props.schema.formItemProps) === null || _props$schema$formIte4 === void 0 ? void 0 : _props$schema$formIte4.hideAsterisk) !== null && _props$schema$formIte3 !== void 0 ? _props$schema$formIte3 : __props.hideAsterisk,
|
|
82
81
|
"show-colon": (_props$schema$formIte5 = (_props$schema$formIte6 = __props.schema.formItemProps) === null || _props$schema$formIte6 === void 0 ? void 0 : _props$schema$formIte6.showColon) !== null && _props$schema$formIte5 !== void 0 ? _props$schema$formIte5 : __props.showColon,
|
|
@@ -105,7 +104,7 @@ var json_form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
105
104
|
])) : __props.schema.render ? (openBlock(), createBlock(unref(form_item_default), mergeProps({
|
|
106
105
|
key: 3,
|
|
107
106
|
label: __props.schema.label,
|
|
108
|
-
field:
|
|
107
|
+
field: normalizedField.value,
|
|
109
108
|
"hide-label": (_props$schema$formIte8 = (_props$schema$formIte9 = __props.schema.formItemProps) === null || _props$schema$formIte9 === void 0 ? void 0 : _props$schema$formIte9.hideLabel) !== null && _props$schema$formIte8 !== void 0 ? _props$schema$formIte8 : __props.hideLabel,
|
|
110
109
|
"hide-asterisk": (_props$schema$formIte10 = (_props$schema$formIte11 = __props.schema.formItemProps) === null || _props$schema$formIte11 === void 0 ? void 0 : _props$schema$formIte11.hideAsterisk) !== null && _props$schema$formIte10 !== void 0 ? _props$schema$formIte10 : __props.hideAsterisk,
|
|
111
110
|
"show-colon": (_props$schema$formIte12 = (_props$schema$formIte13 = __props.schema.formItemProps) === null || _props$schema$formIte13 === void 0 ? void 0 : _props$schema$formIte13.showColon) !== null && _props$schema$formIte12 !== void 0 ? _props$schema$formIte12 : __props.showColon,
|
|
@@ -129,8 +128,8 @@ var json_form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
129
128
|
return [(openBlock(true), createElementBlock(Fragment, null, renderList((_props$schema$childre = __props.schema.children) !== null && _props$schema$childre !== void 0 ? _props$schema$childre : [], (child) => {
|
|
130
129
|
return openBlock(), createBlock(unref(grid_col_default), mergeProps({ key: child.field }, { ref_for: true }, resolveColProps(child)), {
|
|
131
130
|
default: withCtx(() => [createVNode(_component_JsonFormItem, {
|
|
132
|
-
|
|
133
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
|
131
|
+
"model-value": __props.modelValue,
|
|
132
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", $event)),
|
|
134
133
|
schema: child,
|
|
135
134
|
adapter: __props.adapter,
|
|
136
135
|
components: __props.components,
|
|
@@ -144,7 +143,7 @@ var json_form_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
144
143
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, mergeProps({ ref_for: true }, slotProps))])
|
|
145
144
|
};
|
|
146
145
|
})]), 1032, [
|
|
147
|
-
"
|
|
146
|
+
"model-value",
|
|
148
147
|
"schema",
|
|
149
148
|
"adapter",
|
|
150
149
|
"components",
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
2
|
import { type JsonFormModel, type JsonFormProps } from './types';
|
|
3
3
|
type __VLS_Props = JsonFormProps;
|
|
4
|
-
|
|
5
|
-
modelValue?: JsonFormModel | undefined;
|
|
6
|
-
};
|
|
7
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
-
declare var __VLS_9: {}, __VLS_19: string, __VLS_20: {
|
|
4
|
+
declare var __VLS_9: {}, __VLS_21: string, __VLS_22: {
|
|
9
5
|
[x: string]: unknown;
|
|
10
6
|
};
|
|
11
7
|
type __VLS_Slots = {} & {
|
|
12
|
-
[K in NonNullable<typeof
|
|
8
|
+
[K in NonNullable<typeof __VLS_21>]?: (props: typeof __VLS_22) => any;
|
|
13
9
|
} & {
|
|
14
10
|
default?: (props: typeof __VLS_9) => any;
|
|
15
11
|
};
|
|
16
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
17
13
|
validate: (callback?: ((errors: undefined | Record<string, import("../form").ValidatedError>) => void) | undefined) => Promise<Record<string, import("../form").ValidatedError> | undefined> | undefined;
|
|
18
14
|
validateField: (field: string | string[], callback?: ((errors: undefined | Record<string, import("../form").ValidatedError>) => void) | undefined) => Promise<Record<string, import("../form").ValidatedError> | undefined> | undefined;
|
|
19
15
|
resetFields: (field?: string | string[] | undefined) => void | undefined;
|
|
@@ -21,11 +17,12 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
21
17
|
setFields: (data: Record<string, import("../form/interface.ts").FieldData>) => void | undefined;
|
|
22
18
|
scrollToField: (field: string) => void | undefined;
|
|
23
19
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
-
"update:modelValue": (value: JsonFormModel
|
|
25
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
26
|
-
"onUpdate:modelValue"?: ((value: JsonFormModel
|
|
20
|
+
"update:modelValue": (value: JsonFormModel) => any;
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
"onUpdate:modelValue"?: ((value: JsonFormModel) => any) | undefined;
|
|
27
23
|
}>, {
|
|
28
24
|
component: string | Component;
|
|
25
|
+
modelValue: JsonFormModel;
|
|
29
26
|
showColon: boolean;
|
|
30
27
|
hideLabel: boolean;
|
|
31
28
|
hideAsterisk: boolean;
|
|
@@ -5,15 +5,16 @@ import form_default from "../form/form.js";
|
|
|
5
5
|
import { JSON_FORM_ADAPTERS } from "./types.js";
|
|
6
6
|
import { resolveJsonFormComponents, translateA2UI_0_9_1ToJsonFormSchemas } from "./utils.js";
|
|
7
7
|
import json_form_item_default from "./json-form-item.js";
|
|
8
|
-
import { Comment, Fragment, computed, createBlock, createElementBlock, createSlots, defineComponent, inject,
|
|
8
|
+
import { Comment, Fragment, computed, createBlock, createElementBlock, createSlots, defineComponent, inject, mergeProps, openBlock, reactive, renderList, renderSlot, resolveDynamicComponent, shallowRef, unref, useSlots, watch, withCtx } from "vue";
|
|
9
9
|
//#region components/json-form/json-form.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var json_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
11
11
|
name: "JsonForm",
|
|
12
12
|
inheritAttrs: false
|
|
13
13
|
}), {}, {
|
|
14
14
|
__name: "json-form",
|
|
15
|
-
props:
|
|
15
|
+
props: {
|
|
16
16
|
schemas: {},
|
|
17
|
+
modelValue: { default: void 0 },
|
|
17
18
|
adapter: { default: void 0 },
|
|
18
19
|
model: { default: void 0 },
|
|
19
20
|
hideLabel: {
|
|
@@ -29,27 +30,27 @@ var json_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
29
30
|
default: false
|
|
30
31
|
},
|
|
31
32
|
component: { default: void 0 }
|
|
32
|
-
},
|
|
33
|
-
"modelValue": {},
|
|
34
|
-
"modelModifiers": {}
|
|
35
|
-
}),
|
|
33
|
+
},
|
|
36
34
|
emits: ["update:modelValue"],
|
|
37
|
-
setup(__props, { expose: __expose }) {
|
|
35
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
38
36
|
var _props$model;
|
|
39
37
|
const props = __props;
|
|
40
|
-
const
|
|
38
|
+
const emit = __emit;
|
|
41
39
|
const formRef = shallowRef(null);
|
|
42
|
-
const internalModel = shallowRef((_props$model = props.model) !== null && _props$model !== void 0 ? _props$model : {});
|
|
40
|
+
const internalModel = shallowRef(reactive((_props$model = props.model) !== null && _props$model !== void 0 ? _props$model : {}));
|
|
43
41
|
const configProvider = inject(configProviderInjectionKey, void 0);
|
|
44
42
|
const slots = useSlots();
|
|
45
43
|
const prefixCls = getPrefixCls("json-form");
|
|
46
44
|
watch(() => props.model, (value) => {
|
|
47
|
-
if (value && modelValue
|
|
45
|
+
if (value && props.modelValue === void 0) internalModel.value = reactive(value);
|
|
48
46
|
}, { immediate: true });
|
|
49
47
|
const workingModel = computed(() => {
|
|
50
|
-
var
|
|
51
|
-
return (
|
|
48
|
+
var _props$modelValue;
|
|
49
|
+
return (_props$modelValue = props.modelValue) !== null && _props$modelValue !== void 0 ? _props$modelValue : internalModel.value;
|
|
52
50
|
});
|
|
51
|
+
const handleWorkingModelUpdate = (value) => {
|
|
52
|
+
if (props.modelValue !== void 0) emit("update:modelValue", value);
|
|
53
|
+
};
|
|
53
54
|
const resolvedAdapter = computed(() => {
|
|
54
55
|
var _ref, _props$adapter, _configProvider$jsonF;
|
|
55
56
|
return (_ref = (_props$adapter = props.adapter) !== null && _props$adapter !== void 0 ? _props$adapter : configProvider === null || configProvider === void 0 || (_configProvider$jsonF = configProvider.jsonForm) === null || _configProvider$jsonF === void 0 ? void 0 : _configProvider$jsonF.adapter) !== null && _ref !== void 0 ? _ref : JSON_FORM_ADAPTERS.default;
|
|
@@ -59,7 +60,7 @@ var json_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
59
60
|
return resolveJsonFormComponents(configProvider === null || configProvider === void 0 || (_configProvider$jsonF2 = configProvider.jsonForm) === null || _configProvider$jsonF2 === void 0 ? void 0 : _configProvider$jsonF2.components);
|
|
60
61
|
});
|
|
61
62
|
const normalizedSchemas = computed(() => {
|
|
62
|
-
if (resolvedAdapter.value === JSON_FORM_ADAPTERS.a2ui_0_9_1) return translateA2UI_0_9_1ToJsonFormSchemas(props.schemas);
|
|
63
|
+
if (resolvedAdapter.value === JSON_FORM_ADAPTERS.a2ui_0_9_1) return translateA2UI_0_9_1ToJsonFormSchemas(props.schemas, workingModel.value);
|
|
63
64
|
return props.schemas;
|
|
64
65
|
});
|
|
65
66
|
const customComponent = computed(() => {
|
|
@@ -108,8 +109,8 @@ var json_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
108
109
|
default: withCtx(() => [hasDefaultSlot.value ? renderSlot(_ctx.$slots, "default", {}, void 0, void 0, 0) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(normalizedSchemas.value, (schema) => {
|
|
109
110
|
return openBlock(), createBlock(json_form_item_default, {
|
|
110
111
|
key: schema.field,
|
|
111
|
-
|
|
112
|
-
"onUpdate:modelValue":
|
|
112
|
+
"model-value": workingModel.value,
|
|
113
|
+
"onUpdate:modelValue": handleWorkingModelUpdate,
|
|
113
114
|
schema,
|
|
114
115
|
adapter: resolvedAdapter.value,
|
|
115
116
|
components: resolvedComponents.value,
|
|
@@ -123,7 +124,7 @@ var json_form_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
123
124
|
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, mergeProps({ ref_for: true }, slotProps))])
|
|
124
125
|
};
|
|
125
126
|
})]), 1032, [
|
|
126
|
-
"
|
|
127
|
+
"model-value",
|
|
127
128
|
"schema",
|
|
128
129
|
"adapter",
|
|
129
130
|
"components",
|
|
@@ -22,4 +22,19 @@
|
|
|
22
22
|
width: 100%;
|
|
23
23
|
min-width: 0;
|
|
24
24
|
border-radius: 4px;
|
|
25
|
+
}
|
|
26
|
+
.sd-json-form-chips {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
gap: 4px;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
.sd-json-form-chips .sd-checkbox {
|
|
33
|
+
margin-right: 0;
|
|
34
|
+
padding: 2px 6px;
|
|
35
|
+
border: 1px solid var(--sd-color-neutral-3);
|
|
36
|
+
border-radius: 4px;
|
|
37
|
+
}
|
|
38
|
+
.sd-json-form-chips .sd-checkbox-checked {
|
|
39
|
+
border-color: rgb(var(--sd-primary-6));
|
|
25
40
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
@use '@components/json-form/style/token.scss' as *;
|
|
4
4
|
|
|
5
5
|
$json-form-prefix-cls: string.unquote('#{theme.$prefix}-json-form');
|
|
6
|
+
$checkbox-prefix-cls: string.unquote('#{theme.$prefix}-checkbox');
|
|
6
7
|
|
|
7
8
|
.#{$json-form-prefix-cls} {
|
|
8
9
|
&-row {
|
|
@@ -19,4 +20,24 @@ $json-form-prefix-cls: string.unquote('#{theme.$prefix}-json-form');
|
|
|
19
20
|
// 不要在这里设 min-width,否则会覆盖 switch 这类靠 min-width 撑开根元素
|
|
20
21
|
// (滑块绝对定位、无文档流内容)的控件,把它压成 0 宽度。min-width: 0 只留在
|
|
21
22
|
// 撑满型 &-control 上,用于在 flex 容器里收缩防溢出。
|
|
23
|
+
|
|
24
|
+
// A2UI ChoicePicker displayStyle: 'chips' —— 没有专用 chips 控件,用复选组
|
|
25
|
+
// 模拟芯片样式:组内水平排列 + 描边胶囊,选中态用主题色描边。
|
|
26
|
+
&-chips {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
gap: theme.$spacing-2;
|
|
30
|
+
align-items: center;
|
|
31
|
+
|
|
32
|
+
.#{$checkbox-prefix-cls} {
|
|
33
|
+
margin-right: 0;
|
|
34
|
+
padding: theme.$spacing-1 theme.$spacing-3;
|
|
35
|
+
border: 1px solid theme.$color-border-2;
|
|
36
|
+
border-radius: theme.$border-radius-medium;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.#{$checkbox-prefix-cls}-checked {
|
|
40
|
+
border-color: theme.$color-primary-6;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
22
43
|
}
|
package/es/json-form/types.d.ts
CHANGED
|
@@ -160,6 +160,7 @@ export type JsonFormProviderConfig<TExternal extends JsonFormExternalComponentMa
|
|
|
160
160
|
export type JsonFormModel = Record<string, unknown>;
|
|
161
161
|
export type JsonFormProps<TExternal extends JsonFormExternalComponentMap = {}> = {
|
|
162
162
|
schemas: JsonFormSchema<JsonFormComponentType<TExternal>, TExternal>[] | JsonFormA2UI_0_9_1ComponentNode[];
|
|
163
|
+
modelValue?: JsonFormModel;
|
|
163
164
|
adapter?: JsonFormAdapter;
|
|
164
165
|
model?: JsonFormModel;
|
|
165
166
|
hideLabel?: boolean;
|
package/es/json-form/utils.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export declare function shouldStretchJsonFormControl(type?: string): boolean;
|
|
|
6
6
|
export declare function parseJsonFormPath(path: string, adapter?: 'default' | typeof A2UI_0_9_1): string[];
|
|
7
7
|
export declare function getJsonFormValue(model: JsonFormModel | undefined, path: string, adapter?: 'default' | typeof A2UI_0_9_1): unknown;
|
|
8
8
|
export declare function setJsonFormValue(model: JsonFormModel | undefined, path: string, value: unknown, adapter?: 'default' | typeof A2UI_0_9_1): void;
|
|
9
|
-
export declare function translateA2UI_0_9_1ToJsonFormSchemas(nodes: JsonFormA2UI_0_9_1ComponentNode[]): JsonFormSchema<string>[];
|
|
9
|
+
export declare function translateA2UI_0_9_1ToJsonFormSchemas(nodes: JsonFormA2UI_0_9_1ComponentNode[], model?: JsonFormModel): JsonFormSchema<string>[];
|
|
10
10
|
export declare function mergeJsonFormClassName(...classNames: unknown[]): unknown[];
|
package/es/json-form/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
2
3
|
import input_password_default from "../input/input-password.js";
|
|
3
4
|
import input_search_default from "../input/input-search.js";
|
|
4
5
|
import Input from "../input/index.js";
|
|
@@ -11,7 +12,7 @@ import InputNumber from "../input-number/index.js";
|
|
|
11
12
|
import InputTag from "../input-tag/index.js";
|
|
12
13
|
import Select from "../select/index.js";
|
|
13
14
|
import grid_row_default from "../grid/grid-row.js";
|
|
14
|
-
import { JSON_FORM_COMPONENT_TYPES } from "./types.js";
|
|
15
|
+
import { A2UI_0_9_1, JSON_FORM_COMPONENT_TYPES } from "./types.js";
|
|
15
16
|
import Cascader from "../cascader/index.js";
|
|
16
17
|
import range_picker_default from "../date-picker/range-picker.js";
|
|
17
18
|
import DatePicker from "../date-picker/index.js";
|
|
@@ -107,10 +108,15 @@ function setJsonFormValue(model, path, value, adapter = "default") {
|
|
|
107
108
|
function resolveA2UI_0_9_1Path(value) {
|
|
108
109
|
if (value && typeof value === "object" && "path" in value && typeof value.path === "string") return value.path;
|
|
109
110
|
}
|
|
110
|
-
function resolveA2UI_0_9_1Text(value) {
|
|
111
|
-
|
|
111
|
+
function resolveA2UI_0_9_1Text(value, model) {
|
|
112
|
+
if (typeof value === "string") return value;
|
|
113
|
+
const path = resolveA2UI_0_9_1Path(value);
|
|
114
|
+
if (path && model) {
|
|
115
|
+
const resolved = getJsonFormValue(model, path, A2UI_0_9_1);
|
|
116
|
+
if (typeof resolved === "string" || typeof resolved === "number") return String(resolved);
|
|
117
|
+
}
|
|
112
118
|
}
|
|
113
|
-
function translateA2UI_0_9_1Field(node) {
|
|
119
|
+
function translateA2UI_0_9_1Field(node, model) {
|
|
114
120
|
const field = resolveA2UI_0_9_1Path(node.value);
|
|
115
121
|
if (!field) return [];
|
|
116
122
|
switch (node.component) {
|
|
@@ -120,31 +126,32 @@ function translateA2UI_0_9_1Field(node) {
|
|
|
120
126
|
const type = variant === "longText" ? JSON_FORM_COMPONENT_TYPES.textarea : variant === "number" ? JSON_FORM_COMPONENT_TYPES.inputNumber : variant === "obscured" ? JSON_FORM_COMPONENT_TYPES.inputPassword : JSON_FORM_COMPONENT_TYPES.input;
|
|
121
127
|
return [{
|
|
122
128
|
field,
|
|
123
|
-
label: resolveA2UI_0_9_1Text(textField.label),
|
|
129
|
+
label: resolveA2UI_0_9_1Text(textField.label, model),
|
|
124
130
|
type,
|
|
125
131
|
componentProps: textField.validationRegexp ? { inputAttrs: { pattern: textField.validationRegexp } } : void 0
|
|
126
132
|
}];
|
|
127
133
|
}
|
|
128
134
|
case "CheckBox": return [{
|
|
129
135
|
field,
|
|
130
|
-
label: resolveA2UI_0_9_1Text(node.label),
|
|
136
|
+
label: resolveA2UI_0_9_1Text(node.label, model),
|
|
131
137
|
type: JSON_FORM_COMPONENT_TYPES.checkbox
|
|
132
138
|
}];
|
|
133
139
|
case "ChoicePicker": {
|
|
134
140
|
const choicePicker = node;
|
|
135
141
|
return [{
|
|
136
142
|
field,
|
|
137
|
-
label: resolveA2UI_0_9_1Text(choicePicker.label),
|
|
143
|
+
label: resolveA2UI_0_9_1Text(choicePicker.label, model),
|
|
138
144
|
type: JSON_FORM_COMPONENT_TYPES.checkboxGroup,
|
|
139
145
|
componentProps: {
|
|
140
146
|
options: choicePicker.options.map((option) => {
|
|
141
147
|
var _resolveA2UI_0_9_1Tex;
|
|
142
148
|
return {
|
|
143
|
-
label: (_resolveA2UI_0_9_1Tex = resolveA2UI_0_9_1Text(option.label)) !== null && _resolveA2UI_0_9_1Tex !== void 0 ? _resolveA2UI_0_9_1Tex : option.value,
|
|
149
|
+
label: (_resolveA2UI_0_9_1Tex = resolveA2UI_0_9_1Text(option.label, model)) !== null && _resolveA2UI_0_9_1Tex !== void 0 ? _resolveA2UI_0_9_1Tex : option.value,
|
|
144
150
|
value: option.value
|
|
145
151
|
};
|
|
146
152
|
}),
|
|
147
|
-
max: choicePicker.variant === "multipleSelection" ? void 0 : 1
|
|
153
|
+
max: choicePicker.variant === "multipleSelection" ? void 0 : 1,
|
|
154
|
+
class: choicePicker.displayStyle === "chips" ? `${getPrefixCls("json-form")}-chips` : void 0
|
|
148
155
|
}
|
|
149
156
|
}];
|
|
150
157
|
}
|
|
@@ -153,7 +160,7 @@ function translateA2UI_0_9_1Field(node) {
|
|
|
153
160
|
const slider = node;
|
|
154
161
|
return [{
|
|
155
162
|
field,
|
|
156
|
-
label: resolveA2UI_0_9_1Text(slider.label),
|
|
163
|
+
label: resolveA2UI_0_9_1Text(slider.label, model),
|
|
157
164
|
type: JSON_FORM_COMPONENT_TYPES.slider,
|
|
158
165
|
componentProps: {
|
|
159
166
|
min: (_slider$min = slider.min) !== null && _slider$min !== void 0 ? _slider$min : 0,
|
|
@@ -168,7 +175,7 @@ function translateA2UI_0_9_1Field(node) {
|
|
|
168
175
|
const enableTime = (_dateTimeInput$enable2 = dateTimeInput.enableTime) !== null && _dateTimeInput$enable2 !== void 0 ? _dateTimeInput$enable2 : false;
|
|
169
176
|
return [{
|
|
170
177
|
field,
|
|
171
|
-
label: resolveA2UI_0_9_1Text(dateTimeInput.label),
|
|
178
|
+
label: resolveA2UI_0_9_1Text(dateTimeInput.label, model),
|
|
172
179
|
type: enableDate ? JSON_FORM_COMPONENT_TYPES.datePicker : JSON_FORM_COMPONENT_TYPES.timePicker,
|
|
173
180
|
componentProps: enableDate && enableTime ? { showTime: true } : void 0
|
|
174
181
|
}];
|
|
@@ -176,7 +183,7 @@ function translateA2UI_0_9_1Field(node) {
|
|
|
176
183
|
default: return [];
|
|
177
184
|
}
|
|
178
185
|
}
|
|
179
|
-
function translateA2UI_0_9_1ToJsonFormSchemas(nodes) {
|
|
186
|
+
function translateA2UI_0_9_1ToJsonFormSchemas(nodes, model) {
|
|
180
187
|
const nodeMap = new Map(nodes.map((node) => [node.id, node]));
|
|
181
188
|
const visitedIds = /* @__PURE__ */ new Set();
|
|
182
189
|
const expandNode = (node) => {
|
|
@@ -200,7 +207,7 @@ function translateA2UI_0_9_1ToJsonFormSchemas(nodes) {
|
|
|
200
207
|
children
|
|
201
208
|
}];
|
|
202
209
|
}
|
|
203
|
-
return translateA2UI_0_9_1Field(node);
|
|
210
|
+
return translateA2UI_0_9_1Field(node, model);
|
|
204
211
|
};
|
|
205
212
|
const root = nodeMap.get("root");
|
|
206
213
|
return root ? expandNode(root) : [];
|
|
@@ -1,7 +1,28 @@
|
|
|
1
|
+
import { isFunction } from "../../_utils/is.js";
|
|
1
2
|
import { computed } from "vue";
|
|
2
3
|
//#region components/layout/hooks/use-has-sider.ts
|
|
3
4
|
var SIDER_COMPONENT_NAME = "LayoutSider";
|
|
4
5
|
/**
|
|
6
|
+
* @zh 归一化 vnode 的 children 为 vnode 列表,供静态扫描递归:
|
|
7
|
+
* - 数组:直接返回;
|
|
8
|
+
* - 函数:h() 风格的单插槽函数,调用后返回列表;
|
|
9
|
+
* - 对象:编译模板的 slots 对象(调用 default 插槽),否则视为单个 vnode。
|
|
10
|
+
* @en Normalize a vnode children into a vnode list for static scanning:
|
|
11
|
+
* - array: returned as is;
|
|
12
|
+
* - function: single slot function (h() style), invoked;
|
|
13
|
+
* - object: compiled-template slots object (default slot invoked), otherwise treated as a single vnode.
|
|
14
|
+
*/
|
|
15
|
+
function normalizeChildren(vnode) {
|
|
16
|
+
const { children } = vnode;
|
|
17
|
+
if (Array.isArray(children)) return children;
|
|
18
|
+
if (isFunction(children)) return children();
|
|
19
|
+
if (children && typeof children === "object") {
|
|
20
|
+
const { default: defaultSlot } = children;
|
|
21
|
+
if (isFunction(defaultSlot)) return defaultSlot();
|
|
22
|
+
return [children];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
5
26
|
* @zh 递归判断 VNode 列表中是否存在 Sider 组件
|
|
6
27
|
* @en Recursively detect whether a Sider component exists in the VNode list
|
|
7
28
|
*/
|
|
@@ -11,8 +32,8 @@ function hasSiderInVNodes(vnodes) {
|
|
|
11
32
|
if (!vnode) continue;
|
|
12
33
|
const { type } = vnode;
|
|
13
34
|
if (type && typeof type === "object" && "name" in type && type.name === SIDER_COMPONENT_NAME) return true;
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
35
|
+
const childVNodes = normalizeChildren(vnode);
|
|
36
|
+
if (childVNodes && hasSiderInVNodes(childVNodes)) return true;
|
|
16
37
|
}
|
|
17
38
|
return false;
|
|
18
39
|
}
|
package/es/layout/interface.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { SiderBreakpoint } from '../_utils/responsive-observe';
|
|
|
3
3
|
import type { DrawerProps } from '../drawer';
|
|
4
4
|
import type { ScrollbarProps } from '../scrollbar';
|
|
5
5
|
export type SiderTheme = 'light' | 'dark';
|
|
6
|
-
export type CollapseType = 'clickTrigger' | 'responsive';
|
|
6
|
+
export type CollapseType = 'clickTrigger' | 'responsive' | 'mask';
|
|
7
7
|
export interface LayoutProps {
|
|
8
8
|
hasSider?: boolean;
|
|
9
9
|
}
|
|
@@ -329,7 +329,7 @@ var sider_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
329
329
|
footer: false
|
|
330
330
|
}, props.drawerProps));
|
|
331
331
|
const onDrawerVisibleChange = (visible) => {
|
|
332
|
-
if (visible !== !mergedCollapsed.value) handleSetCollapsed(!visible, "
|
|
332
|
+
if (visible !== !mergedCollapsed.value) handleSetCollapsed(!visible, "mask");
|
|
333
333
|
};
|
|
334
334
|
const mergedSiderRail = computed(() => !!props.rail && !isRailExpanded.value);
|
|
335
335
|
const siderRailWidthValue = computed(() => props.rail && typeof props.railWidth === "number" ? props.railWidth : void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.146.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
3
|
import { PerformantEllipsis } from "../ellipsis/index.js";
|
|
4
|
-
import { createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
4
|
+
import { computed, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref, useSlots, withCtx } from "vue";
|
|
5
5
|
//#region components/list/list-item-meta.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var list_item_meta_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, { name: "ListItemMeta" }), {}, {
|
|
7
7
|
__name: "list-item-meta",
|
|
@@ -36,12 +36,12 @@ var list_item_meta_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
36
36
|
*/
|
|
37
37
|
const slots = useSlots();
|
|
38
38
|
const prefixCls = getPrefixCls("list-item-meta");
|
|
39
|
-
const hasContent = Boolean(props.title || props.description || slots.title || slots.description);
|
|
39
|
+
const hasContent = computed(() => Boolean(props.title || props.description || slots.title || slots.description));
|
|
40
40
|
return (_ctx, _cache) => {
|
|
41
41
|
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(prefixCls)) }, [_ctx.$slots.avatar ? (openBlock(), createElementBlock("div", {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: normalizeClass(`${unref(prefixCls)}-avatar`)
|
|
44
|
-
}, [renderSlot(_ctx.$slots, "avatar")], 2)) : createCommentVNode("", true),
|
|
44
|
+
}, [renderSlot(_ctx.$slots, "avatar")], 2)) : createCommentVNode("", true), hasContent.value ? (openBlock(), createElementBlock("div", {
|
|
45
45
|
key: 1,
|
|
46
46
|
class: normalizeClass(`${unref(prefixCls)}-content`)
|
|
47
47
|
}, [_ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("div", {
|
package/es/locale/interface.d.ts
CHANGED
|
@@ -235,6 +235,9 @@ export interface SdLang {
|
|
|
235
235
|
image: {
|
|
236
236
|
loading: string;
|
|
237
237
|
};
|
|
238
|
+
filePreview: {
|
|
239
|
+
loadFailed: string;
|
|
240
|
+
};
|
|
238
241
|
imagePreview: {
|
|
239
242
|
fullScreen: string;
|
|
240
243
|
rotateRight: string;
|
|
@@ -250,6 +253,10 @@ export interface SdLang {
|
|
|
250
253
|
collapse: string;
|
|
251
254
|
edit: string;
|
|
252
255
|
};
|
|
256
|
+
copy: {
|
|
257
|
+
copy: string;
|
|
258
|
+
copied: string;
|
|
259
|
+
};
|
|
253
260
|
form?: {
|
|
254
261
|
validateMessages: ValidateMessage;
|
|
255
262
|
};
|
package/es/locale/lang/en-us.js
CHANGED
|
@@ -134,6 +134,7 @@ var lang = {
|
|
|
134
134
|
ok: "Ok"
|
|
135
135
|
},
|
|
136
136
|
image: { loading: "loading" },
|
|
137
|
+
filePreview: { loadFailed: "File preview failed to load" },
|
|
137
138
|
imagePreview: {
|
|
138
139
|
fullScreen: "Full Screen",
|
|
139
140
|
rotateRight: "Rotate Right",
|
|
@@ -149,6 +150,10 @@ var lang = {
|
|
|
149
150
|
collapse: "Collapse",
|
|
150
151
|
edit: "Edit"
|
|
151
152
|
},
|
|
153
|
+
copy: {
|
|
154
|
+
copy: "Copy",
|
|
155
|
+
copied: "Copied successfully"
|
|
156
|
+
},
|
|
152
157
|
form: { validateMessages: DefaultValidateMessage },
|
|
153
158
|
colorPicker: {
|
|
154
159
|
history: "History Colors",
|
package/es/locale/lang/zh-cn.js
CHANGED
|
@@ -133,6 +133,7 @@ var lang = {
|
|
|
133
133
|
ok: "确定"
|
|
134
134
|
},
|
|
135
135
|
image: { loading: "加载中" },
|
|
136
|
+
filePreview: { loadFailed: "文件预览加载失败" },
|
|
136
137
|
imagePreview: {
|
|
137
138
|
fullScreen: "全屏",
|
|
138
139
|
rotateRight: "向右旋转",
|
|
@@ -148,6 +149,10 @@ var lang = {
|
|
|
148
149
|
collapse: "折叠",
|
|
149
150
|
edit: "编辑"
|
|
150
151
|
},
|
|
152
|
+
copy: {
|
|
153
|
+
copy: "复制",
|
|
154
|
+
copied: "复制成功"
|
|
155
|
+
},
|
|
151
156
|
form: { validateMessages: {
|
|
152
157
|
required: "#{field} 是必填项",
|
|
153
158
|
type: {
|
package/es/mention/index.d.ts
CHANGED
|
@@ -20,6 +20,10 @@ declare const Mention: {
|
|
|
20
20
|
type: StringConstructor;
|
|
21
21
|
default: string;
|
|
22
22
|
};
|
|
23
|
+
filterOption: {
|
|
24
|
+
type: import("vue").PropType<import("../index.ts").FilterOption>;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
23
27
|
type: {
|
|
24
28
|
type: import("vue").PropType<"input" | "textarea">;
|
|
25
29
|
default: string;
|
|
@@ -1130,6 +1134,7 @@ declare const Mention: {
|
|
|
1130
1134
|
allowClear: boolean;
|
|
1131
1135
|
fitWidth: boolean;
|
|
1132
1136
|
maxWFull: boolean;
|
|
1137
|
+
filterOption: import("../index.ts").FilterOption;
|
|
1133
1138
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
1134
1139
|
P: {};
|
|
1135
1140
|
B: {};
|
|
@@ -1155,6 +1160,10 @@ declare const Mention: {
|
|
|
1155
1160
|
type: StringConstructor;
|
|
1156
1161
|
default: string;
|
|
1157
1162
|
};
|
|
1163
|
+
filterOption: {
|
|
1164
|
+
type: import("vue").PropType<import("../index.ts").FilterOption>;
|
|
1165
|
+
default: boolean;
|
|
1166
|
+
};
|
|
1158
1167
|
type: {
|
|
1159
1168
|
type: import("vue").PropType<"input" | "textarea">;
|
|
1160
1169
|
default: string;
|
|
@@ -2257,6 +2266,7 @@ declare const Mention: {
|
|
|
2257
2266
|
allowClear: boolean;
|
|
2258
2267
|
fitWidth: boolean;
|
|
2259
2268
|
maxWFull: boolean;
|
|
2269
|
+
filterOption: import("../index.ts").FilterOption;
|
|
2260
2270
|
}>;
|
|
2261
2271
|
__isFragment?: never;
|
|
2262
2272
|
__isTeleport?: never;
|
|
@@ -2279,6 +2289,10 @@ declare const Mention: {
|
|
|
2279
2289
|
type: StringConstructor;
|
|
2280
2290
|
default: string;
|
|
2281
2291
|
};
|
|
2292
|
+
filterOption: {
|
|
2293
|
+
type: import("vue").PropType<import("../index.ts").FilterOption>;
|
|
2294
|
+
default: boolean;
|
|
2295
|
+
};
|
|
2282
2296
|
type: {
|
|
2283
2297
|
type: import("vue").PropType<"input" | "textarea">;
|
|
2284
2298
|
default: string;
|
|
@@ -3389,6 +3403,7 @@ declare const Mention: {
|
|
|
3389
3403
|
allowClear: boolean;
|
|
3390
3404
|
fitWidth: boolean;
|
|
3391
3405
|
maxWFull: boolean;
|
|
3406
|
+
filterOption: import("../index.ts").FilterOption;
|
|
3392
3407
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
3393
3408
|
$slots: {
|
|
3394
3409
|
option?: (props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nextTick } from 'vue';
|
|
2
2
|
import type { ComponentPublicInstance, PropType } from 'vue';
|
|
3
3
|
import type { FloatingOptions } from '../_utils/floating';
|
|
4
|
-
import type { SelectOptionData, SelectOptionGroup } from '../select/interface';
|
|
4
|
+
import type { FilterOption, SelectOptionData, SelectOptionGroup } from '../select/interface';
|
|
5
5
|
declare var __VLS_15: {
|
|
6
6
|
data: {
|
|
7
7
|
[x: string]: unknown;
|
|
@@ -46,6 +46,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
46
46
|
type: StringConstructor;
|
|
47
47
|
default: string;
|
|
48
48
|
};
|
|
49
|
+
filterOption: {
|
|
50
|
+
type: PropType<FilterOption>;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
49
53
|
type: {
|
|
50
54
|
type: PropType<"input" | "textarea">;
|
|
51
55
|
default: string;
|
|
@@ -1155,6 +1159,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
1155
1159
|
type: StringConstructor;
|
|
1156
1160
|
default: string;
|
|
1157
1161
|
};
|
|
1162
|
+
filterOption: {
|
|
1163
|
+
type: PropType<FilterOption>;
|
|
1164
|
+
default: boolean;
|
|
1165
|
+
};
|
|
1158
1166
|
type: {
|
|
1159
1167
|
type: PropType<"input" | "textarea">;
|
|
1160
1168
|
default: string;
|
|
@@ -1199,6 +1207,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
1199
1207
|
allowClear: boolean;
|
|
1200
1208
|
fitWidth: boolean;
|
|
1201
1209
|
maxWFull: boolean;
|
|
1210
|
+
filterOption: FilterOption;
|
|
1202
1211
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
1203
1212
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
1204
1213
|
declare const _default: typeof __VLS_export;
|