diginet-core-ui 1.3.66 → 1.3.68
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/assets/storybook/avatar01.svg +9 -0
- package/assets/storybook/cover01.svg +9 -0
- package/components/accordion/css.js +6 -6
- package/components/accordion/details.js +13 -18
- package/components/accordion/group.js +16 -17
- package/components/accordion/index.js +17 -22
- package/components/accordion/summary.js +55 -32
- package/components/avatar/index.js +4 -9
- package/components/badge/index.js +4 -9
- package/components/button/icon.js +4 -9
- package/components/button/index.js +287 -292
- package/components/card/body.js +47 -0
- package/components/card/extra.js +47 -0
- package/components/card/footer.js +47 -0
- package/components/card/header.js +50 -0
- package/components/card/index.js +175 -37
- package/components/chart/Pie-v2/Sector.js +2 -2
- package/components/chip/attach.js +5 -5
- package/components/form-control/attachment/index.js +5 -3
- package/components/form-control/calendar/function.js +20 -10
- package/components/form-control/calendar/index.js +16 -16
- package/components/form-control/dropdown/index.js +71 -10
- package/components/form-control/helper-text/index.js +8 -3
- package/components/form-control/input-base/index.js +47 -10
- package/components/form-control/money-input/index.js +6 -2
- package/components/form-control/number-input/index.js +11 -11
- package/components/form-control/number-input/index2.js +13 -4
- package/components/form-control/phone-input/index.js +13 -9
- package/components/form-control/text-input/index.js +13 -3
- package/components/grid/Container.js +110 -0
- package/components/grid/Row.js +1 -1
- package/components/grid/index.js +35 -5
- package/components/index.js +7 -2
- package/components/others/option-wrapper/index.js +21 -27
- package/components/paging/page-info.js +263 -88
- package/components/paging/page-selector2.js +95 -56
- package/components/popover/index.js +8 -6
- package/components/progress/circular.js +12 -12
- package/components/transfer/index.js +3 -3
- package/components/tree-view/index.js +10 -6
- package/icons/basic.js +120 -0
- package/icons/effect.js +19 -24
- package/package.json +1 -1
- package/readme.md +20 -0
- package/styles/color-helper.js +103 -103
- package/styles/utils.js +14 -2
- package/utils/classNames.js +30 -0
- package/utils/error/error.js +2 -2
- package/utils/index.js +1 -0
- package/utils/renderIcon.js +5 -5
- package/utils/useInput.js +1 -8
- package/components/card/body-card.js +0 -65
- package/components/card/card.js +0 -125
- package/components/card/context.js +0 -6
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { memo, useState, useRef, useEffect, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
7
8
|
import { getGlobal } from '../../global';
|
|
8
9
|
import theme from '../../theme/settings';
|
|
9
10
|
import { alignCenter, borderBox, flexRow, parseHeight } from '../../styles/general';
|
|
@@ -40,6 +41,7 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
40
41
|
className,
|
|
41
42
|
currentPage,
|
|
42
43
|
hideEllipsis,
|
|
44
|
+
hideWithPage,
|
|
43
45
|
id,
|
|
44
46
|
itemsPerPage,
|
|
45
47
|
onChangePage,
|
|
@@ -62,7 +64,11 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
62
64
|
}] = useElementSize();
|
|
63
65
|
const lastPage = getLastPage(totalItemsState, itemsPerPageState);
|
|
64
66
|
|
|
65
|
-
const _onChangePage = async (
|
|
67
|
+
const _onChangePage = async ({
|
|
68
|
+
page,
|
|
69
|
+
e,
|
|
70
|
+
changeBy
|
|
71
|
+
}) => {
|
|
66
72
|
let disablePrev = false;
|
|
67
73
|
let disableNext = false; // If last page = 1. Disable all
|
|
68
74
|
|
|
@@ -81,16 +87,22 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
81
87
|
disablePrev = true;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
|
|
90
|
+
setDisablePrevState(disablePrev);
|
|
91
|
+
setDisableNextState(disableNext);
|
|
92
|
+
if (page === currentPageState) return;
|
|
93
|
+
|
|
94
|
+
if (onChangingPage) {
|
|
85
95
|
const event = { ...e,
|
|
86
96
|
cancel: false,
|
|
87
97
|
prevPage: currentPageState,
|
|
88
|
-
newPage: page
|
|
98
|
+
newPage: page,
|
|
99
|
+
changeBy: changeBy
|
|
89
100
|
};
|
|
90
101
|
await onChangingPage(event);
|
|
91
102
|
|
|
92
103
|
if (event.cancel) {
|
|
93
104
|
if (e !== null && e !== void 0 && e.reset) e.reset();
|
|
105
|
+
currentPageRef.current = currentPageState;
|
|
94
106
|
setCurrentPageState(currentPageState);
|
|
95
107
|
return;
|
|
96
108
|
}
|
|
@@ -98,12 +110,11 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
98
110
|
|
|
99
111
|
currentPageRef.current = page;
|
|
100
112
|
setCurrentPageState(page);
|
|
101
|
-
|
|
102
|
-
setDisableNextState(disableNext);
|
|
103
|
-
if (onChangePage && !isInit) onChangePage(page);
|
|
113
|
+
if (onChangePage) onChangePage(page);
|
|
104
114
|
};
|
|
105
115
|
|
|
106
116
|
const _onChangePerPage = async per => {
|
|
117
|
+
if (per === itemsPerPageState) return;
|
|
107
118
|
const lastPage = getLastPage(totalItemsState, per);
|
|
108
119
|
per = parseInt(per, 10);
|
|
109
120
|
let disableNext = false; // If last page = 1. Disable all
|
|
@@ -125,9 +136,13 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
125
136
|
}
|
|
126
137
|
}
|
|
127
138
|
|
|
128
|
-
currentPageRef.current = 0;
|
|
129
|
-
|
|
130
|
-
|
|
139
|
+
setItemsPerPageState(per); // currentPageRef.current = 0;
|
|
140
|
+
// setCurrentPageState(0);
|
|
141
|
+
|
|
142
|
+
_onChangePage({
|
|
143
|
+
page: 0
|
|
144
|
+
});
|
|
145
|
+
|
|
131
146
|
setDisablePrevState(true);
|
|
132
147
|
setDisableNextState(disableNext);
|
|
133
148
|
if (onChangePerPage) onChangePerPage(per);
|
|
@@ -137,48 +152,43 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
137
152
|
setTotalItemsState(totalItems);
|
|
138
153
|
}, [totalItems]);
|
|
139
154
|
useEffect(() => {
|
|
140
|
-
|
|
141
|
-
clearTimeout(timer.current);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
timer.current = setTimeout(() => {
|
|
145
|
-
_onChangePage(currentPageState !== null && currentPageState !== void 0 ? currentPageState : 0, true);
|
|
146
|
-
}, delayOnInput);
|
|
147
|
-
}, [totalItemsState, itemsPerPageState]);
|
|
148
|
-
useEffect(() => {
|
|
149
|
-
setItemsPerPageState(itemsPerPage);
|
|
155
|
+
_onChangePerPage(itemsPerPage);
|
|
150
156
|
}, [itemsPerPage]);
|
|
151
157
|
useEffect(() => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
timer.current = setTimeout(() => {
|
|
159
|
-
_onChangePage(currentPage, true);
|
|
160
|
-
}, delayOnInput);
|
|
158
|
+
_onChangePage({
|
|
159
|
+
page: currentPage,
|
|
160
|
+
changeBy: 'currentPage'
|
|
161
|
+
});
|
|
161
162
|
}, [currentPage]);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
useEffect(() => {
|
|
164
|
+
_onChangePage({
|
|
165
|
+
page: totalItemsState / itemsPerPageState < currentPageState - 1 ? 0 : currentPageState,
|
|
166
|
+
changeBy: 'totalItems'
|
|
167
|
+
});
|
|
168
|
+
}, [totalItemsState]);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
_onChangePage({
|
|
171
|
+
page: totalItemsState / itemsPerPageState < currentPageState - 1 ? 0 : currentPageState,
|
|
172
|
+
changeBy: 'itemsPerPage'
|
|
173
|
+
});
|
|
174
|
+
}, [itemsPerPageState]);
|
|
175
|
+
useImperativeHandle(reference, () => ({
|
|
176
|
+
element: ref.current,
|
|
177
|
+
instance: {
|
|
178
|
+
onChangePage: page => _onChangePage({
|
|
179
|
+
page: page,
|
|
180
|
+
changeBy: 'ref'
|
|
181
|
+
}),
|
|
166
182
|
onChangePerPage: per => _onChangePerPage(per),
|
|
167
183
|
setTotalItems: items => setTotalItemsState(items)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
currentRef.onChangePerPage = per => _onChangePerPage(per);
|
|
177
|
-
|
|
178
|
-
currentRef.setTotalItems = items => setTotalItemsState(items);
|
|
179
|
-
|
|
180
|
-
return currentRef;
|
|
181
|
-
});
|
|
184
|
+
},
|
|
185
|
+
onChangePage: page => _onChangePage({
|
|
186
|
+
page: page,
|
|
187
|
+
changeBy: 'ref'
|
|
188
|
+
}),
|
|
189
|
+
onChangePerPage: per => _onChangePerPage(per),
|
|
190
|
+
setTotalItems: items => setTotalItemsState(items)
|
|
191
|
+
}));
|
|
182
192
|
|
|
183
193
|
const renderButton = (key, page, isSelected, customDisplay) => {
|
|
184
194
|
if (page >= lastPage || page < 0) return;
|
|
@@ -192,17 +202,35 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
192
202
|
style: {
|
|
193
203
|
fontWeight: 'normal'
|
|
194
204
|
},
|
|
195
|
-
onClick: e => page !== currentPageState && _onChangePage(
|
|
205
|
+
onClick: e => page !== currentPageState && _onChangePage({
|
|
206
|
+
page: page,
|
|
207
|
+
e: e
|
|
208
|
+
})
|
|
196
209
|
}, customDisplay || page + 1);
|
|
197
210
|
};
|
|
198
211
|
|
|
212
|
+
const checkShowSelector = () => {
|
|
213
|
+
switch (hideWithPage) {
|
|
214
|
+
case 'empty':
|
|
215
|
+
return totalItemsState !== 0;
|
|
216
|
+
|
|
217
|
+
case 'single':
|
|
218
|
+
return totalItemsState / itemsPerPageState > 1;
|
|
219
|
+
|
|
220
|
+
case 'none':
|
|
221
|
+
default:
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
199
226
|
return useMemo(() => {
|
|
200
227
|
const count = componentWidth >= 368 ? 10 : componentWidth >= 208 ? 5 : 1;
|
|
201
|
-
const pageArr = Array
|
|
228
|
+
const pageArr = [...Array(count).keys()];
|
|
202
229
|
const halfArrLength = Math.floor(count / 2);
|
|
203
230
|
const quarterArrLength = Math.floor(count / 2.5);
|
|
204
231
|
const showEllipsis = !hideEllipsis && count !== lastPage && count >= 5;
|
|
205
|
-
|
|
232
|
+
const showSelector = checkShowSelector();
|
|
233
|
+
return showSelector && jsx("div", {
|
|
206
234
|
css: PageSelectorCSS,
|
|
207
235
|
ref: node => {
|
|
208
236
|
ref.current = node;
|
|
@@ -218,14 +246,17 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
218
246
|
name: 'ArrowLeft',
|
|
219
247
|
disabled: disablePrevState,
|
|
220
248
|
onClick: e => {
|
|
221
|
-
currentPageRef.current = currentPageRef.current - 1;
|
|
249
|
+
currentPageRef.current = currentPageRef.current === 0 ? 0 : currentPageRef.current - 1;
|
|
222
250
|
|
|
223
251
|
if (timer.current) {
|
|
224
252
|
clearTimeout(timer.current);
|
|
225
253
|
}
|
|
226
254
|
|
|
227
255
|
timer.current = setTimeout(() => {
|
|
228
|
-
_onChangePage(
|
|
256
|
+
_onChangePage({
|
|
257
|
+
page: currentPageRef.current,
|
|
258
|
+
e: e
|
|
259
|
+
});
|
|
229
260
|
}, delayOnInput);
|
|
230
261
|
}
|
|
231
262
|
}), pageArr.map((_, idx) => {
|
|
@@ -278,18 +309,21 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
278
309
|
name: 'ArrowRight',
|
|
279
310
|
disabled: disableNextState,
|
|
280
311
|
onClick: e => {
|
|
281
|
-
currentPageRef.current = currentPageRef.current + 1;
|
|
312
|
+
currentPageRef.current = currentPageRef.current === lastPage ? lastPage : currentPageRef.current + 1;
|
|
282
313
|
|
|
283
314
|
if (timer.current) {
|
|
284
315
|
clearTimeout(timer.current);
|
|
285
316
|
}
|
|
286
317
|
|
|
287
318
|
timer.current = setTimeout(() => {
|
|
288
|
-
_onChangePage(
|
|
319
|
+
_onChangePage({
|
|
320
|
+
page: currentPageRef.current,
|
|
321
|
+
e: e
|
|
322
|
+
});
|
|
289
323
|
}, delayOnInput);
|
|
290
324
|
}
|
|
291
325
|
}));
|
|
292
|
-
}, [id, style, className, hideEllipsis, totalItemsState, itemsPerPageState, currentPageState, disablePrevState, disableNextState, componentWidth]);
|
|
326
|
+
}, [id, style, className, hideEllipsis, hideWithPage, totalItemsState, itemsPerPageState, currentPageState, disablePrevState, disableNextState, componentWidth]);
|
|
293
327
|
}));
|
|
294
328
|
const PageSelectorCSS = css`
|
|
295
329
|
${flexRow};
|
|
@@ -309,7 +343,8 @@ PagingSelector.defaultProps = {
|
|
|
309
343
|
className: '',
|
|
310
344
|
totalItems: 0,
|
|
311
345
|
currentPage: 0,
|
|
312
|
-
hideEllipsis: false
|
|
346
|
+
hideEllipsis: false,
|
|
347
|
+
hideWithPage: 'none'
|
|
313
348
|
};
|
|
314
349
|
PagingSelector.propTypes = {
|
|
315
350
|
/** Class for component. */
|
|
@@ -321,6 +356,9 @@ PagingSelector.propTypes = {
|
|
|
321
356
|
/** If `true`, hide ellipsis. */
|
|
322
357
|
hideEllipsis: PropTypes.bool,
|
|
323
358
|
|
|
359
|
+
/** Hidden mode for page selector. */
|
|
360
|
+
hideWithPage: PropTypes.oneOf(['none', 'empty', 'single']),
|
|
361
|
+
|
|
324
362
|
/** The quantity of items per page. */
|
|
325
363
|
itemsPerPage: PropTypes.number,
|
|
326
364
|
|
|
@@ -370,4 +408,5 @@ PagingSelector.propTypes = {
|
|
|
370
408
|
current: PropTypes.instanceOf(Element)
|
|
371
409
|
})])
|
|
372
410
|
};
|
|
373
|
-
export
|
|
411
|
+
export { PagingSelector };
|
|
412
|
+
export default OptionWrapper(PagingSelector);
|
|
@@ -209,8 +209,10 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
if (element || anchor) {
|
|
212
|
-
if (element) anchor = element;else if (anchor
|
|
213
|
-
|
|
212
|
+
if (element) anchor = element;else if (anchor && !(anchor instanceof Element)) {
|
|
213
|
+
var _anchor4, _anchor$current;
|
|
214
|
+
|
|
215
|
+
anchor = ((_anchor4 = anchor) === null || _anchor4 === void 0 ? void 0 : _anchor4.element) || ((_anchor$current = anchor.current) === null || _anchor$current === void 0 ? void 0 : _anchor$current.element) || anchor.current;
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
if (anchorOrigin === 'center') {
|
|
@@ -322,9 +324,9 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
322
324
|
};
|
|
323
325
|
}, []);
|
|
324
326
|
useEffect(() => {
|
|
325
|
-
var
|
|
327
|
+
var _anchor5, _anchor6;
|
|
326
328
|
|
|
327
|
-
const anchorEl = ((
|
|
329
|
+
const anchorEl = ((_anchor5 = anchor) === null || _anchor5 === void 0 ? void 0 : _anchor5.element) || ((_anchor6 = anchor) === null || _anchor6 === void 0 ? void 0 : _anchor6.current) || anchor;
|
|
328
330
|
const eventArr = eventMap.get(trigger) || [];
|
|
329
331
|
|
|
330
332
|
if (anchorEl && open === undefined && (eventArr === null || eventArr === void 0 ? void 0 : eventArr.length) > 0) {
|
|
@@ -378,9 +380,9 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
378
380
|
}));
|
|
379
381
|
|
|
380
382
|
const renderAnchor = () => {
|
|
381
|
-
var
|
|
383
|
+
var _anchor7;
|
|
382
384
|
|
|
383
|
-
if (!((
|
|
385
|
+
if (!((_anchor7 = anchor) !== null && _anchor7 !== void 0 && _anchor7.type)) return null;
|
|
384
386
|
const AnchorTag = /*#__PURE__*/React.cloneElement(anchor, {
|
|
385
387
|
// onClick: () => {
|
|
386
388
|
// setOpenState(true);
|
|
@@ -65,8 +65,8 @@ const getDimension = size => {
|
|
|
65
65
|
strokeWidth
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
/**
|
|
69
|
-
* Determinate circular progress
|
|
68
|
+
/**
|
|
69
|
+
* Determinate circular progress
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
72
|
|
|
@@ -115,8 +115,8 @@ const Determinate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
115
115
|
|
|
116
116
|
return angle;
|
|
117
117
|
};
|
|
118
|
-
/**
|
|
119
|
-
* style
|
|
118
|
+
/**
|
|
119
|
+
* style
|
|
120
120
|
*/
|
|
121
121
|
|
|
122
122
|
|
|
@@ -218,8 +218,8 @@ Determinate.propTypes = {
|
|
|
218
218
|
width: PropTypes.number
|
|
219
219
|
};
|
|
220
220
|
export const DeterminateCircularProgress = Determinate;
|
|
221
|
-
/**
|
|
222
|
-
* Indeterminate circular progress
|
|
221
|
+
/**
|
|
222
|
+
* Indeterminate circular progress
|
|
223
223
|
*/
|
|
224
224
|
|
|
225
225
|
const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -256,8 +256,8 @@ const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
256
256
|
stroke-dashoffset: -${r * 124 / 200};
|
|
257
257
|
}
|
|
258
258
|
`;
|
|
259
|
-
/**
|
|
260
|
-
* style
|
|
259
|
+
/**
|
|
260
|
+
* style
|
|
261
261
|
*/
|
|
262
262
|
|
|
263
263
|
|
|
@@ -288,8 +288,8 @@ const Indeterminate = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
288
288
|
stroke-linecap: round;
|
|
289
289
|
stroke-width: ${circleStrokeW};
|
|
290
290
|
`;
|
|
291
|
-
/**
|
|
292
|
-
* component
|
|
291
|
+
/**
|
|
292
|
+
* component
|
|
293
293
|
*/
|
|
294
294
|
|
|
295
295
|
const CircleBackgroundMemo = useMemo(() => jsx("circle", {
|
|
@@ -332,8 +332,8 @@ Indeterminate.propTypes = {
|
|
|
332
332
|
width: PropTypes.number
|
|
333
333
|
};
|
|
334
334
|
export const IndeterminateCircularProgress = Indeterminate;
|
|
335
|
-
/**
|
|
336
|
-
* Circular progress
|
|
335
|
+
/**
|
|
336
|
+
* Circular progress
|
|
337
337
|
*/
|
|
338
338
|
|
|
339
339
|
const CircularProgress = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -456,9 +456,9 @@ Transfer.propTypes = {
|
|
|
456
456
|
/** field name used for icon display */
|
|
457
457
|
iconExpr: string,
|
|
458
458
|
|
|
459
|
-
/** field name used for text display<br/>
|
|
460
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
461
|
-
* Note: don't use 'id - name', return undefined
|
|
459
|
+
/** field name used for text display<br/>
|
|
460
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
461
|
+
* Note: don't use 'id - name', return undefined
|
|
462
462
|
*/
|
|
463
463
|
displayExpr: oneOfType([string, array]),
|
|
464
464
|
|
|
@@ -227,8 +227,8 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
227
227
|
el.classList[isChecked ? 'add' : 'remove']('disabled');
|
|
228
228
|
|
|
229
229
|
if (el.classList.contains('DGN-UI-Accordion')) {
|
|
230
|
-
el.firstChild.firstChild.
|
|
231
|
-
el.firstChild.firstChild.
|
|
230
|
+
el.firstChild.firstChild.lastChild.firstChild.firstChild.firstChild.classList[isChecked ? 'add' : 'remove']('disabled');
|
|
231
|
+
el.firstChild.firstChild.lastChild.firstChild.firstChild.firstChild.disabled = isChecked;
|
|
232
232
|
Array.from(el.childNodes).forEach(e => {
|
|
233
233
|
e.classList[isChecked ? 'add' : 'remove']('treeview-disabled');
|
|
234
234
|
});
|
|
@@ -248,7 +248,7 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
248
248
|
if (node.classList.contains('DGN-UI-Accordion') && node.firstChild.classList.contains('DGN-UI-Accordion-Summary')) {
|
|
249
249
|
var _node$querySelectorAl;
|
|
250
250
|
|
|
251
|
-
const checkbox = node.firstChild.firstChild.
|
|
251
|
+
const checkbox = node.firstChild.firstChild.lastChild.firstChild.firstChild.firstChild; // Trường hợp phải set về false để xét các input đã check không bao gồm node này
|
|
252
252
|
|
|
253
253
|
checkbox.firstChild.checked = isChecked;
|
|
254
254
|
const mustDisabled = !!((_node$querySelectorAl = node.querySelectorAll('input:checked')) !== null && _node$querySelectorAl !== void 0 && _node$querySelectorAl.length); // Nếu có ít nhất một input con được check thì phải checked cho input này
|
|
@@ -299,14 +299,18 @@ const TreeView = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
299
299
|
};
|
|
300
300
|
|
|
301
301
|
const setValueIntoInput = data => {
|
|
302
|
+
var _clearIconRef$current2;
|
|
303
|
+
|
|
302
304
|
if (!data || !(data !== null && data !== void 0 && data.length)) {
|
|
305
|
+
var _clearIconRef$current;
|
|
306
|
+
|
|
303
307
|
inputValueRef.current.value = '';
|
|
304
|
-
clearIconRef.current.style.opacity = 0;
|
|
308
|
+
if ((_clearIconRef$current = clearIconRef.current) !== null && _clearIconRef$current !== void 0 && _clearIconRef$current.element) clearIconRef.current.element.style.opacity = 0;
|
|
305
309
|
return;
|
|
306
310
|
}
|
|
307
311
|
|
|
308
|
-
if (clearIconRef.current.style.opacity === '0') {
|
|
309
|
-
clearIconRef.current.style.opacity = null;
|
|
312
|
+
if ((_clearIconRef$current2 = clearIconRef.current) !== null && _clearIconRef$current2 !== void 0 && _clearIconRef$current2.element && clearIconRef.current.element.style.opacity === '0') {
|
|
313
|
+
clearIconRef.current.element.style.opacity = null;
|
|
310
314
|
}
|
|
311
315
|
|
|
312
316
|
let result = '';
|
package/icons/basic.js
CHANGED
|
@@ -2915,6 +2915,34 @@ export const List = /*#__PURE__*/memo(({
|
|
|
2915
2915
|
fill: colors[color] || color
|
|
2916
2916
|
}));
|
|
2917
2917
|
});
|
|
2918
|
+
export const ListAlt = /*#__PURE__*/memo(({
|
|
2919
|
+
width,
|
|
2920
|
+
height,
|
|
2921
|
+
color = '#7F828E',
|
|
2922
|
+
viewBox = false
|
|
2923
|
+
}) => {
|
|
2924
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
2925
|
+
width: width || 24,
|
|
2926
|
+
height: height || 24,
|
|
2927
|
+
viewBox: "0 0 24 24",
|
|
2928
|
+
fill: "none"
|
|
2929
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2930
|
+
fillRule: "evenodd",
|
|
2931
|
+
clipRule: "evenodd",
|
|
2932
|
+
d: "M20.1 3H3.9C3.4 3 3 3.4 3 3.9V20.1C3 20.5 3.4 21 3.9 21H20.1C20.5 21 21 20.5 21 20.1V3.9C21 3.4 20.5 3 20.1 3ZM9 7H7V9H9V7ZM17 7H11V9H17V7ZM17 11H11V13H17V11ZM11 15H17V17H11V15ZM7 11H9V13H7V11ZM9 15H7V17H9V15ZM5 19H19V5H5V19Z",
|
|
2933
|
+
fill: colors[color] || color
|
|
2934
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
2935
|
+
width: width || 18,
|
|
2936
|
+
height: height || 18,
|
|
2937
|
+
viewBox: "0 0 18 18",
|
|
2938
|
+
fill: "none"
|
|
2939
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
2940
|
+
fillRule: "evenodd",
|
|
2941
|
+
clipRule: "evenodd",
|
|
2942
|
+
d: "M17.1 0H0.9C0.4 0 0 0.4 0 0.9V17.1C0 17.5 0.4 18 0.9 18H17.1C17.5 18 18 17.5 18 17.1V0.9C18 0.4 17.5 0 17.1 0ZM6 4H4V6H6V4ZM14 4H8V6H14V4ZM14 8H8V10H14V8ZM8 12H14V14H8V12ZM4 8H6V10H4V8ZM6 12H4V14H6V12ZM2 16H16V2H2V16Z",
|
|
2943
|
+
fill: colors[color] || color
|
|
2944
|
+
}));
|
|
2945
|
+
});
|
|
2918
2946
|
export const ListApproval = /*#__PURE__*/memo(({
|
|
2919
2947
|
width,
|
|
2920
2948
|
height,
|
|
@@ -3720,6 +3748,30 @@ export const NotificationV2 = /*#__PURE__*/memo(({
|
|
|
3720
3748
|
fill: colors[color] || color
|
|
3721
3749
|
}));
|
|
3722
3750
|
});
|
|
3751
|
+
export const Undo = /*#__PURE__*/memo(({
|
|
3752
|
+
width,
|
|
3753
|
+
height,
|
|
3754
|
+
color = '#7F828E',
|
|
3755
|
+
viewBox = false
|
|
3756
|
+
}) => {
|
|
3757
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
3758
|
+
width: width || 24,
|
|
3759
|
+
height: height || 24,
|
|
3760
|
+
viewBox: "0 0 24 24",
|
|
3761
|
+
fill: "none"
|
|
3762
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3763
|
+
d: "M12.5 8C9.85 8 7.45 8.99 5.6 10.6L2 7V16H11L7.38 12.38C8.77 11.22 10.54 10.5 12.5 10.5C16.04 10.5 19.05 12.81 20.1 16L22.47 15.22C21.08 11.03 17.15 8 12.5 8Z",
|
|
3764
|
+
fill: colors[color] || color
|
|
3765
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
3766
|
+
width: width || 21,
|
|
3767
|
+
height: height || 9,
|
|
3768
|
+
viewBox: "0 0 21 9",
|
|
3769
|
+
fill: "none"
|
|
3770
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
3771
|
+
d: "M10.5 1C7.85 1 5.45 1.99 3.6 3.6L0 0V9H9L5.38 5.38C6.77 4.22 8.54 3.5 10.5 3.5C14.04 3.5 17.05 5.81 18.1 9L20.47 8.22C19.08 4.03 15.15 1 10.5 1Z",
|
|
3772
|
+
fill: colors[color] || color
|
|
3773
|
+
}));
|
|
3774
|
+
});
|
|
3723
3775
|
export const Unlock = /*#__PURE__*/memo(({
|
|
3724
3776
|
width,
|
|
3725
3777
|
height,
|
|
@@ -4276,6 +4328,46 @@ export const PersonRate = /*#__PURE__*/memo(({
|
|
|
4276
4328
|
fill: colors[color] || color
|
|
4277
4329
|
}));
|
|
4278
4330
|
});
|
|
4331
|
+
export const PersonSetting = /*#__PURE__*/memo(({
|
|
4332
|
+
width,
|
|
4333
|
+
height,
|
|
4334
|
+
color = '#7F828E',
|
|
4335
|
+
viewBox = false
|
|
4336
|
+
}) => {
|
|
4337
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
4338
|
+
width: width || 24,
|
|
4339
|
+
height: height || 24,
|
|
4340
|
+
viewBox: "0 0 24 24",
|
|
4341
|
+
fill: "none"
|
|
4342
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4343
|
+
d: "M11 11C13.21 11 15 9.21 15 7C15 4.79 13.21 3 11 3C8.79 3 7 4.79 7 7C7 9.21 8.79 11 11 11Z",
|
|
4344
|
+
fill: colors[color] || color
|
|
4345
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
4346
|
+
d: "M11 13C8.33 13 3 14.34 3 17V19H12.8027C12.2922 18.1175 12 17.0929 12 16C12 14.9646 12.2623 13.9904 12.724 13.1403C12.0912 13.0468 11.4991 13 11 13Z",
|
|
4347
|
+
fill: colors[color] || color
|
|
4348
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
4349
|
+
fillRule: "evenodd",
|
|
4350
|
+
clipRule: "evenodd",
|
|
4351
|
+
d: "M21.0851 16C21.0851 16.136 21.0727 16.264 21.0563 16.392L21.924 17.052C22.0021 17.112 22.0227 17.22 21.9733 17.308L21.1509 18.692C21.1015 18.78 20.9946 18.816 20.9 18.78L19.8761 18.38C19.6622 18.536 19.432 18.672 19.1811 18.772L19.0248 19.832C19.0125 19.928 18.9262 20 18.8234 20H17.1785C17.0757 20 16.9893 19.928 16.977 19.832L16.8207 18.772C16.5699 18.672 16.3396 18.54 16.1257 18.38L15.1018 18.78C15.0113 18.812 14.9003 18.78 14.851 18.692L14.0285 17.308C13.9792 17.22 13.9997 17.112 14.0779 17.052L14.9455 16.392C14.9291 16.264 14.9167 16.132 14.9167 16C14.9167 15.868 14.9291 15.736 14.9455 15.608L14.0779 14.948C13.9997 14.888 13.9751 14.78 14.0285 14.692L14.851 13.308C14.9003 13.22 15.0072 13.184 15.1018 13.22L16.1257 13.62C16.3396 13.464 16.5699 13.328 16.8207 13.228L16.977 12.168C16.9893 12.072 17.0757 12 17.1785 12H18.8234C18.9262 12 19.0125 12.072 19.0248 12.168L19.1811 13.228C19.432 13.328 19.6622 13.46 19.8761 13.62L20.9 13.22C20.9905 13.188 21.1015 13.22 21.1509 13.308L21.9733 14.692C22.0227 14.78 22.0021 14.888 21.924 14.948L21.0563 15.608C21.0727 15.736 21.0851 15.864 21.0851 16ZM16.5616 16C16.5616 16.772 17.2073 17.4 18.0009 17.4C18.7946 17.4 19.4402 16.772 19.4402 16C19.4402 15.228 18.7946 14.6 18.0009 14.6C17.2073 14.6 16.5616 15.228 16.5616 16Z",
|
|
4352
|
+
fill: colors[color] || color
|
|
4353
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
4354
|
+
width: width || 19,
|
|
4355
|
+
height: height || 17,
|
|
4356
|
+
viewBox: "0 0 19 17",
|
|
4357
|
+
fill: "none"
|
|
4358
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4359
|
+
d: "M8 8C10.21 8 12 6.21 12 4C12 1.79 10.21 0 8 0C5.79 0 4 1.79 4 4C4 6.21 5.79 8 8 8Z",
|
|
4360
|
+
fill: colors[color] || color
|
|
4361
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
4362
|
+
d: "M8 10C5.33 10 0 11.34 0 14V16H9.80269C9.29218 15.1175 9 14.0929 9 13C9 11.9646 9.26227 10.9904 9.724 10.1403C9.09118 10.0468 8.49911 10 8 10Z",
|
|
4363
|
+
fill: colors[color] || color
|
|
4364
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
4365
|
+
fillRule: "evenodd",
|
|
4366
|
+
clipRule: "evenodd",
|
|
4367
|
+
d: "M18.0851 13C18.0851 13.136 18.0727 13.264 18.0563 13.392L18.924 14.052C19.0021 14.112 19.0227 14.22 18.9733 14.308L18.1509 15.692C18.1015 15.78 17.9946 15.816 17.9 15.78L16.8761 15.38C16.6622 15.536 16.432 15.672 16.1811 15.772L16.0248 16.832C16.0125 16.928 15.9262 17 15.8234 17H14.1785C14.0757 17 13.9893 16.928 13.977 16.832L13.8207 15.772C13.5699 15.672 13.3396 15.54 13.1257 15.38L12.1018 15.78C12.0113 15.812 11.9003 15.78 11.851 15.692L11.0285 14.308C10.9792 14.22 10.9997 14.112 11.0779 14.052L11.9455 13.392C11.9291 13.264 11.9167 13.132 11.9167 13C11.9167 12.868 11.9291 12.736 11.9455 12.608L11.0779 11.948C10.9997 11.888 10.9751 11.78 11.0285 11.692L11.851 10.308C11.9003 10.22 12.0072 10.184 12.1018 10.22L13.1257 10.62C13.3396 10.464 13.5699 10.328 13.8207 10.228L13.977 9.168C13.9893 9.072 14.0757 9 14.1785 9H15.8234C15.9262 9 16.0125 9.072 16.0248 9.168L16.1811 10.228C16.432 10.328 16.6622 10.46 16.8761 10.62L17.9 10.22C17.9905 10.188 18.1015 10.22 18.1509 10.308L18.9733 11.692C19.0227 11.78 19.0021 11.888 18.924 11.948L18.0563 12.608C18.0727 12.736 18.0851 12.864 18.0851 13ZM13.5616 13C13.5616 13.772 14.2073 14.4 15.0009 14.4C15.7946 14.4 16.4402 13.772 16.4402 13C16.4402 12.228 15.7946 11.6 15.0009 11.6C14.2073 11.6 13.5616 12.228 13.5616 13Z",
|
|
4368
|
+
fill: colors[color] || color
|
|
4369
|
+
}));
|
|
4370
|
+
});
|
|
4279
4371
|
export const PersonSync = /*#__PURE__*/memo(({
|
|
4280
4372
|
width,
|
|
4281
4373
|
height,
|
|
@@ -5547,6 +5639,34 @@ export const View = /*#__PURE__*/memo(({
|
|
|
5547
5639
|
fill: colors[color] || color
|
|
5548
5640
|
}));
|
|
5549
5641
|
});
|
|
5642
|
+
export const ViewHeadline = /*#__PURE__*/memo(({
|
|
5643
|
+
width,
|
|
5644
|
+
height,
|
|
5645
|
+
color = '#7F828E',
|
|
5646
|
+
viewBox = false
|
|
5647
|
+
}) => {
|
|
5648
|
+
return viewBox ? /*#__PURE__*/React.createElement("svg", {
|
|
5649
|
+
width: width || 24,
|
|
5650
|
+
height: height || 24,
|
|
5651
|
+
viewBox: "0 0 24 24",
|
|
5652
|
+
fill: "none"
|
|
5653
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
5654
|
+
fillRule: "evenodd",
|
|
5655
|
+
clipRule: "evenodd",
|
|
5656
|
+
d: "M4 7V5H20V7H4ZM4 11H20V9H4V11ZM20 15H4V13H20V15ZM20 19H4V17H20V19Z",
|
|
5657
|
+
fill: colors[color] || color
|
|
5658
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
5659
|
+
width: width || 16,
|
|
5660
|
+
height: height || 14,
|
|
5661
|
+
viewBox: "0 0 16 14",
|
|
5662
|
+
fill: "none"
|
|
5663
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
5664
|
+
fillRule: "evenodd",
|
|
5665
|
+
clipRule: "evenodd",
|
|
5666
|
+
d: "M0 2V0H16V2H0ZM0 6H16V4H0V6ZM16 10H0V8H16V10ZM16 14H0V12H16V14Z",
|
|
5667
|
+
fill: colors[color] || color
|
|
5668
|
+
}));
|
|
5669
|
+
});
|
|
5550
5670
|
export const UnView = /*#__PURE__*/memo(({
|
|
5551
5671
|
width,
|
|
5552
5672
|
height,
|
package/icons/effect.js
CHANGED
|
@@ -45,15 +45,10 @@ const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
45
45
|
height: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
46
46
|
border: 1px dashed ${rest};
|
|
47
47
|
`;
|
|
48
|
-
useImperativeHandle(reference, () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_instance.__proto__ = {}; // hidden methods
|
|
53
|
-
|
|
54
|
-
currentRef.instance = _instance;
|
|
55
|
-
return currentRef;
|
|
56
|
-
});
|
|
48
|
+
useImperativeHandle(reference, () => ({
|
|
49
|
+
element: ref.current,
|
|
50
|
+
instance: {}
|
|
51
|
+
}));
|
|
57
52
|
return useMemo(() => {
|
|
58
53
|
if (!name) return null;
|
|
59
54
|
let node = null;
|
|
@@ -94,8 +89,8 @@ Icon.propTypes = {
|
|
|
94
89
|
/** name of icon in icons store */
|
|
95
90
|
name: PropTypes.string.isRequired,
|
|
96
91
|
|
|
97
|
-
/** color of icon<br />
|
|
98
|
-
* default: #7F828E
|
|
92
|
+
/** color of icon<br />
|
|
93
|
+
* default: #7F828E
|
|
99
94
|
*/
|
|
100
95
|
color: PropTypes.string,
|
|
101
96
|
|
|
@@ -117,19 +112,19 @@ Icon.propTypes = {
|
|
|
117
112
|
/** have view box if true */
|
|
118
113
|
onClick: PropTypes.func,
|
|
119
114
|
|
|
120
|
-
/**
|
|
121
|
-
* ref methods
|
|
122
|
-
*
|
|
123
|
-
* * option(): Gets all UI component properties
|
|
124
|
-
* * Returns value - object
|
|
125
|
-
* * option(optionName): Gets the value of a single property
|
|
126
|
-
* * @param {optionName} - string
|
|
127
|
-
* * Returns value - any
|
|
128
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
129
|
-
* * @param {optionName} - string
|
|
130
|
-
* * @param {optionValue} - any
|
|
131
|
-
* * option(options): Updates the values of several properties
|
|
132
|
-
* * @param {options} - object
|
|
115
|
+
/**
|
|
116
|
+
* ref methods
|
|
117
|
+
*
|
|
118
|
+
* * option(): Gets all UI component properties
|
|
119
|
+
* * Returns value - object
|
|
120
|
+
* * option(optionName): Gets the value of a single property
|
|
121
|
+
* * @param {optionName} - string
|
|
122
|
+
* * Returns value - any
|
|
123
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
124
|
+
* * @param {optionName} - string
|
|
125
|
+
* * @param {optionValue} - any
|
|
126
|
+
* * option(options): Updates the values of several properties
|
|
127
|
+
* * @param {options} - object
|
|
133
128
|
*/
|
|
134
129
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
135
130
|
current: PropTypes.instanceOf(Element)
|