rc-picker
Advanced tools
Comparing version 0.0.1-alpha.14 to 0.0.1-alpha.15
"use strict"; | ||
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */ | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -326,6 +334,21 @@ | ||
if (extraFooterSelections && extraFooterSelections.length) { | ||
if (extraFooterSelections && extraFooterSelections.length || showTime) { | ||
var mergedSelections = []; | ||
if (showTime) { | ||
mergedSelections.push({ | ||
label: locale.now, | ||
onClick: function onClick() { | ||
triggerSelect(generateConfig.getNow()); | ||
} | ||
}); | ||
} | ||
if (extraFooterSelections) { | ||
mergedSelections = [].concat(_toConsumableArray(mergedSelections), _toConsumableArray(extraFooterSelections)); | ||
} | ||
extraSelectionNode = React.createElement("ul", { | ||
className: "".concat(prefixCls, "-ranges") | ||
}, extraFooterSelections.map(function (_ref) { | ||
}, mergedSelections.map(function (_ref) { | ||
var label = _ref.label, | ||
@@ -332,0 +355,0 @@ onClick = _ref.onClick; |
import * as React from 'react'; | ||
import { NullableDateType } from './interface'; | ||
export interface FooterSelection { | ||
label: string; | ||
onClick: React.MouseEventHandler<HTMLElement>; | ||
} | ||
interface RangeContextProps { | ||
extraFooterSelections?: { | ||
label: string; | ||
onClick: React.MouseEventHandler<HTMLElement>; | ||
}[]; | ||
extraFooterSelections?: FooterSelection[]; | ||
/** | ||
@@ -9,0 +10,0 @@ * Set displayed range value style. |
"use strict"; | ||
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */ | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
@@ -326,6 +334,21 @@ | ||
if (extraFooterSelections && extraFooterSelections.length) { | ||
if (extraFooterSelections && extraFooterSelections.length || showTime) { | ||
var mergedSelections = []; | ||
if (showTime) { | ||
mergedSelections.push({ | ||
label: locale.now, | ||
onClick: function onClick() { | ||
triggerSelect(generateConfig.getNow()); | ||
} | ||
}); | ||
} | ||
if (extraFooterSelections) { | ||
mergedSelections = [].concat(_toConsumableArray(mergedSelections), _toConsumableArray(extraFooterSelections)); | ||
} | ||
extraSelectionNode = React.createElement("ul", { | ||
className: "".concat(prefixCls, "-ranges") | ||
}, extraFooterSelections.map(function (_ref) { | ||
}, mergedSelections.map(function (_ref) { | ||
var label = _ref.label, | ||
@@ -332,0 +355,0 @@ onClick = _ref.onClick; |
import * as React from 'react'; | ||
import { NullableDateType } from './interface'; | ||
export interface FooterSelection { | ||
label: string; | ||
onClick: React.MouseEventHandler<HTMLElement>; | ||
} | ||
interface RangeContextProps { | ||
extraFooterSelections?: { | ||
label: string; | ||
onClick: React.MouseEventHandler<HTMLElement>; | ||
}[]; | ||
extraFooterSelections?: FooterSelection[]; | ||
/** | ||
@@ -9,0 +10,0 @@ * Set displayed range value style. |
{ | ||
"name": "rc-picker", | ||
"version": "0.0.1-alpha.14", | ||
"version": "0.0.1-alpha.15", | ||
"description": "React date & time picker", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
444953
10792