@veltra/desktop 1.3.9 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action/action-group.vue.d.ts +2 -2
- package/dist/components/action/action.vue.d.ts +1 -1
- package/dist/components/auto-complete/auto-complete.js +6 -1
- package/dist/components/auto-complete/auto-complete.js.map +1 -1
- package/dist/components/auto-complete/style2.css +6 -4
- package/dist/components/batch-edit/batch-edit.vue.d.ts +8 -8
- package/dist/components/cascade/cascade.vue.d.ts +2 -2
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
- package/dist/components/collapse/collapse-item.js +34 -11
- package/dist/components/collapse/collapse-item.js.map +1 -1
- package/dist/components/collapse/collapse-item.vue.d.ts +9 -1
- package/dist/components/collapse/style2.css +29 -51
- package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
- package/dist/components/input/input.vue.d.ts +2 -2
- package/dist/components/multi-select/multi-select.vue.d.ts +2 -2
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +2 -2
- package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/steps/steps.vue.d.ts +2 -2
- package/dist/components/steps/style2.css +14 -14
- package/dist/components/textarea/textarea.vue.d.ts +2 -2
- package/dist/components/tree-select/tree-select.vue.d.ts +2 -2
- package/dist/components/watermark/watermark.vue.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/types/collapse.d.ts +23 -4
- package/dist/types/index.d.ts +3 -3
- package/package.json +6 -6
- package/src/components/auto-complete/auto-complete.vue +8 -0
- package/src/components/auto-complete/style.scss +6 -4
- package/src/components/collapse/__test__/collapse.test.ts +178 -1
- package/src/components/collapse/collapse-item.vue +40 -12
- package/src/components/collapse/style.scss +26 -62
- package/src/components/steps/style.scss +2 -2
- package/src/types/collapse.ts +25 -3
|
@@ -6,11 +6,11 @@ type __VLS_Slots = {
|
|
|
6
6
|
default?: () => VNode[];
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<ActionGroupProps, _ActionGroupExposed, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionGroupProps> & Readonly<{}>, {
|
|
9
|
-
size: "small" | "default" | "large";
|
|
10
9
|
type: import("@veltra/utils").ColorType;
|
|
10
|
+
size: "small" | "default" | "large";
|
|
11
|
+
max: number;
|
|
11
12
|
text: boolean;
|
|
12
13
|
circle: boolean;
|
|
13
|
-
max: number;
|
|
14
14
|
loading: boolean;
|
|
15
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
16
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_base: import("vue").DefineComponent<ActionProps, {}, {}, {},
|
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<ActionProps> & Readonly<{
|
|
15
15
|
onRun?: (() => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
size: import("@veltra/utils").ComponentSize;
|
|
18
17
|
type: ButtonType;
|
|
18
|
+
size: import("@veltra/utils").ComponentSize;
|
|
19
19
|
text: boolean;
|
|
20
20
|
circle: boolean;
|
|
21
21
|
loading: boolean;
|
|
@@ -112,6 +112,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
112
112
|
}
|
|
113
113
|
handleKeydown(event);
|
|
114
114
|
};
|
|
115
|
+
/** 用户输入时展开建议面板(选中项不会触发原生 input 事件,因此不会误展开) */
|
|
116
|
+
const handleNativeInput = () => {
|
|
117
|
+
if (!dropdownVisible.value) dropdownVisible.value = true;
|
|
118
|
+
};
|
|
115
119
|
watch([point, keyboardOptions], ([currentPoint, options]) => {
|
|
116
120
|
if (!scrollRef.value || currentPoint < 0) return;
|
|
117
121
|
const currentOption = options[currentPoint];
|
|
@@ -160,7 +164,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
160
164
|
clearable: __props.clearable,
|
|
161
165
|
modelValue: model.value,
|
|
162
166
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
163
|
-
onKeydown: handleInputKeydown
|
|
167
|
+
onKeydown: handleInputKeydown,
|
|
168
|
+
"onNative:input": handleNativeInput
|
|
164
169
|
}, createSlots({ _: 2 }, [slots.suffix ? {
|
|
165
170
|
name: "suffix",
|
|
166
171
|
fn: withCtx(() => [renderSlot(_ctx.$slots, "suffix")]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-complete.js","names":["$attrs"],"sources":["../../../src/components/auto-complete/auto-complete.vue"],"sourcesContent":["<template>\n <u-dropdown\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n :class=\"[cls.b, cls.m(size), bem.is('disabled', disabled)]\"\n ref=\"dropdownRef\"\n v-model:visible=\"dropdownVisible\"\n :content-class=\"[cls.e('panel'), cls.em('panel', size)]\"\n :disabled=\"disabled\"\n >\n <!-- 触发 -->\n <template #trigger>\n <!-- 单选 -->\n <u-input\n :size=\"size\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n v-model=\"model\"\n @keydown=\"handleInputKeydown\"\n >\n <template #suffix v-if=\"slots.suffix\">\n <slot name=\"suffix\" />\n </template>\n\n <template #prefix v-if=\"slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n </u-input>\n </template>\n\n <!-- 下拉内容 -->\n <template #content>\n <u-scroll tag=\"ul\" :class=\"cls.e('options')\" ref=\"scrollRef\">\n <li\n v-if=\"displayCachedSuggestion\"\n :class=\"[optionClass, bem.is('active', isCachedActive)]\"\n @click=\"handleSelectCachedOption(displayCachedSuggestion)\"\n v-ripple=\"cls.e('ripple')\"\n :data-key=\"displayCachedSuggestion\"\n :key=\"displayCachedSuggestion\"\n >\n <slot v-bind=\"{ option: displayCachedSuggestion, index: -1 }\">\n {{ displayCachedSuggestion }}\n </slot>\n </li>\n\n <li\n v-for=\"(option, index) of suggestions\"\n :class=\"[\n optionClass,\n bem.is('selected', option === model),\n bem.is('active', isActiveOption(index))\n ]\"\n @click=\"handleSelect(option)\"\n v-ripple=\"cls.e('ripple')\"\n :data-key=\"option\"\n :key=\"option\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ option }}\n </slot>\n </li>\n </u-scroll>\n </template>\n </u-dropdown>\n\n <template v-else>\n {{ model || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { vRipple } from '@veltra/directives'\nimport { bem, FORM_EMPTY_CONTENT, scrollIntoContainerView } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, shallowRef, watch } from 'vue'\n\nimport type { AutoCompleteEmits, AutoCompleteProps, _AutoCompleteExposed } from '../../types'\nimport type { DropdownExposed, ScrollExposed } from '../../types'\nimport { UDropdown } from '../dropdown'\nimport { UInput } from '../input'\nimport { UScroll } from '../scroll'\nimport { useKeyboard } from './use-keyboard'\nimport { useSuggestions } from './use-suggestions'\n\ndefineOptions({ name: 'UAutoComplete', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<AutoCompleteProps>(), {\n placeholder: '请输入',\n clearable: true,\n allowCustom: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<AutoCompleteEmits>()\n\nconst slots = defineSlots<{\n default?: (props: { option: string; index: number }) => any\n suffix?: () => any\n prefix?: () => any\n}>()\n\n// 当前输入框的值\nconst model = defineModel<string>()\n\nconst cls = bem('auto-complete')\n\nconst optionClass = cls.e('option')\n\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst dropdownRef = shallowRef<DropdownExposed>()\nconst dropdownVisible = shallowRef(false)\nconst scrollRef = shallowRef<ScrollExposed>()\n\nwatch(scrollRef, (scroll) => {\n if (scroll && model.value !== undefined) {\n const li = scroll.contentRef!.querySelector(`li[data-key=\"${model.value}\"]`) as HTMLElement\n li && scrollIntoContainerView(li, scroll.containerRef ?? null)\n }\n})\n\nconst { suggestions, appendedSuggestions, cachedSuggestion } = useSuggestions({ props, model })\n\nconst displayCachedSuggestion = computed(() => {\n if (!props.allowCustom) return undefined\n return cachedSuggestion.value\n})\n\nconst keyboardOptions = computed(() => {\n const currentSuggestions = suggestions.value\n return displayCachedSuggestion.value\n ? [displayCachedSuggestion.value, ...currentSuggestions]\n : currentSuggestions\n})\n\nconst { point, handleKeydown } = useKeyboard({\n options: keyboardOptions,\n dropdownVisible,\n getDefaultIndex: (options) => {\n if (!options.length) return -1\n if (model.value) {\n const matchIndex = options.indexOf(model.value)\n if (matchIndex > -1) return matchIndex\n }\n return 0\n },\n onSelect: (option, index) => {\n if (displayCachedSuggestion.value && index === 0) {\n handleSelectCachedOption(option)\n return\n }\n handleSelect(option)\n }\n})\n\nconst isCachedActive = computed(() => !!displayCachedSuggestion.value && point.value === 0)\n\nconst isActiveOption = (index: number) => {\n const offset = displayCachedSuggestion.value ? 1 : 0\n return point.value === index + offset\n}\n\nconst handleInputKeydown = (event: KeyboardEvent) => {\n if (!dropdownVisible.value && event.key === 'Enter' && displayCachedSuggestion.value) {\n event.preventDefault()\n event.stopPropagation()\n handleSelectCachedOption(displayCachedSuggestion.value)\n return\n }\n handleKeydown(event)\n}\n\nwatch([point, keyboardOptions], ([currentPoint, options]) => {\n if (!scrollRef.value || currentPoint < 0) return\n const currentOption = options[currentPoint]\n if (!currentOption) return\n const target = scrollRef.value.contentRef?.querySelector(\n `li[data-key=\"${currentOption}\"]`\n ) as HTMLElement | null\n if (target) {\n scrollIntoContainerView(target, scrollRef.value.containerRef ?? null)\n }\n})\n\n/** 选中选项 */\nconst handleSelect = (option: string) => {\n model.value = option\n dropdownRef.value?.close()\n saveCache()\n emit('select', option)\n}\n\nfunction saveCache() {\n if (!model.value) return\n appendedSuggestions.value = [...appendedSuggestions.value, model.value]\n}\n\nconst handleSelectCachedOption = (cachedOption: string) => {\n appendedSuggestions.value = [...appendedSuggestions.value, cachedOption]\n dropdownRef.value?.close()\n}\n\ndefineExpose<_AutoCompleteExposed>({\n open: () => dropdownRef.value?.open(),\n close: () => dropdownRef.value?.close()\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FA,MAAM,QAAQ;EAQd,MAAM,OAAO;EAEb,MAAM,QAAQ,SAAA;EAOd,MAAM,QAAQ,SAAmB,SAAA,YAAC;EAElC,MAAM,MAAM,IAAI,eAAe;EAE/B,MAAM,cAAc,IAAI,EAAE,QAAQ;EAElC,MAAM,EAAE,cAAc,kBAAkB;EACxC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG;GAClF,MAAM;GACN,UAAU;GACV,UAAU;EACZ,CAAC;EAED,MAAM,cAAc,WAA4B;EAChD,MAAM,kBAAkB,WAAW,KAAK;EACxC,MAAM,YAAY,WAA0B;EAE5C,MAAM,YAAY,WAAW;GAC3B,IAAI,UAAU,MAAM,UAAU,KAAA,GAAW;IACvC,MAAM,KAAK,OAAO,WAAY,cAAc,gBAAgB,MAAM,MAAM,GAAG;IAC3E,MAAM,wBAAwB,IAAI,OAAO,gBAAgB,IAAI;GAC/D;EACF,CAAC;EAED,MAAM,EAAE,aAAa,qBAAqB,qBAAqB,eAAe;GAAE;GAAO;EAAM,CAAC;EAE9F,MAAM,0BAA0B,eAAe;GAC7C,IAAI,CAAC,MAAM,aAAa,OAAO,KAAA;GAC/B,OAAO,iBAAiB;EAC1B,CAAC;EAED,MAAM,kBAAkB,eAAe;GACr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AEW,UAAA,EAAA,KAAA,EAAA,GAAA,CAAA,gBAAA,gBADN,MAAA,SAAS,MAAA,kBAAA,CAAkB,GAAA,CAAA,CAAA,GAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"auto-complete.js","names":["$attrs"],"sources":["../../../src/components/auto-complete/auto-complete.vue"],"sourcesContent":["<template>\n <u-dropdown\n v-if=\"!readonly\"\n v-bind=\"$attrs\"\n trigger=\"click\"\n :class=\"[cls.b, cls.m(size), bem.is('disabled', disabled)]\"\n ref=\"dropdownRef\"\n v-model:visible=\"dropdownVisible\"\n :content-class=\"[cls.e('panel'), cls.em('panel', size)]\"\n :disabled=\"disabled\"\n >\n <!-- 触发 -->\n <template #trigger>\n <!-- 单选 -->\n <u-input\n :size=\"size\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n v-model=\"model\"\n @keydown=\"handleInputKeydown\"\n @native:input=\"handleNativeInput\"\n >\n <template #suffix v-if=\"slots.suffix\">\n <slot name=\"suffix\" />\n </template>\n\n <template #prefix v-if=\"slots.prefix\">\n <slot name=\"prefix\" />\n </template>\n </u-input>\n </template>\n\n <!-- 下拉内容 -->\n <template #content>\n <u-scroll tag=\"ul\" :class=\"cls.e('options')\" ref=\"scrollRef\">\n <li\n v-if=\"displayCachedSuggestion\"\n :class=\"[optionClass, bem.is('active', isCachedActive)]\"\n @click=\"handleSelectCachedOption(displayCachedSuggestion)\"\n v-ripple=\"cls.e('ripple')\"\n :data-key=\"displayCachedSuggestion\"\n :key=\"displayCachedSuggestion\"\n >\n <slot v-bind=\"{ option: displayCachedSuggestion, index: -1 }\">\n {{ displayCachedSuggestion }}\n </slot>\n </li>\n\n <li\n v-for=\"(option, index) of suggestions\"\n :class=\"[\n optionClass,\n bem.is('selected', option === model),\n bem.is('active', isActiveOption(index))\n ]\"\n @click=\"handleSelect(option)\"\n v-ripple=\"cls.e('ripple')\"\n :data-key=\"option\"\n :key=\"option\"\n >\n <slot v-bind=\"{ option, index }\">\n {{ option }}\n </slot>\n </li>\n </u-scroll>\n </template>\n </u-dropdown>\n\n <template v-else>\n {{ model || FORM_EMPTY_CONTENT }}\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useFormFallbackProps } from '@veltra/compositions'\nimport { vRipple } from '@veltra/directives'\nimport { bem, FORM_EMPTY_CONTENT, scrollIntoContainerView } from '@veltra/utils'\nimport { injectFormContext } from '@veltra/utils'\nimport { computed, shallowRef, watch } from 'vue'\n\nimport type { AutoCompleteEmits, AutoCompleteProps, _AutoCompleteExposed } from '../../types'\nimport type { DropdownExposed, ScrollExposed } from '../../types'\nimport { UDropdown } from '../dropdown'\nimport { UInput } from '../input'\nimport { UScroll } from '../scroll'\nimport { useKeyboard } from './use-keyboard'\nimport { useSuggestions } from './use-suggestions'\n\ndefineOptions({ name: 'UAutoComplete', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<AutoCompleteProps>(), {\n placeholder: '请输入',\n clearable: true,\n allowCustom: true,\n disabled: undefined,\n readonly: undefined\n})\n\nconst emit = defineEmits<AutoCompleteEmits>()\n\nconst slots = defineSlots<{\n default?: (props: { option: string; index: number }) => any\n suffix?: () => any\n prefix?: () => any\n}>()\n\n// 当前输入框的值\nconst model = defineModel<string>()\n\nconst cls = bem('auto-complete')\n\nconst optionClass = cls.e('option')\n\nconst { formProps } = injectFormContext()\nconst { size, disabled, readonly } = useFormFallbackProps([formProps ?? {}, props], {\n size: 'default',\n disabled: false,\n readonly: false\n})\n\nconst dropdownRef = shallowRef<DropdownExposed>()\nconst dropdownVisible = shallowRef(false)\nconst scrollRef = shallowRef<ScrollExposed>()\n\nwatch(scrollRef, (scroll) => {\n if (scroll && model.value !== undefined) {\n const li = scroll.contentRef!.querySelector(`li[data-key=\"${model.value}\"]`) as HTMLElement\n li && scrollIntoContainerView(li, scroll.containerRef ?? null)\n }\n})\n\nconst { suggestions, appendedSuggestions, cachedSuggestion } = useSuggestions({ props, model })\n\nconst displayCachedSuggestion = computed(() => {\n if (!props.allowCustom) return undefined\n return cachedSuggestion.value\n})\n\nconst keyboardOptions = computed(() => {\n const currentSuggestions = suggestions.value\n return displayCachedSuggestion.value\n ? [displayCachedSuggestion.value, ...currentSuggestions]\n : currentSuggestions\n})\n\nconst { point, handleKeydown } = useKeyboard({\n options: keyboardOptions,\n dropdownVisible,\n getDefaultIndex: (options) => {\n if (!options.length) return -1\n if (model.value) {\n const matchIndex = options.indexOf(model.value)\n if (matchIndex > -1) return matchIndex\n }\n return 0\n },\n onSelect: (option, index) => {\n if (displayCachedSuggestion.value && index === 0) {\n handleSelectCachedOption(option)\n return\n }\n handleSelect(option)\n }\n})\n\nconst isCachedActive = computed(() => !!displayCachedSuggestion.value && point.value === 0)\n\nconst isActiveOption = (index: number) => {\n const offset = displayCachedSuggestion.value ? 1 : 0\n return point.value === index + offset\n}\n\nconst handleInputKeydown = (event: KeyboardEvent) => {\n if (!dropdownVisible.value && event.key === 'Enter' && displayCachedSuggestion.value) {\n event.preventDefault()\n event.stopPropagation()\n handleSelectCachedOption(displayCachedSuggestion.value)\n return\n }\n handleKeydown(event)\n}\n\n/** 用户输入时展开建议面板(选中项不会触发原生 input 事件,因此不会误展开) */\nconst handleNativeInput = () => {\n if (!dropdownVisible.value) {\n dropdownVisible.value = true\n }\n}\n\nwatch([point, keyboardOptions], ([currentPoint, options]) => {\n if (!scrollRef.value || currentPoint < 0) return\n const currentOption = options[currentPoint]\n if (!currentOption) return\n const target = scrollRef.value.contentRef?.querySelector(\n `li[data-key=\"${currentOption}\"]`\n ) as HTMLElement | null\n if (target) {\n scrollIntoContainerView(target, scrollRef.value.containerRef ?? null)\n }\n})\n\n/** 选中选项 */\nconst handleSelect = (option: string) => {\n model.value = option\n dropdownRef.value?.close()\n saveCache()\n emit('select', option)\n}\n\nfunction saveCache() {\n if (!model.value) return\n appendedSuggestions.value = [...appendedSuggestions.value, model.value]\n}\n\nconst handleSelectCachedOption = (cachedOption: string) => {\n appendedSuggestions.value = [...appendedSuggestions.value, cachedOption]\n dropdownRef.value?.close()\n}\n\ndefineExpose<_AutoCompleteExposed>({\n open: () => dropdownRef.value?.open(),\n close: () => dropdownRef.value?.close()\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2FA,MAAM,QAAQ;EAQd,MAAM,OAAO;EAEb,MAAM,QAAQ,SAAA;EAOd,MAAM,QAAQ,SAAmB,SAAA,YAAC;EAElC,MAAM,MAAM,IAAI,eAAe;EAE/B,MAAM,cAAc,IAAI,EAAE,QAAQ;EAElC,MAAM,EAAE,cAAc,kBAAkB;EACxC,MAAM,EAAE,MAAM,UAAU,aAAa,qBAAqB,CAAC,aAAa,CAAC,GAAG,KAAK,GAAG;GAClF,MAAM;GACN,UAAU;GACV,UAAU;EACZ,CAAC;EAED,MAAM,cAAc,WAA4B;EAChD,MAAM,kBAAkB,WAAW,KAAK;EACxC,MAAM,YAAY,WAA0B;EAE5C,MAAM,YAAY,WAAW;GAC3B,IAAI,UAAU,MAAM,UAAU,KAAA,GAAW;IACvC,MAAM,KAAK,OAAO,WAAY,cAAc,gBAAgB,MAAM,MAAM,GAAG;IAC3E,MAAM,wBAAwB,IAAI,OAAO,gBAAgB,IAAI;GAC/D;EACF,CAAC;EAED,MAAM,EAAE,aAAa,qBAAqB,qBAAqB,eAAe;GAAE;GAAO;EAAM,CAAC;EAE9F,MAAM,0BAA0B,eAAe;GAC7C,IAAI,CAAC,MAAM,aAAa,OAAO,KAAA;GAC/B,OAAO,iBAAiB;EAC1B,CAAC;EAED,MAAM,kBAAkB,eAAe;GACrC,MAAM,qBAAqB,YAAY;GACvC,OAAO,wBAAwB,QAC3B,CAAC,wBAAwB,OAAO,GAAG,kBAAkB,IACrD;EACN,CAAC;EAED,MAAM,EAAE,OAAO,kBAAkB,YAAY;GAC3C,SAAS;GACT;GACA,kBAAkB,YAAY;IAC5B,IAAI,CAAC,QAAQ,QAAQ,OAAO;IAC5B,IAAI,MAAM,O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|
|
41
41
|
white-space: nowrap;
|
|
42
42
|
}
|
|
43
43
|
.u-auto-complete__option:hover {
|
|
44
|
-
background-color: var(--u-
|
|
44
|
+
background-color: var(--u-nav-hover-bg);
|
|
45
|
+
color: var(--u-nav-hover-color);
|
|
45
46
|
}
|
|
46
47
|
.u-auto-complete__option.is-active {
|
|
47
|
-
background-color: var(--u-
|
|
48
|
+
background-color: var(--u-nav-hover-bg);
|
|
49
|
+
color: var(--u-nav-hover-color);
|
|
48
50
|
}
|
|
49
51
|
.u-auto-complete__option.is-selected {
|
|
50
|
-
background-color: var(--u-
|
|
51
|
-
color: var(--u-
|
|
52
|
+
background-color: var(--u-nav-active-bg);
|
|
53
|
+
color: var(--u-nav-active-color);
|
|
52
54
|
}
|
|
53
55
|
.u-auto-complete__ripple {
|
|
54
56
|
background-color: var(--u-color-primary-light-7);
|
|
@@ -8,28 +8,28 @@ declare const __VLS_base: import("vue").DefineComponent<BatchEditProps, {}, {},
|
|
|
8
8
|
"update:selected": (value: Record<string, any> | undefined) => any;
|
|
9
9
|
"update:checked": (value: Record<string, any>[]) => any;
|
|
10
10
|
"update:current": (row?: TableRow | undefined) => any;
|
|
11
|
-
"update:rows": (rows: TableRow[]) => any;
|
|
12
|
-
"update:forest": (rows?: import("@cat-kit/core").Forest<Record<string, unknown>, any> | undefined) => any;
|
|
13
|
-
"cell-click": (row: TableRow, column: TableColumn, ev: MouseEvent) => any;
|
|
14
|
-
"row-click": (row: TableRow, ev: MouseEvent) => any;
|
|
15
11
|
create: () => any;
|
|
16
12
|
"update:data": (value: Record<string, any>[]) => any;
|
|
17
13
|
"create-prev": (row: TableRow) => any;
|
|
18
14
|
"create-next": (row: TableRow) => any;
|
|
19
15
|
"create-child": (row: TableRow) => any;
|
|
16
|
+
"update:rows": (rows: TableRow[]) => any;
|
|
17
|
+
"update:forest": (rows?: import("@cat-kit/core").Forest<Record<string, unknown>, any> | undefined) => any;
|
|
18
|
+
"cell-click": (row: TableRow, column: TableColumn, ev: MouseEvent) => any;
|
|
19
|
+
"row-click": (row: TableRow, ev: MouseEvent) => any;
|
|
20
20
|
}, string, import("vue").PublicProps, Readonly<BatchEditProps> & Readonly<{
|
|
21
21
|
"onUpdate:selected"?: ((value: Record<string, any> | undefined) => any) | undefined;
|
|
22
22
|
"onUpdate:checked"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
23
23
|
"onUpdate:current"?: ((row?: TableRow | undefined) => any) | undefined;
|
|
24
|
-
"onUpdate:rows"?: ((rows: TableRow[]) => any) | undefined;
|
|
25
|
-
"onUpdate:forest"?: ((rows?: import("@cat-kit/core").Forest<Record<string, unknown>, any> | undefined) => any) | undefined;
|
|
26
|
-
"onCell-click"?: ((row: TableRow, column: TableColumn, ev: MouseEvent) => any) | undefined;
|
|
27
|
-
"onRow-click"?: ((row: TableRow, ev: MouseEvent) => any) | undefined;
|
|
28
24
|
onCreate?: (() => any) | undefined;
|
|
29
25
|
"onUpdate:data"?: ((value: Record<string, any>[]) => any) | undefined;
|
|
30
26
|
"onCreate-prev"?: ((row: TableRow) => any) | undefined;
|
|
31
27
|
"onCreate-next"?: ((row: TableRow) => any) | undefined;
|
|
32
28
|
"onCreate-child"?: ((row: TableRow) => any) | undefined;
|
|
29
|
+
"onUpdate:rows"?: ((rows: TableRow[]) => any) | undefined;
|
|
30
|
+
"onUpdate:forest"?: ((rows?: import("@cat-kit/core").Forest<Record<string, unknown>, any> | undefined) => any) | undefined;
|
|
31
|
+
"onCell-click"?: ((row: TableRow, column: TableColumn, ev: MouseEvent) => any) | undefined;
|
|
32
|
+
"onRow-click"?: ((row: TableRow, ev: MouseEvent) => any) | undefined;
|
|
33
33
|
}>, {
|
|
34
34
|
cols: string | [string, string];
|
|
35
35
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -12,12 +12,12 @@ declare const __VLS_export: import("vue").DefineComponent<CascadeProps, {}, {},
|
|
|
12
12
|
onClear?: (() => any) | undefined;
|
|
13
13
|
"onUpdate:label"?: ((label?: string | string[] | undefined) => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
readonly: boolean;
|
|
17
15
|
labelKey: string;
|
|
18
16
|
valueKey: string;
|
|
19
17
|
childrenKey: string;
|
|
20
18
|
data: Record<string, any>[];
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
readonly: boolean;
|
|
21
21
|
placeholder: string;
|
|
22
22
|
clearable: boolean;
|
|
23
23
|
filterable: boolean;
|
|
@@ -18,9 +18,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
18
18
|
"onUpdate:modelValue"?: ((checked: boolean) => any) | undefined;
|
|
19
19
|
onChange?: ((checked: boolean) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
|
+
type: import("@veltra/utils").ColorType;
|
|
21
22
|
disabled: boolean;
|
|
22
23
|
readonly: boolean;
|
|
23
|
-
type: import("@veltra/utils").ColorType;
|
|
24
24
|
round: boolean;
|
|
25
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -13,10 +13,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
13
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
14
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
|
-
disabled: boolean;
|
|
17
|
-
readonly: boolean;
|
|
18
16
|
labelKey: string;
|
|
19
17
|
valueKey: string;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
readonly: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
22
22
|
//#endregion
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _sfc_main$1 from "../icon/icon.js";
|
|
2
2
|
import { CollapseDIKey } from "./di.js";
|
|
3
3
|
import { computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, watch, withCtx, withKeys, withModifiers } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useModel as useModel$1 } from "@veltra/compositions";
|
|
5
|
+
import { ExpandTransition, bem } from "@veltra/utils";
|
|
6
|
+
import { ArrowDown } from "@veltra/icons/normal";
|
|
6
7
|
//#region src/components/collapse/collapse-item.vue
|
|
7
8
|
const _hoisted_1 = [
|
|
8
9
|
"aria-expanded",
|
|
@@ -16,15 +17,30 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
16
17
|
__name: "collapse-item",
|
|
17
18
|
props: {
|
|
18
19
|
value: {},
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
19
24
|
title: {},
|
|
20
|
-
disabled: { type: Boolean }
|
|
25
|
+
disabled: { type: Boolean },
|
|
26
|
+
expandIcon: {}
|
|
21
27
|
},
|
|
22
|
-
|
|
28
|
+
emits: ["update:modelValue", "change"],
|
|
29
|
+
setup(__props, { emit: __emit }) {
|
|
23
30
|
const props = __props;
|
|
24
|
-
const
|
|
31
|
+
const emit = __emit;
|
|
32
|
+
const context = inject(CollapseDIKey, void 0);
|
|
25
33
|
const cls = context?.cls ?? bem("collapse");
|
|
26
|
-
const
|
|
27
|
-
|
|
34
|
+
const standaloneModel = useModel$1({
|
|
35
|
+
props,
|
|
36
|
+
emit,
|
|
37
|
+
defaultValue: false
|
|
38
|
+
});
|
|
39
|
+
const isActive = computed(() => {
|
|
40
|
+
if (context) return props.value !== void 0 && context.activeValues.value.includes(props.value);
|
|
41
|
+
return !!standaloneModel.value;
|
|
42
|
+
});
|
|
43
|
+
const iconComponent = computed(() => context?.expandIcon.value ?? props.expandIcon ?? ArrowDown);
|
|
28
44
|
const classList = computed(() => [
|
|
29
45
|
cls.e("item"),
|
|
30
46
|
bem.is("active", isActive.value),
|
|
@@ -35,14 +51,21 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
35
51
|
bem.is("disabled", props.disabled),
|
|
36
52
|
bem.is("active", isActive.value)
|
|
37
53
|
]);
|
|
54
|
+
const expandTransition = context?.expandTransition ?? new ExpandTransition({ transition: "height 0.24s cubic-bezier(0.4, 0, 0.2, 1)" });
|
|
38
55
|
const handleClick = () => {
|
|
39
56
|
if (props.disabled) return;
|
|
40
|
-
context
|
|
57
|
+
if (context) {
|
|
58
|
+
if (props.value === void 0) return;
|
|
59
|
+
context.toggle(props.value);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const next = !standaloneModel.value;
|
|
63
|
+
standaloneModel.value = next;
|
|
64
|
+
emit("change", next);
|
|
41
65
|
};
|
|
42
66
|
const wrapperEl = ref();
|
|
43
|
-
const { expandTransition } = context;
|
|
44
67
|
onMounted(() => {
|
|
45
|
-
context
|
|
68
|
+
if (context && props.value !== void 0) context.register(props.value);
|
|
46
69
|
if (!wrapperEl.value) return;
|
|
47
70
|
expandTransition.setExpanded(wrapperEl.value, isActive.value);
|
|
48
71
|
});
|
|
@@ -51,7 +74,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
51
74
|
active ? expandTransition.expand(wrapperEl.value) : expandTransition.collapse(wrapperEl.value);
|
|
52
75
|
});
|
|
53
76
|
onBeforeUnmount(() => {
|
|
54
|
-
context
|
|
77
|
+
if (context && props.value !== void 0) context.unregister(props.value);
|
|
55
78
|
if (!wrapperEl.value) return;
|
|
56
79
|
expandTransition.cancel(wrapperEl.value);
|
|
57
80
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse-item.js","names":[],"sources":["../../../src/components/collapse/collapse-item.vue"],"sourcesContent":["<template>\n <div :class=\"classList\">\n <div\n :class=\"headerClassList\"\n role=\"button\"\n :aria-expanded=\"isActive\"\n :aria-disabled=\"disabled\"\n :tabindex=\"disabled ? -1 : 0\"\n @click=\"handleClick\"\n @keydown.enter.prevent=\"handleClick\"\n @keydown.space.prevent=\"handleClick\"\n >\n <span :class=\"cls.e('title')\">\n <slot name=\"title\">{{ title }}</slot>\n </span>\n\n <span :class=\"cls.e('icon')\">\n <slot name=\"icon\" :is-active=\"isActive\">\n <UIcon><component :is=\"iconComponent\" /></UIcon>\n </slot>\n </span>\n </div>\n <div ref=\"wrapperEl\" :class=\"cls.e('content-wrapper')\" :aria-hidden=\"!isActive\">\n <div :class=\"cls.e('content')\">\n <slot />\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {
|
|
1
|
+
{"version":3,"file":"collapse-item.js","names":[],"sources":["../../../src/components/collapse/collapse-item.vue"],"sourcesContent":["<template>\n <div :class=\"classList\">\n <div\n :class=\"headerClassList\"\n role=\"button\"\n :aria-expanded=\"isActive\"\n :aria-disabled=\"disabled\"\n :tabindex=\"disabled ? -1 : 0\"\n @click=\"handleClick\"\n @keydown.enter.prevent=\"handleClick\"\n @keydown.space.prevent=\"handleClick\"\n >\n <span :class=\"cls.e('title')\">\n <slot name=\"title\">{{ title }}</slot>\n </span>\n\n <span :class=\"cls.e('icon')\">\n <slot name=\"icon\" :is-active=\"isActive\">\n <UIcon><component :is=\"iconComponent\" /></UIcon>\n </slot>\n </span>\n </div>\n <div ref=\"wrapperEl\" :class=\"cls.e('content-wrapper')\" :aria-hidden=\"!isActive\">\n <div :class=\"cls.e('content')\">\n <slot />\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useModel } from '@veltra/compositions'\nimport { ArrowDown } from '@veltra/icons/normal'\nimport { bem, ExpandTransition } from '@veltra/utils'\nimport { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue'\n\nimport type { CollapseItemEmits, CollapseItemProps } from '../../types'\nimport { UIcon } from '../icon'\nimport { CollapseDIKey } from './di'\n\ndefineOptions({ name: 'UCollapseItem' })\n\nconst props = withDefaults(defineProps<CollapseItemProps>(), { modelValue: false })\nconst emit = defineEmits<CollapseItemEmits>()\n\nconst context = inject(CollapseDIKey, undefined)\n\nconst cls = context?.cls ?? bem('collapse')\n\nconst standaloneModel = useModel<CollapseItemProps, 'modelValue'>({\n props,\n emit,\n defaultValue: false\n})\n\nconst isActive = computed(() => {\n if (context) {\n return props.value !== undefined && context.activeValues.value.includes(props.value)\n }\n return !!standaloneModel.value\n})\n\nconst iconComponent = computed(() => context?.expandIcon.value ?? props.expandIcon ?? ArrowDown)\n\nconst classList = computed(() => [\n cls.e('item'),\n bem.is('active', isActive.value),\n bem.is('disabled', props.disabled)\n])\n\nconst headerClassList = computed(() => [\n cls.e('header'),\n bem.is('disabled', props.disabled),\n bem.is('active', isActive.value)\n])\n\nconst expandTransition =\n context?.expandTransition ??\n new ExpandTransition({ transition: 'height 0.24s cubic-bezier(0.4, 0, 0.2, 1)' })\n\nconst handleClick = () => {\n if (props.disabled) return\n\n if (context) {\n if (props.value === undefined) return\n context.toggle(props.value)\n return\n }\n\n const next = !standaloneModel.value\n standaloneModel.value = next\n emit('change', next)\n}\n\nconst wrapperEl = ref<HTMLElement>()\n\nonMounted(() => {\n if (context && props.value !== undefined) {\n context.register(props.value)\n }\n if (!wrapperEl.value) return\n expandTransition.setExpanded(wrapperEl.value, isActive.value)\n})\n\nwatch(isActive, (active) => {\n if (!wrapperEl.value) return\n active ? expandTransition.expand(wrapperEl.value) : expandTransition.collapse(wrapperEl.value)\n})\n\nonBeforeUnmount(() => {\n if (context && props.value !== undefined) {\n context.unregister(props.value)\n }\n if (!wrapperEl.value) return\n expandTransition.cancel(wrapperEl.value)\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,UAAU,OAAO,eAAe,KAAA,CAAS;EA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SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,UAAA,CAAA,GAAA,CAAA"}
|
|
@@ -11,7 +11,15 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
} & {
|
|
12
12
|
default?: (props: typeof __VLS_16) => any;
|
|
13
13
|
};
|
|
14
|
-
declare const __VLS_base: import("vue").DefineComponent<CollapseItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<CollapseItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
|
+
"update:modelValue": (value: boolean) => any;
|
|
16
|
+
change: (value: boolean) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<CollapseItemProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
19
|
+
onChange?: ((value: boolean) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
modelValue: boolean;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
24
|
declare const _default: typeof __VLS_export;
|
|
17
25
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -22,37 +22,14 @@
|
|
|
22
22
|
background-color: transparent;
|
|
23
23
|
}
|
|
24
24
|
.u-collapse__item {
|
|
25
|
-
|
|
26
|
-
border-radius:
|
|
25
|
+
border: var(--u-border-muted);
|
|
26
|
+
border-radius: var(--u-radius-default);
|
|
27
|
+
background-color: var(--u-bg-color-middle);
|
|
27
28
|
overflow: hidden;
|
|
28
|
-
background-color: var(--u-collapse-item-bg);
|
|
29
|
-
transition: background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
|
|
30
|
-
}
|
|
31
|
-
.u-collapse__item::before {
|
|
32
|
-
content: "";
|
|
33
|
-
position: absolute;
|
|
34
|
-
top: 0;
|
|
35
|
-
bottom: 0;
|
|
36
|
-
left: 0;
|
|
37
|
-
width: 3px;
|
|
38
|
-
background-color: var(--u-color-primary);
|
|
39
|
-
opacity: 0;
|
|
40
|
-
pointer-events: none;
|
|
41
|
-
transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1);
|
|
42
|
-
z-index: 1;
|
|
43
29
|
}
|
|
44
30
|
.u-collapse__item + .u-collapse__item {
|
|
45
31
|
margin-top: var(--u-gap-default);
|
|
46
32
|
}
|
|
47
|
-
.u-collapse__item:not(.is-disabled):hover {
|
|
48
|
-
background-color: var(--u-collapse-item-hover-bg);
|
|
49
|
-
}
|
|
50
|
-
.u-collapse__item.is-active {
|
|
51
|
-
background-color: var(--u-collapse-item-active-bg);
|
|
52
|
-
}
|
|
53
|
-
.u-collapse__item.is-active::before {
|
|
54
|
-
opacity: 1;
|
|
55
|
-
}
|
|
56
33
|
.u-collapse__item.is-disabled {
|
|
57
34
|
opacity: 0.55;
|
|
58
35
|
}
|
|
@@ -60,35 +37,37 @@
|
|
|
60
37
|
position: relative;
|
|
61
38
|
display: flex;
|
|
62
39
|
align-items: center;
|
|
63
|
-
gap:
|
|
40
|
+
gap: var(--u-gap-small);
|
|
41
|
+
padding: var(--u-gap-small) var(--u-gap-default);
|
|
64
42
|
cursor: pointer;
|
|
65
43
|
font-weight: 500;
|
|
66
44
|
letter-spacing: 0.01em;
|
|
67
|
-
color: var(--u-
|
|
45
|
+
color: var(--u-text-color-main);
|
|
68
46
|
user-select: none;
|
|
69
47
|
outline: none;
|
|
70
|
-
transition:
|
|
71
|
-
border-radius:
|
|
48
|
+
transition: background-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
|
|
49
|
+
border-radius: 0;
|
|
72
50
|
}
|
|
73
51
|
.u-collapse__header:focus-visible {
|
|
74
52
|
box-shadow: inset 0 0 0 2px var(--u-color-primary);
|
|
75
53
|
}
|
|
54
|
+
.u-collapse__header:not(.is-disabled):hover {
|
|
55
|
+
background-color: var(--u-bg-color-hover);
|
|
56
|
+
}
|
|
76
57
|
.u-collapse__header.is-disabled {
|
|
77
58
|
cursor: not-allowed;
|
|
78
59
|
color: var(--u-text-color-placeholder);
|
|
79
60
|
}
|
|
80
61
|
.u-collapse__header.is-active {
|
|
81
|
-
|
|
82
|
-
color: var(--u-collapse-active-title-color, var(--u-color-primary));
|
|
83
|
-
background-color: var(--u-collapse-header-active-bg);
|
|
84
|
-
border-bottom-right-radius: 0;
|
|
85
|
-
border-bottom-left-radius: 0;
|
|
62
|
+
background-color: var(--u-bg-color-hover);
|
|
86
63
|
}
|
|
87
64
|
.u-collapse__header.is-active .u-collapse__icon {
|
|
88
|
-
transform: rotate(
|
|
89
|
-
color: var(--u-collapse-active-title-color, var(--u-color-primary));
|
|
65
|
+
transform: rotate(180deg);
|
|
90
66
|
}
|
|
91
67
|
.u-collapse__title {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--u-gap-small);
|
|
92
71
|
flex: 1 1 auto;
|
|
93
72
|
min-width: 0;
|
|
94
73
|
line-height: 1.5;
|
|
@@ -98,35 +77,34 @@
|
|
|
98
77
|
align-items: center;
|
|
99
78
|
justify-content: center;
|
|
100
79
|
flex: 0 0 auto;
|
|
101
|
-
color: var(--u-text-color-
|
|
102
|
-
transition: transform 0.
|
|
80
|
+
color: var(--u-text-color-assist);
|
|
81
|
+
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
103
82
|
will-change: transform;
|
|
104
83
|
}
|
|
105
84
|
.u-collapse__content-wrapper {
|
|
106
85
|
overflow: hidden;
|
|
107
86
|
height: 0;
|
|
108
|
-
|
|
109
|
-
border-bottom-left-radius: inherit;
|
|
110
|
-
background-color: var(--u-collapse-content-bg);
|
|
87
|
+
background-color: transparent;
|
|
111
88
|
transition: height 0.24s cubic-bezier(0.4, 0, 0.2, 1);
|
|
112
89
|
}
|
|
113
90
|
.u-collapse__content {
|
|
114
91
|
color: var(--u-text-color-main);
|
|
115
92
|
line-height: 1.7;
|
|
93
|
+
padding: var(--u-gap-small) var(--u-gap-default);
|
|
116
94
|
}
|
|
117
95
|
.u-collapse--small {
|
|
118
96
|
font-size: var(--u-font-size-main-small);
|
|
119
97
|
}
|
|
120
98
|
.u-collapse--small .u-collapse__header {
|
|
121
|
-
padding:
|
|
99
|
+
padding: var(--u-gap-small) var(--u-gap-small);
|
|
122
100
|
font-size: var(--u-font-size-main-small);
|
|
123
101
|
}
|
|
124
102
|
.u-collapse--small .u-collapse__content {
|
|
125
103
|
font-size: var(--u-font-size-main-small);
|
|
126
|
-
padding:
|
|
104
|
+
padding: var(--u-gap-small);
|
|
127
105
|
}
|
|
128
106
|
.u-collapse--small .u-collapse__item {
|
|
129
|
-
border-radius:
|
|
107
|
+
border-radius: var(--u-radius-small);
|
|
130
108
|
}
|
|
131
109
|
.u-collapse--small .u-collapse__item + .u-collapse__item {
|
|
132
110
|
margin-top: var(--u-gap-small);
|
|
@@ -135,15 +113,15 @@
|
|
|
135
113
|
font-size: var(--u-font-size-main-default);
|
|
136
114
|
}
|
|
137
115
|
.u-collapse--default .u-collapse__header {
|
|
138
|
-
padding:
|
|
116
|
+
padding: var(--u-gap-default) var(--u-gap-default);
|
|
139
117
|
font-size: var(--u-font-size-main-default);
|
|
140
118
|
}
|
|
141
119
|
.u-collapse--default .u-collapse__content {
|
|
142
120
|
font-size: var(--u-font-size-main-default);
|
|
143
|
-
padding:
|
|
121
|
+
padding: var(--u-gap-default);
|
|
144
122
|
}
|
|
145
123
|
.u-collapse--default .u-collapse__item {
|
|
146
|
-
border-radius:
|
|
124
|
+
border-radius: var(--u-radius-default);
|
|
147
125
|
}
|
|
148
126
|
.u-collapse--default .u-collapse__item + .u-collapse__item {
|
|
149
127
|
margin-top: var(--u-gap-default);
|
|
@@ -152,15 +130,15 @@
|
|
|
152
130
|
font-size: var(--u-font-size-main-large);
|
|
153
131
|
}
|
|
154
132
|
.u-collapse--large .u-collapse__header {
|
|
155
|
-
padding:
|
|
133
|
+
padding: var(--u-gap-large) var(--u-gap-large);
|
|
156
134
|
font-size: var(--u-font-size-main-large);
|
|
157
135
|
}
|
|
158
136
|
.u-collapse--large .u-collapse__content {
|
|
159
137
|
font-size: var(--u-font-size-main-large);
|
|
160
|
-
padding:
|
|
138
|
+
padding: var(--u-gap-large);
|
|
161
139
|
}
|
|
162
140
|
.u-collapse--large .u-collapse__item {
|
|
163
|
-
border-radius:
|
|
141
|
+
border-radius: var(--u-radius-large);
|
|
164
142
|
}
|
|
165
143
|
.u-collapse--large .u-collapse__item + .u-collapse__item {
|
|
166
144
|
margin-top: var(--u-gap-large);
|
|
@@ -8,8 +8,8 @@ declare const __VLS_export: import("vue").DefineComponent<DatePanelProps, {}, {}
|
|
|
8
8
|
"onSelect:range-date"?: ((rangeDate?: [import("@cat-kit/core").Dater, import("@cat-kit/core").Dater] | undefined) => any) | undefined;
|
|
9
9
|
"onSelect:date"?: ((date: import("@cat-kit/core").Dater) => any) | undefined;
|
|
10
10
|
}>, {
|
|
11
|
-
size: import("@veltra/utils").ComponentSize;
|
|
12
11
|
type: "date" | "month" | "year";
|
|
12
|
+
size: import("@veltra/utils").ComponentSize;
|
|
13
13
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
14
|
declare const _default: typeof __VLS_export;
|
|
15
15
|
//#endregion
|
|
@@ -6,9 +6,9 @@ declare const __VLS_export: import("vue").DefineComponent<DatePickerProps, {}, {
|
|
|
6
6
|
}, string, import("vue").PublicProps, Readonly<DatePickerProps> & Readonly<{
|
|
7
7
|
"onUpdate:modelValue"?: ((value?: string | number | Date | undefined) => any) | undefined;
|
|
8
8
|
}>, {
|
|
9
|
+
type: "date" | "month" | "year";
|
|
9
10
|
disabled: boolean;
|
|
10
11
|
readonly: boolean;
|
|
11
|
-
type: "date" | "month" | "year";
|
|
12
12
|
placeholder: string;
|
|
13
13
|
clearable: boolean;
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -6,9 +6,9 @@ declare const __VLS_export: import("vue").DefineComponent<DateRangePickerProps,
|
|
|
6
6
|
}, string, import("vue").PublicProps, Readonly<DateRangePickerProps> & Readonly<{
|
|
7
7
|
"onUpdate:modelValue"?: ((value?: [string, string] | undefined) => any) | undefined;
|
|
8
8
|
}>, {
|
|
9
|
+
type: "date" | "month" | "year";
|
|
9
10
|
disabled: boolean;
|
|
10
11
|
readonly: boolean;
|
|
11
|
-
type: "date" | "month" | "year";
|
|
12
12
|
placeholder: [string, string];
|
|
13
13
|
clearable: boolean;
|
|
14
14
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -17,19 +17,19 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, _Inpu
|
|
|
17
17
|
} & {
|
|
18
18
|
"update:modelValue": (value: string) => any;
|
|
19
19
|
change: (value: string) => any;
|
|
20
|
-
clear: () => any;
|
|
21
20
|
"suffix:click": (value?: string | undefined) => any;
|
|
22
21
|
"prefix:click": (value?: string | undefined) => any;
|
|
23
22
|
focus: (value?: string | undefined) => any;
|
|
23
|
+
clear: () => any;
|
|
24
24
|
blur: (value?: string | undefined) => any;
|
|
25
25
|
"native:input": (ev: Event) => any;
|
|
26
26
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
27
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
28
28
|
onChange?: ((value: string) => any) | undefined;
|
|
29
|
-
onClear?: (() => any) | undefined;
|
|
30
29
|
"onSuffix:click"?: ((value?: string | undefined) => any) | undefined;
|
|
31
30
|
"onPrefix:click"?: ((value?: string | undefined) => any) | undefined;
|
|
32
31
|
onFocus?: ((value?: string | undefined) => any) | undefined;
|
|
32
|
+
onClear?: (() => any) | undefined;
|
|
33
33
|
onBlur?: ((value?: string | undefined) => any) | undefined;
|
|
34
34
|
"onNative:input"?: ((ev: Event) => any) | undefined;
|
|
35
35
|
}>, {
|
|
@@ -27,10 +27,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
27
27
|
"onUpdate:modelValue"?: ((value: any[]) => any) | undefined;
|
|
28
28
|
onChange?: ((options: Record<string, any>[]) => any) | undefined;
|
|
29
29
|
}>, {
|
|
30
|
-
disabled: boolean;
|
|
31
|
-
readonly: boolean;
|
|
32
30
|
labelKey: string;
|
|
33
31
|
valueKey: string;
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
readonly: boolean;
|
|
34
34
|
placeholder: string;
|
|
35
35
|
clearable: boolean;
|
|
36
36
|
minWidth: string;
|
|
@@ -21,11 +21,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
21
21
|
onChange?: ((checked: Record<string, any>[]) => any) | undefined;
|
|
22
22
|
onClear?: (() => any) | undefined;
|
|
23
23
|
}>, {
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
readonly: boolean;
|
|
26
24
|
expandAll: boolean;
|
|
27
25
|
labelKey: string;
|
|
28
26
|
valueKey: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
readonly: boolean;
|
|
29
29
|
placeholder: string;
|
|
30
30
|
clearable: boolean;
|
|
31
31
|
filterable: boolean;
|
|
@@ -15,10 +15,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
15
15
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
16
16
|
onChange?: ((item: Record<string, any>) => any) | undefined;
|
|
17
17
|
}>, {
|
|
18
|
-
disabled: boolean;
|
|
19
|
-
readonly: boolean;
|
|
20
18
|
labelKey: string;
|
|
21
19
|
valueKey: string;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
readonly: boolean;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const _default: typeof __VLS_export;
|
|
24
24
|
//#endregion
|
|
@@ -19,10 +19,10 @@ declare const __VLS_base: import("vue").DefineComponent<SelectProps, {}, {}, {},
|
|
|
19
19
|
onChange?: ((option?: Record<string, any> | undefined) => any) | undefined;
|
|
20
20
|
"onUpdate:text"?: ((text?: string | undefined) => any) | undefined;
|
|
21
21
|
}>, {
|
|
22
|
-
disabled: boolean;
|
|
23
|
-
readonly: boolean;
|
|
24
22
|
labelKey: string;
|
|
25
23
|
valueKey: string;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
readonly: boolean;
|
|
26
26
|
placeholder: string;
|
|
27
27
|
clearable: boolean;
|
|
28
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -7,11 +7,11 @@ type __VLS_Slots = {
|
|
|
7
7
|
tip?: (scope: StepsSlotScope) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<StepsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
"item-click": (item: Record<string, any>, index: number) => any;
|
|
11
10
|
"update:current": (value?: string | number | undefined) => any;
|
|
11
|
+
"item-click": (item: Record<string, any>, index: number) => any;
|
|
12
12
|
}, string, import("vue").PublicProps, Readonly<StepsProps> & Readonly<{
|
|
13
|
-
"onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
|
|
14
13
|
"onUpdate:current"?: ((value?: string | number | undefined) => any) | undefined;
|
|
14
|
+
"onItem-click"?: ((item: Record<string, any>, index: number) => any) | undefined;
|
|
15
15
|
}>, {
|
|
16
16
|
labelKey: string;
|
|
17
17
|
direction: "horizontal" | "vertical";
|