amotify 0.0.3 → 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,793 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StyleConverter,
|
|
3
|
+
useStore,
|
|
4
|
+
} from '@global';
|
|
5
|
+
const {
|
|
6
|
+
useState,
|
|
7
|
+
useEffect,
|
|
8
|
+
useRef
|
|
9
|
+
} = React;
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
Box,
|
|
13
|
+
Flex,
|
|
14
|
+
FAIcon,
|
|
15
|
+
Span
|
|
16
|
+
} from '@atoms';
|
|
17
|
+
import {
|
|
18
|
+
Row,
|
|
19
|
+
Text,
|
|
20
|
+
Column
|
|
21
|
+
} from '@mols';
|
|
22
|
+
import {
|
|
23
|
+
Buttons,
|
|
24
|
+
Tooltips
|
|
25
|
+
} from '@functions';
|
|
26
|
+
|
|
27
|
+
import style from './style.module.scss';
|
|
28
|
+
|
|
29
|
+
import { HiddenInput } from './Hidden';
|
|
30
|
+
import {
|
|
31
|
+
TextInput,
|
|
32
|
+
TextValidate
|
|
33
|
+
} from './Text';
|
|
34
|
+
import { TextAreaInput } from './TextArea';
|
|
35
|
+
import { DigitCharactersInput } from './DigitCharacters'
|
|
36
|
+
import {
|
|
37
|
+
TimeInput,
|
|
38
|
+
TimeFNs
|
|
39
|
+
} from './Time/_';
|
|
40
|
+
import { SelectInput } from './Select/_';
|
|
41
|
+
import { ListInput } from './List/_';
|
|
42
|
+
import { ChipsInput } from './Chips/_';
|
|
43
|
+
import { SwitchInput } from './Switch/_';
|
|
44
|
+
import { FileInput } from './File/_';
|
|
45
|
+
import { SliderInput } from './Slider/_';
|
|
46
|
+
import { Segmented } from './Segmented/_';
|
|
47
|
+
|
|
48
|
+
const UniComponent: FNC<{
|
|
49
|
+
componentID?: string
|
|
50
|
+
children: FNC<any>
|
|
51
|
+
params: any
|
|
52
|
+
}> = ( props ) => {
|
|
53
|
+
let [ val_componentID ] = useState( props.componentID || $.uuidGen() );
|
|
54
|
+
|
|
55
|
+
props.params = {
|
|
56
|
+
enableFormSubmit: true,
|
|
57
|
+
// override: 'beforeModified',
|
|
58
|
+
override: 'never',
|
|
59
|
+
name: $.uuidGen(),
|
|
60
|
+
id: $.uuidGen(),
|
|
61
|
+
statusID: $.uuidGen(),
|
|
62
|
+
'aria-label': 'Input-' + val_componentID,
|
|
63
|
+
...props.params,
|
|
64
|
+
componentID: val_componentID,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let {
|
|
68
|
+
children: Children
|
|
69
|
+
} = props;
|
|
70
|
+
|
|
71
|
+
return ( <Children { ...props.params } /> );
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const TextInputs: amotify.fn.Input.Text.Methods = {
|
|
75
|
+
Validate: TextValidate,
|
|
76
|
+
Normal: ( rawParams ) => {
|
|
77
|
+
if ( rawParams.rightIcon ) rawParams.paddingRight = rawParams.paddingRight ?? 3;
|
|
78
|
+
if ( rawParams.leftIcon ) rawParams.paddingLeft = rawParams.paddingLeft ?? 3;
|
|
79
|
+
|
|
80
|
+
return ( <UniComponent
|
|
81
|
+
componentID={ rawParams.componentID }
|
|
82
|
+
children={ TextInput }
|
|
83
|
+
params={ DefaultStyles.Boxish( rawParams ) }
|
|
84
|
+
/> );
|
|
85
|
+
},
|
|
86
|
+
CreditCard: ( props ) => ( <TextInputs.Normal
|
|
87
|
+
restrict='creditCard'
|
|
88
|
+
{ ...props }
|
|
89
|
+
/> ),
|
|
90
|
+
Tel: ( props ) => ( <TextInputs.Normal
|
|
91
|
+
restrict='tel'
|
|
92
|
+
placeholder='xxx-xxxx-xxxx'
|
|
93
|
+
{ ...props }
|
|
94
|
+
/> ),
|
|
95
|
+
Number: ( props ) => ( <TextInputs.Normal restrict='number' { ...props } /> ),
|
|
96
|
+
DigitNumber: ( props ) => ( <TextInputs.Normal restrict='digitNumber' { ...props } /> ),
|
|
97
|
+
Email: ( props ) => ( <TextInputs.Normal restrict='email' { ...props } /> ),
|
|
98
|
+
Url: ( props ) => ( <TextInputs.Normal
|
|
99
|
+
restrict='url'
|
|
100
|
+
placeholder='https://example.com'
|
|
101
|
+
{ ...props }
|
|
102
|
+
/> ),
|
|
103
|
+
Postal: ( params ) => {
|
|
104
|
+
let [ val_postalEventID ] = useState( $.uuidGen() );
|
|
105
|
+
useEffect( () => {
|
|
106
|
+
return () => {
|
|
107
|
+
useStore.delete( val_postalEventID );
|
|
108
|
+
}
|
|
109
|
+
},[] );
|
|
110
|
+
|
|
111
|
+
return ( <TextInputs.Normal
|
|
112
|
+
restrict='postal'
|
|
113
|
+
placeholder='郵便番号'
|
|
114
|
+
leftIndicator={ <Input.Comps.LeftIndicator children={ '〒' } /> }
|
|
115
|
+
{ ...params }
|
|
116
|
+
/> );
|
|
117
|
+
},
|
|
118
|
+
Password: ( props ) => {
|
|
119
|
+
return (
|
|
120
|
+
<TextInputs.Normal
|
|
121
|
+
restrict='password'
|
|
122
|
+
placeholder='パスワードを入力'
|
|
123
|
+
rightIndicator={
|
|
124
|
+
<Input.Comps.RightIndicator
|
|
125
|
+
padding={ 0 }
|
|
126
|
+
>
|
|
127
|
+
<Buttons.Button.Normal.R
|
|
128
|
+
padding={ '3/4' }
|
|
129
|
+
fontColor='theme'
|
|
130
|
+
borderTopLeftRadius={ 0 }
|
|
131
|
+
borderBottomLeftRadius={ 0 }
|
|
132
|
+
backgroundColor='inherit'
|
|
133
|
+
height={ 1 }
|
|
134
|
+
ssEffectsOnActive={ [ 'expand' ] }
|
|
135
|
+
onMouseOver={ ( event ) => {
|
|
136
|
+
Tooltips.open( {
|
|
137
|
+
parent: event.currentTarget,
|
|
138
|
+
gravityPoint: 24,
|
|
139
|
+
padding: [ 1,0 ],
|
|
140
|
+
content: <Tooltips.Comps.Body>
|
|
141
|
+
パスワードを表示
|
|
142
|
+
</Tooltips.Comps.Body>
|
|
143
|
+
} );
|
|
144
|
+
} }
|
|
145
|
+
tabIndex={ -1 }
|
|
146
|
+
onClick={ ( event ) => {
|
|
147
|
+
$( event.target )
|
|
148
|
+
.parent().parent().parent()
|
|
149
|
+
.find( 'input' )
|
|
150
|
+
.callback( ( input ) => {
|
|
151
|
+
let Input = input[ 0 ];
|
|
152
|
+
Input.type = Input.type === 'password' ? 'text' : 'password';
|
|
153
|
+
} );
|
|
154
|
+
} }
|
|
155
|
+
>
|
|
156
|
+
<FAIcon
|
|
157
|
+
d='eye'
|
|
158
|
+
freeCSS={ {
|
|
159
|
+
pointerEvents: 'none'
|
|
160
|
+
} }
|
|
161
|
+
/>
|
|
162
|
+
</Buttons.Button.Normal.R>
|
|
163
|
+
</Input.Comps.RightIndicator>
|
|
164
|
+
}
|
|
165
|
+
{ ...props }
|
|
166
|
+
/>
|
|
167
|
+
);
|
|
168
|
+
},
|
|
169
|
+
Money: {
|
|
170
|
+
JPY: ( props ) => ( <TextInputs.DigitNumber
|
|
171
|
+
placeholder="金額を入力"
|
|
172
|
+
rightIndicator={ <Input.Comps.RightIndicator
|
|
173
|
+
children={ '円' }
|
|
174
|
+
/> }
|
|
175
|
+
{ ...props }
|
|
176
|
+
/> )
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const TimeInputs: amotify.fn.Input.Time.Methods & {
|
|
181
|
+
Origin: ( props: amotify.fn.Input.Time.OriginParams ) => JSX.Element
|
|
182
|
+
} = {
|
|
183
|
+
Origin: ( rawParams ) => {
|
|
184
|
+
let [ val_componentID ] = useState( rawParams.componentID || $.uuidGen() );
|
|
185
|
+
rawParams.componentID = val_componentID;
|
|
186
|
+
|
|
187
|
+
if ( $.is.nullish( rawParams.rightIndicator ) ) {
|
|
188
|
+
let icon = ( rawParams.restrict || '' ).match( /clock/ ) ? 'clock' : 'calendar-lines';
|
|
189
|
+
|
|
190
|
+
rawParams.rightIndicator = <Input.Comps.RightIndicator
|
|
191
|
+
padding={ 0 }
|
|
192
|
+
>
|
|
193
|
+
<Buttons.Button.Sub.R
|
|
194
|
+
color='cloud'
|
|
195
|
+
border='unset'
|
|
196
|
+
padding={ '3/4' }
|
|
197
|
+
fontColor='theme'
|
|
198
|
+
borderTopLeftRadius={ 0 }
|
|
199
|
+
borderBottomLeftRadius={ 0 }
|
|
200
|
+
backgroundColor='inherit'
|
|
201
|
+
height={ 1 }
|
|
202
|
+
ssEffectsOnActive={ [ 'ripple.theme' ] }
|
|
203
|
+
tabIndex={ -1 }
|
|
204
|
+
id={ 'Picker-' + rawParams.componentID }
|
|
205
|
+
onClick={ () => {
|
|
206
|
+
let component = useStore.get( rawParams.componentID! );
|
|
207
|
+
if ( component ) component.openPicker();
|
|
208
|
+
} }
|
|
209
|
+
>
|
|
210
|
+
<FAIcon d={ icon } />
|
|
211
|
+
</Buttons.Button.Sub.R>
|
|
212
|
+
</Input.Comps.RightIndicator>
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return ( <UniComponent
|
|
216
|
+
componentID={ rawParams.componentID! }
|
|
217
|
+
children={ TimeInput }
|
|
218
|
+
params={ DefaultStyles.Boxish( rawParams ) }
|
|
219
|
+
/> );
|
|
220
|
+
},
|
|
221
|
+
Clock: ( props ) => ( <TimeInputs.Origin restrict='clock' era='clock' { ...props } /> ),
|
|
222
|
+
Date: ( props ) => ( <TimeInputs.Origin restrict='date' { ...props } /> ),
|
|
223
|
+
Week: ( props ) => ( <TimeInputs.Origin restrict='week' { ...props } /> ),
|
|
224
|
+
Month: ( props ) => ( <TimeInputs.Origin restrict='month' { ...props } /> ),
|
|
225
|
+
Year: ( props ) => ( <TimeInputs.Origin restrict='year' { ...props } /> ),
|
|
226
|
+
DateWareki: ( params ) => {
|
|
227
|
+
let [ val_componentID ] = useState( params.componentID || $.uuidGen() );
|
|
228
|
+
params.componentID = val_componentID;
|
|
229
|
+
let {
|
|
230
|
+
defaultEra = 'wareki',
|
|
231
|
+
} = params;
|
|
232
|
+
|
|
233
|
+
let era = 'year' as amotify.fn.Input.Time.EraTypes;
|
|
234
|
+
|
|
235
|
+
if ( defaultEra == 'wareki' ) {
|
|
236
|
+
era = 'reiwa';
|
|
237
|
+
if ( params.value ) {
|
|
238
|
+
let [ year,month,date ] = params.value.split( /\D/ );
|
|
239
|
+
if ( year && month && date ) {
|
|
240
|
+
let Year = Number( year );
|
|
241
|
+
if ( Year >= 2019 ) {
|
|
242
|
+
Year -= 2019,era = 'reiwa';
|
|
243
|
+
} else if ( Year >= 1989 ) {
|
|
244
|
+
Year -= 1989,era = 'heisei';
|
|
245
|
+
} else if ( Year >= 1926 ) {
|
|
246
|
+
Year -= 1926,era = 'shouwa';
|
|
247
|
+
} else if ( Year >= 1912 ) {
|
|
248
|
+
Year -= 1912,era = 'taisho';
|
|
249
|
+
} else if ( Year >= 1868 ) {
|
|
250
|
+
Year -= 1868,era = 'meiji';
|
|
251
|
+
}
|
|
252
|
+
Year += 1;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return ( <TimeInputs.Origin
|
|
258
|
+
restrict='dateWareki'
|
|
259
|
+
leftIndicator={ <Input.Select
|
|
260
|
+
enableUnSelected={ false }
|
|
261
|
+
value={ era }
|
|
262
|
+
tone={ params.tone }
|
|
263
|
+
flexCenter
|
|
264
|
+
borderTopRightRadius={ 0 }
|
|
265
|
+
borderBottomRightRadius={ 0 }
|
|
266
|
+
freeCSS={ {
|
|
267
|
+
whiteSpace: 'nowrap',
|
|
268
|
+
marginRight: -1
|
|
269
|
+
} }
|
|
270
|
+
options={ [
|
|
271
|
+
{ value: 'year',label: '西暦' },
|
|
272
|
+
{ value: 'reiwa',label: '令和' },
|
|
273
|
+
{ value: 'heisei',label: '平成' },
|
|
274
|
+
{ value: 'shouwa',label: '昭和' },
|
|
275
|
+
{ value: 'taisho',label: '大正' },
|
|
276
|
+
{ value: 'meiji',label: '明治' }
|
|
277
|
+
] }
|
|
278
|
+
onUpdateValidValue={ ( { value,eventType } ) => {
|
|
279
|
+
let component = useStore.get( params.componentID! );
|
|
280
|
+
|
|
281
|
+
if ( component && component.resetEra ) component.resetEra( value );
|
|
282
|
+
} }
|
|
283
|
+
rightIcon={ false }
|
|
284
|
+
/> }
|
|
285
|
+
{ ...params }
|
|
286
|
+
era={ era }
|
|
287
|
+
/> );
|
|
288
|
+
},
|
|
289
|
+
Periods: {
|
|
290
|
+
Date: ( props ) => ( <TimeInputs.Origin restrict='dates' { ...props } /> ),
|
|
291
|
+
Month: ( props ) => ( <TimeInputs.Origin restrict='months' { ...props } /> ),
|
|
292
|
+
},
|
|
293
|
+
fn: TimeFNs
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
const ChipsInputs = ( rawParams: amotify.fn.Input.Chips.PlainParams ) => {
|
|
297
|
+
rawParams = {
|
|
298
|
+
gap: 1,
|
|
299
|
+
display: 'flex',
|
|
300
|
+
horizontalAlign: 'left',
|
|
301
|
+
verticalAlign: 'center',
|
|
302
|
+
flexWrap: true,
|
|
303
|
+
...rawParams
|
|
304
|
+
}
|
|
305
|
+
let params = DefaultStyles.Boxish( rawParams ) as amotify.fn.Input.Chips.PlainParams;
|
|
306
|
+
|
|
307
|
+
return ( <UniComponent
|
|
308
|
+
componentID={ rawParams.componentID }
|
|
309
|
+
children={ ChipsInput }
|
|
310
|
+
params={ params }
|
|
311
|
+
/> );
|
|
312
|
+
};
|
|
313
|
+
ChipsInputs.fn = ChipsInput.fn;
|
|
314
|
+
|
|
315
|
+
const FileInputs = ( rawParams: amotify.fn.Input.Filer.PlainParams ) => {
|
|
316
|
+
rawParams.override = 'force';
|
|
317
|
+
let params = StyleConverter.ToClassName( rawParams );
|
|
318
|
+
params.cellClassName = [
|
|
319
|
+
params.cellClassName,
|
|
320
|
+
DefaultStyles.Boxish( {
|
|
321
|
+
...params.cellStyles,
|
|
322
|
+
tone: params.tone
|
|
323
|
+
} ).className,
|
|
324
|
+
].join( ' ' );
|
|
325
|
+
|
|
326
|
+
return ( <UniComponent
|
|
327
|
+
componentID={ rawParams.componentID }
|
|
328
|
+
children={ FileInput }
|
|
329
|
+
params={ params }
|
|
330
|
+
/> );
|
|
331
|
+
}
|
|
332
|
+
FileInputs.fn = FileInput.fn;
|
|
333
|
+
|
|
334
|
+
export const ListInputs: amotify.fn.Input.List.Methods & {
|
|
335
|
+
Origin: ( props: amotify.fn.Input.List.OriginParams ) => JSX.Element
|
|
336
|
+
} = {
|
|
337
|
+
Origin: ( rawParams ) => {
|
|
338
|
+
|
|
339
|
+
let params = DefaultStyles.ListCell( rawParams );
|
|
340
|
+
return ( <UniComponent
|
|
341
|
+
componentID={ rawParams.componentID }
|
|
342
|
+
children={ ListInput }
|
|
343
|
+
params={ params }
|
|
344
|
+
/> );
|
|
345
|
+
},
|
|
346
|
+
Radio: ( params ) => ( <ListInputs.Origin
|
|
347
|
+
iconType='radio'
|
|
348
|
+
tone={ params.tone as any }
|
|
349
|
+
{ ...params }
|
|
350
|
+
type='radio'
|
|
351
|
+
/> ),
|
|
352
|
+
Checkbox: ( params ) => ( <ListInputs.Origin
|
|
353
|
+
iconType='checkbox'
|
|
354
|
+
tone={ params.tone as any }
|
|
355
|
+
{ ...params }
|
|
356
|
+
type='checkbox'
|
|
357
|
+
/> )
|
|
358
|
+
}
|
|
359
|
+
export const Input: amotify.fn.Input.Methods = {
|
|
360
|
+
Plain: ( params ) => ( <input { ...StyleConverter.ToClassName( params ) } /> ),
|
|
361
|
+
Hidden: ( rawParams ) => {
|
|
362
|
+
return ( <UniComponent
|
|
363
|
+
componentID={ rawParams.componentID }
|
|
364
|
+
children={ HiddenInput }
|
|
365
|
+
params={ rawParams }
|
|
366
|
+
/> );
|
|
367
|
+
},
|
|
368
|
+
Text: TextInputs,
|
|
369
|
+
TextArea: ( rawParams ) => {
|
|
370
|
+
if ( rawParams.rightIcon ) rawParams.paddingRight = rawParams.paddingRight ?? 3;
|
|
371
|
+
if ( rawParams.leftIcon ) rawParams.paddingLeft = rawParams.paddingLeft ?? 3;
|
|
372
|
+
|
|
373
|
+
let params = DefaultStyles.Boxish( rawParams );
|
|
374
|
+
params.rows = params.rows || 5;
|
|
375
|
+
return ( <UniComponent
|
|
376
|
+
componentID={ rawParams.componentID }
|
|
377
|
+
children={ TextAreaInput }
|
|
378
|
+
params={ params }
|
|
379
|
+
/> );
|
|
380
|
+
},
|
|
381
|
+
DigitCharacters: ( rawParams ) => {
|
|
382
|
+
rawParams = {
|
|
383
|
+
textAlign: 'center',
|
|
384
|
+
width: 0,
|
|
385
|
+
...rawParams
|
|
386
|
+
}
|
|
387
|
+
if ( rawParams.combineInput ) {
|
|
388
|
+
rawParams = $.deepMerge(
|
|
389
|
+
rawParams,{
|
|
390
|
+
digits: rawParams.digits,
|
|
391
|
+
textAlign: 'center',
|
|
392
|
+
width: 0,
|
|
393
|
+
borderRadius: 0,
|
|
394
|
+
freeCSS: {
|
|
395
|
+
minWidth: 12 * 2,
|
|
396
|
+
marginRight: -1
|
|
397
|
+
},
|
|
398
|
+
listStyles: {
|
|
399
|
+
borderRadius: '2.tone.secondary',
|
|
400
|
+
border: 'unset',
|
|
401
|
+
gap: 0
|
|
402
|
+
},
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
let params = DefaultStyles.Boxish( rawParams ) as amotify.fn.Input.DigitCharacters.PlainParams;
|
|
407
|
+
|
|
408
|
+
return (
|
|
409
|
+
<UniComponent
|
|
410
|
+
componentID={ rawParams.componentID }
|
|
411
|
+
children={ DigitCharactersInput }
|
|
412
|
+
params={ params }
|
|
413
|
+
/>
|
|
414
|
+
);
|
|
415
|
+
},
|
|
416
|
+
Time: TimeInputs,
|
|
417
|
+
Select: ( rawParams ) => {
|
|
418
|
+
if ( $.is.nullish( rawParams.rightIcon ) ) {
|
|
419
|
+
rawParams.rightIcon = <Input.Comps.RightIcon
|
|
420
|
+
flexType='col'
|
|
421
|
+
className={ style.IndicatorIcon }
|
|
422
|
+
{ ...rawParams.rightIconStyles }
|
|
423
|
+
>
|
|
424
|
+
<FAIcon.AngleDown />
|
|
425
|
+
</Input.Comps.RightIcon>
|
|
426
|
+
}
|
|
427
|
+
if ( rawParams.rightIcon ) rawParams.paddingRight = rawParams.paddingRight ?? 3;
|
|
428
|
+
if ( rawParams.leftIcon ) rawParams.paddingLeft = rawParams.paddingLeft ?? 3;
|
|
429
|
+
|
|
430
|
+
let params = DefaultStyles.Boxish( rawParams ) as amotify.fn.Input.Select.PlainParams;
|
|
431
|
+
delete params.rightIconStyles;
|
|
432
|
+
return (
|
|
433
|
+
<UniComponent
|
|
434
|
+
componentID={ rawParams.componentID }
|
|
435
|
+
children={ SelectInput }
|
|
436
|
+
params={ params }
|
|
437
|
+
/>
|
|
438
|
+
);
|
|
439
|
+
},
|
|
440
|
+
Radio: ListInputs.Radio,
|
|
441
|
+
Checkbox: ListInputs.Checkbox,
|
|
442
|
+
Chips: ChipsInputs,
|
|
443
|
+
Search: ( params: amotify.fn.Input.Search.PlainParams ) => {
|
|
444
|
+
return <ChipsInputs
|
|
445
|
+
AddButtonComponent={ ( props ) => {
|
|
446
|
+
if ( props.selected.length ) return null;
|
|
447
|
+
return <Box>
|
|
448
|
+
選択してください
|
|
449
|
+
</Box>
|
|
450
|
+
} }
|
|
451
|
+
SelectedCellComponent={ ( props ) => {
|
|
452
|
+
return <Box
|
|
453
|
+
width={ 1 }
|
|
454
|
+
textAlign='left'
|
|
455
|
+
>
|
|
456
|
+
<Row.Separate>
|
|
457
|
+
{ props.label }
|
|
458
|
+
{ props.defaultRemoveButton }
|
|
459
|
+
</Row.Separate>
|
|
460
|
+
</Box>;
|
|
461
|
+
} }
|
|
462
|
+
paddingLeft={ 3 }
|
|
463
|
+
rightIcon={ <Input.Comps.LeftIcon>
|
|
464
|
+
<Column gap={ 0 }>
|
|
465
|
+
<FAIcon.AngleUp />
|
|
466
|
+
<FAIcon.AngleDown />
|
|
467
|
+
</Column>
|
|
468
|
+
</Input.Comps.LeftIcon> }
|
|
469
|
+
limit={ 1 }
|
|
470
|
+
{ ...params }
|
|
471
|
+
/>
|
|
472
|
+
},
|
|
473
|
+
File: FileInputs,
|
|
474
|
+
Switch: ( rawParams ) => {
|
|
475
|
+
rawParams.color = rawParams.color || 'theme';
|
|
476
|
+
return ( <UniComponent
|
|
477
|
+
componentID={ rawParams.componentID }
|
|
478
|
+
children={ SwitchInput }
|
|
479
|
+
params={ rawParams }
|
|
480
|
+
/> );
|
|
481
|
+
},
|
|
482
|
+
Slider: ( rawParams ) => {
|
|
483
|
+
return ( <UniComponent
|
|
484
|
+
componentID={ rawParams.componentID }
|
|
485
|
+
children={ SliderInput }
|
|
486
|
+
params={ StyleConverter.ToClassName( rawParams ) }
|
|
487
|
+
/> );
|
|
488
|
+
},
|
|
489
|
+
Checker: ( rawParams ) => {
|
|
490
|
+
return ( <ListInputs.Origin
|
|
491
|
+
{ ...rawParams }
|
|
492
|
+
tone='plain'
|
|
493
|
+
icon
|
|
494
|
+
type='checker'
|
|
495
|
+
iconType='checkbox'
|
|
496
|
+
value={ rawParams.value ? true : null }
|
|
497
|
+
cellStyles={ {
|
|
498
|
+
padding: 0,
|
|
499
|
+
...rawParams.cellStyles
|
|
500
|
+
} }
|
|
501
|
+
options={ [
|
|
502
|
+
{ value: true,label: rawParams.label }
|
|
503
|
+
] }
|
|
504
|
+
onUpdateValidValue={ ( args ) => {
|
|
505
|
+
let Value = !!args.value[ 0 ];
|
|
506
|
+
if ( rawParams.onUpdateValidValue )
|
|
507
|
+
rawParams.onUpdateValidValue( {
|
|
508
|
+
...args,
|
|
509
|
+
value: Value
|
|
510
|
+
} );
|
|
511
|
+
} }
|
|
512
|
+
/> );
|
|
513
|
+
},
|
|
514
|
+
|
|
515
|
+
Segmented: Segmented,
|
|
516
|
+
|
|
517
|
+
Comps: {
|
|
518
|
+
RequiredSign: ( params ) => {
|
|
519
|
+
return ( <Span
|
|
520
|
+
fontColor='white'
|
|
521
|
+
fontSize={ '0.xs' }
|
|
522
|
+
padding={ [ '1/4','1/3' ] }
|
|
523
|
+
backgroundColor='nega'
|
|
524
|
+
borderRadius={ '3.tone.tertiary' }
|
|
525
|
+
children={ '必須' }
|
|
526
|
+
{ ...params }
|
|
527
|
+
/> );
|
|
528
|
+
},
|
|
529
|
+
OmitSign: ( params ) => {
|
|
530
|
+
return ( <Span
|
|
531
|
+
fontColor='white'
|
|
532
|
+
fontSize={ '0.xs' }
|
|
533
|
+
padding={ [ '1/4','1/3' ] }
|
|
534
|
+
borderRadius={ '3.tone.tertiary' }
|
|
535
|
+
backgroundColor='6.layer.darkest'
|
|
536
|
+
children={ '省略可' }
|
|
537
|
+
{ ...params }
|
|
538
|
+
/> );
|
|
539
|
+
},
|
|
540
|
+
LeftIndicator: ( params ) => {
|
|
541
|
+
let {
|
|
542
|
+
tone,
|
|
543
|
+
...others
|
|
544
|
+
} = params;
|
|
545
|
+
|
|
546
|
+
return ( <Box
|
|
547
|
+
{ ...DefaultStyles.Indicator( tone! ) }
|
|
548
|
+
borderRight='unset'
|
|
549
|
+
borderTopRightRadius={ 0 }
|
|
550
|
+
borderBottomRightRadius={ 0 }
|
|
551
|
+
{ ...others }
|
|
552
|
+
/> );
|
|
553
|
+
},
|
|
554
|
+
RightIndicator: ( params ) => {
|
|
555
|
+
let {
|
|
556
|
+
tone,
|
|
557
|
+
...others
|
|
558
|
+
} = params;
|
|
559
|
+
|
|
560
|
+
return ( <Box
|
|
561
|
+
{ ...DefaultStyles.Indicator( tone! ) }
|
|
562
|
+
borderLeft='unset'
|
|
563
|
+
borderTopLeftRadius={ 0 }
|
|
564
|
+
borderBottomLeftRadius={ 0 }
|
|
565
|
+
{ ...others }
|
|
566
|
+
/> );
|
|
567
|
+
},
|
|
568
|
+
RightIcon: ( params ) => {
|
|
569
|
+
let {
|
|
570
|
+
tone = 'border',
|
|
571
|
+
...others
|
|
572
|
+
} = params;
|
|
573
|
+
|
|
574
|
+
return ( <Box
|
|
575
|
+
{ ...DefaultStyles.IndicatorIcon }
|
|
576
|
+
right={ '3/4' }
|
|
577
|
+
className={ style.IndicatorIcon }
|
|
578
|
+
{ ...others }
|
|
579
|
+
freeCSS={ {
|
|
580
|
+
zIndex: 6,
|
|
581
|
+
pointerEvents: 'none',
|
|
582
|
+
...others.freeCSS
|
|
583
|
+
} }
|
|
584
|
+
/> );
|
|
585
|
+
},
|
|
586
|
+
LeftIcon: ( params ) => {
|
|
587
|
+
let {
|
|
588
|
+
tone = 'border',
|
|
589
|
+
...others
|
|
590
|
+
} = params;
|
|
591
|
+
|
|
592
|
+
return ( <Box
|
|
593
|
+
{ ...DefaultStyles.IndicatorIcon }
|
|
594
|
+
left={ '3/4' }
|
|
595
|
+
className={ style.IndicatorIcon }
|
|
596
|
+
{ ...others }
|
|
597
|
+
freeCSS={ {
|
|
598
|
+
zIndex: 6,
|
|
599
|
+
pointerEvents: 'none',
|
|
600
|
+
...others.freeCSS
|
|
601
|
+
} }
|
|
602
|
+
/> );
|
|
603
|
+
},
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
const DefaultStyles = {
|
|
608
|
+
Input: ( type: amotify.fn.Input.BoxToneTypes ) => {
|
|
609
|
+
if ( type == 'plain' ) return {};
|
|
610
|
+
let Styles: amotifyUniStyleParams = {
|
|
611
|
+
padding: '3/4',
|
|
612
|
+
transition: 'middle',
|
|
613
|
+
flexSizing: 'auto',
|
|
614
|
+
boxShadow: 0
|
|
615
|
+
}
|
|
616
|
+
if ( type == 'border' ) {
|
|
617
|
+
Styles = {
|
|
618
|
+
...Styles,
|
|
619
|
+
border: true,
|
|
620
|
+
borderRadius: '2.tone.secondary',
|
|
621
|
+
backgroundColor: '1.layer.base'
|
|
622
|
+
}
|
|
623
|
+
} else if ( type == 'cloud' ) {
|
|
624
|
+
Styles = {
|
|
625
|
+
...Styles,
|
|
626
|
+
border: '1.thin',
|
|
627
|
+
borderRadius: '2.tone.secondary',
|
|
628
|
+
backgroundColor: 'cloud'
|
|
629
|
+
}
|
|
630
|
+
} else if ( type == 'bottomBorder' ) {
|
|
631
|
+
Styles = {
|
|
632
|
+
...Styles,
|
|
633
|
+
borderRadius: 0,
|
|
634
|
+
borderBottom: true,
|
|
635
|
+
backgroundColor: 'cloud'
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return Styles;
|
|
639
|
+
},
|
|
640
|
+
ListCell: ( params: amotify.fn.Input.List.OriginParams ) => {
|
|
641
|
+
if ( !params.tone ) {
|
|
642
|
+
params.tone = 'border';
|
|
643
|
+
|
|
644
|
+
if ( amotify.config.tone == 'flat' ) params.tone = 'cloud';
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
let { tone } = params;
|
|
648
|
+
|
|
649
|
+
if ( tone == 'plain' ) {
|
|
650
|
+
|
|
651
|
+
} else {
|
|
652
|
+
params = {
|
|
653
|
+
...params,
|
|
654
|
+
cellStyles: {
|
|
655
|
+
position: 'relative',
|
|
656
|
+
padding: [ '3/4',1 ],
|
|
657
|
+
borderRadius: '2.tone.secondary',
|
|
658
|
+
transition: 'middle',
|
|
659
|
+
...params.cellStyles,
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
if ( tone == 'normal' ) {
|
|
664
|
+
params = {
|
|
665
|
+
gap: '1/2',
|
|
666
|
+
...params,
|
|
667
|
+
cellStyles: {
|
|
668
|
+
isBoldFont: true,
|
|
669
|
+
...params.cellStyles,
|
|
670
|
+
},
|
|
671
|
+
cellCheckedStyles: {
|
|
672
|
+
backgroundColor: 'cloud'
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
params = {
|
|
678
|
+
gap: '3/4',
|
|
679
|
+
...params,
|
|
680
|
+
cellStyles: {
|
|
681
|
+
boxShadow: 0,
|
|
682
|
+
...params.cellStyles
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
if ( tone == 'cloud' || tone == 'vivid' ) {
|
|
687
|
+
params.cellStyles = {
|
|
688
|
+
border: '1.thin',
|
|
689
|
+
backgroundColor: '2.layer.cloud',
|
|
690
|
+
...params.cellStyles,
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if ( tone == 'border' ) {
|
|
695
|
+
params.cellStyles = {
|
|
696
|
+
border: true,
|
|
697
|
+
backgroundColor: '1.layer.base',
|
|
698
|
+
...params.cellStyles,
|
|
699
|
+
}
|
|
700
|
+
params.cellCheckedStyles = {
|
|
701
|
+
borderColor: 'theme',
|
|
702
|
+
fontColor: 'theme',
|
|
703
|
+
...params.cellCheckedStyles
|
|
704
|
+
}
|
|
705
|
+
} else if ( tone == 'cloud' ) {
|
|
706
|
+
params.cellCheckedStyles = {
|
|
707
|
+
backgroundColor: 'tcOpFew',
|
|
708
|
+
fontColor: 'theme',
|
|
709
|
+
borderColor: 'theme',
|
|
710
|
+
...params.cellCheckedStyles
|
|
711
|
+
}
|
|
712
|
+
} else if ( tone == 'vivid' ) {
|
|
713
|
+
params.cellCheckedStyles = {
|
|
714
|
+
backgroundColor: 'theme',
|
|
715
|
+
fontColor: 'white',
|
|
716
|
+
borderColor: 'theme',
|
|
717
|
+
...params.cellCheckedStyles
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
return StyleConverter.ToClassName( params );
|
|
723
|
+
},
|
|
724
|
+
Boxish: ( params: any ) => {
|
|
725
|
+
if ( !params.tone ) {
|
|
726
|
+
params.tone = 'border';
|
|
727
|
+
if ( amotify.config.tone == 'sharp' ) params.tone = 'bottomBorder';
|
|
728
|
+
else if ( amotify.config.tone == 'flat' ) params.tone = 'cloud';
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
let Styles: amotifyUniStyleParams = {
|
|
732
|
+
...DefaultStyles.Input( params.tone ),
|
|
733
|
+
...params,
|
|
734
|
+
...params.leftIndicator ? {
|
|
735
|
+
borderTopLeftRadius: 0,
|
|
736
|
+
borderBottomLeftRadius: 0
|
|
737
|
+
} : null,
|
|
738
|
+
...params.rightIndicator ? {
|
|
739
|
+
borderTopRightRadius: 0,
|
|
740
|
+
borderBottomRightRadius: 0,
|
|
741
|
+
} : null,
|
|
742
|
+
className: [
|
|
743
|
+
style.Input,
|
|
744
|
+
params.className
|
|
745
|
+
].join( ' ' ),
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return StyleConverter.ToClassName( Styles ) as any;
|
|
749
|
+
},
|
|
750
|
+
Indicator: ( type: amotify.fn.Input.BoxToneTypes ) => {
|
|
751
|
+
if ( !type ) {
|
|
752
|
+
type = 'border';
|
|
753
|
+
if ( amotify.config.tone == 'sharp' ) type = 'bottomBorder';
|
|
754
|
+
}
|
|
755
|
+
if ( type == 'plain' ) return {};
|
|
756
|
+
let styles: amotifyUniStyleParams = {
|
|
757
|
+
flexSizing: 'none',
|
|
758
|
+
flexCenter: true,
|
|
759
|
+
padding: [ 0,1 ],
|
|
760
|
+
borderRadius: '2.tone.secondary',
|
|
761
|
+
backgroundColor: 'cloud'
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
if ( type == 'border' ) {
|
|
765
|
+
styles = {
|
|
766
|
+
...styles,
|
|
767
|
+
border: true
|
|
768
|
+
}
|
|
769
|
+
} else if ( type == 'cloud' ) {
|
|
770
|
+
styles = {
|
|
771
|
+
...styles,
|
|
772
|
+
border: '1.thin'
|
|
773
|
+
}
|
|
774
|
+
} else if ( type == 'bottomBorder' ) {
|
|
775
|
+
styles = {
|
|
776
|
+
...styles,
|
|
777
|
+
borderRadius: 0,
|
|
778
|
+
borderBottom: true
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
return styles;
|
|
782
|
+
},
|
|
783
|
+
IndicatorIcon: {
|
|
784
|
+
position: 'absolute',
|
|
785
|
+
unitWidth: 2,
|
|
786
|
+
unitHeight: 2,
|
|
787
|
+
top: '50%',
|
|
788
|
+
flexCenter: true,
|
|
789
|
+
fontColor: 'theme',
|
|
790
|
+
fontSize: '1.mini',
|
|
791
|
+
backgroundColor: 'inherit',
|
|
792
|
+
} as amotifyUniStyleParams
|
|
793
|
+
};
|