amotify 0.0.65 → 0.0.66
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/amotify.js +3 -2
- package/dist/amotify.min.css +2 -2
- package/dist/coreVender.js +14 -2
- package/package.json +10 -10
- package/tsconfig.json +13 -5
- package/@types/_.tsx +0 -7
- package/@types/amot.tsx +0 -355
- package/@types/fn.tsx +0 -1280
- package/@types/jsminAmotifyExtension.tsx +0 -137
- package/@types/module.tsx +0 -1
- package/@types/state.tsx +0 -231
- package/src/@atoms.tsx +0 -34
- package/src/@functions.tsx +0 -29
- package/src/@global.tsx +0 -145
- package/src/@jsminAmotifyExtension/_.tsx +0 -4
- package/src/@jsminAmotifyExtension/fetch.tsx +0 -110
- package/src/@jsminAmotifyExtension/formCollect.tsx +0 -94
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +0 -165
- package/src/@jsminAmotifyExtension/variables.tsx +0 -137
- package/src/@molecules.tsx +0 -96
- package/src/@organisms.tsx +0 -1
- package/src/@reactPacks/reactProduction@18.2.0.js +0 -79
- package/src/@reactPacks/reactRouterDomProduction@18.2.0.js +0 -31
- package/src/@styles/@app.scss +0 -4
- package/src/@styles/UniStyling.scss +0 -1028
- package/src/@styles/init.scss +0 -94
- package/src/@styles/props.scss +0 -109
- package/src/@styles/styleSet.scss +0 -38
- package/src/@styles/themeColor.scss +0 -71
- package/src/@styles/var.scss +0 -182
- package/src/@templates.tsx +0 -7
- package/src/@variables.tsx +0 -74
- package/src/atoms/FAI/parts.tsx +0 -139
- package/src/atoms/Logo/parts.tsx +0 -335
- package/src/atoms/Logo/style.module.scss +0 -96
- package/src/atoms/Various/parts.tsx +0 -159
- package/src/atoms/Various/style.module.scss +0 -46
- package/src/config.tsx +0 -191
- package/src/functions/Button/_.tsx +0 -331
- package/src/functions/Button/style.module.scss +0 -157
- package/src/functions/Cropper/parts.tsx +0 -1084
- package/src/functions/Cropper/style.module.scss +0 -64
- package/src/functions/Effects/Fade.tsx +0 -76
- package/src/functions/Effects/Ripple.tsx +0 -141
- package/src/functions/Effects/_.tsx +0 -33
- package/src/functions/Effects/style.module.scss +0 -91
- package/src/functions/Input/Chips/Selector.tsx +0 -445
- package/src/functions/Input/Chips/_.tsx +0 -289
- package/src/functions/Input/Chips/style.module.scss +0 -6
- package/src/functions/Input/Contenteditable.tsx +0 -114
- package/src/functions/Input/DigitCharacters.tsx +0 -235
- package/src/functions/Input/File/_.tsx +0 -553
- package/src/functions/Input/File/style.module.scss +0 -34
- package/src/functions/Input/Hidden.tsx +0 -21
- package/src/functions/Input/List/_.tsx +0 -383
- package/src/functions/Input/List/style.module.scss +0 -84
- package/src/functions/Input/RichSelect/_.tsx +0 -230
- package/src/functions/Input/RichSelect/style.module.scss +0 -11
- package/src/functions/Input/Segmented/_.tsx +0 -246
- package/src/functions/Input/Segmented/style.module.scss +0 -81
- package/src/functions/Input/Select/_.tsx +0 -218
- package/src/functions/Input/Select/style.module.scss +0 -11
- package/src/functions/Input/Slider/_.tsx +0 -524
- package/src/functions/Input/Slider/style.module.scss +0 -67
- package/src/functions/Input/Switch/_.tsx +0 -176
- package/src/functions/Input/Switch/style.module.scss +0 -18
- package/src/functions/Input/Text.tsx +0 -487
- package/src/functions/Input/TextArea.tsx +0 -109
- package/src/functions/Input/Time/Picker.tsx +0 -1361
- package/src/functions/Input/Time/_.tsx +0 -749
- package/src/functions/Input/Time/style.module.scss +0 -79
- package/src/functions/Input/_.tsx +0 -881
- package/src/functions/Input/core.tsx +0 -473
- package/src/functions/Input/style.module.scss +0 -102
- package/src/functions/Inputs/_.tsx +0 -5
- package/src/functions/Inputs/style.module.scss +0 -15
- package/src/functions/Inputs/text.tsx +0 -53
- package/src/functions/Inputs/types.d.ts +0 -13
- package/src/functions/Layout/PageNotFound.tsx +0 -78
- package/src/functions/Layout/PageRouter.tsx +0 -89
- package/src/functions/Layout/PageViewController/parts.tsx +0 -27
- package/src/functions/Layout/Plate.tsx +0 -30
- package/src/functions/Layout/RootViewController/parts.tsx +0 -300
- package/src/functions/Layout/RootViewController/style.module.scss +0 -23
- package/src/functions/Layout/SwipeView/parts.tsx +0 -375
- package/src/functions/Layout/SwipeView/style.module.scss +0 -20
- package/src/functions/Layout/TabBar.tsx +0 -60
- package/src/functions/Layout/_.tsx +0 -20
- package/src/functions/Loader/corner.tsx +0 -74
- package/src/functions/Loader/mini.tsx +0 -114
- package/src/functions/Loader/parts.tsx +0 -103
- package/src/functions/Loader/style.module.scss +0 -223
- package/src/functions/Loader/top.tsx +0 -84
- package/src/functions/Sheet/parts.tsx +0 -994
- package/src/functions/Sheet/style.module.scss +0 -208
- package/src/functions/SnackBar/parts.tsx +0 -215
- package/src/functions/SnackBar/style.module.scss +0 -25
- package/src/functions/Table/Data/parts.tsx +0 -965
- package/src/functions/Table/Drag/parts.tsx +0 -442
- package/src/functions/Table/Normal/parts.tsx +0 -124
- package/src/functions/Table/_.tsx +0 -177
- package/src/functions/Table/style.module.scss +0 -93
- package/src/functions/Tooltips/parts.tsx +0 -53
- package/src/global/LaunchReactApplication.tsx +0 -40
- package/src/global/styleConverter.tsx +0 -465
- package/src/launch.tsx +0 -117
- package/src/molecules/Accordion/parts.tsx +0 -146
- package/src/molecules/Accordion/style.module.scss +0 -13
- package/src/molecules/LinkifyText/parts.tsx +0 -52
- package/src/molecules/List.tsx +0 -31
- package/src/preload.tsx +0 -31
- package/src/templates/PlayGround/parts.tsx +0 -96
- package/src/templates/PlayGround/style.module.scss +0 -38
- package/webpack.config.js +0 -146
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
React
|
|
3
|
-
} from '@global'
|
|
4
|
-
|
|
5
|
-
import { ListInputs } from '../_'
|
|
6
|
-
|
|
7
|
-
import style from './style.module.scss'
|
|
8
|
-
|
|
9
|
-
export const Segmented: amotify.fn.Input.Segmented.Types = {
|
|
10
|
-
Auto: ( params ) => {
|
|
11
|
-
params = { ...params }
|
|
12
|
-
params = {
|
|
13
|
-
padding: '1/3',
|
|
14
|
-
gap: '1/3',
|
|
15
|
-
ssCardBox: true,
|
|
16
|
-
...params,
|
|
17
|
-
cellStyles: {
|
|
18
|
-
borderRadius: 'inherit',
|
|
19
|
-
position: 'relative',
|
|
20
|
-
...params.cellStyles
|
|
21
|
-
},
|
|
22
|
-
cellCheckedStyles: {
|
|
23
|
-
backgroundColor: 'theme',
|
|
24
|
-
fontColor: 'white',
|
|
25
|
-
...params.cellCheckedStyles
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return <Core appearance={ ( params as any ).tone || 'Auto' } { ...params } />
|
|
30
|
-
},
|
|
31
|
-
Normal: ( params ) => {
|
|
32
|
-
params = { ...params }
|
|
33
|
-
params = {
|
|
34
|
-
border: true,
|
|
35
|
-
borderColor: 'theme',
|
|
36
|
-
overflow: 'hidden',
|
|
37
|
-
gap: 0,
|
|
38
|
-
ssLastChildLossBorder: 'right',
|
|
39
|
-
fontColor: '3.blur',
|
|
40
|
-
...params,
|
|
41
|
-
cellStyles: {
|
|
42
|
-
borderRadius: 0,
|
|
43
|
-
borderRight: true,
|
|
44
|
-
borderColor: 'theme',
|
|
45
|
-
...params.cellStyles
|
|
46
|
-
},
|
|
47
|
-
cellCheckedStyles: {
|
|
48
|
-
backgroundColor: 'theme',
|
|
49
|
-
fontColor: 'white',
|
|
50
|
-
...params.cellCheckedStyles
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
( params as any ).tone = 'ThemeBorder'
|
|
54
|
-
|
|
55
|
-
return <Core appearance={ 'Border' } { ...params } />
|
|
56
|
-
},
|
|
57
|
-
Cloud: ( params ) => {
|
|
58
|
-
params = { ...params }
|
|
59
|
-
params = {
|
|
60
|
-
padding: '1/3',
|
|
61
|
-
gap: '1/3',
|
|
62
|
-
backgroundColor: 'cloud',
|
|
63
|
-
...params,
|
|
64
|
-
cellStyles: {
|
|
65
|
-
borderRadius: 'inherit',
|
|
66
|
-
position: 'relative',
|
|
67
|
-
...params.cellStyles
|
|
68
|
-
},
|
|
69
|
-
cellCheckedStyles: {
|
|
70
|
-
backgroundColor: 'theme',
|
|
71
|
-
fontColor: 'white',
|
|
72
|
-
...params.cellCheckedStyles
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return <Core appearance={ ( params as any ).tone || 'Cloud' } { ...params } />
|
|
77
|
-
},
|
|
78
|
-
Cloud2: ( params ) => {
|
|
79
|
-
params = { ...params };
|
|
80
|
-
( params as any ).tone = 'WhiteCloud'
|
|
81
|
-
return <Segmented.Cloud
|
|
82
|
-
fontColor='3.blur'
|
|
83
|
-
{ ...params }
|
|
84
|
-
cellCheckedStyles={ {
|
|
85
|
-
fontColor: '1.clear',
|
|
86
|
-
...params.cellCheckedStyles
|
|
87
|
-
} }
|
|
88
|
-
/>
|
|
89
|
-
},
|
|
90
|
-
Cloud3: ( params ) => {
|
|
91
|
-
params = { ...params };
|
|
92
|
-
( params as any ).tone = 'ThemeCloud'
|
|
93
|
-
return <Segmented.Cloud
|
|
94
|
-
backgroundColor='tcOpFew'
|
|
95
|
-
fontColor='theme'
|
|
96
|
-
{ ...params }
|
|
97
|
-
cellStyles={ {
|
|
98
|
-
...params.cellStyles
|
|
99
|
-
} }
|
|
100
|
-
/>
|
|
101
|
-
},
|
|
102
|
-
Border: ( params ) => {
|
|
103
|
-
params = { ...params }
|
|
104
|
-
params = {
|
|
105
|
-
backgroundColor: '1.layer.base',
|
|
106
|
-
border: '2.normal',
|
|
107
|
-
overflow: 'hidden',
|
|
108
|
-
gap: 0,
|
|
109
|
-
ssLastChildLossBorder: 'right',
|
|
110
|
-
boxShadow: '0.thin',
|
|
111
|
-
...params,
|
|
112
|
-
cellStyles: {
|
|
113
|
-
borderRadius: 0,
|
|
114
|
-
borderRight: '2.normal',
|
|
115
|
-
...params.cellStyles
|
|
116
|
-
},
|
|
117
|
-
cellCheckedStyles: {
|
|
118
|
-
backgroundColor: 'tcOpFew',
|
|
119
|
-
fontColor: 'theme',
|
|
120
|
-
...params.cellCheckedStyles
|
|
121
|
-
},
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return <Core appearance={ ( params as any ).tone || 'Border' } { ...params } />
|
|
125
|
-
},
|
|
126
|
-
Border2: ( params ) => {
|
|
127
|
-
params = { ...params }
|
|
128
|
-
params = {
|
|
129
|
-
border: true,
|
|
130
|
-
borderColor: 'theme',
|
|
131
|
-
overflow: 'hidden',
|
|
132
|
-
gap: 0,
|
|
133
|
-
ssLastChildLossBorder: 'right',
|
|
134
|
-
boxShadow: '0.thin',
|
|
135
|
-
fontColor: '3.blur',
|
|
136
|
-
...params,
|
|
137
|
-
cellStyles: {
|
|
138
|
-
borderRadius: 0,
|
|
139
|
-
borderRight: true,
|
|
140
|
-
borderColor: 'theme',
|
|
141
|
-
...params.cellStyles
|
|
142
|
-
},
|
|
143
|
-
cellCheckedStyles: {
|
|
144
|
-
backgroundColor: 'theme',
|
|
145
|
-
fontColor: 'white',
|
|
146
|
-
...params.cellCheckedStyles
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
( params as any ).tone = 'ThemeBorder'
|
|
150
|
-
|
|
151
|
-
return <Core appearance={ 'Border' } { ...params } />
|
|
152
|
-
},
|
|
153
|
-
BottomLine: ( params ) => {
|
|
154
|
-
params = { ...params }
|
|
155
|
-
params = {
|
|
156
|
-
gap: 0,
|
|
157
|
-
fontColor: '3.blur',
|
|
158
|
-
...params,
|
|
159
|
-
cellStyles: {
|
|
160
|
-
ssEffectsOnActive: 'ripple.theme',
|
|
161
|
-
borderRadius: 0,
|
|
162
|
-
padding: 1,
|
|
163
|
-
...params.cellStyles
|
|
164
|
-
},
|
|
165
|
-
cellCheckedStyles: {
|
|
166
|
-
fontColor: 'theme',
|
|
167
|
-
...params.cellCheckedStyles
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return <Core appearance={ 'BottomLine' } { ...params } />
|
|
172
|
-
},
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
type CoreParams = amotify.fn.Input.Segmented.Params & {
|
|
176
|
-
appearance: amotify.fn.Input.Segmented.Tones
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const Core: React.FC<CoreParams> = ( params ) => {
|
|
180
|
-
let {
|
|
181
|
-
tone,
|
|
182
|
-
appearance,
|
|
183
|
-
value,
|
|
184
|
-
options,
|
|
185
|
-
onUpdateValue,onUpdateValidValue,
|
|
186
|
-
freeCSS,
|
|
187
|
-
cellStyles,
|
|
188
|
-
cellClassName,
|
|
189
|
-
cellCheckedClassName,
|
|
190
|
-
cellCheckedStyles,
|
|
191
|
-
...others
|
|
192
|
-
} = params
|
|
193
|
-
|
|
194
|
-
let [ val_componentID ] = React.useState( $.uuidGen() )
|
|
195
|
-
|
|
196
|
-
let [ val_defValue,set_defValue ] = React.useState( value )
|
|
197
|
-
let [ val_value,set_value ] = React.useState( val_defValue )
|
|
198
|
-
if ( val_defValue != value ) {
|
|
199
|
-
set_defValue( value )
|
|
200
|
-
set_value( value )
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return <ListInputs.Radio
|
|
204
|
-
// hideInput
|
|
205
|
-
defaultActiveStyling={ false }
|
|
206
|
-
flexWrap={ false }
|
|
207
|
-
borderRadius={ '2.tone.secondary' }
|
|
208
|
-
position='relative'
|
|
209
|
-
options={ options }
|
|
210
|
-
value={ val_value }
|
|
211
|
-
componentID={ val_componentID }
|
|
212
|
-
icon={ false }
|
|
213
|
-
{ ...others }
|
|
214
|
-
freeCSS={ {
|
|
215
|
-
whiteSpace: 'nowrap',
|
|
216
|
-
...freeCSS
|
|
217
|
-
} }
|
|
218
|
-
cellStyles={ {
|
|
219
|
-
flexCenter: true,
|
|
220
|
-
ssPushable: true,
|
|
221
|
-
boxShadow: 'none',
|
|
222
|
-
...cellStyles
|
|
223
|
-
} }
|
|
224
|
-
cellClassName={ [
|
|
225
|
-
cellClassName,
|
|
226
|
-
style.Label,
|
|
227
|
-
style[ 'Tone_' + appearance ]
|
|
228
|
-
].join( ' ' ) }
|
|
229
|
-
cellCheckedStyles={ {
|
|
230
|
-
isSemiBoldFont: true,
|
|
231
|
-
...cellCheckedStyles,
|
|
232
|
-
} }
|
|
233
|
-
cellCheckedClassName={ [
|
|
234
|
-
cellCheckedClassName,
|
|
235
|
-
style.Checked
|
|
236
|
-
].join( ' ' ) }
|
|
237
|
-
tone={ 'custom' as any }
|
|
238
|
-
onUpdateValue={ onUpdateValue }
|
|
239
|
-
onUpdateValidValue={ ( args ) => {
|
|
240
|
-
if ( onUpdateValidValue ) onUpdateValidValue( args )
|
|
241
|
-
if ( appearance == 'BottomLine' ) {
|
|
242
|
-
set_value( args.value[ 0 ] )
|
|
243
|
-
}
|
|
244
|
-
} }
|
|
245
|
-
/>
|
|
246
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
@use '@props' as *;
|
|
2
|
-
@use'@styleSet' as *;
|
|
3
|
-
.Label {
|
|
4
|
-
user-select: none;
|
|
5
|
-
-webkit-user-select: none;
|
|
6
|
-
flex: auto;
|
|
7
|
-
&.Tone_ {
|
|
8
|
-
&Auto, &Cloud, &ThemeCloud, &WhiteCloud {
|
|
9
|
-
&:before {
|
|
10
|
-
transform: scale(0.4);
|
|
11
|
-
@include absoluteCovered();
|
|
12
|
-
background-color: $color-theme;
|
|
13
|
-
opacity: 0;
|
|
14
|
-
border-radius: inherit;
|
|
15
|
-
box-shadow: $shadow1;
|
|
16
|
-
transition: $animation-time-middle;
|
|
17
|
-
}
|
|
18
|
-
&.Checked {
|
|
19
|
-
&:before {
|
|
20
|
-
transform: scale(1);
|
|
21
|
-
opacity: 1;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
&WhiteCloud {
|
|
26
|
-
&:before {
|
|
27
|
-
background-color: $color-layer1;
|
|
28
|
-
}
|
|
29
|
-
&.Checked {
|
|
30
|
-
background-color: $color-layer1 !important;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
&ThemeCloud {
|
|
34
|
-
&.Checked {
|
|
35
|
-
background-color: $color-theme;
|
|
36
|
-
&:focus, &:active {
|
|
37
|
-
background-color: $color-theme !important;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
&Border {}
|
|
42
|
-
&ThemeBorder {
|
|
43
|
-
&.Checked {
|
|
44
|
-
background-color: $color-theme;
|
|
45
|
-
&:focus, &:active {
|
|
46
|
-
background-color: $color-theme !important;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
&BottomLine {
|
|
51
|
-
&:after {
|
|
52
|
-
content: "";
|
|
53
|
-
position: absolute;
|
|
54
|
-
bottom: 0;
|
|
55
|
-
left: 0;
|
|
56
|
-
right: 0;
|
|
57
|
-
height: $unit1_3;
|
|
58
|
-
background-color: $color-theme;
|
|
59
|
-
opacity: 0;
|
|
60
|
-
border-radius: 100rem;
|
|
61
|
-
transition: $animation-time-middle;
|
|
62
|
-
}
|
|
63
|
-
&:hover, &:focus {
|
|
64
|
-
background-color: $color-theme-opacity-few;
|
|
65
|
-
color: $color-theme;
|
|
66
|
-
&:after {
|
|
67
|
-
opacity: .2;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
&:active {
|
|
71
|
-
background-color: $color-theme-opacity-few;
|
|
72
|
-
&:after {
|
|
73
|
-
opacity: .4;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
&.Checked:after {
|
|
77
|
-
opacity: 1;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
React,
|
|
3
|
-
} from '@global'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Box
|
|
7
|
-
} from '@atoms'
|
|
8
|
-
import {
|
|
9
|
-
BoxWrapper,
|
|
10
|
-
SubmitForm,
|
|
11
|
-
ValidationCheck,
|
|
12
|
-
CommonEffects
|
|
13
|
-
} from '../core'
|
|
14
|
-
import {
|
|
15
|
-
Buttons
|
|
16
|
-
} from '@fn'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import style from './style.module.scss'
|
|
20
|
-
import coreStyle from '../style.module.scss'
|
|
21
|
-
|
|
22
|
-
function DefaultValidation( props: {
|
|
23
|
-
value: any
|
|
24
|
-
params: any
|
|
25
|
-
} ): amotify.fn.Input.Validation.Result {
|
|
26
|
-
let {
|
|
27
|
-
value,
|
|
28
|
-
params
|
|
29
|
-
} = props
|
|
30
|
-
let {
|
|
31
|
-
required,
|
|
32
|
-
options
|
|
33
|
-
} = params as amotify.fn.Input.Select.PlainParams
|
|
34
|
-
let notice: amotify.fn.Input.Validation.NoticeTypes[] = []
|
|
35
|
-
|
|
36
|
-
if ( required ) {
|
|
37
|
-
if ( !options.length || ( options.length && $.is.nullish( JSON.parse( value ) ) ) ) {
|
|
38
|
-
notice.push( { type: 'invalid',label: '必須項目です' } )
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
ok: !notice.filter( ( { type } ) => type == 'invalid' ).length,
|
|
44
|
-
notice: notice
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const SelectInput: React.FC<amotify.fn.Input.Select.PlainParams> = ( params ) => {
|
|
49
|
-
let {
|
|
50
|
-
value = null,
|
|
51
|
-
placeholder,
|
|
52
|
-
options = []
|
|
53
|
-
} = params
|
|
54
|
-
|
|
55
|
-
let SelectedExist = 0
|
|
56
|
-
let SelectedValue = JSON.stringify( value )
|
|
57
|
-
let DefaultOptions = options.map( ( option ) => {
|
|
58
|
-
let { value,label } = option
|
|
59
|
-
let Value = JSON.stringify( value )
|
|
60
|
-
let Selected = Value == SelectedValue
|
|
61
|
-
SelectedExist |= Number( Selected )
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
...option,
|
|
65
|
-
value: Value,
|
|
66
|
-
label
|
|
67
|
-
}
|
|
68
|
-
} )
|
|
69
|
-
if ( !SelectedExist ) value = null
|
|
70
|
-
let DefaultValue = JSON.stringify( value )
|
|
71
|
-
|
|
72
|
-
return <Core
|
|
73
|
-
{ ...params }
|
|
74
|
-
value={ DefaultValue }
|
|
75
|
-
options={ DefaultOptions }
|
|
76
|
-
/>
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const Core: React.FC<amotify.fn.Input.Select.PlainParams> = ( params ) => {
|
|
80
|
-
let {
|
|
81
|
-
tone,
|
|
82
|
-
required,
|
|
83
|
-
form,
|
|
84
|
-
className,
|
|
85
|
-
|
|
86
|
-
enableFormSubmit,
|
|
87
|
-
enableUnSelected,
|
|
88
|
-
|
|
89
|
-
checkValidationAtFirst,
|
|
90
|
-
onChange,onKeyDown,
|
|
91
|
-
onValidate,
|
|
92
|
-
onUpdateValue,
|
|
93
|
-
onUpdateValidValue,
|
|
94
|
-
value = '',
|
|
95
|
-
options,
|
|
96
|
-
placeholder,
|
|
97
|
-
|
|
98
|
-
leftIndicator,rightIndicator,leftIcon,rightIcon,
|
|
99
|
-
componentID,status_id,
|
|
100
|
-
|
|
101
|
-
...others
|
|
102
|
-
} = params
|
|
103
|
-
|
|
104
|
-
let Default_Status: amotify.fn.Input.Status.Plain = {
|
|
105
|
-
componentID: params.componentID || '',
|
|
106
|
-
dataValue: value,
|
|
107
|
-
eventType: 'init',
|
|
108
|
-
eventID: $.uuidGen()
|
|
109
|
-
}
|
|
110
|
-
let [ val_status,set_status ] = React.useState( Default_Status )
|
|
111
|
-
let [ val_validate,set_validate ] = React.useState( {
|
|
112
|
-
ok: false,
|
|
113
|
-
notice: []
|
|
114
|
-
} as amotify.fn.Input.Validation.Result )
|
|
115
|
-
|
|
116
|
-
CommonEffects( {
|
|
117
|
-
type: 'select',
|
|
118
|
-
params,
|
|
119
|
-
val_status,
|
|
120
|
-
set_status,
|
|
121
|
-
ExtraOverrideParams: {
|
|
122
|
-
dataValue: value,
|
|
123
|
-
formatValue: value,
|
|
124
|
-
},
|
|
125
|
-
val_validate,
|
|
126
|
-
set_validate,
|
|
127
|
-
DefaultValidation,
|
|
128
|
-
onUpdateValue,
|
|
129
|
-
onUpdateValidValue
|
|
130
|
-
} )
|
|
131
|
-
|
|
132
|
-
let SelectedElement: ReactElement = <Box fontColor='4.thin' textAlign='left'>{ placeholder || '選択' }</Box>
|
|
133
|
-
if ( val_status.dataValue ) {
|
|
134
|
-
let Selected = options.find( ( option ) => option.value == val_status.dataValue )
|
|
135
|
-
if ( Selected ) SelectedElement = Selected.displayLabel ?? Selected.label
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return <BoxWrapper
|
|
139
|
-
val_status={ val_status }
|
|
140
|
-
set_status={ set_status }
|
|
141
|
-
val_validate={ val_validate }
|
|
142
|
-
params={ params }
|
|
143
|
-
>
|
|
144
|
-
<Box
|
|
145
|
-
className={ [
|
|
146
|
-
className,
|
|
147
|
-
style.SelectLegend,
|
|
148
|
-
coreStyle.InputCover
|
|
149
|
-
].join( ' ' ) }
|
|
150
|
-
>
|
|
151
|
-
{ SelectedElement }
|
|
152
|
-
<select
|
|
153
|
-
data-form={ form }
|
|
154
|
-
data-input-type={ 'select' }
|
|
155
|
-
data-validation={ val_validate.ok }
|
|
156
|
-
data-component-id={ val_status.componentID }
|
|
157
|
-
data-value={ val_status.dataValue }
|
|
158
|
-
value={ val_status.dataValue }
|
|
159
|
-
onKeyDown={ ( event ) => {
|
|
160
|
-
if ( onKeyDown ) onKeyDown( event )
|
|
161
|
-
if ( enableFormSubmit ) SubmitForm( event )
|
|
162
|
-
} }
|
|
163
|
-
onChange={ ( event ) => {
|
|
164
|
-
let {
|
|
165
|
-
value: rawValue
|
|
166
|
-
} = event.target
|
|
167
|
-
|
|
168
|
-
if ( val_validate.ok ) set_validate( { ok: false,notice: [] } )
|
|
169
|
-
set_status( {
|
|
170
|
-
...val_status,
|
|
171
|
-
dataValue: rawValue,
|
|
172
|
-
eventType: 'update',
|
|
173
|
-
eventID: $.uuidGen(),
|
|
174
|
-
} )
|
|
175
|
-
|
|
176
|
-
if ( onChange ) onChange( event )
|
|
177
|
-
} }
|
|
178
|
-
{ ...others as any }
|
|
179
|
-
className={ style.Select }
|
|
180
|
-
>
|
|
181
|
-
<Options params={ params } />
|
|
182
|
-
</select>
|
|
183
|
-
</Box>
|
|
184
|
-
</BoxWrapper>
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const Options: React.FC<{ params: amotify.fn.Input.Select.PlainParams }> = ( props ) => {
|
|
188
|
-
let {
|
|
189
|
-
options = [],
|
|
190
|
-
placeholder = '選択してください',
|
|
191
|
-
enableUnSelected = true
|
|
192
|
-
} = props.params
|
|
193
|
-
|
|
194
|
-
let Options = options.map( ( option: amotify.fn.Input.Select.OptionProps ) => {
|
|
195
|
-
let {
|
|
196
|
-
value,
|
|
197
|
-
label,
|
|
198
|
-
} = option
|
|
199
|
-
let Value = String( value )
|
|
200
|
-
return <option
|
|
201
|
-
value={ Value }
|
|
202
|
-
key={ Value }
|
|
203
|
-
children={ label }
|
|
204
|
-
/>
|
|
205
|
-
} )
|
|
206
|
-
|
|
207
|
-
if ( enableUnSelected ) {
|
|
208
|
-
Options.unshift( <option
|
|
209
|
-
key={ 0 }
|
|
210
|
-
value={ JSON.stringify( null ) }
|
|
211
|
-
children={ placeholder }
|
|
212
|
-
/> )
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return <>
|
|
216
|
-
{ Options }
|
|
217
|
-
</>
|
|
218
|
-
}
|