yc-pro-components 0.0.53 → 0.0.57
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/components/breadcrumb/index.d.ts +1 -1
- package/es/components/breadcrumb/src/index.vue.d.ts +1 -1
- package/es/components/check-card/index.d.ts +1 -1
- package/es/components/check-card-group/index.d.ts +2 -1
- package/es/components/check-card-group/src/index.vue.d.ts +1 -1
- package/es/components/descriptions/index.d.ts +2 -1
- package/es/components/dialog-form/index.d.ts +2 -1
- package/es/components/display-item/index.d.ts +2 -1
- package/es/components/drawer-form/index.d.ts +2 -1
- package/es/components/form/index.d.ts +2 -1
- package/es/components/form/src/form-content.vue.d.ts +2 -2
- package/es/components/form-item/index.d.ts +2 -1
- package/es/components/header/index.d.ts +1 -1
- package/es/components/input-tag/index.d.ts +1 -1
- package/es/components/layout/index.d.ts +2 -1
- package/es/components/page/index.d.ts +2 -1
- package/es/components/pagination/index.d.ts +1 -1
- package/es/components/radio/index.d.ts +1 -1
- package/es/components/render/index.d.ts +2 -1
- package/es/components/search/index.d.ts +2 -1
- package/es/components/sidebar/index.d.ts +1 -1
- package/es/components/steps-form/index.d.ts +2 -1
- package/es/components/table/index.d.ts +2 -1
- package/es/components/virtual-table/index.d.ts +2 -1
- package/es/components/yc-drawer/store.d.ts +1 -1
- package/es/components/yc-plus-page/src/filter-strategies.d.ts +22 -0
- package/es/components/yc-plus-page/src/filter-strategies.mjs +189 -0
- package/es/components/yc-plus-page/src/filter-utils.d.ts +37 -0
- package/es/components/yc-plus-page/src/filter-utils.mjs +27 -0
- package/es/components/yc-plus-page/src/header-filter-cell.vue.d.ts +2 -0
- package/es/components/yc-plus-page/src/header-filter-cell.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/header-filter-cell.vue2.mjs +136 -65
- package/es/components/yc-plus-page/src/index.vue.d.ts +2 -1
- package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/index.vue2.mjs +15 -4
- package/es/components/yc-plus-page/src/type.d.ts +8 -0
- package/es/components/yc-plus-page/src/use-header-filter.mjs +17 -4
- package/es/components/yc-select-v2/src/index.vue2.mjs +4 -2
- package/es/components/yc-select-v2/src/type.d.ts +2 -0
- package/es/directives/dist/fn-perm.mjs +2 -2
- package/es/hooks/useGetOptions.mjs +56 -34
- package/es/hooks/usePlusFormReset.d.ts +2 -1
- package/es/index.css +13 -12
- package/es/index.d.ts +1 -0
- package/es/index.mjs +1 -0
- package/es/types/table.d.ts +2 -3
- package/es/utils/dist/permission.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/yc-components/index.d.ts +1 -0
- package/es/yc-components/version.d.ts +1 -1
- package/index.css +15 -12
- package/index.js +445 -117
- package/index.min.css +3 -2
- package/index.min.js +11 -11
- package/index.min.mjs +11 -11
- package/index.mjs +444 -118
- package/lib/components/breadcrumb/index.d.ts +1 -1
- package/lib/components/breadcrumb/src/index.vue.d.ts +1 -1
- package/lib/components/check-card/index.d.ts +1 -1
- package/lib/components/check-card-group/index.d.ts +2 -1
- package/lib/components/check-card-group/src/index.vue.d.ts +1 -1
- package/lib/components/descriptions/index.d.ts +2 -1
- package/lib/components/dialog-form/index.d.ts +2 -1
- package/lib/components/display-item/index.d.ts +2 -1
- package/lib/components/drawer-form/index.d.ts +2 -1
- package/lib/components/form/index.d.ts +2 -1
- package/lib/components/form/src/form-content.vue.d.ts +2 -2
- package/lib/components/form-item/index.d.ts +2 -1
- package/lib/components/header/index.d.ts +1 -1
- package/lib/components/input-tag/index.d.ts +1 -1
- package/lib/components/layout/index.d.ts +2 -1
- package/lib/components/page/index.d.ts +2 -1
- package/lib/components/pagination/index.d.ts +1 -1
- package/lib/components/radio/index.d.ts +1 -1
- package/lib/components/render/index.d.ts +2 -1
- package/lib/components/search/index.d.ts +2 -1
- package/lib/components/sidebar/index.d.ts +1 -1
- package/lib/components/steps-form/index.d.ts +2 -1
- package/lib/components/table/index.d.ts +2 -1
- package/lib/components/virtual-table/index.d.ts +2 -1
- package/lib/components/yc-drawer/store.d.ts +1 -1
- package/lib/components/yc-plus-page/src/filter-strategies.d.ts +22 -0
- package/lib/components/yc-plus-page/src/filter-strategies.js +193 -0
- package/lib/components/yc-plus-page/src/filter-utils.d.ts +37 -0
- package/lib/components/yc-plus-page/src/filter-utils.js +36 -0
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.d.ts +2 -0
- package/lib/components/yc-plus-page/src/header-filter-cell.vue.js +1 -1
- package/lib/components/yc-plus-page/src/header-filter-cell.vue2.js +135 -64
- package/lib/components/yc-plus-page/src/index.vue.d.ts +2 -1
- package/lib/components/yc-plus-page/src/index.vue.js +1 -1
- package/lib/components/yc-plus-page/src/index.vue2.js +15 -4
- package/lib/components/yc-plus-page/src/type.d.ts +8 -0
- package/lib/components/yc-plus-page/src/use-header-filter.js +17 -4
- package/lib/components/yc-select-v2/src/index.vue2.js +4 -2
- package/lib/components/yc-select-v2/src/type.d.ts +2 -0
- package/lib/hooks/useGetOptions.js +55 -33
- package/lib/hooks/usePlusFormReset.d.ts +2 -1
- package/lib/index.css +14 -13
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/types/table.d.ts +2 -3
- package/lib/utils/dist/permission.js +3 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/yc-components/index.d.ts +1 -0
- package/lib/yc-components/version.d.ts +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LooseRequired } from '@vue/shared';
|
|
2
2
|
import { RouteComponent, RouteLocation, RouteLocationRaw, LocationQueryRaw, HistoryState, RouteRecordName, RouteParamsRaw, NavigationGuardWithThis, NavigationGuard, RouteLocationNormalized, RouteMeta } from 'vue-router';
|
|
3
|
-
import { PlusRouteRecordRaw, RenderTypes } from '
|
|
3
|
+
import { PlusRouteRecordRaw, RenderTypes } from 'yc-pro-components';
|
|
4
4
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, FunctionalComponent, DefineComponent, Slot, Component, ComputedOptions, MethodOptions, Directive, WatchCallback, WatchOptions, ComponentProvideOptions, DebuggerEvent, ComponentPublicInstance } from 'vue';
|
|
5
5
|
export * from './src/type';
|
|
6
6
|
export declare const PlusBreadcrumb: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LooseRequired } from '@vue/shared';
|
|
2
2
|
import { RouteComponent, RouteLocation, RouteLocationRaw, LocationQueryRaw, HistoryState, RouteRecordName, RouteParamsRaw, NavigationGuardWithThis, NavigationGuard, RouteLocationNormalized, RouteMeta } from 'vue-router';
|
|
3
|
-
import { PlusRouteRecordRaw } from '
|
|
3
|
+
import { PlusRouteRecordRaw } from 'yc-pro-components';
|
|
4
4
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, FunctionalComponent, Slot, Component, ComputedOptions, MethodOptions, Directive, WatchCallback, WatchOptions, ComponentProvideOptions, DebuggerEvent, ComponentPublicInstance, ComponentOptionsBase, PropType } from 'vue';
|
|
5
5
|
import { PlusBreadcrumbSelfProps as PlusBreadcrumbProps } from './type';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderTypes, RecordType } from '
|
|
1
|
+
import { RenderTypes, RecordType } from 'yc-pro-components';
|
|
2
2
|
import { PlusCheckCardProps } from './src/index.vue';
|
|
3
3
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
4
4
|
export type { PlusCheckCardProps } from './src/index.vue';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { RenderTypes } from 'yc-pro-components';
|
|
1
2
|
import { ValueType } from './src/index.vue';
|
|
2
|
-
import { PlusCheckCardProps
|
|
3
|
+
import { PlusCheckCardProps } from 'packages/yc-components';
|
|
3
4
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
4
5
|
export type { PlusCheckCardGroupProps } from './src/index.vue';
|
|
5
6
|
export declare const PlusCheckCardGroup: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderTypes } from '
|
|
1
|
+
import { RenderTypes } from 'yc-pro-components';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
|
|
3
3
|
import { ComponentSize } from 'element-plus';
|
|
4
4
|
import { PlusCheckCardProps } from 'yc-pro-components/es/components/check-card';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlusFormProps, TableFormRefRow } from 'packages/yc-components';
|
|
2
|
+
import { RecordType, PlusColumn, FieldValueType } from 'yc-pro-components';
|
|
2
3
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ShallowRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
3
4
|
import { default as Descriptions } from './src/index.vue';
|
|
4
5
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EpPropMergeType } from 'element-plus/es/utils';
|
|
2
2
|
import { LooseRequired } from '@vue/shared';
|
|
3
3
|
import { FormInstance, ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps } from 'element-plus';
|
|
4
|
-
import {
|
|
4
|
+
import { FieldValues, PlusColumn, RecordType, Mutable, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, TableValueType, FormItemValueType, FieldValueType, OptionsRow } from 'yc-pro-components';
|
|
5
|
+
import { PlusDialogProps, PlusFormProps, PlusFormItemProps, PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
5
6
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Ref, CSSProperties, Component } from 'vue';
|
|
6
7
|
import { default as DialogForm } from './src/index.vue';
|
|
7
8
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EpPropMergeType } from 'element-plus/es/utils';
|
|
2
2
|
import { ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps } from 'element-plus';
|
|
3
3
|
import { LooseRequired } from '@vue/shared';
|
|
4
|
-
import {
|
|
4
|
+
import { PlusFormProps, PlusFormItemProps, PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
5
|
+
import { RecordType, PlusColumn, FieldValueType, Mutable, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, TableValueType, FormItemValueType, OptionsRow } from 'yc-pro-components';
|
|
5
6
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, Ref, ComputedRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, CSSProperties } from 'vue';
|
|
6
7
|
import { default as DisplayItem } from './src/index.vue';
|
|
7
8
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LooseRequired } from '@vue/shared';
|
|
2
2
|
import { EpPropMergeType, EpPropFinalized } from 'element-plus/es/utils';
|
|
3
3
|
import { DrawerProps, DialogTransition, DialogBeforeCloseFn, FormInstance, ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps } from 'element-plus';
|
|
4
|
-
import {
|
|
4
|
+
import { FieldValues, Mutable, RecordType, PlusColumn, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, TableValueType, FormItemValueType, FieldValueType, OptionsRow } from 'yc-pro-components';
|
|
5
|
+
import { PlusFormProps, PlusFormItemProps, PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
5
6
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, Ref, ComponentInternalInstance, TransitionProps, Component, ComputedOptions, MethodOptions, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, ComputedRef } from 'vue';
|
|
6
7
|
export type { PlusDrawerFormProps } from './src/index.vue';
|
|
7
8
|
export type PlusDrawerFormInstance = InstanceType<typeof PlusDrawerForm>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { PlusFormItemProps, PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
1
2
|
import { LooseRequired } from '@vue/shared';
|
|
2
3
|
import { FormItemRule, RowProps, ColProps, CardProps, FormInstance, ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps } from 'element-plus';
|
|
3
4
|
import { Arrayable, EpPropMergeType } from 'element-plus/es/utils';
|
|
4
5
|
import { PlusFormGroupRow } from './src/type';
|
|
5
|
-
import { PlusColumn, FieldValues, Mutable, RecordType,
|
|
6
|
+
import { PlusColumn, FieldValues, Mutable, RecordType, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, TableValueType, FormItemValueType, FieldValueType, OptionsRow } from 'yc-pro-components';
|
|
6
7
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, Ref, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, ComputedRef, Component } from 'vue';
|
|
7
8
|
import { default as Form } from './src/index.vue';
|
|
8
9
|
|
|
@@ -140,7 +140,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
140
140
|
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
141
141
|
dictCode?: string | undefined;
|
|
142
142
|
} | undefined;
|
|
143
|
-
headerFilter?: boolean | undefined;
|
|
143
|
+
headerFilter?: boolean | Record<string, any> | undefined;
|
|
144
144
|
disabledHeaderFilter?: boolean | undefined;
|
|
145
145
|
headerIsChecked?: boolean | undefined;
|
|
146
146
|
tableColumnProps?: Partial<Omit< TableColumnCtx<any>, "label " | "prop" | "width" | "minWidth"> & {
|
|
@@ -485,7 +485,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
485
485
|
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
486
486
|
dictCode?: string | undefined;
|
|
487
487
|
} | undefined;
|
|
488
|
-
headerFilter?: boolean | undefined;
|
|
488
|
+
headerFilter?: boolean | Record<string, any> | undefined;
|
|
489
489
|
disabledHeaderFilter?: boolean | undefined;
|
|
490
490
|
headerIsChecked?: boolean | undefined;
|
|
491
491
|
tableColumnProps?: Partial<Omit< TableColumnCtx<any>, "label " | "prop" | "width" | "minWidth"> & {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { PlusFormItemProps } from './src/index.vue';
|
|
2
2
|
import { LooseRequired } from '@vue/shared';
|
|
3
|
+
import { PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
3
4
|
import { EpPropMergeType, Arrayable, EpPropFinalized } from 'element-plus/es/utils';
|
|
4
5
|
import { ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps, FormItemProp, FormItemRule, FormValidateCallback, FormValidationResult } from 'element-plus';
|
|
5
|
-
import { Mutable, RecordType, PropsItemType, OmitTypes, CascaderProps,
|
|
6
|
+
import { Mutable, RecordType, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, OptionsRow, TableValueType, FieldValueType, PlusColumn, FormItemValueType } from 'yc-pro-components';
|
|
6
7
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComputedRef, CSSProperties, Ref, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
|
|
7
8
|
export type { PlusFormItemProps } from './src/index.vue';
|
|
8
9
|
export declare const PlusFormItem: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RenderTypes } from '
|
|
1
|
+
import { RenderTypes } from 'yc-pro-components';
|
|
2
2
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
3
3
|
export * from './src/type';
|
|
4
4
|
export declare const PlusHeader: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InputProps, TagProps, InputInstance, TagInstance } from 'element-plus';
|
|
2
|
-
import { Mutable, RecordType } from '
|
|
2
|
+
import { Mutable, RecordType } from 'yc-pro-components';
|
|
3
3
|
import { DefineComponent, PropType, CSSProperties, Ref, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
|
|
4
4
|
import { PlusInputTagProps } from './src/index.vue';
|
|
5
5
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NavigationFailure } from 'vue-router';
|
|
2
2
|
import { EpPropFinalized, EpPropMergeType } from 'element-plus/es/utils';
|
|
3
3
|
import { ScrollbarProps, BacktopProps, PopperEffect, MenuItemClicked } from 'element-plus';
|
|
4
|
-
import {
|
|
4
|
+
import { Mutable, RecordType, PlusRouteRecordRaw, RenderTypes } from 'yc-pro-components';
|
|
5
|
+
import { PlusHeaderProps, PlusSidebarProps, PlusBreadcrumbProps } from 'packages/yc-components';
|
|
5
6
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, Ref, ComponentInternalInstance, ComputedRef, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, Component, VNode, RendererNode, RendererElement, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
|
|
6
7
|
export type { PlusLayoutProps } from './src/index.vue';
|
|
7
8
|
export declare const PlusLayout: {
|
|
@@ -2,7 +2,8 @@ import { Options } from 'sortablejs';
|
|
|
2
2
|
import { LooseRequired } from '@vue/shared';
|
|
3
3
|
import { Arrayable, EpPropMergeType } from 'element-plus/es/utils';
|
|
4
4
|
import { TableProps, CardProps, RowProps, ColProps, FormItemRule, FormInstance, ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps, TableColumnCtx, TableInstance, TableV2Instance } from 'element-plus';
|
|
5
|
-
import {
|
|
5
|
+
import { RecordType, PlusColumn, PageInfo, Mutable, FieldValues, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, TableValueType, FormItemValueType, FieldValueType, OptionsRow } from 'yc-pro-components';
|
|
6
|
+
import { PlusSearchSelfProps, PlusFormSelfProps, ElementPlusFormProps, PlusTableSelfProps, PlusPaginationProps, PlusFormGroupRow, PlusFormItemProps, PlusRadioProps, PlusDatePickerProps, PlusInputTagProps, ActionBarProps, ColumnSetting, ButtonsCallBackParams, FormChangeCallBackParams, FilterTableHeaderEventType, TableFormRefRow, VirtualTableColumn } from 'packages/yc-components';
|
|
6
7
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, Ref, ComponentInternalInstance, Component, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, ComputedRef, ShallowRef } from 'vue';
|
|
7
8
|
import { default as Page } from './src/index.vue';
|
|
8
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PageInfo } from '
|
|
1
|
+
import { PageInfo } from 'yc-pro-components';
|
|
2
2
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
3
3
|
import { default as Pagination } from './src/index.vue';
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { radioOptionProp, radioOption } from 'element-plus';
|
|
2
2
|
import { EpPropMergeType, EpPropFinalized } from 'element-plus/es/utils';
|
|
3
|
-
import { OptionsRow, RecordType, RenderTypes } from '
|
|
3
|
+
import { OptionsRow, RecordType, RenderTypes } from 'yc-pro-components';
|
|
4
4
|
import { DefineComponent, PropType, Ref, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, PublicProps } from 'vue';
|
|
5
5
|
import { PlusRadioProps } from './src/index.vue';
|
|
6
6
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
1
2
|
import { EpPropMergeType } from 'element-plus/es/utils';
|
|
2
3
|
import { FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps } from 'element-plus';
|
|
3
|
-
import { FieldValueType, PlusColumn, RenderTypes, RecordType, PropsItemType, Mutable, OmitTypes, CascaderProps
|
|
4
|
+
import { FieldValueType, PlusColumn, RenderTypes, RecordType, PropsItemType, Mutable, OmitTypes, CascaderProps } from 'yc-pro-components';
|
|
4
5
|
import { DefineComponent, PropType, CSSProperties, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
|
|
5
6
|
export type { PlusRenderProps } from './src/index.vue';
|
|
6
7
|
export declare const PlusRender: DefineComponent<{
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LooseRequired } from '@vue/shared';
|
|
2
2
|
import { Arrayable, EpPropMergeType } from 'element-plus/es/utils';
|
|
3
|
+
import { PlusFormGroupRow, PlusFormItemProps, PlusRadioProps, PlusDatePickerProps, PlusInputTagProps } from 'packages/yc-components';
|
|
3
4
|
import { RowProps, ColProps, FormItemRule, CardProps, FormInstance, ElTooltipProps, FormItemProps, ProgressFn, CascaderNode, PopperEffect, InputAutoSize, AutocompleteProps, CheckboxGroupProps, ColorPickerProps, DatePickerProps, InputProps, InputNumberProps, RadioGroupProps, RateProps, SelectProps, SliderProps, SwitchProps, TimePickerDefaultProps, TimeSelectProps, TextProps, ImageProps, LinkProps, TagProps, ProgressProps } from 'element-plus';
|
|
4
|
-
import { PlusColumn, FieldValues, Mutable, RecordType,
|
|
5
|
+
import { PlusColumn, FieldValues, Mutable, RecordType, PropsItemType, OmitTypes, CascaderProps, OptionsType, RenderTypes, TableValueType, FormItemValueType, FieldValueType, OptionsRow } from 'yc-pro-components';
|
|
5
6
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, Component, Ref, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, ComputedRef } from 'vue';
|
|
6
7
|
import { default as Search } from './src/index.vue';
|
|
7
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NavigationFailure } from 'vue-router';
|
|
2
2
|
import { EpPropFinalized, EpPropMergeType } from 'element-plus/es/utils';
|
|
3
3
|
import { ScrollbarProps, PopperEffect, MenuItemClicked } from 'element-plus';
|
|
4
|
-
import { PlusRouteRecordRaw, RenderTypes, Mutable, RecordType } from '
|
|
4
|
+
import { PlusRouteRecordRaw, RenderTypes, Mutable, RecordType } from 'yc-pro-components';
|
|
5
5
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComputedRef, Ref, CSSProperties, Component, VNode, RendererNode, RendererElement, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
6
6
|
import { default as Sidebar } from './src/index.vue';
|
|
7
7
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EpPropMergeType } from 'element-plus/es/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { PlusFormProps } from 'packages/yc-components';
|
|
3
|
+
import { FieldValues, PlusColumn } from 'yc-pro-components';
|
|
3
4
|
import { PlusStepFromRow } from './src/type';
|
|
4
5
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, Component, ComputedOptions, MethodOptions } from 'vue';
|
|
5
6
|
export type { PlusStepsFormProps } from './src/index.vue';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Options } from 'sortablejs';
|
|
2
|
+
import { PlusPaginationProps, PlusRadioProps } from 'packages/yc-components';
|
|
2
3
|
import { ActionBarProps, ColumnSetting, ButtonsCallBackParams, FormChangeCallBackParams, FilterTableHeaderEventType, TableFormRefRow } from './src/type';
|
|
3
4
|
import { TableColumnCtx, TableInstance } from 'element-plus';
|
|
4
|
-
import { RecordType, PlusColumn,
|
|
5
|
+
import { RecordType, PlusColumn, PageInfo, TableValueType, FormItemValueType, OptionsRow } from 'yc-pro-components';
|
|
5
6
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, ComputedRef, ShallowRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
6
7
|
import { default as _Table } from './src/index.vue';
|
|
7
8
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableV2Instance } from 'element-plus';
|
|
2
2
|
import { VirtualTableColumn } from './src/type';
|
|
3
|
-
import {
|
|
3
|
+
import { ActionBarProps, PlusPaginationProps, ButtonsCallBackParams } from 'packages/yc-components';
|
|
4
|
+
import { RecordType, PlusColumn, PageInfo } from 'yc-pro-components';
|
|
4
5
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, CSSProperties, ComputedRef, ShallowRef, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase } from 'vue';
|
|
5
6
|
import { default as _VirtualTable } from './src/index.vue';
|
|
6
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Globals } from 'csstype';
|
|
2
|
-
import { OptionsRow } from '
|
|
2
|
+
import { OptionsRow } from 'yc-pro-components';
|
|
3
3
|
import { NavigationGuardWithThis, NavigationGuard } from 'vue-router';
|
|
4
4
|
import { LooseRequired } from '@vue/shared';
|
|
5
5
|
import { Ref, FunctionalComponent, Slot, Component, ComputedOptions, MethodOptions, Directive, WatchCallback, WatchOptions, ComponentProvideOptions, DebuggerEvent, ComponentPublicInstance, ComponentOptionsBase, VNode, RendererNode, RendererElement } from 'vue';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { h } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 筛选组件策略接口
|
|
5
|
+
*/
|
|
6
|
+
export interface FilterComponentStrategy {
|
|
7
|
+
render: (ctx: {
|
|
8
|
+
fp: Record<string, unknown>;
|
|
9
|
+
inputVal: string;
|
|
10
|
+
setInputVal: (v: string) => void;
|
|
11
|
+
options: any[];
|
|
12
|
+
}) => ReturnType<typeof h>;
|
|
13
|
+
}
|
|
14
|
+
/** valueType -> interactionType 的映射表,用于自动推断交互组件类型 */
|
|
15
|
+
export declare const VALUE_TYPE_MAP: Record<string, string>;
|
|
16
|
+
/** 根据列配置解析最终的交互组件类型 */
|
|
17
|
+
export declare const resolveInteractionType: (customType: string | undefined, fieldConfig: Record<string, unknown> | undefined, valueType: string) => string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* 策略注册表
|
|
20
|
+
* 新增组件类型只需在此处追加一条策略,无需修改 renderValueField 主逻辑
|
|
21
|
+
*/
|
|
22
|
+
export declare const FILTER_COMPONENT_STRATEGIES: Record<string, FilterComponentStrategy>;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { h } from 'vue';
|
|
2
|
+
import { ElTimePicker, ElTimeSelect, ElDatePicker, ElCheckbox, ElButton, ElCheckboxGroup, ElTreeSelect, ElCascader, ElSelect, ElOption } from 'element-plus';
|
|
3
|
+
import { mergePopperClass, FILTER_FIELD_STYLE, isRangeType, toArrayValue, fromArrayValue, parseTypedValue } from './filter-utils.mjs';
|
|
4
|
+
|
|
5
|
+
const VALUE_TYPE_MAP = {
|
|
6
|
+
select: "select",
|
|
7
|
+
checkbox: "checkbox",
|
|
8
|
+
radio: "select",
|
|
9
|
+
"date-picker": "date-picker",
|
|
10
|
+
"datetime-picker": "date-picker",
|
|
11
|
+
datetime: "date-picker",
|
|
12
|
+
"time-picker": "time-picker",
|
|
13
|
+
"time-select": "time-select",
|
|
14
|
+
"tree-select": "tree-select",
|
|
15
|
+
cascader: "cascader"
|
|
16
|
+
};
|
|
17
|
+
const resolveInteractionType = (customType, fieldConfig, valueType) => {
|
|
18
|
+
if (customType) return customType;
|
|
19
|
+
if (fieldConfig) {
|
|
20
|
+
if (fieldConfig.type === "date") return "date-picker";
|
|
21
|
+
if (fieldConfig.dictField === true) return "select";
|
|
22
|
+
}
|
|
23
|
+
return VALUE_TYPE_MAP[valueType] || void 0;
|
|
24
|
+
};
|
|
25
|
+
const FILTER_COMPONENT_STRATEGIES = {
|
|
26
|
+
"time-picker": {
|
|
27
|
+
render: ({ fp, inputVal, setInputVal }) => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
return h(ElTimePicker, {
|
|
30
|
+
...fp,
|
|
31
|
+
format: (_a = fp == null ? void 0 : fp.format) != null ? _a : "HH:mm:ss",
|
|
32
|
+
valueFormat: (_b = fp == null ? void 0 : fp.valueFormat) != null ? _b : "HH:mm:ss",
|
|
33
|
+
modelValue: inputVal,
|
|
34
|
+
"onUpdate:modelValue": (v) => setInputVal(String(v != null ? v : "")),
|
|
35
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
36
|
+
style: FILTER_FIELD_STYLE
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"time-select": {
|
|
41
|
+
render: ({ fp, inputVal, setInputVal }) => h(ElTimeSelect, {
|
|
42
|
+
...fp,
|
|
43
|
+
modelValue: inputVal,
|
|
44
|
+
"onUpdate:modelValue": (v) => {
|
|
45
|
+
const raw = String(v != null ? v : "");
|
|
46
|
+
setInputVal(raw && /^\d{2}:\d{2}$/.test(raw) ? `${raw}:00` : raw);
|
|
47
|
+
},
|
|
48
|
+
style: FILTER_FIELD_STYLE
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
"date-picker": {
|
|
52
|
+
render: ({ fp, inputVal, setInputVal }) => {
|
|
53
|
+
var _a;
|
|
54
|
+
const range = isRangeType(fp.type);
|
|
55
|
+
return h(ElDatePicker, {
|
|
56
|
+
...fp,
|
|
57
|
+
valueFormat: (_a = fp == null ? void 0 : fp.valueFormat) != null ? _a : "YYYY-MM-DD HH:mm:ss",
|
|
58
|
+
modelValue: range ? toArrayValue(inputVal) : inputVal,
|
|
59
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
60
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
61
|
+
style: FILTER_FIELD_STYLE
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
checkbox: {
|
|
66
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
67
|
+
const parsedValue = toArrayValue(inputVal) || [];
|
|
68
|
+
const allVals = options.map((o) => o.value);
|
|
69
|
+
const selectedSet = new Set(parsedValue);
|
|
70
|
+
const checkAll = options.length > 0 && parsedValue.length === options.length;
|
|
71
|
+
const isIndeterminate = parsedValue.length > 0 && parsedValue.length < options.length;
|
|
72
|
+
const handleCheckAllChange = (val) => {
|
|
73
|
+
setInputVal(val ? options.map((opt) => opt.value).join(",") : "");
|
|
74
|
+
};
|
|
75
|
+
const handleInvert = () => {
|
|
76
|
+
if (!options.length) return;
|
|
77
|
+
const inverted = allVals.filter((v) => !selectedSet.has(v));
|
|
78
|
+
setInputVal(inverted.join(","));
|
|
79
|
+
};
|
|
80
|
+
const showCheckAll = fp.showCheckAll !== false;
|
|
81
|
+
const showInvert = fp.showInvert !== false;
|
|
82
|
+
const checkAllText = fp.checkAllText || "\u5168\u9009";
|
|
83
|
+
return h("div", { class: "header-filter-checkbox-group", style: "max-height: 250px; overflow-y: auto; padding: 4px;" }, [
|
|
84
|
+
showCheckAll && options.length > 0 ? h("div", { style: "display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--el-border-color-lighter);" }, [
|
|
85
|
+
h(ElCheckbox, {
|
|
86
|
+
modelValue: checkAll,
|
|
87
|
+
indeterminate: isIndeterminate,
|
|
88
|
+
"onUpdate:modelValue": handleCheckAllChange,
|
|
89
|
+
style: "font-weight: bold; flex: 1; min-width: 0;"
|
|
90
|
+
}, () => checkAllText),
|
|
91
|
+
showInvert ? h(
|
|
92
|
+
ElButton,
|
|
93
|
+
{
|
|
94
|
+
link: true,
|
|
95
|
+
type: "primary",
|
|
96
|
+
size: "small",
|
|
97
|
+
onClick: handleInvert
|
|
98
|
+
},
|
|
99
|
+
() => "\u53CD\u9009"
|
|
100
|
+
) : null
|
|
101
|
+
]) : null,
|
|
102
|
+
h(ElCheckboxGroup, {
|
|
103
|
+
...fp,
|
|
104
|
+
modelValue: parsedValue,
|
|
105
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
106
|
+
style: "display: flex; flex-direction: column;"
|
|
107
|
+
}, {
|
|
108
|
+
default: () => options.map(
|
|
109
|
+
(opt) => h(
|
|
110
|
+
ElCheckbox,
|
|
111
|
+
{
|
|
112
|
+
value: opt.value,
|
|
113
|
+
label: opt.value,
|
|
114
|
+
style: "margin-bottom: 4px; height: auto;"
|
|
115
|
+
},
|
|
116
|
+
() => opt.label
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
})
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"tree-select": {
|
|
124
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
125
|
+
const isMultiple = !!fp.multiple;
|
|
126
|
+
const treeData = options && options.length > 0 ? options : fp.data || [];
|
|
127
|
+
return h(ElTreeSelect, {
|
|
128
|
+
...fp,
|
|
129
|
+
modelValue: parseTypedValue(inputVal, isMultiple),
|
|
130
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
131
|
+
data: treeData,
|
|
132
|
+
popperClass: mergePopperClass(fp.popperClass, "yc-header-filter-tree-popper"),
|
|
133
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
134
|
+
style: FILTER_FIELD_STYLE
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
cascader: {
|
|
139
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
140
|
+
const cascaderProps = fp.props || {};
|
|
141
|
+
const isMultiple = !!cascaderProps.multiple;
|
|
142
|
+
let parsedValue = inputVal;
|
|
143
|
+
if (isMultiple && typeof inputVal === "string" && inputVal && !cascaderProps.emitPath) {
|
|
144
|
+
parsedValue = inputVal.split(",");
|
|
145
|
+
}
|
|
146
|
+
return h(ElCascader, {
|
|
147
|
+
...fp,
|
|
148
|
+
modelValue: parsedValue,
|
|
149
|
+
"onUpdate:modelValue": (v) => {
|
|
150
|
+
let flat = v;
|
|
151
|
+
if (Array.isArray(v) && v.length && Array.isArray(v[0])) {
|
|
152
|
+
flat = v.map((arr) => Array.isArray(arr) ? arr[arr.length - 1] : arr);
|
|
153
|
+
}
|
|
154
|
+
setInputVal(fromArrayValue(flat));
|
|
155
|
+
},
|
|
156
|
+
options,
|
|
157
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
158
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
159
|
+
style: FILTER_FIELD_STYLE
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
select: {
|
|
164
|
+
render: ({ fp, inputVal, setInputVal, options }) => {
|
|
165
|
+
const isMultiple = !!fp.multiple;
|
|
166
|
+
return h(
|
|
167
|
+
ElSelect,
|
|
168
|
+
{
|
|
169
|
+
...fp,
|
|
170
|
+
modelValue: parseTypedValue(inputVal, isMultiple),
|
|
171
|
+
"onUpdate:modelValue": (v) => setInputVal(fromArrayValue(v)),
|
|
172
|
+
popperClass: mergePopperClass(fp.popperClass),
|
|
173
|
+
placeholder: fp.placeholder || "\u8BF7\u9009\u62E9",
|
|
174
|
+
style: FILTER_FIELD_STYLE
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
default: () => options.map(
|
|
178
|
+
(opt) => h(ElOption, {
|
|
179
|
+
label: opt.label,
|
|
180
|
+
value: opt.value
|
|
181
|
+
})
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export { FILTER_COMPONENT_STRATEGIES, VALUE_TYPE_MAP, resolveInteractionType };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 筛选组件公共工具函数
|
|
3
|
+
* 抽取自 header-filter-cell.vue,供策略和主渲染函数复用
|
|
4
|
+
*/
|
|
5
|
+
/** 通用样式常量:筛选组件输入区域的宽度和间距 */
|
|
6
|
+
export declare const FILTER_FIELD_STYLE = "margin-top: 4px; width: 100%";
|
|
7
|
+
/** 统一的筛选内部下拉面板标记类名,用于 onDocPointerDown 豁免判断 */
|
|
8
|
+
export declare const FILTER_INNER_DROPDOWN_CLASS = "yc-header-filter-inner-dropdown";
|
|
9
|
+
/** 判断是否为范围类型的 date-picker */
|
|
10
|
+
export declare const isRangeType: (type: unknown) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 将逗号分隔字符串转为数组
|
|
13
|
+
* 用于多选组件的 modelValue 回显
|
|
14
|
+
*/
|
|
15
|
+
export declare const toArrayValue: (val: string | undefined) => string[] | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* 将数组或单值转为逗号分隔字符串
|
|
18
|
+
* 用于将多选组件的 modelValue 存回 state.inputVal
|
|
19
|
+
*/
|
|
20
|
+
export declare const fromArrayValue: (v: unknown) => string;
|
|
21
|
+
/**
|
|
22
|
+
* 将逗号分隔字符串还原为正确类型的数组或单值
|
|
23
|
+
* 解决 inputVal 存储字符串,但组件 option.value 为 number 导致的选中回显失败
|
|
24
|
+
* @param val 逗号分隔的字符串值
|
|
25
|
+
* @param isMultiple 是否多选模式
|
|
26
|
+
* @returns 多选时返回数组(还原数字类型),单选时返回原值
|
|
27
|
+
*/
|
|
28
|
+
export declare const parseTypedValue: (val: string | undefined, isMultiple: boolean) => unknown;
|
|
29
|
+
/**
|
|
30
|
+
* 合并用户自定义的 popperClass 和内置标记类
|
|
31
|
+
* 确保下拉面板同时拥有:(1) z-index 提升类 (2) onDocPointerDown 豁免标记类 (3) 用户自定义类
|
|
32
|
+
*/
|
|
33
|
+
export declare const mergePopperClass: (userClass: string | undefined, builtinClass?: string) => string;
|
|
34
|
+
/**
|
|
35
|
+
* 统一解析 options:优先使用 resolvedOptions,为空时回退到 headerFilter.options(自动解包 Ref)
|
|
36
|
+
*/
|
|
37
|
+
export declare const resolveFilterOptions: (resolvedOptions: unknown[], headerFilterOptions: unknown) => unknown[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const FILTER_FIELD_STYLE = "margin-top: 4px; width: 100%";
|
|
2
|
+
const FILTER_INNER_DROPDOWN_CLASS = "yc-header-filter-inner-dropdown";
|
|
3
|
+
const isRangeType = (type) => type === "daterange" || type === "monthrange" || type === "datetimerange" || type === "yearrange";
|
|
4
|
+
const toArrayValue = (val) => typeof val === "string" && val ? val.split(",") : void 0;
|
|
5
|
+
const fromArrayValue = (v) => Array.isArray(v) ? v.join(",") : String(v != null ? v : "");
|
|
6
|
+
const parseTypedValue = (val, isMultiple) => {
|
|
7
|
+
if (!val) return isMultiple ? [] : "";
|
|
8
|
+
if (!isMultiple) return val;
|
|
9
|
+
return val.split(",").filter(Boolean).map((s) => {
|
|
10
|
+
const n = Number(s);
|
|
11
|
+
return Number.isNaN(n) ? s : n;
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const mergePopperClass = (userClass, builtinClass) => {
|
|
15
|
+
const parts = [FILTER_INNER_DROPDOWN_CLASS];
|
|
16
|
+
if (builtinClass) parts.push(builtinClass);
|
|
17
|
+
if (userClass) parts.push(userClass);
|
|
18
|
+
return parts.join(" ");
|
|
19
|
+
};
|
|
20
|
+
const resolveFilterOptions = (resolvedOptions, headerFilterOptions) => {
|
|
21
|
+
if (resolvedOptions && resolvedOptions.length > 0) return resolvedOptions;
|
|
22
|
+
if (!headerFilterOptions) return [];
|
|
23
|
+
const unwrapped = typeof headerFilterOptions.value !== "undefined" ? headerFilterOptions.value : headerFilterOptions;
|
|
24
|
+
return Array.isArray(unwrapped) ? unwrapped : [];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { FILTER_FIELD_STYLE, FILTER_INNER_DROPDOWN_CLASS, fromArrayValue, isRangeType, mergePopperClass, parseTypedValue, resolveFilterOptions, toArrayValue };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main from './header-filter-cell.vue2.mjs';
|
|
2
2
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
3
3
|
|
|
4
|
-
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
var YcTableHeaderFilterCellComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1b4d52f7"], ["__file", "header-filter-cell.vue"]]);
|
|
5
5
|
|
|
6
6
|
export { YcTableHeaderFilterCellComponent as default };
|