td-stylekit 28.44.1 → 30.0.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/CHANGELOG.md +63 -0
- package/dist/es/BarChart/BarChart.d.ts +2 -2
- package/dist/es/BarChart/BarChart.js +5 -15
- package/dist/es/ChartPrimitives/utils.d.ts +0 -10
- package/dist/es/ChartPrimitives/utils.js +7 -145
- package/dist/es/ComparisonChart/ComparisonChart.d.ts +2 -2
- package/dist/es/ComparisonChart/ComparisonChart.js +5 -16
- package/dist/es/DataGrid/elements.d.ts +2 -78
- package/dist/es/DataGrid/elements.js +29 -29
- package/dist/es/DataGrid/renderers.d.ts +0 -4
- package/dist/es/DataGrid/renderers.js +55 -120
- package/dist/es/DateControl/elements.d.ts +34 -34
- package/dist/es/DropdownButton/DropdownButtonElements.d.ts +1 -1
- package/dist/es/DropdownButton/DropdownButtonElements.js +8 -8
- package/dist/es/FormField/index.d.ts +0 -2
- package/dist/es/FormField/index.js +0 -8
- package/dist/es/GrowthRateChart/GrowthRateChart.d.ts +0 -76
- package/dist/es/GrowthRateChart/GrowthRateChart.js +2 -9
- package/dist/es/Heading/Heading.js +2 -2
- package/dist/es/Highlighter/Highlighter.js +2 -2
- package/dist/es/Icon/Icon.js +2 -2
- package/dist/es/Icon/staticTypes.d.ts +88 -418
- package/dist/es/Icon/types.js +7 -557
- package/dist/es/Logo/Logo.js +0 -12
- package/dist/es/Menu/MenuElements.js +3 -3
- package/dist/es/MultiSelect/elements.d.ts +1 -1
- package/dist/es/MultiSelect/elements.js +17 -17
- package/dist/es/SecondaryNavigation/elements/Item.js +7 -7
- package/dist/es/SecondaryNavigation/elements/Section.js +3 -3
- package/dist/es/SecondaryNavigation/elements/Title.js +3 -3
- package/dist/es/SecondaryNavigation/elements/Wrapper.js +3 -3
- package/dist/es/Section/elements.d.ts +1 -1
- package/dist/es/Select/utils.js +2 -2
- package/dist/es/Tagger/TaggerElements.js +11 -11
- package/dist/es/Tagger/components/PopupSelector.js +4 -4
- package/dist/es/Tagger/components/PopupSelectorElements.js +16 -16
- package/dist/es/ThemeProvider/ThemeProvider.d.ts +0 -205
- package/dist/es/ThemeProvider/ThemeProvider.js +1 -7
- package/dist/es/ThemeProvider/icons.d.ts +1 -1
- package/dist/es/ThemeProvider/icons.js +4 -46
- package/dist/es/ThemeProvider/index.d.ts +1 -1
- package/dist/es/ThemeProvider/index.js +0 -6
- package/dist/es/ThemeProvider/theme.d.ts +0 -76
- package/dist/es/ThemeProvider/theme.js +0 -82
- package/dist/es/ThemeProvider/types.d.ts +1 -1
- package/dist/es/TimeControl/elements.d.ts +34 -34
- package/dist/es/Toggle/Toggle.js +6 -7
- package/dist/es/UserAvatar/UserAvatar.js +7 -7
- package/dist/es/VolumeChart/VolumeChart.d.ts +2 -2
- package/dist/es/VolumeChart/VolumeChart.js +2 -13
- package/dist/es/index.d.ts +1 -11
- package/dist/es/index.js +0 -70
- package/dist/es/mixins/border.d.ts +1 -1
- package/dist/es/mixins/border.js +3 -3
- package/dist/es/utils/globalcss.js +1 -1
- package/dist/es/utils/testingLibrary.d.ts +1 -3
- package/dist/es/utils/testingLibrary.js +13 -24
- package/package.json +13 -13
- package/dist/es/CheckboxField/CheckboxField.d.ts +0 -13
- package/dist/es/CheckboxField/CheckboxField.js +0 -73
- package/dist/es/CheckboxField/index.d.ts +0 -3
- package/dist/es/CheckboxField/index.js +0 -15
- package/dist/es/DateField/DateField.d.ts +0 -74
- package/dist/es/DateField/DateField.js +0 -297
- package/dist/es/DateField/elements.d.ts +0 -11
- package/dist/es/DateField/elements.js +0 -39
- package/dist/es/DateField/index.d.ts +0 -3
- package/dist/es/DateField/index.js +0 -15
- package/dist/es/DetailPanel/DetailPanel.d.ts +0 -16
- package/dist/es/DetailPanel/DetailPanel.js +0 -62
- package/dist/es/DetailPanel/elements.d.ts +0 -35
- package/dist/es/DetailPanel/elements.js +0 -225
- package/dist/es/DetailPanel/index.d.ts +0 -3
- package/dist/es/DetailPanel/index.js +0 -15
- package/dist/es/FormField/FormField.d.ts +0 -38
- package/dist/es/FormField/FormField.js +0 -204
- package/dist/es/FormField/elements.d.ts +0 -17
- package/dist/es/FormField/elements.js +0 -75
- package/dist/es/InfiniteList/InfiniteList.d.ts +0 -29
- package/dist/es/InfiniteList/InfiniteList.js +0 -114
- package/dist/es/InfiniteList/index.d.ts +0 -2
- package/dist/es/InfiniteList/index.js +0 -15
- package/dist/es/NavigationBar/LogoItem.d.ts +0 -6
- package/dist/es/NavigationBar/LogoItem.js +0 -42
- package/dist/es/NavigationBar/NavigationBar.d.ts +0 -33
- package/dist/es/NavigationBar/NavigationBar.js +0 -99
- package/dist/es/NavigationBar/NavigationItem.d.ts +0 -33
- package/dist/es/NavigationBar/NavigationItem.js +0 -183
- package/dist/es/NavigationBar/index.d.ts +0 -2
- package/dist/es/NavigationBar/index.js +0 -15
- package/dist/es/NavigationPopover/NavigationPopover.d.ts +0 -24
- package/dist/es/NavigationPopover/NavigationPopover.js +0 -116
- package/dist/es/NavigationPopover/index.d.ts +0 -2
- package/dist/es/NavigationPopover/index.js +0 -15
- package/dist/es/Overlay/Overlay.d.ts +0 -15
- package/dist/es/Overlay/Overlay.js +0 -66
- package/dist/es/Overlay/OverlayBody.d.ts +0 -9
- package/dist/es/Overlay/OverlayBody.js +0 -32
- package/dist/es/Overlay/OverlayHeader.d.ts +0 -37
- package/dist/es/Overlay/OverlayHeader.js +0 -135
- package/dist/es/Overlay/index.d.ts +0 -4
- package/dist/es/Overlay/index.js +0 -29
- package/dist/es/StatCard/StatCard.d.ts +0 -26
- package/dist/es/StatCard/StatCard.js +0 -118
- package/dist/es/StatCard/elements.d.ts +0 -48
- package/dist/es/StatCard/elements.js +0 -156
- package/dist/es/StatCard/index.d.ts +0 -3
- package/dist/es/StatCard/index.js +0 -15
- package/dist/es/ThemeProvider/v4/Badge.d.ts +0 -10
- package/dist/es/ThemeProvider/v4/Badge.js +0 -57
- package/dist/es/ThemeProvider/v4/Button.d.ts +0 -161
- package/dist/es/ThemeProvider/v4/Button.js +0 -200
- package/dist/es/ThemeProvider/v4/Card.d.ts +0 -12
- package/dist/es/ThemeProvider/v4/Card.js +0 -24
- package/dist/es/ThemeProvider/v4/Checkbox.d.ts +0 -70
- package/dist/es/ThemeProvider/v4/Checkbox.js +0 -94
- package/dist/es/ThemeProvider/v4/CollapsibleToggle.d.ts +0 -31
- package/dist/es/ThemeProvider/v4/CollapsibleToggle.js +0 -46
- package/dist/es/ThemeProvider/v4/Color.d.ts +0 -12
- package/dist/es/ThemeProvider/v4/Color.js +0 -47
- package/dist/es/ThemeProvider/v4/DataGrid.d.ts +0 -72
- package/dist/es/ThemeProvider/v4/DataGrid.js +0 -182
- package/dist/es/ThemeProvider/v4/DatePicker.d.ts +0 -41
- package/dist/es/ThemeProvider/v4/DatePicker.js +0 -111
- package/dist/es/ThemeProvider/v4/DropdownButton.d.ts +0 -67
- package/dist/es/ThemeProvider/v4/DropdownButton.js +0 -99
- package/dist/es/ThemeProvider/v4/FormFieldAddon.d.ts +0 -16
- package/dist/es/ThemeProvider/v4/FormFieldAddon.js +0 -38
- package/dist/es/ThemeProvider/v4/FormLabel.d.ts +0 -11
- package/dist/es/ThemeProvider/v4/FormLabel.js +0 -28
- package/dist/es/ThemeProvider/v4/Icon.d.ts +0 -7
- package/dist/es/ThemeProvider/v4/Icon.js +0 -20
- package/dist/es/ThemeProvider/v4/Input.d.ts +0 -10
- package/dist/es/ThemeProvider/v4/Input.js +0 -50
- package/dist/es/ThemeProvider/v4/Link.d.ts +0 -20
- package/dist/es/ThemeProvider/v4/Link.js +0 -30
- package/dist/es/ThemeProvider/v4/Menu.d.ts +0 -36
- package/dist/es/ThemeProvider/v4/Menu.js +0 -60
- package/dist/es/ThemeProvider/v4/Modal.d.ts +0 -63
- package/dist/es/ThemeProvider/v4/Modal.js +0 -216
- package/dist/es/ThemeProvider/v4/MultiSelect.d.ts +0 -35
- package/dist/es/ThemeProvider/v4/MultiSelect.js +0 -126
- package/dist/es/ThemeProvider/v4/Popover.d.ts +0 -4
- package/dist/es/ThemeProvider/v4/Popover.js +0 -107
- package/dist/es/ThemeProvider/v4/Radio.d.ts +0 -17
- package/dist/es/ThemeProvider/v4/Radio.js +0 -69
- package/dist/es/ThemeProvider/v4/Section.d.ts +0 -33
- package/dist/es/ThemeProvider/v4/Section.js +0 -93
- package/dist/es/ThemeProvider/v4/Select.d.ts +0 -69
- package/dist/es/ThemeProvider/v4/Select.js +0 -198
- package/dist/es/ThemeProvider/v4/Shuttle.d.ts +0 -12
- package/dist/es/ThemeProvider/v4/Shuttle.js +0 -28
- package/dist/es/ThemeProvider/v4/Tagger.d.ts +0 -30
- package/dist/es/ThemeProvider/v4/Tagger.js +0 -64
- package/dist/es/ThemeProvider/v4/Toast.d.ts +0 -35
- package/dist/es/ThemeProvider/v4/Toast.js +0 -119
- package/dist/es/ThemeProvider/v4/Toggle.d.ts +0 -18
- package/dist/es/ThemeProvider/v4/Toggle.js +0 -93
- package/dist/es/ThemeProvider/v4/UserAvatar.d.ts +0 -15
- package/dist/es/ThemeProvider/v4/UserAvatar.js +0 -31
- package/dist/es/ThemeProvider/v4/View.d.ts +0 -9
- package/dist/es/ThemeProvider/v4/View.js +0 -21
- package/dist/es/ThemeProvider/v4/index.d.ts +0 -6
- package/dist/es/ThemeProvider/v4/index.js +0 -46
- package/dist/es/TimeField/TimeField.d.ts +0 -15
- package/dist/es/TimeField/TimeField.js +0 -42
- package/dist/es/TimeField/index.d.ts +0 -3
- package/dist/es/TimeField/index.js +0 -15
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CheckboxProps } from '../Checkbox';
|
|
3
|
-
export type CheckboxFieldProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
'data-instrumentation'?: string;
|
|
6
|
-
error?: Array<string> | string;
|
|
7
|
-
hideAddOn?: boolean;
|
|
8
|
-
hint?: string;
|
|
9
|
-
hintNode?: React.ReactNode;
|
|
10
|
-
} & CheckboxProps;
|
|
11
|
-
export declare const CheckboxField: React.FunctionComponent<React.PropsWithChildren<CheckboxFieldProps>>;
|
|
12
|
-
export default CheckboxField;
|
|
13
|
-
//# sourceMappingURL=CheckboxField.d.ts.map
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.CheckboxField = void 0;
|
|
8
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
-
var _utils = require("../utils");
|
|
10
|
-
var _Checkbox = _interopRequireDefault(require("../Checkbox"));
|
|
11
|
-
var _FormFieldAddon = _interopRequireDefault(require("../FormFieldAddon"));
|
|
12
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
13
|
-
var _excluded = ["className", "error", "hideAddOn", "hintNode", "hint"];
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
22
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
23
|
-
if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
|
|
24
|
-
if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
|
|
25
|
-
var Container = /*#__PURE__*/(0, _base["default"])('div', process.env.NODE_ENV === "production" ? {
|
|
26
|
-
target: "e1tlns5h1"
|
|
27
|
-
} : {
|
|
28
|
-
target: "e1tlns5h1",
|
|
29
|
-
label: "Container"
|
|
30
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
31
|
-
name: "1saxkct",
|
|
32
|
-
styles: "align-items:stretch;display:flex;flex-flow:column nowrap;min-width:0;position:relative"
|
|
33
|
-
} : {
|
|
34
|
-
name: "1saxkct",
|
|
35
|
-
styles: "align-items:stretch;display:flex;flex-flow:column nowrap;min-width:0;position:relative",
|
|
36
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9DaGVja2JveEZpZWxkL0NoZWNrYm94RmllbGQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1rQiIsImZpbGUiOiIuLi8uLi8uLi9zcmMvQ2hlY2tib3hGaWVsZC9DaGVja2JveEZpZWxkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHsgZ2V0RXJyb3JMaXN0IH0gZnJvbSAnLi4vdXRpbHMnXG5pbXBvcnQgQ2hlY2tib3ggZnJvbSAnLi4vQ2hlY2tib3gnXG5pbXBvcnQgdHlwZSB7IENoZWNrYm94UHJvcHMgfSBmcm9tICcuLi9DaGVja2JveCdcbmltcG9ydCBGb3JtRmllbGRBZGRvbiBmcm9tICcuLi9Gb3JtRmllbGRBZGRvbidcblxuY29uc3QgQ29udGFpbmVyID0gc3R5bGVkKCdkaXYnKSh7XG4gIGFsaWduSXRlbXM6ICdzdHJldGNoJyxcbiAgZGlzcGxheTogJ2ZsZXgnLFxuICBmbGV4RmxvdzogJ2NvbHVtbiBub3dyYXAnLFxuICBtaW5XaWR0aDogMCxcbiAgcG9zaXRpb246ICdyZWxhdGl2ZSdcbn0pXG5cbmNvbnN0IEFkZG9uID0gc3R5bGVkKEZvcm1GaWVsZEFkZG9uKTx7IG5vTGFiZWw6IGJvb2xlYW4gfT4oXG4gICh7IHRoZW1lLCBub0xhYmVsIH0pID0+ICh7XG4gICAgbWFyZ2luOiAwLFxuICAgIG1hcmdpbkxlZnQ6IG5vTGFiZWwgPyAwIDogdGhlbWUuc3BhY2VbNl1cbiAgfSlcbilcblxuZXhwb3J0IHR5cGUgQ2hlY2tib3hGaWVsZFByb3BzID0ge1xuICBjbGFzc05hbWU/OiBzdHJpbmdcbiAgJ2RhdGEtaW5zdHJ1bWVudGF0aW9uJz86IHN0cmluZ1xuICBlcnJvcj86IEFycmF5PHN0cmluZz4gfCBzdHJpbmdcbiAgaGlkZUFkZE9uPzogYm9vbGVhblxuICBoaW50Pzogc3RyaW5nXG4gIGhpbnROb2RlPzogUmVhY3QuUmVhY3ROb2RlXG59ICYgQ2hlY2tib3hQcm9wc1xuXG5leHBvcnQgY29uc3QgQ2hlY2tib3hGaWVsZDogUmVhY3QuRnVuY3Rpb25Db21wb25lbnQ8XG4gIFJlYWN0LlByb3BzV2l0aENoaWxkcmVuPENoZWNrYm94RmllbGRQcm9wcz5cbj4gPSAoe1xuICBjbGFzc05hbWUsXG4gIGVycm9yLFxuICBoaWRlQWRkT24sXG4gIGhpbnROb2RlLFxuICBoaW50LFxuICAuLi5wcm9wc1xufTogQ2hlY2tib3hGaWVsZFByb3BzKSA9PiB7XG4gIGNvbnN0IGVycm9yTGlzdCA9IGdldEVycm9yTGlzdChlcnJvcilcbiAgcmV0dXJuIChcbiAgICA8Q29udGFpbmVyPlxuICAgICAgPENoZWNrYm94IHsuLi5wcm9wc30gLz5cbiAgICAgIHtoaWRlQWRkT24gfHwgKFxuICAgICAgICA8QWRkb25cbiAgICAgICAgICBlcnJvckxpc3Q9e2Vycm9yTGlzdH1cbiAgICAgICAgICBoaW50PXtoaW50fVxuICAgICAgICAgIGhpbnROb2RlPXtoaW50Tm9kZX1cbiAgICAgICAgICBub0xhYmVsPXshcHJvcHMubGFiZWx9XG4gICAgICAgIC8+XG4gICAgICApfVxuICAgIDwvQ29udGFpbmVyPlxuICApXG59XG5cbmV4cG9ydCBkZWZhdWx0IENoZWNrYm94RmllbGRcbiJdfQ== */",
|
|
37
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
|
-
});
|
|
39
|
-
var Addon = /*#__PURE__*/(0, _base["default"])(_FormFieldAddon["default"], process.env.NODE_ENV === "production" ? {
|
|
40
|
-
target: "e1tlns5h0"
|
|
41
|
-
} : {
|
|
42
|
-
target: "e1tlns5h0",
|
|
43
|
-
label: "Addon"
|
|
44
|
-
})(function (_ref) {
|
|
45
|
-
var theme = _ref.theme,
|
|
46
|
-
noLabel = _ref.noLabel;
|
|
47
|
-
return {
|
|
48
|
-
margin: 0,
|
|
49
|
-
marginLeft: noLabel ? 0 : theme.space[6]
|
|
50
|
-
};
|
|
51
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9DaGVja2JveEZpZWxkL0NoZWNrYm94RmllbGQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNjIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9DaGVja2JveEZpZWxkL0NoZWNrYm94RmllbGQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5pbXBvcnQgeyBnZXRFcnJvckxpc3QgfSBmcm9tICcuLi91dGlscydcbmltcG9ydCBDaGVja2JveCBmcm9tICcuLi9DaGVja2JveCdcbmltcG9ydCB0eXBlIHsgQ2hlY2tib3hQcm9wcyB9IGZyb20gJy4uL0NoZWNrYm94J1xuaW1wb3J0IEZvcm1GaWVsZEFkZG9uIGZyb20gJy4uL0Zvcm1GaWVsZEFkZG9uJ1xuXG5jb25zdCBDb250YWluZXIgPSBzdHlsZWQoJ2RpdicpKHtcbiAgYWxpZ25JdGVtczogJ3N0cmV0Y2gnLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIGZsZXhGbG93OiAnY29sdW1uIG5vd3JhcCcsXG4gIG1pbldpZHRoOiAwLFxuICBwb3NpdGlvbjogJ3JlbGF0aXZlJ1xufSlcblxuY29uc3QgQWRkb24gPSBzdHlsZWQoRm9ybUZpZWxkQWRkb24pPHsgbm9MYWJlbDogYm9vbGVhbiB9PihcbiAgKHsgdGhlbWUsIG5vTGFiZWwgfSkgPT4gKHtcbiAgICBtYXJnaW46IDAsXG4gICAgbWFyZ2luTGVmdDogbm9MYWJlbCA/IDAgOiB0aGVtZS5zcGFjZVs2XVxuICB9KVxuKVxuXG5leHBvcnQgdHlwZSBDaGVja2JveEZpZWxkUHJvcHMgPSB7XG4gIGNsYXNzTmFtZT86IHN0cmluZ1xuICAnZGF0YS1pbnN0cnVtZW50YXRpb24nPzogc3RyaW5nXG4gIGVycm9yPzogQXJyYXk8c3RyaW5nPiB8IHN0cmluZ1xuICBoaWRlQWRkT24/OiBib29sZWFuXG4gIGhpbnQ/OiBzdHJpbmdcbiAgaGludE5vZGU/OiBSZWFjdC5SZWFjdE5vZGVcbn0gJiBDaGVja2JveFByb3BzXG5cbmV4cG9ydCBjb25zdCBDaGVja2JveEZpZWxkOiBSZWFjdC5GdW5jdGlvbkNvbXBvbmVudDxcbiAgUmVhY3QuUHJvcHNXaXRoQ2hpbGRyZW48Q2hlY2tib3hGaWVsZFByb3BzPlxuPiA9ICh7XG4gIGNsYXNzTmFtZSxcbiAgZXJyb3IsXG4gIGhpZGVBZGRPbixcbiAgaGludE5vZGUsXG4gIGhpbnQsXG4gIC4uLnByb3BzXG59OiBDaGVja2JveEZpZWxkUHJvcHMpID0+IHtcbiAgY29uc3QgZXJyb3JMaXN0ID0gZ2V0RXJyb3JMaXN0KGVycm9yKVxuICByZXR1cm4gKFxuICAgIDxDb250YWluZXI+XG4gICAgICA8Q2hlY2tib3ggey4uLnByb3BzfSAvPlxuICAgICAge2hpZGVBZGRPbiB8fCAoXG4gICAgICAgIDxBZGRvblxuICAgICAgICAgIGVycm9yTGlzdD17ZXJyb3JMaXN0fVxuICAgICAgICAgIGhpbnQ9e2hpbnR9XG4gICAgICAgICAgaGludE5vZGU9e2hpbnROb2RlfVxuICAgICAgICAgIG5vTGFiZWw9eyFwcm9wcy5sYWJlbH1cbiAgICAgICAgLz5cbiAgICAgICl9XG4gICAgPC9Db250YWluZXI+XG4gIClcbn1cblxuZXhwb3J0IGRlZmF1bHQgQ2hlY2tib3hGaWVsZFxuIl19 */");
|
|
52
|
-
var CheckboxField = exports.CheckboxField = function CheckboxField(_ref2) {
|
|
53
|
-
var className = _ref2.className,
|
|
54
|
-
error = _ref2.error,
|
|
55
|
-
hideAddOn = _ref2.hideAddOn,
|
|
56
|
-
hintNode = _ref2.hintNode,
|
|
57
|
-
hint = _ref2.hint,
|
|
58
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
59
|
-
var errorList = (0, _utils.getErrorList)(error);
|
|
60
|
-
return (0, _jsxRuntime.jsxs)(Container, {
|
|
61
|
-
"data-gs": gs("src", "checkboxfield", "checkboxfield.tsx", "container"),
|
|
62
|
-
children: [(0, _jsxRuntime.jsx)(_Checkbox["default"], _objectSpread({
|
|
63
|
-
"data-gs": gs("src", "checkboxfield", "checkboxfield.tsx", "container", "checkbox")
|
|
64
|
-
}, props)), hideAddOn || (0, _jsxRuntime.jsx)(Addon, {
|
|
65
|
-
"data-gs": gs("src", "checkboxfield", "checkboxfield.tsx", "container", "addon"),
|
|
66
|
-
errorList: errorList,
|
|
67
|
-
hint: hint,
|
|
68
|
-
hintNode: hintNode,
|
|
69
|
-
noLabel: !props.label
|
|
70
|
-
})]
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
var _default = exports["default"] = CheckboxField;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _CheckboxField["default"];
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CheckboxField = _interopRequireDefault(require("./CheckboxField"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
|
|
15
|
-
if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { ReactNode, KeyboardEvent, Component } from 'react';
|
|
2
|
-
import type { FormFieldProps } from '../FormField';
|
|
3
|
-
import type { PLACEMENT } from '../TooltipPopover';
|
|
4
|
-
export declare const CLOSE_KEYS: string[];
|
|
5
|
-
export declare const FORMAT_DATE_ERROR_MESSAGE = "Format M/d/yyyy";
|
|
6
|
-
export declare const DATE_FORMAT = "yyyy-M-d HH:mm:ss";
|
|
7
|
-
export declare const FORMAT_ERROR_MESSAGE = "Format yyyy-M-d HH:mm:ss";
|
|
8
|
-
export declare const DISABLED_DAY_ERROR_MESSAGE = "That date is disabled";
|
|
9
|
-
export type DateFieldProps = Omit<FormFieldProps<'text'>, 'value' | 'onChange' | 'type'> & {
|
|
10
|
-
clearable?: boolean;
|
|
11
|
-
disabledDays?: (date: Date) => boolean;
|
|
12
|
-
/** Dates after today should be selectable; defaults to true */
|
|
13
|
-
enableFutureDates?: boolean;
|
|
14
|
-
/** Dates before today should be selectable; defaults to false */
|
|
15
|
-
enablePastDates?: boolean;
|
|
16
|
-
/** Earliest selectable datetime */
|
|
17
|
-
minDatetime?: Date;
|
|
18
|
-
/** Callback triggered when user changes date. */
|
|
19
|
-
onChange: (val: {
|
|
20
|
-
name: string;
|
|
21
|
-
value: Date | string | null;
|
|
22
|
-
}) => void;
|
|
23
|
-
/** Selected/displayed date */
|
|
24
|
-
value: Date | null;
|
|
25
|
-
/** Hide Error addon for dates */
|
|
26
|
-
hideErrors?: boolean;
|
|
27
|
-
/** Positions the popover. Use value from OverlayTrigger.PLACEMENT. Defaults to BOTTOM. */
|
|
28
|
-
popoverPlacement?: PLACEMENT;
|
|
29
|
-
time?: boolean;
|
|
30
|
-
popoverRenderer?: () => ReactNode;
|
|
31
|
-
/** this function gets called when show is called */
|
|
32
|
-
onMenuOpen?: () => void;
|
|
33
|
-
/** this function gets called when hide is called */
|
|
34
|
-
onMenuClose?: () => void;
|
|
35
|
-
/** Instrumentation */
|
|
36
|
-
'data-instrumentation'?: string;
|
|
37
|
-
/** Locale */
|
|
38
|
-
locale?: string;
|
|
39
|
-
};
|
|
40
|
-
type DateFieldState = {
|
|
41
|
-
inputValue: string;
|
|
42
|
-
show: boolean;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Displays a text Input component with a popover DatePicker for selecting a date.
|
|
46
|
-
*/
|
|
47
|
-
export declare class UnstyledDateField extends Component<DateFieldProps, DateFieldState> {
|
|
48
|
-
static defaultProps: {
|
|
49
|
-
enablePastDates: boolean;
|
|
50
|
-
enableFutureDates: boolean;
|
|
51
|
-
clearable: boolean;
|
|
52
|
-
popoverPlacement: string;
|
|
53
|
-
'data-instrumentation': string;
|
|
54
|
-
};
|
|
55
|
-
inputRef: import("react").RefObject<HTMLInputElement>;
|
|
56
|
-
datePickerRef: import("react").RefObject<HTMLDivElement>;
|
|
57
|
-
constructor(props: DateFieldProps, context?: any);
|
|
58
|
-
componentDidUpdate(prevProps: DateFieldProps): void;
|
|
59
|
-
show: () => void;
|
|
60
|
-
hide: () => void;
|
|
61
|
-
onRootClose: (e: MouseEvent | TouchEvent) => void;
|
|
62
|
-
_overlayTarget: () => HTMLInputElement | null;
|
|
63
|
-
_onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
64
|
-
_onDatePickerChange: (value: Date | string) => void;
|
|
65
|
-
_onInputChange: ({ name, value }: {
|
|
66
|
-
name: any;
|
|
67
|
-
value: any;
|
|
68
|
-
}) => void;
|
|
69
|
-
getErrors: () => string[] | undefined;
|
|
70
|
-
render(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
71
|
-
}
|
|
72
|
-
export default function DateField(props: any): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
73
|
-
export {};
|
|
74
|
-
//# sourceMappingURL=DateField.d.ts.map
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UnstyledDateField = exports.FORMAT_ERROR_MESSAGE = exports.FORMAT_DATE_ERROR_MESSAGE = exports.DISABLED_DAY_ERROR_MESSAGE = exports.DATE_FORMAT = exports.CLOSE_KEYS = void 0;
|
|
7
|
-
exports["default"] = DateField;
|
|
8
|
-
var _react = require("@emotion/react");
|
|
9
|
-
var _react2 = require("react");
|
|
10
|
-
var _DatePicker = _interopRequireWildcard(require("../DatePicker"));
|
|
11
|
-
var _FormField = _interopRequireDefault(require("../FormField"));
|
|
12
|
-
var _Modal = _interopRequireDefault(require("../Modal"));
|
|
13
|
-
var _TooltipPopover = _interopRequireDefault(require("../TooltipPopover"));
|
|
14
|
-
var _utils = require("../utils");
|
|
15
|
-
var _elements = require("./elements");
|
|
16
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
17
|
-
var _excluded = ["className", "disabledDays", "data-instrumentation", "enableFutureDates", "enablePastDates", "value", "hideErrors", "minDatetime", "popoverPlacement", "time", "popoverRenderer", "onMenuClose", "onMenuOpen", "locale"];
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
22
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
|
24
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
29
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
30
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
32
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
34
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
38
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
39
|
-
if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
|
|
40
|
-
if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
|
|
41
|
-
var dateToString = _DatePicker.DatePickerUtils.dateToString,
|
|
42
|
-
stringToDate = _DatePicker.DatePickerUtils.stringToDate,
|
|
43
|
-
isStringCorrectFormat = _DatePicker.DatePickerUtils.isStringCorrectFormat,
|
|
44
|
-
DEFAULT_FORMAT = _DatePicker.DatePickerUtils.DEFAULT_FORMAT;
|
|
45
|
-
var CLOSE_KEYS = exports.CLOSE_KEYS = [String.fromCharCode(25),
|
|
46
|
-
// Gets sent when you press shift+tab with Chrome...
|
|
47
|
-
'Enter', 'Escape', 'Tab'];
|
|
48
|
-
// @TODO: Change to YYYY-MM-DD?
|
|
49
|
-
var FORMAT_DATE_ERROR_MESSAGE = exports.FORMAT_DATE_ERROR_MESSAGE = 'Format M/d/yyyy';
|
|
50
|
-
var DATE_FORMAT = exports.DATE_FORMAT = 'yyyy-M-d HH:mm:ss';
|
|
51
|
-
var FORMAT_ERROR_MESSAGE = exports.FORMAT_ERROR_MESSAGE = "Format ".concat(DATE_FORMAT);
|
|
52
|
-
var DISABLED_DAY_ERROR_MESSAGE = exports.DISABLED_DAY_ERROR_MESSAGE = 'That date is disabled';
|
|
53
|
-
var ModalAwarePopover = function ModalAwarePopover(props) {
|
|
54
|
-
var _useContext = (0, _react2.useContext)(_Modal["default"].context),
|
|
55
|
-
inModal = _useContext.inModal;
|
|
56
|
-
return (0, _jsxRuntime.jsx)(_elements.PopoverDiv, _objectSpread(_objectSpread({
|
|
57
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "popover-div")
|
|
58
|
-
}, props), {}, {
|
|
59
|
-
zIndex: inModal ? 'Modal' : undefined
|
|
60
|
-
}));
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Displays a text Input component with a popover DatePicker for selecting a date.
|
|
64
|
-
*/
|
|
65
|
-
var UnstyledDateField = exports.UnstyledDateField = /*#__PURE__*/function (_Component) {
|
|
66
|
-
function UnstyledDateField(props, context) {
|
|
67
|
-
var _this;
|
|
68
|
-
_classCallCheck(this, UnstyledDateField);
|
|
69
|
-
_this = _callSuper(this, UnstyledDateField, [props, context]);
|
|
70
|
-
_defineProperty(_this, "inputRef", /*#__PURE__*/(0, _react2.createRef)());
|
|
71
|
-
_defineProperty(_this, "datePickerRef", /*#__PURE__*/(0, _react2.createRef)());
|
|
72
|
-
_defineProperty(_this, "show", function () {
|
|
73
|
-
_this.setState({
|
|
74
|
-
show: true
|
|
75
|
-
});
|
|
76
|
-
_this.props.onMenuOpen && _this.props.onMenuOpen();
|
|
77
|
-
});
|
|
78
|
-
_defineProperty(_this, "hide", function () {
|
|
79
|
-
_this.setState({
|
|
80
|
-
show: false
|
|
81
|
-
});
|
|
82
|
-
_this.props.onMenuClose && _this.props.onMenuClose();
|
|
83
|
-
});
|
|
84
|
-
_defineProperty(_this, "onRootClose", function (e) {
|
|
85
|
-
var _this$datePickerRef, _this$datePickerRef$c, _this$inputRef, _this$inputRef$curren;
|
|
86
|
-
if (e && !((_this$datePickerRef = _this.datePickerRef) !== null && _this$datePickerRef !== void 0 && (_this$datePickerRef$c = _this$datePickerRef.current) !== null && _this$datePickerRef$c !== void 0 && _this$datePickerRef$c.contains(e.target)) && !((_this$inputRef = _this.inputRef) !== null && _this$inputRef !== void 0 && (_this$inputRef$curren = _this$inputRef.current) !== null && _this$inputRef$curren !== void 0 && _this$inputRef$curren.contains(e.target))) {
|
|
87
|
-
_this.hide();
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
_defineProperty(_this, "_overlayTarget", function () {
|
|
91
|
-
return _this.inputRef.current;
|
|
92
|
-
});
|
|
93
|
-
_defineProperty(_this, "_onKeyDown", function (event) {
|
|
94
|
-
if (CLOSE_KEYS.includes(event.key)) {
|
|
95
|
-
_this.hide();
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
_defineProperty(_this, "_onDatePickerChange", function (value) {
|
|
99
|
-
var _this$props = _this.props,
|
|
100
|
-
name = _this$props.name,
|
|
101
|
-
onChange = _this$props.onChange;
|
|
102
|
-
onChange({
|
|
103
|
-
name: name,
|
|
104
|
-
value: value
|
|
105
|
-
});
|
|
106
|
-
_this.hide();
|
|
107
|
-
});
|
|
108
|
-
_defineProperty(_this, "_onInputChange", function (_ref) {
|
|
109
|
-
var name = _ref.name,
|
|
110
|
-
value = _ref.value;
|
|
111
|
-
var date = typeof value === 'string' && isStringCorrectFormat(value, DEFAULT_FORMAT, _this.props.locale) ? stringToDate(value) : null;
|
|
112
|
-
var _this$props2 = _this.props,
|
|
113
|
-
onChange = _this$props2.onChange,
|
|
114
|
-
disabledDays = _this$props2.disabledDays,
|
|
115
|
-
enableFutureDates = _this$props2.enableFutureDates,
|
|
116
|
-
clearable = _this$props2.clearable,
|
|
117
|
-
minDatetime = _this$props2.minDatetime;
|
|
118
|
-
|
|
119
|
-
// If we have a validation function and it's test doesn't pass then
|
|
120
|
-
// we don't want to call onChange, but we want to keep local state
|
|
121
|
-
// up to date so that the input respects the users inputs
|
|
122
|
-
if (disabledDays && date && disabledDays(date)) {
|
|
123
|
-
_this.setState({
|
|
124
|
-
inputValue: String(value)
|
|
125
|
-
});
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Not all input values reflect real dates
|
|
130
|
-
// but we still need to update state to keep the inner <input> synced
|
|
131
|
-
if (date) {
|
|
132
|
-
if (minDatetime && date < minDatetime || !enableFutureDates && date > new Date()) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
onChange({
|
|
136
|
-
name: name,
|
|
137
|
-
value: date
|
|
138
|
-
});
|
|
139
|
-
} else {
|
|
140
|
-
if (!value && clearable) {
|
|
141
|
-
// notify when input has been cleared
|
|
142
|
-
onChange({
|
|
143
|
-
name: name,
|
|
144
|
-
value: null
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
_this.setState({
|
|
148
|
-
inputValue: String(value)
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Make sure the overlay is showing any time the input is changed
|
|
153
|
-
// This handles an edge case where a user types a value after typing Escape
|
|
154
|
-
_this.show();
|
|
155
|
-
});
|
|
156
|
-
_defineProperty(_this, "getErrors", function () {
|
|
157
|
-
var _this$props3 = _this.props,
|
|
158
|
-
error = _this$props3.error,
|
|
159
|
-
disabledDays = _this$props3.disabledDays,
|
|
160
|
-
hideErrors = _this$props3.hideErrors,
|
|
161
|
-
time = _this$props3.time;
|
|
162
|
-
if (hideErrors) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
var inputValue = _this.state.inputValue;
|
|
166
|
-
var errorList = error ? (0, _utils.getErrorList)(error) : [];
|
|
167
|
-
var date = stringToDate(inputValue);
|
|
168
|
-
if (!time && inputValue && !date) {
|
|
169
|
-
errorList.unshift(FORMAT_DATE_ERROR_MESSAGE);
|
|
170
|
-
}
|
|
171
|
-
if (inputValue && date && disabledDays && disabledDays(date)) {
|
|
172
|
-
errorList.unshift(DISABLED_DAY_ERROR_MESSAGE);
|
|
173
|
-
}
|
|
174
|
-
if (time && !_DatePicker.DatePickerUtils.stringToDate(inputValue, DATE_FORMAT)) {
|
|
175
|
-
errorList.unshift(FORMAT_ERROR_MESSAGE);
|
|
176
|
-
}
|
|
177
|
-
return errorList;
|
|
178
|
-
});
|
|
179
|
-
_this.state = {
|
|
180
|
-
inputValue: props.value ? dateToString(props.value, undefined, props.locale) : '',
|
|
181
|
-
show: false
|
|
182
|
-
};
|
|
183
|
-
return _this;
|
|
184
|
-
}
|
|
185
|
-
_inherits(UnstyledDateField, _Component);
|
|
186
|
-
return _createClass(UnstyledDateField, [{
|
|
187
|
-
key: "componentDidUpdate",
|
|
188
|
-
value: function componentDidUpdate(prevProps) {
|
|
189
|
-
if (prevProps.value !== this.props.value) {
|
|
190
|
-
// Keep our inner <input> synced with changes to Date
|
|
191
|
-
// either external or from clicks on DayPicker
|
|
192
|
-
var format = this.props.time ? DATE_FORMAT : undefined;
|
|
193
|
-
this.setState({
|
|
194
|
-
inputValue: this.props.value ? this.props.value instanceof Date ? _DatePicker.DatePickerUtils.dateToString(this.props.value, format, this.props.locale) : this.props.value : ''
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}, {
|
|
199
|
-
key: "render",
|
|
200
|
-
value: function render() {
|
|
201
|
-
var _this2 = this;
|
|
202
|
-
var _this$props4 = this.props,
|
|
203
|
-
className = _this$props4.className,
|
|
204
|
-
disabledDays = _this$props4.disabledDays,
|
|
205
|
-
dataInstrumentation = _this$props4['data-instrumentation'],
|
|
206
|
-
enableFutureDates = _this$props4.enableFutureDates,
|
|
207
|
-
enablePastDates = _this$props4.enablePastDates,
|
|
208
|
-
value = _this$props4.value,
|
|
209
|
-
hideErrors = _this$props4.hideErrors,
|
|
210
|
-
minDatetime = _this$props4.minDatetime,
|
|
211
|
-
popoverPlacement = _this$props4.popoverPlacement,
|
|
212
|
-
time = _this$props4.time,
|
|
213
|
-
popoverRenderer = _this$props4.popoverRenderer,
|
|
214
|
-
onMenuClose = _this$props4.onMenuClose,
|
|
215
|
-
onMenuOpen = _this$props4.onMenuOpen,
|
|
216
|
-
locale = _this$props4.locale,
|
|
217
|
-
props = _objectWithoutProperties(_this$props4, _excluded);
|
|
218
|
-
var _this$state = this.state,
|
|
219
|
-
inputValue = _this$state.inputValue,
|
|
220
|
-
show = _this$state.show;
|
|
221
|
-
return (0, _jsxRuntime.jsx)(_utils.CloseWrapper, {
|
|
222
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper"),
|
|
223
|
-
className: className,
|
|
224
|
-
onClose: function onClose(e) {
|
|
225
|
-
return e && _this2.onRootClose(e);
|
|
226
|
-
},
|
|
227
|
-
disabled: !show,
|
|
228
|
-
children: (0, _jsxRuntime.jsxs)(_elements.Container, {
|
|
229
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container"),
|
|
230
|
-
onKeyDown: this._onKeyDown,
|
|
231
|
-
"data-instrumentation": dataInstrumentation,
|
|
232
|
-
children: [(0, _jsxRuntime.jsx)(_FormField["default"], _objectSpread(_objectSpread({
|
|
233
|
-
"data-gs-c": gsC(inputValue),
|
|
234
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container", "form-field")
|
|
235
|
-
}, props), {}, {
|
|
236
|
-
error: !hideErrors ? this.getErrors() : null,
|
|
237
|
-
onChange: this._onInputChange,
|
|
238
|
-
onFocus: this.show,
|
|
239
|
-
inputRef: this.inputRef,
|
|
240
|
-
value: inputValue,
|
|
241
|
-
type: "text",
|
|
242
|
-
"data-instrumentation": "".concat(dataInstrumentation, "-formfield"),
|
|
243
|
-
locale: locale
|
|
244
|
-
})), (0, _jsxRuntime.jsx)(_TooltipPopover["default"], {
|
|
245
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container", "tooltip-popover"),
|
|
246
|
-
onHide: this.hide,
|
|
247
|
-
placement: popoverPlacement,
|
|
248
|
-
show: show,
|
|
249
|
-
target: this._overlayTarget,
|
|
250
|
-
children: (0, _jsxRuntime.jsx)(ModalAwarePopover, {
|
|
251
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container", "tooltip-popover", "modal-aware-popover"),
|
|
252
|
-
children: (0, _jsxRuntime.jsx)("div", {
|
|
253
|
-
"data-gs-c": gsC(popoverRenderer ? popoverRenderer() : (0, _jsxRuntime.jsx)(_DatePicker["default"], {
|
|
254
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container", "tooltip-popover", "modal-aware-popover", "div", "date-picker"),
|
|
255
|
-
date: value,
|
|
256
|
-
disabledDays: disabledDays,
|
|
257
|
-
disablePastDates: !enablePastDates,
|
|
258
|
-
disableFutureDates: !enableFutureDates,
|
|
259
|
-
onChange: this._onDatePickerChange,
|
|
260
|
-
"data-instrumentation": "".concat(dataInstrumentation, "-datepicker"),
|
|
261
|
-
locale: locale
|
|
262
|
-
})),
|
|
263
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container", "tooltip-popover", "modal-aware-popover", "div"),
|
|
264
|
-
ref: this.datePickerRef,
|
|
265
|
-
children: popoverRenderer ? popoverRenderer() : (0, _jsxRuntime.jsx)(_DatePicker["default"], {
|
|
266
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "close-wrapper", "container", "tooltip-popover", "modal-aware-popover", "div", "date-picker"),
|
|
267
|
-
date: value,
|
|
268
|
-
disabledDays: disabledDays,
|
|
269
|
-
disablePastDates: !enablePastDates,
|
|
270
|
-
disableFutureDates: !enableFutureDates,
|
|
271
|
-
onChange: this._onDatePickerChange,
|
|
272
|
-
"data-instrumentation": "".concat(dataInstrumentation, "-datepicker"),
|
|
273
|
-
locale: locale
|
|
274
|
-
})
|
|
275
|
-
})
|
|
276
|
-
})
|
|
277
|
-
})]
|
|
278
|
-
})
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
}]);
|
|
282
|
-
}(_react2.Component); // Re-exported so that react-docgen correctly parses component documentation.
|
|
283
|
-
_defineProperty(UnstyledDateField, "defaultProps", {
|
|
284
|
-
enablePastDates: false,
|
|
285
|
-
enableFutureDates: true,
|
|
286
|
-
clearable: true,
|
|
287
|
-
popoverPlacement: 'bottom',
|
|
288
|
-
'data-instrumentation': 'datefield'
|
|
289
|
-
});
|
|
290
|
-
function DateField(props) {
|
|
291
|
-
var theme = (0, _react.useTheme)();
|
|
292
|
-
return (0, _jsxRuntime.jsx)(UnstyledDateField, _objectSpread(_objectSpread({
|
|
293
|
-
"data-gs": gs("src", "datefield", "datefield.tsx", "date-field", "unstyled-date-field")
|
|
294
|
-
}, props), {}, {
|
|
295
|
-
theme: theme
|
|
296
|
-
}));
|
|
297
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
5
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const PopoverDiv: import("@emotion/styled").StyledComponent<import("../Popover").PopoverProps & {
|
|
7
|
-
children?: import("react").ReactNode;
|
|
8
|
-
} & {
|
|
9
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
-
}, {}, {}>;
|
|
11
|
-
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PopoverDiv = exports.Container = void 0;
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
8
|
-
var _Popover = _interopRequireDefault(require("../Popover"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11
|
-
if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
|
|
12
|
-
if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
|
|
13
|
-
var Container = exports.Container = /*#__PURE__*/(0, _base["default"])('div', process.env.NODE_ENV === "production" ? {
|
|
14
|
-
target: "elmf6gl1"
|
|
15
|
-
} : {
|
|
16
|
-
target: "elmf6gl1",
|
|
17
|
-
label: "Container"
|
|
18
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
19
|
-
name: "bjn8wh",
|
|
20
|
-
styles: "position:relative"
|
|
21
|
-
} : {
|
|
22
|
-
name: "bjn8wh",
|
|
23
|
-
styles: "position:relative",
|
|
24
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9EYXRlRmllbGQvZWxlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR3lCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9EYXRlRmllbGQvZWxlbWVudHMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUG9wb3ZlciBmcm9tICcuLi9Qb3BvdmVyJ1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5cbmV4cG9ydCBjb25zdCBDb250YWluZXIgPSBzdHlsZWQoJ2RpdicpKHtcbiAgcG9zaXRpb246ICdyZWxhdGl2ZSdcbn0pXG5cbmV4cG9ydCBjb25zdCBQb3BvdmVyRGl2ID0gc3R5bGVkKFBvcG92ZXIpKCh7IHRoZW1lIH0pID0+ICh7XG4gIG1heFdpZHRoOiAnbm9uZScsXG4gIHBhZGRpbmc6IDAsXG4gIHpJbmRleDogdGhlbWUuekluZGV4LlRldGhlclxufSkpXG4iXX0= */",
|
|
25
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
-
});
|
|
27
|
-
var PopoverDiv = exports.PopoverDiv = /*#__PURE__*/(0, _base["default"])(_Popover["default"], process.env.NODE_ENV === "production" ? {
|
|
28
|
-
target: "elmf6gl0"
|
|
29
|
-
} : {
|
|
30
|
-
target: "elmf6gl0",
|
|
31
|
-
label: "PopoverDiv"
|
|
32
|
-
})(function (_ref) {
|
|
33
|
-
var theme = _ref.theme;
|
|
34
|
-
return {
|
|
35
|
-
maxWidth: 'none',
|
|
36
|
-
padding: 0,
|
|
37
|
-
zIndex: theme.zIndex.Tether
|
|
38
|
-
};
|
|
39
|
-
}, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9EYXRlRmllbGQvZWxlbWVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTzBCIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9EYXRlRmllbGQvZWxlbWVudHMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUG9wb3ZlciBmcm9tICcuLi9Qb3BvdmVyJ1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5cbmV4cG9ydCBjb25zdCBDb250YWluZXIgPSBzdHlsZWQoJ2RpdicpKHtcbiAgcG9zaXRpb246ICdyZWxhdGl2ZSdcbn0pXG5cbmV4cG9ydCBjb25zdCBQb3BvdmVyRGl2ID0gc3R5bGVkKFBvcG92ZXIpKCh7IHRoZW1lIH0pID0+ICh7XG4gIG1heFdpZHRoOiAnbm9uZScsXG4gIHBhZGRpbmc6IDAsXG4gIHpJbmRleDogdGhlbWUuekluZGV4LlRldGhlclxufSkpXG4iXX0= */");
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _DateField["default"];
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _DateField = _interopRequireDefault(require("./DateField"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
|
|
15
|
-
if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DetailPanelBody, DetailPanelHeader } from './elements';
|
|
3
|
-
import type { CollapsibleToggleProps } from '../CollapsibleToggle';
|
|
4
|
-
export type DetailPanelProps = {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
hiddenToggleLabel?: CollapsibleToggleProps['hiddenLabel'];
|
|
7
|
-
isClosed?: boolean;
|
|
8
|
-
toggleOnClick?: CollapsibleToggleProps['onClick'];
|
|
9
|
-
};
|
|
10
|
-
export type DetailPanelSubComponents = {
|
|
11
|
-
Header: typeof DetailPanelHeader;
|
|
12
|
-
Body: typeof DetailPanelBody;
|
|
13
|
-
};
|
|
14
|
-
export declare const DetailPanel: React.FunctionComponent<React.PropsWithChildren<DetailPanelProps>> & DetailPanelSubComponents;
|
|
15
|
-
export default DetailPanel;
|
|
16
|
-
//# sourceMappingURL=DetailPanel.d.ts.map
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.DetailPanel = void 0;
|
|
7
|
-
var _elements = require("./elements");
|
|
8
|
-
var _CollapsibleToggle = _interopRequireDefault(require("../CollapsibleToggle"));
|
|
9
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
if (typeof window !== "undefined" && !window.gs) window.gs = function () {};
|
|
12
|
-
if (typeof window !== "undefined" && !window.gsC) window.gsC = function () {};
|
|
13
|
-
/* eslint-disable td/instrumentation */
|
|
14
|
-
// this level of fine grained instrumentation is not needed
|
|
15
|
-
var DetailPanel = exports.DetailPanel = function DetailPanel(_ref) {
|
|
16
|
-
var children = _ref.children,
|
|
17
|
-
isClosed = _ref.isClosed,
|
|
18
|
-
hiddenToggleLabel = _ref.hiddenToggleLabel,
|
|
19
|
-
toggleOnClick = _ref.toggleOnClick;
|
|
20
|
-
function onClick(e) {
|
|
21
|
-
e.stopPropagation();
|
|
22
|
-
if (toggleOnClick) toggleOnClick(e);
|
|
23
|
-
}
|
|
24
|
-
var defaultHiddenLabel = isClosed ? 'Open Panel' : 'Close Panel';
|
|
25
|
-
var toggleLabel = hiddenToggleLabel || defaultHiddenLabel;
|
|
26
|
-
return (0, _jsxRuntime.jsxs)(_elements.Wrapper, {
|
|
27
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper"),
|
|
28
|
-
isClosed: isClosed,
|
|
29
|
-
children: [toggleOnClick && (0, _jsxRuntime.jsx)(_CollapsibleToggle["default"], {
|
|
30
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper", "toggle"),
|
|
31
|
-
id: "DETAIL_PANEL_TOGGLE",
|
|
32
|
-
isClosed: isClosed,
|
|
33
|
-
hiddenLabel: toggleLabel,
|
|
34
|
-
onClick: onClick,
|
|
35
|
-
openLeft: true
|
|
36
|
-
}), (0, _jsxRuntime.jsx)(_elements.DetailPanelContainer, {
|
|
37
|
-
"data-gs-c": gsC(isClosed ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
38
|
-
children: [(0, _jsxRuntime.jsx)(_elements.HeaderWrapper, {
|
|
39
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper", "detail-panel-container", "header-wrapper"),
|
|
40
|
-
isClosed: true
|
|
41
|
-
}), (0, _jsxRuntime.jsx)(_elements.DetailPanelBody, {
|
|
42
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper", "detail-panel-container", "detail-panel-body"),
|
|
43
|
-
isClosed: true
|
|
44
|
-
})]
|
|
45
|
-
}) : children),
|
|
46
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper", "detail-panel-container"),
|
|
47
|
-
isClosed: isClosed,
|
|
48
|
-
children: isClosed ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
49
|
-
children: [(0, _jsxRuntime.jsx)(_elements.HeaderWrapper, {
|
|
50
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper", "detail-panel-container", "header-wrapper"),
|
|
51
|
-
isClosed: true
|
|
52
|
-
}), (0, _jsxRuntime.jsx)(_elements.DetailPanelBody, {
|
|
53
|
-
"data-gs": gs("src", "detailpanel", "detailpanel.tsx", "wrapper", "detail-panel-container", "detail-panel-body"),
|
|
54
|
-
isClosed: true
|
|
55
|
-
})]
|
|
56
|
-
}) : children
|
|
57
|
-
})]
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
DetailPanel.Header = _elements.DetailPanelHeader;
|
|
61
|
-
DetailPanel.Body = _elements.DetailPanelBody;
|
|
62
|
-
var _default = exports["default"] = DetailPanel;
|