@panneau/field-display 3.0.160

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.
File without changes
package/es/index.js ADDED
@@ -0,0 +1,45 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
+ import classNames from 'classnames';
4
+ import PropTypes from 'prop-types';
5
+ import React from 'react';
6
+ import { useDisplaysComponentsManager } from '@panneau/core/contexts';
7
+
8
+ var styles = {};
9
+
10
+ var _excluded = ["type", "value", "className"];
11
+ var propTypes = {
12
+ value: PropTypes.bool,
13
+ type: PropTypes.string,
14
+ className: PropTypes.string
15
+ };
16
+ var defaultProps = {
17
+ value: null,
18
+ type: null,
19
+ className: null
20
+ };
21
+ var DisplayField = function DisplayField(_ref) {
22
+ var _ref$type = _ref.type,
23
+ type = _ref$type === void 0 ? null : _ref$type,
24
+ value = _ref.value,
25
+ className = _ref.className,
26
+ props = _objectWithoutProperties(_ref, _excluded);
27
+ var displays = useDisplaysComponentsManager();
28
+ var Component = displays.getComponent(type) || null;
29
+ console.log('props', props);
30
+ return Component !== null ? /*#__PURE__*/React.createElement(Component, Object.assign({
31
+ className: classNames([styles.container, _defineProperty({}, className, className !== null)])
32
+ }, props, {
33
+ value: value
34
+ })) : null;
35
+ };
36
+ DisplayField.propTypes = propTypes;
37
+ DisplayField.defaultProps = defaultProps;
38
+ var DisplayField$1 = DisplayField;
39
+
40
+ var definition = {
41
+ id: 'display',
42
+ component: 'Display'
43
+ };
44
+
45
+ export { DisplayField$1 as default, definition };
package/lib/index.js ADDED
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
7
+ var classNames = require('classnames');
8
+ var PropTypes = require('prop-types');
9
+ var React = require('react');
10
+ var contexts = require('@panneau/core/contexts');
11
+
12
+ var styles = {};
13
+
14
+ var _excluded = ["type", "value", "className"];
15
+ var propTypes = {
16
+ value: PropTypes.bool,
17
+ type: PropTypes.string,
18
+ className: PropTypes.string
19
+ };
20
+ var defaultProps = {
21
+ value: null,
22
+ type: null,
23
+ className: null
24
+ };
25
+ var DisplayField = function DisplayField(_ref) {
26
+ var _ref$type = _ref.type,
27
+ type = _ref$type === void 0 ? null : _ref$type,
28
+ value = _ref.value,
29
+ className = _ref.className,
30
+ props = _objectWithoutProperties(_ref, _excluded);
31
+ var displays = contexts.useDisplaysComponentsManager();
32
+ var Component = displays.getComponent(type) || null;
33
+ console.log('props', props);
34
+ return Component !== null ? /*#__PURE__*/React.createElement(Component, Object.assign({
35
+ className: classNames([styles.container, _defineProperty({}, className, className !== null)])
36
+ }, props, {
37
+ value: value
38
+ })) : null;
39
+ };
40
+ DisplayField.propTypes = propTypes;
41
+ DisplayField.defaultProps = defaultProps;
42
+ var DisplayField$1 = DisplayField;
43
+
44
+ var definition = {
45
+ id: 'display',
46
+ component: 'Display'
47
+ };
48
+
49
+ exports.default = DisplayField$1;
50
+ exports.definition = definition;
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@panneau/field-display",
3
+ "version": "3.0.160",
4
+ "description": "A field rendering a display",
5
+ "keywords": [
6
+ "javascript"
7
+ ],
8
+ "homepage": "https://github.com/folkloreinc/panneau-js",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/folkloreinc/panneau-js.git"
12
+ },
13
+ "author": {
14
+ "name": "Folklore",
15
+ "email": "info@folklore.email"
16
+ },
17
+ "contributors": [
18
+ {
19
+ "name": "David Mongeau-Petitpas",
20
+ "email": "dmp@folklore.email"
21
+ },
22
+ {
23
+ "name": "Nicolas Roy-Bourdages",
24
+ "email": "nrb@folklore.email"
25
+ }
26
+ ],
27
+ "license": "ISC",
28
+ "main": "lib/index.js",
29
+ "module": "es/index.js",
30
+ "files": [
31
+ "lib",
32
+ "es",
33
+ "assets"
34
+ ],
35
+ "scripts": {
36
+ "prepublishOnly": "npm run build",
37
+ "build": "../../scripts/prepare-package.sh --scss"
38
+ },
39
+ "devDependencies": {
40
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
41
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
42
+ },
43
+ "peerDependencies": {
44
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
45
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
46
+ },
47
+ "dependencies": {
48
+ "@babel/runtime": "^7.12.5",
49
+ "@panneau/core": "^3.0.160",
50
+ "@panneau/themes": "^3.0.160",
51
+ "classnames": "^2.5.1",
52
+ "prop-types": "^15.7.2"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public"
56
+ },
57
+ "gitHead": "71a2a64cd2e0ed3cc921b0ec3b0a69449a4a978c"
58
+ }