forstok-ui-lib 5.13.18 → 6.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "5.13.18",
3
+ "version": "6.0.1",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -48,7 +48,6 @@
48
48
  "react": "^19.0.0",
49
49
  "react-content-loader": "^7.0.2",
50
50
  "react-datepicker": "^8.0.0",
51
- "react-dom": "^19.0.0",
52
51
  "react-router-dom": "^7.1.1",
53
52
  "react-select": "^5.10.0",
54
53
  "rollup-plugin-dts": "^6.1.1",
@@ -0,0 +1 @@
1
+ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='100%' height='100%'><path fill='none' stroke='#7eb6ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6L7 17l-5-5m20-2l-7.5 7.5L13 16'/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='100%' height='100%'><path fill='none' stroke='#60646c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6L7 17l-5-5m20-2l-7.5 7.5L13 16'/></svg>
@@ -7,6 +7,8 @@ import IconBack from '../../assets/images/icons/back.svg';
7
7
  import IconDashboardLeftNav from '../../assets/images/navs/left/dashboard.svg';
8
8
  import IconProductLeftNav from '../../assets/images/navs/left/products.svg';
9
9
  import IconWarningChat from '../../assets/images/icons/warning-agent.svg';
10
+ import IconCheckChat from '../../assets/images/icons/check.svg';
11
+ import IconCheckChatBlue from '../../assets/images/icons/check-blue.svg';
10
12
 
11
13
  const NotificationStyled = css`
12
14
  width: 44px;
@@ -299,6 +301,20 @@ const getIconContainerStyled = ({ $mode, $name, $width, onClick }:{ $mode?: stri
299
301
  }
300
302
  `
301
303
  break;
304
+ case 'check-chat':
305
+ style += `
306
+ &:before {
307
+ content: url(${IconCheckChat});
308
+ }
309
+ `
310
+ break;
311
+ case 'check-chat-blue':
312
+ style += `
313
+ &:before {
314
+ content: url(${IconCheckChatBlue});
315
+ }
316
+ `
317
+ break;
302
318
  default:
303
319
  break;
304
320
  }
@@ -8,7 +8,6 @@ export { default as ButtonComponent } from './button';
8
8
  export { default as LabelComponent } from './label';
9
9
  export { default as IconComponent } from './icon';
10
10
  export { default as LoadingComponent } from './loading';
11
- export { default as DropDownComponent } from './dropdown';
12
11
  export { default as MessageComponent } from './message';
13
12
  export { default as MessageQuestionComponent } from './message/question';
14
13
  export { default as PopupComponent } from './popup';
@@ -26,9 +25,7 @@ export { default as RadioComponent } from './radio';
26
25
  export { default as SwitchComponent } from './switch';
27
26
  export { default as MasterTableComponent } from './masterTable';
28
27
  export { default as ListComponent } from './list';
29
- export { default as ListTableComponent } from './listTable';
30
28
 
31
- export * from './dropdown/typed';
32
29
  export * from './message/typed';
33
30
  export * from './popup/typed';
34
31
  export * from './select/typed';
@@ -1,11 +1,11 @@
1
1
  import { Dispatch, JSX } from 'react';
2
2
  import { TChangeEvent, TMouseEvent, TObject, TPage, TState } from './base.typed';
3
- import { TCloseDropdownFunction } from '../components/dropdown/typed';
4
3
  import { TCustomField, TAutoCopy } from '../components/masterTable/typed';
5
4
  import { TMessageFunction, TMessageQuestionFunction } from '../components/message/typed';
6
5
  import { TPopupFunction, TPopupOpenFunction } from '../components/popup/typed';
7
6
  import { TOption } from '../components/select/typed';
8
7
 
8
+ export type TCloseDropdownFunction = (currentTarget: EventTarget & HTMLElement) => void;
9
9
  export type TUser = {
10
10
  profile_id: number,
11
11
  profile_name: string,
@@ -1,261 +0,0 @@
1
- import { useEffect, useRef, isValidElement } from 'react';
2
- import ReactPortalComponent from '../portal';
3
- import { DropDownContainer, DropDownTitle, DropDownSubTitle, DropDownWrapper, DropDownOverlayWrapper, DropDownControl, DropDownBody, DropDownAction, DropdownControlWrapper, DropdownPortalContainer } from './styles';
4
- import type { TMouseEvent } from '../../typeds/base.typed';
5
- import type { TDropdown } from './typed';
6
-
7
- const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externalMinWidth, $internalWidth, $area, $openPosition, $placement, $top, onClick, $alias, type, portalId, $bottom, ...props }: TDropdown) => {
8
- const buttonRef = useRef<HTMLElement>(null);
9
-
10
- const evScrollDropdown = () => {
11
- const containerEl = document.getElementsByClassName('_refContainer is-shown')[0] as HTMLElement;
12
- if (containerEl) {
13
- const offsetPos = containerEl.getBoundingClientRect();
14
- const portalContainerRef = document.querySelector(`#${portalId} ._refDropdownPortal`) as HTMLElement;
15
- if (portalContainerRef) {
16
- const wrapperRef = portalContainerRef.querySelector('._refDropdownWrapper') as HTMLElement;
17
- const value = offsetPos.left + offsetPos.width - wrapperRef.getBoundingClientRect().width;
18
- portalContainerRef.style.left = (value > 0 ? value : offsetPos.left) + 'px';
19
- portalContainerRef.style.top = offsetPos.top + parseInt($top || '0') - 32 + 'px';
20
- }
21
- }
22
- }
23
-
24
- const evResetDropdown = () => {
25
- const containerRef = document.getElementsByClassName('_refContainer is-shown') as HTMLCollectionOf<HTMLElement>;
26
- const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement;
27
- if (containerRef.length) {
28
- bodyEl.classList.remove('is-immuned');
29
- for (let i = 0; i < containerRef.length; i++) {
30
- const overlayEl = containerRef[i].querySelector(`._refDropdownOverlay`) as HTMLDivElement;
31
- overlayEl.style.display = 'none';
32
- containerRef[i].classList.remove('is-shown');
33
- }
34
- }
35
- const refScrollContainerEl = document.querySelector('._refScrollContainer') as HTMLElement;
36
- refScrollContainerEl && refScrollContainerEl.removeEventListener('scroll', evScrollDropdown, true);
37
- setTimeout(() => {
38
- if (portalId) {
39
- const portalContainerRef = document.getElementsByClassName('_refDropdownPortal is-shown') as HTMLCollectionOf<HTMLElement>;
40
- if (portalContainerRef.length) {
41
- for (let i = 0; i < portalContainerRef.length; i++) {
42
- portalContainerRef[i].style.left = '0';
43
- portalContainerRef[i].style.top = '0';
44
- portalContainerRef[i].classList.remove('is-shown');
45
- }
46
- }
47
- }
48
- },10);
49
- }
50
-
51
- const evToogleDropdown: TMouseEvent = e => {
52
- const currRefEl = buttonRef.current;
53
- if (currRefEl) {
54
- const buttonEl = (e.target as HTMLElement).closest(`.${currRefEl.classList[0]}`);
55
- if (!buttonEl) {
56
- return;
57
- }
58
- const containerEl = buttonEl.closest('._refContainer') as HTMLElement;
59
- const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement;
60
- if (containerEl) {
61
- const overlayEl = containerEl.querySelector(`._refDropdownOverlay`) as HTMLDivElement;
62
- const isCurOpen = containerEl.classList.contains('is-shown');
63
- const offsetPos = containerEl.getBoundingClientRect();
64
-
65
- if (!isCurOpen) {
66
- evResetDropdown();
67
- overlayEl.style.display = 'block';
68
- bodyEl.classList.add('is-immuned');
69
- containerEl.classList.add('is-shown');
70
- setTimeout(() => {
71
- if (portalId) {
72
- const portalContainerRef = document.querySelector(`#${portalId} ._refDropdownPortal`) as HTMLElement;
73
- const refScrollContainerEl = document.querySelector('._refScrollContainer') as HTMLElement;
74
- const wrapperRef = portalContainerRef.querySelector('._refDropdownWrapper') as HTMLElement;
75
- if (portalContainerRef) {
76
- if (offsetPos) {
77
- if (wrapperRef) {
78
- setTimeout(() => {
79
- wrapperRef.style.right = 'auto';
80
- const value = offsetPos.left + offsetPos.width - wrapperRef.getBoundingClientRect().width;
81
- portalContainerRef.style.left = (value > 0 ? value : offsetPos.left) + 'px';
82
- portalContainerRef.style.top = offsetPos.top + parseInt($top || '0') - 32 + 'px';
83
- portalContainerRef.style.zIndex = '8';
84
- refScrollContainerEl && refScrollContainerEl.addEventListener('scroll', evScrollDropdown, true);
85
- }, 10);
86
- } else {
87
- portalContainerRef.style.left = offsetPos.left + ((parseInt($internalWidth || '0') + offsetPos.width) / 2) + 'px';
88
- portalContainerRef.style.top = (offsetPos.top + offsetPos.height) + 'px';
89
- }
90
- }
91
- portalContainerRef.classList.add('is-shown');
92
- }
93
- }
94
- }, 10);
95
- onClick && onClick(e);
96
- } else {
97
- overlayEl.style.display = 'none';
98
- bodyEl.classList.remove('is-immuned');
99
- containerEl.classList.remove('is-shown');
100
- setTimeout(() => {
101
- if (portalId) {
102
- const portalContainerRef = document.querySelector(`#${portalId} ._refDropdownPortal`) as HTMLElement;
103
- const refScrollContainerEl = document.querySelector('._refScrollContainer') as HTMLElement;
104
- const wrapperRef = portalContainerRef.querySelector('._refDropdownWrapper') as HTMLElement;
105
- if (portalContainerRef) {
106
- portalContainerRef.classList.remove('is-shown');
107
- portalContainerRef.style.left = '0px';
108
- portalContainerRef.style.top = '0px';
109
- if (wrapperRef) {
110
- refScrollContainerEl && refScrollContainerEl.removeEventListener('scroll', evScrollDropdown, true);
111
- }
112
- }
113
- }
114
- }, 10);
115
- }
116
- }
117
- }
118
- }
119
-
120
- const evMouseEnter: TMouseEvent = e => {
121
- const currRefEl = buttonRef.current;
122
- if (currRefEl) {
123
- const buttonEl = (e.target as HTMLElement).closest(`.${currRefEl.classList[0]}`);
124
- if (!buttonEl) {
125
- return;
126
- }
127
- const portalContainerRefs = document.querySelectorAll(`._refDropdownPortal`) as NodeListOf<HTMLElement>;
128
- for (const portalContainerRef of portalContainerRefs) {
129
- portalContainerRef.classList.remove('is-shown');
130
- portalContainerRef.style.left = '0';
131
- portalContainerRef.style.top = '0';
132
- }
133
- const containerEl = buttonEl.closest('._refContainer') as HTMLElement;
134
- if (containerEl) {
135
- const offsetPos = containerEl.getBoundingClientRect();
136
- const portalContainerRef = document.querySelector(`#${portalId} ._refDropdownPortal`) as HTMLElement;
137
- if (portalContainerRef) {
138
- if (offsetPos) {
139
- portalContainerRef.style.left = offsetPos.left + ((parseInt($internalWidth || '0') + offsetPos.width) / 2) + 'px';
140
- let currentTop = offsetPos.top + offsetPos.height;
141
- const dropdownWrapperEl = portalContainerRef.querySelector('._refDropdownWrapper') as HTMLElement;
142
- if (dropdownWrapperEl) {
143
- dropdownWrapperEl.style.display = 'block';
144
- if ((currentTop + dropdownWrapperEl.clientHeight) >= document.body.clientHeight) {
145
- currentTop = offsetPos.top - dropdownWrapperEl.clientHeight - 10;
146
- }
147
- }
148
- portalContainerRef.style.top = currentTop + 'px';
149
- }
150
- portalContainerRef.classList.add('is-shown');
151
- }
152
- }
153
- }
154
- }
155
-
156
- useEffect(() => {
157
- setTimeout(() => {
158
- const portalContainerRefs = document.querySelectorAll(`._refDropdownPortal._refHover`) as NodeListOf<HTMLElement>;
159
- for (let portalContainerRef of portalContainerRefs) {
160
- portalContainerRef && portalContainerRef.addEventListener('mouseenter', (event) => {
161
- const el = event.target as HTMLElement;
162
- el.classList.add('is-shown');
163
- el.classList.add('unhiddenable');
164
- })
165
- portalContainerRef && portalContainerRef.addEventListener('mouseleave', (event) => {
166
- const el = event.target as HTMLElement;
167
- el.classList.remove('is-shown');
168
- el.classList.remove('unhiddenable');
169
- el.style.left = '0';
170
- el.style.top = '0';
171
- })
172
- }
173
- }, 1);
174
- return () => {
175
- const portalContainerRefs = document.querySelectorAll(`._refDropdownPortal._refHover`) as NodeListOf<HTMLElement>;
176
- for (let portalContainerRef of portalContainerRefs) {
177
- portalContainerRef && portalContainerRef.removeEventListener('mouseenter', (event) => {
178
- const el = event.target as HTMLElement;
179
- el.classList.add('is-shown');
180
- el.classList.add('unhiddenable');
181
- }, true)
182
- portalContainerRef && portalContainerRef.removeEventListener('mouseleave', (event) => {
183
- const el = event.target as HTMLElement;
184
- el.classList.remove('is-shown');
185
- el.classList.remove('unhiddenable');
186
- el.style.left = '0';
187
- el.style.top = '0';
188
- }, true)
189
- }
190
- };
191
- }, [portalId])
192
-
193
- const evMouseLeave: TMouseEvent = e => {
194
- const currRefEl = buttonRef.current;
195
- if (currRefEl) {
196
- const buttonEl = (e.target as HTMLElement).closest(`.${currRefEl.classList[0]}`);
197
- if (!buttonEl) {
198
- return;
199
- }
200
- setTimeout(() => {
201
- const portalContainerRef = document.querySelector(`#${portalId} ._refDropdownPortal`) as HTMLElement;
202
- if (portalContainerRef && !portalContainerRef.classList.contains('unhiddenable')) {
203
- portalContainerRef.classList.remove('is-shown');
204
- portalContainerRef.style.left = '0';
205
- portalContainerRef.style.top = '0';
206
- }
207
- }, 150);
208
- }
209
- }
210
-
211
- const evCloseDropdown = () => {
212
- evResetDropdown();
213
- }
214
-
215
- const DropDownSubTitleEl = (subTitle) ? <DropDownSubTitle>{subTitle}</DropDownSubTitle> : null;
216
- const DropDownTitleEl = (title) ? <DropDownTitle>{title} {DropDownSubTitleEl}</DropDownTitle> : null;
217
- const ControlChildrenFilter = children.filter((child: any) => isValidElement(child) ? ((child.props as any)['aria-label'] === 'control') : null);
218
- const DropDownControlEl = (ControlChildrenFilter && isValidElement(ControlChildrenFilter[0])) ?
219
- type === 'hover' ? (
220
- <DropdownControlWrapper>
221
- <DropDownControl className='_refDropdownControl' {...portalId && { onMouseEnter: evMouseEnter, onMouseLeave: evMouseLeave }}>{(ControlChildrenFilter[0].props as any).children}</DropDownControl>
222
- <DropDownControl className='_refDropdownControlMobile' ref={buttonRef} onClick={evToogleDropdown}>{(ControlChildrenFilter[0].props as any).children}</DropDownControl>
223
- </DropdownControlWrapper>
224
- ) : <DropDownControl ref={buttonRef} onClick={evToogleDropdown} >{(ControlChildrenFilter[0].props as any).children}</DropDownControl>
225
- : null
226
- const BodyChildrenFilter = children.filter((child: any) => isValidElement(child) ? ((child.props as any)['aria-label'] === 'body') : null)
227
- const DropDownBodyEl = (BodyChildrenFilter && isValidElement(BodyChildrenFilter[0])) ? <DropDownBody $area={$area}>{(BodyChildrenFilter[0].props as any).children}</DropDownBody> : null
228
- const ActionChildrenFilter = children.filter((child: any) => isValidElement(child) ? ((child.props as any)['aria-label'] === 'action') : null)
229
- const DropDownActionEl = (ActionChildrenFilter && isValidElement(ActionChildrenFilter[0])) ? <DropDownAction $position={(ActionChildrenFilter[0].props as any)['data-position']} className={(ActionChildrenFilter[0].props as any).className}>{(ActionChildrenFilter[0].props as any).children}</DropDownAction> : null
230
-
231
- const dropdownWrapperEl = <DropDownWrapper
232
- className='_refDropdownWrapper'
233
- {...$internalWidth && { $internalWidth: $internalWidth }}
234
- {...$top && { $top: $top }}
235
- {...$openPosition && { $openPosition: $openPosition }}
236
- {...$placement && { $placement: $placement }}
237
- {...$bottom && { $bottom: $bottom }}>
238
- {DropDownTitleEl}
239
- {DropDownBodyEl}
240
- {DropDownActionEl}
241
- </DropDownWrapper>
242
- return (
243
- <DropDownContainer
244
- className={`_refContainer ${type ? `_refContainer${type}` : ``}`}
245
- {...$externalWidth && { $externalWidth: $externalWidth }}
246
- {...$externalMinWidth && { $externalMinWidth: $externalMinWidth }}
247
- {...$area && { $area: $area }}
248
- {...$top && { $top: $top }}
249
- {...$alias && { $alias: $alias }}
250
- {...$openPosition && { $openPosition: $openPosition }}
251
- {...$placement && { $placement: $placement }}
252
- {...$bottom && { $bottom: $bottom }}
253
- {...props}>
254
- {DropDownControlEl}
255
- <DropDownOverlayWrapper className='_refDropdownOverlay' onClick={evCloseDropdown} />
256
- { portalId ? <ReactPortalComponent wrapperId={portalId}><DropdownPortalContainer className={`_refDropdownPortal ${type === 'hover' ? '_refHover' : ''}`}>{dropdownWrapperEl}</DropdownPortalContainer></ReactPortalComponent> : dropdownWrapperEl }
257
- </DropDownContainer>
258
- );
259
- }
260
-
261
- export default DropDownComponent;
@@ -1,333 +0,0 @@
1
- import styled from 'styled-components';
2
- import { buttonActiveShadowStyle, buttonActiveStyle } from '../../assets/stylesheets/bases.styles';
3
- import type { TDropdown } from './typed';
4
-
5
- type TDropdownChild = Pick<TDropdown, '$internalWidth' | '$openPosition' | '$placement' | '$bottom' | '$top'>
6
- type TDropdownParent = Pick<TDropdown, '$openPosition' | '$placement' | '$bottom' | '$top' | '$alias' | '$externalWidth' | '$externalMinWidth' | '$area'>
7
-
8
- const getDropDownContainerModifiedStyled = ({ $top, $bottom, $placement, $alias, $openPosition, $externalWidth, $externalMinWidth, $area }: TDropdownParent) => {
9
- const axTop = $top ? (parseInt($top) + 5)+'px' : '40px'
10
- let style = `
11
- @keyframes droptodown {
12
- 90% {
13
- top: ${axTop};
14
- }
15
- 100% {
16
- top: ${$top || '35px'};
17
- }
18
- }
19
- @keyframes droptoup {
20
- 50% {
21
- bottom: -100px;
22
- }
23
- 50% {
24
- bottom: -50px;
25
- }
26
- 100% {
27
- bottom: 0px;
28
- }
29
- }
30
- @keyframes dropgodown {
31
- 90% {
32
- bottom: ${axTop};
33
- }
34
- 100% {
35
- bottom: ${$bottom || '35px'};
36
- }
37
- }
38
- @keyframse dropgoup {
39
- 50% {
40
- top: -100px;
41
- }
42
- 50% {
43
- top: -50px;
44
- }
45
- 100% {
46
- top: 0px;
47
- }
48
- }
49
- & ${DropDownWrapper} {
50
- display: none;
51
- }
52
- &.is-shown {
53
- & ${DropDownControl} button {
54
- &._refNoActive {
55
- ${buttonActiveShadowStyle}
56
- }
57
- &:not(._refNoActive) {
58
- ${buttonActiveStyle}
59
- }
60
- }
61
- @media only screen and (max-width: 767px) {
62
- & ${DropDownWrapper} {
63
- display: grid;
64
- left: 0;
65
- bottom:0;
66
- ${$placement === 'top' ? 'animation: dropgoup .075s;' : 'animation: droptoup .075s;'}
67
- overflow-x: hidden;
68
- }
69
- & ${DropDownBody} {
70
- ._refFilterDropdown a {
71
- text-align: left !important;
72
- }
73
- }
74
- }
75
- @media only screen and (min-width: 768px) {
76
- & ${DropDownWrapper} {
77
- display: grid;
78
- ${$placement === 'top' ? `animation: dropgodown .075s linear; bottom: ${$bottom || '35px'}; top: auto;` : `animation: droptodown .075s linear; top: ${$top || '35px'};`}
79
- left: ${($alias === "_dropdownFilterContainer" && $openPosition !== 'left') ? '100%': $openPosition === 'left' ? '0' : 'auto'};
80
- }
81
- }
82
- @media only screen and (min-width: 1024px) {
83
- & ${DropDownWrapper} {
84
- left: ${($alias === "_dropdownFilterContainer" && $openPosition !== 'left') ? '30%': $openPosition === 'left' ? '0' : 'auto'};
85
- }
86
- }
87
- @media only screen and (min-width: 1280px) {
88
- & ${DropDownWrapper} {
89
- left: ${($alias === "_dropdownFilterContainer" && $openPosition !== 'left') ? '0': $openPosition === 'left' ? '0' : 'auto'};
90
- }
91
- }
92
- }
93
- `
94
- if ($alias === '_dropdownFilterContainer') {
95
- style += `
96
- margin-top: 4px;
97
- ${DropDownControl} {
98
- margin-top: -4px;
99
- }
100
- `
101
- }
102
- if ($externalWidth) {
103
- style += `
104
- width: ${$externalWidth}
105
- `
106
- }
107
- if ($externalMinWidth) {
108
- style += `
109
- min-width: ${$externalMinWidth}
110
- `
111
- }
112
- if ($area === 'mobile') {
113
- style += `
114
- @media (min-width: 320px) and (max-width: 480px) {
115
- ${DropDownWrapper} {
116
- width: 100%;
117
- align-content: start;
118
- z-index: 88;
119
- }
120
- }
121
- `
122
- }
123
- return style
124
- }
125
-
126
- const getDropDownWrapperModifiedStyled = ({ $internalWidth, $openPosition, $placement, $bottom, $top }: TDropdownChild) => {
127
- let style = ''
128
- if ($internalWidth) {
129
- style += `
130
- width: ${$internalWidth};
131
- `
132
- } else {
133
- style +=`
134
- width: auto;
135
- white-space: nowrap;
136
- ${DropDownBody} {
137
- overflow: unset;
138
- }
139
- `
140
- }
141
- if ($openPosition === 'left') {
142
- style += `
143
- left: 0;
144
- right: auto;
145
- `
146
- } else if ($openPosition === 'center') {
147
- style += `
148
- left: 50%;
149
- right: auto;
150
- transform: translateX(-50%);
151
- `
152
- }
153
- if ($placement === 'top' && $bottom) {
154
- style += `
155
- top: unset; bottom: ${$bottom}
156
- `
157
- } else if ($top) {
158
- style += `
159
- top: ${$top};
160
- `
161
- }
162
- return style
163
- }
164
-
165
- const getDropDownBodyModifiedStyled = ({ $area }:{ $area?: string }) => {
166
- let style = ''
167
- if ($area === 'promotion') {
168
- style += `
169
- max-height: 347px;
170
- overflow-y: auto;
171
- `
172
- }
173
- return style
174
- }
175
-
176
- const getDropDownActionModifiedStyled = ({ $position }:{ $position?: string }) => {
177
- let style = `
178
- justify-self: end;
179
- `
180
- if ($position === 'middle') {
181
- style += `
182
- width: 100%;
183
- text-align: center;
184
- `
185
- } else if ($position === 'left') {
186
- style += `
187
- width: 100%;
188
- `
189
- } else if ($position === 'end') {
190
- style += `
191
- width: 100%;
192
- text-align: end
193
- `
194
- }
195
- return style
196
- }
197
-
198
- export const DropDownWrapper = styled.section<TDropdownChild>`
199
- background-color: var(--pri-clr-bg);
200
- border: 1px solid var(--sec-clr-ln);
201
- position: fixed;
202
- width: 100vw;
203
- z-index: 102;
204
- display: none;
205
- border-radius: 10px 10px 0px 0px;
206
- > div,
207
- > section {
208
- padding: 1em;
209
- }
210
- @media only screen and (min-width: 768px) {
211
- position: absolute;
212
- min-width: 110px;
213
- width: 100vw;
214
- top: 40px;
215
- right: 0;
216
- z-index: 10;
217
- border: none;
218
- border-radius: .75rem;
219
- box-shadow: 0rem .5rem 1.5rem -.5rem rgba(0, 0, 0, .05), 0rem .5rem 1rem -.25rem rgba(0, 0, 0, .05), 0rem .1875rem .375rem 0rem rgba(0, 0, 0, .05), 0rem .125rem .25rem 0rem rgba(0, 0, 0, .05), 0rem .0625rem .125rem 0rem rgba(0, 0, 0, .05), 0rem 0rem 0rem .0625rem rgba(0, 0, 0, .06);
220
- > div,
221
- > section {
222
- padding: 1em;
223
- ._refFilterDropdown {
224
- > * {
225
- margin-left: -1em;
226
- margin-right: -1em;
227
- &:first-child {
228
- margin-top: -1em;
229
- }
230
- &:last-child {
231
- margin-bottom: -1em;
232
- }
233
- }
234
- > article {
235
- padding: 1em;
236
- width: calc(100% + 2em);
237
- }
238
- }
239
- }
240
- ${getDropDownWrapperModifiedStyled}
241
- }
242
- `
243
-
244
- export const DropDownOverlayWrapper = styled.div`
245
- width: 100%;
246
- height: 100%;
247
- position: fixed;
248
- top: 0;
249
- left: 0;
250
- z-index: 100;
251
- background-color: rgba(0, 0, 0, .1);
252
- display: none;
253
- @media only screen and (min-width: 768px) {
254
- display: none !important;
255
- }
256
- `
257
-
258
- export const DropDownControl = styled.section`
259
- display: block;
260
- `
261
-
262
- export const DropdownControlWrapper = styled.div`
263
- ._refDropdownControl {
264
- display: none;
265
- }
266
- ._refDropdownControlMobile {
267
- display: block;
268
- }
269
- @media only screen and (min-width: 1024px) {
270
- ._refDropdownControl {
271
- display: block;
272
- }
273
- ._refDropdownControlMobile {
274
- display: none;
275
- }
276
- }
277
- `
278
-
279
- export const DropDownContainer = styled.section<{ $area?: string }>`
280
- position: relative;
281
- ${getDropDownContainerModifiedStyled}
282
- @media only screen and (min-width: 1024px) {
283
- &._refContainerhover:hover {
284
- ${DropDownWrapper} {
285
- display: grid;
286
- animation: droptodown .075s linear;
287
- top: '35px';
288
- }
289
- }
290
- }
291
- `
292
-
293
- export const DropDownTitle = styled.div`
294
- font-weight: 600;
295
- border-bottom: 1px solid var(--sec-clr-ln);
296
- `
297
-
298
- export const DropDownSubTitle = styled.p`
299
- color: var(--mt-clr);
300
- margin-top: 4px;
301
- margin-bottom: 0;
302
- font-weight: 400;
303
- line-height: 1;
304
- letter-spacing: normal;
305
- `
306
-
307
- export const DropDownBody = styled.section<{ $area?: string }>`
308
- overflow-y: auto;
309
- max-height: 75vh;
310
- overflow-x: hidden;
311
- @media (max-width: 767px) {
312
- max-height: 65vh;
313
- }
314
- ${getDropDownBodyModifiedStyled}
315
- `
316
-
317
- export const DropDownAction = styled.section<{ $position?: string }>`
318
- border-top: 1px solid var(--sec-clr-ln);
319
- ${getDropDownActionModifiedStyled}
320
- `
321
-
322
- export const DropdownPortalContainer = styled.div`
323
- display: inline-block;
324
- position: fixed;
325
- top: 0;
326
- left: 0;
327
- z-index: 999;
328
- &.is-shown {
329
- & ${DropDownWrapper} {
330
- display: block;
331
- }
332
- }
333
- `