diginet-core-ui 1.3.85-beta.2 → 1.3.85-beta.4
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/components/alert/notify.js +10 -10
- package/components/avatar/index.js +19 -19
- package/components/badge/index.js +18 -18
- package/components/button/icon.js +21 -21
- package/components/button/index.js +13 -13
- package/components/button/more.js +13 -13
- package/components/form-control/calendar/function.js +113 -113
- package/components/form-control/checkbox/index.js +4 -4
- package/components/form-control/date-range-picker/index.js +6 -6
- package/components/form-control/dropdown/index.js +16 -38
- package/components/form-control/input-base/index.js +48 -54
- package/components/form-control/radio/index.js +5 -5
- package/components/form-control/toggle/index.js +4 -4
- package/components/paging/page-info.js +23 -23
- package/components/paging/page-selector2.js +23 -23
- package/components/popup/v2/index.js +13 -13
- package/components/rating/index.js +8 -8
- package/components/tab/tab-header.js +2 -2
- package/components/tab/tab-panel.js +2 -2
- package/components/tree-view/index.js +125 -129
- package/package.json +1 -1
- package/styles/utils.js +15 -15
- package/components/tree-view/css.js +0 -107
|
@@ -104,9 +104,9 @@ Notify.defaultProps = {
|
|
|
104
104
|
Notify.propTypes = {
|
|
105
105
|
/** Class for component. */
|
|
106
106
|
className: PropTypes.string,
|
|
107
|
-
/**
|
|
108
|
-
* used to set position of Alert (is a string or an object)
|
|
109
|
-
* string is center (obligatory) as {vertical: 'center', horizontal: 'center'}
|
|
107
|
+
/**
|
|
108
|
+
* used to set position of Alert (is a string or an object)
|
|
109
|
+
* string is center (obligatory) as {vertical: 'center', horizontal: 'center'}
|
|
110
110
|
*/
|
|
111
111
|
position: PropTypes.oneOfType([PropTypes.oneOf(['center']), PropTypes.shape({
|
|
112
112
|
horizontal: PropTypes.oneOf(['center', 'left', 'right']),
|
|
@@ -116,13 +116,13 @@ Notify.propTypes = {
|
|
|
116
116
|
style: PropTypes.object,
|
|
117
117
|
/** Any [props](https://core.diginet.com.vn/ui/?path=/docs/alert--basic) of Alert */
|
|
118
118
|
props: PropTypes.any,
|
|
119
|
-
/**
|
|
120
|
-
* ref methods (ref.current.instance.*method*)
|
|
121
|
-
*
|
|
122
|
-
* * show(message, option): Show notify
|
|
123
|
-
* * @param {message} - number
|
|
124
|
-
* * @param {options} - object
|
|
125
|
-
* * {[Props](https://core.diginet.com.vn/ui/?path=/docs/alert--basic) applied to the `Alert`.}
|
|
119
|
+
/**
|
|
120
|
+
* ref methods (ref.current.instance.*method*)
|
|
121
|
+
*
|
|
122
|
+
* * show(message, option): Show notify
|
|
123
|
+
* * @param {message} - number
|
|
124
|
+
* * @param {options} - object
|
|
125
|
+
* * {[Props](https://core.diginet.com.vn/ui/?path=/docs/alert--basic) applied to the `Alert`.}
|
|
126
126
|
*/
|
|
127
127
|
reference: ref
|
|
128
128
|
};
|
|
@@ -398,14 +398,14 @@ Avatar.propTypes = {
|
|
|
398
398
|
className: PropTypes.string,
|
|
399
399
|
/** If `true`, display remove avatar icon. */
|
|
400
400
|
clearAble: PropTypes.bool,
|
|
401
|
-
/**
|
|
402
|
-
* data to display when hoverAble is true<br />
|
|
403
|
-
* data is an object or function return a jsx element
|
|
401
|
+
/**
|
|
402
|
+
* data to display when hoverAble is true<br />
|
|
403
|
+
* data is an object or function return a jsx element
|
|
404
404
|
*/
|
|
405
405
|
data: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.node]),
|
|
406
|
-
/**
|
|
407
|
-
* it is used to display the default if there is no src<br />
|
|
408
|
-
* if undefined, will display icons available in the icons store
|
|
406
|
+
/**
|
|
407
|
+
* it is used to display the default if there is no src<br />
|
|
408
|
+
* if undefined, will display icons available in the icons store
|
|
409
409
|
*/
|
|
410
410
|
defaultSrc: PropTypes.string,
|
|
411
411
|
/** the direction to display more info */
|
|
@@ -442,19 +442,19 @@ Avatar.propTypes = {
|
|
|
442
442
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
443
443
|
/** the error to show on wrong type */
|
|
444
444
|
wrongTypeError: PropTypes.string,
|
|
445
|
-
/**
|
|
446
|
-
* ref methods
|
|
447
|
-
*
|
|
448
|
-
* * option(): Gets all UI component properties
|
|
449
|
-
* * Returns value - object
|
|
450
|
-
* * option(optionName): Gets the value of a single property
|
|
451
|
-
* * @param {optionName} - string
|
|
452
|
-
* * Returns value - any
|
|
453
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
454
|
-
* * @param {optionName} - string
|
|
455
|
-
* * @param {optionValue} - any
|
|
456
|
-
* * option(options): Updates the values of several properties
|
|
457
|
-
* * @param {options} - object
|
|
445
|
+
/**
|
|
446
|
+
* ref methods
|
|
447
|
+
*
|
|
448
|
+
* * option(): Gets all UI component properties
|
|
449
|
+
* * Returns value - object
|
|
450
|
+
* * option(optionName): Gets the value of a single property
|
|
451
|
+
* * @param {optionName} - string
|
|
452
|
+
* * Returns value - any
|
|
453
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
454
|
+
* * @param {optionName} - string
|
|
455
|
+
* * @param {optionValue} - any
|
|
456
|
+
* * option(options): Updates the values of several properties
|
|
457
|
+
* * @param {options} - object
|
|
458
458
|
*/
|
|
459
459
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
460
460
|
current: PropTypes.instanceOf(Element)
|
|
@@ -201,28 +201,28 @@ Badge.propTypes = {
|
|
|
201
201
|
name: PropTypes.string,
|
|
202
202
|
/** Controls whether the badge is hidden when `content` is zero. */
|
|
203
203
|
showZero: PropTypes.bool,
|
|
204
|
-
/** Size of the components.
|
|
205
|
-
*
|
|
206
|
-
* * medium (dot 8px, typography p3)
|
|
207
|
-
* * large (button 10px, typography p2)
|
|
208
|
-
* * giant (button 12px, typography p1)
|
|
204
|
+
/** Size of the components.
|
|
205
|
+
*
|
|
206
|
+
* * medium (dot 8px, typography p3)
|
|
207
|
+
* * large (button 10px, typography p2)
|
|
208
|
+
* * giant (button 12px, typography p1)
|
|
209
209
|
* */
|
|
210
210
|
size: PropTypes.oneOf(['medium', 'large', 'giant']),
|
|
211
211
|
/** Style inline of component. */
|
|
212
212
|
style: PropTypes.object,
|
|
213
|
-
/**
|
|
214
|
-
* ref methods (ref.current.instance.*method*)
|
|
215
|
-
*
|
|
216
|
-
* * option(): Gets all UI component properties
|
|
217
|
-
* * Returns value - object
|
|
218
|
-
* * option(optionName): Gets the value of a single property
|
|
219
|
-
* * @param {optionName} - string
|
|
220
|
-
* * Returns value - any
|
|
221
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
222
|
-
* * @param {optionName} - string
|
|
223
|
-
* * @param {optionValue} - any
|
|
224
|
-
* * option(options): Updates the values of several properties
|
|
225
|
-
* * @param {options} - object
|
|
213
|
+
/**
|
|
214
|
+
* ref methods (ref.current.instance.*method*)
|
|
215
|
+
*
|
|
216
|
+
* * option(): Gets all UI component properties
|
|
217
|
+
* * Returns value - object
|
|
218
|
+
* * option(optionName): Gets the value of a single property
|
|
219
|
+
* * @param {optionName} - string
|
|
220
|
+
* * Returns value - any
|
|
221
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
222
|
+
* * @param {optionName} - string
|
|
223
|
+
* * @param {optionValue} - any
|
|
224
|
+
* * option(options): Updates the values of several properties
|
|
225
|
+
* * @param {options} - object
|
|
226
226
|
*/
|
|
227
227
|
reference: ref
|
|
228
228
|
};
|
|
@@ -320,14 +320,14 @@ ButtonIcon.propTypes = {
|
|
|
320
320
|
onClick: PropTypes.func,
|
|
321
321
|
/** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
|
|
322
322
|
name: PropTypes.string,
|
|
323
|
-
/**
|
|
324
|
-
* The size of the component.
|
|
325
|
-
*
|
|
326
|
-
* * tiny (button 24px, icon 16px)
|
|
327
|
-
* * small (button 32px, icon 20px)
|
|
328
|
-
* * medium (button 40px, icon 24px)
|
|
329
|
-
* * large (button 48px, icon 32px)
|
|
330
|
-
* * giant (button 56px, icon 40px)
|
|
323
|
+
/**
|
|
324
|
+
* The size of the component.
|
|
325
|
+
*
|
|
326
|
+
* * tiny (button 24px, icon 16px)
|
|
327
|
+
* * small (button 32px, icon 20px)
|
|
328
|
+
* * medium (button 40px, icon 24px)
|
|
329
|
+
* * large (button 48px, icon 32px)
|
|
330
|
+
* * giant (button 56px, icon 40px)
|
|
331
331
|
* */
|
|
332
332
|
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant', 'extraGiant']),
|
|
333
333
|
/** Style inline of component. */
|
|
@@ -338,19 +338,19 @@ ButtonIcon.propTypes = {
|
|
|
338
338
|
viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'ghost']),
|
|
339
339
|
/** Width of the component. */
|
|
340
340
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
341
|
-
/**
|
|
342
|
-
* ref methods (ref.current.instance.*method*)
|
|
343
|
-
*
|
|
344
|
-
* * option(): Gets all UI component properties
|
|
345
|
-
* * Returns value - object
|
|
346
|
-
* * option(optionName): Gets the value of a single property
|
|
347
|
-
* * @param {optionName} - string
|
|
348
|
-
* * Returns value - any
|
|
349
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
350
|
-
* * @param {optionName} - string
|
|
351
|
-
* * @param {optionValue} - any
|
|
352
|
-
* * option(options): Updates the values of several properties
|
|
353
|
-
* * @param {options} - object
|
|
341
|
+
/**
|
|
342
|
+
* ref methods (ref.current.instance.*method*)
|
|
343
|
+
*
|
|
344
|
+
* * option(): Gets all UI component properties
|
|
345
|
+
* * Returns value - object
|
|
346
|
+
* * option(optionName): Gets the value of a single property
|
|
347
|
+
* * @param {optionName} - string
|
|
348
|
+
* * Returns value - any
|
|
349
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
350
|
+
* * @param {optionName} - string
|
|
351
|
+
* * @param {optionValue} - any
|
|
352
|
+
* * option(options): Updates the values of several properties
|
|
353
|
+
* * @param {options} - object
|
|
354
354
|
*/
|
|
355
355
|
reference: ref
|
|
356
356
|
};
|
|
@@ -438,19 +438,19 @@ Button.propTypes = {
|
|
|
438
438
|
urlParams: PropTypes.object,
|
|
439
439
|
/** The variant to use. */
|
|
440
440
|
viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'link']),
|
|
441
|
-
/**
|
|
442
|
-
* ref methods (ref.current.instance.*method*)
|
|
443
|
-
*
|
|
444
|
-
* * option(): Gets all UI component properties
|
|
445
|
-
* * Returns value - object
|
|
446
|
-
* * option(optionName): Gets the value of a single property
|
|
447
|
-
* * @param {optionName} - string
|
|
448
|
-
* * Returns value - any
|
|
449
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
450
|
-
* * @param {optionName} - string
|
|
451
|
-
* * @param {optionValue} - any
|
|
452
|
-
* * option(options): Updates the values of several properties
|
|
453
|
-
* * @param {options} - object
|
|
441
|
+
/**
|
|
442
|
+
* ref methods (ref.current.instance.*method*)
|
|
443
|
+
*
|
|
444
|
+
* * option(): Gets all UI component properties
|
|
445
|
+
* * Returns value - object
|
|
446
|
+
* * option(optionName): Gets the value of a single property
|
|
447
|
+
* * @param {optionName} - string
|
|
448
|
+
* * Returns value - any
|
|
449
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
450
|
+
* * @param {optionName} - string
|
|
451
|
+
* * @param {optionValue} - any
|
|
452
|
+
* * option(options): Updates the values of several properties
|
|
453
|
+
* * @param {options} - object
|
|
454
454
|
*/
|
|
455
455
|
reference: ref
|
|
456
456
|
};
|
|
@@ -174,19 +174,19 @@ ButtonMore.propTypes = {
|
|
|
174
174
|
popoverProp: PropTypes.object,
|
|
175
175
|
/** Style inline of component. */
|
|
176
176
|
style: PropTypes.object,
|
|
177
|
-
/**
|
|
178
|
-
* ref methods (ref.current.instance.*method*)
|
|
179
|
-
*
|
|
180
|
-
* * option(): Gets all UI component properties
|
|
181
|
-
* * Returns value - object
|
|
182
|
-
* * option(optionName): Gets the value of a single property
|
|
183
|
-
* * @param {optionName} - string
|
|
184
|
-
* * Returns value - any
|
|
185
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
186
|
-
* * @param {optionName} - string
|
|
187
|
-
* * @param {optionValue} - any
|
|
188
|
-
* * option(options): Updates the values of several properties
|
|
189
|
-
* * @param {options} - object
|
|
177
|
+
/**
|
|
178
|
+
* ref methods (ref.current.instance.*method*)
|
|
179
|
+
*
|
|
180
|
+
* * option(): Gets all UI component properties
|
|
181
|
+
* * Returns value - object
|
|
182
|
+
* * option(optionName): Gets the value of a single property
|
|
183
|
+
* * @param {optionName} - string
|
|
184
|
+
* * Returns value - any
|
|
185
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
186
|
+
* * @param {optionName} - string
|
|
187
|
+
* * @param {optionValue} - any
|
|
188
|
+
* * option(options): Updates the values of several properties
|
|
189
|
+
* * @param {options} - object
|
|
190
190
|
*/
|
|
191
191
|
reference: ref
|
|
192
192
|
};
|
|
@@ -32,15 +32,15 @@ const {
|
|
|
32
32
|
info8
|
|
33
33
|
} = colors;
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* START STYLE
|
|
35
|
+
/**
|
|
36
|
+
* START STYLE
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @param {Object} unique
|
|
42
|
-
* @param {Boolean} boxShadow
|
|
43
|
-
* @returns
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {Object} unique
|
|
42
|
+
* @param {Boolean} boxShadow
|
|
43
|
+
* @returns
|
|
44
44
|
*/
|
|
45
45
|
const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) => css`
|
|
46
46
|
${borderRadius4px}
|
|
@@ -243,15 +243,15 @@ const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) =>
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
`;
|
|
246
|
-
/**
|
|
247
|
-
* END STYLE
|
|
246
|
+
/**
|
|
247
|
+
* END STYLE
|
|
248
248
|
*/
|
|
249
249
|
|
|
250
|
-
/**
|
|
251
|
-
*
|
|
252
|
-
* @description return props of the typography.
|
|
253
|
-
* @param {String} className
|
|
254
|
-
* @returns {Object} props of the typography
|
|
250
|
+
/**
|
|
251
|
+
*
|
|
252
|
+
* @description return props of the typography.
|
|
253
|
+
* @param {String} className
|
|
254
|
+
* @returns {Object} props of the typography
|
|
255
255
|
*/
|
|
256
256
|
const typographyProps = className => {
|
|
257
257
|
return {
|
|
@@ -270,11 +270,11 @@ const typographyProps = className => {
|
|
|
270
270
|
type: 'h6'
|
|
271
271
|
};
|
|
272
272
|
};
|
|
273
|
-
/**
|
|
274
|
-
*
|
|
275
|
-
* @description return props of the button icon.
|
|
276
|
-
* @param {String} className
|
|
277
|
-
* @returns {Object} props of the button icon
|
|
273
|
+
/**
|
|
274
|
+
*
|
|
275
|
+
* @description return props of the button icon.
|
|
276
|
+
* @param {String} className
|
|
277
|
+
* @returns {Object} props of the button icon
|
|
278
278
|
*/
|
|
279
279
|
const buttonIconProps = className => {
|
|
280
280
|
return {
|
|
@@ -286,11 +286,11 @@ const buttonIconProps = className => {
|
|
|
286
286
|
width: 28
|
|
287
287
|
};
|
|
288
288
|
};
|
|
289
|
-
/**
|
|
290
|
-
*
|
|
291
|
-
* @description return props of the button icon.
|
|
292
|
-
* @param {Function} fn
|
|
293
|
-
* @returns {Object} props of the button text
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
* @description return props of the button icon.
|
|
292
|
+
* @param {Function} fn
|
|
293
|
+
* @returns {Object} props of the button text
|
|
294
294
|
*/
|
|
295
295
|
const buttonTextProps = fn => {
|
|
296
296
|
return {
|
|
@@ -306,43 +306,43 @@ const buttonTextProps = fn => {
|
|
|
306
306
|
};
|
|
307
307
|
};
|
|
308
308
|
|
|
309
|
-
/**
|
|
310
|
-
* @description detect value is a Date object
|
|
311
|
-
* @param {String | Number | Array} value
|
|
312
|
-
* @returns boolean
|
|
309
|
+
/**
|
|
310
|
+
* @description detect value is a Date object
|
|
311
|
+
* @param {String | Number | Array} value
|
|
312
|
+
* @returns boolean
|
|
313
313
|
*/
|
|
314
314
|
const isValidDate = value => {
|
|
315
315
|
return new Date(value) instanceof Date && !isNaN(new Date(value));
|
|
316
316
|
};
|
|
317
|
-
/**
|
|
318
|
-
*
|
|
319
|
-
* @description set Sunday (0) to the last day of week.
|
|
320
|
-
* @param {Date} date
|
|
321
|
-
* @returns number of day from 0 (Monday) to 6 (Sunday).
|
|
317
|
+
/**
|
|
318
|
+
*
|
|
319
|
+
* @description set Sunday (0) to the last day of week.
|
|
320
|
+
* @param {Date} date
|
|
321
|
+
* @returns number of day from 0 (Monday) to 6 (Sunday).
|
|
322
322
|
*/
|
|
323
323
|
const getDateOfWeek = date => {
|
|
324
324
|
let day = date.getDay();
|
|
325
325
|
if (day === 0) day = 7;
|
|
326
326
|
return day - 1;
|
|
327
327
|
};
|
|
328
|
-
/**
|
|
329
|
-
*
|
|
330
|
-
* @description check day is today.
|
|
331
|
-
* @param {Date} day
|
|
332
|
-
* @param {Date} today
|
|
333
|
-
* @param {String} className
|
|
334
|
-
* @returns {Boolean} is today
|
|
328
|
+
/**
|
|
329
|
+
*
|
|
330
|
+
* @description check day is today.
|
|
331
|
+
* @param {Date} day
|
|
332
|
+
* @param {Date} today
|
|
333
|
+
* @param {String} className
|
|
334
|
+
* @returns {Boolean} is today
|
|
335
335
|
*/
|
|
336
336
|
const isToday = (day, today, className) => {
|
|
337
337
|
return +moment(day).diff(today) === 0 ? className : '';
|
|
338
338
|
};
|
|
339
|
-
/**
|
|
340
|
-
*
|
|
341
|
-
* @description check day is active day.
|
|
342
|
-
* @param {Date} day
|
|
343
|
-
* @param {Date} active
|
|
344
|
-
* @param {String} className
|
|
345
|
-
* @returns {Boolean} is active day
|
|
339
|
+
/**
|
|
340
|
+
*
|
|
341
|
+
* @description check day is active day.
|
|
342
|
+
* @param {Date} day
|
|
343
|
+
* @param {Date} active
|
|
344
|
+
* @param {String} className
|
|
345
|
+
* @returns {Boolean} is active day
|
|
346
346
|
*/
|
|
347
347
|
const isActive = (day, active, className) => {
|
|
348
348
|
if (Array.isArray(active)) {
|
|
@@ -355,14 +355,14 @@ const isActive = (day, active, className) => {
|
|
|
355
355
|
}
|
|
356
356
|
return '';
|
|
357
357
|
};
|
|
358
|
-
/**
|
|
359
|
-
*
|
|
360
|
-
* @description check day is min/max day.
|
|
361
|
-
* @param {Date} day
|
|
362
|
-
* @param {Date} max
|
|
363
|
-
* @param {Date} min
|
|
364
|
-
* @param {Object} className
|
|
365
|
-
* @returns {Boolean} is limited day
|
|
358
|
+
/**
|
|
359
|
+
*
|
|
360
|
+
* @description check day is min/max day.
|
|
361
|
+
* @param {Date} day
|
|
362
|
+
* @param {Date} max
|
|
363
|
+
* @param {Date} min
|
|
364
|
+
* @param {Object} className
|
|
365
|
+
* @returns {Boolean} is limited day
|
|
366
366
|
*/
|
|
367
367
|
const isLimit = (day, max, min, className) => {
|
|
368
368
|
return isBeforeLimit(min, day) || isAfterLimit(max, day) ? className : '';
|
|
@@ -385,17 +385,17 @@ const isBeforeLimit = (min, time) => {
|
|
|
385
385
|
const isAfterLimit = (max, time) => {
|
|
386
386
|
return max && isValidDate(max) && moment(time).diff(new Date(max).setHours(0, 0, 0, 0)) > 0;
|
|
387
387
|
};
|
|
388
|
-
/**
|
|
389
|
-
*
|
|
390
|
-
* @description return the table body of the calendar.
|
|
391
|
-
* @param {Date} time
|
|
392
|
-
* @param {Date} activeValue
|
|
393
|
-
* @param {Object} className
|
|
394
|
-
* @param {Boolean} displayAnotherMonth
|
|
395
|
-
* @param {Function} onTableDataClick
|
|
396
|
-
* @param {Date} min
|
|
397
|
-
* @param {Date} max
|
|
398
|
-
* @returns {Element}
|
|
388
|
+
/**
|
|
389
|
+
*
|
|
390
|
+
* @description return the table body of the calendar.
|
|
391
|
+
* @param {Date} time
|
|
392
|
+
* @param {Date} activeValue
|
|
393
|
+
* @param {Object} className
|
|
394
|
+
* @param {Boolean} displayAnotherMonth
|
|
395
|
+
* @param {Function} onTableDataClick
|
|
396
|
+
* @param {Date} min
|
|
397
|
+
* @param {Date} max
|
|
398
|
+
* @returns {Element}
|
|
399
399
|
*/
|
|
400
400
|
const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTableDataClick, min, max) => {
|
|
401
401
|
time = new Date(time);
|
|
@@ -412,8 +412,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
412
412
|
weekDateFirst = getDateOfWeek(firstDay),
|
|
413
413
|
weekDateLast = getDateOfWeek(lastDay);
|
|
414
414
|
if (activeValue && Array.isArray(activeValue) && activeValue.length === 2 && activeValue[0] !== activeValue[1]) {
|
|
415
|
-
/**
|
|
416
|
-
* days of previous month
|
|
415
|
+
/**
|
|
416
|
+
* days of previous month
|
|
417
417
|
*/
|
|
418
418
|
active = activeValue;
|
|
419
419
|
for (let i = weekDateFirst; i > 0; i--) {
|
|
@@ -428,8 +428,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
428
428
|
...typographyProps(className.day.day)
|
|
429
429
|
}, '')));
|
|
430
430
|
}
|
|
431
|
-
/**
|
|
432
|
-
* days of this month
|
|
431
|
+
/**
|
|
432
|
+
* days of this month
|
|
433
433
|
*/
|
|
434
434
|
for (let i = 0; i < lastDate; i++) {
|
|
435
435
|
const day = new Date(time.getFullYear(), time.getMonth(), i + 1);
|
|
@@ -442,8 +442,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
442
442
|
...typographyProps(className.day.day)
|
|
443
443
|
}, i + 1)));
|
|
444
444
|
}
|
|
445
|
-
/**
|
|
446
|
-
* days of next month
|
|
445
|
+
/**
|
|
446
|
+
* days of next month
|
|
447
447
|
*/
|
|
448
448
|
for (let i = 0; i < 20 - weekDateLast; i++) {
|
|
449
449
|
const day = new Date(time.getFullYear(), time.getMonth() + 1,
|
|
@@ -458,8 +458,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
458
458
|
}, '')));
|
|
459
459
|
}
|
|
460
460
|
} else {
|
|
461
|
-
/**
|
|
462
|
-
* days of previous month
|
|
461
|
+
/**
|
|
462
|
+
* days of previous month
|
|
463
463
|
*/
|
|
464
464
|
for (let i = weekDateFirst; i > 0; i--) {
|
|
465
465
|
const day = new Date(time.getFullYear(), time.getMonth() - 1, displayAnotherMonth ? prevDate - i + 1 : 1);
|
|
@@ -472,8 +472,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
472
472
|
...typographyProps(className.day.day)
|
|
473
473
|
}, displayAnotherMonth ? prevDate - i + 1 : '')));
|
|
474
474
|
}
|
|
475
|
-
/**
|
|
476
|
-
* days of this month
|
|
475
|
+
/**
|
|
476
|
+
* days of this month
|
|
477
477
|
*/
|
|
478
478
|
for (let i = 0; i < lastDate; i++) {
|
|
479
479
|
const day = new Date(time.getFullYear(), time.getMonth(), i + 1);
|
|
@@ -486,8 +486,8 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
486
486
|
...typographyProps(className.day.day)
|
|
487
487
|
}, i + 1)));
|
|
488
488
|
}
|
|
489
|
-
/**
|
|
490
|
-
* days of next month
|
|
489
|
+
/**
|
|
490
|
+
* days of next month
|
|
491
491
|
*/
|
|
492
492
|
for (let i = 0; i < 20 - weekDateLast; i++) {
|
|
493
493
|
const day = new Date(time.getFullYear(), time.getMonth() + 1, displayAnotherMonth ? i + 1 : 6 - weekDateLast);
|
|
@@ -513,10 +513,10 @@ const renderTableBody = (time, activeValue, className, displayAnotherMonth, onTa
|
|
|
513
513
|
}
|
|
514
514
|
return tableBody;
|
|
515
515
|
};
|
|
516
|
-
/**
|
|
517
|
-
*
|
|
518
|
-
* @param {Object} className
|
|
519
|
-
* @returns
|
|
516
|
+
/**
|
|
517
|
+
*
|
|
518
|
+
* @param {Object} className
|
|
519
|
+
* @returns
|
|
520
520
|
*/
|
|
521
521
|
const renderHeader = className => {
|
|
522
522
|
const weekdays = getGlobal(['weekdaysLong']);
|
|
@@ -535,15 +535,15 @@ const renderHeader = className => {
|
|
|
535
535
|
}, tableHeader));
|
|
536
536
|
return header;
|
|
537
537
|
};
|
|
538
|
-
/**
|
|
539
|
-
*
|
|
540
|
-
* @param {Object} className
|
|
541
|
-
* @param {Object} refs
|
|
542
|
-
* @param {Function} dbLeftFn
|
|
543
|
-
* @param {Function} leftFn
|
|
544
|
-
* @param {Function} rightFn
|
|
545
|
-
* @param {Function} dbRightFn
|
|
546
|
-
* @returns navigator
|
|
538
|
+
/**
|
|
539
|
+
*
|
|
540
|
+
* @param {Object} className
|
|
541
|
+
* @param {Object} refs
|
|
542
|
+
* @param {Function} dbLeftFn
|
|
543
|
+
* @param {Function} leftFn
|
|
544
|
+
* @param {Function} rightFn
|
|
545
|
+
* @param {Function} dbRightFn
|
|
546
|
+
* @returns navigator
|
|
547
547
|
*/
|
|
548
548
|
const renderNavigator = (className, refs, dbLeftFn, leftFn, rightFn, dbRightFn, fn) => jsx("div", {
|
|
549
549
|
className: className.navigator.navigator
|
|
@@ -580,22 +580,22 @@ const renderNavigator = (className, refs, dbLeftFn, leftFn, rightFn, dbRightFn,
|
|
|
580
580
|
onClick: dbRightFn,
|
|
581
581
|
ref: refs.doubleRight
|
|
582
582
|
})));
|
|
583
|
-
/**
|
|
584
|
-
*
|
|
585
|
-
* @param {Date} time
|
|
586
|
-
* @returns {String} month year
|
|
583
|
+
/**
|
|
584
|
+
*
|
|
585
|
+
* @param {Date} time
|
|
586
|
+
* @returns {String} month year
|
|
587
587
|
*/
|
|
588
588
|
const renderNavigatorContent = time => {
|
|
589
589
|
const value = new Date(time);
|
|
590
590
|
const months = getGlobal(['months', 'full']);
|
|
591
591
|
return [months[value.getMonth()], value.getFullYear()];
|
|
592
592
|
};
|
|
593
|
-
/**
|
|
594
|
-
*
|
|
595
|
-
* @param {Date} time
|
|
596
|
-
* @param {Object} refs
|
|
597
|
-
* @param {Date} min
|
|
598
|
-
* @param {Date} max
|
|
593
|
+
/**
|
|
594
|
+
*
|
|
595
|
+
* @param {Date} time
|
|
596
|
+
* @param {Object} refs
|
|
597
|
+
* @param {Date} min
|
|
598
|
+
* @param {Date} max
|
|
599
599
|
*/
|
|
600
600
|
const onUpdateNavigator = (time, refs, min, max) => {
|
|
601
601
|
var _refs$doubleLeft$curr, _refs$doubleLeft$curr2, _refs$doubleRight$cur, _refs$doubleRight$cur2, _refs$left$current, _refs$left$current$in, _refs$right$current, _refs$right$current$i;
|
|
@@ -634,18 +634,18 @@ const onUpdateNavigator = (time, refs, min, max) => {
|
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
|
-
/**
|
|
638
|
-
*
|
|
639
|
-
* @param {Date} time
|
|
640
|
-
* @param {Object} navigatorRefs
|
|
641
|
-
* @param {Date} min
|
|
642
|
-
* @param {Date} max
|
|
643
|
-
* @param {Element} table
|
|
644
|
-
* @param {Date} activeValue
|
|
645
|
-
* @param {Object} className
|
|
646
|
-
* @param {Boolean} displayAnotherMonth
|
|
647
|
-
* @param {Function} onTableDataClick
|
|
648
|
-
* @param {Function} onUpdateNavigatorValue
|
|
637
|
+
/**
|
|
638
|
+
*
|
|
639
|
+
* @param {Date} time
|
|
640
|
+
* @param {Object} navigatorRefs
|
|
641
|
+
* @param {Date} min
|
|
642
|
+
* @param {Date} max
|
|
643
|
+
* @param {Element} table
|
|
644
|
+
* @param {Date} activeValue
|
|
645
|
+
* @param {Object} className
|
|
646
|
+
* @param {Boolean} displayAnotherMonth
|
|
647
|
+
* @param {Function} onTableDataClick
|
|
648
|
+
* @param {Function} onUpdateNavigatorValue
|
|
649
649
|
*/
|
|
650
650
|
const onUpdateCalendar = (time, navigatorRefs, min, max, table, activeValue, className, displayAnotherMonth, onTableDataClick, onUpdateNavigatorValue) => {
|
|
651
651
|
onUpdateNavigator(time, navigatorRefs, min, max);
|
|
@@ -299,10 +299,10 @@ Checkbox.propTypes = {
|
|
|
299
299
|
labelProps: PropTypes.object,
|
|
300
300
|
/** The name of the Checkbox corresponds to the label displayed on the interface. */
|
|
301
301
|
name: PropTypes.string,
|
|
302
|
-
/**
|
|
303
|
-
* Callback fired when the state is changed.
|
|
304
|
-
*
|
|
305
|
-
* You can pull out the new checked state by accessing `event.value` or `event.target.checked` (boolean).
|
|
302
|
+
/**
|
|
303
|
+
* Callback fired when the state is changed.
|
|
304
|
+
*
|
|
305
|
+
* You can pull out the new checked state by accessing `event.value` or `event.target.checked` (boolean).
|
|
306
306
|
*/
|
|
307
307
|
onChange: PropTypes.func,
|
|
308
308
|
/** If `true`, the component is readonly. */
|
|
@@ -252,8 +252,8 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
252
252
|
tableData = [],
|
|
253
253
|
weekDateFirst = getDateOfWeek(firstDay),
|
|
254
254
|
weekDateLast = getDateOfWeek(lastDay);
|
|
255
|
-
/**
|
|
256
|
-
* days of previous month
|
|
255
|
+
/**
|
|
256
|
+
* days of previous month
|
|
257
257
|
*/
|
|
258
258
|
for (let i = weekDateFirst; i > 0; i--) {
|
|
259
259
|
const day = Date.parse(new Date(time.getFullYear(), time.getMonth(), 1));
|
|
@@ -265,8 +265,8 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
265
265
|
className: unique.day.day
|
|
266
266
|
})));
|
|
267
267
|
}
|
|
268
|
-
/**
|
|
269
|
-
* days of current month
|
|
268
|
+
/**
|
|
269
|
+
* days of current month
|
|
270
270
|
*/
|
|
271
271
|
for (let i = 0; i < lastDate; i++) {
|
|
272
272
|
const day = new Date(time.getFullYear(), time.getMonth(), i + 1);
|
|
@@ -292,8 +292,8 @@ const DateRangePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
292
292
|
type: 'h6'
|
|
293
293
|
}, i + 1)));
|
|
294
294
|
}
|
|
295
|
-
/**
|
|
296
|
-
* days of next month
|
|
295
|
+
/**
|
|
296
|
+
* days of next month
|
|
297
297
|
*/
|
|
298
298
|
for (let i = 0; i < 13 - weekDateLast; i++) {
|
|
299
299
|
const day = Date.parse(new Date(time.getFullYear(), time.getMonth() + 1, 0));
|