context.d.ts 1.0 KB

12345678910111213141516171819202122
  1. import type { CSSProperties, Ref } from 'vue';
  2. import type { VueNode } from '../_util/type';
  3. import type { BaseCascaderProps, InternalFieldNames, DefaultOptionType, SingleValueType } from './Cascader';
  4. export interface CascaderContextProps {
  5. options: Ref<BaseCascaderProps['options']>;
  6. fieldNames: Ref<InternalFieldNames>;
  7. values: Ref<SingleValueType[]>;
  8. halfValues: Ref<SingleValueType[]>;
  9. changeOnSelect: Ref<boolean>;
  10. onSelect: (valuePath: SingleValueType) => void;
  11. checkable: Ref<boolean | VueNode>;
  12. searchOptions: Ref<DefaultOptionType[]>;
  13. dropdownPrefixCls?: Ref<string>;
  14. loadData: Ref<(selectOptions: DefaultOptionType[]) => void>;
  15. expandTrigger: Ref<'hover' | 'click'>;
  16. expandIcon: Ref<VueNode>;
  17. loadingIcon: Ref<VueNode>;
  18. dropdownMenuColumnStyle: Ref<CSSProperties>;
  19. customSlots: Ref<Record<string, Function>>;
  20. }
  21. export declare const useProvideCascader: (props: CascaderContextProps) => void;
  22. export declare const useInjectCascader: () => CascaderContextProps;