@fibrae/semi-foundation 0.1.1 → 0.2.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/anchor/foundation.d.ts +1 -1
- package/dist/anchor/foundation.js +21 -21
- package/dist/audio-player/foundation.d.ts +10 -10
- package/dist/audio-player/foundation.js +19 -19
- package/dist/auto-complete/foundation.d.ts +12 -12
- package/dist/auto-complete/foundation.js +51 -51
- package/dist/avatar/foundation.d.ts +5 -5
- package/dist/avatar/foundation.js +16 -16
- package/dist/backtop/foundation.d.ts +2 -2
- package/dist/backtop/foundation.js +7 -7
- package/dist/banner/foundation.d.ts +1 -1
- package/dist/banner/foundation.js +4 -4
- package/dist/base/auto-close-foundation.d.ts +8 -8
- package/dist/base/auto-close-foundation.js +15 -15
- package/dist/base/foundation.d.ts +4 -3
- package/dist/base/foundation.js +12 -11
- package/dist/breadcrumb/foundation.d.ts +5 -5
- package/dist/breadcrumb/foundation.js +9 -10
- package/dist/breadcrumb/item-foundation.d.ts +3 -3
- package/dist/breadcrumb/item-foundation.js +6 -6
- package/dist/calendar/event-util.js +1 -1
- package/dist/calendar/foundation.js +4 -4
- package/dist/calendar/month-foundation.d.ts +2 -2
- package/dist/calendar/month-foundation.js +6 -6
- package/dist/carousel/foundation.d.ts +17 -17
- package/dist/carousel/foundation.js +51 -51
- package/dist/cascader/foundation.d.ts +34 -26
- package/dist/cascader/foundation.js +143 -121
- package/dist/checkbox/checkbox-foundation.d.ts +2 -2
- package/dist/checkbox/checkbox-foundation.js +15 -15
- package/dist/checkbox/checkbox-group-foundation.d.ts +2 -2
- package/dist/checkbox/checkbox-group-foundation.js +8 -8
- package/dist/code-highlight/index.d.ts +1 -1
- package/dist/code-highlight/index.js +3 -3
- package/dist/collapse/foundation.d.ts +2 -2
- package/dist/collapse/foundation.js +7 -7
- package/dist/collapsible/foundation.d.ts +3 -3
- package/dist/collapsible/foundation.js +8 -8
- package/dist/color-picker/alpha-slider-foundation.d.ts +2 -4
- package/dist/color-picker/alpha-slider-foundation.js +10 -10
- package/dist/color-picker/color-choose-area-foundation.d.ts +2 -5
- package/dist/color-picker/color-choose-area-foundation.js +14 -14
- package/dist/color-picker/color-slider-foundation.d.ts +2 -4
- package/dist/color-picker/color-slider-foundation.js +10 -10
- package/dist/color-picker/data-part-foundation.d.ts +5 -5
- package/dist/color-picker/data-part-foundation.js +11 -11
- package/dist/color-picker/foundation.d.ts +4 -4
- package/dist/color-picker/foundation.js +10 -10
- package/dist/config-provider/breakpoint-observer.d.ts +3 -3
- package/dist/config-provider/breakpoint-observer.js +6 -6
- package/dist/cropper/foundation.d.ts +15 -15
- package/dist/cropper/foundation.js +26 -23
- package/dist/date-picker/_utils/picker-type.d.ts +1 -1
- package/dist/date-picker/foundation.d.ts +36 -36
- package/dist/date-picker/foundation.js +125 -129
- package/dist/date-picker/input-foundation.d.ts +9 -9
- package/dist/date-picker/input-foundation.js +28 -28
- package/dist/date-picker/months-grid-foundation.d.ts +16 -16
- package/dist/date-picker/months-grid-foundation.js +64 -65
- package/dist/date-picker/year-and-month-foundation.d.ts +3 -3
- package/dist/date-picker/year-and-month-foundation.js +11 -11
- package/dist/drag-move/foundation.d.ts +2 -2
- package/dist/drag-move/foundation.js +15 -13
- package/dist/dropdown/foundation.d.ts +8 -5
- package/dist/dropdown/foundation.js +32 -28
- package/dist/dropdown/menu-foundation.d.ts +1 -1
- package/dist/dropdown/menu-foundation.js +11 -11
- package/dist/feedback/foundation.d.ts +9 -9
- package/dist/feedback/foundation.js +33 -33
- package/dist/form/form-api-proxy.d.ts +8 -7
- package/dist/form/form-api-proxy.js +25 -25
- package/dist/form/foundation.d.ts +5 -5
- package/dist/form/foundation.js +60 -61
- package/dist/highlight/foundation.js +1 -1
- package/dist/hot-keys/foundation.d.ts +2 -2
- package/dist/hot-keys/foundation.js +5 -5
- package/dist/image/image-foundation.d.ts +4 -4
- package/dist/image/image-foundation.js +10 -10
- package/dist/image/preview-footer-foundation.d.ts +3 -3
- package/dist/image/preview-footer-foundation.js +10 -10
- package/dist/image/preview-foundation.js +7 -6
- package/dist/image/preview-image-foundation.d.ts +6 -8
- package/dist/image/preview-image-foundation.js +14 -14
- package/dist/image/preview-inner-foundation.d.ts +9 -9
- package/dist/image/preview-inner-foundation.js +38 -38
- package/dist/input/foundation.d.ts +10 -10
- package/dist/input/foundation.js +47 -49
- package/dist/input/text-entry-foundation.d.ts +3 -3
- package/dist/input/text-entry-foundation.js +14 -14
- package/dist/input/textarea-foundation.d.ts +7 -7
- package/dist/input/textarea-foundation.js +36 -36
- package/dist/input-number/foundation.d.ts +16 -14
- package/dist/input-number/foundation.js +54 -53
- package/dist/json-viewer/foundation.d.ts +8 -8
- package/dist/json-viewer/foundation.js +23 -23
- package/dist/lottie/foundation.d.ts +1 -1
- package/dist/lottie/foundation.js +4 -4
- package/dist/markdown-render/foundation.d.ts +1 -1
- package/dist/markdown-render/foundation.js +4 -4
- package/dist/modal/modal-content-foundation.d.ts +7 -7
- package/dist/modal/modal-content-foundation.js +20 -20
- package/dist/modal/modal-foundation.d.ts +6 -6
- package/dist/modal/modal-foundation.js +24 -24
- package/dist/navigation/foundation.d.ts +1 -1
- package/dist/navigation/foundation.js +14 -14
- package/dist/navigation/item-foundation.d.ts +1 -1
- package/dist/navigation/item-foundation.js +8 -8
- package/dist/navigation/sub-nav-foundation.d.ts +3 -3
- package/dist/navigation/sub-nav-foundation.js +17 -17
- package/dist/notification/notification-list-foundation.d.ts +7 -7
- package/dist/notification/notification-list-foundation.js +12 -12
- package/dist/overflow-list/foundation.d.ts +4 -4
- package/dist/overflow-list/foundation.js +18 -18
- package/dist/pagination/foundation.d.ts +8 -8
- package/dist/pagination/foundation.js +28 -28
- package/dist/pincode/foundation.d.ts +5 -5
- package/dist/pincode/foundation.js +22 -22
- package/dist/popconfirm/popconfirm-foundation.d.ts +7 -7
- package/dist/popconfirm/popconfirm-foundation.js +26 -26
- package/dist/radio/radio-foundation.d.ts +5 -5
- package/dist/radio/radio-foundation.js +15 -15
- package/dist/radio/radio-group-foundation.d.ts +2 -2
- package/dist/radio/radio-group-foundation.js +9 -9
- package/dist/rating/foundation.d.ts +10 -10
- package/dist/rating/foundation.js +35 -35
- package/dist/resizable/group/index.d.ts +6 -6
- package/dist/resizable/group/index.js +40 -40
- package/dist/resizable/single/index.d.ts +2 -2
- package/dist/resizable/single/index.js +9 -9
- package/dist/scroll-list/item-foundation.d.ts +7 -7
- package/dist/scroll-list/item-foundation.js +35 -35
- package/dist/select/foundation.d.ts +42 -56
- package/dist/select/foundation.js +214 -279
- package/dist/select/option-foundation.d.ts +23 -27
- package/dist/select/option-foundation.js +10 -18
- package/dist/side-sheet/side-sheet-foundation.d.ts +6 -6
- package/dist/side-sheet/side-sheet-foundation.js +22 -22
- package/dist/slider/foundation.d.ts +16 -16
- package/dist/slider/foundation.js +46 -46
- package/dist/sortable/accessibility.d.ts +1 -1
- package/dist/sortable/accessibility.js +2 -2
- package/dist/spin/foundation.d.ts +2 -2
- package/dist/spin/foundation.js +6 -6
- package/dist/steps/utils.d.ts +1 -1
- package/dist/switch/foundation.d.ts +2 -2
- package/dist/switch/foundation.js +7 -7
- package/dist/table/foundation.d.ts +14 -14
- package/dist/table/foundation.js +93 -93
- package/dist/table/utils.d.ts +2 -2
- package/dist/tabs/foundation.d.ts +5 -5
- package/dist/tabs/foundation.js +17 -17
- package/dist/tag-input/foundation.d.ts +11 -11
- package/dist/tag-input/foundation.js +52 -52
- package/dist/time-picker/foundation.d.ts +13 -13
- package/dist/time-picker/foundation.js +39 -39
- package/dist/time-picker/input-foundation.d.ts +4 -4
- package/dist/time-picker/input-foundation.js +13 -13
- package/dist/toast/toast-list-foundation.d.ts +7 -7
- package/dist/toast/toast-list-foundation.js +14 -14
- package/dist/tooltip/foundation.d.ts +9 -9
- package/dist/tooltip/foundation.js +67 -61
- package/dist/transfer/foundation.d.ts +22 -9
- package/dist/transfer/foundation.js +38 -23
- package/dist/tree/foundation.d.ts +14 -14
- package/dist/tree/foundation.js +61 -61
- package/dist/tree/shared.d.ts +1 -1
- package/dist/tree-select/foundation.d.ts +26 -20
- package/dist/tree-select/foundation.js +91 -83
- package/dist/typography/ellipsis.d.ts +4 -4
- package/dist/typography/ellipsis.js +8 -8
- package/dist/typography/format-numeral.d.ts +1 -1
- package/dist/typography/format-numeral.js +2 -2
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +17 -17
- package/dist/upload/foundation.js +92 -92
- package/dist/upload/utils.d.ts +3 -3
- package/dist/upload/utils.js +6 -6
- package/dist/user-guide/foundation.d.ts +3 -3
- package/dist/user-guide/foundation.js +19 -19
- package/dist/utils/a11y.d.ts +1 -1
- package/dist/utils/announcer.d.ts +2 -2
- package/dist/utils/announcer.js +4 -4
- package/dist/utils/focus-handle.d.ts +1 -1
- package/dist/utils/focus-handle.js +1 -2
- package/dist/utils/focus-scope.d.ts +5 -5
- package/dist/utils/focus-scope.js +10 -10
- package/dist/utils/is-promise.d.ts +1 -1
- package/dist/utils/release-holder.d.ts +2 -2
- package/dist/utils/release-holder.js +4 -4
- package/dist/video-player/foundation.d.ts +15 -15
- package/dist/video-player/foundation.js +89 -89
- package/dist/video-player/progress-foundation.d.ts +2 -2
- package/dist/video-player/progress-foundation.js +12 -12
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseFoundation, { DefaultAdapter } from "../base/foundation.js";
|
|
2
2
|
import { isComposing } from "../utils/key-code.js";
|
|
3
|
-
import { BasicOptionProps } from "./option-foundation.js";
|
|
3
|
+
import { BasicOptionProps, OptionRecord } from "./option-foundation.js";
|
|
4
4
|
/** The props the foundation reads with getProps */
|
|
5
5
|
export interface SelectBaseProps {
|
|
6
6
|
allowCreate?: boolean;
|
|
@@ -29,16 +29,19 @@ export interface SelectBaseState {
|
|
|
29
29
|
isFocus: boolean;
|
|
30
30
|
isFullTags: boolean;
|
|
31
31
|
isOpen: boolean;
|
|
32
|
-
options:
|
|
32
|
+
options: OptionRecord[];
|
|
33
|
+
/** The selected options' data by value */
|
|
33
34
|
selections: Map<any, any>;
|
|
34
35
|
showInput: boolean;
|
|
35
36
|
}
|
|
37
|
+
/** The fields the foundation reads from a keydown, so a host framework's own event type also fits */
|
|
38
|
+
export type SelectKeyEvent = Pick<KeyboardEvent, 'key' | 'target' | 'currentTarget' | 'ctrlKey' | 'metaKey' | 'altKey' | 'shiftKey' | 'preventDefault' | 'stopPropagation'> & Parameters<typeof isComposing>[0];
|
|
36
39
|
/** LE is the host's option list scroll event, which the foundation only passes through */
|
|
37
40
|
export interface SelectAdapter<P extends SelectBaseProps = SelectBaseProps, S extends SelectBaseState = SelectBaseState, LE = unknown> extends DefaultAdapter<P, S> {
|
|
38
41
|
updateFocusState(focus: boolean): void;
|
|
39
42
|
focusTrigger(): void;
|
|
40
|
-
getOptionsFromChildren():
|
|
41
|
-
updateOptions(options:
|
|
43
|
+
getOptionsFromChildren(): OptionRecord[];
|
|
44
|
+
updateOptions(options: OptionRecord[]): void;
|
|
42
45
|
updateFocusIndex(index: number): void;
|
|
43
46
|
updateSelection(selection: Map<any, any>): void;
|
|
44
47
|
openMenu(cb?: () => void): void;
|
|
@@ -73,68 +76,51 @@ type PropValue = LabelValue | Record<string, any>;
|
|
|
73
76
|
export default class SelectFoundation<P extends SelectBaseProps = SelectBaseProps, S extends SelectBaseState = SelectBaseState, LE = unknown> extends BaseFoundation<SelectAdapter<P, S, LE>, P, S> {
|
|
74
77
|
#private;
|
|
75
78
|
/** `options` is the host's option list from optionList or the option children */
|
|
76
|
-
static getInitialState(props: SelectBaseProps, options:
|
|
77
|
-
options:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
label?: string | number | unknown;
|
|
81
|
-
children?: unknown;
|
|
82
|
-
disabled?: boolean;
|
|
83
|
-
showTick?: boolean;
|
|
84
|
-
className?: string;
|
|
85
|
-
style?: Record<string, any>;
|
|
86
|
-
} | {
|
|
87
|
-
_show: boolean;
|
|
88
|
-
_selected: boolean;
|
|
89
|
-
value?: string | number;
|
|
90
|
-
label?: string | number | unknown;
|
|
91
|
-
children?: unknown;
|
|
92
|
-
disabled?: boolean;
|
|
93
|
-
showTick?: boolean;
|
|
94
|
-
className?: string;
|
|
95
|
-
style?: Record<string, any>;
|
|
96
|
-
})[];
|
|
79
|
+
static getInitialState(props: SelectBaseProps, options: OptionRecord[]): {
|
|
80
|
+
options: OptionRecord<BasicOptionProps, {
|
|
81
|
+
label?: unknown;
|
|
82
|
+
}>[];
|
|
97
83
|
selections: Map<any, any>;
|
|
98
84
|
focusIndex: number;
|
|
99
85
|
overflowItemCount: number;
|
|
100
86
|
};
|
|
101
87
|
init(): void;
|
|
102
|
-
focus(optionsForOpen?:
|
|
88
|
+
focus: (optionsForOpen?: OptionRecord[], openDropdown?: boolean) => void;
|
|
103
89
|
/** After an update, the host reports whether the options (optionList or children) and value changed by its own change detection */
|
|
104
|
-
handleInputsChange({ optionsChanged, valueChanged }: {
|
|
90
|
+
handleInputsChange: ({ optionsChanged, valueChanged }: {
|
|
105
91
|
optionsChanged: boolean;
|
|
106
92
|
valueChanged: boolean;
|
|
107
|
-
}, value: PropValue)
|
|
108
|
-
handleClick(e: Pick<MouseEvent,
|
|
109
|
-
open(_acInput?: string, originalOptions?:
|
|
110
|
-
handleClickOutside(e: MouseEvent)
|
|
111
|
-
close(closeConfig?: {
|
|
112
|
-
event?:
|
|
93
|
+
}, value: PropValue) => void;
|
|
94
|
+
handleClick: (e: Pick<MouseEvent, "target" | "currentTarget" | "detail">) => void;
|
|
95
|
+
open: (_acInput?: string, originalOptions?: OptionRecord[]) => void;
|
|
96
|
+
handleClickOutside: (e: MouseEvent) => void;
|
|
97
|
+
close: (closeConfig?: {
|
|
98
|
+
event?: unknown;
|
|
113
99
|
closeCb?: () => void;
|
|
114
100
|
notToggleInput?: boolean;
|
|
115
101
|
returnFocus?: boolean;
|
|
116
|
-
})
|
|
117
|
-
onSelect(option:
|
|
118
|
-
clearSelected()
|
|
119
|
-
removeTag(item: BasicOptionProps)
|
|
120
|
-
clearInput(event?:
|
|
121
|
-
handleInputChange(sugInput: string, event: unknown)
|
|
122
|
-
handleKeyDown(event:
|
|
123
|
-
handleContainerKeyDown(event: Pick<KeyboardEvent,
|
|
124
|
-
handleMouseEnter(e:
|
|
125
|
-
handleMouseLeave(e:
|
|
126
|
-
handleClearClick(e?: MouseEvent)
|
|
127
|
-
handleOptionMouseEnter(optionIndex: number)
|
|
128
|
-
handleListScroll(e: LE)
|
|
129
|
-
handleTriggerFocus(e:
|
|
130
|
-
handleTriggerBlur(e:
|
|
131
|
-
handleInputFocus(e:
|
|
132
|
-
handleInputBlur()
|
|
133
|
-
selectAll()
|
|
134
|
-
updateScrollTop()
|
|
135
|
-
updateOverflowItemCount(selectionLength: number, overFlowCount?: number)
|
|
136
|
-
updateIsFullTags()
|
|
137
|
-
handlePopoverClose()
|
|
138
|
-
handleSlotMouseEnter()
|
|
102
|
+
}) => void;
|
|
103
|
+
onSelect: (option: OptionRecord, optionIndex: number, event: unknown) => void;
|
|
104
|
+
clearSelected: () => void;
|
|
105
|
+
removeTag: (item: BasicOptionProps) => void;
|
|
106
|
+
clearInput: (event?: unknown) => void;
|
|
107
|
+
handleInputChange: (sugInput: string, event: unknown) => void;
|
|
108
|
+
handleKeyDown: (event: SelectKeyEvent) => void;
|
|
109
|
+
handleContainerKeyDown: (event: Pick<KeyboardEvent, "key" | "shiftKey" | "preventDefault" | "stopPropagation"> & Parameters<typeof isComposing>[0]) => void;
|
|
110
|
+
handleMouseEnter: (e: unknown) => void;
|
|
111
|
+
handleMouseLeave: (e: unknown) => void;
|
|
112
|
+
handleClearClick: (e?: Pick<MouseEvent, "stopPropagation">) => void;
|
|
113
|
+
handleOptionMouseEnter: (optionIndex: number) => void;
|
|
114
|
+
handleListScroll: (e: LE) => void;
|
|
115
|
+
handleTriggerFocus: (e: unknown) => void;
|
|
116
|
+
handleTriggerBlur: (e: unknown) => void;
|
|
117
|
+
handleInputFocus: (e: unknown) => void;
|
|
118
|
+
handleInputBlur: () => void;
|
|
119
|
+
selectAll: () => void;
|
|
120
|
+
updateScrollTop: () => void;
|
|
121
|
+
updateOverflowItemCount: (selectionLength: number, overFlowCount?: number) => void;
|
|
122
|
+
updateIsFullTags: () => void;
|
|
123
|
+
handlePopoverClose: () => void;
|
|
124
|
+
handleSlotMouseEnter: () => void;
|
|
139
125
|
}
|
|
140
126
|
export {};
|