amotify 0.0.2 → 0.0.4
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/src/@jsminAmotifyExtension/_.d.ts +4 -0
- package/dist/src/@jsminAmotifyExtension/fetch.d.ts +9 -0
- package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +1 -0
- package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +4 -0
- package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
- package/dist/src/@types/_.d.ts +6 -0
- package/dist/src/@types/amot.d.ts +260 -0
- package/dist/src/@types/fn.d.ts +1040 -0
- package/dist/src/@types/index.d.ts +62 -0
- package/dist/src/@types/jsminAmotifyExtension.d.ts +134 -0
- package/dist/src/@types/module.d.ts +2 -0
- package/dist/src/@types/state.d.ts +145 -0
- package/dist/src/Atoms/@export.d.ts +4 -0
- package/dist/src/Atoms/FAIcon/parts.d.ts +2 -0
- package/dist/src/Atoms/Logo/parts.d.ts +1 -0
- package/dist/src/Atoms/Various/parts.d.ts +9 -0
- package/dist/src/Functions/@export.d.ts +12 -0
- package/dist/src/Functions/Button/_.d.ts +1 -0
- package/dist/src/Functions/Cropper/parts.d.ts +1 -0
- package/dist/src/Functions/Effects/Fade.d.ts +1 -0
- package/dist/src/Functions/Effects/Ripple.d.ts +1 -0
- package/dist/src/Functions/Effects/_.d.ts +3 -0
- package/dist/src/Functions/Input/Chips/Selector.d.ts +1 -0
- package/dist/src/Functions/Input/Chips/_.d.ts +2 -0
- package/dist/src/Functions/Input/DigitCharacters.d.ts +1 -0
- package/dist/src/Functions/Input/File/_.d.ts +2 -0
- package/dist/src/Functions/Input/Hidden.d.ts +1 -0
- package/dist/src/Functions/Input/List/_.d.ts +1 -0
- package/dist/src/Functions/Input/Segmented/_.d.ts +1 -0
- package/dist/src/Functions/Input/Select/_.d.ts +1 -0
- package/dist/src/Functions/Input/Slider/_.d.ts +1 -0
- package/dist/src/Functions/Input/Switch/_.d.ts +1 -0
- package/dist/src/Functions/Input/Text.d.ts +5 -0
- package/dist/src/Functions/Input/TextArea.d.ts +1 -0
- package/dist/src/Functions/Input/Time/Picker.d.ts +1 -0
- package/dist/src/Functions/Input/Time/_.d.ts +2 -0
- package/dist/src/Functions/Input/_.d.ts +5 -0
- package/dist/src/Functions/Input/core.d.ts +34 -0
- package/dist/src/Functions/Inputs/_.d.ts +3 -0
- package/dist/src/Functions/Inputs/text.d.ts +12 -0
- package/dist/src/Functions/Layout/PageNotFound.d.ts +1 -0
- package/dist/src/Functions/Layout/PageRouter.d.ts +2 -0
- package/dist/src/Functions/Layout/PageViewController/parts.d.ts +1 -0
- package/dist/src/Functions/Layout/Plate.d.ts +1 -0
- package/dist/src/Functions/Layout/RootViewController/parts.d.ts +1 -0
- package/dist/src/Functions/Layout/SwipeView/parts.d.ts +2 -0
- package/dist/src/Functions/Layout/TabBar.d.ts +1 -0
- package/dist/src/Functions/Layout/_.d.ts +2 -0
- package/dist/src/Functions/Loader/corner.d.ts +1 -0
- package/dist/src/Functions/Loader/mini.d.ts +33 -0
- package/dist/src/Functions/Loader/parts.d.ts +3 -0
- package/dist/src/Functions/Loader/top.d.ts +1 -0
- package/dist/src/Functions/Sheet/parts.d.ts +2 -0
- package/dist/src/Functions/SnackBar/parts.d.ts +2 -0
- package/dist/src/Functions/Table/Data/parts.d.ts +3 -0
- package/dist/src/Functions/Table/Drag/parts.d.ts +1 -0
- package/dist/src/Functions/Table/Normal/parts.d.ts +1 -0
- package/dist/src/Functions/Table/_.d.ts +9 -0
- package/dist/src/Functions/Tooltips/parts.d.ts +2 -0
- package/dist/src/Global/@export.d.ts +12 -0
- package/dist/src/Global/LaunchReactApplication.d.ts +1 -0
- package/dist/src/Global/styleConverter.d.ts +2 -0
- package/dist/src/Molecules/@export.d.ts +21 -0
- package/dist/src/Molecules/Accordion/parts.d.ts +2 -0
- package/dist/src/Molecules/LinkifyText/parts.d.ts +1 -0
- package/dist/src/Molecules/List.d.ts +1 -0
- package/dist/src/Organisms/@export.d.ts +2 -0
- package/dist/src/Organisms/DisplayStyleInput/_.d.ts +1 -0
- package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +1 -0
- package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +27 -0
- package/dist/src/Templates/@export.d.ts +2 -0
- package/dist/src/Templates/PlayGround/parts.d.ts +1 -0
- package/dist/src/config.d.ts +16 -0
- package/dist/src/launch.d.ts +9 -0
- package/dist/src/preload.d.ts +1 -0
- package/package.json +2 -2
- package/src/@jsminAmotifyExtension/_.tsx +4 -0
- package/src/@jsminAmotifyExtension/fetch.tsx +107 -0
- package/src/@jsminAmotifyExtension/formCollect.tsx +89 -0
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +159 -0
- package/src/@jsminAmotifyExtension/variables.tsx +130 -0
- package/src/@styles/@app.scss +4 -0
- package/src/@styles/@variables/customProps.scss +109 -0
- package/src/@styles/@variables/styleSet.scss +38 -0
- package/src/@styles/@variables/themeColor.scss +71 -0
- package/src/@styles/@variables/var.scss +171 -0
- package/src/@styles/UniStyling.scss +996 -0
- package/src/@styles/init.scss +154 -0
- package/src/@types/_.tsx +6 -0
- package/src/@types/amot.tsx +323 -0
- package/src/@types/fn.tsx +1210 -0
- package/src/@types/index.tsx +74 -0
- package/src/@types/jsminAmotifyExtension.tsx +143 -0
- package/src/@types/module.tsx +2 -0
- package/src/@types/state.tsx +199 -0
- package/src/Atoms/@export.tsx +32 -0
- package/src/Atoms/FAIcon/parts.tsx +117 -0
- package/src/Atoms/FAIcon/style.module.scss +9 -0
- package/src/Atoms/Logo/parts.tsx +335 -0
- package/src/Atoms/Logo/style.module.scss +96 -0
- package/src/Atoms/Various/parts.tsx +157 -0
- package/src/Atoms/Various/style.module.scss +40 -0
- package/src/Functions/@export.tsx +29 -0
- package/src/Functions/Button/_.tsx +305 -0
- package/src/Functions/Button/style.module.scss +183 -0
- package/src/Functions/Cropper/parts.tsx +1061 -0
- package/src/Functions/Cropper/style.module.scss +62 -0
- package/src/Functions/Effects/Fade.tsx +81 -0
- package/src/Functions/Effects/Ripple.tsx +141 -0
- package/src/Functions/Effects/_.tsx +33 -0
- package/src/Functions/Effects/style.module.scss +83 -0
- package/src/Functions/Input/Chips/Selector.tsx +451 -0
- package/src/Functions/Input/Chips/_.tsx +286 -0
- package/src/Functions/Input/Chips/style.module.scss +6 -0
- package/src/Functions/Input/DigitCharacters.tsx +241 -0
- package/src/Functions/Input/File/_.tsx +596 -0
- package/src/Functions/Input/File/style.module.scss +34 -0
- package/src/Functions/Input/Hidden.tsx +18 -0
- package/src/Functions/Input/List/_.tsx +383 -0
- package/src/Functions/Input/List/style.module.scss +84 -0
- package/src/Functions/Input/Segmented/_.tsx +238 -0
- package/src/Functions/Input/Segmented/style.module.scss +81 -0
- package/src/Functions/Input/Select/_.tsx +225 -0
- package/src/Functions/Input/Select/style.module.scss +10 -0
- package/src/Functions/Input/Slider/_.tsx +519 -0
- package/src/Functions/Input/Slider/style.module.scss +67 -0
- package/src/Functions/Input/Switch/_.tsx +177 -0
- package/src/Functions/Input/Switch/style.module.scss +18 -0
- package/src/Functions/Input/Text.tsx +437 -0
- package/src/Functions/Input/TextArea.tsx +115 -0
- package/src/Functions/Input/Time/Picker.tsx +950 -0
- package/src/Functions/Input/Time/_.tsx +736 -0
- package/src/Functions/Input/Time/style.module.scss +72 -0
- package/src/Functions/Input/_.tsx +793 -0
- package/src/Functions/Input/core.tsx +461 -0
- package/src/Functions/Input/style.module.scss +43 -0
- package/src/Functions/Inputs/_.tsx +5 -0
- package/src/Functions/Inputs/style.module.scss +15 -0
- package/src/Functions/Inputs/text.tsx +67 -0
- package/src/Functions/Inputs/types.d.ts +1 -0
- package/src/Functions/Layout/PageNotFound.tsx +81 -0
- package/src/Functions/Layout/PageRouter.tsx +107 -0
- package/src/Functions/Layout/PageViewController/parts.tsx +32 -0
- package/src/Functions/Layout/Plate.tsx +30 -0
- package/src/Functions/Layout/RootViewController/parts.tsx +290 -0
- package/src/Functions/Layout/RootViewController/style.module.scss +24 -0
- package/src/Functions/Layout/SwipeView/parts.tsx +380 -0
- package/src/Functions/Layout/SwipeView/style.module.scss +19 -0
- package/src/Functions/Layout/TabBar.tsx +64 -0
- package/src/Functions/Layout/_.tsx +20 -0
- package/src/Functions/Loader/corner.tsx +78 -0
- package/src/Functions/Loader/mini.tsx +117 -0
- package/src/Functions/Loader/parts.tsx +105 -0
- package/src/Functions/Loader/style.module.scss +222 -0
- package/src/Functions/Loader/top.tsx +90 -0
- package/src/Functions/Sheet/parts.tsx +972 -0
- package/src/Functions/Sheet/style.module.scss +235 -0
- package/src/Functions/SnackBar/parts.tsx +215 -0
- package/src/Functions/SnackBar/style.module.scss +25 -0
- package/src/Functions/Table/Data/parts.tsx +955 -0
- package/src/Functions/Table/Drag/parts.tsx +448 -0
- package/src/Functions/Table/Normal/parts.tsx +123 -0
- package/src/Functions/Table/_.tsx +170 -0
- package/src/Functions/Table/style.module.scss +92 -0
- package/src/Functions/Tooltips/parts.tsx +52 -0
- package/src/Global/@export.tsx +138 -0
- package/src/Global/LaunchReactApplication.tsx +30 -0
- package/src/Global/exe.tsx +0 -0
- package/src/Global/styleConverter.tsx +435 -0
- package/src/Molecules/@export.tsx +95 -0
- package/src/Molecules/Accordion/parts.tsx +146 -0
- package/src/Molecules/Accordion/style.module.scss +13 -0
- package/src/Molecules/LinkifyText/parts.tsx +54 -0
- package/src/Molecules/List.tsx +30 -0
- package/src/Organisms/@export.tsx +5 -0
- package/src/Organisms/DisplayStyleInput/_.tsx +18 -0
- package/src/Organisms/DisplayStyleInput/darkmode.tsx +112 -0
- package/src/Organisms/DisplayStyleInput/themeColor.tsx +210 -0
- package/src/Templates/@export.tsx +7 -0
- package/src/Templates/PlayGround/parts.tsx +115 -0
- package/src/Templates/PlayGround/style.module.scss +38 -0
- package/src/config.tsx +132 -0
- package/src/launch.tsx +100 -0
- package/src/preload.tsx +49 -0
- package/tsconfig.json +27 -14
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useStore
|
|
3
|
+
} from '@global';
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
Flex
|
|
7
|
+
} from '@atoms';
|
|
8
|
+
const {
|
|
9
|
+
useState,
|
|
10
|
+
useEffect,
|
|
11
|
+
useRef,
|
|
12
|
+
} = React;
|
|
13
|
+
|
|
14
|
+
import style from './style.module.scss';
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
type SlideEventProps = {
|
|
18
|
+
eventType: 'usr' | 'sys' | 'init' | 'adjustLoop'
|
|
19
|
+
index: number
|
|
20
|
+
}
|
|
21
|
+
type SliderInfoProps = {
|
|
22
|
+
x: number
|
|
23
|
+
y: number
|
|
24
|
+
effectStartAt: number
|
|
25
|
+
process: boolean
|
|
26
|
+
loop: boolean
|
|
27
|
+
id: string
|
|
28
|
+
index: number
|
|
29
|
+
minIndex: number
|
|
30
|
+
maxIndex: number
|
|
31
|
+
width: number
|
|
32
|
+
set_event: React.Dispatch<React.SetStateAction<SlideEventProps>>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const SwipeView = ( params: amotify.fn.Layout.SwipeView.Params ) => {
|
|
36
|
+
return ( <Core
|
|
37
|
+
{ ...params }
|
|
38
|
+
slideIndex={ Math.max( Math.min( params.slideIndex!,params.slides.length - 1 ),0 ) }
|
|
39
|
+
/> );
|
|
40
|
+
}
|
|
41
|
+
export const Core: FNC<amotify.fn.Layout.SwipeView.Params> = ( params ) => {
|
|
42
|
+
let {
|
|
43
|
+
options: {
|
|
44
|
+
onSlideCallback,
|
|
45
|
+
visibilitySurroundSlide = true,
|
|
46
|
+
autoSwipeSeconds = 0,
|
|
47
|
+
loop = false,
|
|
48
|
+
disableMousedrag = false,
|
|
49
|
+
disableTouch = false,
|
|
50
|
+
} = {},
|
|
51
|
+
wrapper = ( slide ) => ( slide ),
|
|
52
|
+
slides = [],
|
|
53
|
+
...others
|
|
54
|
+
} = params;
|
|
55
|
+
|
|
56
|
+
let [ val_swipeID ] = useState( $.uuidGen() );
|
|
57
|
+
let [ val_event,set_event ] = useState( {
|
|
58
|
+
eventType: 'init',
|
|
59
|
+
index: params.slideIndex
|
|
60
|
+
} as SlideEventProps );
|
|
61
|
+
|
|
62
|
+
useEffect( () => {
|
|
63
|
+
useStore.set( {
|
|
64
|
+
key: 'SwipeTimer-' + val_swipeID,
|
|
65
|
+
value: null
|
|
66
|
+
} );
|
|
67
|
+
},[] );
|
|
68
|
+
|
|
69
|
+
const mounted = useRef( false );
|
|
70
|
+
useEffect( () => {
|
|
71
|
+
set_event( {
|
|
72
|
+
eventType: 'usr',
|
|
73
|
+
index: params.slideIndex!
|
|
74
|
+
} );
|
|
75
|
+
|
|
76
|
+
if ( !mounted.current ) mounted.current = true;
|
|
77
|
+
},[ params.slideIndex ] );
|
|
78
|
+
|
|
79
|
+
useEffect( () => {
|
|
80
|
+
let Index = val_event.index + ( loop ? 1 : 0 );
|
|
81
|
+
let CopyIndex = [ -1,slides.length ].includes( val_event.index );
|
|
82
|
+
|
|
83
|
+
if ( !CopyIndex ) if ( onSlideCallback ) setTimeout( () => {
|
|
84
|
+
onSlideCallback!( val_event.index );
|
|
85
|
+
},300 );
|
|
86
|
+
|
|
87
|
+
let Base = $( '#Swiper-' + val_swipeID );
|
|
88
|
+
if ( val_event.eventType == 'adjustLoop' ) {
|
|
89
|
+
Base
|
|
90
|
+
.await( 250 )
|
|
91
|
+
.css( {
|
|
92
|
+
transition: '0s',
|
|
93
|
+
transform: FNs.TrasformString( Index )
|
|
94
|
+
} )
|
|
95
|
+
.children()
|
|
96
|
+
.removeClass( style.Display )
|
|
97
|
+
.parent().children( Index )
|
|
98
|
+
.addClass( [ style.Display,style.LoopAdjusting ] )
|
|
99
|
+
.await( 100 ).removeClass( style.LoopAdjusting );
|
|
100
|
+
} else if ( val_event.eventType == 'sys' ) {
|
|
101
|
+
Base
|
|
102
|
+
.await( 250 )
|
|
103
|
+
.css( {
|
|
104
|
+
transform: FNs.TrasformString( Index )
|
|
105
|
+
} )
|
|
106
|
+
.children()
|
|
107
|
+
.removeClass( style.Display )
|
|
108
|
+
.parent().children( Index )
|
|
109
|
+
.addClass( style.Display );
|
|
110
|
+
} else {
|
|
111
|
+
Base
|
|
112
|
+
.children()
|
|
113
|
+
.removeClass( style.Display )
|
|
114
|
+
.parent().children( Index )
|
|
115
|
+
.addClass( style.Display )
|
|
116
|
+
.parent()
|
|
117
|
+
.css( {
|
|
118
|
+
transition: '0.3s',
|
|
119
|
+
transform: FNs.TrasformString( Index )
|
|
120
|
+
} )
|
|
121
|
+
.await( 250 ).css( { transition: '0s' } );
|
|
122
|
+
|
|
123
|
+
if ( CopyIndex ) {
|
|
124
|
+
let ajastIndex = val_event.index == -1 ? slides.length - 1 : 0;
|
|
125
|
+
set_event( {
|
|
126
|
+
eventType: 'adjustLoop',
|
|
127
|
+
index: ajastIndex
|
|
128
|
+
} );
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if ( autoSwipeSeconds && !CopyIndex ) {
|
|
133
|
+
$.interval.clear( 'SwipeTimer-' + val_swipeID );
|
|
134
|
+
$.interval.standBy(
|
|
135
|
+
'SwipeTimer-' + val_swipeID,
|
|
136
|
+
autoSwipeSeconds - ( val_event.eventType == 'sys' ? 310 : 0 ),
|
|
137
|
+
() => {
|
|
138
|
+
let newIndex = val_event.index + 1;
|
|
139
|
+
|
|
140
|
+
if ( !loop && newIndex > slides.length - 1 ) newIndex = 0;
|
|
141
|
+
|
|
142
|
+
set_event( {
|
|
143
|
+
eventType: 'usr',
|
|
144
|
+
index: newIndex
|
|
145
|
+
} );
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
},[ val_event ] );
|
|
150
|
+
|
|
151
|
+
let Slides = slides.map( ( slide,index ) => <Box
|
|
152
|
+
key={ index }
|
|
153
|
+
flexSizing={ 'none' }
|
|
154
|
+
width={ 1 }
|
|
155
|
+
height={ 0 }
|
|
156
|
+
className={ style.Child }
|
|
157
|
+
children={ wrapper( slide ) }
|
|
158
|
+
/> );
|
|
159
|
+
|
|
160
|
+
if ( loop ) {
|
|
161
|
+
Slides.push( Slides[ 0 ] );
|
|
162
|
+
Slides.unshift( Slides[ Slides.length - 2 ] );
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let info: SliderInfoProps = {
|
|
166
|
+
x: 0,
|
|
167
|
+
y: 0,
|
|
168
|
+
process: false,
|
|
169
|
+
effectStartAt: 0,
|
|
170
|
+
id: val_swipeID,
|
|
171
|
+
loop,
|
|
172
|
+
index: val_event.index,
|
|
173
|
+
minIndex: loop ? -1 : 0,
|
|
174
|
+
maxIndex: slides.length + ( loop ? 1 : -1 ),
|
|
175
|
+
width: 0,
|
|
176
|
+
set_event: set_event
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let Index = val_event.index + ( loop ? 1 : 0 );
|
|
180
|
+
|
|
181
|
+
return ( <Box
|
|
182
|
+
overflow='hidden'
|
|
183
|
+
position='relative'
|
|
184
|
+
{ ...others }
|
|
185
|
+
freeCSS={ {
|
|
186
|
+
zIndex: 1,
|
|
187
|
+
...others.freeCSS
|
|
188
|
+
} }
|
|
189
|
+
data-swipe-id={ val_swipeID }
|
|
190
|
+
onMouseDown={ ( event ) => {
|
|
191
|
+
if ( disableMousedrag ) return;
|
|
192
|
+
if ( event.buttons != 1 ) return;
|
|
193
|
+
FNs.EffectStart( event,info );
|
|
194
|
+
} }
|
|
195
|
+
onTouchStart={ ( event ) => {
|
|
196
|
+
if ( disableTouch ) return;
|
|
197
|
+
if ( event.touches?.length != 1 ) return;
|
|
198
|
+
FNs.EffectStart( event as any,info );
|
|
199
|
+
} }
|
|
200
|
+
>
|
|
201
|
+
<Flex
|
|
202
|
+
flexWrap={ false }
|
|
203
|
+
gap={ 1 }
|
|
204
|
+
transition='long'
|
|
205
|
+
className={ [
|
|
206
|
+
style.Rail,
|
|
207
|
+
style[ 'ShowOther_' + visibilitySurroundSlide ]
|
|
208
|
+
].join( ' ' ) }
|
|
209
|
+
id={ 'Swiper-' + val_swipeID }
|
|
210
|
+
freeCSS={ {
|
|
211
|
+
...!mounted.current ? {
|
|
212
|
+
transform: FNs.TrasformString( Index )
|
|
213
|
+
} : {}
|
|
214
|
+
} }
|
|
215
|
+
children={ Slides }
|
|
216
|
+
/>
|
|
217
|
+
</Box> );
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const FNs = {
|
|
221
|
+
TrasformString: ( Index: number ) => ( `translateX( calc( ${ -100 * Index }% - ${ 12 * ( Index ) }px ) )` ),
|
|
222
|
+
EffectStart: ( event: React.MouseEvent<HTMLDivElement,MouseEvent>,info: SliderInfoProps ) => {
|
|
223
|
+
let {
|
|
224
|
+
x,y
|
|
225
|
+
} = $.getCursor( event as any );
|
|
226
|
+
let eventTarget = event.currentTarget;
|
|
227
|
+
let target = event.target as HTMLElement;
|
|
228
|
+
if ( [ 'SELECT','BUTTON','LABEL','INPUT' ].includes( target.tagName ) ) return;
|
|
229
|
+
|
|
230
|
+
info = {
|
|
231
|
+
...info,
|
|
232
|
+
x: x - info.x + window.scrollX,
|
|
233
|
+
y: y - info.y + window.scrollY,
|
|
234
|
+
effectStartAt: new Date().getTime(),
|
|
235
|
+
width: $( '#Swiper-' + info.id ).position().width
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
let { swipeId } = eventTarget.dataset;
|
|
239
|
+
if ( swipeId == info.id ) {
|
|
240
|
+
$( document )
|
|
241
|
+
.addEvent( {
|
|
242
|
+
eventID: 'SwipeMouseMove',eventType: 'mousemove',
|
|
243
|
+
callback: ( event ) => { FNs.EffectCheck( event,info ); },
|
|
244
|
+
option: { passive: false }
|
|
245
|
+
} )
|
|
246
|
+
.addEvent( {
|
|
247
|
+
eventID: 'SwipeTouchMove',eventType: 'touchmove',
|
|
248
|
+
callback: ( event ) => { FNs.EffectCheck( event,info ); },
|
|
249
|
+
option: { passive: false }
|
|
250
|
+
} )
|
|
251
|
+
.addEvent( {
|
|
252
|
+
eventID: 'SwipeMouseUp',eventType: 'mouseup',
|
|
253
|
+
callback: ( event ) => { FNs.EffectEnd( event,info ); },
|
|
254
|
+
option: { passive: false }
|
|
255
|
+
} )
|
|
256
|
+
.addEvent( {
|
|
257
|
+
eventID: 'SwipeTouchEnd',eventType: 'touchend',
|
|
258
|
+
callback: ( event ) => { FNs.EffectEnd( event,info ); },
|
|
259
|
+
option: { passive: false }
|
|
260
|
+
} );
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
EffectCheck: ( event: any,info: SliderInfoProps ) => {
|
|
264
|
+
if ( info.process ) return;
|
|
265
|
+
let {
|
|
266
|
+
x,y
|
|
267
|
+
} = $.getCursor( event );
|
|
268
|
+
|
|
269
|
+
let X = Math.abs( x - info.x + window.scrollX );
|
|
270
|
+
let Y = Math.abs( y - info.y + window.scrollY );
|
|
271
|
+
|
|
272
|
+
if ( event.touches && event.touches.length > 1 ) return;
|
|
273
|
+
if ( Y + X < 15 ) return;
|
|
274
|
+
if ( Y > X / 2 ) {
|
|
275
|
+
$( document ).removeEvent( [
|
|
276
|
+
'SwipeMouseMove',
|
|
277
|
+
'SwipeTouchMove'
|
|
278
|
+
] );
|
|
279
|
+
} else {
|
|
280
|
+
info.process = true;
|
|
281
|
+
|
|
282
|
+
let Index = info.index + ( info.loop ? 1 : 0 );
|
|
283
|
+
$( '#Swiper-' + info.id ).children( Index - 1 ).addClass( style.Display );
|
|
284
|
+
$( '#Swiper-' + info.id ).children( Index + 1 ).addClass( style.Display );
|
|
285
|
+
|
|
286
|
+
$( document )
|
|
287
|
+
.addEvent( {
|
|
288
|
+
eventID: 'SwipeCheckMouseMove',eventType: 'mousemove',
|
|
289
|
+
callback: ( event ) => { FNs.EffectMove( event,info ); },
|
|
290
|
+
option: { passive: false }
|
|
291
|
+
} )
|
|
292
|
+
.addEvent( {
|
|
293
|
+
eventID: 'SwipeCheckTouchMove',eventType: 'touchmove',
|
|
294
|
+
callback: ( event ) => { FNs.EffectMove( event,info ); },
|
|
295
|
+
option: { passive: false }
|
|
296
|
+
} )
|
|
297
|
+
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
EffectMove: ( event: any,info: SliderInfoProps ) => {
|
|
303
|
+
if ( event.touches && event.touches.length > 1 ) return;
|
|
304
|
+
|
|
305
|
+
let {
|
|
306
|
+
x
|
|
307
|
+
} = $.getCursor( event );
|
|
308
|
+
|
|
309
|
+
let X = x - info.x + window.scrollX;
|
|
310
|
+
|
|
311
|
+
let Index = info.index + ( info.loop ? 1 : 0 );
|
|
312
|
+
let rate = Index - X / info.width;
|
|
313
|
+
|
|
314
|
+
if ( rate < 0 ) {
|
|
315
|
+
rate /= 2;
|
|
316
|
+
} else if ( rate > info.maxIndex ) {
|
|
317
|
+
let excess = rate - info.maxIndex;
|
|
318
|
+
rate = info.maxIndex + excess / 2;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
$( '#Swiper-' + info.id ).css( {
|
|
322
|
+
transition: '0s',
|
|
323
|
+
transform: FNs.TrasformString( rate )
|
|
324
|
+
} );
|
|
325
|
+
|
|
326
|
+
event.preventDefault();
|
|
327
|
+
return;
|
|
328
|
+
},
|
|
329
|
+
EffectEnd: ( event: Event,info: SliderInfoProps ) => {
|
|
330
|
+
if ( info.process ) {
|
|
331
|
+
let cursor = $.getCursor( event );
|
|
332
|
+
let X = cursor.x - info.x + window.scrollX;
|
|
333
|
+
|
|
334
|
+
let current = new Date().getTime();
|
|
335
|
+
|
|
336
|
+
let totalTime = current - info.effectStartAt;
|
|
337
|
+
|
|
338
|
+
let Index = info.index + ( info.loop ? 1 : 0 );
|
|
339
|
+
|
|
340
|
+
let newIndex = 0;
|
|
341
|
+
if ( totalTime < 400 ) {
|
|
342
|
+
newIndex = Index - ( Number( X > 0 ) * 2 - 1 );
|
|
343
|
+
} else {
|
|
344
|
+
newIndex = Math.round( Index - X / info.width );
|
|
345
|
+
}
|
|
346
|
+
newIndex = Math.max( Math.min( newIndex,info.maxIndex ),info.minIndex );
|
|
347
|
+
|
|
348
|
+
info.process = false;
|
|
349
|
+
if ( Index === newIndex ) {
|
|
350
|
+
info.effectStartAt = current;
|
|
351
|
+
|
|
352
|
+
$( '#Swiper-' + info.id )
|
|
353
|
+
.css( {
|
|
354
|
+
transition: '.2s',
|
|
355
|
+
transform: FNs.TrasformString( newIndex )
|
|
356
|
+
} )
|
|
357
|
+
.await( 310 )
|
|
358
|
+
.css( {
|
|
359
|
+
transition: '0s'
|
|
360
|
+
} )
|
|
361
|
+
.children().removeClass( style.Display )
|
|
362
|
+
.parent().children( Index ).addClass( style.Display );
|
|
363
|
+
} else {
|
|
364
|
+
info.set_event( {
|
|
365
|
+
eventType: 'usr',
|
|
366
|
+
index: newIndex + info.minIndex
|
|
367
|
+
} );
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
$( document ).removeEvent( [
|
|
372
|
+
'SwipeMouseMove',
|
|
373
|
+
'SwipeTouchMove',
|
|
374
|
+
'SwipeCheckMouseMove',
|
|
375
|
+
'SwipeCheckTouchMove',
|
|
376
|
+
'SwipeMouseUp',
|
|
377
|
+
'SwipeTouchEnd'
|
|
378
|
+
] );
|
|
379
|
+
}
|
|
380
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@use '@uniVar' as *;
|
|
2
|
+
.Rail {
|
|
3
|
+
&.ShowOther_true {
|
|
4
|
+
> .Child {
|
|
5
|
+
opacity: 100% !important;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
.Child {
|
|
9
|
+
opacity: 0%;
|
|
10
|
+
transition: .3s;
|
|
11
|
+
&.Display {
|
|
12
|
+
opacity: 100%;
|
|
13
|
+
height: auto;
|
|
14
|
+
}
|
|
15
|
+
&.LoopAdjusting {
|
|
16
|
+
transition: 0s !important;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
React,
|
|
3
|
+
} from '@global';
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
Flex
|
|
7
|
+
} from '@atoms';
|
|
8
|
+
import {
|
|
9
|
+
Row
|
|
10
|
+
} from '@mols';
|
|
11
|
+
import {
|
|
12
|
+
Input
|
|
13
|
+
} from '@functions';
|
|
14
|
+
const {
|
|
15
|
+
useEffect,
|
|
16
|
+
useState
|
|
17
|
+
} = React;
|
|
18
|
+
|
|
19
|
+
export const TabBar: FNC<amotify.fn.Layout.TabBar.Params> = ( params ) => {
|
|
20
|
+
let {
|
|
21
|
+
tabIndex,
|
|
22
|
+
tabs,
|
|
23
|
+
onTabChange,
|
|
24
|
+
componentDidMount,
|
|
25
|
+
...others
|
|
26
|
+
} = params;
|
|
27
|
+
|
|
28
|
+
useEffect( () => {
|
|
29
|
+
if ( componentDidMount ) componentDidMount();
|
|
30
|
+
},[] );
|
|
31
|
+
|
|
32
|
+
return ( <Flex
|
|
33
|
+
position='relative'
|
|
34
|
+
overflow={ 'auto' }
|
|
35
|
+
flexWrap={ false }
|
|
36
|
+
{ ...others }
|
|
37
|
+
freeCSS={ {
|
|
38
|
+
zIndex: 3,
|
|
39
|
+
whiteSpace: 'nowrap',
|
|
40
|
+
...others.freeCSS
|
|
41
|
+
} }
|
|
42
|
+
>
|
|
43
|
+
<Box
|
|
44
|
+
margin={ [ 0,'auto' ] }
|
|
45
|
+
>
|
|
46
|
+
<Input.Segmented.BottomLine
|
|
47
|
+
value={ tabIndex }
|
|
48
|
+
fontColor='inherit'
|
|
49
|
+
override='force'
|
|
50
|
+
gap={ 0 }
|
|
51
|
+
options={ tabs.map( ( tab,index ) => {
|
|
52
|
+
return {
|
|
53
|
+
value: index,
|
|
54
|
+
label: tab
|
|
55
|
+
}
|
|
56
|
+
} ) }
|
|
57
|
+
onUpdateValidValue={ ( args ) => {
|
|
58
|
+
let value = args.value[ 0 ];
|
|
59
|
+
if ( onTabChange ) onTabChange( value );
|
|
60
|
+
} }
|
|
61
|
+
/>
|
|
62
|
+
</Box>
|
|
63
|
+
</Flex> );
|
|
64
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SwipeView } from './SwipeView/parts';
|
|
2
|
+
import { PageViewController } from './PageViewController/parts';
|
|
3
|
+
import { TabBar } from './TabBar';
|
|
4
|
+
import { Plate } from './Plate';
|
|
5
|
+
import { PageNotFound } from './PageNotFound';
|
|
6
|
+
import { PageRouter } from './PageRouter';
|
|
7
|
+
|
|
8
|
+
import { RootViewController } from './RootViewController/parts';
|
|
9
|
+
|
|
10
|
+
const Layout: amotify.fn.Layout.Methods = {
|
|
11
|
+
PageViewController,
|
|
12
|
+
TabBar,
|
|
13
|
+
Plate,
|
|
14
|
+
SwipeView,
|
|
15
|
+
PageRouter,
|
|
16
|
+
PageNotFound,
|
|
17
|
+
RootViewController
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { Layout }
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useStore
|
|
3
|
+
} from '@global';
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
Flex
|
|
7
|
+
} from '@atoms';
|
|
8
|
+
import {
|
|
9
|
+
Row
|
|
10
|
+
} from '@mols';
|
|
11
|
+
const {
|
|
12
|
+
useEffect,
|
|
13
|
+
useState,
|
|
14
|
+
} = React;
|
|
15
|
+
|
|
16
|
+
import style from './style.module.scss';
|
|
17
|
+
|
|
18
|
+
import { memoryID } from './parts';
|
|
19
|
+
|
|
20
|
+
export const Corner = () => {
|
|
21
|
+
let [ val_active,set_active ] = useState( false );
|
|
22
|
+
|
|
23
|
+
useEffect( () => {
|
|
24
|
+
useStore.set( {
|
|
25
|
+
key: memoryID + '-corner',
|
|
26
|
+
value: {
|
|
27
|
+
active: () => {
|
|
28
|
+
set_active( true );
|
|
29
|
+
},
|
|
30
|
+
stop: () => {
|
|
31
|
+
set_active( false );
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
} );
|
|
35
|
+
},[] );
|
|
36
|
+
|
|
37
|
+
return <Flex
|
|
38
|
+
className={ [
|
|
39
|
+
style.CornerLoader,
|
|
40
|
+
style[ 'Active_' + val_active ]
|
|
41
|
+
].join( ' ' ) }
|
|
42
|
+
gap={ '1/2' }
|
|
43
|
+
padding={ [ '1/2','3/4' ] }
|
|
44
|
+
borderRadius={ '2/3' }
|
|
45
|
+
backgroundColor='theme'
|
|
46
|
+
position='fixed'
|
|
47
|
+
boxShadow={ 2 }
|
|
48
|
+
right={ 1 }
|
|
49
|
+
bottom={ 1 }
|
|
50
|
+
opacity='trans'
|
|
51
|
+
transition='short'
|
|
52
|
+
freeCSS={ {
|
|
53
|
+
pointerEvents: 'none'
|
|
54
|
+
} }
|
|
55
|
+
>
|
|
56
|
+
<Flex
|
|
57
|
+
className={ style.Wrap }
|
|
58
|
+
flexWrap={ false }
|
|
59
|
+
verticalAlign='center'
|
|
60
|
+
horizontalAlign='center'
|
|
61
|
+
>
|
|
62
|
+
<Box className={ style.Ld4 } />
|
|
63
|
+
<Box className={ style.Ld3 } />
|
|
64
|
+
<Box className={ style.Ld2 } />
|
|
65
|
+
<Box className={ style.Ld1 } />
|
|
66
|
+
<Box className={ style.Ld2 } />
|
|
67
|
+
<Box className={ style.Ld3 } />
|
|
68
|
+
<Box className={ style.Ld4 } />
|
|
69
|
+
</Flex>
|
|
70
|
+
<Box
|
|
71
|
+
fontColor='white'
|
|
72
|
+
fontSize='0.xs'
|
|
73
|
+
isBoldFont
|
|
74
|
+
>
|
|
75
|
+
Loading
|
|
76
|
+
</Box>
|
|
77
|
+
</Flex>;
|
|
78
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useStore
|
|
3
|
+
} from '@global';
|
|
4
|
+
import {
|
|
5
|
+
Row
|
|
6
|
+
} from '@mols';
|
|
7
|
+
const {
|
|
8
|
+
useEffect,
|
|
9
|
+
useState,
|
|
10
|
+
} = React;
|
|
11
|
+
|
|
12
|
+
import style from './style.module.scss';
|
|
13
|
+
|
|
14
|
+
export const Mini = ( params: amotify.fn.Loader.CompInput & {
|
|
15
|
+
color?: amotify.fn.Loader.Colors
|
|
16
|
+
size?: amotify.fn.Loader.Sizes
|
|
17
|
+
} ) => {
|
|
18
|
+
let {
|
|
19
|
+
color = 'theme',
|
|
20
|
+
size = 'R',
|
|
21
|
+
showInitial = false,
|
|
22
|
+
loaderID = '',
|
|
23
|
+
...props
|
|
24
|
+
} = params;
|
|
25
|
+
let [ val_key ] = useState( loaderID );
|
|
26
|
+
let [ val_componentID ] = useState( $.uuidGen() );
|
|
27
|
+
let [ val_active,set_active ] = useState( showInitial );
|
|
28
|
+
|
|
29
|
+
let Size: amotify.UniStyles.Sizes.SizeParams = 0;
|
|
30
|
+
if ( size == 'S' ) {
|
|
31
|
+
Size = 1;
|
|
32
|
+
} else if ( size == 'R' ) {
|
|
33
|
+
Size = 1.5;
|
|
34
|
+
} else if ( size == 'L' ) {
|
|
35
|
+
Size = 3;
|
|
36
|
+
} else if ( size == 'XL' ) {
|
|
37
|
+
Size = 4;
|
|
38
|
+
} else if ( size == 'MAX' ) {
|
|
39
|
+
Size = 6;
|
|
40
|
+
}
|
|
41
|
+
let BorderColor = {
|
|
42
|
+
'theme': 'hsl( var( --color-theme-hsl ) )',
|
|
43
|
+
'posi': 'var( --color-positive )',
|
|
44
|
+
'nega': 'var( --color-negative )',
|
|
45
|
+
'warn': 'var( --color-warning )',
|
|
46
|
+
'cloud': 'hsl( var( --color-layer5-hsl ) )',
|
|
47
|
+
'white': 'white',
|
|
48
|
+
}[ color as 'theme' ];
|
|
49
|
+
|
|
50
|
+
let QuerySelector = '[data-component-id="' + val_componentID + '"]';
|
|
51
|
+
useEffect( () => {
|
|
52
|
+
if ( val_active ) {
|
|
53
|
+
$( QuerySelector )
|
|
54
|
+
.removeClass( style.Hide )
|
|
55
|
+
.await( 10 )
|
|
56
|
+
.addClass( style.Active );
|
|
57
|
+
} else {
|
|
58
|
+
$( QuerySelector )
|
|
59
|
+
.removeClass( style.Active )
|
|
60
|
+
.await( 210 )
|
|
61
|
+
.addClass( style.Hide )
|
|
62
|
+
}
|
|
63
|
+
},[ val_active ] );
|
|
64
|
+
|
|
65
|
+
useEffect( () => {
|
|
66
|
+
useStore.set( {
|
|
67
|
+
key: val_componentID,
|
|
68
|
+
value: {
|
|
69
|
+
active: ( keyCode: string ) => {
|
|
70
|
+
if ( val_key != keyCode ) return;
|
|
71
|
+
set_active( true );
|
|
72
|
+
},
|
|
73
|
+
stop: ( keyCode: string ) => {
|
|
74
|
+
if ( val_key != keyCode ) return;
|
|
75
|
+
set_active( false );
|
|
76
|
+
},
|
|
77
|
+
stopForce: () => {
|
|
78
|
+
set_active( false );
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} );
|
|
82
|
+
},[] );
|
|
83
|
+
|
|
84
|
+
return <Row.Center
|
|
85
|
+
ssSphere={ Size }
|
|
86
|
+
className={ [
|
|
87
|
+
style.MiniLoader,
|
|
88
|
+
showInitial ? '' : style.Hide
|
|
89
|
+
].join( ' ' ) }
|
|
90
|
+
componentID={ val_componentID }
|
|
91
|
+
position='relative'
|
|
92
|
+
{ ...props }
|
|
93
|
+
>
|
|
94
|
+
<svg
|
|
95
|
+
className={ style.SVG1 }
|
|
96
|
+
width="100"
|
|
97
|
+
height="100"
|
|
98
|
+
viewBox="0 0 100 100"
|
|
99
|
+
style={ {
|
|
100
|
+
stroke: BorderColor
|
|
101
|
+
} }
|
|
102
|
+
>
|
|
103
|
+
<circle cx="50" cy="50" r="40" />
|
|
104
|
+
</svg>
|
|
105
|
+
<svg
|
|
106
|
+
className={ style.SVG2 }
|
|
107
|
+
width="100"
|
|
108
|
+
height="100"
|
|
109
|
+
viewBox="0 0 100 100"
|
|
110
|
+
style={ {
|
|
111
|
+
stroke: BorderColor
|
|
112
|
+
} }
|
|
113
|
+
>
|
|
114
|
+
<circle cx="50" cy="50" r="40" />
|
|
115
|
+
</svg>
|
|
116
|
+
</Row.Center>;
|
|
117
|
+
}
|