UNPKG

2.78 kBJavaScriptView Raw
1"use strict";
2
3function _typeof(obj) { "@babel/helpers - typeof"; 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); }
4
5Object.defineProperty(exports, "__esModule", {
6 value: true
7});
8exports.isFixed = exports.isIntrinsic = exports.isRTL = exports.isVertical = exports.isHorizontal = exports.getTabPanelId = exports.getTabId = void 0;
9
10var React = _interopRequireWildcard(require("react"));
11
12var _constants = require("./constants.js");
13
14function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
15
16function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
18/*
19Copyright (c) 2018-2020 Uber Technologies, Inc.
20
21This source code is licensed under the MIT license found in the
22LICENSE file in the root directory of this source tree.
23*/
24var getTabId = function getTabId(uid, key) {
25 return "tabs-".concat(uid, "-tab-").concat(key);
26};
27
28exports.getTabId = getTabId;
29
30var getTabPanelId = function getTabPanelId(uid, key) {
31 return "tabs-".concat(uid, "-tabpanel-").concat(key);
32};
33
34exports.getTabPanelId = getTabPanelId;
35
36var isHorizontal = function isHorizontal(orientation) {
37 return orientation === _constants.ORIENTATION.horizontal;
38};
39
40exports.isHorizontal = isHorizontal;
41
42var isVertical = function isVertical(orientation) {
43 return orientation === _constants.ORIENTATION.vertical;
44};
45
46exports.isVertical = isVertical;
47
48var isRTL = function isRTL(direction) {
49 return direction === 'rtl';
50};
51
52exports.isRTL = isRTL;
53
54var isIntrinsic = function isIntrinsic(fill) {
55 return fill === _constants.FILL.intrinsic;
56};
57
58exports.isIntrinsic = isIntrinsic;
59
60var isFixed = function isFixed(fill) {
61 return fill === _constants.FILL.fixed;
62};
63
64exports.isFixed = isFixed;
\No newline at end of file