@comet/admin-color-picker 7.3.0-canary-20240827074534 → 7.3.0-canary-20240827075324
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/ColorField.d.ts +2 -2
- package/lib/ColorField.d.ts.map +1 -1
- package/lib/ColorField.js +0 -4
- package/lib/ColorPicker.d.ts +8 -8
- package/lib/ColorPicker.d.ts.map +1 -1
- package/lib/ColorPicker.js +6 -9
- package/lib/FinalFormColorPicker.d.ts +2 -2
- package/lib/FinalFormColorPicker.d.ts.map +1 -1
- package/lib/FinalFormColorPicker.js +0 -4
- package/package.json +5 -5
package/lib/ColorField.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { FieldProps } from "@comet/admin";
|
2
|
-
import * as React from "react";
|
3
3
|
export type ColorFieldProps = FieldProps<string, HTMLInputElement>;
|
4
|
-
export declare const ColorField: ({ ...restProps }: ColorFieldProps) =>
|
4
|
+
export declare const ColorField: ({ ...restProps }: ColorFieldProps) => JSX.Element;
|
5
5
|
//# sourceMappingURL=ColorField.d.ts.map
|
package/lib/ColorField.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../src/ColorField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"ColorField.d.ts","sourceRoot":"","sources":["../src/ColorField.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAS,UAAU,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEnE,eAAO,MAAM,UAAU,qBAAsB,eAAe,gBAE3D,CAAC"}
|
package/lib/ColorField.js
CHANGED
@@ -1,15 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.ColorField = void 0;
|
8
7
|
var _admin = require("@comet/admin");
|
9
|
-
var React = _interopRequireWildcard(require("react"));
|
10
8
|
var _FinalFormColorPicker = require("./FinalFormColorPicker");
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
13
9
|
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
14
10
|
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); }
|
15
11
|
var ColorField = function ColorField(_ref) {
|
package/lib/ColorPicker.d.ts
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
import { InputWithPopperComponents, InputWithPopperProps } from "@comet/admin";
|
2
2
|
import { ComponentsOverrides, InputBaseProps } from "@mui/material";
|
3
3
|
import { Theme } from "@mui/material/styles";
|
4
|
-
import
|
4
|
+
import { ComponentType, HTMLAttributes, ReactNode } from "react";
|
5
5
|
import { ColorPickerClassKey, PreviewIndicatorColorProps, PreviewIndicatorEmptyOrInvalidProps, SlotProps } from "./ColorPicker.slots";
|
6
|
-
export interface ColorPickerColorPreviewProps extends Omit<
|
6
|
+
export interface ColorPickerColorPreviewProps extends Omit<HTMLAttributes<HTMLDivElement>, "color">, PreviewIndicatorColorProps {
|
7
7
|
}
|
8
|
-
export interface ColorPickerNoColorPreviewProps extends
|
8
|
+
export interface ColorPickerNoColorPreviewProps extends HTMLAttributes<HTMLDivElement>, PreviewIndicatorEmptyOrInvalidProps {
|
9
9
|
}
|
10
10
|
export interface ColorPickerPropsComponents extends InputWithPopperComponents {
|
11
|
-
ColorPickerColorPreview?:
|
12
|
-
ColorPickerInvalidPreview?:
|
13
|
-
ColorPickerEmptyPreview?:
|
11
|
+
ColorPickerColorPreview?: ComponentType<ColorPickerColorPreviewProps>;
|
12
|
+
ColorPickerInvalidPreview?: ComponentType<ColorPickerNoColorPreviewProps>;
|
13
|
+
ColorPickerEmptyPreview?: ComponentType<ColorPickerNoColorPreviewProps>;
|
14
14
|
}
|
15
15
|
export interface ColorPickerProps extends Omit<InputWithPopperProps, "children" | "onChange" | "value" | "components" | "slotProps"> {
|
16
16
|
value?: string | null;
|
@@ -25,8 +25,8 @@ export interface ColorPickerProps extends Omit<InputWithPopperProps, "children"
|
|
25
25
|
endAdornment?: InputBaseProps["endAdornment"];
|
26
26
|
invalidIndicatorCharacter?: string;
|
27
27
|
required?: boolean;
|
28
|
-
titleText?:
|
29
|
-
clearButtonText?:
|
28
|
+
titleText?: ReactNode;
|
29
|
+
clearButtonText?: ReactNode;
|
30
30
|
components?: ColorPickerPropsComponents;
|
31
31
|
slotProps?: SlotProps;
|
32
32
|
}
|
package/lib/ColorPicker.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../src/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpG,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAc,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../src/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpG,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAc,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAe,aAAa,EAAc,cAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAK/G,OAAO,EAGH,mBAAmB,EAYnB,0BAA0B,EAC1B,mCAAmC,EAGnC,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EAAE,0BAA0B;CAAG;AAClI,MAAM,WAAW,8BAA+B,SAAQ,cAAc,CAAC,cAAc,CAAC,EAAE,mCAAmC;CAAG;AAE9H,MAAM,WAAW,0BAA2B,SAAQ,yBAAyB;IACzE,uBAAuB,CAAC,EAAE,aAAa,CAAC,4BAA4B,CAAC,CAAC;IACtE,yBAAyB,CAAC,EAAE,aAAa,CAAC,8BAA8B,CAAC,CAAC;IAC1E,uBAAuB,CAAC,EAAE,aAAa,CAAC,8BAA8B,CAAC,CAAC;CAC3E;AAUD,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C;KACL;CACJ"}
|
package/lib/ColorPicker.js
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
@@ -9,7 +8,7 @@ var _admin = require("@comet/admin");
|
|
9
8
|
var _adminIcons = require("@comet/admin-icons");
|
10
9
|
var _material = require("@mui/material");
|
11
10
|
var _styles = require("@mui/material/styles");
|
12
|
-
var
|
11
|
+
var _react = require("react");
|
13
12
|
var _reactIntl = require("react-intl");
|
14
13
|
var _tinycolor = _interopRequireDefault(require("tinycolor2"));
|
15
14
|
var _useDebounce = require("use-debounce");
|
@@ -17,8 +16,6 @@ var _ColorPicker = require("./ColorPicker.slots");
|
|
17
16
|
var _excluded = ["classes", "value", "colorFormat", "hidePicker", "hideHeader", "hideFooter", "colorPalette", "onChange", "startAdornment", "endAdornment", "onBlur", "required", "titleText", "clearButtonText", "components", "slotProps"],
|
18
17
|
_excluded2 = ["ColorPickerColorPreview", "ColorPickerInvalidPreview", "ColorPickerEmptyPreview"];
|
19
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
22
19
|
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); }
|
23
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
24
21
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
@@ -85,12 +82,12 @@ var ColorPicker = function ColorPicker(inProps) {
|
|
85
82
|
_components$ColorPick3 = components.ColorPickerEmptyPreview,
|
86
83
|
EmptyPreview = _components$ColorPick3 === void 0 ? DefaultNoColorPreviewIndicator : _components$ColorPick3,
|
87
84
|
inputWithPopperComponents = _objectWithoutProperties(components, _excluded2);
|
88
|
-
var
|
89
|
-
|
90
|
-
displayValue =
|
91
|
-
setDisplayValue =
|
85
|
+
var _useState = (0, _react.useState)(value !== null && value !== void 0 ? value : ""),
|
86
|
+
_useState2 = _slicedToArray(_useState, 2),
|
87
|
+
displayValue = _useState2[0],
|
88
|
+
setDisplayValue = _useState2[1];
|
92
89
|
var previewColor = displayValue ? (0, _tinycolor["default"])(displayValue) : null;
|
93
|
-
|
90
|
+
(0, _react.useEffect)(function () {
|
94
91
|
setDisplayValue(value !== null && value !== void 0 ? value : "");
|
95
92
|
}, [value, setDisplayValue]);
|
96
93
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
2
|
import { FieldRenderProps } from "react-final-form";
|
3
3
|
import { ColorPickerProps } from "./ColorPicker";
|
4
4
|
export type FinalFormColorPickerProps = ColorPickerProps & FieldRenderProps<string, HTMLInputElement | HTMLTextAreaElement>;
|
5
|
-
export declare const FinalFormColorPicker: ({ meta, input, ...restProps }: FinalFormColorPickerProps) =>
|
5
|
+
export declare const FinalFormColorPicker: ({ meta, input, ...restProps }: FinalFormColorPickerProps) => JSX.Element;
|
6
6
|
//# sourceMappingURL=FinalFormColorPicker.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FinalFormColorPicker.d.ts","sourceRoot":"","sources":["../src/FinalFormColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"FinalFormColorPicker.d.ts","sourceRoot":"","sources":["../src/FinalFormColorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAAC,CAAC;AAE5H,eAAO,MAAM,oBAAoB,kCAAmC,yBAAyB,gBAE5F,CAAC"}
|
@@ -1,15 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
5
4
|
value: true
|
6
5
|
});
|
7
6
|
exports.FinalFormColorPicker = void 0;
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
9
7
|
var _ColorPicker = require("./ColorPicker");
|
10
8
|
var _excluded = ["meta", "input"];
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
13
9
|
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); }
|
14
10
|
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; }
|
15
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@comet/admin-color-picker",
|
3
|
-
"version": "7.3.0-canary-
|
3
|
+
"version": "7.3.0-canary-20240827075324",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/vivid-planet/comet",
|
@@ -13,8 +13,8 @@
|
|
13
13
|
"lib"
|
14
14
|
],
|
15
15
|
"dependencies": {
|
16
|
-
"@comet/admin": "7.3.0-canary-
|
17
|
-
"@comet/admin-icons": "7.3.0-canary-
|
16
|
+
"@comet/admin": "7.3.0-canary-20240827075324",
|
17
|
+
"@comet/admin-icons": "7.3.0-canary-20240827075324",
|
18
18
|
"clsx": "^1.1.1",
|
19
19
|
"react-colorful": "^5.5.1",
|
20
20
|
"tinycolor2": "^1.4.1",
|
@@ -23,8 +23,8 @@
|
|
23
23
|
"devDependencies": {
|
24
24
|
"@babel/cli": "^7.17.6",
|
25
25
|
"@babel/core": "^7.20.12",
|
26
|
-
"@comet/admin-babel-preset": "7.3.0-canary-
|
27
|
-
"@comet/eslint-config": "7.3.0-canary-
|
26
|
+
"@comet/admin-babel-preset": "7.3.0-canary-20240827075324",
|
27
|
+
"@comet/eslint-config": "7.3.0-canary-20240827075324",
|
28
28
|
"@mui/material": "^5.0.0",
|
29
29
|
"@types/react": "^17.0.0",
|
30
30
|
"@types/react-dom": "^17.0.0",
|