@comet/admin-color-picker 7.3.0-canary-20240827075324 → 7.3.0-canary-20240827115253

Sign up to get free protection for your applications and to get access to all the features.
package/lib/ColorField.js CHANGED
@@ -1,16 +1,23 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.ColorField = void 0;
7
8
  var _admin = require("@comet/admin");
8
9
  var _FinalFormColorPicker = require("./FinalFormColorPicker");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ 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; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
16
  function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
10
17
  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); }
11
18
  var ColorField = function ColorField(_ref) {
12
19
  var restProps = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
13
- return /*#__PURE__*/React.createElement(_admin.Field, _extends({
20
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.Field, _objectSpread({
14
21
  component: _FinalFormColorPicker.FinalFormColorPicker
15
22
  }, restProps));
16
23
  };
@@ -1,5 +1,6 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -13,10 +14,15 @@ var _reactIntl = require("react-intl");
13
14
  var _tinycolor = _interopRequireDefault(require("tinycolor2"));
14
15
  var _useDebounce = require("use-debounce");
15
16
  var _ColorPicker = require("./ColorPicker.slots");
17
+ var _jsxRuntime = require("react/jsx-runtime");
16
18
  var _excluded = ["classes", "value", "colorFormat", "hidePicker", "hideHeader", "hideFooter", "colorPalette", "onChange", "startAdornment", "endAdornment", "onBlur", "required", "titleText", "clearButtonText", "components", "slotProps"],
17
19
  _excluded2 = ["ColorPickerColorPreview", "ColorPickerInvalidPreview", "ColorPickerEmptyPreview"];
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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); }
21
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
+ 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; }
24
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
26
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
27
  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."); }
22
28
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -28,7 +34,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
28
34
  var DefaultColorPreviewIndicator = function DefaultColorPreviewIndicator(_ref) {
29
35
  var type = _ref.type,
30
36
  color = _ref.color;
31
- return /*#__PURE__*/React.createElement(_ColorPicker.PreviewIndicator, {
37
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.PreviewIndicator, {
32
38
  ownerState: {
33
39
  type: type,
34
40
  color: color
@@ -37,7 +43,7 @@ var DefaultColorPreviewIndicator = function DefaultColorPreviewIndicator(_ref) {
37
43
  };
38
44
  var DefaultNoColorPreviewIndicator = function DefaultNoColorPreviewIndicator(_ref2) {
39
45
  var type = _ref2.type;
40
- return /*#__PURE__*/React.createElement(_ColorPicker.PreviewIndicator, {
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.PreviewIndicator, {
41
47
  ownerState: {
42
48
  type: type
43
49
  }
@@ -62,12 +68,12 @@ var ColorPicker = function ColorPicker(inProps) {
62
68
  _onBlur = _useThemeProps.onBlur,
63
69
  required = _useThemeProps.required,
64
70
  _useThemeProps$titleT = _useThemeProps.titleText,
65
- titleText = _useThemeProps$titleT === void 0 ? /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
71
+ titleText = _useThemeProps$titleT === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
66
72
  id: "comet.colorPicker.title",
67
73
  defaultMessage: "Choose a color"
68
74
  }) : _useThemeProps$titleT,
69
75
  _useThemeProps$clearB = _useThemeProps.clearButtonText,
70
- clearButtonText = _useThemeProps$clearB === void 0 ? /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, {
76
+ clearButtonText = _useThemeProps$clearB === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
71
77
  id: "comet.colorPicker.clearButton",
72
78
  defaultMessage: "clear color"
73
79
  }) : _useThemeProps$clearB,
@@ -109,26 +115,34 @@ var ColorPicker = function ColorPicker(inProps) {
109
115
  setDisplayValue("");
110
116
  }
111
117
  };
112
- return /*#__PURE__*/React.createElement(_ColorPicker.Root, _extends({
118
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.Root, _objectSpread(_objectSpread(_objectSpread({
113
119
  required: required,
114
- startAdornment: startAdornment ? startAdornment : /*#__PURE__*/React.createElement(_ColorPicker.InputAdornment, _extends({
120
+ startAdornment: startAdornment ? startAdornment : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.InputAdornment, _objectSpread(_objectSpread({
115
121
  position: "start",
116
122
  disablePointerEvents: true
117
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.inputAdornment), /*#__PURE__*/React.createElement(_ColorPicker.Preview, null, previewColor ? previewColor.isValid() ? /*#__PURE__*/React.createElement(ColorPreview, _extends({
118
- type: "color",
119
- color: previewColor.toRgbString()
120
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorColor)) : /*#__PURE__*/React.createElement(InvalidPreview, _extends({
121
- type: "invalid"
122
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorInvalid), "?") : /*#__PURE__*/React.createElement(EmptyPreview, _extends({
123
- type: "empty"
124
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorEmpty)))),
125
- endAdornment: !required ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_admin.ClearInputAdornment, {
126
- position: "end",
127
- hasClearableContent: Boolean(value),
128
- onClick: function onClick() {
129
- return onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
130
- }
131
- }), endAdornment) : endAdornment,
123
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.inputAdornment), {}, {
124
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.Preview, {
125
+ children: previewColor ? previewColor.isValid() ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ColorPreview, _objectSpread(_objectSpread({
126
+ type: "color",
127
+ color: previewColor.toRgbString()
128
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator), slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorColor)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(InvalidPreview, _objectSpread(_objectSpread(_objectSpread({
129
+ type: "invalid"
130
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator), slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorInvalid), {}, {
131
+ children: "?"
132
+ })) : /*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyPreview, _objectSpread(_objectSpread({
133
+ type: "empty"
134
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator), slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorEmpty))
135
+ })
136
+ })),
137
+ endAdornment: !required ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
138
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_admin.ClearInputAdornment, {
139
+ position: "end",
140
+ hasClearableContent: Boolean(value),
141
+ onClick: function onClick() {
142
+ return onChange === null || onChange === void 0 ? void 0 : onChange(undefined);
143
+ }
144
+ }), endAdornment]
145
+ }) : endAdornment,
132
146
  value: displayValue,
133
147
  onChange: function onChange(e) {
134
148
  setDisplayValue(e.currentTarget.value);
@@ -138,36 +152,56 @@ var ColorPicker = function ColorPicker(inProps) {
138
152
  onChangeColor(displayValue);
139
153
  },
140
154
  components: inputWithPopperComponents
141
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root, restProps), function (closePopper) {
142
- return /*#__PURE__*/React.createElement(_ColorPicker.PopperRoot, slotProps === null || slotProps === void 0 ? void 0 : slotProps.popperRoot, !hideHeader && /*#__PURE__*/React.createElement(_ColorPicker.Header, slotProps === null || slotProps === void 0 ? void 0 : slotProps.header, /*#__PURE__*/React.createElement(_ColorPicker.HeaderTitleText, slotProps === null || slotProps === void 0 ? void 0 : slotProps.headerTitleText, titleText), /*#__PURE__*/React.createElement(_ColorPicker.HeaderCloseButton, _extends({
143
- onClick: function onClick() {
144
- return closePopper(true);
145
- }
146
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.headerCloseButton), /*#__PURE__*/React.createElement(_adminIcons.Close, null))), !hidePicker && /*#__PURE__*/React.createElement(_ColorPicker.ColorPickerWrapper, slotProps === null || slotProps === void 0 ? void 0 : slotProps.colorPickerWrapper, colorFormat === "hex" && /*#__PURE__*/React.createElement(_ColorPicker.HexColorPicker, _extends({
147
- color: value !== null && value !== void 0 ? value : "",
148
- onChange: onChangeColor
149
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.hexColorPicker)), colorFormat === "rgba" && /*#__PURE__*/React.createElement(_ColorPicker.RgbaStringColorPicker, _extends({
150
- color: value !== null && value !== void 0 ? value : "",
151
- onChange: onChangeColor
152
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.rgbaStringColorPicker))), (colorPalette === null || colorPalette === void 0 ? void 0 : colorPalette.length) && /*#__PURE__*/React.createElement(_ColorPicker.ColorPalette, slotProps === null || slotProps === void 0 ? void 0 : slotProps.colorPalette, colorPalette.map(function (color, index) {
153
- return /*#__PURE__*/React.createElement(_ColorPicker.ColorPaletteItem, _extends({
154
- key: "".concat(index, "_").concat(color),
155
- onClick: function onClick() {
156
- onChangeColor(color);
157
- closePopper(true);
158
- },
159
- ownerState: {
160
- colorValue: color
161
- }
162
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.colorPaletteItem));
163
- })), !hideFooter && /*#__PURE__*/React.createElement(_ColorPicker.Footer, slotProps === null || slotProps === void 0 ? void 0 : slotProps.footer, /*#__PURE__*/React.createElement(_ColorPicker.FooterClearButton, _extends({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.footerClearButton, {
164
- onClick: function onClick() {
165
- onChangeColor("");
166
- closePopper(true);
167
- }
168
- }), /*#__PURE__*/React.createElement(_ColorPicker.Preview, slotProps === null || slotProps === void 0 ? void 0 : slotProps.preview, /*#__PURE__*/React.createElement(EmptyPreview, _extends({
169
- type: "empty"
170
- }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorEmpty))), /*#__PURE__*/React.createElement(_material.Typography, null, clearButtonText))));
171
- });
155
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.root), restProps), {}, {
156
+ children: function children(closePopper) {
157
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ColorPicker.PopperRoot, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.popperRoot), {}, {
158
+ children: [!hideHeader && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ColorPicker.Header, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.header), {}, {
159
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.HeaderTitleText, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.headerTitleText), {}, {
160
+ children: titleText
161
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.HeaderCloseButton, _objectSpread(_objectSpread({
162
+ onClick: function onClick() {
163
+ return closePopper(true);
164
+ }
165
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.headerCloseButton), {}, {
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_adminIcons.Close, {})
167
+ }))]
168
+ })), !hidePicker && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ColorPicker.ColorPickerWrapper, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.colorPickerWrapper), {}, {
169
+ children: [colorFormat === "hex" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.HexColorPicker, _objectSpread({
170
+ color: value !== null && value !== void 0 ? value : "",
171
+ onChange: onChangeColor
172
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.hexColorPicker)), colorFormat === "rgba" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.RgbaStringColorPicker, _objectSpread({
173
+ color: value !== null && value !== void 0 ? value : "",
174
+ onChange: onChangeColor
175
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.rgbaStringColorPicker))]
176
+ })), (colorPalette === null || colorPalette === void 0 ? void 0 : colorPalette.length) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.ColorPalette, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.colorPalette), {}, {
177
+ children: colorPalette.map(function (color, index) {
178
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.ColorPaletteItem, _objectSpread({
179
+ onClick: function onClick() {
180
+ onChangeColor(color);
181
+ closePopper(true);
182
+ },
183
+ ownerState: {
184
+ colorValue: color
185
+ }
186
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.colorPaletteItem), "".concat(index, "_").concat(color));
187
+ })
188
+ })), !hideFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.Footer, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.footer), {}, {
189
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ColorPicker.FooterClearButton, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.footerClearButton), {}, {
190
+ onClick: function onClick() {
191
+ onChangeColor("");
192
+ closePopper(true);
193
+ },
194
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.Preview, _objectSpread(_objectSpread({}, slotProps === null || slotProps === void 0 ? void 0 : slotProps.preview), {}, {
195
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyPreview, _objectSpread(_objectSpread({
196
+ type: "empty"
197
+ }, slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicator), slotProps === null || slotProps === void 0 ? void 0 : slotProps.previewIndicatorEmpty))
198
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
199
+ children: clearButtonText
200
+ })]
201
+ }))
202
+ }))]
203
+ }));
204
+ }
205
+ }));
172
206
  };
173
207
  exports.ColorPicker = ColorPicker;
@@ -1,18 +1,24 @@
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.FinalFormColorPicker = void 0;
7
8
  var _ColorPicker = require("./ColorPicker");
9
+ var _jsxRuntime = require("react/jsx-runtime");
8
10
  var _excluded = ["meta", "input"];
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); }
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ 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; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
16
  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; }
11
17
  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; }
12
18
  var FinalFormColorPicker = function FinalFormColorPicker(_ref) {
13
19
  var meta = _ref.meta,
14
20
  input = _ref.input,
15
21
  restProps = _objectWithoutProperties(_ref, _excluded);
16
- return /*#__PURE__*/React.createElement(_ColorPicker.ColorPicker, _extends({}, input, restProps));
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ColorPicker.ColorPicker, _objectSpread(_objectSpread({}, input), restProps));
17
23
  };
18
24
  exports.FinalFormColorPicker = FinalFormColorPicker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/admin-color-picker",
3
- "version": "7.3.0-canary-20240827075324",
3
+ "version": "7.3.0-canary-20240827115253",
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-20240827075324",
17
- "@comet/admin-icons": "7.3.0-canary-20240827075324",
16
+ "@comet/admin": "7.3.0-canary-20240827115253",
17
+ "@comet/admin-icons": "7.3.0-canary-20240827115253",
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-20240827075324",
27
- "@comet/eslint-config": "7.3.0-canary-20240827075324",
26
+ "@comet/admin-babel-preset": "7.3.0-canary-20240827115253",
27
+ "@comet/eslint-config": "7.3.0-canary-20240827115253",
28
28
  "@mui/material": "^5.0.0",
29
29
  "@types/react": "^17.0.0",
30
30
  "@types/react-dom": "^17.0.0",