@coreui/react-pro 4.8.0-alpha.3 → 4.9.0-next.0
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/README.md +1 -1
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/utils.d.ts +23 -0
- package/dist/components/date-picker/CDatePicker.d.ts +1 -1
- package/dist/components/date-range-picker/CDateRangePicker.d.ts +2 -2
- package/dist/components/element-cover/CElementCover.d.ts +3 -7
- package/dist/components/element-cover/index.d.ts +2 -0
- package/dist/components/form/CFormInput.d.ts +1 -1
- package/dist/components/form/CFormSwitch.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/nav/CNavGroup.d.ts +4 -4
- package/dist/components/offcanvas/COffcanvas.d.ts +8 -2
- package/dist/components/sidebar/CSidebar.d.ts +4 -4
- package/dist/components/smart-table/CSmartTableBody.d.ts +6 -5
- package/dist/components/smart-table/CSmartTableHead.d.ts +6 -3
- package/dist/components/smart-table/CSmartTableInterface.d.ts +46 -109
- package/dist/components/smart-table/types.d.ts +53 -0
- package/dist/components/smart-table/utils.d.ts +16 -0
- package/dist/components/table/CTable.d.ts +5 -5
- package/dist/components/time-picker/types.d.ts +15 -0
- package/dist/components/time-picker/utils.d.ts +23 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/useForkedRef.d.ts +7 -0
- package/dist/hooks/useStateWithCallback.d.ts +2 -0
- package/dist/index.es.js +1246 -1865
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1246 -1863
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/isInViewport.d.ts +2 -0
- package/dist/utils/isObjectInArray.d.ts +2 -0
- package/package.json +14 -14
- package/src/components/accordion/CAccordionBody.tsx +1 -1
- package/src/components/alert/CAlert.tsx +1 -1
- package/src/components/backdrop/CBackdrop.tsx +1 -1
- package/src/components/calendar/CCalendar.tsx +351 -240
- package/src/components/calendar/index.ts +3 -0
- package/src/{utils/calendar.ts → components/calendar/utils.ts} +1 -1
- package/src/components/carousel/CCarousel.tsx +4 -4
- package/src/components/carousel/CCarouselItem.tsx +1 -1
- package/src/components/collapse/CCollapse.tsx +1 -1
- package/src/components/date-picker/CDatePicker.tsx +1 -1
- package/src/components/date-range-picker/CDateRangePicker.tsx +3 -3
- package/src/components/dropdown/CDropdown.tsx +1 -1
- package/src/components/dropdown/CDropdownToggle.tsx +1 -1
- package/src/components/element-cover/CElementCover.tsx +19 -25
- package/src/components/element-cover/index.ts +3 -0
- package/src/components/form/CFormCheck.tsx +1 -1
- package/src/components/form/CFormControlWrapper.tsx +14 -20
- package/src/components/form/CFormInput.tsx +1 -1
- package/src/components/form/CFormSwitch.tsx +1 -1
- package/src/components/grid/CCol.tsx +4 -0
- package/src/components/index.ts +2 -0
- package/src/components/modal/CModal.tsx +1 -1
- package/src/components/nav/CNavGroup.tsx +4 -4
- package/src/components/nav/CNavLink.tsx +2 -1
- package/src/components/offcanvas/COffcanvas.tsx +36 -18
- package/src/components/sidebar/CSidebar.tsx +10 -10
- package/src/components/smart-table/CSmartTable.tsx +279 -259
- package/src/components/smart-table/CSmartTableBody.tsx +31 -41
- package/src/components/smart-table/CSmartTableCleaner.tsx +1 -1
- package/src/components/smart-table/CSmartTableFilter.tsx +1 -3
- package/src/components/smart-table/CSmartTableHead.tsx +53 -103
- package/src/components/smart-table/CSmartTableInterface.tsx +57 -120
- package/src/components/smart-table/CSmartTableItemsPerPageSelector.tsx +1 -2
- package/src/components/smart-table/types.tsx +65 -0
- package/src/components/smart-table/utils.tsx +199 -0
- package/src/components/table/CTable.tsx +12 -9
- package/src/components/tabs/CTabPane.tsx +1 -1
- package/src/components/time-picker/CTimePicker.tsx +50 -23
- package/src/components/time-picker/CTimePickerRollCol.tsx +1 -1
- package/src/components/time-picker/types.ts +15 -0
- package/src/{utils/time.ts → components/time-picker/utils.ts} +43 -2
- package/src/components/toast/CToast.tsx +1 -1
- package/src/components/virtual-scroller/CVirtualScroller.tsx +1 -1
- package/src/{utils/hooks → hooks}/index.ts +0 -0
- package/src/{utils/hooks → hooks}/useForkedRef.ts +0 -0
- package/src/{utils/hooks → hooks}/useStateWithCallback.ts +0 -0
- package/src/utils/index.ts +3 -2
- package/src/utils/isInViewport.ts +11 -0
- package/src/utils/isObjectInArray.ts +14 -0
- package/src/utils/isVisible.ts +0 -11
package/dist/index.js
CHANGED
|
@@ -2096,6 +2096,7 @@ Transition.EXITED = EXITED;
|
|
|
2096
2096
|
Transition.ENTERING = ENTERING;
|
|
2097
2097
|
Transition.ENTERED = ENTERED;
|
|
2098
2098
|
Transition.EXITING = EXITING;
|
|
2099
|
+
var Transition$1 = Transition;
|
|
2099
2100
|
|
|
2100
2101
|
var _addClass = function addClass$1(node, classes) {
|
|
2101
2102
|
return node && classes && classes.split(' ').forEach(function (c) {
|
|
@@ -2351,7 +2352,7 @@ var CSSTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
2351
2352
|
_this$props.classNames;
|
|
2352
2353
|
var props = _objectWithoutPropertiesLoose$1(_this$props, ["classNames"]);
|
|
2353
2354
|
|
|
2354
|
-
return /*#__PURE__*/React$1.createElement(Transition, _extends$1({}, props, {
|
|
2355
|
+
return /*#__PURE__*/React$1.createElement(Transition$1, _extends$1({}, props, {
|
|
2355
2356
|
onEnter: this.onEnter,
|
|
2356
2357
|
onEntered: this.onEntered,
|
|
2357
2358
|
onEntering: this.onEntering,
|
|
@@ -2367,7 +2368,7 @@ var CSSTransition = /*#__PURE__*/function (_React$Component) {
|
|
|
2367
2368
|
CSSTransition.defaultProps = {
|
|
2368
2369
|
classNames: ''
|
|
2369
2370
|
};
|
|
2370
|
-
CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$1({}, Transition.propTypes, {
|
|
2371
|
+
CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$1({}, Transition$1.propTypes, {
|
|
2371
2372
|
/**
|
|
2372
2373
|
* The animation classNames applied to the component as it appears, enters,
|
|
2373
2374
|
* exits or has finished the transition. A single name can be provided, which
|
|
@@ -2497,842 +2498,136 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$1({},
|
|
|
2497
2498
|
*/
|
|
2498
2499
|
onExited: propTypesExports.func
|
|
2499
2500
|
}) : {};
|
|
2501
|
+
var CSSTransition$1 = CSSTransition;
|
|
2500
2502
|
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
var result = Object.create(null);
|
|
2521
|
-
if (children) React$1.Children.map(children, function (c) {
|
|
2522
|
-
return c;
|
|
2523
|
-
}).forEach(function (child) {
|
|
2524
|
-
// run the map function here instead so that the key is the computed one
|
|
2525
|
-
result[child.key] = mapper(child);
|
|
2526
|
-
});
|
|
2527
|
-
return result;
|
|
2503
|
+
// code borrowed from https://github.com/reach/reach-ui
|
|
2504
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2505
|
+
function useForkedRef() {
|
|
2506
|
+
var refs = [];
|
|
2507
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2508
|
+
refs[_i] = arguments[_i];
|
|
2509
|
+
}
|
|
2510
|
+
return React$1.useMemo(function () {
|
|
2511
|
+
if (refs.every(function (ref) { return ref == null; })) {
|
|
2512
|
+
return null;
|
|
2513
|
+
}
|
|
2514
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2515
|
+
return function (node) {
|
|
2516
|
+
refs.forEach(function (ref) {
|
|
2517
|
+
assignRef(ref, node);
|
|
2518
|
+
});
|
|
2519
|
+
};
|
|
2520
|
+
}, refs);
|
|
2528
2521
|
}
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
* so we implement it here.
|
|
2538
|
-
*
|
|
2539
|
-
* @param {object} prev prev children as returned from
|
|
2540
|
-
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
2541
|
-
* @param {object} next next children as returned from
|
|
2542
|
-
* `ReactTransitionChildMapping.getChildMapping()`.
|
|
2543
|
-
* @return {object} a key set that contains all keys in `prev` and all keys
|
|
2544
|
-
* in `next` in a reasonable order.
|
|
2545
|
-
*/
|
|
2546
|
-
|
|
2547
|
-
function mergeChildMappings(prev, next) {
|
|
2548
|
-
prev = prev || {};
|
|
2549
|
-
next = next || {};
|
|
2550
|
-
|
|
2551
|
-
function getValueForKey(key) {
|
|
2552
|
-
return key in next ? next[key] : prev[key];
|
|
2553
|
-
} // For each key of `next`, the list of keys to insert before that key in
|
|
2554
|
-
// the combined list
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
var nextKeysPending = Object.create(null);
|
|
2558
|
-
var pendingKeys = [];
|
|
2559
|
-
|
|
2560
|
-
for (var prevKey in prev) {
|
|
2561
|
-
if (prevKey in next) {
|
|
2562
|
-
if (pendingKeys.length) {
|
|
2563
|
-
nextKeysPending[prevKey] = pendingKeys;
|
|
2564
|
-
pendingKeys = [];
|
|
2565
|
-
}
|
|
2566
|
-
} else {
|
|
2567
|
-
pendingKeys.push(prevKey);
|
|
2522
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2523
|
+
function assignRef(ref,
|
|
2524
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2525
|
+
value) {
|
|
2526
|
+
if (ref == null)
|
|
2527
|
+
return;
|
|
2528
|
+
if (isFunction(ref)) {
|
|
2529
|
+
ref(value);
|
|
2568
2530
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
|
2577
|
-
var pendingNextKey = nextKeysPending[nextKey][i];
|
|
2578
|
-
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
|
2579
|
-
}
|
|
2531
|
+
else {
|
|
2532
|
+
try {
|
|
2533
|
+
ref.current = value;
|
|
2534
|
+
}
|
|
2535
|
+
catch (error) {
|
|
2536
|
+
throw new Error("Cannot assign value \"".concat(value, "\" to ref \"").concat(ref, "\""));
|
|
2537
|
+
}
|
|
2580
2538
|
}
|
|
2581
|
-
|
|
2582
|
-
childMapping[nextKey] = getValueForKey(nextKey);
|
|
2583
|
-
} // Finally, add the keys which didn't appear before any key in `next`
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
for (i = 0; i < pendingKeys.length; i++) {
|
|
2587
|
-
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
|
2588
|
-
}
|
|
2589
|
-
|
|
2590
|
-
return childMapping;
|
|
2591
|
-
}
|
|
2592
|
-
|
|
2593
|
-
function getProp(child, prop, props) {
|
|
2594
|
-
return props[prop] != null ? props[prop] : child.props[prop];
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
|
-
function getInitialChildMapping(props, onExited) {
|
|
2598
|
-
return getChildMapping(props.children, function (child) {
|
|
2599
|
-
return React$1.cloneElement(child, {
|
|
2600
|
-
onExited: onExited.bind(null, child),
|
|
2601
|
-
in: true,
|
|
2602
|
-
appear: getProp(child, 'appear', props),
|
|
2603
|
-
enter: getProp(child, 'enter', props),
|
|
2604
|
-
exit: getProp(child, 'exit', props)
|
|
2605
|
-
});
|
|
2606
|
-
});
|
|
2607
2539
|
}
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
Object.keys(children).forEach(function (key) {
|
|
2612
|
-
var child = children[key];
|
|
2613
|
-
if (!React$1.isValidElement(child)) return;
|
|
2614
|
-
var hasPrev = (key in prevChildMapping);
|
|
2615
|
-
var hasNext = (key in nextChildMapping);
|
|
2616
|
-
var prevChild = prevChildMapping[key];
|
|
2617
|
-
var isLeaving = React$1.isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
|
|
2618
|
-
|
|
2619
|
-
if (hasNext && (!hasPrev || isLeaving)) {
|
|
2620
|
-
// console.log('entering', key)
|
|
2621
|
-
children[key] = React$1.cloneElement(child, {
|
|
2622
|
-
onExited: onExited.bind(null, child),
|
|
2623
|
-
in: true,
|
|
2624
|
-
exit: getProp(child, 'exit', nextProps),
|
|
2625
|
-
enter: getProp(child, 'enter', nextProps)
|
|
2626
|
-
});
|
|
2627
|
-
} else if (!hasNext && hasPrev && !isLeaving) {
|
|
2628
|
-
// item is old (exiting)
|
|
2629
|
-
// console.log('leaving', key)
|
|
2630
|
-
children[key] = React$1.cloneElement(child, {
|
|
2631
|
-
in: false
|
|
2632
|
-
});
|
|
2633
|
-
} else if (hasNext && hasPrev && React$1.isValidElement(prevChild)) {
|
|
2634
|
-
// item hasn't changed transition states
|
|
2635
|
-
// copy over the last transition props;
|
|
2636
|
-
// console.log('unchanged', key)
|
|
2637
|
-
children[key] = React$1.cloneElement(child, {
|
|
2638
|
-
onExited: onExited.bind(null, child),
|
|
2639
|
-
in: prevChild.props.in,
|
|
2640
|
-
exit: getProp(child, 'exit', nextProps),
|
|
2641
|
-
enter: getProp(child, 'enter', nextProps)
|
|
2642
|
-
});
|
|
2643
|
-
}
|
|
2644
|
-
});
|
|
2645
|
-
return children;
|
|
2540
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
2541
|
+
function isFunction(value) {
|
|
2542
|
+
return !!(value && {}.toString.call(value) == '[object Function]');
|
|
2646
2543
|
}
|
|
2647
2544
|
|
|
2648
|
-
var
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
component: 'div',
|
|
2656
|
-
childFactory: function childFactory(child) {
|
|
2657
|
-
return child;
|
|
2658
|
-
}
|
|
2545
|
+
var useStateWithCallback = function (initialState, handler, runHandler) {
|
|
2546
|
+
var _a = React$1.useState(initialState), state = _a[0], setState = _a[1];
|
|
2547
|
+
handler &&
|
|
2548
|
+
React$1.useEffect(function () {
|
|
2549
|
+
runHandler && handler(state);
|
|
2550
|
+
}, [state]);
|
|
2551
|
+
return [state, setState];
|
|
2659
2552
|
};
|
|
2660
|
-
/**
|
|
2661
|
-
* The `<TransitionGroup>` component manages a set of transition components
|
|
2662
|
-
* (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
|
|
2663
|
-
* components, `<TransitionGroup>` is a state machine for managing the mounting
|
|
2664
|
-
* and unmounting of components over time.
|
|
2665
|
-
*
|
|
2666
|
-
* Consider the example below. As items are removed or added to the TodoList the
|
|
2667
|
-
* `in` prop is toggled automatically by the `<TransitionGroup>`.
|
|
2668
|
-
*
|
|
2669
|
-
* Note that `<TransitionGroup>` does not define any animation behavior!
|
|
2670
|
-
* Exactly _how_ a list item animates is up to the individual transition
|
|
2671
|
-
* component. This means you can mix and match animations across different list
|
|
2672
|
-
* items.
|
|
2673
|
-
*/
|
|
2674
|
-
|
|
2675
|
-
var TransitionGroup = /*#__PURE__*/function (_React$Component) {
|
|
2676
|
-
_inheritsLoose(TransitionGroup, _React$Component);
|
|
2677
2553
|
|
|
2678
|
-
|
|
2679
|
-
var
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
var
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
};
|
|
2693
|
-
return _this;
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
var _proto = TransitionGroup.prototype;
|
|
2697
|
-
|
|
2698
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
2699
|
-
this.mounted = true;
|
|
2700
|
-
this.setState({
|
|
2701
|
-
contextValue: {
|
|
2702
|
-
isMounting: false
|
|
2703
|
-
}
|
|
2704
|
-
});
|
|
2705
|
-
};
|
|
2706
|
-
|
|
2707
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2708
|
-
this.mounted = false;
|
|
2709
|
-
};
|
|
2710
|
-
|
|
2711
|
-
TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
|
|
2712
|
-
var prevChildMapping = _ref.children,
|
|
2713
|
-
handleExited = _ref.handleExited,
|
|
2714
|
-
firstRender = _ref.firstRender;
|
|
2715
|
-
return {
|
|
2716
|
-
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
|
|
2717
|
-
firstRender: false
|
|
2554
|
+
var CCollapse = React$1.forwardRef(function (_a, ref) {
|
|
2555
|
+
var children = _a.children, className = _a.className, horizontal = _a.horizontal, onHide = _a.onHide, onShow = _a.onShow, visible = _a.visible, rest = __rest$1(_a, ["children", "className", "horizontal", "onHide", "onShow", "visible"]);
|
|
2556
|
+
var _b = React$1.useState(), height = _b[0], setHeight = _b[1];
|
|
2557
|
+
var _c = React$1.useState(), width = _c[0], setWidth = _c[1];
|
|
2558
|
+
var collapseRef = React$1.useRef(null);
|
|
2559
|
+
var forkedRef = useForkedRef(ref, collapseRef);
|
|
2560
|
+
var getTransitionClass = function (state) {
|
|
2561
|
+
return state === 'entering'
|
|
2562
|
+
? 'collapsing'
|
|
2563
|
+
: state === 'entered'
|
|
2564
|
+
? 'collapse show'
|
|
2565
|
+
: state === 'exiting'
|
|
2566
|
+
? 'collapsing'
|
|
2567
|
+
: 'collapse';
|
|
2718
2568
|
};
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
if (child.props.onExited) {
|
|
2727
|
-
child.props.onExited(node);
|
|
2728
|
-
}
|
|
2729
|
-
|
|
2730
|
-
if (this.mounted) {
|
|
2731
|
-
this.setState(function (state) {
|
|
2732
|
-
var children = _extends$1({}, state.children);
|
|
2733
|
-
|
|
2734
|
-
delete children[child.key];
|
|
2735
|
-
return {
|
|
2736
|
-
children: children
|
|
2737
|
-
};
|
|
2738
|
-
});
|
|
2739
|
-
}
|
|
2740
|
-
};
|
|
2741
|
-
|
|
2742
|
-
_proto.render = function render() {
|
|
2743
|
-
var _this$props = this.props,
|
|
2744
|
-
Component = _this$props.component,
|
|
2745
|
-
childFactory = _this$props.childFactory,
|
|
2746
|
-
props = _objectWithoutPropertiesLoose$1(_this$props, ["component", "childFactory"]);
|
|
2747
|
-
|
|
2748
|
-
var contextValue = this.state.contextValue;
|
|
2749
|
-
var children = values(this.state.children).map(childFactory);
|
|
2750
|
-
delete props.appear;
|
|
2751
|
-
delete props.enter;
|
|
2752
|
-
delete props.exit;
|
|
2753
|
-
|
|
2754
|
-
if (Component === null) {
|
|
2755
|
-
return /*#__PURE__*/React$1.createElement(TransitionGroupContext.Provider, {
|
|
2756
|
-
value: contextValue
|
|
2757
|
-
}, children);
|
|
2758
|
-
}
|
|
2759
|
-
|
|
2760
|
-
return /*#__PURE__*/React$1.createElement(TransitionGroupContext.Provider, {
|
|
2761
|
-
value: contextValue
|
|
2762
|
-
}, /*#__PURE__*/React$1.createElement(Component, props, children));
|
|
2763
|
-
};
|
|
2764
|
-
|
|
2765
|
-
return TransitionGroup;
|
|
2766
|
-
}(React$1.Component);
|
|
2767
|
-
|
|
2768
|
-
TransitionGroup.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
2769
|
-
/**
|
|
2770
|
-
* `<TransitionGroup>` renders a `<div>` by default. You can change this
|
|
2771
|
-
* behavior by providing a `component` prop.
|
|
2772
|
-
* If you use React v16+ and would like to avoid a wrapping `<div>` element
|
|
2773
|
-
* you can pass in `component={null}`. This is useful if the wrapping div
|
|
2774
|
-
* borks your css styles.
|
|
2775
|
-
*/
|
|
2776
|
-
component: propTypesExports.any,
|
|
2777
|
-
|
|
2778
|
-
/**
|
|
2779
|
-
* A set of `<Transition>` components, that are toggled `in` and out as they
|
|
2780
|
-
* leave. the `<TransitionGroup>` will inject specific transition props, so
|
|
2781
|
-
* remember to spread them through if you are wrapping the `<Transition>` as
|
|
2782
|
-
* with our `<Fade>` example.
|
|
2783
|
-
*
|
|
2784
|
-
* While this component is meant for multiple `Transition` or `CSSTransition`
|
|
2785
|
-
* children, sometimes you may want to have a single transition child with
|
|
2786
|
-
* content that you want to be transitioned out and in when you change it
|
|
2787
|
-
* (e.g. routes, images etc.) In that case you can change the `key` prop of
|
|
2788
|
-
* the transition child as you change its content, this will cause
|
|
2789
|
-
* `TransitionGroup` to transition the child out and back in.
|
|
2790
|
-
*/
|
|
2791
|
-
children: propTypesExports.node,
|
|
2792
|
-
|
|
2793
|
-
/**
|
|
2794
|
-
* A convenience prop that enables or disables appear animations
|
|
2795
|
-
* for all children. Note that specifying this will override any defaults set
|
|
2796
|
-
* on individual children Transitions.
|
|
2797
|
-
*/
|
|
2798
|
-
appear: propTypesExports.bool,
|
|
2799
|
-
|
|
2800
|
-
/**
|
|
2801
|
-
* A convenience prop that enables or disables enter animations
|
|
2802
|
-
* for all children. Note that specifying this will override any defaults set
|
|
2803
|
-
* on individual children Transitions.
|
|
2804
|
-
*/
|
|
2805
|
-
enter: propTypesExports.bool,
|
|
2806
|
-
|
|
2807
|
-
/**
|
|
2808
|
-
* A convenience prop that enables or disables exit animations
|
|
2809
|
-
* for all children. Note that specifying this will override any defaults set
|
|
2810
|
-
* on individual children Transitions.
|
|
2811
|
-
*/
|
|
2812
|
-
exit: propTypesExports.bool,
|
|
2813
|
-
|
|
2814
|
-
/**
|
|
2815
|
-
* You may need to apply reactive updates to a child as it is exiting.
|
|
2816
|
-
* This is generally done by using `cloneElement` however in the case of an exiting
|
|
2817
|
-
* child the element has already been removed and not accessible to the consumer.
|
|
2818
|
-
*
|
|
2819
|
-
* If you do need to update a child as it leaves you can provide a `childFactory`
|
|
2820
|
-
* to wrap every child, even the ones that are leaving.
|
|
2821
|
-
*
|
|
2822
|
-
* @type Function(child: ReactElement) -> ReactElement
|
|
2823
|
-
*/
|
|
2824
|
-
childFactory: propTypesExports.func
|
|
2825
|
-
} : {};
|
|
2826
|
-
TransitionGroup.defaultProps = defaultProps;
|
|
2827
|
-
|
|
2828
|
-
/**
|
|
2829
|
-
* The `<ReplaceTransition>` component is a specialized `Transition` component
|
|
2830
|
-
* that animates between two children.
|
|
2831
|
-
*
|
|
2832
|
-
* ```jsx
|
|
2833
|
-
* <ReplaceTransition in>
|
|
2834
|
-
* <Fade><div>I appear first</div></Fade>
|
|
2835
|
-
* <Fade><div>I replace the above</div></Fade>
|
|
2836
|
-
* </ReplaceTransition>
|
|
2837
|
-
* ```
|
|
2838
|
-
*/
|
|
2839
|
-
|
|
2840
|
-
var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
|
|
2841
|
-
_inheritsLoose(ReplaceTransition, _React$Component);
|
|
2842
|
-
|
|
2843
|
-
function ReplaceTransition() {
|
|
2844
|
-
var _this;
|
|
2845
|
-
|
|
2846
|
-
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2847
|
-
_args[_key] = arguments[_key];
|
|
2848
|
-
}
|
|
2849
|
-
|
|
2850
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
|
|
2851
|
-
|
|
2852
|
-
_this.handleEnter = function () {
|
|
2853
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2854
|
-
args[_key2] = arguments[_key2];
|
|
2855
|
-
}
|
|
2856
|
-
|
|
2857
|
-
return _this.handleLifecycle('onEnter', 0, args);
|
|
2569
|
+
var onEntering = function () {
|
|
2570
|
+
onShow && onShow();
|
|
2571
|
+
if (horizontal) {
|
|
2572
|
+
collapseRef.current && setWidth(collapseRef.current.scrollWidth);
|
|
2573
|
+
return;
|
|
2574
|
+
}
|
|
2575
|
+
collapseRef.current && setHeight(collapseRef.current.scrollHeight);
|
|
2858
2576
|
};
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
return _this.handleLifecycle('onEntering', 0, args);
|
|
2577
|
+
var onEntered = function () {
|
|
2578
|
+
if (horizontal) {
|
|
2579
|
+
setWidth(0);
|
|
2580
|
+
return;
|
|
2581
|
+
}
|
|
2582
|
+
setHeight(0);
|
|
2866
2583
|
};
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
return _this.handleLifecycle('onEntered', 0, args);
|
|
2584
|
+
var onExit = function () {
|
|
2585
|
+
if (horizontal) {
|
|
2586
|
+
collapseRef.current && setWidth(collapseRef.current.scrollWidth);
|
|
2587
|
+
return;
|
|
2588
|
+
}
|
|
2589
|
+
collapseRef.current && setHeight(collapseRef.current.scrollHeight);
|
|
2874
2590
|
};
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2591
|
+
var onExiting = function () {
|
|
2592
|
+
onHide && onHide();
|
|
2593
|
+
if (horizontal) {
|
|
2594
|
+
setWidth(0);
|
|
2595
|
+
return;
|
|
2596
|
+
}
|
|
2597
|
+
setHeight(0);
|
|
2882
2598
|
};
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
return _this.handleLifecycle('onExiting', 1, args);
|
|
2599
|
+
var onExited = function () {
|
|
2600
|
+
if (horizontal) {
|
|
2601
|
+
setWidth(0);
|
|
2602
|
+
return;
|
|
2603
|
+
}
|
|
2604
|
+
setHeight(0);
|
|
2890
2605
|
};
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
|
|
2911
|
-
|
|
2912
|
-
if (this.props[handler]) {
|
|
2913
|
-
var maybeNode = child.props.nodeRef ? undefined : ReactDOM.findDOMNode(this);
|
|
2914
|
-
this.props[handler](maybeNode);
|
|
2915
|
-
}
|
|
2916
|
-
};
|
|
2917
|
-
|
|
2918
|
-
_proto.render = function render() {
|
|
2919
|
-
var _this$props = this.props,
|
|
2920
|
-
children = _this$props.children,
|
|
2921
|
-
inProp = _this$props.in,
|
|
2922
|
-
props = _objectWithoutPropertiesLoose$1(_this$props, ["children", "in"]);
|
|
2923
|
-
|
|
2924
|
-
var _React$Children$toArr = React$1.Children.toArray(children),
|
|
2925
|
-
first = _React$Children$toArr[0],
|
|
2926
|
-
second = _React$Children$toArr[1];
|
|
2927
|
-
|
|
2928
|
-
delete props.onEnter;
|
|
2929
|
-
delete props.onEntering;
|
|
2930
|
-
delete props.onEntered;
|
|
2931
|
-
delete props.onExit;
|
|
2932
|
-
delete props.onExiting;
|
|
2933
|
-
delete props.onExited;
|
|
2934
|
-
return /*#__PURE__*/React$1.createElement(TransitionGroup, props, inProp ? React$1.cloneElement(first, {
|
|
2935
|
-
key: 'first',
|
|
2936
|
-
onEnter: this.handleEnter,
|
|
2937
|
-
onEntering: this.handleEntering,
|
|
2938
|
-
onEntered: this.handleEntered
|
|
2939
|
-
}) : React$1.cloneElement(second, {
|
|
2940
|
-
key: 'second',
|
|
2941
|
-
onEnter: this.handleExit,
|
|
2942
|
-
onEntering: this.handleExiting,
|
|
2943
|
-
onEntered: this.handleExited
|
|
2944
|
-
}));
|
|
2945
|
-
};
|
|
2946
|
-
|
|
2947
|
-
return ReplaceTransition;
|
|
2948
|
-
}(React$1.Component);
|
|
2949
|
-
|
|
2950
|
-
ReplaceTransition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
2951
|
-
in: propTypesExports.bool.isRequired,
|
|
2952
|
-
children: function children(props, propName) {
|
|
2953
|
-
if (React$1.Children.count(props[propName]) !== 2) return new Error("\"" + propName + "\" must be exactly two transition components.");
|
|
2954
|
-
return null;
|
|
2955
|
-
}
|
|
2956
|
-
} : {};
|
|
2957
|
-
|
|
2958
|
-
var _leaveRenders, _enterRenders;
|
|
2959
|
-
|
|
2960
|
-
function areChildrenDifferent(oldChildren, newChildren) {
|
|
2961
|
-
if (oldChildren === newChildren) return false;
|
|
2962
|
-
|
|
2963
|
-
if (React$1.isValidElement(oldChildren) && React$1.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
|
|
2964
|
-
return false;
|
|
2965
|
-
}
|
|
2966
|
-
|
|
2967
|
-
return true;
|
|
2968
|
-
}
|
|
2969
|
-
/**
|
|
2970
|
-
* Enum of modes for SwitchTransition component
|
|
2971
|
-
* @enum { string }
|
|
2972
|
-
*/
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
var modes = {
|
|
2976
|
-
out: 'out-in',
|
|
2977
|
-
in: 'in-out'
|
|
2978
|
-
};
|
|
2979
|
-
|
|
2980
|
-
var callHook = function callHook(element, name, cb) {
|
|
2981
|
-
return function () {
|
|
2982
|
-
var _element$props;
|
|
2983
|
-
|
|
2984
|
-
element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
|
|
2985
|
-
cb();
|
|
2986
|
-
};
|
|
2987
|
-
};
|
|
2988
|
-
|
|
2989
|
-
var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
|
|
2990
|
-
var current = _ref.current,
|
|
2991
|
-
changeState = _ref.changeState;
|
|
2992
|
-
return React$1.cloneElement(current, {
|
|
2993
|
-
in: false,
|
|
2994
|
-
onExited: callHook(current, 'onExited', function () {
|
|
2995
|
-
changeState(ENTERING, null);
|
|
2996
|
-
})
|
|
2997
|
-
});
|
|
2998
|
-
}, _leaveRenders[modes.in] = function (_ref2) {
|
|
2999
|
-
var current = _ref2.current,
|
|
3000
|
-
changeState = _ref2.changeState,
|
|
3001
|
-
children = _ref2.children;
|
|
3002
|
-
return [current, React$1.cloneElement(children, {
|
|
3003
|
-
in: true,
|
|
3004
|
-
onEntered: callHook(children, 'onEntered', function () {
|
|
3005
|
-
changeState(ENTERING);
|
|
3006
|
-
})
|
|
3007
|
-
})];
|
|
3008
|
-
}, _leaveRenders);
|
|
3009
|
-
var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
|
|
3010
|
-
var children = _ref3.children,
|
|
3011
|
-
changeState = _ref3.changeState;
|
|
3012
|
-
return React$1.cloneElement(children, {
|
|
3013
|
-
in: true,
|
|
3014
|
-
onEntered: callHook(children, 'onEntered', function () {
|
|
3015
|
-
changeState(ENTERED, React$1.cloneElement(children, {
|
|
3016
|
-
in: true
|
|
3017
|
-
}));
|
|
3018
|
-
})
|
|
3019
|
-
});
|
|
3020
|
-
}, _enterRenders[modes.in] = function (_ref4) {
|
|
3021
|
-
var current = _ref4.current,
|
|
3022
|
-
children = _ref4.children,
|
|
3023
|
-
changeState = _ref4.changeState;
|
|
3024
|
-
return [React$1.cloneElement(current, {
|
|
3025
|
-
in: false,
|
|
3026
|
-
onExited: callHook(current, 'onExited', function () {
|
|
3027
|
-
changeState(ENTERED, React$1.cloneElement(children, {
|
|
3028
|
-
in: true
|
|
3029
|
-
}));
|
|
3030
|
-
})
|
|
3031
|
-
}), React$1.cloneElement(children, {
|
|
3032
|
-
in: true
|
|
3033
|
-
})];
|
|
3034
|
-
}, _enterRenders);
|
|
3035
|
-
/**
|
|
3036
|
-
* A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
|
|
3037
|
-
* You can use it when you want to control the render between state transitions.
|
|
3038
|
-
* Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
|
|
3039
|
-
*
|
|
3040
|
-
* If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
|
|
3041
|
-
* If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
|
|
3042
|
-
*
|
|
3043
|
-
* **Note**: If you want the animation to happen simultaneously
|
|
3044
|
-
* (that is, to have the old child removed and a new child inserted **at the same time**),
|
|
3045
|
-
* you should use
|
|
3046
|
-
* [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
|
|
3047
|
-
* instead.
|
|
3048
|
-
*
|
|
3049
|
-
* ```jsx
|
|
3050
|
-
* function App() {
|
|
3051
|
-
* const [state, setState] = useState(false);
|
|
3052
|
-
* return (
|
|
3053
|
-
* <SwitchTransition>
|
|
3054
|
-
* <CSSTransition
|
|
3055
|
-
* key={state ? "Goodbye, world!" : "Hello, world!"}
|
|
3056
|
-
* addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
|
|
3057
|
-
* classNames='fade'
|
|
3058
|
-
* >
|
|
3059
|
-
* <button onClick={() => setState(state => !state)}>
|
|
3060
|
-
* {state ? "Goodbye, world!" : "Hello, world!"}
|
|
3061
|
-
* </button>
|
|
3062
|
-
* </CSSTransition>
|
|
3063
|
-
* </SwitchTransition>
|
|
3064
|
-
* );
|
|
3065
|
-
* }
|
|
3066
|
-
* ```
|
|
3067
|
-
*
|
|
3068
|
-
* ```css
|
|
3069
|
-
* .fade-enter{
|
|
3070
|
-
* opacity: 0;
|
|
3071
|
-
* }
|
|
3072
|
-
* .fade-exit{
|
|
3073
|
-
* opacity: 1;
|
|
3074
|
-
* }
|
|
3075
|
-
* .fade-enter-active{
|
|
3076
|
-
* opacity: 1;
|
|
3077
|
-
* }
|
|
3078
|
-
* .fade-exit-active{
|
|
3079
|
-
* opacity: 0;
|
|
3080
|
-
* }
|
|
3081
|
-
* .fade-enter-active,
|
|
3082
|
-
* .fade-exit-active{
|
|
3083
|
-
* transition: opacity 500ms;
|
|
3084
|
-
* }
|
|
3085
|
-
* ```
|
|
3086
|
-
*/
|
|
3087
|
-
|
|
3088
|
-
var SwitchTransition = /*#__PURE__*/function (_React$Component) {
|
|
3089
|
-
_inheritsLoose(SwitchTransition, _React$Component);
|
|
3090
|
-
|
|
3091
|
-
function SwitchTransition() {
|
|
3092
|
-
var _this;
|
|
3093
|
-
|
|
3094
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3095
|
-
args[_key] = arguments[_key];
|
|
3096
|
-
}
|
|
3097
|
-
|
|
3098
|
-
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
3099
|
-
_this.state = {
|
|
3100
|
-
status: ENTERED,
|
|
3101
|
-
current: null
|
|
3102
|
-
};
|
|
3103
|
-
_this.appeared = false;
|
|
3104
|
-
|
|
3105
|
-
_this.changeState = function (status, current) {
|
|
3106
|
-
if (current === void 0) {
|
|
3107
|
-
current = _this.state.current;
|
|
3108
|
-
}
|
|
3109
|
-
|
|
3110
|
-
_this.setState({
|
|
3111
|
-
status: status,
|
|
3112
|
-
current: current
|
|
3113
|
-
});
|
|
3114
|
-
};
|
|
3115
|
-
|
|
3116
|
-
return _this;
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
var _proto = SwitchTransition.prototype;
|
|
3120
|
-
|
|
3121
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
3122
|
-
this.appeared = true;
|
|
3123
|
-
};
|
|
3124
|
-
|
|
3125
|
-
SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
3126
|
-
if (props.children == null) {
|
|
3127
|
-
return {
|
|
3128
|
-
current: null
|
|
3129
|
-
};
|
|
3130
|
-
}
|
|
3131
|
-
|
|
3132
|
-
if (state.status === ENTERING && props.mode === modes.in) {
|
|
3133
|
-
return {
|
|
3134
|
-
status: ENTERING
|
|
3135
|
-
};
|
|
3136
|
-
}
|
|
3137
|
-
|
|
3138
|
-
if (state.current && areChildrenDifferent(state.current, props.children)) {
|
|
3139
|
-
return {
|
|
3140
|
-
status: EXITING
|
|
3141
|
-
};
|
|
3142
|
-
}
|
|
3143
|
-
|
|
3144
|
-
return {
|
|
3145
|
-
current: React$1.cloneElement(props.children, {
|
|
3146
|
-
in: true
|
|
3147
|
-
})
|
|
3148
|
-
};
|
|
3149
|
-
};
|
|
3150
|
-
|
|
3151
|
-
_proto.render = function render() {
|
|
3152
|
-
var _this$props = this.props,
|
|
3153
|
-
children = _this$props.children,
|
|
3154
|
-
mode = _this$props.mode,
|
|
3155
|
-
_this$state = this.state,
|
|
3156
|
-
status = _this$state.status,
|
|
3157
|
-
current = _this$state.current;
|
|
3158
|
-
var data = {
|
|
3159
|
-
children: children,
|
|
3160
|
-
current: current,
|
|
3161
|
-
changeState: this.changeState,
|
|
3162
|
-
status: status
|
|
3163
|
-
};
|
|
3164
|
-
var component;
|
|
3165
|
-
|
|
3166
|
-
switch (status) {
|
|
3167
|
-
case ENTERING:
|
|
3168
|
-
component = enterRenders[mode](data);
|
|
3169
|
-
break;
|
|
3170
|
-
|
|
3171
|
-
case EXITING:
|
|
3172
|
-
component = leaveRenders[mode](data);
|
|
3173
|
-
break;
|
|
3174
|
-
|
|
3175
|
-
case ENTERED:
|
|
3176
|
-
component = current;
|
|
3177
|
-
}
|
|
3178
|
-
|
|
3179
|
-
return /*#__PURE__*/React$1.createElement(TransitionGroupContext.Provider, {
|
|
3180
|
-
value: {
|
|
3181
|
-
isMounting: !this.appeared
|
|
3182
|
-
}
|
|
3183
|
-
}, component);
|
|
3184
|
-
};
|
|
3185
|
-
|
|
3186
|
-
return SwitchTransition;
|
|
3187
|
-
}(React$1.Component);
|
|
3188
|
-
|
|
3189
|
-
SwitchTransition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
3190
|
-
/**
|
|
3191
|
-
* Transition modes.
|
|
3192
|
-
* `out-in`: Current element transitions out first, then when complete, the new element transitions in.
|
|
3193
|
-
* `in-out`: New element transitions in first, then when complete, the current element transitions out.
|
|
3194
|
-
*
|
|
3195
|
-
* @type {'out-in'|'in-out'}
|
|
3196
|
-
*/
|
|
3197
|
-
mode: propTypesExports.oneOf([modes.in, modes.out]),
|
|
3198
|
-
|
|
3199
|
-
/**
|
|
3200
|
-
* Any `Transition` or `CSSTransition` component.
|
|
3201
|
-
*/
|
|
3202
|
-
children: propTypesExports.oneOfType([propTypesExports.element.isRequired])
|
|
3203
|
-
} : {};
|
|
3204
|
-
SwitchTransition.defaultProps = {
|
|
3205
|
-
mode: modes.out
|
|
3206
|
-
};
|
|
3207
|
-
|
|
3208
|
-
// code borrowed from https://github.com/reach/reach-ui
|
|
3209
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3210
|
-
function useForkedRef() {
|
|
3211
|
-
var refs = [];
|
|
3212
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3213
|
-
refs[_i] = arguments[_i];
|
|
3214
|
-
}
|
|
3215
|
-
return React$1.useMemo(function () {
|
|
3216
|
-
if (refs.every(function (ref) { return ref == null; })) {
|
|
3217
|
-
return null;
|
|
3218
|
-
}
|
|
3219
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3220
|
-
return function (node) {
|
|
3221
|
-
refs.forEach(function (ref) {
|
|
3222
|
-
assignRef(ref, node);
|
|
3223
|
-
});
|
|
3224
|
-
};
|
|
3225
|
-
}, refs);
|
|
3226
|
-
}
|
|
3227
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3228
|
-
function assignRef(ref,
|
|
3229
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3230
|
-
value) {
|
|
3231
|
-
if (ref == null)
|
|
3232
|
-
return;
|
|
3233
|
-
if (isFunction(ref)) {
|
|
3234
|
-
ref(value);
|
|
3235
|
-
}
|
|
3236
|
-
else {
|
|
3237
|
-
try {
|
|
3238
|
-
ref.current = value;
|
|
3239
|
-
}
|
|
3240
|
-
catch (error) {
|
|
3241
|
-
throw new Error("Cannot assign value \"".concat(value, "\" to ref \"").concat(ref, "\""));
|
|
3242
|
-
}
|
|
3243
|
-
}
|
|
3244
|
-
}
|
|
3245
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
|
3246
|
-
function isFunction(value) {
|
|
3247
|
-
return !!(value && {}.toString.call(value) == '[object Function]');
|
|
3248
|
-
}
|
|
3249
|
-
|
|
3250
|
-
var useStateWithCallback = function (initialState, handler, runHandler) {
|
|
3251
|
-
var _a = React$1.useState(initialState), state = _a[0], setState = _a[1];
|
|
3252
|
-
handler &&
|
|
3253
|
-
React$1.useEffect(function () {
|
|
3254
|
-
runHandler && handler(state);
|
|
3255
|
-
}, [state]);
|
|
3256
|
-
return [state, setState];
|
|
3257
|
-
};
|
|
3258
|
-
|
|
3259
|
-
var CCollapse = React$1.forwardRef(function (_a, ref) {
|
|
3260
|
-
var children = _a.children, className = _a.className, horizontal = _a.horizontal, onHide = _a.onHide, onShow = _a.onShow, visible = _a.visible, rest = __rest$1(_a, ["children", "className", "horizontal", "onHide", "onShow", "visible"]);
|
|
3261
|
-
var _b = React$1.useState(), height = _b[0], setHeight = _b[1];
|
|
3262
|
-
var _c = React$1.useState(), width = _c[0], setWidth = _c[1];
|
|
3263
|
-
var collapseRef = React$1.useRef(null);
|
|
3264
|
-
var forkedRef = useForkedRef(ref, collapseRef);
|
|
3265
|
-
var getTransitionClass = function (state) {
|
|
3266
|
-
return state === 'entering'
|
|
3267
|
-
? 'collapsing'
|
|
3268
|
-
: state === 'entered'
|
|
3269
|
-
? 'collapse show'
|
|
3270
|
-
: state === 'exiting'
|
|
3271
|
-
? 'collapsing'
|
|
3272
|
-
: 'collapse';
|
|
3273
|
-
};
|
|
3274
|
-
var onEntering = function () {
|
|
3275
|
-
onShow && onShow();
|
|
3276
|
-
if (horizontal) {
|
|
3277
|
-
collapseRef.current && setWidth(collapseRef.current.scrollWidth);
|
|
3278
|
-
return;
|
|
3279
|
-
}
|
|
3280
|
-
collapseRef.current && setHeight(collapseRef.current.scrollHeight);
|
|
3281
|
-
};
|
|
3282
|
-
var onEntered = function () {
|
|
3283
|
-
if (horizontal) {
|
|
3284
|
-
setWidth(0);
|
|
3285
|
-
return;
|
|
3286
|
-
}
|
|
3287
|
-
setHeight(0);
|
|
3288
|
-
};
|
|
3289
|
-
var onExit = function () {
|
|
3290
|
-
if (horizontal) {
|
|
3291
|
-
collapseRef.current && setWidth(collapseRef.current.scrollWidth);
|
|
3292
|
-
return;
|
|
3293
|
-
}
|
|
3294
|
-
collapseRef.current && setHeight(collapseRef.current.scrollHeight);
|
|
3295
|
-
};
|
|
3296
|
-
var onExiting = function () {
|
|
3297
|
-
onHide && onHide();
|
|
3298
|
-
if (horizontal) {
|
|
3299
|
-
setWidth(0);
|
|
3300
|
-
return;
|
|
3301
|
-
}
|
|
3302
|
-
setHeight(0);
|
|
3303
|
-
};
|
|
3304
|
-
var onExited = function () {
|
|
3305
|
-
if (horizontal) {
|
|
3306
|
-
setWidth(0);
|
|
3307
|
-
return;
|
|
3308
|
-
}
|
|
3309
|
-
setHeight(0);
|
|
3310
|
-
};
|
|
3311
|
-
var _className = classNames$1({
|
|
3312
|
-
'collapse-horizontal': horizontal,
|
|
3313
|
-
}, className);
|
|
3314
|
-
return (React$1.createElement(CSSTransition, { in: visible, nodeRef: collapseRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
|
|
3315
|
-
var transitionClass = getTransitionClass(state);
|
|
3316
|
-
var currentHeight = height === 0 ? null : { height: height };
|
|
3317
|
-
var currentWidth = width === 0 ? null : { width: width };
|
|
3318
|
-
return (React$1.createElement("div", __assign$1({ className: classNames$1(_className, transitionClass), style: __assign$1(__assign$1({}, currentHeight), currentWidth) }, rest, { ref: forkedRef }), children));
|
|
3319
|
-
}));
|
|
3320
|
-
});
|
|
3321
|
-
CCollapse.propTypes = {
|
|
3322
|
-
children: propTypesExports.node,
|
|
3323
|
-
className: propTypesExports.string,
|
|
3324
|
-
horizontal: propTypesExports.bool,
|
|
3325
|
-
onHide: propTypesExports.func,
|
|
3326
|
-
onShow: propTypesExports.func,
|
|
3327
|
-
visible: propTypesExports.bool,
|
|
3328
|
-
};
|
|
3329
|
-
CCollapse.displayName = 'CCollapse';
|
|
2606
|
+
var _className = classNames$1({
|
|
2607
|
+
'collapse-horizontal': horizontal,
|
|
2608
|
+
}, className);
|
|
2609
|
+
return (React$1.createElement(CSSTransition$1, { in: visible, nodeRef: collapseRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 350 }, function (state) {
|
|
2610
|
+
var transitionClass = getTransitionClass(state);
|
|
2611
|
+
var currentHeight = height === 0 ? null : { height: height };
|
|
2612
|
+
var currentWidth = width === 0 ? null : { width: width };
|
|
2613
|
+
return (React$1.createElement("div", __assign$1({ className: classNames$1(_className, transitionClass), style: __assign$1(__assign$1({}, currentHeight), currentWidth) }, rest, { ref: forkedRef }), children));
|
|
2614
|
+
}));
|
|
2615
|
+
});
|
|
2616
|
+
CCollapse.propTypes = {
|
|
2617
|
+
children: propTypesExports.node,
|
|
2618
|
+
className: propTypesExports.string,
|
|
2619
|
+
horizontal: propTypesExports.bool,
|
|
2620
|
+
onHide: propTypesExports.func,
|
|
2621
|
+
onShow: propTypesExports.func,
|
|
2622
|
+
visible: propTypesExports.bool,
|
|
2623
|
+
};
|
|
2624
|
+
CCollapse.displayName = 'CCollapse';
|
|
3330
2625
|
|
|
3331
2626
|
var CAccordionBody = React$1.forwardRef(function (_a, ref) {
|
|
3332
2627
|
var children = _a.children, className = _a.className, rest = __rest$1(_a, ["children", "className"]);
|
|
3333
2628
|
var visible = React$1.useContext(CAccordionItemContext).visible;
|
|
3334
2629
|
var _className = classNames$1('accordion-body', className);
|
|
3335
|
-
return (React$1.createElement(CCollapse, { className: "accordion-
|
|
2630
|
+
return (React$1.createElement(CCollapse, { className: "accordion-collapse", visible: visible },
|
|
3336
2631
|
React$1.createElement("div", __assign$1({ className: _className }, rest, { ref: ref }), children)));
|
|
3337
2632
|
});
|
|
3338
2633
|
CAccordionBody.propTypes = {
|
|
@@ -3465,7 +2760,7 @@ var CAlert = React$1.forwardRef(function (_a, ref) {
|
|
|
3465
2760
|
var getTransitionClass = function (state) {
|
|
3466
2761
|
return state === 'entered' && 'show';
|
|
3467
2762
|
};
|
|
3468
|
-
return (React$1.createElement(Transition, { in: _visible, mountOnEnter: true, nodeRef: alertRef, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2763
|
+
return (React$1.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: alertRef, onExit: onClose, timeout: 150, unmountOnExit: true }, function (state) {
|
|
3469
2764
|
var transitionClass = getTransitionClass(state);
|
|
3470
2765
|
return (React$1.createElement("div", __assign$1({ className: classNames$1(_className, transitionClass), role: "alert" }, rest, { ref: forkedRef }),
|
|
3471
2766
|
children,
|
|
@@ -3559,7 +2854,7 @@ var CBackdrop = React$1.forwardRef(function (_a, ref) {
|
|
|
3559
2854
|
var getTransitionClass = function (state) {
|
|
3560
2855
|
return state === 'entered' && 'show';
|
|
3561
2856
|
};
|
|
3562
|
-
return (React$1.createElement(Transition, { in: visible, mountOnEnter: true, nodeRef: backdropRef, timeout: 150, unmountOnExit: true }, function (state) {
|
|
2857
|
+
return (React$1.createElement(Transition$1, { in: visible, mountOnEnter: true, nodeRef: backdropRef, timeout: 150, unmountOnExit: true }, function (state) {
|
|
3563
2858
|
var transitionClass = getTransitionClass(state);
|
|
3564
2859
|
return (React$1.createElement("div", __assign$1({ className: classNames$1(_className, transitionClass) }, rest, { ref: forkedRef })));
|
|
3565
2860
|
}));
|
|
@@ -3847,12 +3142,26 @@ var getPreviousSibling = function (elem, selector) {
|
|
|
3847
3142
|
return;
|
|
3848
3143
|
};
|
|
3849
3144
|
|
|
3850
|
-
var
|
|
3145
|
+
var isInViewport = function (element) {
|
|
3851
3146
|
var rect = element.getBoundingClientRect();
|
|
3852
|
-
return (rect.top >= 0 &&
|
|
3853
|
-
rect.left >= 0 &&
|
|
3854
|
-
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
3855
|
-
rect.right <= (window.innerWidth || document.documentElement.clientWidth));
|
|
3147
|
+
return (Math.floor(rect.top) >= 0 &&
|
|
3148
|
+
Math.floor(rect.left) >= 0 &&
|
|
3149
|
+
Math.floor(rect.bottom) <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
3150
|
+
Math.floor(rect.right) <= (window.innerWidth || document.documentElement.clientWidth));
|
|
3151
|
+
};
|
|
3152
|
+
|
|
3153
|
+
var isObjectInArray = function (array, item, ignore) {
|
|
3154
|
+
if (ignore === void 0) { ignore = []; }
|
|
3155
|
+
return array.some(function (_item) {
|
|
3156
|
+
var result = true;
|
|
3157
|
+
for (var key in item) {
|
|
3158
|
+
if (!ignore.includes(key) && item[key] !== _item[key]) {
|
|
3159
|
+
result = false;
|
|
3160
|
+
break;
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
return result;
|
|
3164
|
+
});
|
|
3856
3165
|
};
|
|
3857
3166
|
|
|
3858
3167
|
var CCarouselContext = React$1.createContext({});
|
|
@@ -3899,7 +3208,7 @@ var CCarousel = React$1.forwardRef(function (_a, ref) {
|
|
|
3899
3208
|
var nextItemWhenVisible = function () {
|
|
3900
3209
|
// Don't call next when the page isn't visible
|
|
3901
3210
|
// or the carousel or its parent isn't visible
|
|
3902
|
-
if (!document.hidden && carouselRef.current &&
|
|
3211
|
+
if (!document.hidden && carouselRef.current && isInViewport(carouselRef.current)) {
|
|
3903
3212
|
if (animating) {
|
|
3904
3213
|
return;
|
|
3905
3214
|
}
|
|
@@ -3933,7 +3242,7 @@ var CCarousel = React$1.forwardRef(function (_a, ref) {
|
|
|
3933
3242
|
}
|
|
3934
3243
|
};
|
|
3935
3244
|
var handleScroll = function () {
|
|
3936
|
-
if (!document.hidden && carouselRef.current &&
|
|
3245
|
+
if (!document.hidden && carouselRef.current && isInViewport(carouselRef.current)) {
|
|
3937
3246
|
setVisible(true);
|
|
3938
3247
|
}
|
|
3939
3248
|
else {
|
|
@@ -4554,6 +3863,7 @@ var formatters$2 = {
|
|
|
4554
3863
|
return addLeadingZeros(fractionalSeconds, token.length);
|
|
4555
3864
|
}
|
|
4556
3865
|
};
|
|
3866
|
+
var formatters$3 = formatters$2;
|
|
4557
3867
|
|
|
4558
3868
|
var dayPeriodEnum = {
|
|
4559
3869
|
am: 'am',
|
|
@@ -4651,7 +3961,7 @@ var formatters = {
|
|
|
4651
3961
|
});
|
|
4652
3962
|
}
|
|
4653
3963
|
|
|
4654
|
-
return formatters$
|
|
3964
|
+
return formatters$3.y(date, token);
|
|
4655
3965
|
},
|
|
4656
3966
|
// Local week-numbering year
|
|
4657
3967
|
Y: function Y(date, token, localize, options) {
|
|
@@ -4784,7 +4094,7 @@ var formatters = {
|
|
|
4784
4094
|
switch (token) {
|
|
4785
4095
|
case 'M':
|
|
4786
4096
|
case 'MM':
|
|
4787
|
-
return formatters$
|
|
4097
|
+
return formatters$3.M(date, token);
|
|
4788
4098
|
// 1st, 2nd, ..., 12th
|
|
4789
4099
|
|
|
4790
4100
|
case 'Mo':
|
|
@@ -4889,7 +4199,7 @@ var formatters = {
|
|
|
4889
4199
|
});
|
|
4890
4200
|
}
|
|
4891
4201
|
|
|
4892
|
-
return formatters$
|
|
4202
|
+
return formatters$3.d(date, token);
|
|
4893
4203
|
},
|
|
4894
4204
|
// Day of year
|
|
4895
4205
|
D: function D(date, token, localize) {
|
|
@@ -5210,7 +4520,7 @@ var formatters = {
|
|
|
5210
4520
|
});
|
|
5211
4521
|
}
|
|
5212
4522
|
|
|
5213
|
-
return formatters$
|
|
4523
|
+
return formatters$3.h(date, token);
|
|
5214
4524
|
},
|
|
5215
4525
|
// Hour [0-23]
|
|
5216
4526
|
H: function H(date, token, localize) {
|
|
@@ -5220,7 +4530,7 @@ var formatters = {
|
|
|
5220
4530
|
});
|
|
5221
4531
|
}
|
|
5222
4532
|
|
|
5223
|
-
return formatters$
|
|
4533
|
+
return formatters$3.H(date, token);
|
|
5224
4534
|
},
|
|
5225
4535
|
// Hour [0-11]
|
|
5226
4536
|
K: function K(date, token, localize) {
|
|
@@ -5255,7 +4565,7 @@ var formatters = {
|
|
|
5255
4565
|
});
|
|
5256
4566
|
}
|
|
5257
4567
|
|
|
5258
|
-
return formatters$
|
|
4568
|
+
return formatters$3.m(date, token);
|
|
5259
4569
|
},
|
|
5260
4570
|
// Second
|
|
5261
4571
|
s: function s(date, token, localize) {
|
|
@@ -5265,11 +4575,11 @@ var formatters = {
|
|
|
5265
4575
|
});
|
|
5266
4576
|
}
|
|
5267
4577
|
|
|
5268
|
-
return formatters$
|
|
4578
|
+
return formatters$3.s(date, token);
|
|
5269
4579
|
},
|
|
5270
4580
|
// Fraction of second
|
|
5271
4581
|
S: function S(date, token) {
|
|
5272
|
-
return formatters$
|
|
4582
|
+
return formatters$3.S(date, token);
|
|
5273
4583
|
},
|
|
5274
4584
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
5275
4585
|
X: function X(date, token, _localize, options) {
|
|
@@ -5619,6 +4929,8 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
|
5619
4929
|
return result;
|
|
5620
4930
|
};
|
|
5621
4931
|
|
|
4932
|
+
var formatDistance$1 = formatDistance;
|
|
4933
|
+
|
|
5622
4934
|
function buildFormatLongFn(args) {
|
|
5623
4935
|
return function () {
|
|
5624
4936
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -5661,6 +4973,7 @@ var formatLong = {
|
|
|
5661
4973
|
defaultWidth: 'full'
|
|
5662
4974
|
})
|
|
5663
4975
|
};
|
|
4976
|
+
var formatLong$1 = formatLong;
|
|
5664
4977
|
|
|
5665
4978
|
var formatRelativeLocale = {
|
|
5666
4979
|
lastWeek: "'last' eeee 'at' p",
|
|
@@ -5675,6 +4988,8 @@ var formatRelative = function formatRelative(token, _date, _baseDate, _options)
|
|
|
5675
4988
|
return formatRelativeLocale[token];
|
|
5676
4989
|
};
|
|
5677
4990
|
|
|
4991
|
+
var formatRelative$1 = formatRelative;
|
|
4992
|
+
|
|
5678
4993
|
function buildLocalizeFn(args) {
|
|
5679
4994
|
return function (dirtyIndex, options) {
|
|
5680
4995
|
var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
|
|
@@ -5842,6 +5157,7 @@ var localize = {
|
|
|
5842
5157
|
defaultFormattingWidth: 'wide'
|
|
5843
5158
|
})
|
|
5844
5159
|
};
|
|
5160
|
+
var localize$1 = localize;
|
|
5845
5161
|
|
|
5846
5162
|
function buildMatchFn(args) {
|
|
5847
5163
|
return function (string) {
|
|
@@ -6005,6 +5321,7 @@ var match = {
|
|
|
6005
5321
|
defaultParseWidth: 'any'
|
|
6006
5322
|
})
|
|
6007
5323
|
};
|
|
5324
|
+
var match$1 = match;
|
|
6008
5325
|
|
|
6009
5326
|
/**
|
|
6010
5327
|
* @type {Locale}
|
|
@@ -6017,11 +5334,11 @@ var match = {
|
|
|
6017
5334
|
*/
|
|
6018
5335
|
var locale = {
|
|
6019
5336
|
code: 'en-US',
|
|
6020
|
-
formatDistance: formatDistance,
|
|
6021
|
-
formatLong: formatLong,
|
|
6022
|
-
formatRelative: formatRelative,
|
|
6023
|
-
localize: localize,
|
|
6024
|
-
match: match,
|
|
5337
|
+
formatDistance: formatDistance$1,
|
|
5338
|
+
formatLong: formatLong$1,
|
|
5339
|
+
formatRelative: formatRelative$1,
|
|
5340
|
+
localize: localize$1,
|
|
5341
|
+
match: match$1,
|
|
6025
5342
|
options: {
|
|
6026
5343
|
weekStartsOn: 0
|
|
6027
5344
|
/* Sunday */
|
|
@@ -6447,12 +5764,12 @@ var uaParser_min = {
|
|
|
6447
5764
|
set exports(v){ uaParser_minExports = v; },
|
|
6448
5765
|
};
|
|
6449
5766
|
|
|
6450
|
-
/* UAParser.js v1.0.
|
|
5767
|
+
/* UAParser.js v1.0.33
|
|
6451
5768
|
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
|
|
6452
5769
|
MIT License */
|
|
6453
5770
|
|
|
6454
5771
|
(function (module, exports) {
|
|
6455
|
-
(function(window,undefined$1){var LIBVERSION="1.0.32",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",UA_MAX_LENGTH=350;var AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",BROWSER="Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",OPERA="Opera",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",FACEBOOK="Facebook";var extend=function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i]);}else {mergedRegexes[i]=regexes[i];}}return mergedRegexes},enumerize=function(arr){var enums={};for(var i=0;i<arr.length;i++){enums[arr[i].toUpperCase()]=arr[i];}return enums},has=function(str1,str2){return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:false},lowerize=function(str){return str.toLowerCase()},majorize=function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,EMPTY).split(".")[0]:undefined$1},trim=function(str,len){if(typeof str===STR_TYPE){str=str.replace(/^\s\s*/,EMPTY).replace(/\s\s*$/,EMPTY);return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var rgxMapper=function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i<arrays.length&&!matches){var regex=arrays[i],props=arrays[i+1];j=k=0;while(j<regex.length&&!matches){matches=regex[j++].exec(ua);if(!!matches){for(p=0;p<props.length;p++){match=matches[++k];q=props[p];if(typeof q===OBJ_TYPE&&q.length>0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match);}else {this[q[0]]=q[1];}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined$1;}else {this[q[0]]=match?match.replace(q[1],q[2]):undefined$1;}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined$1;}}else {this[q]=match?match:undefined$1;}}}}i+=2;}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j<map[i].length;j++){if(has(map[i][j],str)){return i===UNKNOWN?undefined$1:i}}}else if(has(map[i],str)){return i===UNKNOWN?undefined$1:i}}return str};var oldSafariMap={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},windowsVersionMap={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"};var regexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION,[NAME,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION],[/opios[\/ ]+([\w\.]+)/i],[VERSION,[NAME,OPERA+" Mini"]],[/\bopr\/([\w\.]+)/i],[VERSION,[NAME,OPERA]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[NAME,VERSION],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"UC"+BROWSER]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[VERSION,[NAME,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[VERSION,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION,[NAME,"IE"]],[/yabrowser\/([\w\.]+)/i],[VERSION,[NAME,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure "+BROWSER],VERSION],[/\bfocus\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION,[NAME,"MIUI "+BROWSER]],[/fxios\/([-\w\.]+)/i],[VERSION,[NAME,FIREFOX]],[/\bqihu|(qi?ho?o?|360)browser/i],[[NAME,"360 "+BROWSER]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 "+BROWSER],VERSION],[/(comodo_dragon)\/([\w\.]+)/i],[[NAME,/_/g," "],VERSION],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[NAME,VERSION],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[NAME,VERSION],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION,[NAME,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION,[NAME,CHROME+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION,[NAME,"Android "+BROWSER]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[VERSION,[NAME,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[VERSION,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION,strMapper,oldSafariMap]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[NAME,VERSION]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i],[[ARCHITECTURE,lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/windows (ce|mobile); ppc;/i],[[ARCHITECTURE,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/(sun4\w)[;\)]/i],[[ARCHITECTURE,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/\((ip(?:hone|od)[\w ]*);/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,"OPPO"],[TYPE,MOBILE]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[MODEL,[VENDOR,"Lenovo"],[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[MODEL,/_/g," "],[VENDOR,"Nokia"],[TYPE,MOBILE]],[/(pixel c)\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,"OnePlus"],[TYPE,MOBILE]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/(u304aa)/i],[MODEL,[VENDOR,"AT&T"],[TYPE,MOBILE]],[/\bsie-(\w*)/i],[MODEL,[VENDOR,"Siemens"],[TYPE,MOBILE]],[/\b(rct\w+) b/i],[MODEL,[VENDOR,"RCA"],[TYPE,TABLET]],[/\b(venue[\d ]{2,7}) b/i],[MODEL,[VENDOR,"Dell"],[TYPE,TABLET]],[/\b(q(?:mv|ta)\w+) b/i],[MODEL,[VENDOR,"Verizon"],[TYPE,TABLET]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[MODEL,[VENDOR,"Barnes & Noble"],[TYPE,TABLET]],[/\b(tm\d{3}\w+) b/i],[MODEL,[VENDOR,"NuVision"],[TYPE,TABLET]],[/\b(k88) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,TABLET]],[/\b(nx\d{3}j) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,MOBILE]],[/\b(gen\d{3}) b.+49h/i],[MODEL,[VENDOR,"Swiss"],[TYPE,MOBILE]],[/\b(zur\d{3}) b/i],[MODEL,[VENDOR,"Swiss"],[TYPE,TABLET]],[/\b((zeki)?tb.*\b) b/i],[MODEL,[VENDOR,"Zeki"],[TYPE,TABLET]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[VENDOR,"Dragon Touch"],MODEL,[TYPE,TABLET]],[/\b(ns-?\w{0,9}) b/i],[MODEL,[VENDOR,"Insignia"],[TYPE,TABLET]],[/\b((nxa|next)-?\w{0,9}) b/i],[MODEL,[VENDOR,"NextBook"],[TYPE,TABLET]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[VENDOR,"Voice"],MODEL,[TYPE,MOBILE]],[/\b(lvtel\-)?(v1[12]) b/i],[[VENDOR,"LvTel"],MODEL,[TYPE,MOBILE]],[/\b(ph-1) /i],[MODEL,[VENDOR,"Essential"],[TYPE,MOBILE]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[MODEL,[VENDOR,"Envizen"],[TYPE,TABLET]],[/\b(trio[-\w\. ]+) b/i],[MODEL,[VENDOR,"MachSpeed"],[TYPE,TABLET]],[/\btu_(1491) b/i],[MODEL,[VENDOR,"Rotor"],[TYPE,TABLET]],[/(shield[\w ]+) b/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield) bui/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,CONSOLE]],[/(playstation [345portablevi]+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROME+"cast"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/droid.+aft(\w)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mitv-\w{5}) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[VENDOR,trim],[MODEL,trim],[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[TYPE,SMARTTV]],[/((pebble))app/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/(quest( 2)?)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,WEARABLE]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[MODEL,[TYPE,MOBILE]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[MODEL,[TYPE,TABLET]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/(android[-\w\. ]{0,9});.+buil/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[NAME,VERSION],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION,NAME]],os:[[/microsoft (windows) (vista|xp)/i],[NAME,VERSION],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[NAME,[VERSION,strMapper,windowsVersionMap]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[NAME,"Windows"],[VERSION,strMapper,windowsVersionMap]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[VERSION,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[NAME,"Mac OS"],[VERSION,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[VERSION,NAME],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[NAME,VERSION],[/\(bb(10);/i],[VERSION,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[VERSION,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[VERSION,[NAME,"webOS"]],[/crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROME+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[NAME,"Chromium OS"],VERSION],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[NAME,VERSION],[/(sunos) ?([\w\.\d]*)/i],[[NAME,"Solaris"],VERSION],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION]]};var UAParser=function(ua,extensions){if(typeof ua===OBJ_TYPE){extensions=ua;ua=undefined$1;}if(!(this instanceof UAParser)){return new UAParser(ua,extensions).getResult()}var _ua=ua||(typeof window!==UNDEF_TYPE&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:EMPTY);var _rgxmap=extensions?extend(regexes,extensions):regexes;this.getBrowser=function(){var _browser={};_browser[NAME]=undefined$1;_browser[VERSION]=undefined$1;rgxMapper.call(_browser,_ua,_rgxmap.browser);_browser.major=majorize(_browser.version);return _browser};this.getCPU=function(){var _cpu={};_cpu[ARCHITECTURE]=undefined$1;rgxMapper.call(_cpu,_ua,_rgxmap.cpu);return _cpu};this.getDevice=function(){var _device={};_device[VENDOR]=undefined$1;_device[MODEL]=undefined$1;_device[TYPE]=undefined$1;rgxMapper.call(_device,_ua,_rgxmap.device);return _device};this.getEngine=function(){var _engine={};_engine[NAME]=undefined$1;_engine[VERSION]=undefined$1;rgxMapper.call(_engine,_ua,_rgxmap.engine);return _engine};this.getOS=function(){var _os={};_os[NAME]=undefined$1;_os[VERSION]=undefined$1;rgxMapper.call(_os,_ua,_rgxmap.os);return _os};this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}};this.getUA=function(){return _ua};this.setUA=function(ua){_ua=typeof ua===STR_TYPE&&ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this};this.setUA(_ua);return this};UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);{if(module.exports){exports=module.exports=UAParser;}exports.UAParser=UAParser;}var $=typeof window!==UNDEF_TYPE&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop];}};}})(typeof window==="object"?window:commonjsGlobal);
|
|
5772
|
+
(function(window,undefined$1){var LIBVERSION="0.7.33",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",UA_MAX_LENGTH=350;var AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",BROWSER="Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",OPERA="Opera",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",FACEBOOK="Facebook";var extend=function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i]);}else {mergedRegexes[i]=regexes[i];}}return mergedRegexes},enumerize=function(arr){var enums={};for(var i=0;i<arr.length;i++){enums[arr[i].toUpperCase()]=arr[i];}return enums},has=function(str1,str2){return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:false},lowerize=function(str){return str.toLowerCase()},majorize=function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,EMPTY).split(".")[0]:undefined$1},trim=function(str,len){if(typeof str===STR_TYPE){str=str.replace(/^\s\s*/,EMPTY);return typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)}};var rgxMapper=function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i<arrays.length&&!matches){var regex=arrays[i],props=arrays[i+1];j=k=0;while(j<regex.length&&!matches){matches=regex[j++].exec(ua);if(!!matches){for(p=0;p<props.length;p++){match=matches[++k];q=props[p];if(typeof q===OBJ_TYPE&&q.length>0){if(q.length===2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match);}else {this[q[0]]=q[1];}}else if(q.length===3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined$1;}else {this[q[0]]=match?match.replace(q[1],q[2]):undefined$1;}}else if(q.length===4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined$1;}}else {this[q]=match?match:undefined$1;}}}}i+=2;}},strMapper=function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j<map[i].length;j++){if(has(map[i][j],str)){return i===UNKNOWN?undefined$1:i}}}else if(has(map[i],str)){return i===UNKNOWN?undefined$1:i}}return str};var oldSafariMap={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},windowsVersionMap={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"};var regexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION,[NAME,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION],[/opios[\/ ]+([\w\.]+)/i],[VERSION,[NAME,OPERA+" Mini"]],[/\bopr\/([\w\.]+)/i],[VERSION,[NAME,OPERA]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[NAME,VERSION],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION,[NAME,"UC"+BROWSER]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[VERSION,[NAME,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[VERSION,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION,[NAME,"IE"]],[/yabrowser\/([\w\.]+)/i],[VERSION,[NAME,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure "+BROWSER],VERSION],[/\bfocus\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION,[NAME,"MIUI "+BROWSER]],[/fxios\/([-\w\.]+)/i],[VERSION,[NAME,FIREFOX]],[/\bqihu|(qi?ho?o?|360)browser/i],[[NAME,"360 "+BROWSER]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 "+BROWSER],VERSION],[/(comodo_dragon)\/([\w\.]+)/i],[[NAME,/_/g," "],VERSION],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[NAME,VERSION],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[NAME,VERSION],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION,[NAME,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION,[NAME,CHROME+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION,[NAME,"Android "+BROWSER]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[VERSION,[NAME,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[VERSION,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION,strMapper,oldSafariMap]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[NAME,VERSION],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i],[[ARCHITECTURE,lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/windows (ce|mobile); ppc;/i],[[ARCHITECTURE,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY,lowerize]],[/(sun4\w)[;\)]/i],[[ARCHITECTURE,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/\((ip(?:hone|od)[\w ]*);/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,"OPPO"],[TYPE,MOBILE]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[MODEL,[VENDOR,"Lenovo"],[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[MODEL,/_/g," "],[VENDOR,"Nokia"],[TYPE,MOBILE]],[/(pixel c)\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,"OnePlus"],[TYPE,MOBILE]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/(u304aa)/i],[MODEL,[VENDOR,"AT&T"],[TYPE,MOBILE]],[/\bsie-(\w*)/i],[MODEL,[VENDOR,"Siemens"],[TYPE,MOBILE]],[/\b(rct\w+) b/i],[MODEL,[VENDOR,"RCA"],[TYPE,TABLET]],[/\b(venue[\d ]{2,7}) b/i],[MODEL,[VENDOR,"Dell"],[TYPE,TABLET]],[/\b(q(?:mv|ta)\w+) b/i],[MODEL,[VENDOR,"Verizon"],[TYPE,TABLET]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[MODEL,[VENDOR,"Barnes & Noble"],[TYPE,TABLET]],[/\b(tm\d{3}\w+) b/i],[MODEL,[VENDOR,"NuVision"],[TYPE,TABLET]],[/\b(k88) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,TABLET]],[/\b(nx\d{3}j) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,MOBILE]],[/\b(gen\d{3}) b.+49h/i],[MODEL,[VENDOR,"Swiss"],[TYPE,MOBILE]],[/\b(zur\d{3}) b/i],[MODEL,[VENDOR,"Swiss"],[TYPE,TABLET]],[/\b((zeki)?tb.*\b) b/i],[MODEL,[VENDOR,"Zeki"],[TYPE,TABLET]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[VENDOR,"Dragon Touch"],MODEL,[TYPE,TABLET]],[/\b(ns-?\w{0,9}) b/i],[MODEL,[VENDOR,"Insignia"],[TYPE,TABLET]],[/\b((nxa|next)-?\w{0,9}) b/i],[MODEL,[VENDOR,"NextBook"],[TYPE,TABLET]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[VENDOR,"Voice"],MODEL,[TYPE,MOBILE]],[/\b(lvtel\-)?(v1[12]) b/i],[[VENDOR,"LvTel"],MODEL,[TYPE,MOBILE]],[/\b(ph-1) /i],[MODEL,[VENDOR,"Essential"],[TYPE,MOBILE]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[MODEL,[VENDOR,"Envizen"],[TYPE,TABLET]],[/\b(trio[-\w\. ]+) b/i],[MODEL,[VENDOR,"MachSpeed"],[TYPE,TABLET]],[/\btu_(1491) b/i],[MODEL,[VENDOR,"Rotor"],[TYPE,TABLET]],[/(shield[\w ]+) b/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield) bui/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,CONSOLE]],[/(playstation [345portablevi]+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROME+"cast"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/droid.+aft(\w)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mitv-\w{5}) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[VENDOR,trim],[MODEL,trim],[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[TYPE,SMARTTV]],[/((pebble))app/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/(quest( 2)?)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,WEARABLE]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[MODEL,[TYPE,MOBILE]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[MODEL,[TYPE,TABLET]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/(android[-\w\. ]{0,9});.+buil/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION,[NAME,EDGE+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[NAME,VERSION],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION,NAME]],os:[[/microsoft (windows) (vista|xp)/i],[NAME,VERSION],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[NAME,[VERSION,strMapper,windowsVersionMap]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[NAME,"Windows"],[VERSION,strMapper,windowsVersionMap]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[VERSION,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[NAME,"Mac OS"],[VERSION,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[VERSION,NAME],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[NAME,VERSION],[/\(bb(10);/i],[VERSION,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[VERSION,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION,[NAME,FIREFOX+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[VERSION,[NAME,"webOS"]],[/crkey\/([\d\.]+)/i],[VERSION,[NAME,CHROME+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[NAME,"Chromium OS"],VERSION],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[NAME,VERSION],[/(sunos) ?([\w\.\d]*)/i],[[NAME,"Solaris"],VERSION],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION]]};var UAParser=function(ua,extensions){if(typeof ua===OBJ_TYPE){extensions=ua;ua=undefined$1;}if(!(this instanceof UAParser)){return new UAParser(ua,extensions).getResult()}var _ua=ua||(typeof window!==UNDEF_TYPE&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:EMPTY);var _rgxmap=extensions?extend(regexes,extensions):regexes;this.getBrowser=function(){var _browser={};_browser[NAME]=undefined$1;_browser[VERSION]=undefined$1;rgxMapper.call(_browser,_ua,_rgxmap.browser);_browser.major=majorize(_browser.version);return _browser};this.getCPU=function(){var _cpu={};_cpu[ARCHITECTURE]=undefined$1;rgxMapper.call(_cpu,_ua,_rgxmap.cpu);return _cpu};this.getDevice=function(){var _device={};_device[VENDOR]=undefined$1;_device[MODEL]=undefined$1;_device[TYPE]=undefined$1;rgxMapper.call(_device,_ua,_rgxmap.device);return _device};this.getEngine=function(){var _engine={};_engine[NAME]=undefined$1;_engine[VERSION]=undefined$1;rgxMapper.call(_engine,_ua,_rgxmap.engine);return _engine};this.getOS=function(){var _os={};_os[NAME]=undefined$1;_os[VERSION]=undefined$1;rgxMapper.call(_os,_ua,_rgxmap.os);return _os};this.getResult=function(){return {ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}};this.getUA=function(){return _ua};this.setUA=function(ua){_ua=typeof ua===STR_TYPE&&ua.length>UA_MAX_LENGTH?trim(ua,UA_MAX_LENGTH):ua;return this};this.setUA(_ua);return this};UAParser.VERSION=LIBVERSION;UAParser.BROWSER=enumerize([NAME,VERSION,MAJOR]);UAParser.CPU=enumerize([ARCHITECTURE]);UAParser.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]);UAParser.ENGINE=UAParser.OS=enumerize([NAME,VERSION]);{if(module.exports){exports=module.exports=UAParser;}exports.UAParser=UAParser;}var $=typeof window!==UNDEF_TYPE&&(window.jQuery||window.Zepto);if($&&!$.ua){var parser=new UAParser;$.ua=parser.getResult();$.ua.get=function(){return parser.getUA()};$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result){$.ua[prop]=result[prop];}};}})(typeof window==="object"?window:commonjsGlobal);
|
|
6456
5773
|
} (uaParser_min, uaParser_minExports));
|
|
6457
5774
|
|
|
6458
5775
|
Object.defineProperty(lib, '__esModule', { value: true });
|
|
@@ -7722,40 +7039,145 @@ var isToday = function (date) {
|
|
|
7722
7039
|
date.getFullYear() === today.getFullYear());
|
|
7723
7040
|
};
|
|
7724
7041
|
|
|
7725
|
-
var
|
|
7726
|
-
var
|
|
7727
|
-
var
|
|
7728
|
-
var
|
|
7042
|
+
var Calendar = function (props) {
|
|
7043
|
+
var addMonths = props.addMonths, calendarDate = props.calendarDate, dayFormat = props.dayFormat, disabledDates = props.disabledDates, endDate = props.endDate, firstDayOfWeek = props.firstDayOfWeek, hoverDate = props.hoverDate, locale = props.locale, maxDate = props.maxDate, minDate = props.minDate, onCellClick = props.onCellClick, onCellKeyDown = props.onCellKeyDown, onCellMouseEnter = props.onCellMouseEnter, onCellMouseLeave = props.onCellMouseLeave, onMonthClick = props.onMonthClick, onYearClick = props.onYearClick, selectEndDate = props.selectEndDate, startDate = props.startDate, view = props.view, weekdayFormat = props.weekdayFormat;
|
|
7044
|
+
var _a = React$1.useState(calendarDate), date = _a[0], setDate = _a[1];
|
|
7045
|
+
var _b = React$1.useState([]), listOfMonths = _b[0], setListOfMonths = _b[1];
|
|
7729
7046
|
React$1.useEffect(function () {
|
|
7730
|
-
if (
|
|
7731
|
-
|
|
7732
|
-
|
|
7047
|
+
if (addMonths !== 0) {
|
|
7048
|
+
setDate(new Date(calendarDate.getFullYear(), calendarDate.getMonth() + addMonths, 1));
|
|
7049
|
+
return;
|
|
7733
7050
|
}
|
|
7051
|
+
setDate(calendarDate);
|
|
7734
7052
|
}, [calendarDate]);
|
|
7735
|
-
|
|
7053
|
+
React$1.useEffect(function () {
|
|
7054
|
+
setListOfMonths(createGroupsInArray(getMonthsNames(locale), 4));
|
|
7055
|
+
}, []);
|
|
7056
|
+
var monthDetails = getMonthDetails(date.getFullYear(), date.getMonth(), firstDayOfWeek);
|
|
7057
|
+
var listOfYears = createGroupsInArray(getYears(date.getFullYear()), 4);
|
|
7058
|
+
var weekDays = monthDetails[0];
|
|
7059
|
+
return (React$1.createElement("table", null,
|
|
7060
|
+
view === 'days' && (React$1.createElement("thead", null,
|
|
7061
|
+
React$1.createElement("tr", null, weekDays.map(function (_a, idx) {
|
|
7062
|
+
var date = _a.date;
|
|
7063
|
+
return (React$1.createElement("th", { key: idx, className: "calendar-cell" },
|
|
7064
|
+
React$1.createElement("div", { className: "calendar-header-cell-inner" }, typeof weekdayFormat === 'function'
|
|
7065
|
+
? weekdayFormat(date)
|
|
7066
|
+
: typeof weekdayFormat === 'string'
|
|
7067
|
+
? date.toLocaleDateString(locale, { weekday: weekdayFormat })
|
|
7068
|
+
: date.toLocaleDateString(locale, { weekday: 'long' }).slice(0, weekdayFormat))));
|
|
7069
|
+
})))),
|
|
7070
|
+
React$1.createElement("tbody", null,
|
|
7071
|
+
view === 'days' &&
|
|
7072
|
+
monthDetails.map(function (week, index) {
|
|
7073
|
+
return (React$1.createElement("tr", { key: index }, week.map(function (_a, idx) {
|
|
7074
|
+
var _b;
|
|
7075
|
+
var date = _a.date, month = _a.month;
|
|
7076
|
+
return (React$1.createElement("td", __assign$1({ className: classNames$1('calendar-cell', (_b = {
|
|
7077
|
+
today: month === 'current' && isToday(date),
|
|
7078
|
+
disabled: isDateDisabled(date, minDate, maxDate, disabledDates)
|
|
7079
|
+
},
|
|
7080
|
+
_b[month] = true,
|
|
7081
|
+
_b.last = isLastDayOfMonth(date),
|
|
7082
|
+
_b['range-hover'] = month === 'current' &&
|
|
7083
|
+
(hoverDate && selectEndDate
|
|
7084
|
+
? isDateInRange(date, startDate, hoverDate)
|
|
7085
|
+
: isDateInRange(date, hoverDate, endDate)),
|
|
7086
|
+
_b.range = month === 'current' && isDateInRange(date, startDate, endDate),
|
|
7087
|
+
_b.selected = isDateSelected(date, startDate, endDate),
|
|
7088
|
+
_b.start = isStartDate(date, startDate, endDate),
|
|
7089
|
+
_b.end = isEndDate(date, startDate, endDate),
|
|
7090
|
+
_b)), key: idx, tabIndex: 0, title: date.toLocaleDateString(locale) }, (month === 'current' && {
|
|
7091
|
+
onBlur: function () { return onCellMouseLeave(); },
|
|
7092
|
+
onClick: function () { return onCellClick(date); },
|
|
7093
|
+
onFocus: function () { return onCellMouseEnter(date); },
|
|
7094
|
+
onKeyDown: function (event) { return onCellKeyDown(event, date); },
|
|
7095
|
+
onMouseEnter: function () { return onCellMouseEnter(date); },
|
|
7096
|
+
onMouseLeave: function () { return onCellMouseLeave(); },
|
|
7097
|
+
}), (month !== 'current' && {
|
|
7098
|
+
onMouseEnter: function () { return onCellMouseLeave(); },
|
|
7099
|
+
})),
|
|
7100
|
+
React$1.createElement("div", { className: "calendar-cell-inner" }, typeof dayFormat === 'function'
|
|
7101
|
+
? dayFormat(date)
|
|
7102
|
+
: date.toLocaleDateString(locale, { day: dayFormat }))));
|
|
7103
|
+
})));
|
|
7104
|
+
}),
|
|
7105
|
+
view === 'months' &&
|
|
7106
|
+
listOfMonths.map(function (row, index) {
|
|
7107
|
+
return (React$1.createElement("tr", { key: index }, row.map(function (month, idx) {
|
|
7108
|
+
return (React$1.createElement("td", { key: idx, className: "calendar-cell month", onClick: function () { return onMonthClick(index * 3 + idx - addMonths, 'days'); } },
|
|
7109
|
+
React$1.createElement("div", { className: "calendar-cell-inner" }, month)));
|
|
7110
|
+
})));
|
|
7111
|
+
}),
|
|
7112
|
+
view === 'years' &&
|
|
7113
|
+
listOfYears.map(function (row, index) {
|
|
7114
|
+
return (React$1.createElement("tr", { key: index }, row.map(function (year, idx) {
|
|
7115
|
+
return (React$1.createElement("td", { key: idx, className: "calendar-cell year", onClick: function () {
|
|
7116
|
+
return onYearClick(new Date(year, date.getMonth() - addMonths, date.getDate()), 'months');
|
|
7117
|
+
} },
|
|
7118
|
+
React$1.createElement("div", { className: "calendar-cell-inner" }, new Date(year, 0, 1).toLocaleDateString(locale, { year: 'numeric' }))));
|
|
7119
|
+
})));
|
|
7120
|
+
}))));
|
|
7121
|
+
};
|
|
7122
|
+
var Navigation = function (props) {
|
|
7123
|
+
var addMonths = props.addMonths, calendarDate = props.calendarDate, locale = props.locale, navigation = props.navigation, navNextDoubleIcon = props.navNextDoubleIcon, navNextIcon = props.navNextIcon, navPrevDoubleIcon = props.navPrevDoubleIcon, navPrevIcon = props.navPrevIcon, navYearFirst = props.navYearFirst, onMonthClick = props.onMonthClick, onNavigationClick = props.onNavigationClick, onYearClick = props.onYearClick, view = props.view;
|
|
7124
|
+
var _a = React$1.useState(), date = _a[0], setDate = _a[1];
|
|
7125
|
+
React$1.useEffect(function () {
|
|
7126
|
+
if (addMonths !== 0) {
|
|
7127
|
+
setDate(new Date(calendarDate.getFullYear(), calendarDate.getMonth() + addMonths, 1));
|
|
7128
|
+
return;
|
|
7129
|
+
}
|
|
7130
|
+
setDate(calendarDate);
|
|
7131
|
+
}, [calendarDate]);
|
|
7132
|
+
return (React$1.createElement("div", { className: "calendar-nav" },
|
|
7133
|
+
navigation && (React$1.createElement("div", { className: "calendar-nav-prev" },
|
|
7134
|
+
React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return onNavigationClick('prev', true); } }, navPrevDoubleIcon ? (navPrevDoubleIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-double-prev" }))),
|
|
7135
|
+
view === 'days' && (React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return onNavigationClick('prev'); } }, navPrevIcon ? (navPrevIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-prev" })))))),
|
|
7136
|
+
React$1.createElement("div", __assign$1({ className: "calendar-nav-date" }, (navYearFirst && { style: { display: 'flex', justifyContent: 'center' } })),
|
|
7137
|
+
view === 'days' && (React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return navigation && onMonthClick(); } }, date && date.toLocaleDateString(locale, { month: 'long' }))),
|
|
7138
|
+
React$1.createElement(CButton, __assign$1({ color: "transparent", size: "sm", onClick: function () { return navigation && onYearClick(); } }, (navYearFirst && { style: { order: '-1' } })), date && date.toLocaleDateString(locale, { year: 'numeric' }))),
|
|
7139
|
+
navigation && (React$1.createElement("div", { className: "calendar-nav-next" },
|
|
7140
|
+
view === 'days' && (React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return onNavigationClick('next'); } }, navNextIcon ? (navNextIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-next" })))),
|
|
7141
|
+
React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return onNavigationClick('next', true); } }, navNextDoubleIcon ? (navNextDoubleIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-double-next" })))))));
|
|
7142
|
+
};
|
|
7143
|
+
var CCalendar = React$1.forwardRef(function (_a, ref) {
|
|
7144
|
+
var startDate = _a.startDate, endDate = _a.endDate, _b = _a.calendarDate, calendarDate = _b === void 0 ? startDate || endDate || null : _b, _c = _a.calendars, calendars = _c === void 0 ? 1 : _c, className = _a.className, _d = _a.dayFormat, dayFormat = _d === void 0 ? 'numeric' : _d, disabledDates = _a.disabledDates, _e = _a.firstDayOfWeek, firstDayOfWeek = _e === void 0 ? 1 : _e, _f = _a.locale, locale = _f === void 0 ? 'default' : _f, maxDate = _a.maxDate, minDate = _a.minDate, _g = _a.navigation, navigation = _g === void 0 ? true : _g, navNextIcon = _a.navNextIcon, navNextDoubleIcon = _a.navNextDoubleIcon, navPrevIcon = _a.navPrevIcon, navPrevDoubleIcon = _a.navPrevDoubleIcon, navYearFirst = _a.navYearFirst, range = _a.range, selectEndDate = _a.selectEndDate, _h = _a.weekdayFormat, weekdayFormat = _h === void 0 ? 2 : _h, onCalendarCellHover = _a.onCalendarCellHover, onCalendarDateChange = _a.onCalendarDateChange, onEndDateChange = _a.onEndDateChange, onStartDateChange = _a.onStartDateChange, onSelectEndChange = _a.onSelectEndChange, onViewChanged = _a.onViewChanged;
|
|
7145
|
+
var isInitialMount = React$1.useRef(true);
|
|
7146
|
+
var _j = React$1.useState(null), _calendarDate = _j[0], setCalendarDate = _j[1];
|
|
7147
|
+
React$1.useEffect(function () {
|
|
7148
|
+
if (calendarDate === null) {
|
|
7149
|
+
setCalendarDate(new Date());
|
|
7150
|
+
return;
|
|
7151
|
+
}
|
|
7152
|
+
if (calendarDate) {
|
|
7153
|
+
var date = new Date(calendarDate);
|
|
7154
|
+
!isSameDateAs(_calendarDate, date) && setCalendarDate(date);
|
|
7155
|
+
}
|
|
7156
|
+
}, [calendarDate]);
|
|
7157
|
+
var _k = useStateWithCallback(startDate ? new Date(startDate) : null, onStartDateChange, !isInitialMount.current), _startDate = _k[0], setStartDate = _k[1];
|
|
7736
7158
|
React$1.useEffect(function () {
|
|
7737
7159
|
var date = startDate ? new Date(startDate) : null;
|
|
7738
7160
|
if (!isSameDateAs(date, _startDate)) {
|
|
7739
7161
|
setStartDate(date);
|
|
7740
7162
|
}
|
|
7741
7163
|
}, [startDate]);
|
|
7742
|
-
var
|
|
7164
|
+
var _l = useStateWithCallback(endDate ? new Date(endDate) : null, onEndDateChange, !isInitialMount.current), _endDate = _l[0], setEndDate = _l[1];
|
|
7743
7165
|
React$1.useEffect(function () {
|
|
7744
7166
|
var date = endDate ? new Date(endDate) : null;
|
|
7745
7167
|
if (!isSameDateAs(date, _endDate)) {
|
|
7746
7168
|
setEndDate(date);
|
|
7747
7169
|
}
|
|
7748
7170
|
}, [endDate]);
|
|
7749
|
-
var
|
|
7750
|
-
var
|
|
7171
|
+
var _m = React$1.useState(null), _hoverDate = _m[0], setHoverDate = _m[1];
|
|
7172
|
+
var _o = React$1.useState(maxDate ? new Date(maxDate) : null), _maxDate = _o[0], setMaxDate = _o[1];
|
|
7751
7173
|
React$1.useEffect(function () {
|
|
7752
7174
|
maxDate && setMaxDate(new Date(maxDate));
|
|
7753
7175
|
}, [maxDate]);
|
|
7754
|
-
var
|
|
7176
|
+
var _p = React$1.useState(minDate ? new Date(minDate) : null), _minDate = _p[0], setMinDate = _p[1];
|
|
7755
7177
|
React$1.useEffect(function () {
|
|
7756
7178
|
minDate && setMinDate(new Date(minDate));
|
|
7757
7179
|
}, [minDate]);
|
|
7758
|
-
var
|
|
7180
|
+
var _q = useStateWithCallback(selectEndDate, onSelectEndChange), _selectEndDate = _q[0], setSelectEndDate = _q[1];
|
|
7759
7181
|
React$1.useEffect(function () {
|
|
7760
7182
|
setSelectEndDate(selectEndDate);
|
|
7761
7183
|
}, [selectEndDate]);
|
|
@@ -7765,12 +7187,15 @@ var CCalendar = React$1.forwardRef(function (_a, ref) {
|
|
|
7765
7187
|
onSelectEndChange &&
|
|
7766
7188
|
onSelectEndChange(_selectEndDate);
|
|
7767
7189
|
}, [_selectEndDate]);
|
|
7768
|
-
var
|
|
7190
|
+
var _r = useStateWithCallback('days', onViewChanged), view = _r[0], setView = _r[1];
|
|
7769
7191
|
React$1.useEffect(function () {
|
|
7770
7192
|
isInitialMount.current = false;
|
|
7771
7193
|
}, []);
|
|
7772
7194
|
var setCalendarPage = function (years, months, setMonth) {
|
|
7773
7195
|
if (months === void 0) { months = 0; }
|
|
7196
|
+
if (_calendarDate === null) {
|
|
7197
|
+
return;
|
|
7198
|
+
}
|
|
7774
7199
|
var year = _calendarDate.getFullYear();
|
|
7775
7200
|
var month = _calendarDate.getMonth();
|
|
7776
7201
|
var d = new Date(year, month, 1);
|
|
@@ -7861,105 +7286,16 @@ var CCalendar = React$1.forwardRef(function (_a, ref) {
|
|
|
7861
7286
|
return;
|
|
7862
7287
|
}
|
|
7863
7288
|
};
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
return (React$1.createElement("table", null,
|
|
7875
|
-
view === 'days' && (React$1.createElement("thead", null,
|
|
7876
|
-
React$1.createElement("tr", null, weekDays.map(function (_a, idx) {
|
|
7877
|
-
var date = _a.date;
|
|
7878
|
-
return (React$1.createElement("th", { key: idx, className: "calendar-cell" },
|
|
7879
|
-
React$1.createElement("div", { className: "calendar-header-cell-inner" }, typeof weekdayFormat === 'function'
|
|
7880
|
-
? weekdayFormat(date)
|
|
7881
|
-
: typeof weekdayFormat === 'string'
|
|
7882
|
-
? date.toLocaleDateString(locale, { weekday: weekdayFormat })
|
|
7883
|
-
: date
|
|
7884
|
-
.toLocaleDateString(locale, { weekday: 'long' })
|
|
7885
|
-
.slice(0, weekdayFormat))));
|
|
7886
|
-
})))),
|
|
7887
|
-
React$1.createElement("tbody", null,
|
|
7888
|
-
view === 'days' &&
|
|
7889
|
-
monthDetails.map(function (week, index) {
|
|
7890
|
-
return (React$1.createElement("tr", { key: index }, week.map(function (_a, idx) {
|
|
7891
|
-
var _b;
|
|
7892
|
-
var date = _a.date, month = _a.month;
|
|
7893
|
-
return (React$1.createElement("td", __assign$1({ className: classNames$1('calendar-cell', (_b = {
|
|
7894
|
-
today: month === 'current' && isToday(date),
|
|
7895
|
-
disabled: isDateDisabled(date, _minDate, _maxDate, disabledDates)
|
|
7896
|
-
},
|
|
7897
|
-
_b[month] = true,
|
|
7898
|
-
_b.last = isLastDayOfMonth(date),
|
|
7899
|
-
_b['range-hover'] = month === 'current' &&
|
|
7900
|
-
(_hoverDate && _selectEndDate
|
|
7901
|
-
? isDateInRange(date, _startDate, _hoverDate)
|
|
7902
|
-
: isDateInRange(date, _hoverDate, _endDate)),
|
|
7903
|
-
_b.range = month === 'current' && isDateInRange(date, _startDate, _endDate),
|
|
7904
|
-
_b.selected = isDateSelected(date, _startDate, _endDate),
|
|
7905
|
-
_b.start = isStartDate(date, _startDate, _endDate),
|
|
7906
|
-
_b.end = isEndDate(date, _startDate, _endDate),
|
|
7907
|
-
_b)), key: idx, tabIndex: 0, title: date.toLocaleDateString(locale) }, (month === 'current' && {
|
|
7908
|
-
onBlur: function () { return handleCellMouseLeave(); },
|
|
7909
|
-
onClick: function () { return handleCellOnClick(date); },
|
|
7910
|
-
onFocus: function () { return handleCellMouseEnter(date); },
|
|
7911
|
-
onKeyDown: function (event) { return handleCellKeyDown(event, date); },
|
|
7912
|
-
onMouseEnter: function () { return handleCellMouseEnter(date); },
|
|
7913
|
-
onMouseLeave: function () { return handleCellMouseLeave(); },
|
|
7914
|
-
}), (month !== 'current' && {
|
|
7915
|
-
onMouseEnter: function () { return handleCellMouseLeave(); },
|
|
7916
|
-
})),
|
|
7917
|
-
React$1.createElement("div", { className: "calendar-cell-inner" }, typeof dayFormat === 'function'
|
|
7918
|
-
? dayFormat(date)
|
|
7919
|
-
: date.toLocaleDateString(locale, { day: dayFormat }))));
|
|
7920
|
-
})));
|
|
7921
|
-
}),
|
|
7922
|
-
view === 'months' &&
|
|
7923
|
-
listOfMonths.map(function (row, index) {
|
|
7924
|
-
return (React$1.createElement("tr", { key: index }, row.map(function (month, idx) {
|
|
7925
|
-
return (React$1.createElement("td", { key: idx, className: "calendar-cell month", onClick: function () {
|
|
7926
|
-
setCalendarPage(0, 0, index * 3 + idx - addMonths);
|
|
7927
|
-
setView('days');
|
|
7928
|
-
} },
|
|
7929
|
-
React$1.createElement("div", { className: "calendar-cell-inner" }, month)));
|
|
7930
|
-
})));
|
|
7931
|
-
}),
|
|
7932
|
-
view === 'years' &&
|
|
7933
|
-
listOfYears.map(function (row, index) {
|
|
7934
|
-
return (React$1.createElement("tr", { key: index }, row.map(function (year, idx) {
|
|
7935
|
-
return (React$1.createElement("td", { key: idx, className: "calendar-cell year", onClick: function () {
|
|
7936
|
-
setCalendarDate(new Date(year, date.getMonth() - addMonths, date.getDate()));
|
|
7937
|
-
setView('months');
|
|
7938
|
-
} },
|
|
7939
|
-
React$1.createElement("div", { className: "calendar-cell-inner" }, new Date(year, 0, 1).toLocaleDateString(locale, { year: 'numeric' }))));
|
|
7940
|
-
})));
|
|
7941
|
-
}))));
|
|
7942
|
-
};
|
|
7943
|
-
var Navigation = function (props) {
|
|
7944
|
-
var addMonths = props.addMonths;
|
|
7945
|
-
var date = _calendarDate;
|
|
7946
|
-
if (addMonths !== 0) {
|
|
7947
|
-
date = new Date(_calendarDate.getFullYear(), _calendarDate.getMonth() + addMonths, 1);
|
|
7948
|
-
}
|
|
7949
|
-
return (React$1.createElement("div", { className: "calendar-nav" },
|
|
7950
|
-
navigation && (React$1.createElement("div", { className: "calendar-nav-prev" },
|
|
7951
|
-
React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return handleNavigationOnClick('prev', true); } }, navPrevDoubleIcon ? (navPrevDoubleIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-double-prev" }))),
|
|
7952
|
-
view === 'days' && (React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return handleNavigationOnClick('prev'); } }, navPrevIcon ? (navPrevIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-prev" })))))),
|
|
7953
|
-
React$1.createElement("div", __assign$1({ className: "calendar-nav-date" }, (navYearFirst && { style: { display: 'flex', justifyContent: 'center' } })),
|
|
7954
|
-
view === 'days' && (React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return navigation && setView('months'); } }, date.toLocaleDateString(locale, { month: 'long' }))),
|
|
7955
|
-
React$1.createElement(CButton, __assign$1({ color: "transparent", size: "sm", onClick: function () { return navigation && setView('years'); } }, (navYearFirst && { style: { order: '-1' } })), date.toLocaleDateString(locale, { year: 'numeric' }))),
|
|
7956
|
-
navigation && (React$1.createElement("div", { className: "calendar-nav-next" },
|
|
7957
|
-
view === 'days' && (React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return handleNavigationOnClick('next'); } }, navNextIcon ? (navNextIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-next" })))),
|
|
7958
|
-
React$1.createElement(CButton, { color: "transparent", size: "sm", onClick: function () { return handleNavigationOnClick('next', true); } }, navNextDoubleIcon ? (navNextDoubleIcon) : (React$1.createElement("span", { className: "calendar-nav-icon calendar-nav-icon-double-next" })))))));
|
|
7959
|
-
};
|
|
7960
|
-
return (React$1.createElement("div", { className: classNames$1('calendars', className) }, Array.from({ length: calendars }, function (_, index) { return (React$1.createElement("div", { className: classNames$1('calendar', view), key: index, ref: ref },
|
|
7961
|
-
Navigation({ addMonths: index }),
|
|
7962
|
-
Calendar({ addMonths: index }))); })));
|
|
7289
|
+
return (React$1.createElement("div", { className: classNames$1('calendars', className) }, _calendarDate &&
|
|
7290
|
+
Array.from({ length: calendars }, function (_, index) { return (React$1.createElement("div", { className: classNames$1('calendar', view), key: index, ref: ref },
|
|
7291
|
+
React$1.createElement(Navigation, { addMonths: index, calendarDate: _calendarDate, locale: locale, navigation: navigation, navNextDoubleIcon: navNextDoubleIcon, navNextIcon: navNextIcon, navPrevDoubleIcon: navPrevDoubleIcon, navPrevIcon: navPrevIcon, navYearFirst: navYearFirst, onMonthClick: function () { return setView('months'); }, onNavigationClick: handleNavigationOnClick, onYearClick: function () { return setView('years'); }, view: view }),
|
|
7292
|
+
React$1.createElement(Calendar, { addMonths: index, calendarDate: _calendarDate, dayFormat: dayFormat, disabledDates: disabledDates, endDate: _endDate, firstDayOfWeek: firstDayOfWeek, hoverDate: _hoverDate, locale: locale, maxDate: _maxDate, minDate: _minDate, onCellClick: handleCellOnClick, onCellKeyDown: handleCellKeyDown, onCellMouseEnter: handleCellMouseEnter, onCellMouseLeave: handleCellMouseLeave, onMonthClick: function (month, view) {
|
|
7293
|
+
setCalendarPage(0, 0, month);
|
|
7294
|
+
setView(view);
|
|
7295
|
+
}, onYearClick: function (date, view) {
|
|
7296
|
+
setCalendarDate(date);
|
|
7297
|
+
setView(view);
|
|
7298
|
+
}, selectEndDate: _selectEndDate, startDate: _startDate, view: view, weekdayFormat: weekdayFormat }))); })));
|
|
7963
7299
|
});
|
|
7964
7300
|
CCalendar.propTypes = {
|
|
7965
7301
|
className: propTypesExports.string,
|
|
@@ -8131,15 +7467,16 @@ CFormText.displayName = 'CFormText';
|
|
|
8131
7467
|
|
|
8132
7468
|
var CFormControlWrapper = function (_a) {
|
|
8133
7469
|
var children = _a.children, describedby = _a.describedby, feedback = _a.feedback, feedbackInvalid = _a.feedbackInvalid, feedbackValid = _a.feedbackValid, floatingClassName = _a.floatingClassName, floatingLabel = _a.floatingLabel, id = _a.id, invalid = _a.invalid, label = _a.label, text = _a.text, tooltipFeedback = _a.tooltipFeedback, valid = _a.valid;
|
|
7470
|
+
var formControlValidation = function () { return (React$1.createElement(CFormControlValidation, { describedby: describedby, feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingLabel: floatingLabel, invalid: invalid, tooltipFeedback: tooltipFeedback, valid: valid })); };
|
|
8134
7471
|
return floatingLabel ? (React$1.createElement(CFormFloating, { className: floatingClassName },
|
|
8135
7472
|
children,
|
|
8136
7473
|
React$1.createElement(CFormLabel, { htmlFor: id }, label || floatingLabel),
|
|
8137
7474
|
text && React$1.createElement(CFormText, { id: describedby }, text),
|
|
8138
|
-
|
|
7475
|
+
formControlValidation())) : (React$1.createElement(React$1.Fragment, null,
|
|
8139
7476
|
label && React$1.createElement(CFormLabel, { htmlFor: id }, label),
|
|
8140
7477
|
children,
|
|
8141
7478
|
text && React$1.createElement(CFormText, { id: describedby }, text),
|
|
8142
|
-
|
|
7479
|
+
formControlValidation()));
|
|
8143
7480
|
};
|
|
8144
7481
|
CFormControlWrapper.propTypes = __assign$1({ children: propTypesExports.node, floatingClassName: propTypesExports.string, floatingLabel: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]), label: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]), text: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]) }, CFormControlValidation.propTypes);
|
|
8145
7482
|
CFormControlWrapper.displayName = 'CFormControlWrapper';
|
|
@@ -11003,46 +10340,34 @@ var getAmPm = function (date, locale) {
|
|
|
11003
10340
|
}
|
|
11004
10341
|
return date.getHours() >= 12 ? 'pm' : 'am';
|
|
11005
10342
|
};
|
|
11006
|
-
var
|
|
10343
|
+
var getLocalizedTimePartials = function (locale, ampm) {
|
|
11007
10344
|
if (ampm === void 0) { ampm = 'auto'; }
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
label: ((ampm === 'auto' && isAmPm(locale)) || ampm === true ? i + 1 : i).toLocaleString(locale),
|
|
11012
|
-
};
|
|
11013
|
-
});
|
|
11014
|
-
};
|
|
11015
|
-
var getListOfMinutes = function (locale, valueAsString) {
|
|
11016
|
-
if (valueAsString === void 0) { valueAsString = false; }
|
|
11017
|
-
return Array.from({ length: 60 }, function (_, i) {
|
|
11018
|
-
var d = new Date();
|
|
11019
|
-
d.setMinutes(i);
|
|
10345
|
+
var date = new Date();
|
|
10346
|
+
var hour12 = ['am', 'AM', 'pm', 'PM'].some(function (el) { return date.toLocaleString(locale).includes(el); });
|
|
10347
|
+
var listOfHours = Array.from({ length: (ampm === 'auto' && hour12) || ampm === true ? 12 : 24 }, function (_, i) {
|
|
11020
10348
|
return {
|
|
11021
|
-
value:
|
|
11022
|
-
label:
|
|
11023
|
-
.toLocaleTimeString(locale, {
|
|
11024
|
-
minute: '2-digit',
|
|
11025
|
-
second: '2-digit',
|
|
11026
|
-
})
|
|
11027
|
-
.split(/[^A-Za-z0-9]/)[0],
|
|
10349
|
+
value: (ampm === 'auto' && hour12) || ampm === true ? i + 1 : i,
|
|
10350
|
+
label: ((ampm === 'auto' && hour12) || ampm === true ? i + 1 : i).toLocaleString(locale),
|
|
11028
10351
|
};
|
|
11029
10352
|
});
|
|
11030
|
-
}
|
|
11031
|
-
|
|
11032
|
-
if (valueAsString === void 0) { valueAsString = false; }
|
|
11033
|
-
return Array.from({ length: 60 }, function (_, i) {
|
|
11034
|
-
var d = new Date();
|
|
11035
|
-
d.setSeconds(i);
|
|
10353
|
+
var listOfMinutesSeconds = Array.from({ length: 60 }, function (_, i) {
|
|
10354
|
+
date.setMinutes(i);
|
|
11036
10355
|
return {
|
|
11037
|
-
value:
|
|
11038
|
-
label:
|
|
10356
|
+
value: i,
|
|
10357
|
+
label: date
|
|
11039
10358
|
.toLocaleTimeString(locale, {
|
|
11040
10359
|
minute: '2-digit',
|
|
11041
10360
|
second: '2-digit',
|
|
11042
10361
|
})
|
|
11043
|
-
.split(/[^A-Za-z0-9]/)[
|
|
10362
|
+
.split(/[^A-Za-z0-9\u06F0-\u06F90-9]/)[0],
|
|
11044
10363
|
};
|
|
11045
10364
|
});
|
|
10365
|
+
return {
|
|
10366
|
+
listOfHours: listOfHours,
|
|
10367
|
+
listOfMinutes: listOfMinutesSeconds,
|
|
10368
|
+
listOfSeconds: listOfMinutesSeconds,
|
|
10369
|
+
hour12: hour12,
|
|
10370
|
+
};
|
|
11046
10371
|
};
|
|
11047
10372
|
var getSelectedHour = function (date, locale, ampm) {
|
|
11048
10373
|
if (ampm === void 0) { ampm = 'auto'; }
|
|
@@ -11070,13 +10395,22 @@ var CTimePicker = React$1.forwardRef(function (_a, ref) {
|
|
|
11070
10395
|
var _o = React$1.useState(null), initialDate = _o[0], setInitialDate = _o[1];
|
|
11071
10396
|
var _p = React$1.useState(date ? getAmPm(new Date(date), locale) : 'am'), _ampm = _p[0], setAmPm = _p[1];
|
|
11072
10397
|
var _q = React$1.useState(visible), _visible = _q[0], setVisible = _q[1];
|
|
10398
|
+
var _r = React$1.useState({
|
|
10399
|
+
listOfHours: [],
|
|
10400
|
+
listOfMinutes: [],
|
|
10401
|
+
listOfSeconds: [],
|
|
10402
|
+
hour12: false,
|
|
10403
|
+
}), localizedTimePartials = _r[0], setLocalizedTimePartials = _r[1];
|
|
10404
|
+
React$1.useEffect(function () {
|
|
10405
|
+
setLocalizedTimePartials(getLocalizedTimePartials(locale, ampm));
|
|
10406
|
+
}, [date]);
|
|
11073
10407
|
React$1.useEffect(function () {
|
|
11074
10408
|
setDate(convertTimeToDate(time));
|
|
11075
10409
|
}, [time]);
|
|
11076
10410
|
React$1.useEffect(function () {
|
|
11077
10411
|
if (inputRef.current) {
|
|
11078
10412
|
inputRef.current.value = date
|
|
11079
|
-
? date.toLocaleTimeString(locale, __assign$1({ hour12:
|
|
10413
|
+
? date.toLocaleTimeString(locale, __assign$1({ hour12: localizedTimePartials && localizedTimePartials.hour12 }, (!seconds && { timeStyle: 'short' })))
|
|
11080
10414
|
: '';
|
|
11081
10415
|
}
|
|
11082
10416
|
date && setAmPm(getAmPm(new Date(date), locale));
|
|
@@ -11097,7 +10431,7 @@ var CTimePicker = React$1.forwardRef(function (_a, ref) {
|
|
|
11097
10431
|
}
|
|
11098
10432
|
}
|
|
11099
10433
|
if (set === 'hours') {
|
|
11100
|
-
if (
|
|
10434
|
+
if (localizedTimePartials && localizedTimePartials.hour12) {
|
|
11101
10435
|
_date.setHours(convert12hTo24h(_ampm, parseInt(value)));
|
|
11102
10436
|
}
|
|
11103
10437
|
else {
|
|
@@ -11121,30 +10455,40 @@ var CTimePicker = React$1.forwardRef(function (_a, ref) {
|
|
|
11121
10455
|
indicator && (React$1.createElement("span", { className: "picker-input-group-indicator" }, typeof indicator === 'boolean' ? (React$1.createElement("span", { className: "picker-input-group-icon time-picker-input-icon" })) : (indicator))),
|
|
11122
10456
|
cleaner && date && (React$1.createElement("span", { className: "picker-input-group-cleaner", role: "button", onClick: function (event) { return handleClear(event); } }, typeof cleaner === 'boolean' ? (React$1.createElement("span", { className: "picker-input-group-icon time-picker-cleaner-icon" })) : (cleaner))))))); };
|
|
11123
10457
|
var TimePickerSelect = function () {
|
|
10458
|
+
var _a;
|
|
11124
10459
|
return (React$1.createElement(React$1.Fragment, null,
|
|
11125
10460
|
React$1.createElement("span", { className: "time-picker-inline-icon" }),
|
|
11126
|
-
React$1.createElement(CFormSelect, { disabled: disabled, options:
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
10461
|
+
React$1.createElement(CFormSelect, { disabled: disabled, options: localizedTimePartials &&
|
|
10462
|
+
((_a = localizedTimePartials.listOfHours) === null || _a === void 0 ? void 0 : _a.map(function (option) {
|
|
10463
|
+
return {
|
|
10464
|
+
value: option.value.toString(),
|
|
10465
|
+
label: option.label,
|
|
10466
|
+
};
|
|
10467
|
+
})), onChange: function (event) {
|
|
11132
10468
|
return handleTimeChange('hours', event.target.value);
|
|
11133
10469
|
}, value: getSelectedHour(date, locale) }),
|
|
11134
10470
|
React$1.createElement(React$1.Fragment, null, ":"),
|
|
11135
|
-
React$1.createElement(CFormSelect, { disabled: disabled,
|
|
11136
|
-
|
|
11137
|
-
|
|
10471
|
+
React$1.createElement(CFormSelect, { disabled: disabled, options: localizedTimePartials &&
|
|
10472
|
+
localizedTimePartials.listOfMinutes.map(function (option) {
|
|
10473
|
+
return {
|
|
10474
|
+
value: option.value.toString(),
|
|
10475
|
+
label: option.label,
|
|
10476
|
+
};
|
|
10477
|
+
}), onChange: function (event) {
|
|
11138
10478
|
return handleTimeChange('minutes', event.target.value);
|
|
11139
10479
|
}, value: getSelectedMinutes(date) }),
|
|
11140
10480
|
seconds && (React$1.createElement(React$1.Fragment, null,
|
|
11141
10481
|
React$1.createElement(React$1.Fragment, null, ":"),
|
|
11142
|
-
React$1.createElement(CFormSelect, { disabled: disabled,
|
|
11143
|
-
|
|
11144
|
-
|
|
10482
|
+
React$1.createElement(CFormSelect, { disabled: disabled, options: localizedTimePartials &&
|
|
10483
|
+
localizedTimePartials.listOfSeconds.map(function (option) {
|
|
10484
|
+
return {
|
|
10485
|
+
value: option.value.toString(),
|
|
10486
|
+
label: option.label,
|
|
10487
|
+
};
|
|
10488
|
+
}), onChange: function (event) {
|
|
11145
10489
|
return handleTimeChange('seconds', event.target.value);
|
|
11146
10490
|
}, value: getSelectedSeconds(date) }))),
|
|
11147
|
-
|
|
10491
|
+
localizedTimePartials && localizedTimePartials.hour12 && (React$1.createElement(CFormSelect, { disabled: disabled, options: [
|
|
11148
10492
|
{ value: 'am', label: 'AM' },
|
|
11149
10493
|
{ value: 'pm', label: 'PM' },
|
|
11150
10494
|
], onChange: function (event) {
|
|
@@ -11152,10 +10496,10 @@ var CTimePicker = React$1.forwardRef(function (_a, ref) {
|
|
|
11152
10496
|
}, value: _ampm }))));
|
|
11153
10497
|
};
|
|
11154
10498
|
var TimePickerRoll = function () { return (React$1.createElement(React$1.Fragment, null,
|
|
11155
|
-
React$1.createElement(CTimePickerRollCol, { elements:
|
|
11156
|
-
React$1.createElement(CTimePickerRollCol, { elements:
|
|
11157
|
-
seconds && (React$1.createElement(CTimePickerRollCol, { elements:
|
|
11158
|
-
|
|
10499
|
+
React$1.createElement(CTimePickerRollCol, { elements: localizedTimePartials && localizedTimePartials.listOfHours, onClick: function (index) { return handleTimeChange('hours', index.toString()); }, selected: getSelectedHour(date, locale, ampm) }),
|
|
10500
|
+
React$1.createElement(CTimePickerRollCol, { elements: localizedTimePartials && localizedTimePartials.listOfMinutes, onClick: function (index) { return handleTimeChange('minutes', index.toString()); }, selected: getSelectedMinutes(date) }),
|
|
10501
|
+
seconds && (React$1.createElement(CTimePickerRollCol, { elements: localizedTimePartials && localizedTimePartials.listOfSeconds, onClick: function (index) { return handleTimeChange('seconds', index.toString()); }, selected: getSelectedSeconds(date) })),
|
|
10502
|
+
localizedTimePartials && localizedTimePartials.hour12 && (React$1.createElement(CTimePickerRollCol, { elements: [
|
|
11159
10503
|
{ value: 'am', label: 'AM' },
|
|
11160
10504
|
{ value: 'pm', label: 'PM' },
|
|
11161
10505
|
], onClick: function (value) { return handleTimeChange('toggle', value); }, selected: _ampm })))); };
|
|
@@ -11404,6 +10748,73 @@ CDropdownItemPlain.propTypes = {
|
|
|
11404
10748
|
};
|
|
11405
10749
|
CDropdownItemPlain.displayName = 'CDropdownItemPlain';
|
|
11406
10750
|
|
|
10751
|
+
var CSpinner = React$1.forwardRef(function (_a, ref) {
|
|
10752
|
+
var className = _a.className, color = _a.color, _b = _a.component, Component = _b === void 0 ? 'div' : _b, size = _a.size, _c = _a.variant, variant = _c === void 0 ? 'border' : _c, _d = _a.visuallyHiddenLabel, visuallyHiddenLabel = _d === void 0 ? 'Loading...' : _d, rest = __rest$1(_a, ["className", "color", "component", "size", "variant", "visuallyHiddenLabel"]);
|
|
10753
|
+
var _className = classNames$1("spinner-".concat(variant), "text-".concat(color), size && "spinner-".concat(variant, "-").concat(size), className);
|
|
10754
|
+
return (React$1.createElement(Component, __assign$1({ className: _className, role: "status" }, rest, { ref: ref }),
|
|
10755
|
+
React$1.createElement("span", { className: "visually-hidden" }, visuallyHiddenLabel)));
|
|
10756
|
+
});
|
|
10757
|
+
CSpinner.propTypes = {
|
|
10758
|
+
className: propTypesExports.string,
|
|
10759
|
+
color: colorPropType,
|
|
10760
|
+
component: propTypesExports.string,
|
|
10761
|
+
size: propTypesExports.oneOf(['sm']),
|
|
10762
|
+
variant: propTypesExports.oneOf(['border', 'grow']),
|
|
10763
|
+
visuallyHiddenLabel: propTypesExports.string,
|
|
10764
|
+
};
|
|
10765
|
+
CSpinner.displayName = 'CSpinner';
|
|
10766
|
+
|
|
10767
|
+
var CElementCover = React$1.forwardRef(function (_a, ref) {
|
|
10768
|
+
var children = _a.children, className = _a.className, boundaries = _a.boundaries, _b = _a.opacity, opacity = _b === void 0 ? 0.4 : _b, rest = __rest$1(_a, ["children", "className", "boundaries", "opacity"]);
|
|
10769
|
+
var elementCoverRef = React$1.useRef(null);
|
|
10770
|
+
var forkedRef = useForkedRef(ref, elementCoverRef);
|
|
10771
|
+
var _c = React$1.useState({}), customBoundaries = _c[0], setCustomBoundaries = _c[1];
|
|
10772
|
+
var getCustomBoundaries = function () {
|
|
10773
|
+
if (!elementCoverRef || !elementCoverRef.current || !boundaries) {
|
|
10774
|
+
return {};
|
|
10775
|
+
}
|
|
10776
|
+
var parent = elementCoverRef.current.parentElement;
|
|
10777
|
+
if (!parent) {
|
|
10778
|
+
return {};
|
|
10779
|
+
}
|
|
10780
|
+
var parentCoords = parent.getBoundingClientRect();
|
|
10781
|
+
var customBoundaries = {};
|
|
10782
|
+
boundaries.forEach(function (_a) {
|
|
10783
|
+
var sides = _a.sides, query = _a.query;
|
|
10784
|
+
var element = parent.querySelector(query);
|
|
10785
|
+
if (!element || !sides) {
|
|
10786
|
+
return;
|
|
10787
|
+
}
|
|
10788
|
+
var coords = element.getBoundingClientRect();
|
|
10789
|
+
sides.forEach(function (side) {
|
|
10790
|
+
var sideMargin = Math.abs(coords[side] - parentCoords[side]);
|
|
10791
|
+
customBoundaries[side] = "".concat(sideMargin, "px");
|
|
10792
|
+
});
|
|
10793
|
+
});
|
|
10794
|
+
return customBoundaries;
|
|
10795
|
+
};
|
|
10796
|
+
React$1.useEffect(function () {
|
|
10797
|
+
setCustomBoundaries(getCustomBoundaries());
|
|
10798
|
+
}, [JSON.stringify(getCustomBoundaries())]);
|
|
10799
|
+
var classes = classNames$1(className);
|
|
10800
|
+
var containerCoords = __assign$1({ top: 0, left: 0, right: 0, bottom: 0 }, customBoundaries);
|
|
10801
|
+
var coverStyles = __assign$1(__assign$1({}, containerCoords), { position: 'absolute', backgroundColor: "rgba(255,255,255,".concat(opacity, ")") });
|
|
10802
|
+
return (React$1.createElement("div", __assign$1({ className: classes, style: coverStyles }, rest, { ref: forkedRef }),
|
|
10803
|
+
React$1.createElement("div", { style: {
|
|
10804
|
+
position: 'absolute',
|
|
10805
|
+
top: '50%',
|
|
10806
|
+
left: '50%',
|
|
10807
|
+
transform: 'translateX(-50%) translateY(-50%)',
|
|
10808
|
+
} }, children || React$1.createElement(CSpinner, { variant: "grow", color: "primary" }))));
|
|
10809
|
+
});
|
|
10810
|
+
CElementCover.propTypes = {
|
|
10811
|
+
boundaries: propTypesExports.array,
|
|
10812
|
+
children: propTypesExports.node,
|
|
10813
|
+
className: propTypesExports.string,
|
|
10814
|
+
opacity: propTypesExports.number,
|
|
10815
|
+
};
|
|
10816
|
+
CElementCover.displayName = 'CElementCover';
|
|
10817
|
+
|
|
11407
10818
|
var CFooter = React$1.forwardRef(function (_a, ref) {
|
|
11408
10819
|
var _b;
|
|
11409
10820
|
var children = _a.children, className = _a.className, position = _a.position, rest = __rest$1(_a, ["children", "className", "position"]);
|
|
@@ -11479,6 +10890,10 @@ CCol.propTypes = {
|
|
|
11479
10890
|
className: propTypesExports.string,
|
|
11480
10891
|
xs: col,
|
|
11481
10892
|
sm: col,
|
|
10893
|
+
md: col,
|
|
10894
|
+
lg: col,
|
|
10895
|
+
xl: col,
|
|
10896
|
+
xxl: col,
|
|
11482
10897
|
};
|
|
11483
10898
|
CCol.displayName = 'CCol';
|
|
11484
10899
|
|
|
@@ -11727,22 +11142,6 @@ CListGroupItem.propTypes = {
|
|
|
11727
11142
|
};
|
|
11728
11143
|
CListGroupItem.displayName = 'CListGroupItem';
|
|
11729
11144
|
|
|
11730
|
-
var CSpinner = React$1.forwardRef(function (_a, ref) {
|
|
11731
|
-
var className = _a.className, color = _a.color, _b = _a.component, Component = _b === void 0 ? 'div' : _b, size = _a.size, _c = _a.variant, variant = _c === void 0 ? 'border' : _c, _d = _a.visuallyHiddenLabel, visuallyHiddenLabel = _d === void 0 ? 'Loading...' : _d, rest = __rest$1(_a, ["className", "color", "component", "size", "variant", "visuallyHiddenLabel"]);
|
|
11732
|
-
var _className = classNames$1("spinner-".concat(variant), "text-".concat(color), size && "spinner-".concat(variant, "-").concat(size), className);
|
|
11733
|
-
return (React$1.createElement(Component, __assign$1({ className: _className, role: "status" }, rest, { ref: ref }),
|
|
11734
|
-
React$1.createElement("span", { className: "visually-hidden" }, visuallyHiddenLabel)));
|
|
11735
|
-
});
|
|
11736
|
-
CSpinner.propTypes = {
|
|
11737
|
-
className: propTypesExports.string,
|
|
11738
|
-
color: colorPropType,
|
|
11739
|
-
component: propTypesExports.string,
|
|
11740
|
-
size: propTypesExports.oneOf(['sm']),
|
|
11741
|
-
variant: propTypesExports.oneOf(['border', 'grow']),
|
|
11742
|
-
visuallyHiddenLabel: propTypesExports.string,
|
|
11743
|
-
};
|
|
11744
|
-
CSpinner.displayName = 'CSpinner';
|
|
11745
|
-
|
|
11746
11145
|
var CLoadingButton = React$1.forwardRef(function (_a, ref) {
|
|
11747
11146
|
var children = _a.children, className = _a.className, disabledOnLoading = _a.disabledOnLoading, loading = _a.loading, onClick = _a.onClick, _b = _a.spinnerType, spinnerType = _b === void 0 ? 'border' : _b, timeout = _a.timeout, rest = __rest$1(_a, ["children", "className", "disabledOnLoading", "loading", "onClick", "spinnerType", "timeout"]);
|
|
11748
11147
|
var _c = React$1.useState(), _loading = _c[0], setLoading = _c[1];
|
|
@@ -11904,7 +11303,7 @@ var CModal = React$1.forwardRef(function (_a, ref) {
|
|
|
11904
11303
|
React$1.createElement(CModalContent, __assign$1({}, rest, { ref: modalContentRef }), children)))));
|
|
11905
11304
|
};
|
|
11906
11305
|
return (React$1.createElement(React$1.Fragment, null,
|
|
11907
|
-
React$1.createElement(Transition, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
|
|
11306
|
+
React$1.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: modalRef, onEnter: onShow, onExit: onClose, unmountOnExit: unmountOnClose, timeout: !transition ? 0 : duration }, function (state) {
|
|
11908
11307
|
var transitionClass = getTransitionClass(state);
|
|
11909
11308
|
return typeof window !== 'undefined' && portal
|
|
11910
11309
|
? ReactDOM.createPortal(modal(forkedRef, transitionClass), document.body)
|
|
@@ -12417,7 +11816,7 @@ var CNavGroup = React$1.forwardRef(function (_a, ref) {
|
|
|
12417
11816
|
var _className = classNames$1('nav-group', { show: _visible }, className);
|
|
12418
11817
|
return (React$1.createElement("li", __assign$1({ className: _className }, rest, { ref: ref }),
|
|
12419
11818
|
toggler && (React$1.createElement("a", { className: "nav-link nav-group-toggle", onClick: function (event) { return handleTogglerOnCLick(event); } }, toggler)),
|
|
12420
|
-
React$1.createElement(Transition, { in: _visible, nodeRef: navItemsRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React$1.createElement("ul", { className: classNames$1('nav-group-items', {
|
|
11819
|
+
React$1.createElement(Transition$1, { in: _visible, nodeRef: navItemsRef, onEntering: onEntering, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited, timeout: 300 }, function (state) { return (React$1.createElement("ul", { className: classNames$1('nav-group-items', {
|
|
12421
11820
|
compact: compact,
|
|
12422
11821
|
}), style: __assign$1(__assign$1({}, style), transitionStyles[state]), ref: navItemsRef }, React$1.Children.map(children, function (child, index) {
|
|
12423
11822
|
if (React$1.isValidElement(child)) {
|
|
@@ -12575,8 +11974,8 @@ CNavbarToggler.displayName = 'CNavbarToggler';
|
|
|
12575
11974
|
|
|
12576
11975
|
var COffcanvas = React$1.forwardRef(function (_a, ref) {
|
|
12577
11976
|
var _b;
|
|
12578
|
-
var children = _a.children, _c = _a.backdrop, backdrop = _c === void 0 ? true : _c, className = _a.className, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _e = _a.portal, portal = _e === void 0 ?
|
|
12579
|
-
var
|
|
11977
|
+
var children = _a.children, _c = _a.backdrop, backdrop = _c === void 0 ? true : _c, className = _a.className, _d = _a.keyboard, keyboard = _d === void 0 ? true : _d, onHide = _a.onHide, onShow = _a.onShow, placement = _a.placement, _e = _a.portal, portal = _e === void 0 ? false : _e, _f = _a.responsive, responsive = _f === void 0 ? true : _f, _g = _a.scroll, scroll = _g === void 0 ? false : _g, _h = _a.visible, visible = _h === void 0 ? false : _h, rest = __rest$1(_a, ["children", "backdrop", "className", "keyboard", "onHide", "onShow", "placement", "portal", "responsive", "scroll", "visible"]);
|
|
11978
|
+
var _j = React$1.useState(visible), _visible = _j[0], setVisible = _j[1];
|
|
12580
11979
|
var offcanvasRef = React$1.useRef(null);
|
|
12581
11980
|
var forkedRef = useForkedRef(ref, offcanvasRef);
|
|
12582
11981
|
React$1.useEffect(function () {
|
|
@@ -12595,19 +11994,27 @@ var COffcanvas = React$1.forwardRef(function (_a, ref) {
|
|
|
12595
11994
|
document.body.style.removeProperty('padding-right');
|
|
12596
11995
|
}
|
|
12597
11996
|
}, [_visible]);
|
|
12598
|
-
var
|
|
11997
|
+
var getTransitionClass = function (state) {
|
|
11998
|
+
return state === 'entering'
|
|
11999
|
+
? 'showing'
|
|
12000
|
+
: state === 'entered'
|
|
12001
|
+
? 'show'
|
|
12002
|
+
: state === 'exiting'
|
|
12003
|
+
? 'show hiding'
|
|
12004
|
+
: '';
|
|
12005
|
+
};
|
|
12006
|
+
var _className = classNames$1((_b = {},
|
|
12007
|
+
_b["offcanvas".concat(typeof responsive !== 'boolean' ? '-' + responsive : '')] = responsive,
|
|
12599
12008
|
_b["offcanvas-".concat(placement)] = placement,
|
|
12600
|
-
_b.show = _visible,
|
|
12601
12009
|
_b), className);
|
|
12602
|
-
var transitionStyles = {
|
|
12603
|
-
entering: { visibility: 'visible' },
|
|
12604
|
-
entered: { visibility: 'visible' },
|
|
12605
|
-
exiting: { visibility: 'visible' },
|
|
12606
|
-
exited: { visibility: 'hidden' },
|
|
12607
|
-
};
|
|
12608
12010
|
var handleDismiss = function () {
|
|
12609
12011
|
setVisible(false);
|
|
12610
12012
|
};
|
|
12013
|
+
var handleBackdropDismiss = function () {
|
|
12014
|
+
if (backdrop !== 'static') {
|
|
12015
|
+
setVisible(false);
|
|
12016
|
+
}
|
|
12017
|
+
};
|
|
12611
12018
|
var handleKeyDown = React$1.useCallback(function (event) {
|
|
12612
12019
|
if (event.key === 'Escape' && keyboard) {
|
|
12613
12020
|
return handleDismiss();
|
|
@@ -12615,21 +12022,21 @@ var COffcanvas = React$1.forwardRef(function (_a, ref) {
|
|
|
12615
12022
|
}, [ref, handleDismiss]);
|
|
12616
12023
|
var offcanvas = function (ref, state) {
|
|
12617
12024
|
return (React$1.createElement(React$1.Fragment, null,
|
|
12618
|
-
React$1.createElement("div", __assign$1({ className: _className, role: "dialog",
|
|
12025
|
+
React$1.createElement("div", __assign$1({ className: classNames$1(_className, getTransitionClass(state)), role: "dialog", tabIndex: -1, onKeyDown: handleKeyDown }, rest, { ref: ref }), children)));
|
|
12619
12026
|
};
|
|
12620
12027
|
return (React$1.createElement(React$1.Fragment, null,
|
|
12621
|
-
React$1.createElement(Transition, { in: _visible, nodeRef: offcanvasRef, onEnter: onShow, onEntered: function () { var _a; return (_a = offcanvasRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, onExit: onHide, timeout: 300 }, function (state) {
|
|
12028
|
+
React$1.createElement(Transition$1, { in: _visible, nodeRef: offcanvasRef, onEnter: onShow, onEntered: function () { var _a; return (_a = offcanvasRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, onExit: onHide, timeout: 300 }, function (state) {
|
|
12622
12029
|
return typeof window !== 'undefined' && portal
|
|
12623
12030
|
? ReactDOM.createPortal(offcanvas(forkedRef, state), document.body)
|
|
12624
12031
|
: offcanvas(forkedRef, state);
|
|
12625
12032
|
}),
|
|
12626
12033
|
typeof window !== 'undefined' && portal
|
|
12627
12034
|
? backdrop &&
|
|
12628
|
-
ReactDOM.createPortal(React$1.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick:
|
|
12629
|
-
: backdrop && (React$1.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick:
|
|
12035
|
+
ReactDOM.createPortal(React$1.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleBackdropDismiss, visible: _visible }), document.body)
|
|
12036
|
+
: backdrop && (React$1.createElement(CBackdrop, { className: "offcanvas-backdrop", onClick: handleBackdropDismiss, visible: _visible }))));
|
|
12630
12037
|
});
|
|
12631
12038
|
COffcanvas.propTypes = {
|
|
12632
|
-
backdrop: propTypesExports.bool,
|
|
12039
|
+
backdrop: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.oneOf(['static'])]),
|
|
12633
12040
|
children: propTypesExports.node,
|
|
12634
12041
|
className: propTypesExports.string,
|
|
12635
12042
|
keyboard: propTypesExports.bool,
|
|
@@ -12638,6 +12045,10 @@ COffcanvas.propTypes = {
|
|
|
12638
12045
|
placement: propTypesExports.oneOf(['start', 'end', 'top', 'bottom'])
|
|
12639
12046
|
.isRequired,
|
|
12640
12047
|
portal: propTypesExports.bool,
|
|
12048
|
+
responsive: propTypesExports.oneOfType([
|
|
12049
|
+
propTypesExports.bool,
|
|
12050
|
+
propTypesExports.oneOf(['sm', 'md', 'lg', 'xl', 'xxl']),
|
|
12051
|
+
]),
|
|
12641
12052
|
scroll: propTypesExports.bool,
|
|
12642
12053
|
visible: propTypesExports.bool,
|
|
12643
12054
|
};
|
|
@@ -12830,7 +12241,7 @@ var CPopover = function (_a) {
|
|
|
12830
12241
|
onMouseLeave: function () { return setVisible(false); },
|
|
12831
12242
|
}))),
|
|
12832
12243
|
typeof window !== 'undefined' &&
|
|
12833
|
-
ReactDOM.createPortal(React$1.createElement(Transition, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
12244
|
+
ReactDOM.createPortal(React$1.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: popoverRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
12834
12245
|
enter: 0,
|
|
12835
12246
|
exit: 200,
|
|
12836
12247
|
}, unmountOnExit: true }, function (state) {
|
|
@@ -12855,438 +12266,51 @@ CPopover.propTypes = {
|
|
|
12855
12266
|
};
|
|
12856
12267
|
CPopover.displayName = 'CPopover';
|
|
12857
12268
|
|
|
12858
|
-
|
|
12269
|
+
var cilArrowBottom = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='367.997 338.75 271.999 434.747 271.999 17.503 239.999 17.503 239.999 434.745 144.003 338.75 121.376 361.377 256 496 390.624 361.377 367.997 338.75' class='ci-primary'/>"];
|
|
12859
12270
|
|
|
12860
|
-
|
|
12271
|
+
var cilArrowTop = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='390.624 150.625 256 16 121.376 150.625 144.004 173.252 240.001 77.254 240.001 495.236 272.001 495.236 272.001 77.257 367.996 173.252 390.624 150.625' class='ci-primary'/>"];
|
|
12861
12272
|
|
|
12862
|
-
|
|
12273
|
+
var cilFilterX = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='40 16 40 53.828 109.024 136 150.815 136 76.896 48 459.51 48 304 242.388 304 401.373 241.373 464 240 464 240 368 208 368 208 496 254.627 496 336 414.627 336 253.612 496 53.612 496 16 40 16' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='166.403 248.225 226.864 187.763 204.237 165.135 143.775 225.597 83.313 165.135 60.687 187.763 121.148 248.225 60.687 308.687 83.313 331.314 143.775 270.852 204.237 331.314 226.864 308.687 166.403 248.225' class='ci-primary'/>"];
|
|
12863
12274
|
|
|
12864
|
-
|
|
12275
|
+
var cilSwapVertical = ["512 512", "<polygon fill='var(--ci-primary-color, currentColor)' points='384 433.373 384 160 352 160 352 434.51 282.177 364.687 259.55 387.313 367.432 495.196 475.313 387.313 452.687 364.687 384 433.373' class='ci-primary'/><polygon fill='var(--ci-primary-color, currentColor)' points='159.432 17.372 51.55 125.255 74.177 147.882 144 78.059 144 352 176 352 176 79.195 244.687 147.882 267.313 125.255 159.432 17.372' class='ci-primary'/>"];
|
|
12865
12276
|
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12875
|
-
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
position: 'absolute',
|
|
12904
|
-
top: '50%',
|
|
12905
|
-
left: '50%',
|
|
12906
|
-
transform: 'translateX(-50%) translateY(-50%)',
|
|
12907
|
-
} },
|
|
12908
|
-
React$1.createElement(CSpinner, { variant: "grow", color: "primary" })))));
|
|
12909
|
-
});
|
|
12910
|
-
CElementCover.propTypes = {
|
|
12911
|
-
boundaries: propTypesExports.array,
|
|
12912
|
-
children: propTypesExports.node,
|
|
12913
|
-
className: propTypesExports.string,
|
|
12914
|
-
opacity: propTypesExports.number,
|
|
12915
|
-
};
|
|
12916
|
-
CElementCover.displayName = 'CElementCover';
|
|
12917
|
-
|
|
12918
|
-
var CSmartPagination = React$1.forwardRef(function (_a, ref) {
|
|
12919
|
-
var className = _a.className, _b = _a.activePage, activePage = _b === void 0 ? 1 : _b, _c = _a.align, align = _c === void 0 ? 'start' : _c, _d = _a.arrows, arrows = _d === void 0 ? true : _d, _e = _a.dots, dots = _e === void 0 ? true : _e, _f = _a.doubleArrows, doubleArrows = _f === void 0 ? true : _f, _g = _a.firstButton, firstButton = _g === void 0 ? React$1.createElement(React$1.Fragment, null, "\u00AB") : _g, _h = _a.lastButton, lastButton = _h === void 0 ? React$1.createElement(React$1.Fragment, null, "\u00BB") : _h, _j = _a.limit, limit = _j === void 0 ? 5 : _j, _k = _a.nextButton, nextButton = _k === void 0 ? React$1.createElement(React$1.Fragment, null, "\u203A") : _k, onActivePageChange = _a.onActivePageChange, pages = _a.pages, _l = _a.previousButton, previousButton = _l === void 0 ? React$1.createElement(React$1.Fragment, null, "\u2039") : _l, size = _a.size, rest = __rest$1(_a, ["className", "activePage", "align", "arrows", "dots", "doubleArrows", "firstButton", "lastButton", "limit", "nextButton", "onActivePageChange", "pages", "previousButton", "size"]);
|
|
12920
|
-
var _classNames = classNames$1("justify-content-".concat(align), className);
|
|
12921
|
-
var showDots = (function () {
|
|
12922
|
-
return dots && limit > 4 && limit < pages;
|
|
12923
|
-
})();
|
|
12924
|
-
var maxPrevItems = (function () {
|
|
12925
|
-
return Math.floor((limit - 1) / 2);
|
|
12926
|
-
})();
|
|
12927
|
-
var maxNextItems = (function () {
|
|
12928
|
-
return Math.ceil((limit - 1) / 2);
|
|
12929
|
-
})();
|
|
12930
|
-
var beforeDots = (function () {
|
|
12931
|
-
return showDots && activePage > maxPrevItems + 1;
|
|
12932
|
-
})();
|
|
12933
|
-
var afterDots = (function () {
|
|
12934
|
-
return showDots && activePage < pages - maxNextItems;
|
|
12935
|
-
})();
|
|
12936
|
-
var computedLimit = (function () {
|
|
12937
|
-
return limit - (afterDots ? 1 : 0) - (beforeDots ? 1 : 0);
|
|
12938
|
-
})();
|
|
12939
|
-
var range = (function () {
|
|
12940
|
-
return activePage + maxNextItems;
|
|
12941
|
-
})();
|
|
12942
|
-
var lastItem = (function () {
|
|
12943
|
-
return range >= pages ? pages : range - (afterDots ? 1 : 0);
|
|
12944
|
-
})();
|
|
12945
|
-
var itemsAmount = (function () {
|
|
12946
|
-
return pages < computedLimit ? pages : computedLimit;
|
|
12947
|
-
})();
|
|
12948
|
-
var items = (function () {
|
|
12949
|
-
if (activePage - maxPrevItems <= 1) {
|
|
12950
|
-
return Array.from({
|
|
12951
|
-
length: itemsAmount,
|
|
12952
|
-
}, function (_v, i) { return i + 1; });
|
|
12953
|
-
}
|
|
12954
|
-
else {
|
|
12955
|
-
return Array.from({
|
|
12956
|
-
length: itemsAmount,
|
|
12957
|
-
}, function (_v, i) {
|
|
12958
|
-
return lastItem - i;
|
|
12959
|
-
}).reverse();
|
|
12960
|
-
}
|
|
12961
|
-
})();
|
|
12962
|
-
var setPage = function (number) {
|
|
12963
|
-
if (number !== activePage) {
|
|
12964
|
-
onActivePageChange && onActivePageChange(number);
|
|
12965
|
-
}
|
|
12966
|
-
};
|
|
12967
|
-
return (React$1.createElement(CPagination, __assign$1({ className: _classNames, "aria-label": "pagination", size: size }, rest, { ref: ref }),
|
|
12968
|
-
doubleArrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(1); }, "aria-label": "Go to first page", "aria-disabled": activePage === 1, disabled: activePage === 1 }, firstButton)),
|
|
12969
|
-
arrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(activePage - 1); }, "aria-label": "Go to previous page", "aria-disabled": activePage === 1, disabled: activePage === 1 }, previousButton)),
|
|
12970
|
-
beforeDots && (React$1.createElement(CPaginationItem, { role: "separator", disabled: true }, "\u2026")),
|
|
12971
|
-
items.map(function (i) {
|
|
12972
|
-
return (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(i); }, "aria-label": activePage === i ? "Current page ".concat(i) : "Go to page ".concat(i), active: activePage === i, key: i }, i));
|
|
12973
|
-
}),
|
|
12974
|
-
afterDots && (React$1.createElement(CPaginationItem, { role: "separator", disabled: true }, "\u2026")),
|
|
12975
|
-
arrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(activePage + 1); }, "aria-label": "Go to next page", "aria-disabled": activePage === pages, disabled: activePage === pages }, nextButton)),
|
|
12976
|
-
doubleArrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(pages); }, "aria-label": "Go to last page", "aria-disabled": activePage === pages, disabled: activePage === pages }, lastButton))));
|
|
12977
|
-
});
|
|
12978
|
-
CSmartPagination.propTypes = {
|
|
12979
|
-
className: propTypesExports.oneOfType([propTypesExports.string]),
|
|
12980
|
-
activePage: propTypesExports.number,
|
|
12981
|
-
dots: propTypesExports.bool,
|
|
12982
|
-
arrows: propTypesExports.bool,
|
|
12983
|
-
doubleArrows: propTypesExports.bool,
|
|
12984
|
-
firstButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
12985
|
-
previousButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
12986
|
-
nextButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
12987
|
-
lastButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
12988
|
-
size: propTypesExports.oneOf(['sm', 'lg']),
|
|
12989
|
-
align: propTypesExports.oneOf(['start', 'center', 'end']),
|
|
12990
|
-
limit: propTypesExports.number,
|
|
12991
|
-
pages: propTypesExports.number.isRequired,
|
|
12992
|
-
onActivePageChange: propTypesExports.func,
|
|
12993
|
-
};
|
|
12994
|
-
CSmartPagination.displayName = 'CSmartPagination';
|
|
12995
|
-
|
|
12996
|
-
var CTableHead = React$1.forwardRef(function (_a, ref) {
|
|
12997
|
-
var _b;
|
|
12998
|
-
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
12999
|
-
var _className = classNames$1((_b = {},
|
|
13000
|
-
_b["table-".concat(color)] = color,
|
|
13001
|
-
_b), className);
|
|
13002
|
-
return (React$1.createElement("thead", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13003
|
-
});
|
|
13004
|
-
CTableHead.propTypes = {
|
|
13005
|
-
children: propTypesExports.node,
|
|
13006
|
-
className: propTypesExports.string,
|
|
13007
|
-
color: colorPropType,
|
|
13008
|
-
};
|
|
13009
|
-
CTableHead.displayName = 'CTableHead';
|
|
13010
|
-
|
|
13011
|
-
var CTableHeaderCell = React$1.forwardRef(function (_a, ref) {
|
|
13012
|
-
var _b;
|
|
13013
|
-
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13014
|
-
var _className = classNames$1((_b = {},
|
|
13015
|
-
_b["table-".concat(color)] = color,
|
|
13016
|
-
_b), className);
|
|
13017
|
-
return (React$1.createElement("th", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13018
|
-
});
|
|
13019
|
-
CTableHeaderCell.propTypes = {
|
|
13020
|
-
children: propTypesExports.node,
|
|
13021
|
-
className: propTypesExports.string,
|
|
13022
|
-
color: colorPropType,
|
|
13023
|
-
};
|
|
13024
|
-
CTableHeaderCell.displayName = 'CTableHeaderCell';
|
|
13025
|
-
|
|
13026
|
-
var CTableBody = React$1.forwardRef(function (_a, ref) {
|
|
13027
|
-
var _b;
|
|
13028
|
-
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13029
|
-
var _className = classNames$1((_b = {},
|
|
13030
|
-
_b["table-".concat(color)] = color,
|
|
13031
|
-
_b), className);
|
|
13032
|
-
return (React$1.createElement("tbody", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13033
|
-
});
|
|
13034
|
-
CTableBody.propTypes = {
|
|
13035
|
-
children: propTypesExports.node,
|
|
13036
|
-
className: propTypesExports.string,
|
|
13037
|
-
color: colorPropType,
|
|
13038
|
-
};
|
|
13039
|
-
CTableBody.displayName = 'CTableBody';
|
|
13040
|
-
|
|
13041
|
-
var CTableDataCell = React$1.forwardRef(function (_a, ref) {
|
|
13042
|
-
var _b;
|
|
13043
|
-
var children = _a.children, active = _a.active, align = _a.align, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "active", "align", "className", "color"]);
|
|
13044
|
-
var _className = classNames$1((_b = {},
|
|
13045
|
-
_b["align-".concat(align)] = align,
|
|
13046
|
-
_b['table-active'] = active,
|
|
13047
|
-
_b["table-".concat(color)] = color,
|
|
13048
|
-
_b), className);
|
|
13049
|
-
var Component = rest.scope ? 'th' : 'td';
|
|
13050
|
-
return (React$1.createElement(Component, __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13051
|
-
});
|
|
13052
|
-
CTableDataCell.propTypes = {
|
|
13053
|
-
active: propTypesExports.bool,
|
|
13054
|
-
align: propTypesExports.oneOf(['bottom', 'middle', 'top']),
|
|
13055
|
-
children: propTypesExports.node,
|
|
13056
|
-
className: propTypesExports.string,
|
|
13057
|
-
color: colorPropType,
|
|
13058
|
-
};
|
|
13059
|
-
CTableDataCell.displayName = 'CTableDataCell';
|
|
13060
|
-
|
|
13061
|
-
var CTableRow = React$1.forwardRef(function (_a, ref) {
|
|
13062
|
-
var _b;
|
|
13063
|
-
var children = _a.children, active = _a.active, align = _a.align, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "active", "align", "className", "color"]);
|
|
13064
|
-
var _className = classNames$1((_b = {},
|
|
13065
|
-
_b["align-".concat(align)] = align,
|
|
13066
|
-
_b['table-active'] = active,
|
|
13067
|
-
_b["table-".concat(color)] = color,
|
|
13068
|
-
_b), className);
|
|
13069
|
-
return (React$1.createElement("tr", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13070
|
-
});
|
|
13071
|
-
CTableRow.propTypes = {
|
|
13072
|
-
active: propTypesExports.bool,
|
|
13073
|
-
align: propTypesExports.oneOf(['bottom', 'middle', 'top']),
|
|
13074
|
-
children: propTypesExports.node,
|
|
13075
|
-
className: propTypesExports.string,
|
|
13076
|
-
color: colorPropType,
|
|
13077
|
-
};
|
|
13078
|
-
CTableRow.displayName = 'CTableRow';
|
|
13079
|
-
|
|
13080
|
-
var CTableFoot = React$1.forwardRef(function (_a, ref) {
|
|
13081
|
-
var _b;
|
|
13082
|
-
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13083
|
-
var _className = classNames$1((_b = {},
|
|
13084
|
-
_b["table-".concat(color)] = color,
|
|
13085
|
-
_b), className);
|
|
13086
|
-
return (React$1.createElement("tfoot", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13087
|
-
});
|
|
13088
|
-
CTableFoot.propTypes = {
|
|
13089
|
-
children: propTypesExports.node,
|
|
13090
|
-
className: propTypesExports.string,
|
|
13091
|
-
color: colorPropType,
|
|
13092
|
-
};
|
|
13093
|
-
CTableFoot.displayName = 'CTableFoot';
|
|
13094
|
-
|
|
13095
|
-
var CTableCaption = React$1.forwardRef(function (_a, ref) {
|
|
13096
|
-
var children = _a.children, props = __rest$1(_a, ["children"]);
|
|
13097
|
-
return (React$1.createElement("caption", __assign$1({}, props, { ref: ref }), children));
|
|
13098
|
-
});
|
|
13099
|
-
CTableCaption.propTypes = {
|
|
13100
|
-
children: propTypesExports.node,
|
|
13101
|
-
};
|
|
13102
|
-
CTableCaption.displayName = 'CTableCaption';
|
|
13103
|
-
|
|
13104
|
-
var CTableResponsiveWrapper = function (_a) {
|
|
13105
|
-
var children = _a.children, responsive = _a.responsive, rest = __rest$1(_a, ["children", "responsive"]);
|
|
13106
|
-
return responsive ? (React$1.createElement("div", __assign$1({ className: typeof responsive === 'boolean' ? 'table-responsive' : "table-responsive-".concat(responsive) }, rest), children)) : (children);
|
|
13107
|
-
};
|
|
13108
|
-
CTableResponsiveWrapper.propTypes = {
|
|
13109
|
-
children: propTypesExports.any,
|
|
13110
|
-
responsive: propTypesExports.oneOfType([
|
|
13111
|
-
propTypesExports.bool,
|
|
13112
|
-
propTypesExports.oneOf(['sm', 'md', 'lg', 'xl', 'xxl']),
|
|
13113
|
-
]),
|
|
13114
|
-
};
|
|
13115
|
-
CTableResponsiveWrapper.displayName = 'CTableResponsiveWrapper';
|
|
13116
|
-
|
|
13117
|
-
var CTable = React$1.forwardRef(function (_a, ref) {
|
|
13118
|
-
var _b;
|
|
13119
|
-
var children = _a.children, align = _a.align, borderColor = _a.borderColor, bordered = _a.bordered, borderless = _a.borderless, caption = _a.caption, captionTop = _a.captionTop, className = _a.className, color = _a.color, columns = _a.columns, footer = _a.footer, hover = _a.hover, _c = _a.items, items = _c === void 0 ? [] : _c, responsive = _a.responsive, small = _a.small, striped = _a.striped, stripedColumns = _a.stripedColumns, tableFootProps = _a.tableFootProps, tableHeadProps = _a.tableHeadProps, rest = __rest$1(_a, ["children", "align", "borderColor", "bordered", "borderless", "caption", "captionTop", "className", "color", "columns", "footer", "hover", "items", "responsive", "small", "striped", "stripedColumns", "tableFootProps", "tableHeadProps"]);
|
|
13120
|
-
var _className = classNames$1('table', (_b = {},
|
|
13121
|
-
_b["align-".concat(align)] = align,
|
|
13122
|
-
_b["border-".concat(borderColor)] = borderColor,
|
|
13123
|
-
_b["caption-top"] = captionTop || caption === 'top',
|
|
13124
|
-
_b['table-bordered'] = bordered,
|
|
13125
|
-
_b['table-borderless'] = borderless,
|
|
13126
|
-
_b["table-".concat(color)] = color,
|
|
13127
|
-
_b['table-hover'] = hover,
|
|
13128
|
-
_b['table-sm'] = small,
|
|
13129
|
-
_b['table-striped'] = striped,
|
|
13130
|
-
_b['table-striped-columns'] = stripedColumns,
|
|
13131
|
-
_b), className);
|
|
13132
|
-
var rawColumnNames = columns
|
|
13133
|
-
? columns.map(function (column) {
|
|
13134
|
-
if (typeof column === 'object')
|
|
13135
|
-
return column.key;
|
|
13136
|
-
else
|
|
13137
|
-
return column;
|
|
13138
|
-
})
|
|
13139
|
-
: Object.keys(items[0] || {}).filter(function (el) { return el.charAt(0) !== '_'; });
|
|
13140
|
-
var pretifyName = function (name) {
|
|
13141
|
-
return name
|
|
13142
|
-
.replace(/[-_.]/g, ' ')
|
|
13143
|
-
.replace(/ +/g, ' ')
|
|
13144
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
13145
|
-
.split(' ')
|
|
13146
|
-
.map(function (word) { return word.charAt(0).toUpperCase() + word.slice(1); })
|
|
13147
|
-
.join(' ');
|
|
13148
|
-
};
|
|
13149
|
-
var label = function (column) {
|
|
13150
|
-
return typeof column === 'object'
|
|
13151
|
-
? column.label !== undefined
|
|
13152
|
-
? column.label
|
|
13153
|
-
: pretifyName(column.key)
|
|
13154
|
-
: pretifyName(column);
|
|
13155
|
-
};
|
|
13156
|
-
return (React$1.createElement(CTableResponsiveWrapper, { responsive: responsive },
|
|
13157
|
-
React$1.createElement("table", __assign$1({ className: _className }, rest, { ref: ref }),
|
|
13158
|
-
((caption && caption !== 'top') || captionTop) && (React$1.createElement(CTableCaption, null, caption || captionTop)),
|
|
13159
|
-
columns && (React$1.createElement(CTableHead, __assign$1({}, tableHeadProps),
|
|
13160
|
-
React$1.createElement(CTableRow, null, columns.map(function (column, index) { return (React$1.createElement(CTableHeaderCell, __assign$1({}, (column._props && __assign$1({}, column._props)), (column._style && { style: __assign$1({}, column._style) }), { key: index }), label(column))); })))),
|
|
13161
|
-
items && (React$1.createElement(CTableBody, null, items.map(function (item, index) { return (React$1.createElement(CTableRow, __assign$1({}, (item._props && __assign$1({}, item._props)), { key: index }), rawColumnNames.map(function (colName, index) {
|
|
13162
|
-
return item[colName] ? (React$1.createElement(CTableDataCell, __assign$1({}, (item._cellProps && __assign$1(__assign$1({}, (item._cellProps['all'] && __assign$1({}, item._cellProps['all']))), (item._cellProps[colName] && __assign$1({}, item._cellProps[colName])))), { key: index }), item[colName])) : null;
|
|
13163
|
-
}))); }))),
|
|
13164
|
-
children,
|
|
13165
|
-
footer && (React$1.createElement(CTableFoot, __assign$1({}, tableFootProps),
|
|
13166
|
-
React$1.createElement(CTableRow, null, footer.map(function (item, index) { return (React$1.createElement(CTableDataCell, __assign$1({}, (item._props && __assign$1({}, item._props)), { key: index }), typeof item === 'object' ? item.label : item)); })))))));
|
|
13167
|
-
});
|
|
13168
|
-
CTable.propTypes = {
|
|
13169
|
-
align: propTypesExports.oneOf(['bottom', 'middle', 'top']),
|
|
13170
|
-
borderColor: propTypesExports.string,
|
|
13171
|
-
bordered: propTypesExports.bool,
|
|
13172
|
-
borderless: propTypesExports.bool,
|
|
13173
|
-
caption: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.oneOf(['top'])]),
|
|
13174
|
-
captionTop: propTypesExports.string,
|
|
13175
|
-
children: propTypesExports.node,
|
|
13176
|
-
className: propTypesExports.string,
|
|
13177
|
-
color: colorPropType,
|
|
13178
|
-
columns: propTypesExports.array,
|
|
13179
|
-
footer: propTypesExports.array,
|
|
13180
|
-
hover: propTypesExports.bool,
|
|
13181
|
-
items: propTypesExports.array,
|
|
13182
|
-
responsive: propTypesExports.oneOfType([
|
|
13183
|
-
propTypesExports.bool,
|
|
13184
|
-
propTypesExports.oneOf(['sm', 'md', 'lg', 'xl', 'xxl']),
|
|
13185
|
-
]),
|
|
13186
|
-
small: propTypesExports.bool,
|
|
13187
|
-
striped: propTypesExports.bool,
|
|
13188
|
-
stripedColumns: propTypesExports.bool,
|
|
13189
|
-
tableFootProps: propTypesExports.shape(__assign$1({}, CTableFoot.propTypes)),
|
|
13190
|
-
tableHeadProps: propTypesExports.shape(__assign$1({}, CTableHead.propTypes)),
|
|
13191
|
-
};
|
|
13192
|
-
CTable.displayName = 'CTable';
|
|
13193
|
-
|
|
13194
|
-
var CSmartTableBody = React$1.forwardRef(function (_a, ref) {
|
|
13195
|
-
var clickableRows = _a.clickableRows, currentItems = _a.currentItems, firstItemOnActivePageIndex = _a.firstItemOnActivePageIndex, noItemsLabel = _a.noItemsLabel, onRowChecked = _a.onRowChecked, onRowClick = _a.onRowClick, rawColumnNames = _a.rawColumnNames, scopedColumns = _a.scopedColumns, selectable = _a.selectable, rest = __rest$1(_a, ["clickableRows", "currentItems", "firstItemOnActivePageIndex", "noItemsLabel", "onRowChecked", "onRowClick", "rawColumnNames", "scopedColumns", "selectable"]);
|
|
13196
|
-
var tableDataCellProps = function (item, colName) {
|
|
13197
|
-
var props = item._cellProps && __assign$1(__assign$1({}, (item._cellProps['all'] && __assign$1({}, item._cellProps['all']))), (item._cellProps[colName] && __assign$1({}, item._cellProps[colName])));
|
|
13198
|
-
return props;
|
|
13199
|
-
};
|
|
13200
|
-
var getColumnName = function (event) {
|
|
13201
|
-
var target = event.target;
|
|
13202
|
-
var closest = target.closest('tr');
|
|
13203
|
-
var children = closest ? Array.from(closest.children) : [];
|
|
13204
|
-
var clickedCell = children.filter(function (child) { return child.contains(target); })[0];
|
|
13205
|
-
return rawColumnNames[children.indexOf(clickedCell)];
|
|
13206
|
-
};
|
|
13207
|
-
var colspan = selectable ? rawColumnNames.length + 1 : rawColumnNames.length;
|
|
13208
|
-
return (React$1.createElement(CTableBody, __assign$1({}, (clickableRows && {
|
|
13209
|
-
style: { cursor: 'pointer' },
|
|
13210
|
-
}), rest, { ref: ref }),
|
|
13211
|
-
currentItems.map(function (item, trIndex) {
|
|
13212
|
-
return (React$1.createElement(React$1.Fragment, { key: trIndex },
|
|
13213
|
-
React$1.createElement(CTableRow, __assign$1({}, (item._props && __assign$1({}, item._props)), (clickableRows && { tabIndex: 0 }), { onClick: function (event) {
|
|
13214
|
-
return onRowClick &&
|
|
13215
|
-
onRowClick(item, trIndex + firstItemOnActivePageIndex, getColumnName(event), event);
|
|
13216
|
-
} }),
|
|
13217
|
-
selectable && (React$1.createElement(CTableDataCell, null,
|
|
13218
|
-
React$1.createElement(CFormCheck, { checked: item._selected ? item._selected : false, onChange: function (event) {
|
|
13219
|
-
return onRowChecked && onRowChecked(item._id, event.target.checked);
|
|
13220
|
-
} }))),
|
|
13221
|
-
rawColumnNames.map(function (colName, index) {
|
|
13222
|
-
return ((scopedColumns &&
|
|
13223
|
-
scopedColumns[colName] &&
|
|
13224
|
-
React$1.cloneElement(scopedColumns[colName](item, trIndex + firstItemOnActivePageIndex), {
|
|
13225
|
-
key: index,
|
|
13226
|
-
})) || (React$1.createElement(CTableDataCell, __assign$1({}, tableDataCellProps(item, colName), { key: index }), String(item[colName]))));
|
|
13227
|
-
})),
|
|
13228
|
-
scopedColumns && scopedColumns.details && (React$1.createElement(React$1.Fragment, null,
|
|
13229
|
-
React$1.createElement(CTableRow, null,
|
|
13230
|
-
React$1.createElement(CTableDataCell, { colSpan: colspan, className: "p-0", style: { borderBottomWidth: 0 }, tabIndex: -1 })),
|
|
13231
|
-
React$1.createElement(CTableRow, { onClick: function (event) {
|
|
13232
|
-
return onRowClick &&
|
|
13233
|
-
onRowClick(item, trIndex + firstItemOnActivePageIndex, getColumnName(event), true);
|
|
13234
|
-
}, className: "p-0", key: "details".concat(trIndex) },
|
|
13235
|
-
React$1.createElement(CTableDataCell, { colSpan: colspan, className: "p-0", style: { border: 0 } }, scopedColumns.details(item, trIndex + firstItemOnActivePageIndex)))))));
|
|
13236
|
-
}),
|
|
13237
|
-
!currentItems.length && (React$1.createElement(CTableRow, null,
|
|
13238
|
-
React$1.createElement(CTableDataCell, { colSpan: colspan }, noItemsLabel)))));
|
|
13239
|
-
});
|
|
13240
|
-
CSmartTableBody.propTypes = {
|
|
13241
|
-
clickableRows: propTypesExports.bool,
|
|
13242
|
-
currentItems: propTypesExports.array.isRequired,
|
|
13243
|
-
firstItemOnActivePageIndex: propTypesExports.number.isRequired,
|
|
13244
|
-
noItemsLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.node]),
|
|
13245
|
-
onRowChecked: propTypesExports.func,
|
|
13246
|
-
onRowClick: propTypesExports.func,
|
|
13247
|
-
rawColumnNames: propTypesExports.array.isRequired,
|
|
13248
|
-
scopedColumns: propTypesExports.object,
|
|
13249
|
-
selectable: propTypesExports.bool,
|
|
13250
|
-
};
|
|
13251
|
-
CSmartTableBody.displayName = 'CSmartTableBody';
|
|
13252
|
-
|
|
13253
|
-
/******************************************************************************
|
|
13254
|
-
Copyright (c) Microsoft Corporation.
|
|
13255
|
-
|
|
13256
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
13257
|
-
purpose with or without fee is hereby granted.
|
|
13258
|
-
|
|
13259
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13260
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13261
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
13262
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13263
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13264
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13265
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
13266
|
-
***************************************************************************** */
|
|
13267
|
-
|
|
13268
|
-
var __assign = function() {
|
|
13269
|
-
__assign = Object.assign || function __assign(t) {
|
|
13270
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
13271
|
-
s = arguments[i];
|
|
13272
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
13273
|
-
}
|
|
13274
|
-
return t;
|
|
13275
|
-
};
|
|
13276
|
-
return __assign.apply(this, arguments);
|
|
13277
|
-
};
|
|
13278
|
-
|
|
13279
|
-
function __rest(s, e) {
|
|
13280
|
-
var t = {};
|
|
13281
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13282
|
-
t[p] = s[p];
|
|
13283
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
13284
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
13285
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
13286
|
-
t[p[i]] = s[p[i]];
|
|
13287
|
-
}
|
|
13288
|
-
return t;
|
|
13289
|
-
}
|
|
12277
|
+
/******************************************************************************
|
|
12278
|
+
Copyright (c) Microsoft Corporation.
|
|
12279
|
+
|
|
12280
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12281
|
+
purpose with or without fee is hereby granted.
|
|
12282
|
+
|
|
12283
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12284
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12285
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12286
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12287
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12288
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12289
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
12290
|
+
***************************************************************************** */
|
|
12291
|
+
|
|
12292
|
+
var __assign = function() {
|
|
12293
|
+
__assign = Object.assign || function __assign(t) {
|
|
12294
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12295
|
+
s = arguments[i];
|
|
12296
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
12297
|
+
}
|
|
12298
|
+
return t;
|
|
12299
|
+
};
|
|
12300
|
+
return __assign.apply(this, arguments);
|
|
12301
|
+
};
|
|
12302
|
+
|
|
12303
|
+
function __rest(s, e) {
|
|
12304
|
+
var t = {};
|
|
12305
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
12306
|
+
t[p] = s[p];
|
|
12307
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
12308
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
12309
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
12310
|
+
t[p[i]] = s[p[i]];
|
|
12311
|
+
}
|
|
12312
|
+
return t;
|
|
12313
|
+
}
|
|
13290
12314
|
|
|
13291
12315
|
var propTypes = {exports: {}};
|
|
13292
12316
|
|
|
@@ -14516,103 +13540,565 @@ var classnames = {exports: {}};
|
|
|
14516
13540
|
}
|
|
14517
13541
|
}
|
|
14518
13542
|
|
|
14519
|
-
return classes.join(' ');
|
|
14520
|
-
}
|
|
13543
|
+
return classes.join(' ');
|
|
13544
|
+
}
|
|
13545
|
+
|
|
13546
|
+
if (module.exports) {
|
|
13547
|
+
classNames.default = classNames;
|
|
13548
|
+
module.exports = classNames;
|
|
13549
|
+
} else {
|
|
13550
|
+
window.classNames = classNames;
|
|
13551
|
+
}
|
|
13552
|
+
}());
|
|
13553
|
+
} (classnames));
|
|
13554
|
+
|
|
13555
|
+
var classNames = classnames.exports;
|
|
13556
|
+
|
|
13557
|
+
var toCamelCase = function (str) {
|
|
13558
|
+
return str
|
|
13559
|
+
.replace(/([-_][a-z0-9])/gi, function ($1) {
|
|
13560
|
+
return $1.toUpperCase();
|
|
13561
|
+
})
|
|
13562
|
+
.replace(/-/gi, '');
|
|
13563
|
+
};
|
|
13564
|
+
var CIcon = React$1.forwardRef(function (_a, ref) {
|
|
13565
|
+
var _b;
|
|
13566
|
+
var className = _a.className, content = _a.content, customClassName = _a.customClassName, height = _a.height, icon = _a.icon, name = _a.name, size = _a.size, title = _a.title, use = _a.use, width = _a.width, rest = __rest(_a, ["className", "content", "customClassName", "height", "icon", "name", "size", "title", "use", "width"]);
|
|
13567
|
+
var _c = React$1.useState(0), change = _c[0], setChange = _c[1];
|
|
13568
|
+
var _icon = icon || content || name;
|
|
13569
|
+
if (content) {
|
|
13570
|
+
process &&
|
|
13571
|
+
process.env &&
|
|
13572
|
+
process.env.NODE_ENV === 'development' &&
|
|
13573
|
+
console.warn('[CIcon] The `content` property is deprecated and will be removed in v3, please use `icon={...}` instead of.');
|
|
13574
|
+
}
|
|
13575
|
+
if (name) {
|
|
13576
|
+
process &&
|
|
13577
|
+
process.env &&
|
|
13578
|
+
process.env.NODE_ENV === 'development' &&
|
|
13579
|
+
console.warn('[CIcon] The `name` property is deprecated and will be removed in v3, please use `icon="..."` instead of.');
|
|
13580
|
+
}
|
|
13581
|
+
React$1.useMemo(function () { return setChange(change + 1); }, [_icon, JSON.stringify(_icon)]);
|
|
13582
|
+
var iconName = React$1.useMemo(function () {
|
|
13583
|
+
return _icon && typeof _icon === 'string' && _icon.includes('-') ? toCamelCase(_icon) : _icon;
|
|
13584
|
+
}, [change]);
|
|
13585
|
+
var titleCode = title ? "<title>".concat(title, "</title>") : '';
|
|
13586
|
+
var code = React$1.useMemo(function () {
|
|
13587
|
+
if (Array.isArray(_icon)) {
|
|
13588
|
+
return _icon;
|
|
13589
|
+
}
|
|
13590
|
+
if (typeof _icon === 'string' && React$1['icons']) {
|
|
13591
|
+
return React$1['icons'][iconName];
|
|
13592
|
+
}
|
|
13593
|
+
}, [change]);
|
|
13594
|
+
var iconCode = React$1.useMemo(function () {
|
|
13595
|
+
return Array.isArray(code) ? code[1] || code[0] : code;
|
|
13596
|
+
}, [change]);
|
|
13597
|
+
var scale = (function () {
|
|
13598
|
+
return Array.isArray(code) && code.length > 1 ? code[0] : '64 64';
|
|
13599
|
+
})();
|
|
13600
|
+
var viewBox = (function () {
|
|
13601
|
+
return rest['viewBox'] || "0 0 ".concat(scale);
|
|
13602
|
+
})();
|
|
13603
|
+
// render
|
|
13604
|
+
var _className = customClassName
|
|
13605
|
+
? classNames(customClassName)
|
|
13606
|
+
: classNames('icon', (_b = {},
|
|
13607
|
+
_b["icon-".concat(size)] = size,
|
|
13608
|
+
_b["icon-custom-size"] = height || width,
|
|
13609
|
+
_b), className);
|
|
13610
|
+
return use ? (React$1.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: _className }, (height && { height: height }), (width && { width: width }), { role: "img" }, rest, { ref: ref }),
|
|
13611
|
+
React$1.createElement("use", { href: use }))) : (React$1.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, className: _className }, (height && { height: height }), (width && { width: width }), { role: "img", dangerouslySetInnerHTML: { __html: titleCode + iconCode } }, rest, { ref: ref })));
|
|
13612
|
+
});
|
|
13613
|
+
CIcon.propTypes = {
|
|
13614
|
+
className: propTypes.exports.string,
|
|
13615
|
+
content: propTypes.exports.oneOfType([propTypes.exports.array, propTypes.exports.string]),
|
|
13616
|
+
customClassName: propTypes.exports.string,
|
|
13617
|
+
height: propTypes.exports.number,
|
|
13618
|
+
icon: propTypes.exports.oneOfType([propTypes.exports.array, propTypes.exports.string]),
|
|
13619
|
+
name: propTypes.exports.string,
|
|
13620
|
+
size: propTypes.exports.oneOf([
|
|
13621
|
+
'custom',
|
|
13622
|
+
'custom-size',
|
|
13623
|
+
'sm',
|
|
13624
|
+
'lg',
|
|
13625
|
+
'xl',
|
|
13626
|
+
'xxl',
|
|
13627
|
+
'3xl',
|
|
13628
|
+
'4xl',
|
|
13629
|
+
'5xl',
|
|
13630
|
+
'6xl',
|
|
13631
|
+
'7xl',
|
|
13632
|
+
'8xl',
|
|
13633
|
+
'9xl',
|
|
13634
|
+
]),
|
|
13635
|
+
title: propTypes.exports.any,
|
|
13636
|
+
use: propTypes.exports.any,
|
|
13637
|
+
width: propTypes.exports.number,
|
|
13638
|
+
};
|
|
13639
|
+
CIcon.displayName = 'CIcon';
|
|
13640
|
+
|
|
13641
|
+
var CSmartPagination = React$1.forwardRef(function (_a, ref) {
|
|
13642
|
+
var className = _a.className, _b = _a.activePage, activePage = _b === void 0 ? 1 : _b, _c = _a.align, align = _c === void 0 ? 'start' : _c, _d = _a.arrows, arrows = _d === void 0 ? true : _d, _e = _a.dots, dots = _e === void 0 ? true : _e, _f = _a.doubleArrows, doubleArrows = _f === void 0 ? true : _f, _g = _a.firstButton, firstButton = _g === void 0 ? React$1.createElement(React$1.Fragment, null, "\u00AB") : _g, _h = _a.lastButton, lastButton = _h === void 0 ? React$1.createElement(React$1.Fragment, null, "\u00BB") : _h, _j = _a.limit, limit = _j === void 0 ? 5 : _j, _k = _a.nextButton, nextButton = _k === void 0 ? React$1.createElement(React$1.Fragment, null, "\u203A") : _k, onActivePageChange = _a.onActivePageChange, pages = _a.pages, _l = _a.previousButton, previousButton = _l === void 0 ? React$1.createElement(React$1.Fragment, null, "\u2039") : _l, size = _a.size, rest = __rest$1(_a, ["className", "activePage", "align", "arrows", "dots", "doubleArrows", "firstButton", "lastButton", "limit", "nextButton", "onActivePageChange", "pages", "previousButton", "size"]);
|
|
13643
|
+
var _classNames = classNames$1("justify-content-".concat(align), className);
|
|
13644
|
+
var showDots = (function () {
|
|
13645
|
+
return dots && limit > 4 && limit < pages;
|
|
13646
|
+
})();
|
|
13647
|
+
var maxPrevItems = (function () {
|
|
13648
|
+
return Math.floor((limit - 1) / 2);
|
|
13649
|
+
})();
|
|
13650
|
+
var maxNextItems = (function () {
|
|
13651
|
+
return Math.ceil((limit - 1) / 2);
|
|
13652
|
+
})();
|
|
13653
|
+
var beforeDots = (function () {
|
|
13654
|
+
return showDots && activePage > maxPrevItems + 1;
|
|
13655
|
+
})();
|
|
13656
|
+
var afterDots = (function () {
|
|
13657
|
+
return showDots && activePage < pages - maxNextItems;
|
|
13658
|
+
})();
|
|
13659
|
+
var computedLimit = (function () {
|
|
13660
|
+
return limit - (afterDots ? 1 : 0) - (beforeDots ? 1 : 0);
|
|
13661
|
+
})();
|
|
13662
|
+
var range = (function () {
|
|
13663
|
+
return activePage + maxNextItems;
|
|
13664
|
+
})();
|
|
13665
|
+
var lastItem = (function () {
|
|
13666
|
+
return range >= pages ? pages : range - (afterDots ? 1 : 0);
|
|
13667
|
+
})();
|
|
13668
|
+
var itemsAmount = (function () {
|
|
13669
|
+
return pages < computedLimit ? pages : computedLimit;
|
|
13670
|
+
})();
|
|
13671
|
+
var items = (function () {
|
|
13672
|
+
if (activePage - maxPrevItems <= 1) {
|
|
13673
|
+
return Array.from({
|
|
13674
|
+
length: itemsAmount,
|
|
13675
|
+
}, function (_v, i) { return i + 1; });
|
|
13676
|
+
}
|
|
13677
|
+
else {
|
|
13678
|
+
return Array.from({
|
|
13679
|
+
length: itemsAmount,
|
|
13680
|
+
}, function (_v, i) {
|
|
13681
|
+
return lastItem - i;
|
|
13682
|
+
}).reverse();
|
|
13683
|
+
}
|
|
13684
|
+
})();
|
|
13685
|
+
var setPage = function (number) {
|
|
13686
|
+
if (number !== activePage) {
|
|
13687
|
+
onActivePageChange && onActivePageChange(number);
|
|
13688
|
+
}
|
|
13689
|
+
};
|
|
13690
|
+
return (React$1.createElement(CPagination, __assign$1({ className: _classNames, "aria-label": "pagination", size: size }, rest, { ref: ref }),
|
|
13691
|
+
doubleArrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(1); }, "aria-label": "Go to first page", "aria-disabled": activePage === 1, disabled: activePage === 1 }, firstButton)),
|
|
13692
|
+
arrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(activePage - 1); }, "aria-label": "Go to previous page", "aria-disabled": activePage === 1, disabled: activePage === 1 }, previousButton)),
|
|
13693
|
+
beforeDots && (React$1.createElement(CPaginationItem, { role: "separator", disabled: true }, "\u2026")),
|
|
13694
|
+
items.map(function (i) {
|
|
13695
|
+
return (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(i); }, "aria-label": activePage === i ? "Current page ".concat(i) : "Go to page ".concat(i), active: activePage === i, key: i }, i));
|
|
13696
|
+
}),
|
|
13697
|
+
afterDots && (React$1.createElement(CPaginationItem, { role: "separator", disabled: true }, "\u2026")),
|
|
13698
|
+
arrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(activePage + 1); }, "aria-label": "Go to next page", "aria-disabled": activePage === pages, disabled: activePage === pages }, nextButton)),
|
|
13699
|
+
doubleArrows && (React$1.createElement(CPaginationItem, { onClick: function () { return setPage(pages); }, "aria-label": "Go to last page", "aria-disabled": activePage === pages, disabled: activePage === pages }, lastButton))));
|
|
13700
|
+
});
|
|
13701
|
+
CSmartPagination.propTypes = {
|
|
13702
|
+
className: propTypesExports.oneOfType([propTypesExports.string]),
|
|
13703
|
+
activePage: propTypesExports.number,
|
|
13704
|
+
dots: propTypesExports.bool,
|
|
13705
|
+
arrows: propTypesExports.bool,
|
|
13706
|
+
doubleArrows: propTypesExports.bool,
|
|
13707
|
+
firstButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
13708
|
+
previousButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
13709
|
+
nextButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
13710
|
+
lastButton: propTypesExports.oneOfType([propTypesExports.node, propTypesExports.string]),
|
|
13711
|
+
size: propTypesExports.oneOf(['sm', 'lg']),
|
|
13712
|
+
align: propTypesExports.oneOf(['start', 'center', 'end']),
|
|
13713
|
+
limit: propTypesExports.number,
|
|
13714
|
+
pages: propTypesExports.number.isRequired,
|
|
13715
|
+
onActivePageChange: propTypesExports.func,
|
|
13716
|
+
};
|
|
13717
|
+
CSmartPagination.displayName = 'CSmartPagination';
|
|
13718
|
+
|
|
13719
|
+
var CTableHead = React$1.forwardRef(function (_a, ref) {
|
|
13720
|
+
var _b;
|
|
13721
|
+
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13722
|
+
var _className = classNames$1((_b = {},
|
|
13723
|
+
_b["table-".concat(color)] = color,
|
|
13724
|
+
_b), className);
|
|
13725
|
+
return (React$1.createElement("thead", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13726
|
+
});
|
|
13727
|
+
CTableHead.propTypes = {
|
|
13728
|
+
children: propTypesExports.node,
|
|
13729
|
+
className: propTypesExports.string,
|
|
13730
|
+
color: colorPropType,
|
|
13731
|
+
};
|
|
13732
|
+
CTableHead.displayName = 'CTableHead';
|
|
13733
|
+
|
|
13734
|
+
var CTableHeaderCell = React$1.forwardRef(function (_a, ref) {
|
|
13735
|
+
var _b;
|
|
13736
|
+
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13737
|
+
var _className = classNames$1((_b = {},
|
|
13738
|
+
_b["table-".concat(color)] = color,
|
|
13739
|
+
_b), className);
|
|
13740
|
+
return (React$1.createElement("th", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13741
|
+
});
|
|
13742
|
+
CTableHeaderCell.propTypes = {
|
|
13743
|
+
children: propTypesExports.node,
|
|
13744
|
+
className: propTypesExports.string,
|
|
13745
|
+
color: colorPropType,
|
|
13746
|
+
};
|
|
13747
|
+
CTableHeaderCell.displayName = 'CTableHeaderCell';
|
|
13748
|
+
|
|
13749
|
+
var CTableBody = React$1.forwardRef(function (_a, ref) {
|
|
13750
|
+
var _b;
|
|
13751
|
+
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13752
|
+
var _className = classNames$1((_b = {},
|
|
13753
|
+
_b["table-".concat(color)] = color,
|
|
13754
|
+
_b), className);
|
|
13755
|
+
return (React$1.createElement("tbody", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13756
|
+
});
|
|
13757
|
+
CTableBody.propTypes = {
|
|
13758
|
+
children: propTypesExports.node,
|
|
13759
|
+
className: propTypesExports.string,
|
|
13760
|
+
color: colorPropType,
|
|
13761
|
+
};
|
|
13762
|
+
CTableBody.displayName = 'CTableBody';
|
|
14521
13763
|
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
13764
|
+
var CTableDataCell = React$1.forwardRef(function (_a, ref) {
|
|
13765
|
+
var _b;
|
|
13766
|
+
var children = _a.children, active = _a.active, align = _a.align, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "active", "align", "className", "color"]);
|
|
13767
|
+
var _className = classNames$1((_b = {},
|
|
13768
|
+
_b["align-".concat(align)] = align,
|
|
13769
|
+
_b['table-active'] = active,
|
|
13770
|
+
_b["table-".concat(color)] = color,
|
|
13771
|
+
_b), className);
|
|
13772
|
+
var Component = rest.scope ? 'th' : 'td';
|
|
13773
|
+
return (React$1.createElement(Component, __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13774
|
+
});
|
|
13775
|
+
CTableDataCell.propTypes = {
|
|
13776
|
+
active: propTypesExports.bool,
|
|
13777
|
+
align: propTypesExports.oneOf(['bottom', 'middle', 'top']),
|
|
13778
|
+
children: propTypesExports.node,
|
|
13779
|
+
className: propTypesExports.string,
|
|
13780
|
+
color: colorPropType,
|
|
13781
|
+
};
|
|
13782
|
+
CTableDataCell.displayName = 'CTableDataCell';
|
|
14530
13783
|
|
|
14531
|
-
var
|
|
13784
|
+
var CTableRow = React$1.forwardRef(function (_a, ref) {
|
|
13785
|
+
var _b;
|
|
13786
|
+
var children = _a.children, active = _a.active, align = _a.align, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "active", "align", "className", "color"]);
|
|
13787
|
+
var _className = classNames$1((_b = {},
|
|
13788
|
+
_b["align-".concat(align)] = align,
|
|
13789
|
+
_b['table-active'] = active,
|
|
13790
|
+
_b["table-".concat(color)] = color,
|
|
13791
|
+
_b), className);
|
|
13792
|
+
return (React$1.createElement("tr", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13793
|
+
});
|
|
13794
|
+
CTableRow.propTypes = {
|
|
13795
|
+
active: propTypesExports.bool,
|
|
13796
|
+
align: propTypesExports.oneOf(['bottom', 'middle', 'top']),
|
|
13797
|
+
children: propTypesExports.node,
|
|
13798
|
+
className: propTypesExports.string,
|
|
13799
|
+
color: colorPropType,
|
|
13800
|
+
};
|
|
13801
|
+
CTableRow.displayName = 'CTableRow';
|
|
14532
13802
|
|
|
14533
|
-
var
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
|
|
13803
|
+
var CTableFoot = React$1.forwardRef(function (_a, ref) {
|
|
13804
|
+
var _b;
|
|
13805
|
+
var children = _a.children, className = _a.className, color = _a.color, rest = __rest$1(_a, ["children", "className", "color"]);
|
|
13806
|
+
var _className = classNames$1((_b = {},
|
|
13807
|
+
_b["table-".concat(color)] = color,
|
|
13808
|
+
_b), className);
|
|
13809
|
+
return (React$1.createElement("tfoot", __assign$1({ className: _className ? _className : undefined }, rest, { ref: ref }), children));
|
|
13810
|
+
});
|
|
13811
|
+
CTableFoot.propTypes = {
|
|
13812
|
+
children: propTypesExports.node,
|
|
13813
|
+
className: propTypesExports.string,
|
|
13814
|
+
color: colorPropType,
|
|
14539
13815
|
};
|
|
14540
|
-
|
|
13816
|
+
CTableFoot.displayName = 'CTableFoot';
|
|
13817
|
+
|
|
13818
|
+
var CTableCaption = React$1.forwardRef(function (_a, ref) {
|
|
13819
|
+
var children = _a.children, props = __rest$1(_a, ["children"]);
|
|
13820
|
+
return (React$1.createElement("caption", __assign$1({}, props, { ref: ref }), children));
|
|
13821
|
+
});
|
|
13822
|
+
CTableCaption.propTypes = {
|
|
13823
|
+
children: propTypesExports.node,
|
|
13824
|
+
};
|
|
13825
|
+
CTableCaption.displayName = 'CTableCaption';
|
|
13826
|
+
|
|
13827
|
+
var CTableResponsiveWrapper = function (_a) {
|
|
13828
|
+
var children = _a.children, responsive = _a.responsive, rest = __rest$1(_a, ["children", "responsive"]);
|
|
13829
|
+
return responsive ? (React$1.createElement("div", __assign$1({ className: typeof responsive === 'boolean' ? 'table-responsive' : "table-responsive-".concat(responsive) }, rest), children)) : (children);
|
|
13830
|
+
};
|
|
13831
|
+
CTableResponsiveWrapper.propTypes = {
|
|
13832
|
+
children: propTypesExports.any,
|
|
13833
|
+
responsive: propTypesExports.oneOfType([
|
|
13834
|
+
propTypesExports.bool,
|
|
13835
|
+
propTypesExports.oneOf(['sm', 'md', 'lg', 'xl', 'xxl']),
|
|
13836
|
+
]),
|
|
13837
|
+
};
|
|
13838
|
+
CTableResponsiveWrapper.displayName = 'CTableResponsiveWrapper';
|
|
13839
|
+
|
|
13840
|
+
var CTable = React$1.forwardRef(function (_a, ref) {
|
|
14541
13841
|
var _b;
|
|
14542
|
-
var className = _a.className,
|
|
14543
|
-
var
|
|
14544
|
-
|
|
14545
|
-
|
|
14546
|
-
|
|
14547
|
-
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
13842
|
+
var children = _a.children, align = _a.align, borderColor = _a.borderColor, bordered = _a.bordered, borderless = _a.borderless, caption = _a.caption, captionTop = _a.captionTop, className = _a.className, color = _a.color, columns = _a.columns, footer = _a.footer, hover = _a.hover, items = _a.items, responsive = _a.responsive, small = _a.small, striped = _a.striped, stripedColumns = _a.stripedColumns, tableFootProps = _a.tableFootProps, tableHeadProps = _a.tableHeadProps, rest = __rest$1(_a, ["children", "align", "borderColor", "bordered", "borderless", "caption", "captionTop", "className", "color", "columns", "footer", "hover", "items", "responsive", "small", "striped", "stripedColumns", "tableFootProps", "tableHeadProps"]);
|
|
13843
|
+
var _className = classNames$1('table', (_b = {},
|
|
13844
|
+
_b["align-".concat(align)] = align,
|
|
13845
|
+
_b["border-".concat(borderColor)] = borderColor,
|
|
13846
|
+
_b["caption-top"] = captionTop || caption === 'top',
|
|
13847
|
+
_b['table-bordered'] = bordered,
|
|
13848
|
+
_b['table-borderless'] = borderless,
|
|
13849
|
+
_b["table-".concat(color)] = color,
|
|
13850
|
+
_b['table-hover'] = hover,
|
|
13851
|
+
_b['table-sm'] = small,
|
|
13852
|
+
_b['table-striped'] = striped,
|
|
13853
|
+
_b['table-striped-columns'] = stripedColumns,
|
|
13854
|
+
_b), className);
|
|
13855
|
+
var rawColumnNames = columns
|
|
13856
|
+
? columns.map(function (column) {
|
|
13857
|
+
if (typeof column === 'object')
|
|
13858
|
+
return column.key;
|
|
13859
|
+
else
|
|
13860
|
+
return column;
|
|
13861
|
+
})
|
|
13862
|
+
: Object.keys((items && items[0]) || {}).filter(function (el) { return el.charAt(0) !== '_'; });
|
|
13863
|
+
var pretifyName = function (name) {
|
|
13864
|
+
return name
|
|
13865
|
+
.replace(/[-_.]/g, ' ')
|
|
13866
|
+
.replace(/ +/g, ' ')
|
|
13867
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
13868
|
+
.split(' ')
|
|
13869
|
+
.map(function (word) { return word.charAt(0).toUpperCase() + word.slice(1); })
|
|
13870
|
+
.join(' ');
|
|
13871
|
+
};
|
|
13872
|
+
var label = function (column) {
|
|
13873
|
+
return typeof column === 'object'
|
|
13874
|
+
? column.label !== undefined
|
|
13875
|
+
? column.label
|
|
13876
|
+
: pretifyName(column.key)
|
|
13877
|
+
: pretifyName(column);
|
|
13878
|
+
};
|
|
13879
|
+
return (React$1.createElement(CTableResponsiveWrapper, { responsive: responsive },
|
|
13880
|
+
React$1.createElement("table", __assign$1({ className: _className }, rest, { ref: ref }),
|
|
13881
|
+
((caption && caption !== 'top') || captionTop) && (React$1.createElement(CTableCaption, null, caption || captionTop)),
|
|
13882
|
+
columns && (React$1.createElement(CTableHead, __assign$1({}, tableHeadProps),
|
|
13883
|
+
React$1.createElement(CTableRow, null, columns.map(function (column, index) { return (React$1.createElement(CTableHeaderCell, __assign$1({}, (column._props && __assign$1({}, column._props)), (column._style && { style: __assign$1({}, column._style) }), { key: index }), label(column))); })))),
|
|
13884
|
+
items && (React$1.createElement(CTableBody, null, items.map(function (item, index) { return (React$1.createElement(CTableRow, __assign$1({}, (item._props && __assign$1({}, item._props)), { key: index }), rawColumnNames.map(function (colName, index) {
|
|
13885
|
+
return item[colName] ? (React$1.createElement(CTableDataCell, __assign$1({}, (item._cellProps && __assign$1(__assign$1({}, (item._cellProps['all'] && __assign$1({}, item._cellProps['all']))), (item._cellProps[colName] && __assign$1({}, item._cellProps[colName])))), { key: index }), item[colName])) : null;
|
|
13886
|
+
}))); }))),
|
|
13887
|
+
children,
|
|
13888
|
+
footer && (React$1.createElement(CTableFoot, __assign$1({}, tableFootProps),
|
|
13889
|
+
React$1.createElement(CTableRow, null, footer.map(function (item, index) { return (React$1.createElement(CTableDataCell, __assign$1({}, (typeof item === 'object' && item._props && __assign$1({}, item._props)), { key: index }), typeof item === 'object' ? item.label : item)); })))))));
|
|
13890
|
+
});
|
|
13891
|
+
CTable.propTypes = {
|
|
13892
|
+
align: propTypesExports.oneOf(['bottom', 'middle', 'top']),
|
|
13893
|
+
borderColor: propTypesExports.string,
|
|
13894
|
+
bordered: propTypesExports.bool,
|
|
13895
|
+
borderless: propTypesExports.bool,
|
|
13896
|
+
caption: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.oneOf(['top'])]),
|
|
13897
|
+
captionTop: propTypesExports.string,
|
|
13898
|
+
children: propTypesExports.node,
|
|
13899
|
+
className: propTypesExports.string,
|
|
13900
|
+
color: colorPropType,
|
|
13901
|
+
columns: propTypesExports.array,
|
|
13902
|
+
footer: propTypesExports.array,
|
|
13903
|
+
hover: propTypesExports.bool,
|
|
13904
|
+
items: propTypesExports.array,
|
|
13905
|
+
responsive: propTypesExports.oneOfType([
|
|
13906
|
+
propTypesExports.bool,
|
|
13907
|
+
propTypesExports.oneOf(['sm', 'md', 'lg', 'xl', 'xxl']),
|
|
13908
|
+
]),
|
|
13909
|
+
small: propTypesExports.bool,
|
|
13910
|
+
striped: propTypesExports.bool,
|
|
13911
|
+
stripedColumns: propTypesExports.bool,
|
|
13912
|
+
tableFootProps: propTypesExports.shape(__assign$1({}, CTableFoot.propTypes)),
|
|
13913
|
+
tableHeadProps: propTypesExports.shape(__assign$1({}, CTableHead.propTypes)),
|
|
13914
|
+
};
|
|
13915
|
+
CTable.displayName = 'CTable';
|
|
13916
|
+
|
|
13917
|
+
var filterColumns = function (items, columnFilter, columnFilterState, itemsDataColumns) {
|
|
13918
|
+
if (columnFilter && typeof columnFilter === 'object' && columnFilter.external) {
|
|
13919
|
+
return items;
|
|
14556
13920
|
}
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
|
|
14560
|
-
|
|
14561
|
-
|
|
14562
|
-
var code = React$1.useMemo(function () {
|
|
14563
|
-
if (Array.isArray(_icon)) {
|
|
14564
|
-
return _icon;
|
|
13921
|
+
Object.entries(columnFilterState).forEach(function (_a) {
|
|
13922
|
+
var key = _a[0], value = _a[1];
|
|
13923
|
+
if (value instanceof Function) {
|
|
13924
|
+
items = items.filter(function (item) { return value(item[key]); });
|
|
13925
|
+
return;
|
|
14565
13926
|
}
|
|
14566
|
-
|
|
14567
|
-
|
|
13927
|
+
var columnFilter = String(value).toLowerCase();
|
|
13928
|
+
if (columnFilter && itemsDataColumns.includes(key)) {
|
|
13929
|
+
items = items.filter(function (item) {
|
|
13930
|
+
return String(item[key]).toLowerCase().includes(columnFilter);
|
|
13931
|
+
});
|
|
14568
13932
|
}
|
|
14569
|
-
}
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
14586
|
-
|
|
14587
|
-
|
|
13933
|
+
});
|
|
13934
|
+
return items;
|
|
13935
|
+
};
|
|
13936
|
+
var filterTable = function (items, tableFilter, tableFilterState, itemsDataColumns) {
|
|
13937
|
+
if (!tableFilterState ||
|
|
13938
|
+
(tableFilter && typeof tableFilter === 'object' && tableFilter.external)) {
|
|
13939
|
+
return items;
|
|
13940
|
+
}
|
|
13941
|
+
var filter = tableFilterState.toLowerCase();
|
|
13942
|
+
var valueContainFilter = function (val) { return String(val).toLowerCase().includes(filter); };
|
|
13943
|
+
items = items.filter(function (item) {
|
|
13944
|
+
return !!itemsDataColumns.find(function (key) { return valueContainFilter(item[key]); });
|
|
13945
|
+
});
|
|
13946
|
+
return items;
|
|
13947
|
+
};
|
|
13948
|
+
var getClickedColumnName = function (target, columnNames) {
|
|
13949
|
+
var closest = target.closest('tr');
|
|
13950
|
+
var children = closest ? Array.from(closest.children) : [];
|
|
13951
|
+
var clickedCell = children.filter(function (child) { return child.contains(target); })[0];
|
|
13952
|
+
return columnNames[children.indexOf(clickedCell)];
|
|
13953
|
+
};
|
|
13954
|
+
var getColumnKey = function (column) {
|
|
13955
|
+
return typeof column === 'object' ? column.key : column;
|
|
13956
|
+
};
|
|
13957
|
+
var getColumnLabel = function (column) {
|
|
13958
|
+
return typeof column === 'object'
|
|
13959
|
+
? column.label !== undefined
|
|
13960
|
+
? column.label
|
|
13961
|
+
: pretifyName(column.key)
|
|
13962
|
+
: pretifyName(column);
|
|
13963
|
+
};
|
|
13964
|
+
var getColumnNames = function (columns, items) {
|
|
13965
|
+
return columns
|
|
13966
|
+
? columns.map(function (column) {
|
|
13967
|
+
if (typeof column === 'object')
|
|
13968
|
+
return column.key;
|
|
13969
|
+
else
|
|
13970
|
+
return column;
|
|
13971
|
+
})
|
|
13972
|
+
: getColumnNamesFromItems(items);
|
|
13973
|
+
};
|
|
13974
|
+
var getColumnNamesFromItems = function (items) {
|
|
13975
|
+
return Object.keys(items[0] || {}).filter(function (el) { return el.charAt(0) !== '_'; });
|
|
13976
|
+
};
|
|
13977
|
+
var getColumnSorterState = function (key, sorterState) {
|
|
13978
|
+
if (sorterState && sorterState.column === key) {
|
|
13979
|
+
if (sorterState.state) {
|
|
13980
|
+
return sorterState.state;
|
|
13981
|
+
}
|
|
13982
|
+
return 0;
|
|
13983
|
+
}
|
|
13984
|
+
return 0;
|
|
13985
|
+
};
|
|
13986
|
+
var getColumnValues = function (items, key) {
|
|
13987
|
+
return items.map(function (item) { return item[key]; });
|
|
13988
|
+
};
|
|
13989
|
+
var getTableDataCellProps = function (item, colName) {
|
|
13990
|
+
var props = item._cellProps && __assign$1(__assign$1({}, (item._cellProps['all'] && __assign$1({}, item._cellProps['all']))), (item._cellProps[colName] && __assign$1({}, item._cellProps[colName])));
|
|
13991
|
+
return props;
|
|
13992
|
+
};
|
|
13993
|
+
var getTableHeaderCellProps = function (column) {
|
|
13994
|
+
if (typeof column === 'object' && column._props) {
|
|
13995
|
+
return column._props;
|
|
13996
|
+
}
|
|
13997
|
+
return {};
|
|
13998
|
+
};
|
|
13999
|
+
var getTableHeaderCellStyles = function (column, columnSorter) {
|
|
14000
|
+
var style = {};
|
|
14001
|
+
if (columnSorter &&
|
|
14002
|
+
(typeof column !== 'object' ||
|
|
14003
|
+
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter)))) {
|
|
14004
|
+
style['cursor'] = 'pointer';
|
|
14005
|
+
}
|
|
14006
|
+
if (typeof column === 'object' && column._style) {
|
|
14007
|
+
return __assign$1(__assign$1({}, style), column._style);
|
|
14008
|
+
}
|
|
14009
|
+
return style;
|
|
14010
|
+
};
|
|
14011
|
+
var isSortable = function (i, columns, columnSorter, itemsDataColumns, columnNames) {
|
|
14012
|
+
var isDataColumn = itemsDataColumns.includes(columnNames[i]);
|
|
14013
|
+
var column;
|
|
14014
|
+
if (columns)
|
|
14015
|
+
column = columns[i];
|
|
14016
|
+
return (columnSorter &&
|
|
14017
|
+
(!columns ||
|
|
14018
|
+
typeof column !== 'object' ||
|
|
14019
|
+
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter))) &&
|
|
14020
|
+
isDataColumn);
|
|
14021
|
+
};
|
|
14022
|
+
var pretifyName = function (name) {
|
|
14023
|
+
return name
|
|
14024
|
+
.replace(/[-_.]/g, ' ')
|
|
14025
|
+
.replace(/ +/g, ' ')
|
|
14026
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
14027
|
+
.split(' ')
|
|
14028
|
+
.map(function (word) { return word.charAt(0).toUpperCase() + word.slice(1); })
|
|
14029
|
+
.join(' ');
|
|
14030
|
+
};
|
|
14031
|
+
var sortItems = function (columnSorter, items, itemsDataColumns, sorterState) {
|
|
14032
|
+
var column = sorterState.column;
|
|
14033
|
+
if (!column ||
|
|
14034
|
+
!itemsDataColumns.includes(column) ||
|
|
14035
|
+
(columnSorter && typeof columnSorter === 'object' && columnSorter.external)) {
|
|
14036
|
+
return items;
|
|
14037
|
+
}
|
|
14038
|
+
var flip = sorterState.state === 'asc' ? 1 : sorterState.state === 'desc' ? -1 : 0;
|
|
14039
|
+
var sorted = items.slice().sort(function (item, item2) {
|
|
14040
|
+
var value = item[column];
|
|
14041
|
+
var value2 = item2[column];
|
|
14042
|
+
var a = typeof value === 'number' ? value : String(value).toLowerCase();
|
|
14043
|
+
var b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase();
|
|
14044
|
+
return a > b ? 1 * flip : b > a ? -1 * flip : 0;
|
|
14045
|
+
});
|
|
14046
|
+
return sorted;
|
|
14047
|
+
};
|
|
14048
|
+
|
|
14049
|
+
var CSmartTableBody = React$1.forwardRef(function (_a, ref) {
|
|
14050
|
+
var clickableRows = _a.clickableRows, columnNames = _a.columnNames, currentItems = _a.currentItems, firstItemOnActivePageIndex = _a.firstItemOnActivePageIndex, noItemsLabel = _a.noItemsLabel, onRowChecked = _a.onRowChecked, onRowClick = _a.onRowClick, scopedColumns = _a.scopedColumns, selectable = _a.selectable, selected = _a.selected, rest = __rest$1(_a, ["clickableRows", "columnNames", "currentItems", "firstItemOnActivePageIndex", "noItemsLabel", "onRowChecked", "onRowClick", "scopedColumns", "selectable", "selected"]);
|
|
14051
|
+
var colspan = selectable ? columnNames.length + 1 : columnNames.length;
|
|
14052
|
+
return (React$1.createElement(CTableBody, __assign$1({}, (clickableRows && {
|
|
14053
|
+
style: { cursor: 'pointer' },
|
|
14054
|
+
}), rest, { ref: ref }),
|
|
14055
|
+
currentItems.map(function (item, trIndex) {
|
|
14056
|
+
return (React$1.createElement(React$1.Fragment, { key: trIndex },
|
|
14057
|
+
React$1.createElement(CTableRow, __assign$1({}, (item._props && __assign$1({}, item._props)), (clickableRows && { tabIndex: 0 }), { onClick: function (event) {
|
|
14058
|
+
return onRowClick &&
|
|
14059
|
+
onRowClick(item, trIndex + firstItemOnActivePageIndex, getClickedColumnName(event.target, columnNames), event);
|
|
14060
|
+
} }),
|
|
14061
|
+
selectable && (React$1.createElement(CTableDataCell, null,
|
|
14062
|
+
React$1.createElement(CFormCheck, { checked: selected &&
|
|
14063
|
+
isObjectInArray(selected, item, ['_cellProps', '_props', '_selected']), onChange: function (event) {
|
|
14064
|
+
var _item = __assign$1({}, item);
|
|
14065
|
+
delete _item['_cellProps'];
|
|
14066
|
+
delete _item['_props'];
|
|
14067
|
+
delete _item['_selected'];
|
|
14068
|
+
onRowChecked && onRowChecked(_item, event.target.checked);
|
|
14069
|
+
} }))),
|
|
14070
|
+
columnNames.map(function (colName, index) {
|
|
14071
|
+
return ((scopedColumns &&
|
|
14072
|
+
scopedColumns[colName] &&
|
|
14073
|
+
React$1.cloneElement(scopedColumns[colName](item, trIndex + firstItemOnActivePageIndex), {
|
|
14074
|
+
key: index,
|
|
14075
|
+
})) || (React$1.createElement(CTableDataCell, __assign$1({}, getTableDataCellProps(item, colName), { key: index }), String(item[colName]))));
|
|
14076
|
+
})),
|
|
14077
|
+
scopedColumns && scopedColumns.details && (React$1.createElement(React$1.Fragment, null,
|
|
14078
|
+
React$1.createElement(CTableRow, null,
|
|
14079
|
+
React$1.createElement(CTableDataCell, { colSpan: colspan, className: "p-0", style: { borderBottomWidth: 0 }, tabIndex: -1 })),
|
|
14080
|
+
React$1.createElement(CTableRow, { onClick: function (event) {
|
|
14081
|
+
return onRowClick &&
|
|
14082
|
+
onRowClick(item, trIndex + firstItemOnActivePageIndex, getClickedColumnName(event.target, columnNames), true);
|
|
14083
|
+
}, className: "p-0", key: "details".concat(trIndex) },
|
|
14084
|
+
React$1.createElement(CTableDataCell, { colSpan: colspan, className: "p-0", style: { border: 0 } }, scopedColumns.details(item, trIndex + firstItemOnActivePageIndex)))))));
|
|
14085
|
+
}),
|
|
14086
|
+
!currentItems.length && (React$1.createElement(CTableRow, null,
|
|
14087
|
+
React$1.createElement(CTableDataCell, { colSpan: colspan }, noItemsLabel)))));
|
|
14588
14088
|
});
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
'lg',
|
|
14601
|
-
'xl',
|
|
14602
|
-
'xxl',
|
|
14603
|
-
'3xl',
|
|
14604
|
-
'4xl',
|
|
14605
|
-
'5xl',
|
|
14606
|
-
'6xl',
|
|
14607
|
-
'7xl',
|
|
14608
|
-
'8xl',
|
|
14609
|
-
'9xl',
|
|
14610
|
-
]),
|
|
14611
|
-
title: propTypes.exports.any,
|
|
14612
|
-
use: propTypes.exports.any,
|
|
14613
|
-
width: propTypes.exports.number,
|
|
14089
|
+
CSmartTableBody.propTypes = {
|
|
14090
|
+
clickableRows: propTypesExports.bool,
|
|
14091
|
+
currentItems: propTypesExports.array.isRequired,
|
|
14092
|
+
firstItemOnActivePageIndex: propTypesExports.number.isRequired,
|
|
14093
|
+
noItemsLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.node]),
|
|
14094
|
+
onRowChecked: propTypesExports.func,
|
|
14095
|
+
onRowClick: propTypesExports.func,
|
|
14096
|
+
columnNames: propTypesExports.array.isRequired,
|
|
14097
|
+
scopedColumns: propTypesExports.object,
|
|
14098
|
+
selectable: propTypesExports.bool,
|
|
14099
|
+
selected: propTypesExports.array,
|
|
14614
14100
|
};
|
|
14615
|
-
|
|
14101
|
+
CSmartTableBody.displayName = 'CSmartTableBody';
|
|
14616
14102
|
|
|
14617
14103
|
var CSmartTableCleaner = React$1.forwardRef(function (_a, ref) {
|
|
14618
14104
|
var _b = _a.content, content = _b === void 0 ? React$1.createElement(CIcon, { width: 18, icon: cilFilterX }) : _b, isFiltered = _a.isFiltered, rest = __rest$1(_a, ["content", "isFiltered"]);
|
|
@@ -14627,23 +14113,20 @@ CSmartTableCleaner.propTypes = {
|
|
|
14627
14113
|
};
|
|
14628
14114
|
CSmartTableCleaner.displayName = 'CSmartTableCleaner';
|
|
14629
14115
|
|
|
14630
|
-
var CSmartTableFilter = React$1.forwardRef(function (_a, ref) {
|
|
14631
|
-
var filterLabel = _a.filterLabel, filterPlaceholder = _a.filterPlaceholder, value = _a.value, rest = __rest$1(_a, ["filterLabel", "filterPlaceholder", "value"]);
|
|
14632
|
-
return (React$1.createElement("div", { className: "row mb-2" },
|
|
14633
|
-
React$1.createElement(CFormLabel, { className: "col-sm-auto col-form-label" }, filterLabel),
|
|
14634
|
-
React$1.createElement("div", { className: "col-sm-auto" },
|
|
14635
|
-
React$1.createElement(CFormInput, __assign$1({ placeholder: filterPlaceholder, value: value }, rest, { ref: ref })))));
|
|
14636
|
-
});
|
|
14637
|
-
CSmartTableFilter.propTypes = {
|
|
14638
|
-
filterLabel: propTypesExports.string,
|
|
14639
|
-
filterPlaceholder: propTypesExports.string,
|
|
14640
|
-
value: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string]),
|
|
14641
|
-
};
|
|
14642
|
-
CSmartTableFilter.displayName = 'CSmartTableFilter';
|
|
14643
|
-
|
|
14644
14116
|
var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
|
|
14645
|
-
var columnFilter = _a.columnFilter, columnFilterState = _a.columnFilterState, columnSorter = _a.columnSorter, _b = _a.component, Component = _b === void 0 ? CTableHead : _b, columns = _a.columns, handleOnCustomFilterChange = _a.handleOnCustomFilterChange, handleFilterOnChange = _a.handleFilterOnChange, handleFilterOnInput = _a.handleFilterOnInput, handleSelectAllChecked = _a.handleSelectAllChecked, handleSort = _a.handleSort, items = _a.items, selectable = _a.selectable, selectAll = _a.selectAll, sorterState = _a.sorterState, sortingIcon = _a.sortingIcon, sortingIconAscending = _a.sortingIconAscending, sortingIconDescending = _a.sortingIconDescending, rest = __rest$1(_a, ["columnFilter", "columnFilterState", "columnSorter", "component", "columns", "handleOnCustomFilterChange", "handleFilterOnChange", "handleFilterOnInput", "handleSelectAllChecked", "handleSort", "items", "selectable", "selectAll", "sorterState", "sortingIcon", "sortingIconAscending", "sortingIconDescending"]);
|
|
14117
|
+
var columnFilter = _a.columnFilter, columnFilterState = _a.columnFilterState, columnSorter = _a.columnSorter, _b = _a.component, Component = _b === void 0 ? CTableHead : _b, columns = _a.columns, handleOnCustomFilterChange = _a.handleOnCustomFilterChange, handleFilterOnChange = _a.handleFilterOnChange, handleFilterOnInput = _a.handleFilterOnInput, handleSelectAllChecked = _a.handleSelectAllChecked, handleSort = _a.handleSort, items = _a.items, selectable = _a.selectable, selectAll = _a.selectAll, selectedAll = _a.selectedAll, sorterState = _a.sorterState, sortingIcon = _a.sortingIcon, sortingIconAscending = _a.sortingIconAscending, sortingIconDescending = _a.sortingIconDescending, rest = __rest$1(_a, ["columnFilter", "columnFilterState", "columnSorter", "component", "columns", "handleOnCustomFilterChange", "handleFilterOnChange", "handleFilterOnInput", "handleSelectAllChecked", "handleSort", "items", "selectable", "selectAll", "selectedAll", "sorterState", "sortingIcon", "sortingIconAscending", "sortingIconDescending"]);
|
|
14118
|
+
var selectAllcheckboxRef = React$1.useRef(null);
|
|
14646
14119
|
var _c = React$1.useState(false), refresh = _c[0], setRefresh = _c[1];
|
|
14120
|
+
React$1.useEffect(function () {
|
|
14121
|
+
if (selectedAll === 'indeterminate') {
|
|
14122
|
+
if (selectAllcheckboxRef.current)
|
|
14123
|
+
selectAllcheckboxRef.current.indeterminate = true;
|
|
14124
|
+
}
|
|
14125
|
+
else {
|
|
14126
|
+
if (selectAllcheckboxRef.current)
|
|
14127
|
+
selectAllcheckboxRef.current.indeterminate = false;
|
|
14128
|
+
}
|
|
14129
|
+
}, [selectedAll]);
|
|
14647
14130
|
React$1.useEffect(function () {
|
|
14648
14131
|
if (columnFilterState && Object.keys(columnFilterState).length === 0) {
|
|
14649
14132
|
setRefresh(true);
|
|
@@ -14657,83 +14140,24 @@ var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
|
|
|
14657
14140
|
setRefresh(false);
|
|
14658
14141
|
}
|
|
14659
14142
|
}, [refresh]);
|
|
14660
|
-
var tableHeaderCellProps = function (column) {
|
|
14661
|
-
if (typeof column === 'object' && column._props) {
|
|
14662
|
-
return column._props;
|
|
14663
|
-
}
|
|
14664
|
-
return {};
|
|
14665
|
-
};
|
|
14666
|
-
var tableHeaderCellStyles = function (column) {
|
|
14667
|
-
var style = { verticalAlign: 'middle', overflow: 'hidden', cursor: '' };
|
|
14668
|
-
if (columnSorter &&
|
|
14669
|
-
(typeof column !== 'object' ||
|
|
14670
|
-
(typeof column === 'object' && (typeof column.sorter === 'undefined' || column.sorter)))) {
|
|
14671
|
-
style.cursor = 'pointer';
|
|
14672
|
-
}
|
|
14673
|
-
if (typeof column === 'object' && column._style) {
|
|
14674
|
-
return __assign$1(__assign$1({}, style), column._style);
|
|
14675
|
-
}
|
|
14676
|
-
return style;
|
|
14677
|
-
};
|
|
14678
|
-
var pretifyName = function (name) {
|
|
14679
|
-
return name
|
|
14680
|
-
.replace(/[-_.]/g, ' ')
|
|
14681
|
-
.replace(/ +/g, ' ')
|
|
14682
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
14683
|
-
.split(' ')
|
|
14684
|
-
.map(function (word) { return word.charAt(0).toUpperCase() + word.slice(1); })
|
|
14685
|
-
.join(' ');
|
|
14686
|
-
};
|
|
14687
|
-
var label = function (column) {
|
|
14688
|
-
return typeof column === 'object'
|
|
14689
|
-
? column.label !== undefined
|
|
14690
|
-
? column.label
|
|
14691
|
-
: pretifyName(column.key)
|
|
14692
|
-
: pretifyName(column);
|
|
14693
|
-
};
|
|
14694
|
-
var key = function (column) { return (typeof column === 'object' ? column.key : column); };
|
|
14695
|
-
var getColumnSorterState = function (key) {
|
|
14696
|
-
if (sorterState && sorterState.column === key) {
|
|
14697
|
-
if (sorterState.state) {
|
|
14698
|
-
return sorterState.state;
|
|
14699
|
-
}
|
|
14700
|
-
return 0;
|
|
14701
|
-
}
|
|
14702
|
-
return 0;
|
|
14703
|
-
};
|
|
14704
|
-
var getValues = function (items, key) {
|
|
14705
|
-
return items.map(function (a) { return a[key]; });
|
|
14706
|
-
};
|
|
14707
14143
|
var columnSorterIcon = function (column) {
|
|
14708
|
-
if (getColumnSorterState(
|
|
14144
|
+
if (getColumnSorterState(getColumnKey(column), sorterState) === 0) {
|
|
14709
14145
|
return React$1.createElement("span", { className: "opacity-25 float-end me-1" }, sortingIcon);
|
|
14710
14146
|
}
|
|
14711
|
-
if (getColumnSorterState(
|
|
14147
|
+
if (getColumnSorterState(getColumnKey(column), sorterState) === 'asc') {
|
|
14712
14148
|
return React$1.createElement("span", { className: "float-end me-1" }, sortingIconAscending);
|
|
14713
14149
|
}
|
|
14714
|
-
if (getColumnSorterState(
|
|
14150
|
+
if (getColumnSorterState(getColumnKey(column), sorterState) === 'desc') {
|
|
14715
14151
|
return React$1.createElement("span", { className: "float-end me-1" }, sortingIconDescending);
|
|
14716
14152
|
}
|
|
14717
14153
|
return;
|
|
14718
14154
|
};
|
|
14719
|
-
var checkboxRef = React$1.useRef(null);
|
|
14720
|
-
React$1.useEffect(function () {
|
|
14721
|
-
if (selectAll === 'indeterminate') {
|
|
14722
|
-
if (checkboxRef.current)
|
|
14723
|
-
checkboxRef.current.indeterminate = true;
|
|
14724
|
-
}
|
|
14725
|
-
else {
|
|
14726
|
-
if (checkboxRef.current)
|
|
14727
|
-
checkboxRef.current.indeterminate = false;
|
|
14728
|
-
}
|
|
14729
|
-
}, [selectAll]);
|
|
14730
14155
|
return (React$1.createElement(Component, __assign$1({}, rest, { ref: ref }),
|
|
14731
14156
|
React$1.createElement(CTableRow, null,
|
|
14732
|
-
selectable && (React$1.createElement(CTableHeaderCell, null,
|
|
14733
|
-
React$1.createElement(CFormCheck, { checked: typeof selectAll === 'boolean' ? selectAll : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: checkboxRef }))),
|
|
14157
|
+
selectable && (React$1.createElement(CTableHeaderCell, null, selectAll && (React$1.createElement(CFormCheck, { checked: typeof selectedAll === 'boolean' ? selectedAll : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: selectAllcheckboxRef })))),
|
|
14734
14158
|
columns.map(function (column, index) {
|
|
14735
|
-
return (React$1.createElement(CTableHeaderCell, __assign$1({},
|
|
14736
|
-
React$1.createElement("div", { className: "d-inline" },
|
|
14159
|
+
return (React$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), { onClick: function () { return handleSort && handleSort(getColumnKey(column), index); }, style: getTableHeaderCellStyles(column, columnSorter), key: index }),
|
|
14160
|
+
React$1.createElement("div", { className: "d-inline" }, getColumnLabel(column)),
|
|
14737
14161
|
columnSorter &&
|
|
14738
14162
|
(typeof column !== 'object'
|
|
14739
14163
|
? true
|
|
@@ -14745,23 +14169,23 @@ var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
|
|
|
14745
14169
|
columnFilter && (React$1.createElement(CTableRow, null,
|
|
14746
14170
|
selectable && React$1.createElement(CTableHeaderCell, null),
|
|
14747
14171
|
columns.map(function (column, index) {
|
|
14748
|
-
return (React$1.createElement(CTableHeaderCell, __assign$1({},
|
|
14172
|
+
return (React$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), { key: index }), (typeof column !== 'object'
|
|
14749
14173
|
? true
|
|
14750
14174
|
: typeof column.filter === 'undefined'
|
|
14751
14175
|
? true
|
|
14752
14176
|
: column.filter) ? (typeof column !== 'string' && typeof column.filter === 'function' ? (!refresh &&
|
|
14753
|
-
column.filter(
|
|
14177
|
+
column.filter(getColumnValues(items, getColumnKey(column)), function (value) {
|
|
14754
14178
|
return handleOnCustomFilterChange &&
|
|
14755
|
-
handleOnCustomFilterChange(
|
|
14179
|
+
handleOnCustomFilterChange(getColumnKey(column), value);
|
|
14756
14180
|
})) : (React$1.createElement(CFormInput, { size: "sm", onInput: function (event) {
|
|
14757
14181
|
return handleFilterOnInput &&
|
|
14758
|
-
handleFilterOnInput(
|
|
14182
|
+
handleFilterOnInput(getColumnKey(column), event.target.value);
|
|
14759
14183
|
}, onChange: function (event) {
|
|
14760
14184
|
return handleFilterOnChange &&
|
|
14761
|
-
handleFilterOnChange(
|
|
14762
|
-
}, value: columnFilterState && columnFilterState[
|
|
14763
|
-
? columnFilterState[
|
|
14764
|
-
: '', "aria-label": "column name: '".concat(
|
|
14185
|
+
handleFilterOnChange(getColumnKey(column), event.target.value);
|
|
14186
|
+
}, value: columnFilterState && columnFilterState[getColumnKey(column)]
|
|
14187
|
+
? columnFilterState[getColumnKey(column)]
|
|
14188
|
+
: '', "aria-label": "column name: '".concat(getColumnLabel(column), "' filter input") }))) : ('')));
|
|
14765
14189
|
})))));
|
|
14766
14190
|
});
|
|
14767
14191
|
CSmartTableHead.propTypes = {
|
|
@@ -14776,7 +14200,8 @@ CSmartTableHead.propTypes = {
|
|
|
14776
14200
|
handleSelectAllChecked: propTypesExports.func,
|
|
14777
14201
|
handleSort: propTypesExports.func,
|
|
14778
14202
|
selectable: propTypesExports.bool,
|
|
14779
|
-
selectAll: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.
|
|
14203
|
+
selectAll: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.object]),
|
|
14204
|
+
selectedAll: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.string]),
|
|
14780
14205
|
sorterState: propTypesExports.object,
|
|
14781
14206
|
sortingIcon: propTypesExports.node,
|
|
14782
14207
|
sortingIconAscending: propTypesExports.node,
|
|
@@ -14784,72 +14209,152 @@ CSmartTableHead.propTypes = {
|
|
|
14784
14209
|
};
|
|
14785
14210
|
CSmartTableHead.displayName = 'CSmartTableHead';
|
|
14786
14211
|
|
|
14787
|
-
var CSmartTableItemsPerPageSelector = React$1.forwardRef(function (_a, ref) {
|
|
14788
|
-
var itemsPerPage = _a.itemsPerPage, itemsPerPageLabel = _a.itemsPerPageLabel, itemsPerPageOptions = _a.itemsPerPageOptions, rest = __rest$1(_a, ["itemsPerPage", "itemsPerPageLabel", "itemsPerPageOptions"]);
|
|
14789
|
-
return (React$1.createElement("div", { className: "row" },
|
|
14790
|
-
React$1.createElement(CFormLabel, { className: "col-auto col-form-label" }, itemsPerPageLabel),
|
|
14791
|
-
React$1.createElement("div", { className: "col-auto" },
|
|
14792
|
-
React$1.createElement(CFormSelect, __assign$1({ defaultValue: itemsPerPage }, rest, { ref: ref }), itemsPerPageOptions &&
|
|
14793
|
-
itemsPerPageOptions.map(function (number, index) {
|
|
14794
|
-
return (React$1.createElement("option", { value: number, key: index }, number));
|
|
14795
|
-
})))));
|
|
14796
|
-
});
|
|
14797
|
-
CSmartTableItemsPerPageSelector.propTypes = {
|
|
14798
|
-
itemsPerPage: propTypesExports.number,
|
|
14799
|
-
itemsPerPageLabel: propTypesExports.string,
|
|
14800
|
-
itemsPerPageOptions: propTypesExports.array,
|
|
14801
|
-
};
|
|
14802
|
-
CSmartTableItemsPerPageSelector.displayName = 'CSmartTableItemsPerPageSelector';
|
|
14803
|
-
|
|
14804
14212
|
var CSmartTable = React$1.forwardRef(function (_a, ref) {
|
|
14805
14213
|
var _b = _a.activePage, activePage = _b === void 0 ? 1 : _b, cleaner = _a.cleaner, clickableRows = _a.clickableRows, columnFilter = _a.columnFilter, columnFilterValue = _a.columnFilterValue, // TODO: consider to use only columnFilter prop
|
|
14806
|
-
columns = _a.columns, columnSorter = _a.columnSorter, footer = _a.footer, _c = _a.header, header = _c === void 0 ? true : _c, items = _a.items, _d = _a.itemsPerPage, itemsPerPage = _d === void 0 ? 10 : _d, _e = _a.itemsPerPageLabel, itemsPerPageLabel = _e === void 0 ? 'Items per page:' : _e, _f = _a.itemsPerPageOptions, itemsPerPageOptions = _f === void 0 ? [5, 10, 20, 50] : _f, itemsPerPageSelect = _a.itemsPerPageSelect, loading = _a.loading, _g = _a.noItemsLabel, noItemsLabel = _g === void 0 ? 'No items found' : _g, onActivePageChange = _a.onActivePageChange, onColumnFilterChange = _a.onColumnFilterChange, onFilteredItemsChange = _a.onFilteredItemsChange, onItemsPerPageChange = _a.onItemsPerPageChange, onRowClick = _a.onRowClick, onSelectedItemsChange = _a.onSelectedItemsChange, onSorterChange = _a.onSorterChange, onTableFilterChange = _a.onTableFilterChange, pagination = _a.pagination, paginationProps = _a.paginationProps, scopedColumns = _a.scopedColumns, selectable = _a.selectable, sorterValue = _a.sorterValue,
|
|
14807
|
-
tableHeadProps = _a.tableHeadProps, tableProps = _a.tableProps, rest = __rest$1(_a, ["activePage", "cleaner", "clickableRows", "columnFilter", "columnFilterValue", "columns", "columnSorter", "footer", "header", "items", "itemsPerPage", "itemsPerPageLabel", "itemsPerPageOptions", "itemsPerPageSelect", "loading", "noItemsLabel", "onActivePageChange", "onColumnFilterChange", "onFilteredItemsChange", "onItemsPerPageChange", "onRowClick", "onSelectedItemsChange", "onSorterChange", "onTableFilterChange", "pagination", "paginationProps", "scopedColumns", "selectable", "sorterValue", "sortingIcon", "sortingIconAscending", "sortingIconDescending", "tableBodyProps", "tableFootProps", "tableFilter", "tableFilterLabel", "tableFilterPlaceholder", "tableFilterValue", "tableHeadProps", "tableProps"]);
|
|
14808
|
-
// instance data
|
|
14214
|
+
columns = _a.columns, columnSorter = _a.columnSorter, elementCover = _a.elementCover, footer = _a.footer, _c = _a.header, header = _c === void 0 ? true : _c, items = _a.items, itemsNumber = _a.itemsNumber, _d = _a.itemsPerPage, itemsPerPage = _d === void 0 ? 10 : _d, _e = _a.itemsPerPageLabel, itemsPerPageLabel = _e === void 0 ? 'Items per page:' : _e, _f = _a.itemsPerPageOptions, itemsPerPageOptions = _f === void 0 ? [5, 10, 20, 50] : _f, itemsPerPageSelect = _a.itemsPerPageSelect, loading = _a.loading, _g = _a.noItemsLabel, noItemsLabel = _g === void 0 ? 'No items found' : _g, onActivePageChange = _a.onActivePageChange, onColumnFilterChange = _a.onColumnFilterChange, onFilteredItemsChange = _a.onFilteredItemsChange, onItemsPerPageChange = _a.onItemsPerPageChange, onRowClick = _a.onRowClick, onSelectAll = _a.onSelectAll, onSelectedItemsChange = _a.onSelectedItemsChange, onSorterChange = _a.onSorterChange, onTableFilterChange = _a.onTableFilterChange, pagination = _a.pagination, paginationProps = _a.paginationProps, scopedColumns = _a.scopedColumns, selected = _a.selected, selectable = _a.selectable, _h = _a.selectAll, selectAll = _h === void 0 ? true : _h, sorterValue = _a.sorterValue, _j = _a.sortingIcon, sortingIcon = _j === void 0 ? React$1.createElement(CIcon, { width: 18, icon: cilSwapVertical, key: "csv" }) : _j, _k = _a.sortingIconAscending, sortingIconAscending = _k === void 0 ? React$1.createElement(CIcon, { width: 18, icon: cilArrowTop, key: "cat" }) : _k, _l = _a.sortingIconDescending, sortingIconDescending = _l === void 0 ? React$1.createElement(CIcon, { width: 18, icon: cilArrowBottom, key: "cab" }) : _l, tableBodyProps = _a.tableBodyProps, tableFootProps = _a.tableFootProps, tableFilter = _a.tableFilter, _m = _a.tableFilterLabel, tableFilterLabel = _m === void 0 ? 'Filter:' : _m, _o = _a.tableFilterPlaceholder, tableFilterPlaceholder = _o === void 0 ? 'type string...' : _o, tableFilterValue = _a.tableFilterValue, // TODO: consider to use only tableFilter prop
|
|
14215
|
+
tableHeadProps = _a.tableHeadProps, tableProps = _a.tableProps, rest = __rest$1(_a, ["activePage", "cleaner", "clickableRows", "columnFilter", "columnFilterValue", "columns", "columnSorter", "elementCover", "footer", "header", "items", "itemsNumber", "itemsPerPage", "itemsPerPageLabel", "itemsPerPageOptions", "itemsPerPageSelect", "loading", "noItemsLabel", "onActivePageChange", "onColumnFilterChange", "onFilteredItemsChange", "onItemsPerPageChange", "onRowClick", "onSelectAll", "onSelectedItemsChange", "onSorterChange", "onTableFilterChange", "pagination", "paginationProps", "scopedColumns", "selected", "selectable", "selectAll", "sorterValue", "sortingIcon", "sortingIconAscending", "sortingIconDescending", "tableBodyProps", "tableFootProps", "tableFilter", "tableFilterLabel", "tableFilterPlaceholder", "tableFilterValue", "tableHeadProps", "tableProps"]);
|
|
14809
14216
|
var mountedRef = React$1.useRef(false);
|
|
14810
|
-
var
|
|
14811
|
-
var
|
|
14812
|
-
var
|
|
14813
|
-
var
|
|
14814
|
-
var
|
|
14815
|
-
var
|
|
14816
|
-
var
|
|
14217
|
+
var _p = React$1.useState(activePage), _activePage = _p[0], setActivePage = _p[1];
|
|
14218
|
+
var _q = React$1.useState([]), _items = _q[0], setItems = _q[1];
|
|
14219
|
+
var _r = React$1.useState(itemsNumber), _itemsNumber = _r[0], setItemsNumber = _r[1];
|
|
14220
|
+
var _s = React$1.useState(itemsPerPage), _itemsPerPage = _s[0], setItemsPerPage = _s[1];
|
|
14221
|
+
var _t = React$1.useState([]), _selected = _t[0], setSelected = _t[1];
|
|
14222
|
+
var _u = React$1.useState({}), columnFilterState = _u[0], setColumnFilterState = _u[1];
|
|
14223
|
+
var _v = React$1.useState(), selectedAll = _v[0], setSelectedAll = _v[1];
|
|
14224
|
+
var _w = React$1.useState({}), sorterState = _w[0], setSorterState = _w[1];
|
|
14225
|
+
var _x = React$1.useState(tableFilterValue ? tableFilterValue : ''), tableFilterState = _x[0], setTableFilterState = _x[1];
|
|
14817
14226
|
React$1.useEffect(function () {
|
|
14818
14227
|
setActivePage(activePage);
|
|
14819
14228
|
}, [activePage]);
|
|
14820
|
-
|
|
14821
|
-
React$1.useMemo(function () {
|
|
14229
|
+
React$1.useEffect(function () {
|
|
14822
14230
|
if (items && items.length < _itemsPerPage * _activePage - _itemsPerPage) {
|
|
14823
14231
|
setActivePage(1);
|
|
14824
14232
|
}
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14233
|
+
items &&
|
|
14234
|
+
items.forEach(function (item) {
|
|
14235
|
+
if (item._selected) {
|
|
14236
|
+
var _item = __assign$1({}, item);
|
|
14237
|
+
delete _item['_cellProps'];
|
|
14238
|
+
delete _item['_props'];
|
|
14239
|
+
delete _item['_selected'];
|
|
14240
|
+
setSelected(__spreadArray(__spreadArray([], _selected, true), [_item], false));
|
|
14241
|
+
}
|
|
14242
|
+
});
|
|
14243
|
+
if (Array.isArray(items)) {
|
|
14244
|
+
setItems(items);
|
|
14245
|
+
setItemsNumber(itemsNumber || items.length);
|
|
14246
|
+
}
|
|
14830
14247
|
}, [JSON.stringify(items)]);
|
|
14831
|
-
React$1.
|
|
14248
|
+
React$1.useEffect(function () {
|
|
14249
|
+
Array.isArray(selected) && setSelected(selected);
|
|
14250
|
+
}, [JSON.stringify(selected)]);
|
|
14251
|
+
React$1.useEffect(function () {
|
|
14252
|
+
itemsNumber && setItemsNumber(itemsNumber);
|
|
14253
|
+
}, [itemsNumber]);
|
|
14254
|
+
React$1.useEffect(function () {
|
|
14832
14255
|
columnFilterValue && setColumnFilterState(columnFilterValue);
|
|
14833
14256
|
}, [JSON.stringify(columnFilterValue)]);
|
|
14834
|
-
React$1.
|
|
14257
|
+
React$1.useEffect(function () {
|
|
14835
14258
|
setSorterState(__assign$1({}, sorterValue));
|
|
14836
14259
|
}, [JSON.stringify(sorterValue)]);
|
|
14837
|
-
React$1.
|
|
14838
|
-
|
|
14839
|
-
|
|
14840
|
-
|
|
14841
|
-
|
|
14842
|
-
|
|
14843
|
-
|
|
14844
|
-
|
|
14845
|
-
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
|
|
14850
|
-
};
|
|
14851
|
-
|
|
14852
|
-
|
|
14260
|
+
React$1.useEffect(function () { return setItemsPerPage(itemsPerPage); }, [itemsPerPage]);
|
|
14261
|
+
React$1.useEffect(function () {
|
|
14262
|
+
mountedRef.current && onActivePageChange && onActivePageChange(_activePage);
|
|
14263
|
+
}, [_activePage]);
|
|
14264
|
+
React$1.useEffect(function () {
|
|
14265
|
+
mountedRef.current && onItemsPerPageChange && onItemsPerPageChange(_itemsPerPage);
|
|
14266
|
+
itemsPerPage !== _itemsPerPage && setActivePage(1); // TODO: set proper page after _itemsPerPage update
|
|
14267
|
+
}, [_itemsPerPage]);
|
|
14268
|
+
React$1.useEffect(function () {
|
|
14269
|
+
mountedRef.current && sorterState && onSorterChange && onSorterChange(sorterState);
|
|
14270
|
+
}, [JSON.stringify(sorterState)]);
|
|
14271
|
+
React$1.useEffect(function () {
|
|
14272
|
+
mountedRef.current && onColumnFilterChange && onColumnFilterChange(columnFilterState);
|
|
14273
|
+
}, [columnFilterState]);
|
|
14274
|
+
React$1.useEffect(function () {
|
|
14275
|
+
mountedRef.current && onTableFilterChange && onTableFilterChange(tableFilterState);
|
|
14276
|
+
}, [tableFilterState]);
|
|
14277
|
+
React$1.useEffect(function () {
|
|
14278
|
+
if (selectable) {
|
|
14279
|
+
onSelectedItemsChange && onSelectedItemsChange(_selected);
|
|
14280
|
+
if (_selected.length === _itemsNumber) {
|
|
14281
|
+
setSelectedAll(true);
|
|
14282
|
+
return;
|
|
14283
|
+
}
|
|
14284
|
+
if (_selected.length === 0) {
|
|
14285
|
+
setSelectedAll(false);
|
|
14286
|
+
return;
|
|
14287
|
+
}
|
|
14288
|
+
if (_selected.length !== 0 && _selected.length !== _itemsNumber) {
|
|
14289
|
+
setSelectedAll('indeterminate');
|
|
14290
|
+
}
|
|
14291
|
+
}
|
|
14292
|
+
}, [JSON.stringify(_selected), _itemsNumber]);
|
|
14293
|
+
var columnNames = React$1.useMemo(function () { return getColumnNames(columns, _items); }, [columns, _items]);
|
|
14294
|
+
var itemsDataColumns = React$1.useMemo(function () { return columnNames.filter(function (name) { return getColumnNamesFromItems(_items).includes(name); }); }, [columnNames, _items]);
|
|
14295
|
+
var filteredColumns = React$1.useMemo(function () { return filterColumns(_items, columnFilter, columnFilterState, itemsDataColumns); }, [columnFilterState, JSON.stringify(_items)]);
|
|
14296
|
+
var filteredTable = React$1.useMemo(function () { return filterTable(filteredColumns, tableFilter, tableFilterState, itemsDataColumns); }, [tableFilterState, JSON.stringify(tableFilterValue), JSON.stringify(filteredColumns)]);
|
|
14297
|
+
var sortedItems = React$1.useMemo(function () { return sortItems(columnSorter, filteredTable, itemsDataColumns, sorterState); }, [
|
|
14298
|
+
JSON.stringify(filteredTable),
|
|
14299
|
+
JSON.stringify(sorterState),
|
|
14300
|
+
JSON.stringify(columnSorter),
|
|
14301
|
+
JSON.stringify(filteredColumns),
|
|
14302
|
+
JSON.stringify(_items),
|
|
14303
|
+
]);
|
|
14304
|
+
var numberOfPages = _itemsPerPage ? Math.ceil(sortedItems.length / _itemsPerPage) : 1;
|
|
14305
|
+
var firstItemOnActivePageIndex = _activePage ? (_activePage - 1) * _itemsPerPage : 0;
|
|
14306
|
+
var currentItems = _activePage
|
|
14307
|
+
? sortedItems.slice(firstItemOnActivePageIndex, firstItemOnActivePageIndex + _itemsPerPage)
|
|
14308
|
+
: sortedItems;
|
|
14309
|
+
React$1.useEffect(function () {
|
|
14310
|
+
mountedRef.current && onFilteredItemsChange && onFilteredItemsChange(sortedItems);
|
|
14311
|
+
}, [JSON.stringify(sortedItems)]);
|
|
14312
|
+
var handleClean = function () {
|
|
14313
|
+
setTableFilterState('');
|
|
14314
|
+
setColumnFilterState({});
|
|
14315
|
+
setSorterState({});
|
|
14316
|
+
};
|
|
14317
|
+
var handleColumnFilterChange = function (colName, value, type) {
|
|
14318
|
+
var _a;
|
|
14319
|
+
var isLazy = columnFilter && typeof columnFilter === 'object' && columnFilter.lazy === true;
|
|
14320
|
+
if ((isLazy && type === 'input') || (!isLazy && type === 'change')) {
|
|
14321
|
+
return;
|
|
14322
|
+
}
|
|
14323
|
+
var newState = __assign$1(__assign$1({}, columnFilterState), (_a = {}, _a["".concat(colName)] = value, _a));
|
|
14324
|
+
setActivePage(1);
|
|
14325
|
+
setColumnFilterState(newState);
|
|
14326
|
+
};
|
|
14327
|
+
var handleItemsPerPageChange = function (event) {
|
|
14328
|
+
if (typeof itemsPerPageSelect !== 'object' ||
|
|
14329
|
+
(typeof itemsPerPageSelect === 'object' && !itemsPerPageSelect.external)) {
|
|
14330
|
+
setItemsPerPage(Number(event.target.value));
|
|
14331
|
+
}
|
|
14332
|
+
};
|
|
14333
|
+
var handleRowChecked = function (item, value) {
|
|
14334
|
+
if (value && !isObjectInArray(_selected, item, ['_cellProps', '_props', '_selected'])) {
|
|
14335
|
+
setSelected(__spreadArray(__spreadArray([], _selected, true), [item], false));
|
|
14336
|
+
return;
|
|
14337
|
+
}
|
|
14338
|
+
setSelected(_selected.filter(function (_item) { return !isObjectInArray([_item], item, ['_cellProps', '_props', '_selected']); }));
|
|
14339
|
+
};
|
|
14340
|
+
var handleSelectAllChecked = function () {
|
|
14341
|
+
if (selectedAll === true) {
|
|
14342
|
+
setSelected([]);
|
|
14343
|
+
return;
|
|
14344
|
+
}
|
|
14345
|
+
onSelectAll && onSelectAll();
|
|
14346
|
+
if (selectAll && typeof selectAll === 'object' && selectAll.external) {
|
|
14347
|
+
return;
|
|
14348
|
+
}
|
|
14349
|
+
setSelected(_items.map(function (item) {
|
|
14350
|
+
delete item['_cellProps'];
|
|
14351
|
+
delete item['_props'];
|
|
14352
|
+
delete item['_selected'];
|
|
14353
|
+
return item;
|
|
14354
|
+
}));
|
|
14355
|
+
};
|
|
14356
|
+
var handleSorterChange = function (column, index) {
|
|
14357
|
+
if (!isSortable(index, columns, columnSorter, itemsDataColumns, columnNames)) {
|
|
14853
14358
|
return;
|
|
14854
14359
|
}
|
|
14855
14360
|
//if column changed or sort was descending change asc to true
|
|
@@ -14876,22 +14381,7 @@ var CSmartTable = React$1.forwardRef(function (_a, ref) {
|
|
|
14876
14381
|
}
|
|
14877
14382
|
setSorterState(__assign$1({}, state));
|
|
14878
14383
|
};
|
|
14879
|
-
var
|
|
14880
|
-
if (typeof itemsPerPageSelect !== 'object' ||
|
|
14881
|
-
(typeof itemsPerPageSelect === 'object' && !itemsPerPageSelect.external))
|
|
14882
|
-
setItemsPerPage(Number(event.target.value));
|
|
14883
|
-
};
|
|
14884
|
-
var columnFilterChange = function (colName, value, type) {
|
|
14885
|
-
var _a;
|
|
14886
|
-
var isLazy = columnFilter && typeof columnFilter === 'object' && columnFilter.lazy === true;
|
|
14887
|
-
if ((isLazy && type === 'input') || (!isLazy && type === 'change')) {
|
|
14888
|
-
return;
|
|
14889
|
-
}
|
|
14890
|
-
var newState = __assign$1(__assign$1({}, columnFilterState), (_a = {}, _a["".concat(colName)] = value, _a));
|
|
14891
|
-
setActivePage(1);
|
|
14892
|
-
setColumnFilterState(newState);
|
|
14893
|
-
};
|
|
14894
|
-
var tableFilterChange = function (value, type) {
|
|
14384
|
+
var handleTableFilterChange = function (value, type) {
|
|
14895
14385
|
var isLazy = tableFilter && typeof tableFilter === 'object' && tableFilter.lazy === true;
|
|
14896
14386
|
if ((isLazy && type === 'input') || (!isLazy && type === 'change')) {
|
|
14897
14387
|
return;
|
|
@@ -14899,169 +14389,55 @@ var CSmartTable = React$1.forwardRef(function (_a, ref) {
|
|
|
14899
14389
|
setActivePage(1);
|
|
14900
14390
|
setTableFilterState(value);
|
|
14901
14391
|
};
|
|
14902
|
-
var clean = function () {
|
|
14903
|
-
setTableFilterState('');
|
|
14904
|
-
setColumnFilterState({});
|
|
14905
|
-
setSorterState({});
|
|
14906
|
-
};
|
|
14907
|
-
// computed
|
|
14908
|
-
var genCols = Object.keys(_items[0] || {}).filter(function (el) { return el.charAt(0) !== '_'; });
|
|
14909
|
-
var rawColumnNames = columns
|
|
14910
|
-
? columns.map(function (column) {
|
|
14911
|
-
if (typeof column === 'object')
|
|
14912
|
-
return column.key;
|
|
14913
|
-
else
|
|
14914
|
-
return column;
|
|
14915
|
-
})
|
|
14916
|
-
: genCols; //! || el
|
|
14917
|
-
var itemsDataColumns = rawColumnNames.filter(function (name) { return genCols.includes(name); });
|
|
14918
|
-
// variables
|
|
14919
|
-
var filteredColumns = React$1.useMemo(function () {
|
|
14920
|
-
var items = _items;
|
|
14921
|
-
if (columnFilter && typeof columnFilter === 'object' && columnFilter.external) {
|
|
14922
|
-
return items;
|
|
14923
|
-
}
|
|
14924
|
-
Object.entries(columnFilterState).forEach(function (_a) {
|
|
14925
|
-
var key = _a[0], value = _a[1];
|
|
14926
|
-
if (value instanceof Function) {
|
|
14927
|
-
items = items.filter(function (item) { return value(item[key]); });
|
|
14928
|
-
return;
|
|
14929
|
-
}
|
|
14930
|
-
var columnFilter = String(value).toLowerCase();
|
|
14931
|
-
if (columnFilter && itemsDataColumns.includes(key)) {
|
|
14932
|
-
items = items.filter(function (item) {
|
|
14933
|
-
return String(item[key]).toLowerCase().includes(columnFilter);
|
|
14934
|
-
});
|
|
14935
|
-
}
|
|
14936
|
-
});
|
|
14937
|
-
return items;
|
|
14938
|
-
}, [columnFilterState, JSON.stringify(_items)]);
|
|
14939
|
-
var filteredTable = React$1.useMemo(function () {
|
|
14940
|
-
var items = filteredColumns;
|
|
14941
|
-
if (!tableFilterState ||
|
|
14942
|
-
(tableFilter && typeof tableFilter === 'object' && tableFilter.external)) {
|
|
14943
|
-
return items;
|
|
14944
|
-
}
|
|
14945
|
-
var filter = tableFilterState.toLowerCase();
|
|
14946
|
-
var valueContainFilter = function (val) { return String(val).toLowerCase().includes(filter); };
|
|
14947
|
-
items = items.filter(function (item) {
|
|
14948
|
-
return !!itemsDataColumns.find(function (key) { return valueContainFilter(item[key]); });
|
|
14949
|
-
});
|
|
14950
|
-
return items;
|
|
14951
|
-
}, [tableFilterState, JSON.stringify(tableFilterValue), JSON.stringify(filteredColumns)]);
|
|
14952
|
-
var sortedItems = React$1.useMemo(function () {
|
|
14953
|
-
var col = sorterState === null || sorterState === void 0 ? void 0 : sorterState.column;
|
|
14954
|
-
if (!col ||
|
|
14955
|
-
!itemsDataColumns.includes(col) ||
|
|
14956
|
-
(columnSorter && typeof columnSorter === 'object' && columnSorter.external)) {
|
|
14957
|
-
return filteredTable;
|
|
14958
|
-
}
|
|
14959
|
-
var flip = sorterState.state === 'asc' ? 1 : sorterState.state === 'desc' ? -1 : 0;
|
|
14960
|
-
var sorted = filteredTable.slice().sort(function (item, item2) {
|
|
14961
|
-
var value = item[col];
|
|
14962
|
-
var value2 = item2[col];
|
|
14963
|
-
var a = typeof value === 'number' ? value : String(value).toLowerCase();
|
|
14964
|
-
var b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase();
|
|
14965
|
-
return a > b ? 1 * flip : b > a ? -1 * flip : 0;
|
|
14966
|
-
});
|
|
14967
|
-
return sorted;
|
|
14968
|
-
}, [
|
|
14969
|
-
JSON.stringify(filteredTable),
|
|
14970
|
-
JSON.stringify(sorterState),
|
|
14971
|
-
JSON.stringify(columnSorter),
|
|
14972
|
-
JSON.stringify(filteredColumns),
|
|
14973
|
-
JSON.stringify(_items),
|
|
14974
|
-
]);
|
|
14975
|
-
var numberOfPages = _itemsPerPage ? Math.ceil(sortedItems.length / _itemsPerPage) : 1;
|
|
14976
|
-
var firstItemOnActivePageIndex = _activePage ? (_activePage - 1) * _itemsPerPage : 0;
|
|
14977
|
-
var itemsOnActivePage = sortedItems.slice(firstItemOnActivePageIndex, firstItemOnActivePageIndex + _itemsPerPage);
|
|
14978
|
-
var currentItems = _activePage ? itemsOnActivePage : sortedItems;
|
|
14979
|
-
var isFiltered = tableFilterState || (sorterState === null || sorterState === void 0 ? void 0 : sorterState.column) || Object.values(columnFilterState).join('');
|
|
14980
|
-
// effects
|
|
14981
|
-
React$1.useEffect(function () {
|
|
14982
|
-
mountedRef.current && onActivePageChange && onActivePageChange(_activePage);
|
|
14983
|
-
}, [_activePage]);
|
|
14984
|
-
React$1.useEffect(function () {
|
|
14985
|
-
mountedRef.current && onItemsPerPageChange && onItemsPerPageChange(_itemsPerPage);
|
|
14986
|
-
itemsPerPage !== _itemsPerPage && setActivePage(1); // TODO: set proper page after _itemsPerPage update
|
|
14987
|
-
}, [_itemsPerPage]);
|
|
14988
|
-
React$1.useEffect(function () {
|
|
14989
|
-
mountedRef.current && sorterState && onSorterChange && onSorterChange(sorterState);
|
|
14990
|
-
}, [JSON.stringify(sorterState)]);
|
|
14991
|
-
React$1.useEffect(function () {
|
|
14992
|
-
mountedRef.current && onColumnFilterChange && onColumnFilterChange(columnFilterState);
|
|
14993
|
-
}, [columnFilterState]);
|
|
14994
|
-
React$1.useEffect(function () {
|
|
14995
|
-
mountedRef.current && onTableFilterChange && onTableFilterChange(tableFilterState);
|
|
14996
|
-
}, [tableFilterState]);
|
|
14997
|
-
React$1.useEffect(function () {
|
|
14998
|
-
mountedRef.current && onFilteredItemsChange && onFilteredItemsChange(sortedItems);
|
|
14999
|
-
}, [JSON.stringify(sortedItems)]);
|
|
15000
|
-
var handleRowChecked = function (id, value) {
|
|
15001
|
-
var newArr = __spreadArray([], _items, true);
|
|
15002
|
-
newArr[id]._selected = value;
|
|
15003
|
-
setItems(newArr);
|
|
15004
|
-
};
|
|
15005
|
-
var handleSelectAllChecked = function () {
|
|
15006
|
-
if (selectedAll === true) {
|
|
15007
|
-
setItems(_items.map(function (item) {
|
|
15008
|
-
return __assign$1(__assign$1({}, item), { _selected: false });
|
|
15009
|
-
}));
|
|
15010
|
-
return;
|
|
15011
|
-
}
|
|
15012
|
-
setItems(_items.map(function (item) {
|
|
15013
|
-
return __assign$1(__assign$1({}, item), { _selected: true });
|
|
15014
|
-
}));
|
|
15015
|
-
};
|
|
15016
|
-
React$1.useEffect(function () {
|
|
15017
|
-
if (selectable) {
|
|
15018
|
-
var selected = _items.filter(function (item) { return item._selected === true; });
|
|
15019
|
-
onSelectedItemsChange && onSelectedItemsChange(selected);
|
|
15020
|
-
if (selected.length === _items.length) {
|
|
15021
|
-
setSelectedAll(true);
|
|
15022
|
-
return;
|
|
15023
|
-
}
|
|
15024
|
-
if (selected.length === 0) {
|
|
15025
|
-
setSelectedAll(false);
|
|
15026
|
-
return;
|
|
15027
|
-
}
|
|
15028
|
-
if (selected.length !== 0 && selected.length !== _items.length) {
|
|
15029
|
-
setSelectedAll('indeterminate');
|
|
15030
|
-
}
|
|
15031
|
-
}
|
|
15032
|
-
}, [_items]);
|
|
15033
14392
|
React$1.useEffect(function () {
|
|
15034
14393
|
mountedRef.current = true;
|
|
15035
14394
|
}, []);
|
|
15036
14395
|
return (React$1.createElement(React$1.Fragment, null,
|
|
15037
14396
|
React$1.createElement("div", __assign$1({}, rest, { ref: ref }), (itemsPerPageSelect || tableFilter || cleaner) && (React$1.createElement("div", { className: "row my-2 mx-0" }, (tableFilter || cleaner) && (React$1.createElement(React$1.Fragment, null,
|
|
15038
|
-
React$1.createElement("div", { className: "col-auto p-0" }, tableFilter && (React$1.createElement(
|
|
15039
|
-
|
|
15040
|
-
|
|
15041
|
-
|
|
15042
|
-
|
|
15043
|
-
|
|
14397
|
+
React$1.createElement("div", { className: "col-auto p-0" }, tableFilter && (React$1.createElement("div", { className: "row mb-2" },
|
|
14398
|
+
React$1.createElement(CFormLabel, { className: "col-sm-auto col-form-label" }, tableFilterLabel),
|
|
14399
|
+
React$1.createElement("div", { className: "col-sm-auto" },
|
|
14400
|
+
React$1.createElement(CFormInput, { onInput: function (e) {
|
|
14401
|
+
handleTableFilterChange(e.target.value, 'input');
|
|
14402
|
+
}, onChange: function (e) {
|
|
14403
|
+
handleTableFilterChange(e.target.value, 'change');
|
|
14404
|
+
}, placeholder: tableFilterPlaceholder, value: tableFilterState || '' }))))),
|
|
14405
|
+
React$1.createElement("div", { className: "col-auto p-0" }, cleaner && (React$1.createElement(CSmartTableCleaner, { isFiltered: tableFilterState ||
|
|
14406
|
+
(sorterState === null || sorterState === void 0 ? void 0 : sorterState.column) ||
|
|
14407
|
+
Object.values(columnFilterState).join(''), onClick: function () { return handleClean(); }, onKeyUp: function (event) {
|
|
15044
14408
|
if (event.key === 'Enter')
|
|
15045
|
-
|
|
14409
|
+
handleClean();
|
|
15046
14410
|
} })))))))),
|
|
15047
14411
|
React$1.createElement("div", { className: "position-relative" },
|
|
15048
14412
|
React$1.createElement(CTable, __assign$1({}, tableProps),
|
|
15049
|
-
header && (React$1.createElement(CSmartTableHead, __assign$1({}, tableHeadProps, { columnFilter: columnFilter, columnFilterState: columnFilterState, columns: columns ? columns :
|
|
14413
|
+
header && (React$1.createElement(CSmartTableHead, __assign$1({}, tableHeadProps, { columnFilter: columnFilter, columnFilterState: columnFilterState, columns: columns ? columns : columnNames, columnSorter: columnSorter, items: _items, selectable: selectable, selectAll: selectAll, selectedAll: selectedAll, sorterState: sorterState, sortingIcon: sortingIcon, sortingIconAscending: sortingIconAscending, sortingIconDescending: sortingIconDescending, handleFilterOnChange: function (key, event) {
|
|
14414
|
+
return handleColumnFilterChange(key, event, 'change');
|
|
14415
|
+
}, handleFilterOnInput: function (key, event) { return handleColumnFilterChange(key, event, 'input'); }, handleOnCustomFilterChange: function (key, event) { return handleColumnFilterChange(key, event); }, handleSelectAllChecked: function () { return handleSelectAllChecked(); }, handleSort: function (key, index) { return handleSorterChange(key, index); } }))),
|
|
15050
14416
|
React$1.createElement(CSmartTableBody, __assign$1({ clickableRows: clickableRows, currentItems: currentItems, firstItemOnActivePageIndex: firstItemOnActivePageIndex, noItemsLabel: noItemsLabel, onRowClick: function (item, index, columnName, event) {
|
|
15051
14417
|
return clickableRows && onRowClick && onRowClick(item, index, columnName, event);
|
|
15052
|
-
}, onRowChecked: function (
|
|
15053
|
-
footer && (React$1.createElement(CSmartTableHead, __assign$1({ component: CTableFoot }, tableFootProps, { columnFilter: false, columnSorter: false, columns: columns ? columns :
|
|
14418
|
+
}, onRowChecked: function (item, value) { return handleRowChecked(item, value); }, columnNames: columnNames, scopedColumns: scopedColumns, selectable: selectable, selected: _selected }, tableBodyProps)),
|
|
14419
|
+
typeof footer === 'boolean' && footer && (React$1.createElement(CSmartTableHead, __assign$1({ component: CTableFoot }, tableFootProps, { columnFilter: false, columnSorter: false, columns: columns ? columns : columnNames, items: _items, handleSelectAllChecked: function () { return handleSelectAllChecked(); }, selectable: selectable, selectAll: selectAll, selectedAll: selectedAll }))),
|
|
14420
|
+
Array.isArray(footer) && (React$1.createElement(CTableFoot, __assign$1({}, tableFootProps),
|
|
14421
|
+
React$1.createElement(CTableRow, null, footer.map(function (item, index) { return (React$1.createElement(CTableDataCell, __assign$1({}, (typeof item === 'object' && item._props && __assign$1({}, item._props)), { key: index }), typeof item === 'object' ? item.label : item)); }))))),
|
|
15054
14422
|
loading && (React$1.createElement(CElementCover, { boundaries: [
|
|
15055
|
-
{ sides: ['top'], query: '
|
|
14423
|
+
{ sides: ['top'], query: 'tbody' },
|
|
15056
14424
|
{ sides: ['bottom'], query: 'tbody' },
|
|
15057
|
-
] }))),
|
|
14425
|
+
] }, elementCover))),
|
|
15058
14426
|
(pagination || itemsPerPageSelect) && (React$1.createElement("div", { className: "row" },
|
|
15059
14427
|
React$1.createElement("div", { className: "col" }, ((pagination && numberOfPages > 1) || paginationProps) && (React$1.createElement(CSmartPagination, __assign$1({ activePage: _activePage, onActivePageChange: function (page) {
|
|
15060
14428
|
pagination && typeof pagination === 'object' && pagination.external
|
|
15061
14429
|
? onActivePageChange && onActivePageChange(page)
|
|
15062
14430
|
: setActivePage(page);
|
|
15063
14431
|
}, pages: numberOfPages }, paginationProps)))),
|
|
15064
|
-
React$1.createElement("div", { className: "col-auto ms-auto" }, itemsPerPageSelect && (React$1.createElement(
|
|
14432
|
+
React$1.createElement("div", { className: "col-auto ms-auto" }, itemsPerPageSelect && (React$1.createElement("div", { className: "row" },
|
|
14433
|
+
React$1.createElement(CFormLabel, { className: "col-auto col-form-label" }, itemsPerPageLabel),
|
|
14434
|
+
React$1.createElement("div", { className: "col-auto" },
|
|
14435
|
+
React$1.createElement(CFormSelect, { defaultValue: _itemsPerPage, onChange: function (event) {
|
|
14436
|
+
return handleItemsPerPageChange(event);
|
|
14437
|
+
} }, itemsPerPageOptions &&
|
|
14438
|
+
itemsPerPageOptions.map(function (number, index) {
|
|
14439
|
+
return (React$1.createElement("option", { value: number, key: index }, number));
|
|
14440
|
+
}))))))))));
|
|
15065
14441
|
});
|
|
15066
14442
|
CSmartTable.propTypes = {
|
|
15067
14443
|
activePage: propTypesExports.number,
|
|
@@ -15071,9 +14447,11 @@ CSmartTable.propTypes = {
|
|
|
15071
14447
|
columnFilterValue: propTypesExports.object,
|
|
15072
14448
|
columns: propTypesExports.array,
|
|
15073
14449
|
columnSorter: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.object]),
|
|
15074
|
-
|
|
14450
|
+
elementCover: propTypesExports.node,
|
|
14451
|
+
footer: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.array]),
|
|
15075
14452
|
header: propTypesExports.bool,
|
|
15076
14453
|
items: propTypesExports.array,
|
|
14454
|
+
itemsNumber: propTypesExports.number,
|
|
15077
14455
|
itemsPerPage: propTypesExports.number,
|
|
15078
14456
|
itemsPerPageLabel: propTypesExports.string,
|
|
15079
14457
|
itemsPerPageOptions: propTypesExports.array,
|
|
@@ -15085,6 +14463,7 @@ CSmartTable.propTypes = {
|
|
|
15085
14463
|
onFilteredItemsChange: propTypesExports.func,
|
|
15086
14464
|
onItemsPerPageChange: propTypesExports.func,
|
|
15087
14465
|
onRowClick: propTypesExports.func,
|
|
14466
|
+
onSelectAll: propTypesExports.func,
|
|
15088
14467
|
onSelectedItemsChange: propTypesExports.func,
|
|
15089
14468
|
onSorterChange: propTypesExports.func,
|
|
15090
14469
|
onTableFilterChange: propTypesExports.func,
|
|
@@ -15092,6 +14471,8 @@ CSmartTable.propTypes = {
|
|
|
15092
14471
|
paginationProps: propTypesExports.any,
|
|
15093
14472
|
scopedColumns: propTypesExports.object,
|
|
15094
14473
|
selectable: propTypesExports.bool,
|
|
14474
|
+
selectAll: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.object]),
|
|
14475
|
+
selected: propTypesExports.array,
|
|
15095
14476
|
sorterValue: propTypesExports.object,
|
|
15096
14477
|
sortingIcon: propTypesExports.node,
|
|
15097
14478
|
sortingIconAscending: propTypesExports.node,
|
|
@@ -15133,13 +14514,13 @@ var CSidebar = React$1.forwardRef(function (_a, ref) {
|
|
|
15133
14514
|
React$1.useEffect(function () {
|
|
15134
14515
|
var _a, _b;
|
|
15135
14516
|
sidebarRef.current && setMobile(isOnMobile(sidebarRef.current));
|
|
15136
|
-
sidebarRef.current && setInViewport(
|
|
14517
|
+
sidebarRef.current && setInViewport(isInViewport(sidebarRef.current));
|
|
15137
14518
|
window.addEventListener('resize', function () { return handleResize(); });
|
|
15138
14519
|
window.addEventListener('mouseup', handleClickOutside);
|
|
15139
14520
|
window.addEventListener('keyup', handleKeyup);
|
|
15140
14521
|
(_a = sidebarRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseup', handleOnClick);
|
|
15141
14522
|
(_b = sidebarRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('transitionend', function () {
|
|
15142
|
-
sidebarRef.current && setInViewport(
|
|
14523
|
+
sidebarRef.current && setInViewport(isInViewport(sidebarRef.current));
|
|
15143
14524
|
});
|
|
15144
14525
|
return function () {
|
|
15145
14526
|
var _a, _b;
|
|
@@ -15148,7 +14529,7 @@ var CSidebar = React$1.forwardRef(function (_a, ref) {
|
|
|
15148
14529
|
window.removeEventListener('keyup', handleKeyup);
|
|
15149
14530
|
(_a = sidebarRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseup', handleOnClick);
|
|
15150
14531
|
(_b = sidebarRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('transitionend', function () {
|
|
15151
|
-
sidebarRef.current && setInViewport(
|
|
14532
|
+
sidebarRef.current && setInViewport(isInViewport(sidebarRef.current));
|
|
15152
14533
|
});
|
|
15153
14534
|
};
|
|
15154
14535
|
});
|
|
@@ -15157,7 +14538,7 @@ var CSidebar = React$1.forwardRef(function (_a, ref) {
|
|
|
15157
14538
|
};
|
|
15158
14539
|
var handleResize = function () {
|
|
15159
14540
|
sidebarRef.current && setMobile(isOnMobile(sidebarRef.current));
|
|
15160
|
-
sidebarRef.current && setInViewport(
|
|
14541
|
+
sidebarRef.current && setInViewport(isInViewport(sidebarRef.current));
|
|
15161
14542
|
};
|
|
15162
14543
|
var handleKeyup = function (event) {
|
|
15163
14544
|
if (mobile &&
|
|
@@ -15280,7 +14661,7 @@ var CTabPane = React$1.forwardRef(function (_a, ref) {
|
|
|
15280
14661
|
var _className = classNames$1('tab-pane', 'fade', {
|
|
15281
14662
|
active: visible,
|
|
15282
14663
|
}, className);
|
|
15283
|
-
return (React$1.createElement(Transition, { in: visible, nodeRef: tabPaneRef, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
|
|
14664
|
+
return (React$1.createElement(Transition$1, { in: visible, nodeRef: tabPaneRef, onEnter: onShow, onExit: onHide, timeout: 150 }, function (state) {
|
|
15284
14665
|
var transitionClass = getTransitionClass(state);
|
|
15285
14666
|
return (React$1.createElement("div", __assign$1({ className: classNames$1(_className, transitionClass) }, rest, { ref: forkedRef }), children));
|
|
15286
14667
|
}));
|
|
@@ -15337,7 +14718,7 @@ var CToast = React$1.forwardRef(function (_a, ref) {
|
|
|
15337
14718
|
? 'showing'
|
|
15338
14719
|
: 'fade';
|
|
15339
14720
|
};
|
|
15340
|
-
return (React$1.createElement(Transition, { in: _visible, nodeRef: toastRef, onEnter: function () { return onShow && onShow(index ? index : null); }, onExited: function () { return onClose && onClose(index ? index : null); }, timeout: 250, unmountOnExit: true }, function (state) {
|
|
14721
|
+
return (React$1.createElement(Transition$1, { in: _visible, nodeRef: toastRef, onEnter: function () { return onShow && onShow(index ? index : null); }, onExited: function () { return onClose && onClose(index ? index : null); }, timeout: 250, unmountOnExit: true }, function (state) {
|
|
15341
14722
|
var transitionClass = getTransitionClass(state);
|
|
15342
14723
|
return (React$1.createElement(CToastContext.Provider, { value: contextValues },
|
|
15343
14724
|
React$1.createElement("div", __assign$1({ className: classNames$1(_className, transitionClass), "aria-live": "assertive", "aria-atomic": "true", role: "alert", onMouseEnter: function () { return clearTimeout(timeout.current); }, onMouseLeave: function () { return _autohide(); } }, rest, { key: key, ref: forkedRef }), children)));
|
|
@@ -15491,7 +14872,7 @@ var CTooltip = function (_a) {
|
|
|
15491
14872
|
onMouseLeave: function () { return setVisible(false); },
|
|
15492
14873
|
}))),
|
|
15493
14874
|
typeof window !== 'undefined' &&
|
|
15494
|
-
ReactDOM.createPortal(React$1.createElement(Transition, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
14875
|
+
ReactDOM.createPortal(React$1.createElement(Transition$1, { in: _visible, mountOnEnter: true, nodeRef: tooltipRef, onEnter: onShow, onExit: onHide, timeout: {
|
|
15495
14876
|
enter: 0,
|
|
15496
14877
|
exit: 200,
|
|
15497
14878
|
}, unmountOnExit: true }, function (state) {
|
|
@@ -15689,6 +15070,7 @@ exports.CDropdownItem = CDropdownItem;
|
|
|
15689
15070
|
exports.CDropdownItemPlain = CDropdownItemPlain;
|
|
15690
15071
|
exports.CDropdownMenu = CDropdownMenu;
|
|
15691
15072
|
exports.CDropdownToggle = CDropdownToggle;
|
|
15073
|
+
exports.CElementCover = CElementCover;
|
|
15692
15074
|
exports.CFooter = CFooter;
|
|
15693
15075
|
exports.CForm = CForm;
|
|
15694
15076
|
exports.CFormCheck = CFormCheck;
|
|
@@ -15772,6 +15154,7 @@ exports.CToastClose = CToastClose;
|
|
|
15772
15154
|
exports.CToastHeader = CToastHeader;
|
|
15773
15155
|
exports.CToaster = CToaster;
|
|
15774
15156
|
exports.CTooltip = CTooltip;
|
|
15157
|
+
exports.CVirtualScroller = CVirtualScroller;
|
|
15775
15158
|
exports.CWidgetStatsA = CWidgetStatsA;
|
|
15776
15159
|
exports.CWidgetStatsB = CWidgetStatsB;
|
|
15777
15160
|
exports.CWidgetStatsC = CWidgetStatsC;
|