diginet-core-ui 1.3.89-beta.4 → 1.3.90-beta.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.
@@ -380,10 +380,10 @@ const isBetween = (day, from, to, className) => {
380
380
  return '';
381
381
  };
382
382
  const isBeforeLimit = (min, time) => {
383
- return min && isValidDate(min) && moment(time).diff(new Date(min).setHours(0, 0, 0, 0)) < 0;
383
+ return min && isValidDate(min) && moment(new Date(time).setHours(0, 0, 0, 0)).diff(new Date(min).setHours(0, 0, 0, 0)) < 0;
384
384
  };
385
385
  const isAfterLimit = (max, time) => {
386
- return max && isValidDate(max) && moment(time).diff(new Date(max).setHours(0, 0, 0, 0)) > 0;
386
+ return max && isValidDate(max) && moment(new Date(time).setHours(0, 0, 0, 0)).diff(new Date(max).setHours(0, 0, 0, 0)) > 0;
387
387
  };
388
388
  /**
389
389
  *
@@ -611,28 +611,30 @@ const onUpdateNavigator = (time, refs, min, max) => {
611
611
  (_refs$doubleRight$cur = refs.doubleRight.current) === null || _refs$doubleRight$cur === void 0 ? void 0 : (_refs$doubleRight$cur2 = _refs$doubleRight$cur.instance) === null || _refs$doubleRight$cur2 === void 0 ? void 0 : _refs$doubleRight$cur2.option('disabled', false);
612
612
  (_refs$left$current = refs.left.current) === null || _refs$left$current === void 0 ? void 0 : (_refs$left$current$in = _refs$left$current.instance) === null || _refs$left$current$in === void 0 ? void 0 : _refs$left$current$in.option('disabled', false);
613
613
  (_refs$right$current = refs.right.current) === null || _refs$right$current === void 0 ? void 0 : (_refs$right$current$i = _refs$right$current.instance) === null || _refs$right$current$i === void 0 ? void 0 : _refs$right$current$i.option('disabled', false);
614
- if (min && isValidDate(min)) {
615
- if (moment(time).diff(firstDayOfMin) < 365) {
616
- var _refs$doubleLeft$curr3, _refs$doubleLeft$curr4;
617
- (_refs$doubleLeft$curr3 = refs.doubleLeft.current) === null || _refs$doubleLeft$curr3 === void 0 ? void 0 : (_refs$doubleLeft$curr4 = _refs$doubleLeft$curr3.instance) === null || _refs$doubleLeft$curr4 === void 0 ? void 0 : _refs$doubleLeft$curr4.option('disabled', true);
614
+ setTimeout(() => {
615
+ if (min && isValidDate(min)) {
616
+ if (moment(time).diff(firstDayOfMin) < 365) {
617
+ var _refs$doubleLeft$curr3, _refs$doubleLeft$curr4;
618
+ (_refs$doubleLeft$curr3 = refs.doubleLeft.current) === null || _refs$doubleLeft$curr3 === void 0 ? void 0 : (_refs$doubleLeft$curr4 = _refs$doubleLeft$curr3.instance) === null || _refs$doubleLeft$curr4 === void 0 ? void 0 : _refs$doubleLeft$curr4.option('disabled', true);
619
+ }
620
+ if (moment(time).diff(firstDayOfMin) <= 28 && moment(time).diff(firstDayOfMin, 'months') > 1 || moment(time).diff(firstDayOfMin, 'months') < 1) {
621
+ var _refs$doubleLeft$curr5, _refs$doubleLeft$curr6, _refs$left$current2, _refs$left$current2$i;
622
+ (_refs$doubleLeft$curr5 = refs.doubleLeft.current) === null || _refs$doubleLeft$curr5 === void 0 ? void 0 : (_refs$doubleLeft$curr6 = _refs$doubleLeft$curr5.instance) === null || _refs$doubleLeft$curr6 === void 0 ? void 0 : _refs$doubleLeft$curr6.option('disabled', true);
623
+ (_refs$left$current2 = refs.left.current) === null || _refs$left$current2 === void 0 ? void 0 : (_refs$left$current2$i = _refs$left$current2.instance) === null || _refs$left$current2$i === void 0 ? void 0 : _refs$left$current2$i.option('disabled', true);
624
+ }
618
625
  }
619
- if (moment(time).diff(firstDayOfMin) <= 28) {
620
- var _refs$doubleLeft$curr5, _refs$doubleLeft$curr6, _refs$left$current2, _refs$left$current2$i;
621
- (_refs$doubleLeft$curr5 = refs.doubleLeft.current) === null || _refs$doubleLeft$curr5 === void 0 ? void 0 : (_refs$doubleLeft$curr6 = _refs$doubleLeft$curr5.instance) === null || _refs$doubleLeft$curr6 === void 0 ? void 0 : _refs$doubleLeft$curr6.option('disabled', true);
622
- (_refs$left$current2 = refs.left.current) === null || _refs$left$current2 === void 0 ? void 0 : (_refs$left$current2$i = _refs$left$current2.instance) === null || _refs$left$current2$i === void 0 ? void 0 : _refs$left$current2$i.option('disabled', true);
626
+ if (max && isValidDate(max)) {
627
+ if (moment(time).diff(firstDayOfMax) > -334) {
628
+ var _refs$doubleRight$cur3, _refs$doubleRight$cur4;
629
+ (_refs$doubleRight$cur3 = refs.doubleRight.current) === null || _refs$doubleRight$cur3 === void 0 ? void 0 : (_refs$doubleRight$cur4 = _refs$doubleRight$cur3.instance) === null || _refs$doubleRight$cur4 === void 0 ? void 0 : _refs$doubleRight$cur4.option('disabled', true);
630
+ }
631
+ if (moment(time).diff(firstDayOfMax) > -1) {
632
+ var _refs$doubleRight$cur5, _refs$doubleRight$cur6, _refs$right$current2, _refs$right$current2$;
633
+ (_refs$doubleRight$cur5 = refs.doubleRight.current) === null || _refs$doubleRight$cur5 === void 0 ? void 0 : (_refs$doubleRight$cur6 = _refs$doubleRight$cur5.instance) === null || _refs$doubleRight$cur6 === void 0 ? void 0 : _refs$doubleRight$cur6.option('disabled', true);
634
+ (_refs$right$current2 = refs.right.current) === null || _refs$right$current2 === void 0 ? void 0 : (_refs$right$current2$ = _refs$right$current2.instance) === null || _refs$right$current2$ === void 0 ? void 0 : _refs$right$current2$.option('disabled', true);
635
+ }
623
636
  }
624
- }
625
- if (max && isValidDate(max)) {
626
- if (moment(time).diff(firstDayOfMax) > -334) {
627
- var _refs$doubleRight$cur3, _refs$doubleRight$cur4;
628
- (_refs$doubleRight$cur3 = refs.doubleRight.current) === null || _refs$doubleRight$cur3 === void 0 ? void 0 : (_refs$doubleRight$cur4 = _refs$doubleRight$cur3.instance) === null || _refs$doubleRight$cur4 === void 0 ? void 0 : _refs$doubleRight$cur4.option('disabled', true);
629
- }
630
- if (moment(time).diff(firstDayOfMax) > -1) {
631
- var _refs$doubleRight$cur5, _refs$doubleRight$cur6, _refs$right$current2, _refs$right$current2$;
632
- (_refs$doubleRight$cur5 = refs.doubleRight.current) === null || _refs$doubleRight$cur5 === void 0 ? void 0 : (_refs$doubleRight$cur6 = _refs$doubleRight$cur5.instance) === null || _refs$doubleRight$cur6 === void 0 ? void 0 : _refs$doubleRight$cur6.option('disabled', true);
633
- (_refs$right$current2 = refs.right.current) === null || _refs$right$current2 === void 0 ? void 0 : (_refs$right$current2$ = _refs$right$current2.instance) === null || _refs$right$current2$ === void 0 ? void 0 : _refs$right$current2$.option('disabled', true);
634
- }
635
- }
637
+ });
636
638
  };
637
639
  /**
638
640
  *
@@ -5,14 +5,11 @@ import { Popover } from "./..";
5
5
  import OptionWrapper from "../others/option-wrapper";
6
6
  import PropTypes from 'prop-types';
7
7
  import { forwardRef, Fragment, memo, useImperativeHandle, useMemo, useRef, useState } from 'react';
8
- import { breakAll, breakWord, cursorPointer, displayBlock, displayInlineBlock, italic, overflowHidden, parseHeight, parseMaxWidth, pd, positionRelative, textCapitalize, textCenter, textColor, textLineThrough, textLowercase, textunderline, textUppercase, whiteSpaceBreakSpaces } from "../../styles/general";
8
+ import { breakAll, breakWord, cursorPointer, displayBlock, displayInlineBlock, italic, overflowHidden, parseHeight, parseMaxWidth, parseMinWidth, pd, positionRelative, textCapitalize, textCenter, textColor, textLineThrough, textLowercase, textunderline, textUppercase, whiteSpaceBreakSpaces } from "../../styles/general";
9
9
  import { useTheme, useTypography as typography } from "../../theme";
10
10
  import { classNames, renderHTML } from "../../utils";
11
11
  const {
12
12
  colors: {
13
- system: {
14
- rest: systemRest
15
- },
16
13
  text: {
17
14
  main: textMain
18
15
  },
@@ -21,7 +18,7 @@ const {
21
18
  }
22
19
  }
23
20
  } = useTheme();
24
- const colorMap = new Map([['default', textMain], ['secondary', systemRest]]);
21
+ const colorMap = new Map([['default', textMain]]);
25
22
  const formatMap = new Map([['capitalize', textCapitalize], ['uppercase', textUppercase], ['lowercase', textLowercase], ['italic', italic], ['line-through', textLineThrough], ['underline', textunderline]]);
26
23
  const isTextClamped = elm => (elm === null || elm === void 0 ? void 0 : elm.scrollHeight) > (elm === null || elm === void 0 ? void 0 : elm.clientHeight);
27
24
  const Typography = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
@@ -77,6 +74,7 @@ const Typography = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
77
74
  const classes = (inTooltip = false) => classNames('DGN-UI-Typography', center && 'DGN-Typography-center', fullWidth && 'DGN-Typography-fullWidth', `DGN-Typography-${type}`, uppercase && `DGN-Typography-Uppercase`, capitalize && 'DGN-Typography-Capitalize', !inTooltip && lineClamp && 'DGN-Typography-Clamp', className);
78
75
  const content = Array.isArray(children) && !children.some(node => node && String(node.$$typeof) === 'Symbol(react.element)') ? children.join('') : children;
79
76
  const renderTooltip = hoverTooltip ? jsx(Popover, {
77
+ css: [parseMinWidth(300)],
80
78
  open: openTooltip,
81
79
  pressESCToClose: false,
82
80
  fullScreen: false,
package/icons/basic.js CHANGED
@@ -1156,6 +1156,34 @@ export const Block = /*#__PURE__*/memo(({
1156
1156
  fill: colors[color] || color
1157
1157
  }));
1158
1158
  });
1159
+ export const Cake = /*#__PURE__*/memo(({
1160
+ width,
1161
+ height,
1162
+ color = '#7F828E',
1163
+ viewBox = false
1164
+ }) => {
1165
+ return viewBox ? /*#__PURE__*/React.createElement("svg", {
1166
+ width: width || 24,
1167
+ height: height || 24,
1168
+ viewBox: "0 0 24 24",
1169
+ fill: "none"
1170
+ }, /*#__PURE__*/React.createElement("path", {
1171
+ fillRule: "evenodd",
1172
+ clipRule: "evenodd",
1173
+ d: "M12 6C13.11 6 14 5.1 14 4C14 3.62 13.9 3.27 13.71 2.97L12 0L10.29 2.97C10.1 3.27 10 3.62 10 4C10 5.1 10.9 6 12 6ZM16.6 15.99L15.53 14.92L14.45 15.99C13.15 17.29 10.87 17.3 9.56 15.99L8.49 14.92L7.4 15.99C6.75 16.64 5.88 17 4.96 17C4.23 17 3.56 16.77 3 16.39V21C3 21.55 3.45 22 4 22H20C20.55 22 21 21.55 21 21V16.39C20.44 16.77 19.77 17 19.04 17C18.12 17 17.25 16.64 16.6 15.99ZM13 9H18C19.66 9 21 10.34 20.99 12V13.54C20.99 14.62 20.11 15.5 19.03 15.5C18.51 15.5 18.02 15.3 17.65 14.93L15.52 12.8L13.38 14.93C12.64 15.67 11.35 15.67 10.61 14.93L8.48 12.8L6.34 14.93C5.98 15.3 5.48 15.5 4.96 15.5C3.88 15.5 3 14.62 3 13.54V12C3 10.34 4.34 9 6 9H11V7H13V9Z",
1174
+ fill: colors[color] || color
1175
+ })) : /*#__PURE__*/React.createElement("svg", {
1176
+ width: width || 18,
1177
+ height: height || 22,
1178
+ viewBox: "0 0 18 22",
1179
+ fill: "none"
1180
+ }, /*#__PURE__*/React.createElement("path", {
1181
+ fillRule: "evenodd",
1182
+ clipRule: "evenodd",
1183
+ d: "M9 6C10.11 6 11 5.1 11 4C11 3.62 10.9 3.27 10.71 2.97L9 0L7.29 2.97C7.1 3.27 7 3.62 7 4C7 5.1 7.9 6 9 6ZM13.6 15.99L12.53 14.92L11.45 15.99C10.15 17.29 7.87 17.3 6.56 15.99L5.49 14.92L4.4 15.99C3.75 16.64 2.88 17 1.96 17C1.23 17 0.56 16.77 0 16.39V21C0 21.55 0.45 22 1 22H17C17.55 22 18 21.55 18 21V16.39C17.44 16.77 16.77 17 16.04 17C15.12 17 14.25 16.64 13.6 15.99ZM10 9H15C16.66 9 18 10.34 17.99 12V13.54C17.99 14.62 17.11 15.5 16.03 15.5C15.51 15.5 15.02 15.3 14.65 14.93L12.52 12.8L10.38 14.93C9.64 15.67 8.35 15.67 7.61 14.93L5.48 12.8L3.34 14.93C2.98 15.3 2.48 15.5 1.96 15.5C0.88 15.5 0 14.62 0 13.54V12C0 10.34 1.34 9 3 9H8V7H10V9Z",
1184
+ fill: colors[color] || color
1185
+ }));
1186
+ });
1159
1187
  export const Calculate = /*#__PURE__*/memo(({
1160
1188
  width,
1161
1189
  height,
@@ -1412,6 +1440,34 @@ export const Chat = /*#__PURE__*/memo(({
1412
1440
  fill: '#FFF'
1413
1441
  }));
1414
1442
  });
1443
+ export const ChatAnswer = /*#__PURE__*/memo(({
1444
+ width,
1445
+ height,
1446
+ color = '#7F828E',
1447
+ viewBox = false
1448
+ }) => {
1449
+ return viewBox ? /*#__PURE__*/React.createElement("svg", {
1450
+ width: width || 24,
1451
+ height: height || 24,
1452
+ viewBox: "0 0 24 24",
1453
+ fill: "none"
1454
+ }, /*#__PURE__*/React.createElement("path", {
1455
+ fillRule: "evenodd",
1456
+ clipRule: "evenodd",
1457
+ d: "M17 3V12C17 12.55 16.55 13 16 13H6L2 17V3C2 2.45 2.45 2 3 2H16C16.55 2 17 2.45 17 3ZM19 6H21C21.55 6 22 6.45 22 7V22L18 18H7C6.45 18 6 17.55 6 17V15H19V6Z",
1458
+ fill: colors[color] || color
1459
+ })) : /*#__PURE__*/React.createElement("svg", {
1460
+ width: width || 20,
1461
+ height: height || 20,
1462
+ viewBox: "0 0 20 20",
1463
+ fill: "none"
1464
+ }, /*#__PURE__*/React.createElement("path", {
1465
+ fillRule: "evenodd",
1466
+ clipRule: "evenodd",
1467
+ d: "M15 1V10C15 10.55 14.55 11 14 11H4L0 15V1C0 0.45 0.45 0 1 0H14C14.55 0 15 0.45 15 1ZM17 4H19C19.55 4 20 4.45 20 5V20L16 16H5C4.45 16 4 15.55 4 15V13H17V4Z",
1468
+ fill: colors[color] || color
1469
+ }));
1470
+ });
1415
1471
  export const ChatBubble = /*#__PURE__*/memo(({
1416
1472
  width,
1417
1473
  height,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diginet-core-ui",
3
- "version": "1.3.89-beta.4",
3
+ "version": "1.3.90-beta.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "license": "UNLICENSED",
package/readme.md CHANGED
@@ -38,6 +38,15 @@ npm test
38
38
  ```
39
39
 
40
40
  ## Changelog
41
+ ## 1.3.90
42
+ - \[Added\]: Breadcrumb – Add component Breadcrumb
43
+ - \[Added\]: Icon – Question, Pause, Cake, ChatAnswer
44
+ - \[Added\]: IconMenu – MHRP51N0003
45
+ - \[Fixed\]: Popover – Fix bug css overflow hidden of document body
46
+ - \[Fixed\]: TAB – Fix UI not match design, fix missing ripple effect
47
+ - \[Fixed\]: Popover – Fix bug popover still open when ButtonIcon disabled
48
+ - \[Fixed\]: Popover – Fix bug update wrong position if anchor not exists
49
+
41
50
  ## 1.3.89
42
51
  - \[Added\]: COLORS – Replace base colors with design system colors
43
52
  - \[Added\]: UTILS – Add storybook for utils
package/styles/general.js CHANGED
@@ -4,10 +4,10 @@ export const rootSpacing = 4;
4
4
  export let rootZIndex = 1500;
5
5
  export const typographyTypes = ['t1', 't2', 't3', 't4', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p1', 'p2', 'p3', 'title1', 'title2', 'title3', 'title4', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6', 'paragraph1', 'paragraph2', 'paragraph3'];
6
6
 
7
- /**
8
- * get value spacing with rootZIndex
9
- * @param number
10
- * @return {number}
7
+ /**
8
+ * get value spacing with rootZIndex
9
+ * @param number
10
+ * @return {number}
11
11
  */
12
12
  export const zIndex = number => {
13
13
  number = Number(number || 0);
@@ -15,10 +15,10 @@ export const zIndex = number => {
15
15
  return rootZIndex + number;
16
16
  };
17
17
 
18
- /**
19
- * get value spacing with rootSpacing
20
- * @param {(number|number[])} vl - default 1
21
- * @returns {(number|string)}
18
+ /**
19
+ * get value spacing with rootSpacing
20
+ * @param {(number|number[])} vl - default 1
21
+ * @returns {(number|string)}
22
22
  */
23
23
 
24
24
  export const getSpacing = (vl = 1) => {
@@ -28,9 +28,9 @@ export const getSpacing = (vl = 1) => {
28
28
  } else return vl;
29
29
  };
30
30
 
31
- /**
32
- * replace rootZIndex
33
- * @param number
31
+ /**
32
+ * replace rootZIndex
33
+ * @param number
34
34
  */
35
35
  export const setZIndex = number => {
36
36
  number = Number(number || 0);
@@ -95,6 +95,9 @@ const cursorDefault = css`
95
95
  const cursorInherit = css`
96
96
  cursor: inherit;
97
97
  `;
98
+ const cursorInitial = css`
99
+ cursor: initial;
100
+ `;
98
101
  const cursorMove = css`
99
102
  cursor: move;
100
103
  `;
@@ -442,4 +445,4 @@ const whiteSpacePreWrap = css`
442
445
  const z = vl => css`
443
446
  z-index: ${zIndex(vl)};
444
447
  `;
445
- export { bgColor, bgCurrent, bgTransparent, border, borderBottom, borderBottomColor, borderColor, borderNone, borderRadius, borderRadius100, borderRadius4px, borderRadius50, bottom, boxBorder, boxContent, breakAll, breakWord, cursorDefault, cursorInherit, cursorMove, cursorNoDrop, cursorNotAllowed, cursorPointer, cursorText, displayBlock, displayFlex, displayInlineBlock, displayInlineFlex, displayNone, fill, flexCol, flexColReverse, flexNowrap, flexRow, flexRowReverse, flexShrink, flexShrink0, flexWrap, flexWrapReverse, floatLeft, floatNone, floatRight, gap, gapX, gapY, inset, insetX, insetY, invisible, italic, itemsCenter, itemsEnd, itemsStart, justifyAround, justifyBetween, justifyCenter, justifyEnd, justifyEvenly, justifyStart, left, mg, mgb, mgl, mgr, mgt, mgx, mgy, noBorder, noBoxShadow, noMargin, noPadding, objectContain, objectCover, objectFill, objectNone, order, outlineNone, overflowAuto, overflowHidden, parseHeight, parseMaxHeight, parseMaxWidth, parseMaxWidthHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidth, parseWidthHeight, pd, pdb, pdl, pdr, pdt, pdx, pdy, pointerEventsAuto, pointerEventsInherit, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, positionSticky, right, scale, scaleX, scaleY, selfCenter, selfEnd, selfStart, shadowNone, textCapitalize, textCenter, textColor, textCurrent, textEllipsis, textLeft, textLineThrough, textLowercase, textRight, textunderline, textUppercase, top, truncate, userSelectNone, visible, whiteSpaceBreakSpaces, whiteSpaceNoWrap, whiteSpacePreWrap, z };
448
+ export { bgColor, bgCurrent, bgTransparent, border, borderBottom, borderBottomColor, borderColor, borderNone, borderRadius, borderRadius100, borderRadius4px, borderRadius50, bottom, boxBorder, boxContent, breakAll, breakWord, cursorDefault, cursorInherit, cursorInitial, cursorMove, cursorNoDrop, cursorNotAllowed, cursorPointer, cursorText, displayBlock, displayFlex, displayInlineBlock, displayInlineFlex, displayNone, fill, flexCol, flexColReverse, flexNowrap, flexRow, flexRowReverse, flexShrink, flexShrink0, flexWrap, flexWrapReverse, floatLeft, floatNone, floatRight, gap, gapX, gapY, inset, insetX, insetY, invisible, italic, itemsCenter, itemsEnd, itemsStart, justifyAround, justifyBetween, justifyCenter, justifyEnd, justifyEvenly, justifyStart, left, mg, mgb, mgl, mgr, mgt, mgx, mgy, noBorder, noBoxShadow, noMargin, noPadding, objectContain, objectCover, objectFill, objectNone, order, outlineNone, overflowAuto, overflowHidden, parseHeight, parseMaxHeight, parseMaxWidth, parseMaxWidthHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidth, parseWidthHeight, pd, pdb, pdl, pdr, pdt, pdx, pdy, pointerEventsAuto, pointerEventsInherit, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionFixed, positionRelative, positionSticky, right, scale, scaleX, scaleY, selfCenter, selfEnd, selfStart, shadowNone, textCapitalize, textCenter, textColor, textCurrent, textEllipsis, textLeft, textLineThrough, textLowercase, textRight, textunderline, textUppercase, top, truncate, userSelectNone, visible, whiteSpaceBreakSpaces, whiteSpaceNoWrap, whiteSpacePreWrap, z };