ll-plus 2.6.21 → 2.6.22
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/index.mjs +1 -0
- package/es/index.mjs.map +1 -1
- package/es/packages/components/form/src/form.vue2.mjs +3 -1
- package/es/packages/components/form/src/form.vue2.mjs.map +1 -1
- package/es/packages/utils/deepUnref.mjs +16 -0
- package/es/packages/utils/deepUnref.mjs.map +1 -0
- package/es/packages/utils/index.mjs +1 -0
- package/es/packages/utils/index.mjs.map +1 -1
- package/es/utils/deepUnref.d.ts +1 -0
- package/es/utils/index.d.ts +1 -0
- package/index.full.js +14 -1
- package/index.full.min.js +19 -19
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +18 -18
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +15 -3
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/packages/components/form/src/form.vue2.js +3 -1
- package/lib/packages/components/form/src/form.vue2.js.map +1 -1
- package/lib/packages/utils/deepUnref.js +18 -0
- package/lib/packages/utils/deepUnref.js.map +1 -0
- package/lib/packages/utils/index.js +2 -0
- package/lib/packages/utils/index.js.map +1 -1
- package/lib/utils/deepUnref.d.ts +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/theme-chalk/fonts/iconfont.js +1 -1
- package/theme-chalk/fonts/iconfont.json +84 -0
- package/types/packages/utils/deepUnref.d.ts +1 -0
- package/types/packages/utils/index.d.ts +1 -0
package/index.full.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import require$$0, { warn, defineComponent, ref, computed, watch, resolveComponent, openBlock, createBlock, normalizeClass,
|
|
1
|
+
import require$$0, { warn, unref, defineComponent, ref, computed, watch, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createVNode, createElementVNode, mergeProps, createElementBlock, createTextVNode, createCommentVNode, watchEffect, Fragment, renderList, toDisplayString, withModifiers, inject, useAttrs, withDirectives, vShow, normalizeStyle, provide, normalizeProps, guardReactiveProps, renderSlot, onUnmounted, createSlots, onBeforeUnmount, onMounted, createApp, nextTick, reactive, resolveDynamicComponent, markRaw, getCurrentInstance, h, shallowRef, isRef, toRef, toRefs } from 'vue';
|
|
2
2
|
export { isVNode } from 'vue';
|
|
3
3
|
import { Form as Form$1, Drawer as Drawer$2, Button as Button$1, Cascader as Cascader$1, Checkbox as Checkbox$1, Row, Col, DatePicker as DatePicker$1, RangePicker, theme, InputNumber as InputNumber$1, RadioGroup as RadioGroup$1, Radio as Radio$1, CheckboxGroup as CheckboxGroup$1, Select as Select$1, Tabs, TabPane, InputSearch, FormItem as FormItem$1, Input as Input$1, Modal as Modal$2, RadioButton as RadioButton$1, Segmented as Segmented$1, SelectOption as SelectOption$1, SelectOptGroup as SelectOptGroup$1, Steps as Steps$1, Switch as Switch$1, Popover, Textarea as Textarea$1, TimePicker as TimePicker$1, TimeRangePicker, Tree as Tree$1, message, Watermark as Watermark$1 } from 'ant-design-vue';
|
|
4
4
|
import * as monaco from 'monaco-editor';
|
|
@@ -1948,6 +1948,17 @@ function dataURLtoBlob(base64Buf) {
|
|
|
1948
1948
|
return new Blob([u8arr], { type: mime });
|
|
1949
1949
|
}
|
|
1950
1950
|
|
|
1951
|
+
const deepUnref = (obj) => {
|
|
1952
|
+
const currentObj = unref(obj);
|
|
1953
|
+
for (const i in obj) {
|
|
1954
|
+
currentObj[i] = unref(obj[i]);
|
|
1955
|
+
if (typeof obj[i] === "object") {
|
|
1956
|
+
currentObj[i] = deepUnref(obj[i]);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
return currentObj;
|
|
1960
|
+
};
|
|
1961
|
+
|
|
1951
1962
|
const ALL_VALUE = "_ALL";
|
|
1952
1963
|
const initValue = (columns, values) => {
|
|
1953
1964
|
const copyValues = {};
|
|
@@ -61704,7 +61715,8 @@ var _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
61704
61715
|
const formRef = ref();
|
|
61705
61716
|
const formComponents = ref([]);
|
|
61706
61717
|
const computedFormColumns = computed(() => {
|
|
61707
|
-
|
|
61718
|
+
const formColumns = deepUnref(props.formColumns);
|
|
61719
|
+
return formColumns.map((e) => {
|
|
61708
61720
|
e.disabled = has(e, "disabled") ? e.disabled : props.disabled;
|
|
61709
61721
|
if (e.children && e.children.length) {
|
|
61710
61722
|
e.children.map((a) => {
|
|
@@ -83970,4 +83982,4 @@ var installer = makeInstaller([...Components]);
|
|
|
83970
83982
|
|
|
83971
83983
|
const install = installer.install;
|
|
83972
83984
|
|
|
83973
|
-
export { ALL_VALUE, AVATAR_IMG, DEFAULT_METHOD, DEFAULT_TYPE, FALLBACK_IMAGE, FALL_BACK_IMG, HEADER_SRARCH_HEIGHT, ILlUploadDragProps, ImenuSwitchType, LEFT_SELECT_MIN_WIDTH, LlAdvancedFiltering, LlAdvancedFilteringParams, LlAdvancedFilteringTags, LlApiComponent, LlAvatar, LlBreadcrumbCard, LlButton, LlCascader, LlCheckbox, LlCheckboxGroup, LlCodeEditor, LlConfigProvider, LlCropperImage, LlCropperModal, LlDatePicker, LlDateRange, LlDescriptions, LlDescriptionsItem, LlDrawer, LlDropdown, LlDropdownButton, LlEasyCron, LlEmpty, LlForm, LlFormComponent, LlFormItem, LlIcon, LlIconBase, LlIconPicker, LlImage, LlImagePreviewGroup, LlInput, LlInputNumber, LlKeyValue, LlMarkdownEditor, LlMarkdownViewer, LlModal, LlNewDrawer, LlNewModal, LlNumberRange, LlOperateIcon, LlOperateTree, LlRadio, LlRadioButton, LlRadioGroup, LlRichTextEditor, LlSecondConfirmation, LlSegmented, LlSelect, LlSelectGroup, LlSelectOptGroup, LlSelectOption, LlSpace, LlSteps, LlSwitch, LlTable, LlTabsSimple, LlTagGroup, LlTextarea, LlTimePicker, LlTimeRange, LlTooltip, LlTree, LlTreeSearch, LlUploadDrag, LlUploadImage, LlUriInput, LlWatermark, OperateTreeEmits, PAGINATION_HEIGHT, THROTTLE_TIME, TypeEnum, addUnit, advancedFilteringEmits, advancedFilteringParamsEmits, advancedFilteringParamsProps, advancedFilteringProps, advancedFilteringTagsEmits, apiComponentEmits, apiComponentProps, apiModalEmits, apiModalProps, apiUrlEmits, apiUrlProps, avatarEmits, avatarProps, avatarType, batchEditingEmits, batchEditingOptions, batchEditingProps, bodyEmits, bodyList, bodyProps, breadcrumbCardEmits, breadcrumbCardProps, buildProp, buildProps, buttonProps, calcRPN, checkboxGroupProps, checkboxProps, checkedType, clickInputEmits, clickInputProps, codeEditorEmits, codeEditorProps, codeThemeList, contentTypeOptions, createNamespace, cropperImageEmits, cropperImageProps, cropperModalEmits, cropperModalProps, customOverlay, dataURLtoBlob, dateUtil, installer as default, defaultCropperOptions, defaultEditorConfig, defaultOptions, defaultToolbarConfig, definePropType, descriptionsItemProps, descriptionsProps, drawerEmits, drawerOptions, drawerProps, dropdownButtonEmits, dropdownButtonProps, dropdownEmits, dropdownProps, easyCronEmits, easyCronProps, emptyProps, epPropKey, fileToBase64, filterAllValue, findLabelByValue, footerShadowPlacement, formColumns, formComponentEmits, formComponentProps, formEmits, formOptions, formProps, formatFileSize, formatToDate, formatToDateTime, formdataTableColumns, getAmountChinese, getDateTimeUnit, getHttpMethodUri, getKeyValueItem, getType, hasValue, headersTableColumns, httpUriOptions, iconBaseProps, iconPickerModalEmits, iconPickerModalProps, iconPickerProps, iconPickerSearchEmits, iconPickerSearchProps, iconProps, iconTypes, imageProps, initValue, inputNumberEmits, inputNumberProps, inputProps, install, isArray, isBoolean, isDate$1 as isDate, isElement, isEmpty, isEpProp, isFunction$1 as isFunction, isNumber$2 as isNumber, isObject$1 as isObject, isPromise, isPropAbsent, isString$1 as isString, isStringNumber, isSymbol, isUndefined$2 as isUndefined, isWindow, jsonTableColumns, jsonXmlEmits, jsonXmlOptions, jsonXmlProps, jsonXmlTableEmits, jsonXmlTableProps, jsonXmlTableRowEmits, jsonXmlTableRowProps, jsonXmlTypeOptions, keyValueEmits, keyValueItemEmits, keyValueItemProps, keyValueProps, llMarkdownEditorEmits, llMarkdownEditorProps, llMarkdownViewerProps, mainTableEmits, mainTableProps, menuSwitchRadioList, mergeNumberOfExps, methods$1 as methods, modalEmits, modalProps, modalType, mutable, newDrawerEmits, newDrawerProps, newModalEmits, newModalProps, numberRangeEmits, numberRangeProps, operateIconEmits, operateIconProps, operateTreeEmits, operateTreeProps, paramsOptions, paramsTableColumns, paramsTableEmits, paramsTableProps, paramsTableRowProps, placement, removeQueryString, requestList, richTextEditorEmits, richTextEditorProps, secondConfirmationProps, selectGroupData, selectGroupEmits, selectGroupFormType, selectGroupProps, selectOptGroupProps, selectOptionProps, tableContentType, tableHeaderSearchEmits, tableHeaderSearchProps, tablePaginationProps, tableProps, tabsSimpleEmits, tabsSimpleProps, tagGroupEmits, tagGroupProps, thousandsFormat, toRPN, tooltipProps, treeDataFormat, treeEmits, treeProps, treeSearchEmits, treeSearchEmits1, treeSearchOperateWayType, treeSearchProps, treeSelectDirectoryTitleEmits, treeSelectDirectoryTitleProps, treeSelectHeaderSearchEmits, treeSelectHeaderSearchProps, typeRules, uploadImageEmits, uploadImageProps, uriInputEmits, uriInputProps, url, useScroll, useSecondConfirmation, useTabEmits, useTabProps, useTabSetup, withInstall };
|
|
83985
|
+
export { ALL_VALUE, AVATAR_IMG, DEFAULT_METHOD, DEFAULT_TYPE, FALLBACK_IMAGE, FALL_BACK_IMG, HEADER_SRARCH_HEIGHT, ILlUploadDragProps, ImenuSwitchType, LEFT_SELECT_MIN_WIDTH, LlAdvancedFiltering, LlAdvancedFilteringParams, LlAdvancedFilteringTags, LlApiComponent, LlAvatar, LlBreadcrumbCard, LlButton, LlCascader, LlCheckbox, LlCheckboxGroup, LlCodeEditor, LlConfigProvider, LlCropperImage, LlCropperModal, LlDatePicker, LlDateRange, LlDescriptions, LlDescriptionsItem, LlDrawer, LlDropdown, LlDropdownButton, LlEasyCron, LlEmpty, LlForm, LlFormComponent, LlFormItem, LlIcon, LlIconBase, LlIconPicker, LlImage, LlImagePreviewGroup, LlInput, LlInputNumber, LlKeyValue, LlMarkdownEditor, LlMarkdownViewer, LlModal, LlNewDrawer, LlNewModal, LlNumberRange, LlOperateIcon, LlOperateTree, LlRadio, LlRadioButton, LlRadioGroup, LlRichTextEditor, LlSecondConfirmation, LlSegmented, LlSelect, LlSelectGroup, LlSelectOptGroup, LlSelectOption, LlSpace, LlSteps, LlSwitch, LlTable, LlTabsSimple, LlTagGroup, LlTextarea, LlTimePicker, LlTimeRange, LlTooltip, LlTree, LlTreeSearch, LlUploadDrag, LlUploadImage, LlUriInput, LlWatermark, OperateTreeEmits, PAGINATION_HEIGHT, THROTTLE_TIME, TypeEnum, addUnit, advancedFilteringEmits, advancedFilteringParamsEmits, advancedFilteringParamsProps, advancedFilteringProps, advancedFilteringTagsEmits, apiComponentEmits, apiComponentProps, apiModalEmits, apiModalProps, apiUrlEmits, apiUrlProps, avatarEmits, avatarProps, avatarType, batchEditingEmits, batchEditingOptions, batchEditingProps, bodyEmits, bodyList, bodyProps, breadcrumbCardEmits, breadcrumbCardProps, buildProp, buildProps, buttonProps, calcRPN, checkboxGroupProps, checkboxProps, checkedType, clickInputEmits, clickInputProps, codeEditorEmits, codeEditorProps, codeThemeList, contentTypeOptions, createNamespace, cropperImageEmits, cropperImageProps, cropperModalEmits, cropperModalProps, customOverlay, dataURLtoBlob, dateUtil, deepUnref, installer as default, defaultCropperOptions, defaultEditorConfig, defaultOptions, defaultToolbarConfig, definePropType, descriptionsItemProps, descriptionsProps, drawerEmits, drawerOptions, drawerProps, dropdownButtonEmits, dropdownButtonProps, dropdownEmits, dropdownProps, easyCronEmits, easyCronProps, emptyProps, epPropKey, fileToBase64, filterAllValue, findLabelByValue, footerShadowPlacement, formColumns, formComponentEmits, formComponentProps, formEmits, formOptions, formProps, formatFileSize, formatToDate, formatToDateTime, formdataTableColumns, getAmountChinese, getDateTimeUnit, getHttpMethodUri, getKeyValueItem, getType, hasValue, headersTableColumns, httpUriOptions, iconBaseProps, iconPickerModalEmits, iconPickerModalProps, iconPickerProps, iconPickerSearchEmits, iconPickerSearchProps, iconProps, iconTypes, imageProps, initValue, inputNumberEmits, inputNumberProps, inputProps, install, isArray, isBoolean, isDate$1 as isDate, isElement, isEmpty, isEpProp, isFunction$1 as isFunction, isNumber$2 as isNumber, isObject$1 as isObject, isPromise, isPropAbsent, isString$1 as isString, isStringNumber, isSymbol, isUndefined$2 as isUndefined, isWindow, jsonTableColumns, jsonXmlEmits, jsonXmlOptions, jsonXmlProps, jsonXmlTableEmits, jsonXmlTableProps, jsonXmlTableRowEmits, jsonXmlTableRowProps, jsonXmlTypeOptions, keyValueEmits, keyValueItemEmits, keyValueItemProps, keyValueProps, llMarkdownEditorEmits, llMarkdownEditorProps, llMarkdownViewerProps, mainTableEmits, mainTableProps, menuSwitchRadioList, mergeNumberOfExps, methods$1 as methods, modalEmits, modalProps, modalType, mutable, newDrawerEmits, newDrawerProps, newModalEmits, newModalProps, numberRangeEmits, numberRangeProps, operateIconEmits, operateIconProps, operateTreeEmits, operateTreeProps, paramsOptions, paramsTableColumns, paramsTableEmits, paramsTableProps, paramsTableRowProps, placement, removeQueryString, requestList, richTextEditorEmits, richTextEditorProps, secondConfirmationProps, selectGroupData, selectGroupEmits, selectGroupFormType, selectGroupProps, selectOptGroupProps, selectOptionProps, tableContentType, tableHeaderSearchEmits, tableHeaderSearchProps, tablePaginationProps, tableProps, tabsSimpleEmits, tabsSimpleProps, tagGroupEmits, tagGroupProps, thousandsFormat, toRPN, tooltipProps, treeDataFormat, treeEmits, treeProps, treeSearchEmits, treeSearchEmits1, treeSearchOperateWayType, treeSearchProps, treeSelectDirectoryTitleEmits, treeSelectDirectoryTitleProps, treeSelectHeaderSearchEmits, treeSelectHeaderSearchProps, typeRules, uploadImageEmits, uploadImageProps, uriInputEmits, uriInputProps, url, useScroll, useSecondConfirmation, useTabEmits, useTabProps, useTabSetup, withInstall };
|
package/lib/index.js
CHANGED
|
@@ -139,6 +139,7 @@ var shared = require('@vue/shared');
|
|
|
139
139
|
var vue = require('vue');
|
|
140
140
|
var types = require('./packages/utils/types.js');
|
|
141
141
|
var file = require('./packages/utils/file.js');
|
|
142
|
+
var deepUnref = require('./packages/utils/deepUnref.js');
|
|
142
143
|
var index$V = require('./packages/hooks/use-scroll/index.js');
|
|
143
144
|
|
|
144
145
|
"use strict";
|
|
@@ -451,6 +452,7 @@ exports.isWindow = types.isWindow;
|
|
|
451
452
|
exports.dataURLtoBlob = file.dataURLtoBlob;
|
|
452
453
|
exports.fileToBase64 = file.fileToBase64;
|
|
453
454
|
exports.formatFileSize = file.formatFileSize;
|
|
455
|
+
exports.deepUnref = deepUnref.deepUnref;
|
|
454
456
|
exports.useScroll = index$V.useScroll;
|
|
455
457
|
exports.install = install;
|
|
456
458
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../packages/ll-plus/index.ts"],"sourcesContent":["import installer from './defaults'\n\nexport * from '@ll-plus/components'\nexport * from '@ll-plus/constant'\nexport * from '@ll-plus/utils'\nexport * from '@ll-plus/hooks'\n\nexport const install = installer.install\nexport default installer\n"],"names":["installer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../packages/ll-plus/index.ts"],"sourcesContent":["import installer from './defaults'\n\nexport * from '@ll-plus/components'\nexport * from '@ll-plus/constant'\nexport * from '@ll-plus/utils'\nexport * from '@ll-plus/hooks'\n\nexport const install = installer.install\nexport default installer\n"],"names":["installer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,UAAUA,gBAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,6 +9,7 @@ require('../../../utils/index.js');
|
|
|
9
9
|
var formComponent = require('./components/form-component.vue.js');
|
|
10
10
|
var form = require('./config/form.js');
|
|
11
11
|
var createNamespace = require('../../../utils/create-namespace.js');
|
|
12
|
+
var deepUnref = require('../../../utils/deepUnref.js');
|
|
12
13
|
|
|
13
14
|
"use strict";
|
|
14
15
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -24,7 +25,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
24
25
|
const formRef = vue.ref();
|
|
25
26
|
const formComponents = vue.ref([]);
|
|
26
27
|
const computedFormColumns = vue.computed(() => {
|
|
27
|
-
|
|
28
|
+
const formColumns = deepUnref.deepUnref(props.formColumns);
|
|
29
|
+
return formColumns.map((e) => {
|
|
28
30
|
e.disabled = lodashEs.has(e, "disabled") ? e.disabled : props.disabled;
|
|
29
31
|
if (e.children && e.children.length) {
|
|
30
32
|
e.children.map((a) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.vue2.js","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <a-form\n v-bind=\"computedFormOptions\"\n :id=\"id\"\n ref=\"formRef\"\n :model=\"props.formData\"\n >\n <a-row v-bind=\"props.rowOptions\">\n <a-col\n v-for=\"(item, index) in computedFormColumns\"\n :key=\"index\"\n v-bind=\"item?.colOptions ?? {}\"\n :span=\"item?.spanCol ?? 24\"\n >\n <slot name=\"formItem\" :item=\"item\" :index=\"index\">\n <ll-form-item\n :name=\"item?.key ?? index\"\n :class=\"getFormItemClass(item)\"\n v-bind=\"getBindValue(item)\"\n >\n <template #label>\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label }}</span>\n <span v-if=\"item?.tip\" :class=\"bem.e('tooltip-wrapper')\">\n <ll-tooltip\n style=\"margin-left: 8px\"\n :overlay-class-name=\"bem.e('tooltip')\"\n :arrow-point-at-center=\"true\"\n :max-width=\"item?.tipConfig?.maxWidth ?? 406\"\n :placement=\"item?.tipConfig?.placement ?? 'top'\"\n :tip=\"item.tip\"\n :font-size=\"'16px'\"\n v-bind=\"item?.tipConfig\"\n />\n </span>\n </slot>\n </template>\n <slot name=\"content\" :item=\"item\" :index=\"index\">\n <template v-if=\"!isEmpty(item.children)\">\n <a-row :gutter=\"5\" v-bind=\"item.rowOptions\">\n <a-col\n v-for=\"(child, childIndex) in item.children\"\n :key=\"childIndex\"\n :style=\"{\n display: 'flex',\n 'align-items': 'center'\n }\"\n v-bind=\"item?.colOptions ?? {}\"\n >\n <slot name=\"children\" :item=\"child\" :index=\"index\">\n <form-component\n :item=\"child\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </a-col>\n </a-row>\n </template>\n <form-component\n v-else\n :ref=\"el => (formComponents[index] = el)\"\n :item=\"item\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </ll-form-item>\n </slot>\n </a-col>\n </a-row>\n </a-form>\n </a-spin>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { reactive, ref, watch, onMounted, nextTick, computed } from 'vue'\nimport { omit, isEmpty, has } from 'lodash-es'\nimport { formProps, formEmits, type FormColumn } from './config'\n\nimport type { NamePath } from 'ant-design-vue/es/form/interface'\n\nimport { createNamespace } from '@ll-plus/utils'\n\nimport formComponent from './components/form-component.vue'\n\n// 定义组件名称\ndefineOptions({ name: 'LlForm' })\n\n// Props\nconst props = defineProps(formProps)\n\nconst emits = defineEmits(formEmits)\n\nconst bem = createNamespace('form')\n\nconst formData = reactive(props.formData)\n\nconst formRef = ref()\n\nconst formComponents = ref<InstanceType<typeof formComponent>[]>([])\n\nconst computedFormColumns = computed(() => {\n return props.formColumns.map(e => {\n e.disabled = has(e, 'disabled') ? e.disabled : props.disabled\n if (e.children && e.children.length) {\n e.children.map(a => {\n a.disabled = has(a, 'disabled') ? a.disabled : props.disabled\n return a\n })\n }\n return e\n })\n})\n\nconst validateFields = computed(() => {\n return props.formColumns\n .filter(e => e.required || (has(e, 'rules') && e.rules.length > 0))\n .map(e => {\n return e.key\n })\n})\n\nconst computedFormOptions = computed(() => {\n return {\n scrollToFirstError: !props.validateErrorStop,\n ...props.formOptions\n }\n})\n\nconst id = ref(`ll-form-${+new Date()}`)\n\nconst validate = async () => {\n if (props.validateErrorStop) {\n clearValidate()\n let bool = true\n if (!validateFields.value.length) return bool\n for (const i of validateFields.value) {\n bool = await formRef.value.validateFields([i])\n if (!bool) {\n return bool\n }\n }\n } else {\n return await formRef.value.validateFields()\n }\n}\n\nconst resetFields = async () => {\n return await formRef.value.resetFields()\n}\n\nconst clearValidate = async (nameList?: NamePath[]) => {\n return await formRef.value.clearValidate(nameList)\n}\n\nconst scrollToField = async (name: NamePath, options?: ScrollOptions) => {\n return await formRef.value.scrollToField(name, options)\n}\n\nconst getBindValue = (item: FormColumn) => {\n const obj = { ...item }\n return omit(obj, ['label'])\n}\n\nconst getFormItemClass = (item = {} as FormColumn) => {\n if (props.formOptions.layout === 'horizontal') {\n if (item?.labelCol) {\n return item.labelCol.span && item.labelCol.span >= 24\n ? bem.is('label-top')\n : bem.is('label-left')\n } else {\n return bem.is('label-left')\n }\n }\n return bem.is('label-top')\n}\n\nconst handleChangeField = (item: FormColumn) => {\n emits('change', { item, value: formData[item.key], formData })\n}\n\nwatch(\n () => props.formData,\n async val => {\n for (const i in val) {\n formData[i] = val[i]\n }\n },\n {\n deep: true,\n immediate: true\n }\n)\n\nonMounted(async () => {\n await nextTick()\n if (props.autoFocus) {\n for (const element of formComponents.value) {\n const item = element?.getItem()\n if (['input', 'textarea', 'input-number'].includes(item.type)) {\n element?.focus()\n break\n }\n }\n }\n})\n\ndefineExpose({\n validate,\n resetFields,\n clearValidate,\n scrollToField\n})\n</script>\n"],"names":["createNamespace","reactive","ref","computed","has","omit","watch","onMounted","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;AA4FA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAM,MAAA,GAAA,GAAMA,gCAAgB,MAAM,CAAA,CAAA;AAElC,IAAM,MAAA,QAAA,GAAWC,YAAS,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAExC,IAAA,MAAM,UAAUC,OAAI,EAAA,CAAA;AAEpB,IAAM,MAAA,cAAA,GAAiBA,OAA0C,CAAA,EAAE,CAAA,CAAA;AAEnE,IAAM,MAAA,mBAAA,GAAsBC,aAAS,MAAM;AACzC,MAAO,OAAA,KAAA,CAAM,WAAY,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA;AAChC,QAAA,CAAA,CAAE,WAAWC,YAAI,CAAA,CAAA,EAAG,UAAU,CAAI,GAAA,CAAA,CAAE,WAAW,KAAM,CAAA,QAAA,CAAA;AACrD,QAAA,IAAI,CAAE,CAAA,QAAA,IAAY,CAAE,CAAA,QAAA,CAAS,MAAQ,EAAA;AACnC,UAAE,CAAA,CAAA,QAAA,CAAS,IAAI,CAAK,CAAA,KAAA;AAClB,YAAA,CAAA,CAAE,WAAWA,YAAI,CAAA,CAAA,EAAG,UAAU,CAAI,GAAA,CAAA,CAAE,WAAW,KAAM,CAAA,QAAA,CAAA;AACrD,YAAO,OAAA,CAAA,CAAA;AAAA,WACR,CAAA,CAAA;AAAA,SACH;AACA,QAAO,OAAA,CAAA,CAAA;AAAA,OACR,CAAA,CA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sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <a-form\n v-bind=\"computedFormOptions\"\n :id=\"id\"\n ref=\"formRef\"\n :model=\"props.formData\"\n >\n <a-row v-bind=\"props.rowOptions\">\n <a-col\n v-for=\"(item, index) in computedFormColumns\"\n :key=\"index\"\n v-bind=\"item?.colOptions ?? {}\"\n :span=\"item?.spanCol ?? 24\"\n >\n <slot name=\"formItem\" :item=\"item\" :index=\"index\">\n <ll-form-item\n :name=\"item?.key ?? index\"\n :class=\"getFormItemClass(item)\"\n v-bind=\"getBindValue(item)\"\n >\n <template #label>\n <slot name=\"label\" :item=\"item\" :index=\"index\">\n <span>{{ item.label }}</span>\n <span v-if=\"item?.tip\" :class=\"bem.e('tooltip-wrapper')\">\n <ll-tooltip\n style=\"margin-left: 8px\"\n :overlay-class-name=\"bem.e('tooltip')\"\n :arrow-point-at-center=\"true\"\n :max-width=\"item?.tipConfig?.maxWidth ?? 406\"\n :placement=\"item?.tipConfig?.placement ?? 'top'\"\n :tip=\"item.tip\"\n :font-size=\"'16px'\"\n v-bind=\"item?.tipConfig\"\n />\n </span>\n </slot>\n </template>\n <slot name=\"content\" :item=\"item\" :index=\"index\">\n <template v-if=\"!isEmpty(item.children)\">\n <a-row :gutter=\"5\" v-bind=\"item.rowOptions\">\n <a-col\n v-for=\"(child, childIndex) in item.children\"\n :key=\"childIndex\"\n :style=\"{\n display: 'flex',\n 'align-items': 'center'\n }\"\n v-bind=\"item?.colOptions ?? {}\"\n >\n <slot name=\"children\" :item=\"child\" :index=\"index\">\n <form-component\n :item=\"child\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </a-col>\n </a-row>\n </template>\n <form-component\n v-else\n :ref=\"el => (formComponents[index] = el)\"\n :item=\"item\"\n :form-data=\"formData\"\n @change-field=\"handleChangeField\"\n />\n </slot>\n </ll-form-item>\n </slot>\n </a-col>\n </a-row>\n </a-form>\n </a-spin>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { reactive, ref, watch, onMounted, nextTick, computed } from 'vue'\nimport { omit, isEmpty, has } from 'lodash-es'\nimport { formProps, formEmits, type FormColumn } from './config'\n\nimport type { NamePath } from 'ant-design-vue/es/form/interface'\n\nimport { createNamespace, deepUnref } from '@ll-plus/utils'\n\nimport formComponent from './components/form-component.vue'\n\n// 定义组件名称\ndefineOptions({ name: 'LlForm' })\n\n// Props\nconst props = defineProps(formProps)\n\nconst emits = defineEmits(formEmits)\n\nconst bem = createNamespace('form')\n\nconst formData = reactive(props.formData)\n\nconst formRef = ref()\n\nconst formComponents = ref<InstanceType<typeof formComponent>[]>([])\n\nconst computedFormColumns = computed(() => {\n const formColumns = deepUnref(props.formColumns) as FormColumn[]\n return formColumns.map(e => {\n e.disabled = has(e, 'disabled') ? e.disabled : props.disabled\n if (e.children && e.children.length) {\n e.children.map(a => {\n a.disabled = has(a, 'disabled') ? a.disabled : props.disabled\n return a\n })\n }\n return e\n })\n})\n\nconst validateFields = computed(() => {\n return props.formColumns\n .filter(e => e.required || (has(e, 'rules') && e.rules.length > 0))\n .map(e => {\n return e.key\n })\n})\n\nconst computedFormOptions = computed(() => {\n return {\n scrollToFirstError: !props.validateErrorStop,\n ...props.formOptions\n }\n})\n\nconst id = ref(`ll-form-${+new Date()}`)\n\nconst validate = async () => {\n if (props.validateErrorStop) {\n clearValidate()\n let bool = true\n if (!validateFields.value.length) return bool\n for (const i of validateFields.value) {\n bool = await formRef.value.validateFields([i])\n if (!bool) {\n return bool\n }\n }\n } else {\n return await formRef.value.validateFields()\n }\n}\n\nconst resetFields = async () => {\n return await formRef.value.resetFields()\n}\n\nconst clearValidate = async (nameList?: NamePath[]) => {\n return await formRef.value.clearValidate(nameList)\n}\n\nconst scrollToField = async (name: NamePath, options?: ScrollOptions) => {\n return await formRef.value.scrollToField(name, options)\n}\n\nconst getBindValue = (item: FormColumn) => {\n const obj = { ...item }\n return omit(obj, ['label'])\n}\n\nconst getFormItemClass = (item = {} as FormColumn) => {\n if (props.formOptions.layout === 'horizontal') {\n if (item?.labelCol) {\n return item.labelCol.span && item.labelCol.span >= 24\n ? bem.is('label-top')\n : bem.is('label-left')\n } else {\n return bem.is('label-left')\n }\n }\n return bem.is('label-top')\n}\n\nconst handleChangeField = (item: FormColumn) => {\n emits('change', { item, value: formData[item.key], formData })\n}\n\nwatch(\n () => props.formData,\n async val => {\n for (const i in val) {\n formData[i] = val[i]\n }\n },\n {\n deep: true,\n immediate: true\n }\n)\n\nonMounted(async () => {\n await nextTick()\n if (props.autoFocus) {\n for (const element of formComponents.value) {\n const item = element?.getItem()\n if (['input', 'textarea', 'input-number'].includes(item.type)) {\n element?.focus()\n break\n }\n }\n }\n})\n\ndefineExpose({\n validate,\n resetFields,\n clearValidate,\n scrollToField\n})\n</script>\n"],"names":["createNamespace","reactive","ref","computed","deepUnref","has","omit","watch","onMounted","nextTick"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4FA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAM,MAAA,GAAA,GAAMA,gCAAgB,MAAM,CAAA,CAAA;AAElC,IAAM,MAAA,QAAA,GAAWC,YAAS,CAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAExC,IAAA,MAAM,UAAUC,OAAI,EAAA,CAAA;AAEpB,IAAM,MAAA,cAAA,GAAiBA,OAA0C,CAAA,EAAE,CAAA,CAAA;AAEnE,IAAM,MAAA,mBAAA,GAAsBC,aAAS,MAAM;AACzC,MAAM,MAAA,WAAA,GAAcC,mBAAU,CAAA,KAAA,CAAM,WAAW,CAAA,CAAA;AAC/C,MAAO,OAAA,WAAA,CAAY,IAAI,CAAK,CAAA,KAAA;AAC1B,QAAA,CAAA,CAAE,WAAWC,YAAI,CAAA,CAAA,EAAG,UAAU,CAAI,GAAA,CAAA,CAAE,WAAW,KAAM,CAAA,QAA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AED,IAAa,QAAA,CAAA;AAAA,MACX,QAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const deepUnref = (obj) => {
|
|
7
|
+
const currentObj = vue.unref(obj);
|
|
8
|
+
for (const i in obj) {
|
|
9
|
+
currentObj[i] = vue.unref(obj[i]);
|
|
10
|
+
if (typeof obj[i] === "object") {
|
|
11
|
+
currentObj[i] = deepUnref(obj[i]);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return currentObj;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.deepUnref = deepUnref;
|
|
18
|
+
//# sourceMappingURL=deepUnref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepUnref.js","sources":["../../../../packages/utils/deepUnref.ts"],"sourcesContent":["import { unref } from 'vue'\nexport const deepUnref = (\n obj: any[] | Record<string, any>\n): any[] | Record<string, any> => {\n const currentObj: any[] | Record<string, any> = unref(obj)\n for (const i in obj) {\n currentObj[i] = unref(obj[i])\n if (typeof obj[i] === 'object') {\n currentObj[i] = deepUnref(obj[i])\n }\n }\n return currentObj\n}\n"],"names":["unref"],"mappings":";;;;;AACa,MAAA,SAAA,GAAY,CACvB,GACgC,KAAA;AAChC,EAAM,MAAA,UAAA,GAA0CA,UAAM,GAAG,CAAA,CAAA;AACzD,EAAA,KAAA,MAAW,KAAK,GAAK,EAAA;AACnB,IAAA,UAAA,CAAW,CAAC,CAAA,GAAIA,SAAM,CAAA,GAAA,CAAI,CAAC,CAAC,CAAA,CAAA;AAC5B,IAAA,IAAI,OAAO,GAAA,CAAI,CAAC,CAAA,KAAM,QAAU,EAAA;AAC9B,MAAA,UAAA,CAAW,CAAC,CAAA,GAAI,SAAU,CAAA,GAAA,CAAI,CAAC,CAAC,CAAA,CAAA;AAAA,KAClC;AAAA,GACF;AACA,EAAO,OAAA,UAAA,CAAA;AACT;;;;"}
|
|
@@ -9,6 +9,7 @@ var number = require('./number.js');
|
|
|
9
9
|
var removeQueryString = require('./remove-query-string.js');
|
|
10
10
|
var types = require('./types.js');
|
|
11
11
|
var file = require('./file.js');
|
|
12
|
+
var deepUnref = require('./deepUnref.js');
|
|
12
13
|
var runtime = require('./props/runtime.js');
|
|
13
14
|
var shared = require('@vue/shared');
|
|
14
15
|
var vue = require('vue');
|
|
@@ -38,6 +39,7 @@ exports.isWindow = types.isWindow;
|
|
|
38
39
|
exports.dataURLtoBlob = file.dataURLtoBlob;
|
|
39
40
|
exports.fileToBase64 = file.fileToBase64;
|
|
40
41
|
exports.formatFileSize = file.formatFileSize;
|
|
42
|
+
exports.deepUnref = deepUnref.deepUnref;
|
|
41
43
|
exports.buildProp = runtime.buildProp;
|
|
42
44
|
exports.buildProps = runtime.buildProps;
|
|
43
45
|
exports.definePropType = runtime.definePropType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const deepUnref: (obj: any[] | Record<string, any>) => any[] | Record<string, any>;
|
package/lib/utils/index.d.ts
CHANGED