diginet-core-ui 1.3.33 → 1.3.34

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.
@@ -3,6 +3,7 @@
3
3
  /** @jsx jsx */
4
4
  import { Fragment, memo, useState, useEffect, useMemo, useRef, useImperativeHandle, forwardRef } from 'react';
5
5
  import ReactDOM from 'react-dom';
6
+ import { createPortal } from 'react-dom';
6
7
  import PropTypes from 'prop-types';
7
8
  import { jsx, css } from '@emotion/core';
8
9
  import { Account } from '../../../icons';
@@ -121,71 +122,71 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
121
122
 
122
123
 
123
124
  const forInput = css`
124
- ${flexRow}
125
- flex: 1 1 auto;
126
- ${!multiple && renderSelectedItem ? `width: calc(100% - 34px${clearAble ? ' - 18px' : ''})` : ''}
127
- `;
125
+ ${flexRow}
126
+ flex: 1 1 auto;
127
+ ${!multiple && renderSelectedItem ? `width: calc(100% - 34px${clearAble ? ' - 18px' : ''})` : ''}
128
+ `;
128
129
  const DropdownIcon = css`
129
- ${inlineFlex}
130
- ${alignCenter}
130
+ ${inlineFlex}
131
+ ${alignCenter}
131
132
  ${positionRelative}
132
133
  ${overflowHidden}
133
134
  height: inherit;
134
- margin-right: 8px;
135
- height: 32px;
136
- width: 32px;
137
- border-radius: 16px;
138
- img {
139
- height: 32px;
140
- width: 32px;
141
- object-fit: cover;
142
- }
143
- `;
135
+ margin-right: 8px;
136
+ height: 32px;
137
+ width: 32px;
138
+ border-radius: 16px;
139
+ img {
140
+ height: 32px;
141
+ width: 32px;
142
+ object-fit: cover;
143
+ }
144
+ `;
144
145
  const DropdownInput = css`
145
- ${flexRow}
146
- ${alignCenter}
146
+ ${flexRow}
147
+ ${alignCenter}
147
148
  ${outlineNone}
148
149
  ${backgroundTransparent}
149
150
  ${paragraph1};
150
- width: 100%;
151
- border: none;
152
- color: ${main};
153
- padding-top: 0;
154
- padding-bottom: ${viewType !== 'outlined' ? 0 : 'inherit'};
155
- padding-left: ${viewType !== 'outlined' ? 0 : '16px'};
156
- min-height: ${multiple ? 30 : 24}px;
157
- &.dgn-dropdown-multiple {
158
- ${flexWrap}
159
- ${overflowHidden}
151
+ width: 100%;
152
+ border: none;
153
+ color: ${main};
154
+ padding-top: 0;
155
+ padding-bottom: ${viewType !== 'outlined' ? 0 : 'inherit'};
156
+ padding-left: ${viewType !== 'outlined' ? 0 : '16px'};
157
+ min-height: ${multiple ? 30 : 24}px;
158
+ &.dgn-dropdown-multiple {
159
+ ${flexWrap}
160
+ ${overflowHidden}
160
161
  /* max-height: max-content; */
161
162
  word-break: break-word;
162
- ${!multiple ? 'min-height: 24px; max-width: 100%; white-space: nowrap;' : ''}
163
- &::after {
164
- ${flexRow}
165
- ${positionAbsolute}
163
+ ${!multiple ? 'min-height: 24px; max-width: 100%; white-space: nowrap;' : ''}
164
+ &::after {
165
+ ${flexRow}
166
+ ${positionAbsolute}
166
167
  ${alignCenter}
167
168
  ${justifyCenter}
168
169
  content: '${placeholder}';
169
- color: ${sub};
170
- }
171
- &:not(:empty)::after {
172
- visibility: hidden;
173
- }
174
- }
175
- &:focus {
176
- ${backgroundTransparent}
177
- }
178
- .dropdown-item {
179
- &:not(:last-child) {
180
- margin-right: 5px;
181
- }
182
- svg {
183
- ${borderBox}
184
- padding: ${itemMultipleSize === 'medium' ? 2 : 1}px;
185
- }
186
- }
187
- .css-${DropdownIcon.name} {
188
- ${renderSelectedItem ? `
170
+ color: ${sub};
171
+ }
172
+ &:not(:empty)::after {
173
+ visibility: hidden;
174
+ }
175
+ }
176
+ &:focus {
177
+ ${backgroundTransparent}
178
+ }
179
+ .dropdown-item {
180
+ &:not(:last-child) {
181
+ margin-right: 5px;
182
+ }
183
+ svg {
184
+ ${borderBox}
185
+ padding: ${itemMultipleSize === 'medium' ? 2 : 1}px;
186
+ }
187
+ }
188
+ .css-${DropdownIcon.name} {
189
+ ${renderSelectedItem ? `
189
190
  min-height: 24px;
190
191
  min-width: 24px;
191
192
  ` : `
@@ -196,230 +197,230 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
196
197
  width: 24px;
197
198
  }
198
199
  `}
199
- }
200
- `;
200
+ }
201
+ `;
201
202
  const forIcon = css`
202
- ${flexRow}
203
- ${alignCenter}
203
+ ${flexRow}
204
+ ${alignCenter}
204
205
  margin-left: 8px;
205
- margin-right: ${viewType !== 'outlined' ? 2 : 16}px;
206
- color: inherit;
207
- .icon-close {
208
- display: ${showClear ? 'flex' : 'none'};
209
- margin-right: 4px;
210
- }
211
- .dgn-dropdown-loading {
212
- display: ${loading ? 'flex' : 'none'};
213
- }
214
- `;
206
+ margin-right: ${viewType !== 'outlined' ? 2 : 16}px;
207
+ color: inherit;
208
+ .icon-close {
209
+ display: ${showClear ? 'flex' : 'none'};
210
+ margin-right: 4px;
211
+ }
212
+ .dgn-dropdown-loading {
213
+ display: ${loading ? 'flex' : 'none'};
214
+ }
215
+ `;
215
216
  const DropdownForm = viewType !== 'outlined' ? css`
216
- ${flexRow}
217
- ${alignCenter}
217
+ ${flexRow}
218
+ ${alignCenter}
218
219
  ${positionRelative}
219
220
  ${borderBox}
220
221
  flex: 1 1 auto;
221
- padding-bottom: ${multiple ? 1 : 4}px;
222
- padding-top: ${multiple ? 1 : 4}px;
223
- &:not(:focus-within):hover {
224
- &::before {
225
- border-bottom-color: ${active};
226
- }
227
- .css-${DropdownInput.name} {
228
- color: ${active};
229
- }
230
- }
231
- &:focus-within {
232
- border-bottom-color: ${focus};
233
- &::after {
234
- border-bottom-color: inherit;
235
- transform: scaleX(1);
236
- }
237
- .css-${DropdownInput.name} {
238
- color: ${active};
239
- }
240
- }
241
- &.dropdown-showing {
242
- .icon-dropdown {
243
- transform: rotateX(180deg);
244
- }
245
- }
246
- &::placeholder {
247
- color: ${sub};
248
- }
249
- &::before {
250
- ${positionAbsolute}
251
- content: '';
252
- left: 0;
253
- right: 0;
254
- bottom: 0;
255
- border-bottom: 1px solid ${rest};
256
- }
257
- &::after {
258
- ${positionAbsolute}
259
- content: '';
260
- left: 0px;
261
- right: 0px;
262
- bottom: -1px;
263
- border-bottom: 2px solid transparent;
264
- transform: scaleX(0);
265
- transform-origin: center;
266
- transition: all 0.2s ease;
267
- }
268
- ` : css`
269
- ${flexRow}
270
- ${alignCenter}
222
+ padding-bottom: ${multiple ? 1 : 4}px;
223
+ padding-top: ${multiple ? 1 : 4}px;
224
+ &:not(:focus-within):hover {
225
+ &::before {
226
+ border-bottom-color: ${active};
227
+ }
228
+ .css-${DropdownInput.name} {
229
+ color: ${active};
230
+ }
231
+ }
232
+ &:focus-within {
233
+ border-bottom-color: ${focus};
234
+ &::after {
235
+ border-bottom-color: inherit;
236
+ transform: scaleX(1);
237
+ }
238
+ .css-${DropdownInput.name} {
239
+ color: ${active};
240
+ }
241
+ }
242
+ &.dropdown-showing {
243
+ .icon-dropdown {
244
+ transform: rotateX(180deg);
245
+ }
246
+ }
247
+ &::placeholder {
248
+ color: ${sub};
249
+ }
250
+ &::before {
251
+ ${positionAbsolute}
252
+ content: '';
253
+ left: 0;
254
+ right: 0;
255
+ bottom: 0;
256
+ border-bottom: 1px solid ${rest};
257
+ }
258
+ &::after {
259
+ ${positionAbsolute}
260
+ content: '';
261
+ left: 0px;
262
+ right: 0px;
263
+ bottom: -1px;
264
+ border-bottom: 2px solid transparent;
265
+ transform: scaleX(0);
266
+ transform-origin: center;
267
+ transition: all 0.2s ease;
268
+ }
269
+ ` : css`
270
+ ${flexRow}
271
+ ${alignCenter}
271
272
  ${positionRelative}
272
273
  ${borderRadius4px}
273
274
  ${borderBox}
274
275
  flex: 1 1 auto;
275
- border: 1px solid ${rest};
276
- min-height: 40px;
277
- &:not(:focus-within):hover {
278
- background-color: ${hover};
279
- border-color: ${active};
280
- input {
281
- background-color: ${hover};
282
- }
283
- }
284
- &:focus-within {
285
- border-color: ${focus};
286
- }
287
- &.dropdown-showing {
288
- .icon-dropdown {
289
- transform: rotateX(180deg);
290
- }
291
- }
292
- &::placeholder {
293
- color: ${sub};
294
- }
295
- &::after {
296
- ${positionAbsolute}
297
- ${pointerEventsNone}
276
+ border: 1px solid ${rest};
277
+ min-height: 40px;
278
+ &:not(:focus-within):hover {
279
+ background-color: ${hover};
280
+ border-color: ${active};
281
+ input {
282
+ background-color: ${hover};
283
+ }
284
+ }
285
+ &:focus-within {
286
+ border-color: ${focus};
287
+ }
288
+ &.dropdown-showing {
289
+ .icon-dropdown {
290
+ transform: rotateX(180deg);
291
+ }
292
+ }
293
+ &::placeholder {
294
+ color: ${sub};
295
+ }
296
+ &::after {
297
+ ${positionAbsolute}
298
+ ${pointerEventsNone}
298
299
  content: '';
299
- left: -2px;
300
- right: -2px;
301
- top: -2px;
302
- bottom: -2px;
303
- border: 2px solid transparent;
304
- border-radius: 4px;
305
- }
306
- `;
300
+ left: -2px;
301
+ right: -2px;
302
+ top: -2px;
303
+ bottom: -2px;
304
+ border: 2px solid transparent;
305
+ border-radius: 4px;
306
+ }
307
+ `;
307
308
  const DropdownBox = css`
308
- ${displayBlock}
309
- ${positionRelative}
309
+ ${displayBlock}
310
+ ${positionRelative}
310
311
  ${borderBox}
311
312
  width: 100%;
312
- max-height: 280px;
313
- overflow: auto;
314
- background-color: #FFF;
315
- border-radius: 4px;
316
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
317
- z-index: 9001;
318
- &::-webkit-scrollbar {
319
- width: 24px;
320
- background-color: #FFF !important;
321
- border-radius: 4px;
322
- }
323
- &::-webkit-scrollbar-thumb {
324
- border-radius: 24px;
325
- border: 8px solid transparent;
326
- mix-blend-mode: normal;
327
- background-color: ${scrollbar} !important;
328
- background-clip: content-box;
329
- }
330
- .DGN-UI-TreeView {
331
- padding: 1px;
332
- }
333
- `;
313
+ max-height: 280px;
314
+ overflow: auto;
315
+ background-color: #fff;
316
+ border-radius: 4px;
317
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
318
+ z-index: 9001;
319
+ &::-webkit-scrollbar {
320
+ width: 24px;
321
+ background-color: #fff !important;
322
+ border-radius: 4px;
323
+ }
324
+ &::-webkit-scrollbar-thumb {
325
+ border-radius: 24px;
326
+ border: 8px solid transparent;
327
+ mix-blend-mode: normal;
328
+ background-color: ${scrollbar} !important;
329
+ background-clip: content-box;
330
+ }
331
+ .DGN-UI-TreeView {
332
+ padding: 1px;
333
+ }
334
+ `;
334
335
  const DropdownItem = css`
335
- ${flexRow}
336
- ${positionRelative}
336
+ ${flexRow}
337
+ ${positionRelative}
337
338
  ${alignCenter}
338
339
  ${justifyStart}
339
340
  ${borderBox}
340
341
  ${cursorPointer}
341
342
  ${userSelectNone}
342
343
  min-height: 40px;
343
- width: 100%;
344
- background-color: #FFF;
345
- padding: 8px ${multiple && selectBox ? 0 : '16px'};
346
- color: ${main};
347
- &.no-data {
348
- font-style: italic;
349
- justify-content: center;
350
- cursor: initial;
351
- }
352
- &:not(.no-data):hover,
353
- &:not(.no-data):focus {
354
- background-color: ${hover};
355
- color: ${active};
356
- outline: none;
357
- }
358
- `;
344
+ width: 100%;
345
+ background-color: #fff;
346
+ padding: 8px ${multiple && selectBox ? 0 : '16px'};
347
+ color: ${main};
348
+ &.no-data {
349
+ font-style: italic;
350
+ justify-content: center;
351
+ cursor: initial;
352
+ }
353
+ &:not(.no-data):hover,
354
+ &:not(.no-data):focus {
355
+ background-color: ${hover};
356
+ color: ${active};
357
+ outline: none;
358
+ }
359
+ `;
359
360
  const DropdownText = css`
360
- ${paragraph1};
361
- color: inherit;
362
- .DGN-UI-Dropdown-PrimaryText {
363
- ${paragraph1};
364
- ${displayBlock}
365
- }
366
- .DGN-UI-Dropdown-SubText {
367
- ${paragraph3};
368
- ${displayBlock}
369
- color: ${sub};
370
- }
371
- `;
361
+ ${paragraph1};
362
+ color: inherit;
363
+ .DGN-UI-Dropdown-PrimaryText {
364
+ ${paragraph1};
365
+ ${displayBlock}
366
+ }
367
+ .DGN-UI-Dropdown-SubText {
368
+ ${paragraph3};
369
+ ${displayBlock}
370
+ color: ${sub};
371
+ }
372
+ `;
372
373
  const DropdownRoot = css`
373
- ${displayBlock}
374
- ${positionRelative}
374
+ ${displayBlock}
375
+ ${positionRelative}
375
376
  margin-bottom: 20px;
376
- min-width: 150px;
377
- height: max-content;
378
- &.error {
379
- .css-${DropdownForm.name} {
380
- border-color: ${danger};
381
- path {
382
- fill: ${danger};
383
- }
384
- &::before {
385
- border-color: ${danger};
377
+ min-width: 150px;
378
+ height: max-content;
379
+ &.error {
380
+ .css-${DropdownForm.name} {
381
+ border-color: ${danger};
382
+ path {
383
+ fill: ${danger};
384
+ }
385
+ &::before {
386
+ border-color: ${danger};
387
+ }
388
+ }
386
389
  }
387
- }
388
- }
389
- &.dgn-dropdown-loading,
390
- &.disabled {
391
- ${pointerEventsNone}
392
- ${userSelectNone}
390
+ &.dgn-dropdown-loading,
391
+ &.disabled {
392
+ ${pointerEventsNone}
393
+ ${userSelectNone}
393
394
  .css-${DropdownInput.name} {
394
- //color: ${systemDisabled} !important;
395
- }
396
- .css-${DropdownForm.name} {
397
- border-color: ${systemDisabled};
398
- .css-${forIcon.name} {
399
- path {
400
- fill: transparent;
395
+ //color: ${systemDisabled} !important;
396
+ }
397
+ .css-${DropdownForm.name} {
398
+ border-color: ${systemDisabled};
399
+ .css-${forIcon.name} {
400
+ path {
401
+ fill: transparent;
402
+ }
403
+ }
404
+ &::before {
405
+ border-color: ${systemDisabled};
406
+ }
401
407
  }
402
408
  }
403
- &::before {
404
- border-color: ${systemDisabled};
405
- }
406
- }
407
- }
408
- &.readOnly {
409
- .css-${forIcon.name} {
410
- ${pointerEventsNone}
411
- }
412
- .css-${DropdownInput.name} {
413
- .dropdown-item {
414
- ${pointerEventsNone}
409
+ &.readOnly {
410
+ .css-${forIcon.name} {
411
+ ${pointerEventsNone}
412
+ }
413
+ .css-${DropdownInput.name} {
414
+ .dropdown-item {
415
+ ${pointerEventsNone}
416
+ }
417
+ }
415
418
  }
416
- }
417
- }
418
- `;
419
+ `;
419
420
  const Disabled = css`
420
- pointer-events: none !important;
421
- opacity: 0.4 !important;
422
- `;
421
+ pointer-events: none !important;
422
+ opacity: 0.4 !important;
423
+ `;
423
424
  /* End styled */
424
425
 
425
426
  /* Start handler */
@@ -494,6 +495,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
494
495
  };
495
496
 
496
497
  const showDropdown = () => {
498
+ var _searchRef$current;
499
+
497
500
  if (displayExpr && Array.isArray(displayExpr)) {
498
501
  displayExpr = displayExpr.join(' - ');
499
502
  }
@@ -524,58 +527,76 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
524
527
  }
525
528
  }
526
529
 
527
- const el = document.createElement('div');
528
- const elBox = document.createElement('div');
529
- const elLoading = document.createElement('div');
530
- let _cssText = `position: fixed; top: ${positionTop}px; left: ${left}px; width: ${width}px; background-color: #FFF; opacity: 0; transition: opacity 0.3s; z-index: 9001;`;
531
- if (_isMobile && allowSearch) _cssText += `bottom: 0px; top: auto; display: flex; flex-direction: column-reverse; height: max-content`;
532
- el.style.cssText = _cssText;
533
- elLoading.style.cssText = `display: none; justify-content: center; align-items: center;position: absolute; top: 0; width: 100%; height: 100%; background-color: rgba(255, 255, 255, 0.6); border-radius: 4px; opacity: 0; transition: opacity 0.3s; z-index: 9002;`;
534
- el.className = `DGN-UI-Portal DGN-Dropdown-${unique}`;
535
- elBox.className = `DGN-Dropdown-Box`;
536
- elLoading.className = `DGN-Dropdown-Loading`;
537
- const node = document.body.appendChild(el);
538
-
539
- if ((multiple || allowSearch) && itemMode === 'normal' && !children) {
540
- var _searchRef$current;
541
-
542
- const defaultSearch = !!onInput ? (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.value : '';
543
- const searchInput = jsx(InputBase, {
544
- inputRef: searchRef,
545
- viewType: 'outlined',
546
- defaultValue: defaultSearch,
547
- onChange: onChangeInput,
548
- style: {
549
- backgroundColor: '#FFF',
550
- marginBottom: 1
551
- },
552
- onKeyDown: pressESCHandler,
553
- autoFocus: true
554
- });
555
- const elSearch = document.createElement('div');
556
- elSearch.className = `DGN-Dropdown-Box-Search`;
557
- ReactDOM.render(searchInput, node.appendChild(elSearch));
558
- } else {
530
+ let dropdownStyle = {
531
+ position: 'fixed',
532
+ top: `${positionTop}px`,
533
+ left: `${left}px`,
534
+ width: `${width}px`,
535
+ backgroundColor: '#FFF',
536
+ zIndex: 9001
537
+ };
538
+ if (_isMobile && allowSearch) dropdownStyle = { ...dropdownStyle,
539
+ bottom: 0,
540
+ top: 'auto',
541
+ display: 'flex',
542
+ flexDirection: 'column-reverse',
543
+ height: 'max-content'
544
+ };
545
+ const loadingStyle = {
546
+ display: 'none',
547
+ justifyContent: 'center',
548
+ alignItems: 'center',
549
+ position: 'absolute',
550
+ top: 0,
551
+ width: '100%',
552
+ height: '100%',
553
+ backgroundColor: 'rgba(255, 255, 255, 0.6)',
554
+ borderRadius: 4,
555
+ zIndex: 9002
556
+ };
557
+ const defaultSearch = onInput ? (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.value : '';
558
+ const el = jsx("div", {
559
+ className: `DGN-UI-Portal DGN-Dropdown-${unique}`,
560
+ style: dropdownStyle
561
+ }, (multiple || allowSearch) && itemMode === 'normal' && !children && jsx("div", {
562
+ className: 'DGN-Dropdown-Box-Search'
563
+ }, jsx(InputBase, {
564
+ inputRef: searchRef,
565
+ viewType: 'outlined',
566
+ defaultValue: defaultSearch,
567
+ onChange: onChangeInput,
568
+ style: {
569
+ backgroundColor: '#FFF',
570
+ marginBottom: 1
571
+ },
572
+ onKeyDown: pressESCHandler,
573
+ autoFocus: true
574
+ })), jsx("div", {
575
+ className: 'DGN-Dropdown-Box'
576
+ }, dropdown), jsx("div", {
577
+ className: 'DGN-Dropdown-Loading',
578
+ style: loadingStyle
579
+ }, jsx(CircularProgress, {
580
+ size: 'xs'
581
+ })));
582
+
583
+ if (!((multiple || allowSearch) && itemMode === 'normal' && !children)) {
559
584
  inputRef.current.addEventListener('keydown', pressESCHandler);
560
585
  }
561
586
 
562
- ReactDOM.render(dropdown, node.appendChild(elBox));
563
- ReactDOM.render(jsx(CircularProgress, {
564
- size: 'xs'
565
- }), node.appendChild(elLoading));
566
587
  document.documentElement.style.overflow = 'hidden';
567
588
  setTimeout(() => {
568
- el.style.opacity = 1;
569
589
  window.addEventListener('resize', customizeWidthDropdown);
570
590
  document.addEventListener('wheel', onWheelHandler);
571
- document.addEventListener('click', onClickOutsideOfInput);
591
+ document.addEventListener('mousedown', onClickOutsideOfInput);
572
592
  document.addEventListener('keydown', preventScroll);
573
- boxRef.current.addEventListener('keydown', moveOnItem);
593
+ boxRef.current && boxRef.current.addEventListener('keydown', moveOnItem);
574
594
 
575
595
  if (onLoadMore && dataSource.length < total) {
576
596
  boxRef.current.addEventListener('scroll', onLoadMoreHandler);
577
597
  }
578
598
  }, 10);
599
+ return el;
579
600
  };
580
601
 
581
602
  const moveOnItem = e => {
@@ -587,7 +608,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
587
608
  activeEl.focus();
588
609
  activeEl.scrollIntoView({
589
610
  block: 'center',
590
- behavior: "smooth"
611
+ behavior: 'smooth'
591
612
  });
592
613
  }
593
614
  }
@@ -643,7 +664,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
643
664
  boxRef.current = null;
644
665
  }, 300);
645
666
  setOpenState(false);
646
- document.removeEventListener('click', onClickOutsideOfInput);
667
+ document.removeEventListener('mousedown', onClickOutsideOfInput);
647
668
  window.removeEventListener('resize', customizeWidthDropdown);
648
669
  document.removeEventListener('wheel', onWheelHandler);
649
670
  document.removeEventListener('keydown', preventScroll);
@@ -687,7 +708,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
687
708
  const items = [];
688
709
  const dataSourceUsable = [...dataSource];
689
710
 
690
- if (onLoadMore && currentObjectDefault[unique].length) {
711
+ if (currentObjectDefault[unique] && currentObjectDefault[unique].length) {
691
712
  const length = currentObjectDefault[unique].length;
692
713
  let existItemQuantity = 0;
693
714
 
@@ -729,7 +750,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
729
750
  }
730
751
 
731
752
  const value = typeof data === 'object' ? data[valueExpr] : data;
732
- const itemDisabled = typeof data === 'object' ? data["disabled"] : data;
753
+ const itemDisabled = typeof data === 'object' ? data['disabled'] : data;
733
754
  const icon = getIconFromData(data);
734
755
 
735
756
  if (multiple && selectBox) {
@@ -787,7 +808,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
787
808
  }, items.length ? items : jsx("div", {
788
809
  css: DropdownItem,
789
810
  className: 'no-data'
790
- }, " ", noDataText, " "));
811
+ }, ' ', noDataText, ' '));
791
812
  };
792
813
 
793
814
  const mapTreeView = () => {
@@ -1268,7 +1289,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1268
1289
  }
1269
1290
  }
1270
1291
 
1271
- if (onLoadMore && currentObjectDefault[unique].length) {
1292
+ if (currentObjectDefault[unique].length) {
1272
1293
  const itemOfValue = currentObjectDefault[unique].find(valueObject => valueObject[valueExpr] === v || valueObject === v);
1273
1294
 
1274
1295
  if (itemOfValue) {
@@ -1286,7 +1307,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1286
1307
  }
1287
1308
  }
1288
1309
 
1289
- if (onLoadMore && currentObjectDefault[unique].length) {
1310
+ if (currentObjectDefault[unique].length) {
1290
1311
  const itemOfValue = currentObjectDefault[unique].find(valueObject => valueObject[valueExpr] === source || valueObject === source);
1291
1312
 
1292
1313
  if (itemOfValue) {
@@ -1374,7 +1395,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1374
1395
  setShowClear(clearAble && checkHasValue(valueProp) && !disabled && !readOnly && !loading);
1375
1396
  }, [clearAble, valueProp, disabled, readOnly, loading]);
1376
1397
  useEffect(() => {
1377
- if (onLoadMore && valueObjectDefault) {
1398
+ if (valueObjectDefault) {
1378
1399
  if (Array.isArray(valueObjectDefault)) {
1379
1400
  currentObjectDefault[unique] = [...valueObjectDefault];
1380
1401
  } else if (typeof valueObjectDefault === 'object') {
@@ -1631,13 +1652,13 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
1631
1652
  }, error), [error, valueProp, disabled, errorState]);
1632
1653
  /* End component */
1633
1654
 
1634
- return jsx("div", {
1655
+ return jsx(Fragment, null, jsx("div", {
1635
1656
  ref: dropdownRef,
1636
1657
  css: DropdownRoot,
1637
1658
  className: ['DGN-UI-Dropdown', className, errorState && 'error', loading && 'dgn-dropdown-loading', disabled ? 'disabled' : readOnly && 'readOnly'].join(' ').trim().replace(/\s+/g, ' '),
1638
1659
  style: style,
1639
1660
  ...props
1640
- }, labelComp, inputComp, errorComp);
1661
+ }, labelComp, inputComp, errorComp), openState ? /*#__PURE__*/createPortal(showDropdown(), document.body) : null);
1641
1662
  }));
1642
1663
  Dropdown.defaultProps = {
1643
1664
  viewType: 'underlined',
@@ -1702,14 +1723,14 @@ Dropdown.propTypes = {
1702
1723
  /** display this icon if not found the icon follow iconExpr */
1703
1724
  iconDefault: PropTypes.string,
1704
1725
 
1705
- /** field name used for icon display<br/>
1706
- * Example:<br/>
1707
- * &nbsp;&nbsp;string: 'icon'<br/>
1708
- * &nbsp;&nbsp;object: {<br/>
1709
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key: 'icon',<br/>
1710
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefix: 'https://imglink.com',<br/>
1711
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;suffix: '.jpg'<br/>
1712
- * &nbsp;&nbsp;}
1726
+ /** field name used for icon display<br/>
1727
+ * Example:<br/>
1728
+ * &nbsp;&nbsp;string: 'icon'<br/>
1729
+ * &nbsp;&nbsp;object: {<br/>
1730
+ * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key: 'icon',<br/>
1731
+ * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefix: 'https://imglink.com',<br/>
1732
+ * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;suffix: '.jpg'<br/>
1733
+ * &nbsp;&nbsp;}
1713
1734
  */
1714
1735
  iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
1715
1736
  key: PropTypes.string,
@@ -1727,9 +1748,9 @@ Dropdown.propTypes = {
1727
1748
  /** field name used for text display in input */
1728
1749
  keyExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
1729
1750
 
1730
- /** field name used for text display<br/>
1731
- * Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
1732
- * Note: don't use 'id - name', return undefined
1751
+ /** field name used for text display<br/>
1752
+ * Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
1753
+ * Note: don't use 'id - name', return undefined
1733
1754
  */
1734
1755
  displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
1735
1756
 
@@ -1739,9 +1760,9 @@ Dropdown.propTypes = {
1739
1760
  /** the field name used for the returned result */
1740
1761
  valueExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
1741
1762
 
1742
- /**
1743
- * duration wait enter search content on search<br/>
1744
- * Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
1763
+ /**
1764
+ * duration wait enter search content on search<br/>
1765
+ * Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
1745
1766
  */
1746
1767
  searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
1747
1768
 
@@ -1811,19 +1832,19 @@ Dropdown.propTypes = {
1811
1832
  /** The function to get ref of Dropdown component */
1812
1833
  refs: PropTypes.func,
1813
1834
 
1814
- /** function displays items by custom<br/>
1815
- * renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
1816
- * --> such as: displayExpr={'name - role'}
1835
+ /** function displays items by custom<br/>
1836
+ * renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
1837
+ * --> such as: displayExpr={'name - role'}
1817
1838
  */
1818
1839
  renderItem: PropTypes.func,
1819
1840
 
1820
- /** function displays selected items by custom, example:<br/>
1821
- * renderItem={(data, index) => index + ' - ' + data.name}<br/>
1841
+ /** function displays selected items by custom, example:<br/>
1842
+ * renderItem={(data, index) => index + ' - ' + data.name}<br/>
1822
1843
  */
1823
1844
  renderSelectedItem: PropTypes.func,
1824
1845
 
1825
- /** the function will run when entering input<br/>
1826
- * if undefined: the filter function will run (default)
1846
+ /** the function will run when entering input<br/>
1847
+ * if undefined: the filter function will run (default)
1827
1848
  */
1828
1849
  onInput: PropTypes.func,
1829
1850