UNPKG

@vuesax-alpha/nightly

Version:
1 lines 2.8 kB
{"version":3,"file":"tokens.mjs","sources":["../../../../../../packages/components/select/src/tokens.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\n\nexport type SelectOptionValue = string | number | object\n\nexport type SelectOptionContext = {\n el: HTMLElement | undefined\n index: number\n groupDisabled: boolean\n label?: string\n value: SelectOptionValue\n isDisabled: boolean\n visible: boolean\n hit: boolean\n hover: boolean\n created: boolean\n currentLabel: string\n}\n\nexport type SelectTargetElement =\n | 'select'\n | 'chip'\n | 'popper'\n | 'chip'\n | 'chip-close'\n | 'input'\n | 'input-filter'\n | 'reference'\n\nexport type SelectValue = SelectOptionValue | SelectOptionValue[]\n\nexport type SelectStates = {\n options: Map<SelectOptionValue, SelectOptionContext>\n cachedOptions: Map<SelectOptionValue, SelectOptionContext>\n selected: Map<SelectOptionValue, SelectOptionContext>\n disabledOptions: Map<SelectOptionValue, SelectOptionContext>\n createdLabel: string | null\n createdSelected: boolean\n targetOnElement: SelectTargetElement | null\n optionsCount: number\n filteredOptionsCount: number\n visible: boolean\n softFocus: boolean\n selectedLabel: string\n hoverIndex: number\n query: string\n previousQuery: string | null\n cachedPlaceHolder: string | undefined\n currentPlaceholder: string | undefined\n menuVisibleOnFocus: boolean\n isOnComposition: boolean\n isSilentBlur: boolean\n mouseEnter: boolean\n}\n\nexport type SelectGroupContext = {\n disabled: boolean\n}\n\nexport type SelectContext = {\n multipleLimit: number\n multiple: boolean\n states: SelectStates\n queryChange: string | null\n selectWrapper: HTMLElement | undefined\n selectedArray: SelectOptionContext[]\n optionsArray: SelectOptionContext[]\n cachedOptionsArray: SelectOptionContext[]\n hoverIndex: number\n handleTarget: (\n target: SelectTargetElement | null,\n condition?: boolean\n ) => void\n setSelected(): void\n handleOptionSelect(vm: SelectOptionContext, byClick: boolean): void\n}\n\ntype SelectRegisterContext = (option: SelectOptionContext) => {\n unregister: () => void\n updateOption: (option: SelectOptionContext) => void\n}\n\nexport const selectContextKey: InjectionKey<SelectContext> = Symbol()\n\nexport const selectRegisterKey: InjectionKey<SelectRegisterContext> = Symbol()\n\nexport const optionGroupContextKey: InjectionKey<SelectGroupContext> = Symbol()\n\ntype OptionGroupRegisterContext = (option: SelectOptionContext) => {\n unregister: () => void\n}\nexport const optionGroupRegisterKey: InjectionKey<OptionGroupRegisterContext> =\n Symbol()\n"],"names":[],"mappings":"AAiFO,MAAM,mBAAgD,MAAO,GAAA;AAE7D,MAAM,oBAAyD,MAAO,GAAA;AAEtE,MAAM,wBAA0D,MAAO,GAAA;AAKvE,MAAM,yBACX,MAAO;;;;"}