@fibrae/semi-foundation 0.1.1 → 0.3.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 -4
- package/dist/anchor/foundation.js +21 -22
- package/dist/audio-player/foundation.d.ts +10 -13
- package/dist/audio-player/foundation.js +19 -20
- package/dist/auto-complete/foundation.d.ts +12 -14
- package/dist/auto-complete/foundation.js +51 -52
- package/dist/avatar/foundation.d.ts +5 -6
- package/dist/avatar/foundation.js +16 -16
- package/dist/avatar/variables.scss +0 -1
- package/dist/backtop/foundation.d.ts +2 -5
- package/dist/backtop/foundation.js +7 -8
- package/dist/banner/foundation.d.ts +1 -1
- package/dist/banner/foundation.js +4 -4
- package/dist/base/auto-close-foundation.d.ts +8 -9
- package/dist/base/auto-close-foundation.js +15 -15
- package/dist/base/foundation.d.ts +4 -4
- package/dist/base/foundation.js +12 -11
- package/dist/base/list-store.d.ts +0 -1
- 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.d.ts +0 -10
- package/dist/calendar/event-util.js +1 -11
- package/dist/calendar/foundation.d.ts +1 -6
- package/dist/calendar/foundation.js +5 -9
- package/dist/calendar/month-foundation.d.ts +2 -3
- package/dist/calendar/month-foundation.js +6 -7
- package/dist/carousel/foundation.d.ts +17 -19
- package/dist/carousel/foundation.js +51 -51
- package/dist/cascader/foundation.d.ts +36 -32
- package/dist/cascader/foundation.js +145 -132
- package/dist/cascader/util.d.ts +1 -8
- package/dist/cascader/util.js +1 -8
- package/dist/checkbox/checkbox-foundation.d.ts +3 -7
- package/dist/checkbox/checkbox-foundation.js +15 -17
- package/dist/checkbox/checkbox-group-foundation.d.ts +2 -3
- package/dist/checkbox/checkbox-group-foundation.js +8 -8
- package/dist/code-highlight/index.d.ts +1 -2
- 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-picker.scss +0 -2
- 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/color-picker/interface.d.ts +0 -1
- package/dist/config-provider/breakpoint-observer.d.ts +3 -3
- package/dist/config-provider/breakpoint-observer.js +6 -6
- package/dist/config-provider/responsive-types.d.ts +0 -16
- package/dist/cropper/foundation.d.ts +15 -16
- package/dist/cropper/foundation.js +26 -24
- package/dist/date-picker/_utils/get-default-picker-date.d.ts +0 -3
- package/dist/date-picker/_utils/get-default-picker-date.js +0 -3
- package/dist/date-picker/_utils/get-inset-input-format-token.d.ts +0 -2
- package/dist/date-picker/_utils/get-inset-input-format-token.js +0 -2
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.d.ts +0 -2
- package/dist/date-picker/_utils/get-inset-input-value-from-inset-input-str.js +0 -2
- package/dist/date-picker/_utils/parser.d.ts +0 -3
- package/dist/date-picker/_utils/parser.js +0 -7
- package/dist/date-picker/_utils/picker-type.d.ts +1 -3
- package/dist/date-picker/_utils/picker-type.js +0 -2
- package/dist/date-picker/_utils/to-callback-args.d.ts +0 -1
- package/dist/date-picker/_utils/to-callback-args.js +0 -1
- package/dist/date-picker/date-picker.scss +0 -3
- package/dist/date-picker/foundation.d.ts +39 -58
- package/dist/date-picker/foundation.js +126 -153
- package/dist/date-picker/input-foundation.d.ts +10 -16
- package/dist/date-picker/input-foundation.js +28 -30
- package/dist/date-picker/month-foundation.d.ts +0 -3
- package/dist/date-picker/month-foundation.js +0 -2
- package/dist/date-picker/months-grid-foundation.d.ts +17 -26
- package/dist/date-picker/months-grid-foundation.js +65 -75
- 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 -3
- package/dist/drag-move/foundation.js +15 -13
- package/dist/dropdown/foundation.d.ts +8 -7
- package/dist/dropdown/foundation.js +32 -28
- package/dist/dropdown/menu-foundation.d.ts +1 -2
- package/dist/dropdown/menu-foundation.js +11 -11
- package/dist/feedback/foundation.d.ts +9 -10
- package/dist/feedback/foundation.js +33 -33
- package/dist/feedback/variables.scss +1 -5
- package/dist/float-button/float-button.css +0 -1
- package/dist/float-button/float-button.scss +0 -2
- package/dist/form/form-api-proxy.d.ts +8 -7
- package/dist/form/form-api-proxy.js +25 -25
- package/dist/form/form.scss +0 -12
- package/dist/form/foundation.d.ts +5 -5
- package/dist/form/foundation.js +60 -76
- package/dist/form/interface.d.ts +2 -15
- package/dist/form/utils.d.ts +0 -8
- package/dist/form/utils.js +0 -7
- package/dist/form/variables.scss +1 -4
- package/dist/grid/variables.scss +0 -10
- package/dist/highlight/foundation.d.ts +0 -2
- package/dist/highlight/foundation.js +1 -3
- package/dist/hot-keys/foundation.d.ts +2 -3
- package/dist/hot-keys/foundation.js +5 -5
- package/dist/image/image-foundation.d.ts +4 -6
- package/dist/image/image-foundation.js +10 -10
- package/dist/image/preview-footer-foundation.d.ts +3 -4
- package/dist/image/preview-footer-foundation.js +10 -10
- package/dist/image/preview-foundation.d.ts +0 -3
- package/dist/image/preview-foundation.js +7 -6
- package/dist/image/preview-image-foundation.d.ts +6 -9
- package/dist/image/preview-image-foundation.js +14 -14
- package/dist/image/preview-inner-foundation.d.ts +9 -10
- package/dist/image/preview-inner-foundation.js +38 -38
- package/dist/input/foundation.d.ts +10 -11
- package/dist/input/foundation.js +47 -49
- package/dist/input/text-entry-foundation.d.ts +3 -5
- package/dist/input/text-entry-foundation.js +14 -15
- package/dist/input/textarea-foundation.d.ts +7 -8
- package/dist/input/textarea-foundation.js +36 -36
- package/dist/input-number/caret.d.ts +0 -1
- package/dist/input-number/caret.js +0 -1
- package/dist/input-number/foundation.d.ts +16 -19
- package/dist/input-number/foundation.js +54 -58
- package/dist/json-viewer/foundation.d.ts +8 -10
- package/dist/json-viewer/foundation.js +23 -24
- package/dist/locale/interface.d.ts +0 -3
- package/dist/lottie/foundation.d.ts +1 -1
- package/dist/lottie/foundation.js +4 -4
- package/dist/markdown-render/foundation.d.ts +2 -7
- package/dist/markdown-render/foundation.js +5 -9
- 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 -8
- package/dist/navigation/foundation.js +14 -20
- 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 -4
- package/dist/navigation/sub-nav-foundation.js +17 -17
- package/dist/notification/notification-list-foundation.d.ts +7 -8
- package/dist/notification/notification-list-foundation.js +12 -13
- package/dist/notification/variables.scss +0 -1
- package/dist/overflow-list/foundation.d.ts +4 -6
- package/dist/overflow-list/foundation.js +18 -19
- package/dist/pagination/foundation.d.ts +8 -10
- package/dist/pagination/foundation.js +28 -28
- package/dist/pincode/foundation.d.ts +6 -9
- package/dist/pincode/foundation.js +23 -26
- package/dist/popconfirm/popconfirm-foundation.d.ts +7 -9
- package/dist/popconfirm/popconfirm-foundation.js +26 -26
- package/dist/progress/generates.d.ts +1 -4
- package/dist/progress/generates.js +1 -4
- package/dist/progress/utils.d.ts +1 -1
- package/dist/progress/utils.js +1 -1
- package/dist/radio/radio-foundation.d.ts +5 -9
- package/dist/radio/radio-foundation.js +15 -16
- package/dist/radio/radio-group-foundation.d.ts +2 -3
- package/dist/radio/radio-group-foundation.js +9 -9
- package/dist/rating/foundation.d.ts +10 -15
- package/dist/rating/foundation.js +35 -38
- package/dist/resizable/group/index.d.ts +6 -10
- package/dist/resizable/group/index.js +40 -44
- package/dist/resizable/resizable.scss +0 -1
- package/dist/resizable/single/index.d.ts +3 -7
- package/dist/resizable/single/index.js +10 -13
- package/dist/scroll-list/item-foundation.d.ts +7 -9
- package/dist/scroll-list/item-foundation.js +35 -36
- package/dist/scroll-list/variables.scss +1 -6
- package/dist/select/foundation.d.ts +42 -57
- package/dist/select/foundation.js +214 -279
- package/dist/select/option-foundation.d.ts +23 -28
- package/dist/select/option-foundation.js +10 -19
- package/dist/select/variables.scss +1 -8
- package/dist/side-sheet/side-sheet-foundation.d.ts +7 -12
- package/dist/side-sheet/side-sheet-foundation.js +23 -27
- package/dist/side-sheet/variables.scss +1 -3
- package/dist/slider/foundation.d.ts +17 -28
- package/dist/slider/foundation.js +47 -59
- package/dist/slider/variables.scss +1 -5
- package/dist/sortable/accessibility.d.ts +1 -1
- package/dist/sortable/accessibility.js +2 -2
- package/dist/spin/foundation.d.ts +2 -4
- package/dist/spin/foundation.js +6 -7
- package/dist/spin/variables.scss +1 -3
- package/dist/steps/utils.d.ts +1 -1
- package/dist/switch/foundation.d.ts +2 -3
- package/dist/switch/foundation.js +7 -7
- package/dist/switch/switch.scss +1 -1
- package/dist/switch/variables.scss +1 -5
- package/dist/table/foundation.d.ts +24 -33
- package/dist/table/foundation.js +144 -108
- package/dist/table/table.scss +0 -1
- package/dist/table/utils.d.ts +2 -10
- package/dist/table/utils.js +0 -13
- package/dist/table/variables.scss +1 -5
- package/dist/tabs/foundation.d.ts +5 -14
- package/dist/tabs/foundation.js +17 -21
- package/dist/tabs/tabs.scss +1 -1
- package/dist/tag/focus.js +0 -1
- package/dist/tag-input/foundation.d.ts +11 -13
- package/dist/tag-input/foundation.js +52 -53
- package/dist/tag-input/tag-input.scss +0 -1
- package/dist/tag-input/utils/tag-focus.d.ts +0 -1
- package/dist/tag-input/utils/tag-focus.js +0 -1
- package/dist/time-picker/combox-foundation.d.ts +3 -11
- package/dist/time-picker/combox-foundation.js +3 -10
- package/dist/time-picker/foundation.d.ts +13 -23
- package/dist/time-picker/foundation.js +39 -48
- package/dist/time-picker/input-foundation.d.ts +4 -4
- package/dist/time-picker/input-foundation.js +13 -13
- package/dist/time-picker/utils/index.d.ts +0 -11
- package/dist/time-picker/utils/index.js +0 -11
- package/dist/toast/toast-list-foundation.d.ts +7 -7
- package/dist/toast/toast-list-foundation.js +14 -14
- package/dist/tooltip/adjust-position.d.ts +1 -2
- package/dist/tooltip/constants.d.ts +0 -3
- package/dist/tooltip/constants.js +0 -3
- package/dist/tooltip/foundation.d.ts +9 -12
- package/dist/tooltip/foundation.js +67 -63
- package/dist/tooltip/position.scss +0 -1
- package/dist/transfer/foundation.d.ts +22 -13
- package/dist/transfer/foundation.js +38 -24
- package/dist/tree/foundation.d.ts +14 -16
- package/dist/tree/foundation.js +61 -62
- package/dist/tree/shared.d.ts +2 -4
- package/dist/tree/shared.js +0 -2
- package/dist/tree/tree-util.d.ts +0 -5
- package/dist/tree/tree-util.js +0 -5
- package/dist/tree-select/foundation.d.ts +26 -22
- package/dist/tree-select/foundation.js +91 -86
- package/dist/typography/ellipsis.d.ts +5 -7
- package/dist/typography/ellipsis.js +8 -10
- package/dist/typography/format-numeral.d.ts +1 -1
- package/dist/typography/format-numeral.js +2 -2
- package/dist/typography/typography.scss +0 -1
- package/dist/upload/constants.d.ts +1 -1
- package/dist/upload/foundation.d.ts +17 -23
- package/dist/upload/foundation.js +93 -103
- package/dist/upload/utils.d.ts +3 -8
- package/dist/upload/utils.js +6 -11
- package/dist/user-guide/foundation.d.ts +3 -5
- package/dist/user-guide/foundation.js +19 -19
- package/dist/utils/a11y.d.ts +2 -6
- package/dist/utils/a11y.js +1 -4
- package/dist/utils/announcer.d.ts +2 -2
- package/dist/utils/announcer.js +4 -4
- package/dist/utils/array.d.ts +0 -6
- package/dist/utils/array.js +0 -6
- package/dist/utils/date-fns-extra.js +1 -5
- package/dist/utils/dom.d.ts +0 -1
- package/dist/utils/dom.js +0 -1
- package/dist/utils/escape-html.js +0 -3
- package/dist/utils/field-sizing.d.ts +0 -2
- package/dist/utils/field-sizing.js +0 -2
- package/dist/utils/focus-handle.d.ts +1 -2
- package/dist/utils/focus-handle.js +1 -3
- package/dist/utils/focus-scope.d.ts +5 -6
- package/dist/utils/focus-scope.js +10 -11
- 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/utils/scroll-lock.d.ts +3 -4
- package/dist/utils/scroll-lock.js +3 -4
- package/dist/utils/tween.d.ts +0 -1
- package/dist/utils/tween.js +0 -1
- package/dist/utils/uuid.d.ts +0 -1
- package/dist/utils/uuid.js +0 -1
- package/dist/utils/warning.d.ts +0 -1
- package/dist/utils/warning.js +0 -1
- 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 -3
- package/dist/video-player/progress-foundation.js +12 -13
- package/dist/video-player/variables.scss +1 -1
- package/package.json +2 -2
|
@@ -16,11 +16,11 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
16
16
|
if (this.#interval) {
|
|
17
17
|
clearInterval(this.#interval);
|
|
18
18
|
this.#interval = null;
|
|
19
|
-
this.
|
|
19
|
+
this.adapter.setRotating(false);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
#getActiveIndex() {
|
|
23
|
-
return CarouselFoundation.deriveActiveIndex(this.getProps(), this.getStates(), this.
|
|
23
|
+
return CarouselFoundation.deriveActiveIndex(this.getProps(), this.getStates(), this.adapter.getSlideCount());
|
|
24
24
|
}
|
|
25
25
|
#restartAfterManualSwitch() {
|
|
26
26
|
if (!this.#pausedByHover) this.handleAutoPlay();
|
|
@@ -29,9 +29,9 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
29
29
|
const { isInit } = this.getStates();
|
|
30
30
|
const stateActiveIndex = this.#getActiveIndex();
|
|
31
31
|
if (stateActiveIndex !== activeIndex) {
|
|
32
|
-
if (isInit) this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
32
|
+
if (isInit) this.adapter.setIsInit(false);
|
|
33
|
+
this.adapter.setPreActiveIndex(stateActiveIndex);
|
|
34
|
+
this.adapter.notifyChange(activeIndex, stateActiveIndex);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
#play(interval) {
|
|
@@ -39,7 +39,7 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
39
39
|
this.#interval = setInterval(() => {
|
|
40
40
|
this.next();
|
|
41
41
|
}, interval);
|
|
42
|
-
this.
|
|
42
|
+
this.adapter.setRotating(true);
|
|
43
43
|
}
|
|
44
44
|
#pauseForHover() {
|
|
45
45
|
const { autoPlay } = this.getProps();
|
|
@@ -56,7 +56,7 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
getValidIndex(index) {
|
|
59
|
-
const total = this.
|
|
59
|
+
const total = this.adapter.getSlideCount();
|
|
60
60
|
return total === 0 ? 0 : (index % total + total) % total;
|
|
61
61
|
}
|
|
62
62
|
getSwitchingTime() {
|
|
@@ -66,10 +66,10 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
66
66
|
return speed;
|
|
67
67
|
}
|
|
68
68
|
getIsControlledComponent() {
|
|
69
|
-
return this.
|
|
69
|
+
return this.isControlledComponent("activeIndex");
|
|
70
70
|
}
|
|
71
71
|
handleNewActiveIndex(activeIndex) {
|
|
72
|
-
if (this.#getActiveIndex() !== activeIndex) this.
|
|
72
|
+
if (this.#getActiveIndex() !== activeIndex) this.adapter.setNewActiveIndex(activeIndex);
|
|
73
73
|
}
|
|
74
74
|
static isAutoPlayOn(autoPlay) {
|
|
75
75
|
return autoPlay === true || typeof autoPlay === "object" && autoPlay !== null;
|
|
@@ -84,97 +84,97 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
84
84
|
init() {
|
|
85
85
|
if (!this.getIsControlledComponent()) this.handleAutoPlay();
|
|
86
86
|
}
|
|
87
|
-
setForcePlay(forcePlay) {
|
|
87
|
+
setForcePlay = (forcePlay) => {
|
|
88
88
|
this.#forcePlay = forcePlay;
|
|
89
89
|
if (forcePlay) this.#stoppedByUser = false;
|
|
90
|
-
}
|
|
91
|
-
stopByUser() {
|
|
90
|
+
};
|
|
91
|
+
stopByUser = () => {
|
|
92
92
|
this.#forcePlay = false;
|
|
93
93
|
this.#stoppedByUser = true;
|
|
94
94
|
this.stop();
|
|
95
|
-
}
|
|
96
|
-
stop() {
|
|
95
|
+
};
|
|
96
|
+
stop = () => {
|
|
97
97
|
this.#pausedByHover = false;
|
|
98
98
|
this.#resumeOnFocusLeave = false;
|
|
99
99
|
this.#unregisterInterval();
|
|
100
|
-
}
|
|
101
|
-
handleAutoPlayChange(autoPlayOn) {
|
|
100
|
+
};
|
|
101
|
+
handleAutoPlayChange = (autoPlayOn) => {
|
|
102
102
|
if (!autoPlayOn && !this.#forcePlay) this.stop();
|
|
103
|
-
}
|
|
104
|
-
handlePointerEnter() {
|
|
103
|
+
};
|
|
104
|
+
handlePointerEnter = () => {
|
|
105
105
|
this.#pointerInside = true;
|
|
106
106
|
this.#hoverEnter();
|
|
107
|
-
}
|
|
108
|
-
handlePointerLeave() {
|
|
107
|
+
};
|
|
108
|
+
handlePointerLeave = () => {
|
|
109
109
|
this.#pointerInside = false;
|
|
110
110
|
this.#hoverLeave();
|
|
111
|
-
}
|
|
112
|
-
resetPointer() {
|
|
111
|
+
};
|
|
112
|
+
resetPointer = () => {
|
|
113
113
|
this.#hoverEnter.cancel();
|
|
114
114
|
this.#hoverLeave.cancel();
|
|
115
115
|
this.#pointerInside = false;
|
|
116
|
-
}
|
|
117
|
-
handleSlideCountChange(previous, count) {
|
|
116
|
+
};
|
|
117
|
+
handleSlideCountChange = (previous, count) => {
|
|
118
118
|
if (previous <= 1 && count > 1 && !this.getIsControlledComponent()) {
|
|
119
119
|
this.handleAutoPlay();
|
|
120
120
|
if (this.#pointerInside) this.#pauseForHover();
|
|
121
121
|
}
|
|
122
|
-
}
|
|
123
|
-
handleKeyboardFocus() {
|
|
122
|
+
};
|
|
123
|
+
handleKeyboardFocus = () => {
|
|
124
124
|
this.#keyboardFocusWithin = true;
|
|
125
125
|
if (this.#interval) {
|
|
126
126
|
this.#unregisterInterval();
|
|
127
127
|
this.#resumeOnFocusLeave = true;
|
|
128
128
|
}
|
|
129
|
-
}
|
|
130
|
-
handleFocusLeave() {
|
|
129
|
+
};
|
|
130
|
+
handleFocusLeave = () => {
|
|
131
131
|
this.#keyboardFocusWithin = false;
|
|
132
132
|
if (this.#resumeOnFocusLeave) {
|
|
133
133
|
this.#resumeOnFocusLeave = false;
|
|
134
134
|
this.handleAutoPlay();
|
|
135
135
|
}
|
|
136
|
-
}
|
|
137
|
-
goTo(activeIndex) {
|
|
136
|
+
};
|
|
137
|
+
goTo = (activeIndex) => {
|
|
138
138
|
const stateActiveIndex = this.#getActiveIndex();
|
|
139
139
|
const targetIndex = this.getValidIndex(activeIndex);
|
|
140
|
-
this.
|
|
140
|
+
this.adapter.setIsReverse(stateActiveIndex > targetIndex);
|
|
141
141
|
this.#notifyChange(targetIndex);
|
|
142
142
|
if (!this.getIsControlledComponent()) this.handleNewActiveIndex(targetIndex);
|
|
143
|
-
}
|
|
144
|
-
next() {
|
|
143
|
+
};
|
|
144
|
+
next = () => {
|
|
145
145
|
this.#unregisterInterval();
|
|
146
146
|
const targetIndex = this.getValidIndex(this.#getActiveIndex() + 1);
|
|
147
|
-
this.
|
|
147
|
+
this.adapter.setIsReverse(false);
|
|
148
148
|
this.#notifyChange(targetIndex);
|
|
149
149
|
if (!this.getIsControlledComponent()) this.handleNewActiveIndex(targetIndex);
|
|
150
150
|
this.#restartAfterManualSwitch();
|
|
151
|
-
}
|
|
152
|
-
prev() {
|
|
151
|
+
};
|
|
152
|
+
prev = () => {
|
|
153
153
|
this.#unregisterInterval();
|
|
154
154
|
const targetIndex = this.getValidIndex(this.#getActiveIndex() - 1);
|
|
155
|
-
this.
|
|
155
|
+
this.adapter.setIsReverse(true);
|
|
156
156
|
this.#notifyChange(targetIndex);
|
|
157
157
|
if (!this.getIsControlledComponent()) this.handleNewActiveIndex(targetIndex);
|
|
158
158
|
this.#restartAfterManualSwitch();
|
|
159
|
-
}
|
|
159
|
+
};
|
|
160
160
|
destroy() {
|
|
161
161
|
this.#hoverEnter.cancel();
|
|
162
162
|
this.#hoverLeave.cancel();
|
|
163
163
|
clearInterval(this.#interval);
|
|
164
164
|
this.#interval = null;
|
|
165
165
|
}
|
|
166
|
-
handleAutoPlay() {
|
|
166
|
+
handleAutoPlay = () => {
|
|
167
167
|
const { autoPlay } = this.getProps();
|
|
168
168
|
if (this.#stoppedByUser) return;
|
|
169
169
|
const reduceMotion = !this.#forcePlay && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
170
|
-
if (this.
|
|
170
|
+
if (this.adapter.getSlideCount() > 1 && !reduceMotion && (CarouselFoundation.isAutoPlayOn(autoPlay) || this.#forcePlay)) {
|
|
171
171
|
if (this.#keyboardFocusWithin) this.#resumeOnFocusLeave = true;
|
|
172
172
|
else this.#play(this.getSwitchingTime());
|
|
173
173
|
}
|
|
174
|
-
}
|
|
175
|
-
handleKeyDown(event) {
|
|
174
|
+
};
|
|
175
|
+
handleKeyDown = (event) => {
|
|
176
176
|
if (event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
177
|
-
const isRtl = this.
|
|
177
|
+
const isRtl = this.adapter.getContext("direction") === "rtl";
|
|
178
178
|
switch (event.key) {
|
|
179
179
|
case "ArrowLeft":
|
|
180
180
|
case "ArrowRight":
|
|
@@ -185,20 +185,20 @@ var CarouselFoundation = class CarouselFoundation extends BaseFoundation {
|
|
|
185
185
|
this.goTo(0);
|
|
186
186
|
break;
|
|
187
187
|
case "End":
|
|
188
|
-
this.goTo(this.
|
|
188
|
+
this.goTo(this.adapter.getSlideCount() - 1);
|
|
189
189
|
break;
|
|
190
190
|
default: return false;
|
|
191
191
|
}
|
|
192
192
|
event.preventDefault();
|
|
193
193
|
return true;
|
|
194
|
-
}
|
|
195
|
-
onIndicatorChange(activeIndex) {
|
|
196
|
-
this.
|
|
194
|
+
};
|
|
195
|
+
onIndicatorChange = (activeIndex) => {
|
|
196
|
+
this.adapter.setIsReverse(this.#getActiveIndex() > activeIndex);
|
|
197
197
|
this.#notifyChange(activeIndex);
|
|
198
198
|
if (!this.getIsControlledComponent()) this.handleNewActiveIndex(activeIndex);
|
|
199
|
-
}
|
|
200
|
-
syncActiveIndex(activeIndex) {
|
|
201
|
-
if (activeIndex !== void 0 && activeIndex !== this.getStates().activeIndex) this.
|
|
202
|
-
}
|
|
199
|
+
};
|
|
200
|
+
syncActiveIndex = (activeIndex) => {
|
|
201
|
+
if (activeIndex !== void 0 && activeIndex !== this.getStates().activeIndex) this.adapter.setNewActiveIndex(activeIndex);
|
|
202
|
+
};
|
|
203
203
|
};
|
|
204
204
|
export { CarouselFoundation as default };
|
|
@@ -18,7 +18,6 @@ export interface BasicEntities {
|
|
|
18
18
|
[idx: string]: BasicEntity;
|
|
19
19
|
}
|
|
20
20
|
export interface BasicEntity {
|
|
21
|
-
_notExist?: boolean;
|
|
22
21
|
children?: Array<BasicEntity>;
|
|
23
22
|
data: BasicCascaderData;
|
|
24
23
|
ind: number;
|
|
@@ -134,7 +133,6 @@ export interface BasicCascaderProps {
|
|
|
134
133
|
onBlur?: (e: any) => void;
|
|
135
134
|
onFocus?: (e: any) => void;
|
|
136
135
|
}
|
|
137
|
-
/** The multiple-mode checked sets */
|
|
138
136
|
export interface BasicCheckedState {
|
|
139
137
|
checkedKeys: Set<string>;
|
|
140
138
|
halfCheckedKeys: Set<string>;
|
|
@@ -174,8 +172,8 @@ export interface CascaderAdapter<E = unknown, LE = unknown> extends DefaultAdapt
|
|
|
174
172
|
notifyChange: (value: BasicValue) => void;
|
|
175
173
|
notifySelect: (selected: string | number | Array<string | number>) => void;
|
|
176
174
|
notifyOnSearch: (input: string) => void;
|
|
177
|
-
notifyFocus: (e: E) => void;
|
|
178
|
-
notifyBlur: (e?: E | MouseEvent) => void;
|
|
175
|
+
notifyFocus: (e: E | FocusEvent) => void;
|
|
176
|
+
notifyBlur: (e?: E | MouseEvent | FocusEvent) => void;
|
|
179
177
|
notifyDropdownVisibleChange: (visible: boolean) => void;
|
|
180
178
|
/**
|
|
181
179
|
* Calls `loadData`. `callback` must run after the treeData update it caused is applied, since that update keeps
|
|
@@ -222,7 +220,6 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
|
|
|
222
220
|
static getRealKeys(value: BasicValue, keyEntities: BasicEntities, props: BasicCascaderProps): string[];
|
|
223
221
|
/** Whether a multiple value holds anything to clear, counting the controlled paths treeData lacks */
|
|
224
222
|
static hasMultipleValue(props: BasicCascaderProps, { checkedKeys, keyEntities }: Pick<BasicCascaderInnerData, 'checkedKeys' | 'keyEntities'>): boolean;
|
|
225
|
-
/** Checked, half checked and merged keys for a list of checked keys */
|
|
226
223
|
static calcCheckedState(keys: string[], keyEntities: BasicEntities, { checkRelation, autoMergeValue, leafOnly }: BasicCascaderProps): BasicCheckedState;
|
|
227
224
|
/**
|
|
228
225
|
* The multiple-mode values that follow props: keyEntities, disabledKeys under disableStrictly, and the checked
|
|
@@ -232,13 +229,11 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
|
|
|
232
229
|
*/
|
|
233
230
|
static deriveMultipleState(props: BasicCascaderProps, state: BasicCascaderInnerData): MultipleView;
|
|
234
231
|
static getInitialState(props: BasicCascaderProps): BasicCascaderInnerData;
|
|
235
|
-
/** The flattened search results while searching, otherwise the top level */
|
|
236
232
|
static getRenderData(props: BasicCascaderProps, state: BasicCascaderInnerData): Array<BasicEntity | BasicData>;
|
|
237
|
-
/** Whether an option opens a column: it has children, or loadData may load some */
|
|
238
233
|
static isBranch(data: BasicCascaderData, loadData: unknown): boolean;
|
|
239
234
|
/**
|
|
240
|
-
*
|
|
241
|
-
*
|
|
235
|
+
* An option that is both active and selected shows only as selected, and in multiple mode selection is the
|
|
236
|
+
* checkbox's, so the row is never marked selected.
|
|
242
237
|
*/
|
|
243
238
|
static getTreeItemState(key: string, sets: Record<'activeKeys' | 'selectedKeys' | 'loadedKeys' | 'loadingKeys' | 'checkedKeys' | 'halfCheckedKeys', Set<string>>, multiple: boolean, expandable: boolean): TreeItemState;
|
|
244
239
|
/** `keyboardKey` while its option is shown; hover or a click elsewhere can close its column */
|
|
@@ -247,7 +242,7 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
|
|
|
247
242
|
getStates(): BasicCascaderInnerData;
|
|
248
243
|
getState<K extends keyof BasicCascaderInnerData>(key: K): BasicCascaderInnerData[K];
|
|
249
244
|
init(): void;
|
|
250
|
-
handleKeyDown(e: E & Pick<KeyboardEvent,
|
|
245
|
+
handleKeyDown: (e: E & Pick<KeyboardEvent, "key" | "preventDefault">) => void;
|
|
251
246
|
/**
|
|
252
247
|
* Keys of the open popup (APG combobox with a tree popup, or a listbox while searching); focus stays on the
|
|
253
248
|
* trigger or its search input. Up, Down, Home and End move within the current column or the search results;
|
|
@@ -256,45 +251,54 @@ export default class CascaderFoundation<E = unknown, LE = unknown> extends BaseF
|
|
|
256
251
|
* starting with them (APG tree typeahead). In a search input Space and typed characters edit the text; while
|
|
257
252
|
* searching only Up, Down and Enter navigate. Returns whether the key was used.
|
|
258
253
|
*/
|
|
259
|
-
handleOptionKeyDown(e: E & Pick<KeyboardEvent,
|
|
254
|
+
handleOptionKeyDown: (e: E & Pick<KeyboardEvent, "key" | "ctrlKey" | "metaKey" | "altKey" | "preventDefault">, { editing, rtl }: {
|
|
260
255
|
editing: boolean;
|
|
261
256
|
rtl: boolean;
|
|
262
|
-
})
|
|
257
|
+
}) => boolean;
|
|
263
258
|
/**
|
|
264
259
|
* After an update, the host reports whether the options (treeData or keyMaps) and value changed by its own change
|
|
265
260
|
* detection. Re-collecting the options also re-resolves the value.
|
|
266
261
|
*/
|
|
267
|
-
handleInputsChange({ optionsChanged, valueChanged }: {
|
|
262
|
+
handleInputsChange: ({ optionsChanged, valueChanged }: {
|
|
268
263
|
optionsChanged: boolean;
|
|
269
264
|
valueChanged: boolean;
|
|
270
|
-
}, value: BasicValue)
|
|
271
|
-
open()
|
|
265
|
+
}, value: BasicValue) => void;
|
|
266
|
+
open: () => void;
|
|
272
267
|
/** Mousedown outside the trigger and dropdown while open */
|
|
273
|
-
handleClickOutside(e: MouseEvent)
|
|
274
|
-
|
|
268
|
+
handleClickOutside: (e: MouseEvent) => void;
|
|
269
|
+
/** Focus entered the trigger (its search input, tags, clear button) or the dropdown from outside, by any means */
|
|
270
|
+
handleFocusEnter: (e: E | FocusEvent) => void;
|
|
271
|
+
/**
|
|
272
|
+
* The focus left the trigger and the dropdown (the component checks where it went): reports the blur. An open
|
|
273
|
+
* dropdown closes when the focus went to another element (APG combobox); a window blur has no target and keeps
|
|
274
|
+
* it, as the native select does.
|
|
275
|
+
*/
|
|
276
|
+
handleFocusLeave: (e: FocusEvent) => void;
|
|
277
|
+
/** Closes the dropdown; the focus stays in the component, so no blur */
|
|
278
|
+
close: () => void;
|
|
275
279
|
/** Closes without a blur; called when Vue KeepAlive deactivates the host */
|
|
276
|
-
deactivate()
|
|
277
|
-
focus()
|
|
278
|
-
blur()
|
|
280
|
+
deactivate: () => void;
|
|
281
|
+
focus: () => void;
|
|
282
|
+
blur: () => void;
|
|
279
283
|
/** Leaves search mode after the closed dropdown finishes its exit */
|
|
280
|
-
endSearching()
|
|
284
|
+
endSearching: () => void;
|
|
281
285
|
/** A key that opens the dropdown sets the current option before the list mounts; it is scrolled to once shown */
|
|
282
|
-
handlePopoverOpen()
|
|
283
|
-
handleItemClick(e: E, item: BasicEntity | BasicData)
|
|
284
|
-
handleItemHover(_e: unknown, item: BasicEntity)
|
|
285
|
-
onItemCheckboxClick(item: BasicEntity | BasicData)
|
|
286
|
-
handleClick(e: E & Pick<UIEvent,
|
|
286
|
+
handlePopoverOpen: () => void;
|
|
287
|
+
handleItemClick: (e: E, item: BasicEntity | BasicData) => void;
|
|
288
|
+
handleItemHover: (_e: unknown, item: BasicEntity) => void;
|
|
289
|
+
onItemCheckboxClick: (item: BasicEntity | BasicData) => void;
|
|
290
|
+
handleClick: (e: E & Pick<UIEvent, "detail" | "target" | "currentTarget">) => void;
|
|
287
291
|
/**
|
|
288
292
|
* Enter toggles like a click; Down and Up open a closed popup (APG combobox). Without a search input (select-only
|
|
289
293
|
* combobox) Space also opens it, and Home and End open it on the first and last option of the first column.
|
|
290
294
|
* While open with no current option (handleOptionKeyDown left the key), Space outside a text field acts like
|
|
291
295
|
* Enter, as in Select and TreeSelect. A search input keeps Space, Home and End for its text.
|
|
292
296
|
*/
|
|
293
|
-
handleSelectionKeyDown(keyboardEvent: E & Pick<KeyboardEvent,
|
|
294
|
-
handleInputChange(sugInput: string)
|
|
295
|
-
handleClear()
|
|
296
|
-
handleListScroll(e: LE, ind: number)
|
|
297
|
-
handleTagRemoveByKey(key: string)
|
|
298
|
-
handleTagRemoveInTrigger(pos: string)
|
|
297
|
+
handleSelectionKeyDown: (keyboardEvent: E & Pick<KeyboardEvent, "key" | "preventDefault" | "detail" | "target" | "currentTarget">) => void;
|
|
298
|
+
handleInputChange: (sugInput: string) => void;
|
|
299
|
+
handleClear: () => void;
|
|
300
|
+
handleListScroll: (e: LE, ind: number) => void;
|
|
301
|
+
handleTagRemoveByKey: (key: string) => void;
|
|
302
|
+
handleTagRemoveInTrigger: (pos: string) => void;
|
|
299
303
|
}
|
|
300
304
|
export type { KeyMapProps };
|