@sb1/ffe-dropdown-react 6.0.51 → 7.0.1

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 CHANGED
@@ -12,11 +12,6 @@ npm install --save @sb1/ffe-dropdown-react
12
12
 
13
13
  Full documentation on dropdown usage is available at https://design.sparebank1.no/komponenter/dropdown/.
14
14
 
15
- ## TypeScript definition files
16
-
17
- This component supports TypeScript - please update `index.d.ts` if you change any
18
- of the external methods or properties in this component.
19
-
20
15
  ## Development
21
16
 
22
17
  To start a local development server, run the following from the designsystem root folder:
package/es/Dropdown.js CHANGED
@@ -1,29 +1,28 @@
1
- var _excluded = ["className", "inline", "innerRef"];
2
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
- 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; }
4
- 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; }
5
- import React from 'react';
6
- import { bool, node, string, object, func, shape, oneOfType } from 'prop-types';
7
- import classNames from 'classnames';
8
- var Dropdown = function Dropdown(props) {
9
- var className = props.className,
10
- inline = props.inline,
11
- innerRef = props.innerRef,
12
- rest = _objectWithoutProperties(props, _excluded);
13
- return /*#__PURE__*/React.createElement("select", _extends({
14
- className: classNames('ffe-dropdown', {
15
- 'ffe-dropdown--inline': inline
16
- }, className),
17
- ref: innerRef
18
- }, rest));
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
19
11
  };
20
- Dropdown.propTypes = {
21
- children: node,
22
- inline: bool,
23
- className: string,
24
- /** Ref-setting function, or ref created by useRef, passed to the select element */
25
- innerRef: oneOfType([func, shape({
26
- current: object
27
- })])
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
28
22
  };
29
- export default Dropdown;
23
+ import React from 'react';
24
+ import classNames from 'classnames';
25
+ export var Dropdown = React.forwardRef(function (_a, ref) {
26
+ var className = _a.className, inline = _a.inline, rest = __rest(_a, ["className", "inline"]);
27
+ return (React.createElement("select", __assign({ className: classNames('ffe-dropdown', { 'ffe-dropdown--inline': inline }, className), ref: ref }, rest)));
28
+ });
package/es/index.js CHANGED
@@ -1,2 +1 @@
1
- import Dropdown from './Dropdown';
2
- export default Dropdown;
1
+ export { Dropdown } from './Dropdown';
package/lib/Dropdown.js CHANGED
@@ -1,36 +1,34 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _propTypes = require("prop-types");
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var _excluded = ["className", "inline", "innerRef"];
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- 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; }
14
- 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; }
15
- var Dropdown = function Dropdown(props) {
16
- var className = props.className,
17
- inline = props.inline,
18
- innerRef = props.innerRef,
19
- rest = _objectWithoutProperties(props, _excluded);
20
- return /*#__PURE__*/_react.default.createElement("select", _extends({
21
- className: (0, _classnames.default)('ffe-dropdown', {
22
- 'ffe-dropdown--inline': inline
23
- }, className),
24
- ref: innerRef
25
- }, rest));
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
26
23
  };
27
- Dropdown.propTypes = {
28
- children: _propTypes.node,
29
- inline: _propTypes.bool,
30
- className: _propTypes.string,
31
- /** Ref-setting function, or ref created by useRef, passed to the select element */
32
- innerRef: (0, _propTypes.oneOfType)([_propTypes.func, (0, _propTypes.shape)({
33
- current: _propTypes.object
34
- })])
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
35
26
  };
36
- var _default = exports.default = Dropdown;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.Dropdown = void 0;
29
+ var react_1 = __importDefault(require("react"));
30
+ var classnames_1 = __importDefault(require("classnames"));
31
+ exports.Dropdown = react_1.default.forwardRef(function (_a, ref) {
32
+ var className = _a.className, inline = _a.inline, rest = __rest(_a, ["className", "inline"]);
33
+ return (react_1.default.createElement("select", __assign({ className: (0, classnames_1.default)('ffe-dropdown', { 'ffe-dropdown--inline': inline }, className), ref: ref }, rest)));
34
+ });
package/lib/index.js CHANGED
@@ -1,9 +1,5 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _Dropdown = _interopRequireDefault(require("./Dropdown"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- var _default = exports.default = _Dropdown.default;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Dropdown = void 0;
4
+ var Dropdown_1 = require("./Dropdown");
5
+ Object.defineProperty(exports, "Dropdown", { enumerable: true, get: function () { return Dropdown_1.Dropdown; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sb1/ffe-dropdown-react",
3
- "version": "6.0.51",
3
+ "version": "7.0.1",
4
4
  "license": "MIT",
5
5
  "author": "SpareBank 1",
6
6
  "files": [
@@ -17,14 +17,14 @@
17
17
  "url": "ssh://git@github.com:SpareBank1/designsystem.git"
18
18
  },
19
19
  "scripts": {
20
- "build": "ffe-buildtool babel",
20
+ "build": "ffe-buildtool tsc",
21
21
  "watch": "ffe-buildtool babel-watch",
22
22
  "lint": "eslint src",
23
23
  "test": "ffe-buildtool jest",
24
24
  "test:watch": "ffe-buildtool jest --watch"
25
25
  },
26
26
  "dependencies": {
27
- "@sb1/ffe-form": "^29.0.13",
27
+ "@sb1/ffe-form": "^29.0.14",
28
28
  "classnames": "^2.3.1"
29
29
  },
30
30
  "devDependencies": {
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "a5865069975b15e70cc7a12758fc57e9c87461ea"
42
+ "gitHead": "c62935435283273831e7f6771911ee0783a22bee"
43
43
  }
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface DropdownProps extends React.ComponentPropsWithoutRef<'select'> {
3
+ inline?: boolean;
4
+ }
5
+ export declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLSelectElement>>;
package/types/index.d.ts CHANGED
@@ -1,12 +1 @@
1
- import * as React from 'react';
2
-
3
- export interface DropdownProps extends React.ComponentProps<'select'> {
4
- children?: React.ReactNode;
5
- className?: string;
6
- inline?: boolean;
7
- innerRef?: React.Ref<HTMLSelectElement>;
8
- }
9
-
10
- declare class Dropdown extends React.Component<DropdownProps, any> {}
11
-
12
- export default Dropdown;
1
+ export { Dropdown, DropdownProps } from './Dropdown';
package/es/index.d.js DELETED
@@ -1 +0,0 @@
1
- import * as React from 'react';
package/lib/index.d.js DELETED
@@ -1,6 +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
- var React = _interopRequireWildcard(require("react"));
5
- 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); }
6
- 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; }