amotify 0.0.4 → 0.0.6
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/@jsminAmotifyExtension/formCollect.js +1 -1
- package/dist/Atoms/Logo/parts.js +1 -1
- package/dist/Atoms/Various/parts.js +1 -1
- package/dist/Functions/Button/_.js +1 -1
- package/dist/Functions/Cropper/parts.js +4 -4
- package/dist/Functions/Effects/Fade.js +2 -2
- package/dist/Functions/Input/Chips/Selector.js +4 -4
- package/dist/Functions/Input/Chips/_.js +3 -3
- package/dist/Functions/Input/DigitCharacters.js +3 -3
- package/dist/Functions/Input/File/_.js +4 -4
- package/dist/Functions/Input/List/_.js +3 -3
- package/dist/Functions/Input/Segmented/_.js +1 -1
- package/dist/Functions/Input/Select/_.js +2 -2
- package/dist/Functions/Input/Slider/_.js +3 -3
- package/dist/Functions/Input/Switch/_.js +4 -4
- package/dist/Functions/Input/Text.js +2 -2
- package/dist/Functions/Input/TextArea.js +1 -1
- package/dist/Functions/Input/Time/Picker.js +4 -4
- package/dist/Functions/Input/Time/_.js +3 -3
- package/dist/Functions/Input/_.js +4 -4
- package/dist/Functions/Input/core.js +4 -4
- package/dist/Functions/Inputs/text.js +1 -1
- package/dist/Functions/Layout/PageNotFound.js +3 -3
- package/dist/Functions/Layout/PageRouter.js +2 -2
- package/dist/Functions/Layout/PageViewController/parts.js +2 -2
- package/dist/Functions/Layout/Plate.js +1 -1
- package/dist/Functions/Layout/RootViewController/parts.js +4 -4
- package/dist/Functions/Layout/SwipeView/parts.js +2 -2
- package/dist/Functions/Layout/TabBar.js +3 -3
- package/dist/Functions/Loader/corner.js +2 -2
- package/dist/Functions/Loader/mini.js +2 -2
- package/dist/Functions/Loader/parts.js +1 -1
- package/dist/Functions/Loader/top.js +2 -2
- package/dist/Functions/Sheet/parts.js +4 -4
- package/dist/Functions/SnackBar/parts.js +4 -4
- package/dist/Functions/Table/Data/parts.js +4 -4
- package/dist/Functions/Table/Drag/parts.js +3 -3
- package/dist/Functions/Table/_.js +2 -2
- package/dist/Functions/Tooltips/parts.js +2 -2
- package/dist/Molecules/@export.js +1 -1
- package/dist/Molecules/Accordion/parts.js +2 -2
- package/dist/Molecules/LinkifyText/parts.js +2 -2
- package/dist/Molecules/List.js +1 -1
- package/dist/Organisms/DisplayStyleInput/darkmode.js +4 -4
- package/dist/Organisms/DisplayStyleInput/themeColor.js +4 -4
- package/dist/Templates/PlayGround/parts.js +5 -5
- package/dist/launch.js +6 -6
- package/package.json +6 -5
- package/public/amotify.js +310 -0
- package/public/amotify.min.css +12724 -0
- package/dist/src/@jsminAmotifyExtension/_.d.ts +0 -4
- package/dist/src/@jsminAmotifyExtension/fetch.d.ts +0 -9
- package/dist/src/@jsminAmotifyExtension/formCollect.d.ts +0 -1
- package/dist/src/@jsminAmotifyExtension/spreadSheet.d.ts +0 -4
- package/dist/src/@jsminAmotifyExtension/variables.d.ts +0 -0
- package/dist/src/@types/_.d.ts +0 -6
- package/dist/src/@types/amot.d.ts +0 -260
- package/dist/src/@types/fn.d.ts +0 -1040
- package/dist/src/@types/index.d.ts +0 -62
- package/dist/src/@types/jsminAmotifyExtension.d.ts +0 -134
- package/dist/src/@types/module.d.ts +0 -2
- package/dist/src/@types/state.d.ts +0 -145
- package/dist/src/Atoms/@export.d.ts +0 -4
- package/dist/src/Atoms/FAIcon/parts.d.ts +0 -2
- package/dist/src/Atoms/Logo/parts.d.ts +0 -1
- package/dist/src/Atoms/Various/parts.d.ts +0 -9
- package/dist/src/Functions/@export.d.ts +0 -12
- package/dist/src/Functions/Button/_.d.ts +0 -1
- package/dist/src/Functions/Cropper/parts.d.ts +0 -1
- package/dist/src/Functions/Effects/Fade.d.ts +0 -1
- package/dist/src/Functions/Effects/Ripple.d.ts +0 -1
- package/dist/src/Functions/Effects/_.d.ts +0 -3
- package/dist/src/Functions/Input/Chips/Selector.d.ts +0 -1
- package/dist/src/Functions/Input/Chips/_.d.ts +0 -2
- package/dist/src/Functions/Input/DigitCharacters.d.ts +0 -1
- package/dist/src/Functions/Input/File/_.d.ts +0 -2
- package/dist/src/Functions/Input/Hidden.d.ts +0 -1
- package/dist/src/Functions/Input/List/_.d.ts +0 -1
- package/dist/src/Functions/Input/Segmented/_.d.ts +0 -1
- package/dist/src/Functions/Input/Select/_.d.ts +0 -1
- package/dist/src/Functions/Input/Slider/_.d.ts +0 -1
- package/dist/src/Functions/Input/Switch/_.d.ts +0 -1
- package/dist/src/Functions/Input/Text.d.ts +0 -5
- package/dist/src/Functions/Input/TextArea.d.ts +0 -1
- package/dist/src/Functions/Input/Time/Picker.d.ts +0 -1
- package/dist/src/Functions/Input/Time/_.d.ts +0 -2
- package/dist/src/Functions/Input/_.d.ts +0 -5
- package/dist/src/Functions/Input/core.d.ts +0 -34
- package/dist/src/Functions/Inputs/_.d.ts +0 -3
- package/dist/src/Functions/Inputs/text.d.ts +0 -12
- package/dist/src/Functions/Layout/PageNotFound.d.ts +0 -1
- package/dist/src/Functions/Layout/PageRouter.d.ts +0 -2
- package/dist/src/Functions/Layout/PageViewController/parts.d.ts +0 -1
- package/dist/src/Functions/Layout/Plate.d.ts +0 -1
- package/dist/src/Functions/Layout/RootViewController/parts.d.ts +0 -1
- package/dist/src/Functions/Layout/SwipeView/parts.d.ts +0 -2
- package/dist/src/Functions/Layout/TabBar.d.ts +0 -1
- package/dist/src/Functions/Layout/_.d.ts +0 -2
- package/dist/src/Functions/Loader/corner.d.ts +0 -1
- package/dist/src/Functions/Loader/mini.d.ts +0 -33
- package/dist/src/Functions/Loader/parts.d.ts +0 -3
- package/dist/src/Functions/Loader/top.d.ts +0 -1
- package/dist/src/Functions/Sheet/parts.d.ts +0 -2
- package/dist/src/Functions/SnackBar/parts.d.ts +0 -2
- package/dist/src/Functions/Table/Data/parts.d.ts +0 -3
- package/dist/src/Functions/Table/Drag/parts.d.ts +0 -1
- package/dist/src/Functions/Table/Normal/parts.d.ts +0 -1
- package/dist/src/Functions/Table/_.d.ts +0 -9
- package/dist/src/Functions/Tooltips/parts.d.ts +0 -2
- package/dist/src/Global/@export.d.ts +0 -12
- package/dist/src/Global/LaunchReactApplication.d.ts +0 -1
- package/dist/src/Global/styleConverter.d.ts +0 -2
- package/dist/src/Molecules/@export.d.ts +0 -21
- package/dist/src/Molecules/Accordion/parts.d.ts +0 -2
- package/dist/src/Molecules/LinkifyText/parts.d.ts +0 -1
- package/dist/src/Molecules/List.d.ts +0 -1
- package/dist/src/Organisms/@export.d.ts +0 -2
- package/dist/src/Organisms/DisplayStyleInput/_.d.ts +0 -1
- package/dist/src/Organisms/DisplayStyleInput/darkmode.d.ts +0 -1
- package/dist/src/Organisms/DisplayStyleInput/themeColor.d.ts +0 -27
- package/dist/src/Templates/@export.d.ts +0 -2
- package/dist/src/Templates/PlayGround/parts.d.ts +0 -1
- package/dist/src/config.d.ts +0 -16
- package/dist/src/launch.d.ts +0 -9
- package/dist/src/preload.d.ts +0 -1
- package/src/@jsminAmotifyExtension/_.tsx +0 -4
- package/src/@jsminAmotifyExtension/fetch.tsx +0 -107
- package/src/@jsminAmotifyExtension/formCollect.tsx +0 -89
- package/src/@jsminAmotifyExtension/spreadSheet.tsx +0 -159
- package/src/@jsminAmotifyExtension/variables.tsx +0 -130
- package/src/@styles/@app.scss +0 -4
- package/src/@styles/@variables/customProps.scss +0 -109
- package/src/@styles/@variables/styleSet.scss +0 -38
- package/src/@styles/@variables/themeColor.scss +0 -71
- package/src/@styles/@variables/var.scss +0 -171
- package/src/@styles/UniStyling.scss +0 -996
- package/src/@styles/init.scss +0 -154
- package/src/@types/_.tsx +0 -6
- package/src/@types/amot.tsx +0 -323
- package/src/@types/fn.tsx +0 -1210
- package/src/@types/index.tsx +0 -74
- package/src/@types/jsminAmotifyExtension.tsx +0 -143
- package/src/@types/module.tsx +0 -2
- package/src/@types/state.tsx +0 -199
- package/src/Atoms/@export.tsx +0 -32
- package/src/Atoms/FAIcon/parts.tsx +0 -117
- package/src/Atoms/FAIcon/style.module.scss +0 -9
- package/src/Atoms/Logo/parts.tsx +0 -335
- package/src/Atoms/Logo/style.module.scss +0 -96
- package/src/Atoms/Various/parts.tsx +0 -157
- package/src/Atoms/Various/style.module.scss +0 -40
- package/src/Functions/@export.tsx +0 -29
- package/src/Functions/Button/_.tsx +0 -305
- package/src/Functions/Button/style.module.scss +0 -183
- package/src/Functions/Cropper/parts.tsx +0 -1061
- package/src/Functions/Cropper/style.module.scss +0 -62
- package/src/Functions/Effects/Fade.tsx +0 -81
- package/src/Functions/Effects/Ripple.tsx +0 -141
- package/src/Functions/Effects/_.tsx +0 -33
- package/src/Functions/Effects/style.module.scss +0 -83
- package/src/Functions/Input/Chips/Selector.tsx +0 -451
- package/src/Functions/Input/Chips/_.tsx +0 -286
- package/src/Functions/Input/Chips/style.module.scss +0 -6
- package/src/Functions/Input/DigitCharacters.tsx +0 -241
- package/src/Functions/Input/File/_.tsx +0 -596
- package/src/Functions/Input/File/style.module.scss +0 -34
- package/src/Functions/Input/Hidden.tsx +0 -18
- package/src/Functions/Input/List/_.tsx +0 -383
- package/src/Functions/Input/List/style.module.scss +0 -84
- package/src/Functions/Input/Segmented/_.tsx +0 -238
- package/src/Functions/Input/Segmented/style.module.scss +0 -81
- package/src/Functions/Input/Select/_.tsx +0 -225
- package/src/Functions/Input/Select/style.module.scss +0 -10
- package/src/Functions/Input/Slider/_.tsx +0 -519
- package/src/Functions/Input/Slider/style.module.scss +0 -67
- package/src/Functions/Input/Switch/_.tsx +0 -177
- package/src/Functions/Input/Switch/style.module.scss +0 -18
- package/src/Functions/Input/Text.tsx +0 -437
- package/src/Functions/Input/TextArea.tsx +0 -115
- package/src/Functions/Input/Time/Picker.tsx +0 -950
- package/src/Functions/Input/Time/_.tsx +0 -736
- package/src/Functions/Input/Time/style.module.scss +0 -72
- package/src/Functions/Input/_.tsx +0 -793
- package/src/Functions/Input/core.tsx +0 -461
- package/src/Functions/Input/style.module.scss +0 -43
- package/src/Functions/Inputs/_.tsx +0 -5
- package/src/Functions/Inputs/style.module.scss +0 -15
- package/src/Functions/Inputs/text.tsx +0 -67
- package/src/Functions/Inputs/types.d.ts +0 -1
- package/src/Functions/Layout/PageNotFound.tsx +0 -81
- package/src/Functions/Layout/PageRouter.tsx +0 -107
- package/src/Functions/Layout/PageViewController/parts.tsx +0 -32
- package/src/Functions/Layout/Plate.tsx +0 -30
- package/src/Functions/Layout/RootViewController/parts.tsx +0 -290
- package/src/Functions/Layout/RootViewController/style.module.scss +0 -24
- package/src/Functions/Layout/SwipeView/parts.tsx +0 -380
- package/src/Functions/Layout/SwipeView/style.module.scss +0 -19
- package/src/Functions/Layout/TabBar.tsx +0 -64
- package/src/Functions/Layout/_.tsx +0 -20
- package/src/Functions/Loader/corner.tsx +0 -78
- package/src/Functions/Loader/mini.tsx +0 -117
- package/src/Functions/Loader/parts.tsx +0 -105
- package/src/Functions/Loader/style.module.scss +0 -222
- package/src/Functions/Loader/top.tsx +0 -90
- package/src/Functions/Sheet/parts.tsx +0 -972
- package/src/Functions/Sheet/style.module.scss +0 -235
- 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 -955
- package/src/Functions/Table/Drag/parts.tsx +0 -448
- package/src/Functions/Table/Normal/parts.tsx +0 -123
- package/src/Functions/Table/_.tsx +0 -170
- package/src/Functions/Table/style.module.scss +0 -92
- package/src/Functions/Tooltips/parts.tsx +0 -52
- package/src/Global/@export.tsx +0 -138
- package/src/Global/LaunchReactApplication.tsx +0 -30
- package/src/Global/exe.tsx +0 -0
- package/src/Global/styleConverter.tsx +0 -435
- package/src/Molecules/@export.tsx +0 -95
- package/src/Molecules/Accordion/parts.tsx +0 -146
- package/src/Molecules/Accordion/style.module.scss +0 -13
- package/src/Molecules/LinkifyText/parts.tsx +0 -54
- package/src/Molecules/List.tsx +0 -30
- package/src/Organisms/@export.tsx +0 -5
- package/src/Organisms/DisplayStyleInput/_.tsx +0 -18
- package/src/Organisms/DisplayStyleInput/darkmode.tsx +0 -112
- package/src/Organisms/DisplayStyleInput/themeColor.tsx +0 -210
- package/src/Templates/@export.tsx +0 -7
- package/src/Templates/PlayGround/parts.tsx +0 -115
- package/src/Templates/PlayGround/style.module.scss +0 -38
- package/src/config.tsx +0 -132
- package/src/launch.tsx +0 -100
- package/src/preload.tsx +0 -49
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
React
|
|
3
|
-
} from '@global';
|
|
4
|
-
const {
|
|
5
|
-
useState
|
|
6
|
-
} = React;
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
Box,
|
|
10
|
-
Flex,
|
|
11
|
-
FAIcon
|
|
12
|
-
} from '@atoms';
|
|
13
|
-
import {
|
|
14
|
-
Input,
|
|
15
|
-
Buttons
|
|
16
|
-
} from '@functions';
|
|
17
|
-
import {
|
|
18
|
-
BoxWrapper,
|
|
19
|
-
CommonEffects,
|
|
20
|
-
SubmitForm
|
|
21
|
-
} from '../core';
|
|
22
|
-
import style from './style.module.scss';
|
|
23
|
-
|
|
24
|
-
function DefaultValidation( props: {
|
|
25
|
-
value: any
|
|
26
|
-
params: any
|
|
27
|
-
} ): amotify.fn.Input.Validation.Result {
|
|
28
|
-
let { value,params } = props;
|
|
29
|
-
let {
|
|
30
|
-
type,
|
|
31
|
-
required,
|
|
32
|
-
minSelect = 0
|
|
33
|
-
} = params as amotify.fn.Input.List.OriginParams;
|
|
34
|
-
let notice: amotify.fn.Input.Validation.NoticeTypes[] = [];
|
|
35
|
-
|
|
36
|
-
if ( required ) {
|
|
37
|
-
if ( !value.length ) {
|
|
38
|
-
if ( type == 'radio' ) {
|
|
39
|
-
notice.push( { type: 'invalid',label: '選択されていません' } );
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if ( minSelect ) {
|
|
45
|
-
if ( value.length < minSelect ) {
|
|
46
|
-
notice.push( { type: 'invalid',label: `${ minSelect }個以上選択してください` } );
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
ok: !notice.filter( ( { type } ) => type == 'invalid' ).length,
|
|
52
|
-
notice: notice
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const ListInput: FNC<amotify.fn.Input.List.OriginParams> = ( props ) => {
|
|
57
|
-
let { value,options = [] } = props;
|
|
58
|
-
let Values = $.is.exist( value ) ? $.flatArray( value ) : [];
|
|
59
|
-
let DefaultOptions = options.map( ( option ) => {
|
|
60
|
-
let { value,label } = option;
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
...option,
|
|
64
|
-
value: JSON.stringify( value ),
|
|
65
|
-
label
|
|
66
|
-
}
|
|
67
|
-
} );
|
|
68
|
-
let DefaultValues: string[] = [];
|
|
69
|
-
Values.forEach( ( value ) => {
|
|
70
|
-
let Val = JSON.stringify( value );
|
|
71
|
-
let Index = DefaultOptions.findIndex( ( option ) => option.value == Val );
|
|
72
|
-
if ( Index == -1 ) return;
|
|
73
|
-
DefaultValues.push( Val );
|
|
74
|
-
} );
|
|
75
|
-
|
|
76
|
-
return <Core
|
|
77
|
-
{ ...props }
|
|
78
|
-
value={ DefaultValues }
|
|
79
|
-
options={ DefaultOptions }
|
|
80
|
-
/>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const Core: FNC<amotify.fn.Input.List.OriginParams> = ( params ) => {
|
|
84
|
-
let {
|
|
85
|
-
type,
|
|
86
|
-
tone,
|
|
87
|
-
required,
|
|
88
|
-
componentID = '',
|
|
89
|
-
form,
|
|
90
|
-
override,
|
|
91
|
-
statusID,
|
|
92
|
-
freeCSS,
|
|
93
|
-
|
|
94
|
-
enableFormSubmit,
|
|
95
|
-
|
|
96
|
-
checkValidationAtFirst,
|
|
97
|
-
onValidate,
|
|
98
|
-
onUpdateValue,onUpdateValidValue,
|
|
99
|
-
value,
|
|
100
|
-
options,
|
|
101
|
-
leftIndicator,rightIndicator,
|
|
102
|
-
|
|
103
|
-
className,
|
|
104
|
-
|
|
105
|
-
cellStyles,cellClassName,
|
|
106
|
-
cellCheckedStyles,cellCheckedClassName,
|
|
107
|
-
|
|
108
|
-
...others
|
|
109
|
-
} = params;
|
|
110
|
-
|
|
111
|
-
let Default_Status: amotify.fn.Input.Status.Plain = {
|
|
112
|
-
componentID,
|
|
113
|
-
dataValue: value,
|
|
114
|
-
eventType: 'init',
|
|
115
|
-
eventID: $.uuidGen()
|
|
116
|
-
}
|
|
117
|
-
let [ val_status,set_status ] = useState( Default_Status );
|
|
118
|
-
let [ val_validate,set_validate ] = useState( {
|
|
119
|
-
ok: false,
|
|
120
|
-
notice: []
|
|
121
|
-
} as amotify.fn.Input.Validation.Result );
|
|
122
|
-
|
|
123
|
-
CommonEffects( {
|
|
124
|
-
type: 'list',
|
|
125
|
-
params,
|
|
126
|
-
val_status,
|
|
127
|
-
set_status,
|
|
128
|
-
val_validate,
|
|
129
|
-
set_validate,
|
|
130
|
-
onUpdateValue,onUpdateValidValue,
|
|
131
|
-
DefaultValidation
|
|
132
|
-
} );
|
|
133
|
-
|
|
134
|
-
return ( <BoxWrapper
|
|
135
|
-
val_status={ val_status }
|
|
136
|
-
set_status={ set_status }
|
|
137
|
-
val_validate={ val_validate }
|
|
138
|
-
params={ params }
|
|
139
|
-
>
|
|
140
|
-
<Input.Hidden
|
|
141
|
-
data-value={ JSON.stringify( val_status.dataValue ) }
|
|
142
|
-
form={ form }
|
|
143
|
-
data-input-type={ type }
|
|
144
|
-
data-validation={ val_validate.ok }
|
|
145
|
-
{ ...others }
|
|
146
|
-
componentID={ val_status.componentID }
|
|
147
|
-
/>
|
|
148
|
-
<CellList
|
|
149
|
-
params={ params }
|
|
150
|
-
val_status={ val_status }
|
|
151
|
-
set_status={ set_status }
|
|
152
|
-
/>
|
|
153
|
-
</BoxWrapper> );
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const CellList: FNC<{
|
|
157
|
-
params: amotify.fn.Input.List.OriginParams
|
|
158
|
-
val_status: amotify.fn.Input.Status.Plain
|
|
159
|
-
set_status: React.Dispatch<React.SetStateAction<amotify.fn.Input.Status.Plain>>
|
|
160
|
-
}> = ( props ) => {
|
|
161
|
-
let {
|
|
162
|
-
params,
|
|
163
|
-
val_status,
|
|
164
|
-
set_status
|
|
165
|
-
} = props;
|
|
166
|
-
|
|
167
|
-
let {
|
|
168
|
-
componentID,
|
|
169
|
-
type,
|
|
170
|
-
tone,
|
|
171
|
-
icon = true,
|
|
172
|
-
options,
|
|
173
|
-
name,
|
|
174
|
-
form,
|
|
175
|
-
tabIndex,
|
|
176
|
-
hideInput,
|
|
177
|
-
disabled: DefaultDisabled,
|
|
178
|
-
className: ListClassName,
|
|
179
|
-
|
|
180
|
-
cellStyles: DefaultCellStyles,
|
|
181
|
-
cellClassName: DefaultCellClassName = '',
|
|
182
|
-
cellCheckedStyles: DefaultCellCheckedStyles,
|
|
183
|
-
cellCheckedClassName: DefaultCellCheckedClassName = '',
|
|
184
|
-
|
|
185
|
-
enableFormSubmit,
|
|
186
|
-
defaultActiveStyling = true
|
|
187
|
-
} = params;
|
|
188
|
-
let {
|
|
189
|
-
dataValue
|
|
190
|
-
} = val_status;
|
|
191
|
-
|
|
192
|
-
let IconBox = icon ? <Box
|
|
193
|
-
flexSizing={ 'none' }
|
|
194
|
-
children={ params.iconType == 'radio' ? <Comps.RadioIcon /> :
|
|
195
|
-
params.iconType == 'checkbox' ? <Comps.CheckboxIcon /> : null }
|
|
196
|
-
/> : null;
|
|
197
|
-
|
|
198
|
-
let Cells = options.map( ( option,index ) => {
|
|
199
|
-
let {
|
|
200
|
-
value,
|
|
201
|
-
label,
|
|
202
|
-
disabled = DefaultDisabled,
|
|
203
|
-
className = '',
|
|
204
|
-
checkedStyles,
|
|
205
|
-
checkedClassName = '',
|
|
206
|
-
...styles
|
|
207
|
-
} = option;
|
|
208
|
-
|
|
209
|
-
let CellID = $.uuidGen();
|
|
210
|
-
let Checked = dataValue.findIndex( ( v: string ) => v === value ) != -1;
|
|
211
|
-
|
|
212
|
-
let Styles = {
|
|
213
|
-
...DefaultCellStyles,
|
|
214
|
-
...styles
|
|
215
|
-
} as amotifyUniStyleParams
|
|
216
|
-
let ClassName = [
|
|
217
|
-
style.Label,
|
|
218
|
-
style[ 'defaultActiveStyling_' + !!defaultActiveStyling ],
|
|
219
|
-
DefaultCellClassName,
|
|
220
|
-
className
|
|
221
|
-
];
|
|
222
|
-
|
|
223
|
-
if ( Checked ) {
|
|
224
|
-
Styles = {
|
|
225
|
-
...Styles,
|
|
226
|
-
...DefaultCellCheckedStyles,
|
|
227
|
-
...checkedStyles,
|
|
228
|
-
activeStyles: checkedStyles,
|
|
229
|
-
freeCSS: {
|
|
230
|
-
...Styles.freeCSS,
|
|
231
|
-
...DefaultCellCheckedStyles?.freeCSS,
|
|
232
|
-
...checkedStyles?.freeCSS
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
ClassName = [
|
|
237
|
-
...ClassName,
|
|
238
|
-
DefaultCellCheckedClassName,
|
|
239
|
-
checkedClassName
|
|
240
|
-
];
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return [
|
|
244
|
-
<input
|
|
245
|
-
type={ type == 'radio' ? 'radio' : 'checkbox' }
|
|
246
|
-
className={ [
|
|
247
|
-
style.Input,
|
|
248
|
-
style[ 'defaultActiveStyling_' + !!defaultActiveStyling ]
|
|
249
|
-
].join( ' ' ) }
|
|
250
|
-
name={ 'RadioCheckbox-' + name }
|
|
251
|
-
data-list-index={ componentID + '-' + index }
|
|
252
|
-
id={ CellID }
|
|
253
|
-
value={ String( value ) }
|
|
254
|
-
data-form-name={ form }
|
|
255
|
-
disabled={ disabled }
|
|
256
|
-
checked={ Checked }
|
|
257
|
-
onFocus={ ( event ) => {
|
|
258
|
-
if ( disabled ) return;
|
|
259
|
-
if ( type != 'radio' ) return;
|
|
260
|
-
if ( val_status.dataValue.length ) return;
|
|
261
|
-
let { value,checked } = event.target;
|
|
262
|
-
let nextValue: any = [ value ];
|
|
263
|
-
|
|
264
|
-
set_status( {
|
|
265
|
-
...val_status,
|
|
266
|
-
dataValue: nextValue,
|
|
267
|
-
eventType: 'update',
|
|
268
|
-
eventID: $.uuidGen()
|
|
269
|
-
} );
|
|
270
|
-
} }
|
|
271
|
-
onChange={ ( event ) => {
|
|
272
|
-
if ( disabled ) return;
|
|
273
|
-
let { value,checked } = event.target;
|
|
274
|
-
let nextValue = [];
|
|
275
|
-
if ( type == 'radio' ) {
|
|
276
|
-
nextValue = [ value ];
|
|
277
|
-
} else if ( type == 'checkbox' || type == 'checker' ) {
|
|
278
|
-
if ( checked ) {
|
|
279
|
-
nextValue = [ ...val_status.dataValue,value ];
|
|
280
|
-
} else {
|
|
281
|
-
let prevValue = [ ...val_status.dataValue ];
|
|
282
|
-
prevValue.splice( val_status.dataValue.findIndex( ( v: any ) => v == value ),1 );
|
|
283
|
-
nextValue = prevValue;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
set_status( {
|
|
288
|
-
...val_status,
|
|
289
|
-
dataValue: nextValue,
|
|
290
|
-
eventType: 'update',
|
|
291
|
-
eventID: $.uuidGen()
|
|
292
|
-
} );
|
|
293
|
-
} }
|
|
294
|
-
onKeyDown={ ( event ) => {
|
|
295
|
-
let { key,shiftKey } = event;
|
|
296
|
-
if ( type == 'checkbox' || type == 'checker' ) {
|
|
297
|
-
if ( key == 'Tab' ) {
|
|
298
|
-
if ( shiftKey ) { } else { }
|
|
299
|
-
} else if ( key.match( /Arrow/ ) ) {
|
|
300
|
-
event.preventDefault();
|
|
301
|
-
|
|
302
|
-
let dir = [ 'ArrowLeft','ArrowUp' ].includes( key ) ? -1 : 1;
|
|
303
|
-
let nextIndex = index + dir;
|
|
304
|
-
|
|
305
|
-
if ( nextIndex < 0 ) {
|
|
306
|
-
nextIndex = options.length - 1;
|
|
307
|
-
} else if ( nextIndex >= options.length ) {
|
|
308
|
-
nextIndex = 0;
|
|
309
|
-
}
|
|
310
|
-
$( `input[data-list-index="${ componentID }-${ nextIndex }"]` ).focus();
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if ( enableFormSubmit ) SubmitForm( event );
|
|
315
|
-
} }
|
|
316
|
-
tabIndex={ tabIndex }
|
|
317
|
-
/>,
|
|
318
|
-
<Buttons.Label.Plain
|
|
319
|
-
htmlFor={ CellID }
|
|
320
|
-
className={ ClassName.join( ' ' ) }
|
|
321
|
-
tabIndex={ -1 }
|
|
322
|
-
display='flex'
|
|
323
|
-
ssEffectsOnActive={ false }
|
|
324
|
-
verticalAlign='center'
|
|
325
|
-
gap={ '1/3' }
|
|
326
|
-
flexWrap={ false }
|
|
327
|
-
{ ...Styles }
|
|
328
|
-
>
|
|
329
|
-
{ IconBox }
|
|
330
|
-
{ $.is.string( label ) ? <Box children={ label } /> : label }
|
|
331
|
-
</Buttons.Label.Plain>
|
|
332
|
-
];
|
|
333
|
-
} );
|
|
334
|
-
|
|
335
|
-
return ( <Flex
|
|
336
|
-
flexSizing={ 'auto' }
|
|
337
|
-
freeCSS={ {
|
|
338
|
-
...params.freeCSS
|
|
339
|
-
} }
|
|
340
|
-
className={ [
|
|
341
|
-
ListClassName,
|
|
342
|
-
style.CellBase,
|
|
343
|
-
style[ 'HideInput_' + hideInput ],
|
|
344
|
-
style[ 'IconIndicator_' + !!icon ],
|
|
345
|
-
style[ 'Tone_' + tone ]
|
|
346
|
-
].join( ' ' ) }
|
|
347
|
-
children={ Cells }
|
|
348
|
-
/> );
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
const Comps = {
|
|
352
|
-
RadioIcon: () => ( <Box
|
|
353
|
-
className={ style.Icon }
|
|
354
|
-
backgroundColor={ '1.layer.base' }
|
|
355
|
-
border
|
|
356
|
-
transition='middle'
|
|
357
|
-
position='relative'
|
|
358
|
-
borderRadius={ 'sphere' }
|
|
359
|
-
flexCenter
|
|
360
|
-
/> ),
|
|
361
|
-
CheckboxIcon: () => ( <Box
|
|
362
|
-
className={ [
|
|
363
|
-
style.Icon,
|
|
364
|
-
style.CheckboxIcon
|
|
365
|
-
].join( ' ' ) }
|
|
366
|
-
borderRadius={ '3.tone.tertiary' }
|
|
367
|
-
backgroundColor={ '1.layer.base' }
|
|
368
|
-
border
|
|
369
|
-
transition='middle'
|
|
370
|
-
fontColor={ 'white' }
|
|
371
|
-
position='relative'
|
|
372
|
-
flexCenter
|
|
373
|
-
>
|
|
374
|
-
<FAIcon.Check
|
|
375
|
-
className={ style.I }
|
|
376
|
-
transition='middle'
|
|
377
|
-
opacity='trans'
|
|
378
|
-
freeCSS={ {
|
|
379
|
-
zIndex: 8
|
|
380
|
-
} }
|
|
381
|
-
/>
|
|
382
|
-
</Box> )
|
|
383
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
@use '@uniVar' as *;
|
|
2
|
-
.CellBase {
|
|
3
|
-
&.HideInput_true .Input {
|
|
4
|
-
display: none;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
.Input {
|
|
8
|
-
&:checked + .Label .Icon {
|
|
9
|
-
border-color: transparent;
|
|
10
|
-
&:after, > * {
|
|
11
|
-
transform: scale(1) !important;
|
|
12
|
-
opacity: 1 !important;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
&.defaultActiveStyling_true {
|
|
16
|
-
&:checked {
|
|
17
|
-
&:focus + .Label {
|
|
18
|
-
opacity: 1 !important;
|
|
19
|
-
box-shadow:
|
|
20
|
-
0 0 0 transparent inset,
|
|
21
|
-
0 0 0 1px $color-theme-opacity-middle,
|
|
22
|
-
0 0 0 $unit1_3 $color-theme-opacity-low !important;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
&:focus + .Label {
|
|
26
|
-
box-shadow:
|
|
27
|
-
0 0 0 transparent inset,
|
|
28
|
-
0 0 0 $unit1_3 $color-layer3 !important;
|
|
29
|
-
}
|
|
30
|
-
&:active + .Label {
|
|
31
|
-
opacity: 1 !important;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
.Label {
|
|
36
|
-
-webkit-user-select: none;
|
|
37
|
-
user-select: none;
|
|
38
|
-
* {
|
|
39
|
-
pointer-events: none;
|
|
40
|
-
}
|
|
41
|
-
&.defaultActiveStyling_true {
|
|
42
|
-
&:hover {
|
|
43
|
-
opacity: .6;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
.Icon {
|
|
48
|
-
width: 20px;
|
|
49
|
-
height: 20px;
|
|
50
|
-
&.CheckboxIcon {
|
|
51
|
-
&:after {
|
|
52
|
-
background-color: $color-theme;
|
|
53
|
-
}
|
|
54
|
-
.I {
|
|
55
|
-
transform: scale(.3);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
&:before, &:after {
|
|
59
|
-
content: "";
|
|
60
|
-
position: absolute;
|
|
61
|
-
opacity: 0;
|
|
62
|
-
transition: $animation-time-middle;
|
|
63
|
-
}
|
|
64
|
-
&:before {
|
|
65
|
-
width: 100%;
|
|
66
|
-
height: 100%;
|
|
67
|
-
border-radius: inherit;
|
|
68
|
-
opacity: 1;
|
|
69
|
-
transition: 0s;
|
|
70
|
-
transition-timing-function: $animation-style1;
|
|
71
|
-
}
|
|
72
|
-
&:after {
|
|
73
|
-
top: 0;
|
|
74
|
-
left: 0;
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 100%;
|
|
77
|
-
transform: scale(0.3);
|
|
78
|
-
border-radius: inherit;
|
|
79
|
-
background-color: $color-layer1;
|
|
80
|
-
border: 5.5px solid $color-theme;
|
|
81
|
-
box-shadow: 0 0 0 transparent inset, $shadow1;
|
|
82
|
-
background-color: white;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,238 +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 = {
|
|
12
|
-
padding: '1/3',
|
|
13
|
-
gap: '1/3',
|
|
14
|
-
ssCardBox: true,
|
|
15
|
-
...params,
|
|
16
|
-
cellStyles: {
|
|
17
|
-
borderRadius: 'inherit',
|
|
18
|
-
position: 'relative',
|
|
19
|
-
...params.cellStyles
|
|
20
|
-
},
|
|
21
|
-
cellCheckedStyles: {
|
|
22
|
-
backgroundColor: 'theme',
|
|
23
|
-
fontColor: 'white',
|
|
24
|
-
...params.cellCheckedStyles
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return ( <Core appearance={ ( params as any ).tone || 'Auto' } { ...params } /> );
|
|
29
|
-
},
|
|
30
|
-
Normal: ( params ) => {
|
|
31
|
-
params = {
|
|
32
|
-
border: true,
|
|
33
|
-
borderColor: 'theme',
|
|
34
|
-
overflow: 'hidden',
|
|
35
|
-
gap: 0,
|
|
36
|
-
ssLastChildLossBorder: 'right',
|
|
37
|
-
fontColor: '3.blur',
|
|
38
|
-
...params,
|
|
39
|
-
cellStyles: {
|
|
40
|
-
borderRadius: 0,
|
|
41
|
-
borderRight: true,
|
|
42
|
-
borderColor: 'theme',
|
|
43
|
-
...params.cellStyles
|
|
44
|
-
},
|
|
45
|
-
cellCheckedStyles: {
|
|
46
|
-
backgroundColor: 'theme',
|
|
47
|
-
fontColor: 'white',
|
|
48
|
-
...params.cellCheckedStyles
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
( params as any ).tone = 'ThemeBorder';
|
|
52
|
-
|
|
53
|
-
return ( <Core appearance={ 'Border' } { ...params } /> );
|
|
54
|
-
},
|
|
55
|
-
Cloud: ( params ) => {
|
|
56
|
-
params = {
|
|
57
|
-
padding: '1/3',
|
|
58
|
-
gap: '1/3',
|
|
59
|
-
backgroundColor: 'cloud',
|
|
60
|
-
...params,
|
|
61
|
-
cellStyles: {
|
|
62
|
-
borderRadius: 'inherit',
|
|
63
|
-
position: 'relative',
|
|
64
|
-
...params.cellStyles
|
|
65
|
-
},
|
|
66
|
-
cellCheckedStyles: {
|
|
67
|
-
backgroundColor: 'theme',
|
|
68
|
-
fontColor: 'white',
|
|
69
|
-
...params.cellCheckedStyles
|
|
70
|
-
},
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return ( <Core appearance={ ( params as any ).tone || 'Cloud' } { ...params } /> );
|
|
74
|
-
},
|
|
75
|
-
Cloud2: ( params ) => {
|
|
76
|
-
( params as any ).tone = 'WhiteCloud';
|
|
77
|
-
return ( <Segmented.Cloud
|
|
78
|
-
fontColor='3.blur'
|
|
79
|
-
{ ...params }
|
|
80
|
-
cellCheckedStyles={ {
|
|
81
|
-
fontColor: '1.clear',
|
|
82
|
-
...params.cellCheckedStyles
|
|
83
|
-
} }
|
|
84
|
-
/> );
|
|
85
|
-
},
|
|
86
|
-
Cloud3: ( params ) => {
|
|
87
|
-
( params as any ).tone = 'ThemeCloud';
|
|
88
|
-
return ( <Segmented.Cloud
|
|
89
|
-
backgroundColor='tcOpFew'
|
|
90
|
-
fontColor='theme'
|
|
91
|
-
{ ...params }
|
|
92
|
-
cellStyles={ {
|
|
93
|
-
...params.cellStyles
|
|
94
|
-
} }
|
|
95
|
-
/> );
|
|
96
|
-
},
|
|
97
|
-
Border: ( params ) => {
|
|
98
|
-
params = {
|
|
99
|
-
backgroundColor: '1.layer.base',
|
|
100
|
-
border: '2.normal',
|
|
101
|
-
overflow: 'hidden',
|
|
102
|
-
gap: 0,
|
|
103
|
-
ssLastChildLossBorder: 'right',
|
|
104
|
-
boxShadow: 0,
|
|
105
|
-
...params,
|
|
106
|
-
cellStyles: {
|
|
107
|
-
borderRadius: 0,
|
|
108
|
-
borderRight: '2.normal',
|
|
109
|
-
...params.cellStyles
|
|
110
|
-
},
|
|
111
|
-
cellCheckedStyles: {
|
|
112
|
-
backgroundColor: 'tcOpFew',
|
|
113
|
-
fontColor: 'theme',
|
|
114
|
-
...params.cellCheckedStyles
|
|
115
|
-
},
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return ( <Core appearance={ ( params as any ).tone || 'Border' } { ...params } /> );
|
|
119
|
-
},
|
|
120
|
-
Border2: ( params ) => {
|
|
121
|
-
params = {
|
|
122
|
-
border: true,
|
|
123
|
-
borderColor: 'theme',
|
|
124
|
-
overflow: 'hidden',
|
|
125
|
-
gap: 0,
|
|
126
|
-
ssLastChildLossBorder: 'right',
|
|
127
|
-
boxShadow: 0,
|
|
128
|
-
fontColor: '3.blur',
|
|
129
|
-
...params,
|
|
130
|
-
cellStyles: {
|
|
131
|
-
borderRadius: 0,
|
|
132
|
-
borderRight: true,
|
|
133
|
-
borderColor: 'theme',
|
|
134
|
-
...params.cellStyles
|
|
135
|
-
},
|
|
136
|
-
cellCheckedStyles: {
|
|
137
|
-
backgroundColor: 'theme',
|
|
138
|
-
fontColor: 'white',
|
|
139
|
-
...params.cellCheckedStyles
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
( params as any ).tone = 'ThemeBorder';
|
|
143
|
-
|
|
144
|
-
return ( <Core appearance={ 'Border' } { ...params } /> );
|
|
145
|
-
},
|
|
146
|
-
BottomLine: ( params ) => {
|
|
147
|
-
params = {
|
|
148
|
-
gap: 0,
|
|
149
|
-
fontColor: '3.blur',
|
|
150
|
-
...params,
|
|
151
|
-
cellStyles: {
|
|
152
|
-
ssEffectsOnActive: 'ripple.theme',
|
|
153
|
-
borderRadius: 0,
|
|
154
|
-
padding: 1,
|
|
155
|
-
...params.cellStyles
|
|
156
|
-
},
|
|
157
|
-
cellCheckedStyles: {
|
|
158
|
-
fontColor: 'theme',
|
|
159
|
-
...params.cellCheckedStyles
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return ( <Core appearance={ 'BottomLine' } { ...params } /> );
|
|
164
|
-
},
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
type CoreParams = amotify.fn.Input.Segmented.Params & {
|
|
168
|
-
appearance: amotify.fn.Input.Segmented.Tones
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const Core: FNC<CoreParams> = ( params ) => {
|
|
172
|
-
let {
|
|
173
|
-
tone,
|
|
174
|
-
appearance,
|
|
175
|
-
value,
|
|
176
|
-
options,
|
|
177
|
-
onUpdateValue,onUpdateValidValue,
|
|
178
|
-
freeCSS,
|
|
179
|
-
cellStyles,
|
|
180
|
-
cellClassName,
|
|
181
|
-
cellCheckedClassName,
|
|
182
|
-
cellCheckedStyles,
|
|
183
|
-
...others
|
|
184
|
-
} = params;
|
|
185
|
-
|
|
186
|
-
let [ val_componentID ] = React.useState( $.uuidGen() );
|
|
187
|
-
|
|
188
|
-
let [ val_defValue,set_defValue ] = React.useState( value );
|
|
189
|
-
let [ val_value,set_value ] = React.useState( val_defValue );
|
|
190
|
-
if ( val_defValue != value ) {
|
|
191
|
-
set_defValue( value );
|
|
192
|
-
set_value( value );
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return ( <ListInputs.Radio
|
|
196
|
-
// hideInput
|
|
197
|
-
defaultActiveStyling={ false }
|
|
198
|
-
flexWrap={ false }
|
|
199
|
-
borderRadius={ '2.tone.secondary' }
|
|
200
|
-
position='relative'
|
|
201
|
-
options={ options }
|
|
202
|
-
value={ val_value }
|
|
203
|
-
componentID={ val_componentID }
|
|
204
|
-
icon={ false }
|
|
205
|
-
{ ...others }
|
|
206
|
-
freeCSS={ {
|
|
207
|
-
whiteSpace: 'nowrap',
|
|
208
|
-
...freeCSS
|
|
209
|
-
} }
|
|
210
|
-
cellStyles={ {
|
|
211
|
-
flexCenter: true,
|
|
212
|
-
ssPushable: true,
|
|
213
|
-
boxShadow: 'none',
|
|
214
|
-
...cellStyles
|
|
215
|
-
} }
|
|
216
|
-
cellClassName={ [
|
|
217
|
-
cellClassName,
|
|
218
|
-
style.Label,
|
|
219
|
-
style[ 'Tone_' + appearance ]
|
|
220
|
-
].join( ' ' ) }
|
|
221
|
-
cellCheckedStyles={ {
|
|
222
|
-
isBoldFont: true,
|
|
223
|
-
...cellCheckedStyles,
|
|
224
|
-
} }
|
|
225
|
-
cellCheckedClassName={ [
|
|
226
|
-
cellCheckedClassName,
|
|
227
|
-
style.Checked
|
|
228
|
-
].join( ' ' ) }
|
|
229
|
-
tone={ 'custom' as any }
|
|
230
|
-
onUpdateValue={ onUpdateValue }
|
|
231
|
-
onUpdateValidValue={ ( args ) => {
|
|
232
|
-
if ( onUpdateValidValue ) onUpdateValidValue( args );
|
|
233
|
-
if ( appearance == 'BottomLine' ) {
|
|
234
|
-
set_value( args.value[ 0 ] );
|
|
235
|
-
}
|
|
236
|
-
} }
|
|
237
|
-
/> );
|
|
238
|
-
}
|