diginet-core-ui 1.3.94-beta.3 → 1.3.94-beta.5

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.
@@ -106,7 +106,7 @@ export { default as ModalFooter } from "./modal/footer";
106
106
 
107
107
  // PAGING
108
108
  export { default as PagingInfo } from "./paging/page-info";
109
- export { default as PagingSelector } from "./paging/page-selector2";
109
+ export { default as PagingSelector } from "./paging/page-selector";
110
110
 
111
111
  // PAPER
112
112
  export { default as Paper } from "./paper";
@@ -1,6 +1,7 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/core';
4
+ import OptionWrapper from "../others/option-wrapper";
4
5
  import PropTypes from 'prop-types';
5
6
  import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
6
7
  import { boxBorder, displayBlock, displayNone, order, overflowAuto, parseWidthHeight, positionRelative } from "../../styles/general";
@@ -11,7 +12,8 @@ const ModalBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
11
12
  children,
12
13
  className,
13
14
  id,
14
- style
15
+ style,
16
+ ...props
15
17
  }, reference) => {
16
18
  if (!reference) reference = useRef(null);
17
19
  const ref = useRef(null);
@@ -31,9 +33,10 @@ const ModalBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
31
33
  ref: ref,
32
34
  id: id,
33
35
  className: classNames('DGN-UI-Modal-Body', className),
34
- style: style
36
+ style: style,
37
+ ...props
35
38
  }, children);
36
- }, [children, className, id, style]);
39
+ }, [children, className, id, style, props]);
37
40
  }));
38
41
  const ModalBodyCSS = css`
39
42
  ${displayBlock};
@@ -59,4 +62,5 @@ ModalBody.propTypes = {
59
62
  /** Style inline of component. */
60
63
  style: PropTypes.object
61
64
  };
62
- export default ModalBody;
65
+ export { ModalBody };
66
+ export default OptionWrapper(ModalBody);
@@ -1,9 +1,10 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/core';
4
+ import OptionWrapper from "../others/option-wrapper";
4
5
  import PropTypes from 'prop-types';
5
6
  import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
6
- import { boxBorder, flexRow, itemsCenter, justifyEnd, order, parseWidth, positionRelative } from "../../styles/general";
7
+ import { boxBorder, displayFlex, flexRow, itemsCenter, justifyEnd, order, parseWidth, positionRelative } from "../../styles/general";
7
8
  import { classNames } from "../../utils";
8
9
  import { responsivePaddingCSS } from "./header";
9
10
  const ModalFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
@@ -38,6 +39,7 @@ const ModalFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
38
39
  }, [boxShadow, children, className, id, style]);
39
40
  }));
40
41
  const ModalFooterCSS = boxShadow => css`
42
+ ${displayFlex};
41
43
  ${flexRow};
42
44
  ${positionRelative};
43
45
  ${itemsCenter};
@@ -64,4 +66,5 @@ ModalFooter.propTypes = {
64
66
  /** Style inline of component. */
65
67
  style: PropTypes.object
66
68
  };
67
- export default ModalFooter;
69
+ export { ModalFooter };
70
+ export default OptionWrapper(ModalFooter);
@@ -2,6 +2,7 @@
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/core';
4
4
  import { ButtonIcon, Typography } from "./..";
5
+ import OptionWrapper from "../others/option-wrapper";
5
6
  import PropTypes from 'prop-types';
6
7
  import { forwardRef, memo, useContext, useImperativeHandle, useMemo, useRef } from 'react';
7
8
  import { bgColor, boxBorder, cursorMove, displayFlex, flexRow, itemsCenter, justifyBetween, mgl, order, parseWidth, parseWidthHeight, positionRelative, truncate } from "../../styles/general";
@@ -114,4 +115,5 @@ ModalHeader.propTypes = {
114
115
  /** The content of the component if not have prop `children`. */
115
116
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
116
117
  };
117
- export default ModalHeader;
118
+ export { ModalHeader };
119
+ export default OptionWrapper(ModalHeader);
@@ -1,11 +1,12 @@
1
1
  /** @jsxRuntime classic */
2
2
  /** @jsx jsx */
3
3
  import { css, jsx } from '@emotion/core';
4
+ import OptionWrapper from "../others/option-wrapper";
4
5
  import PropTypes from 'prop-types';
5
6
  import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
6
7
  import { createPortal } from 'react-dom';
7
8
  import { animations } from "../../styles/animation";
8
- import { bgColor, borderRadius4px, boxBorder, cursorMove, flexCol, flexRow, justifyCenter, left, parseMaxWidthHeight, parseMinWidth, parseWidthHeight, pdt, positionAbsolute, positionRelative, top } from "../../styles/general";
9
+ import { bgColor, borderRadius, boxBorder, cursorMove, displayFlex, flexCol, flexRow, justifyCenter, left, parseMaxWidthHeight, parseMinWidth, parseWidthHeight, pdt, positionAbsolute, positionRelative, top } from "../../styles/general";
9
10
  import { useTheme } from "../../theme";
10
11
  import { classNames, useDelayUnmount } from "../../utils";
11
12
  import ModalContext from "./context";
@@ -187,6 +188,7 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
187
188
  }, [alignment, autoFocus, children, className, darkTheme, dragAnyWhere, id, moveable, moveOutScreen, onClose, open, pressESCToClose, style, width, zIndex, openState, showModal]);
188
189
  }));
189
190
  const ModalContainerCSS = (zIndex, alignment, darkTheme) => css`
191
+ ${displayFlex};
190
192
  ${flexRow};
191
193
  ${positionAbsolute}
192
194
  ${justifyCenter};
@@ -200,15 +202,16 @@ const ModalContainerCSS = (zIndex, alignment, darkTheme) => css`
200
202
  `;
201
203
  const ModalBoxCSS = (width, moveable, dragAnyWhere) => css`
202
204
  ${paragraph1};
205
+ ${displayFlex};
203
206
  ${flexCol};
204
207
  ${positionRelative};
205
- ${borderRadius4px}
208
+ ${borderRadius(4)};
206
209
  ${boxBorder};
207
210
  ${parseWidthHeight(width, 'max-content')};
208
211
  ${parseMaxWidthHeight('90%', 'calc(100% - 12px)')};
209
212
  ${parseMinWidth(150)};
210
213
  ${moveable && dragAnyWhere && cursorMove};
211
- ${bgColor('system.white')};
214
+ ${bgColor('system/white')};
212
215
  margin: 0 auto;
213
216
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
214
217
  -webkit-box-orient: vertical;
@@ -267,4 +270,5 @@ Modal.propTypes = {
267
270
  /** The z-index of component. */
268
271
  zIndex: PropTypes.number
269
272
  };
270
- export default Modal;
273
+ export { Modal };
274
+ export default OptionWrapper(Modal);
@@ -6,27 +6,18 @@ import OptionWrapper from "../others/option-wrapper";
6
6
  import { getGlobal } from "../../global";
7
7
  import PropTypes from 'prop-types';
8
8
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
9
- import { itemsCenter, boxBorder, cursorPointer, flexRow, justifyCenter, noPadding, parseHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidthHeight, textCenter, whiteSpaceNoWrap } from "../../styles/general";
9
+ import { bgColor, borderTop, boxBorder, cursorPointer, displayFlex, flexRow, itemsCenter, justifyCenter, mg, mgb, mgl, noPadding, parseHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidthHeight, pd, textCenter, textColor, textLeft, whiteSpaceNoWrap } from "../../styles/general";
10
10
  import { useTheme } from "../../theme";
11
11
  import { classNames, refType as ref } from "../../utils";
12
12
  const {
13
13
  colors: {
14
14
  system: {
15
- active: systemActive,
16
- white: systemWhite
17
- },
18
- line: {
19
- system: lineSystem,
20
- category: lineCategory
21
- },
22
- text: {
23
- main: textMain
15
+ active: systemActive
24
16
  }
25
17
  },
26
18
  typography: {
27
19
  paragraph2
28
- },
29
- spacing
20
+ }
30
21
  } = useTheme();
31
22
  const getLastPage = (totalItems, itemsPerPage) => {
32
23
  let _lastPage = 0;
@@ -57,7 +48,7 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
57
48
  if (!reference) reference = useRef(null);
58
49
  const ref = useRef(null);
59
50
  const timer = useRef(null);
60
- const currentPageRef = useRef(null);
51
+ const currentPageRef = useRef(currentPage);
61
52
  const numberRef = useRef(null);
62
53
  const totalRef = useRef(null);
63
54
  const [totalItemsState, setTotalItemsState] = useState(totalItems);
@@ -67,7 +58,7 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
67
58
  const [disablePrevState, setDisablePrevState] = useState(true);
68
59
  const [disableNextState, setDisableNextState] = useState(!(totalItems > itemsPerPage));
69
60
  const [inputPageValue, setInputPageValue] = useState(currentPage);
70
- const _pagingInfoCSS = pagingInfoCSS(bgColor, typeShort);
61
+ const _PagingInfoCSS = PagingInfoCSS(bgColor, typeShort);
71
62
  const _onChangePage = async ({
72
63
  page,
73
64
  e,
@@ -296,7 +287,7 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
296
287
  const showPaging = checkShowPaging();
297
288
  return showPaging ? jsx("div", {
298
289
  ref: ref,
299
- css: _pagingInfoCSS,
290
+ css: _PagingInfoCSS,
300
291
  id: id,
301
292
  style: style,
302
293
  className: classNames('DGN-UI-PagingInfo', className)
@@ -363,9 +354,7 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
363
354
  totalRef.current = refs;
364
355
  setWithNumber(refs, null);
365
356
  },
366
- css: css`
367
- ${whiteSpaceNoWrap}
368
- `,
357
+ css: whiteSpaceNoWrap,
369
358
  type: 'p2'
370
359
  }, lastPage)), jsx(ButtonIcon, {
371
360
  circular: true,
@@ -412,7 +401,7 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
412
401
  }, typeShort ? jsx(Divider, {
413
402
  direction: 'vertical',
414
403
  height: 24,
415
- color: lineCategory
404
+ color: 'line/category'
416
405
  }) : getGlobal('lineNumber'), jsx(Dropdown, {
417
406
  allowSearch: false,
418
407
  viewType: 'underlined',
@@ -435,57 +424,59 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
435
424
  }, typeShort ? jsx(Divider, {
436
425
  direction: 'vertical',
437
426
  height: 24,
438
- color: lineCategory
427
+ color: 'line/category'
439
428
  }) : getGlobal('total') + ':', totalItemsState)) : null;
440
429
  }, [bgColor, className, hideWithPage, style, typeShort, currentPageState, disableNextState, disablePrevState, inputPageValue, itemsPerPageState, listPerPageState, totalItemsState]);
441
430
  }));
442
431
  const ViewNumberInput = css`
432
+ ${displayFlex};
443
433
  ${flexRow};
444
434
  ${itemsCenter};
445
435
  ${justifyCenter};
436
+ ${mg([0, 1])};
446
437
  transition: all 0.1s;
447
- margin: ${spacing([0, 1])};
448
438
  `;
449
- const pagingInfoCSS = (bgColor, typeShort) => css`
439
+ const PagingInfoCSS = (bgCl, typeShort) => css`
440
+ ${displayFlex};
450
441
  ${flexRow};
451
442
  ${itemsCenter};
452
443
  ${paragraph2};
453
444
  ${boxBorder};
454
445
  ${parseHeight(40)};
455
- border-top: solid 1px ${lineSystem};
456
- padding: ${spacing([1, 0])};
457
- background-color: ${bgColor};
458
- color: ${textMain};
446
+ ${borderTop(1, 'line/system')};
447
+ ${pd([1, 0])};
448
+ ${bgColor(bgCl)};
449
+ ${textColor('text/main')};
459
450
  .inputPage {
460
451
  ${textCenter};
461
- margin: ${spacing([0, 0.5])};
452
+ ${mg([0, 0.5])};
462
453
  .DGN-UI-InputBase {
463
454
  ${noPadding};
464
455
  input {
465
456
  ${paragraph2};
466
457
  ${textCenter};
467
- color: ${systemActive};
468
- text-align: left;
458
+ ${textColor('system/active')};
459
+ ${textLeft};
469
460
  }
470
461
  }
471
462
  }
472
463
  .txt-line-number {
464
+ ${displayFlex};
473
465
  ${whiteSpaceNoWrap};
474
466
  ${itemsCenter};
475
467
  opacity: 0;
476
- display: flex !important;
477
468
  transition: opacity 0.3s ease;
478
469
  }
479
470
  .DGN-UI-Divider {
480
- margin: ${spacing([0, 2])};
471
+ ${mg([0, 2])};
481
472
  }
482
473
  .DGN-UI-Dropdown {
483
- margin-left: ${`${spacing(typeShort ? [0] : [2])}`};
484
- margin-bottom: 0;
474
+ ${mgl([typeShort ? 0 : 2])};
475
+ ${mgb(0)};
485
476
  ${parseMinWidth(52)};
486
477
  .DGN-UI-Dropdown-Form {
487
478
  ${parseMinHeight(24)};
488
- padding: 0;
479
+ ${pd(0)};
489
480
  input,
490
481
  span {
491
482
  ${paragraph2};
@@ -493,7 +484,7 @@ const pagingInfoCSS = (bgColor, typeShort) => css`
493
484
  ${cursorPointer};
494
485
  }
495
486
  .DGN-UI-Dropdown-Icon {
496
- margin-left: ${spacing([1.5])};
487
+ ${mgl([1.5])};
497
488
  div,
498
489
  span,
499
490
  svg {
@@ -504,16 +495,17 @@ const pagingInfoCSS = (bgColor, typeShort) => css`
504
495
  }
505
496
  }
506
497
  .total-items {
507
- ${whiteSpaceNoWrap};
498
+ ${displayFlex};
508
499
  ${flexRow};
500
+ ${whiteSpaceNoWrap};
509
501
  ${itemsCenter};
510
- margin-left: ${`${spacing(typeShort ? [0] : [4])}`};
502
+ ${mgl([typeShort ? 0 : 4])};
511
503
  opacity: 0;
512
504
  transition: opacity 0.3s ease;
513
505
  }
514
506
  `;
515
507
  PagingInfo.defaultProps = {
516
- bgColor: systemWhite,
508
+ bgColor: 'system/white',
517
509
  className: '',
518
510
  currentPage: 0,
519
511
  hideWithPage: 'none',
@@ -572,8 +564,19 @@ PagingInfo.propTypes = {
572
564
  * * @param {per} - number
573
565
  * * setTotalItems(items): Set total items
574
566
  * * @param {items} - number
567
+ *
568
+ * * option(): Gets all UI component properties
569
+ * * Returns value - object
570
+ * * option(optionName): Gets the value of a single property
571
+ * * @param {optionName} - string
572
+ * * Returns value - any
573
+ * * option(optionName, optionValue): Updates the value of a single property
574
+ * * @param {optionName} - string
575
+ * * @param {optionValue} - any
576
+ * * option(options): Updates the values of several properties
577
+ * * @param {options} - object
575
578
  */
576
- reference: ref
579
+ ref: ref
577
580
  };
578
581
  export { PagingInfo };
579
582
  export default OptionWrapper(PagingInfo);