@orfium/ictinus 4.84.1 → 4.85.0

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.
@@ -18,7 +18,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
18
18
  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); }
19
19
  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; }
20
20
  var Filter = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
21
- var _selectedItem$label;
22
21
  var items = props.items,
23
22
  onSelect = props.onSelect,
24
23
  selectedItem = props.selectedItem,
@@ -59,13 +58,15 @@ var Filter = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
59
58
  var _React$useState2 = _react["default"].useState(''),
60
59
  searchValue = _React$useState2[0],
61
60
  setSearchValue = _React$useState2[1];
62
- var _React$useState3 = _react["default"].useState((_selectedItem$label = selectedItem == null ? void 0 : selectedItem.label) != null ? _selectedItem$label : defaultValue.label),
61
+ var _React$useState3 = _react["default"].useState((0, _utils.getInitialFilterLabel)(defaultValue, multi, selectedItem, selectedItems)),
63
62
  filterLabel = _React$useState3[0],
64
63
  setFilterLabel = _React$useState3[1];
65
64
  _react["default"].useEffect(function () {
66
- var _selectedItem$label2;
67
- setFilterLabel((_selectedItem$label2 = selectedItem == null ? void 0 : selectedItem.label) != null ? _selectedItem$label2 : defaultValue.label);
68
- }, [defaultValue.label, selectedItem == null ? void 0 : selectedItem.label]);
65
+ /** Run this useEffect only for single Filter, multi Filter updates the label on every multi filter chip addition/deletion/clear all */
66
+ if (!multi) {
67
+ setFilterLabel((0, _utils.getInitialFilterLabel)(defaultValue, multi, selectedItem, selectedItems));
68
+ }
69
+ }, [defaultValue, filterLabel, multi, selectedItem, selectedItems]);
69
70
  var hasSelectedValue = Boolean(selectedItem == null ? void 0 : selectedItem.value) && (selectedItem == null ? void 0 : selectedItem.value) !== defaultValue.value;
70
71
  var iconName = isOpen ? 'triangleUp' : 'triangleDown';
71
72
  var _useMultiFilterUtils = (0, _useMultiFilterUtils2["default"])({
@@ -1,5 +1,5 @@
1
1
  import { PropsValidationError } from '../../utils/errors';
2
- import { BackgroundColorProps, BaseColorProps, BorderProps, Props } from './types';
2
+ import { BackgroundColorProps, BaseColorProps, BorderProps, FilterOption, Props } from './types';
3
3
  export declare const FILTER_OPTIONS_MAX_HEIGHT = 253;
4
4
  export declare const HAS_SELECTED_VALUE_COLOR_SHADE = 50;
5
5
  export declare const borderStyleParams: string;
@@ -16,3 +16,5 @@ export declare const errors: {
16
16
  condition: ({ filterType, styleType }: Props) => boolean;
17
17
  error: PropsValidationError;
18
18
  }[];
19
+ /** This callback returns the initial label of the Filter for all combinations */
20
+ export declare const getInitialFilterLabel: (defaultItem: FilterOption, multi: boolean, item?: import("../Select/Select").SelectOptionValues | undefined, items?: import("../Select/Select").SelectOptionValues[] | undefined) => string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.transparentFocusBorderWidth = exports.getTextColor = exports.getBorder = exports.getBackgroundColor = exports.focusBorderWidth = exports.errors = exports.borderStyleParams = exports.HAS_SELECTED_VALUE_COLOR_SHADE = exports.FILTER_OPTIONS_MAX_HEIGHT = void 0;
4
+ exports.transparentFocusBorderWidth = exports.getTextColor = exports.getInitialFilterLabel = exports.getBorder = exports.getBackgroundColor = exports.focusBorderWidth = exports.errors = exports.borderStyleParams = exports.HAS_SELECTED_VALUE_COLOR_SHADE = exports.FILTER_OPTIONS_MAX_HEIGHT = void 0;
5
5
  var _utils = require("../../theme/utils");
6
6
  var _palette = require("../../theme/palette");
7
7
  var _errors = require("../../utils/errors");
@@ -82,4 +82,21 @@ var errors = exports.errors = [{
82
82
  return Boolean(filterType === 'added' && styleType === 'transparent');
83
83
  },
84
84
  error: new _errors.PropsValidationError('This filterType and styleType is not supported')
85
- }];
85
+ }];
86
+
87
+ /** This callback returns the initial label of the Filter for all combinations */
88
+ var getInitialFilterLabel = exports.getInitialFilterLabel = function getInitialFilterLabel(defaultItem, multi, item, items) {
89
+ if (multi) {
90
+ if (items && items.length > 0) {
91
+ if (items.length === 1) {
92
+ return items[0].label;
93
+ } else {
94
+ return items[0].label + " + " + (items.length - 1) + " more";
95
+ }
96
+ }
97
+ }
98
+ if (item && !multi) {
99
+ return item.label;
100
+ }
101
+ return defaultItem.label;
102
+ };
@@ -1167,12 +1167,23 @@ LinkedIcon.defaultProps = {
1167
1167
  };
1168
1168
  var LockIcon = function LockIcon(props) {
1169
1169
  return (0, _react2.jsx)("svg", props, (0, _react2.jsx)("path", {
1170
- d: "M18 8.667h-1V6.762C17 4.133 14.76 2 12 2S7 4.133 7 6.762v1.905H6c-1.1 0-2 .857-2 1.904v9.524C4 21.143 4.9 22 6 22h12c1.1 0 2-.857 2-1.905v-9.524c0-1.047-.9-1.904-2-1.904Zm-6 8.571c-1.1 0-2-.857-2-1.905 0-1.047.9-1.904 2-1.904s2 .857 2 1.904c0 1.048-.9 1.905-2 1.905Zm3.1-8.571H8.9V6.762c0-1.629 1.39-2.952 3.1-2.952 1.71 0 3.1 1.323 3.1 2.952v1.905Z",
1171
- fill: "#000"
1170
+ d: "M5.436 18c-.549 0-1.009-.173-1.38-.52a1.691 1.691 0 0 1-.556-1.288v-7.05c0-.514.185-.943.556-1.29.371-.346.831-.519 1.38-.519h.467V5.862c0-1.078.399-1.991 1.196-2.74C7.897 2.375 8.864 2 10 2s2.103.374 2.9 1.123c.798.748 1.197 1.661 1.197 2.739v1.471h.467c.549 0 1.009.173 1.38.52.37.346.556.775.556 1.288v7.051c0 .513-.185.942-.556 1.289-.371.346-.831.519-1.38.519H5.436Zm4.567-3.752c.46 0 .85-.15 1.17-.452.321-.301.482-.666.482-1.095 0-.43-.162-.794-.485-1.093-.322-.3-.714-.45-1.173-.45-.46 0-.85.151-1.17.453-.321.301-.482.666-.482 1.095 0 .43.162.794.485 1.093.322.3.714.45 1.173.45ZM7.597 7.333h4.806V5.862c0-.625-.234-1.162-.702-1.61-.467-.447-1.035-.67-1.703-.67-.668 0-1.236.223-1.702.67-.466.448-.699.985-.699 1.61v1.471Z",
1171
+ fill: "#6265AD"
1172
1172
  }));
1173
1173
  };
1174
1174
  LockIcon.defaultProps = {
1175
- viewBox: "0 0 24 24",
1175
+ viewBox: "0 0 20 20",
1176
+ fill: "none",
1177
+ xmlns: "http://www.w3.org/2000/svg"
1178
+ };
1179
+ var UnlockIcon = function UnlockIcon(props) {
1180
+ return (0, _react2.jsx)("svg", props, (0, _react2.jsx)("path", {
1181
+ d: "M5.436 18c-.538 0-.996-.176-1.372-.527a1.687 1.687 0 0 1-.564-1.281v-7.05c0-.504.188-.93.564-1.282a1.937 1.937 0 0 1 1.372-.527h6.967V5.862c0-.625-.234-1.162-.7-1.61-.468-.447-1.035-.67-1.703-.67-.548 0-1.03.152-1.444.456-.414.304-.691.69-.832 1.156a1.204 1.204 0 0 1-.354.486.781.781 0 0 1-.5.182.888.888 0 0 1-.67-.277c-.177-.184-.233-.389-.17-.614.212-.848.685-1.555 1.42-2.121C8.182 2.283 9.032 2 10 2c1.136 0 2.103.376 2.9 1.128.798.751 1.197 1.663 1.197 2.734v1.471h.467c.538 0 .996.176 1.372.527.376.351.564.778.564 1.281v7.051c0 .503-.188.93-.564 1.281a1.937 1.937 0 0 1-1.372.527H5.436Zm4.567-3.752c.46 0 .85-.15 1.17-.452.321-.301.482-.666.482-1.095 0-.43-.162-.794-.485-1.093-.322-.3-.714-.45-1.173-.45-.46 0-.85.151-1.17.453-.321.301-.482.666-.482 1.095 0 .43.162.794.485 1.093.322.3.714.45 1.173.45Z",
1182
+ fill: "#6265AD"
1183
+ }));
1184
+ };
1185
+ UnlockIcon.defaultProps = {
1186
+ viewBox: "0 0 20 20",
1176
1187
  fill: "none",
1177
1188
  xmlns: "http://www.w3.org/2000/svg"
1178
1189
  };
@@ -2305,6 +2316,7 @@ var iconSelector = {
2305
2316
  licencedVideo: LicencedVideoIcon,
2306
2317
  linked: LinkedIcon,
2307
2318
  lock: LockIcon,
2319
+ unlock: UnlockIcon,
2308
2320
  mail: MailIcon,
2309
2321
  manual: ManualIcon,
2310
2322
  menu: MenuIcon,
@@ -1 +1 @@
1
- export declare type AcceptedIconNames = 'account' | 'actions' | 'add' | 'alert' | 'analytics' | 'analyticsVideos' | 'ancient' | 'arrowDown' | 'arrowLeft' | 'arrowRight' | 'arrowToLeft' | 'arrowToRight' | 'artist' | 'asset' | 'assetMatching' | 'auto' | 'broadcast' | 'calendarEmpty' | 'calendarFilled' | 'catalog' | 'channel' | 'catalogOverview' | 'catalogFiles' | 'chatBubble' | 'check' | 'checkedList' | 'checkmark' | 'chevronExtraSmallDown' | 'chevronExtraSmallLeft' | 'chevronExtraSmallRight' | 'chevronExtraSmallUp' | 'chevronLargeDown' | 'chevronLargeLeft' | 'chevronLargeRight' | 'chevronLargeUp' | 'chevronSmallDown' | 'chevronSmallLeft' | 'chevronSmallRight' | 'chevronSmallUp' | 'claimList' | 'clock' | 'close' | 'closeTag' | 'cmsProcess' | 'composition' | 'compositionRecording' | 'compositionV2' | 'confirmedMatches' | 'conflicts' | 'copy' | 'concert' | 'dashboard' | 'dataset' | 'delete' | 'delivery' | 'details' | 'digitalUse' | 'distribution' | 'dotsVertical' | 'download' | 'duplicate' | 'duplicate2' | 'earnings' | 'earnings2' | 'edit' | 'entities' | 'error' | 'expenses' | 'externalLink' | 'externalLinkV2' | 'fatArrowDown' | 'fatArrowLeft' | 'fatArrowRight' | 'fatArrowUp' | 'file' | 'financialChart' | 'generatedReports' | 'genericFile' | 'genericOrdering' | 'globalItem' | 'heartFill' | 'heartStroke' | 'help' | 'hourglass' | 'income' | 'infoFilled' | 'info' | 'issues' | 'keyword' | 'legalFiles' | 'licence' | 'licencedVideo' | 'linked' | 'lock' | 'mail' | 'manual' | 'menu' | 'microphone' | 'minus' | 'moreOptionsHorizontal' | 'moreOptionsVertical' | 'musicNote' | 'myEarnings' | 'notifications' | 'notifications2' | 'oneWay' | 'others' | 'ownershipValidation' | 'pageFirst' | 'pageLast' | 'percentage' | 'play' | 'plus' | 'policies' | 'process' | 'processManagement' | 'publicPerformance' | 'publisher' | 'recording' | 'recordLabel' | 'recordLabelV2' | 'referenceFile' | 'relations' | 'restore' | 'result' | 'royaltyShares' | 'search' | 'searchMusic' | 'searchThunder' | 'settings' | 'sight' | 'sortAscending' | 'sortDescending' | 'stamp' | 'statements' | 'success' | 'television' | 'thumbsUp' | 'thunder' | 'ticTacToeArrow' | 'timeOut' | 'training' | 'triangleDown' | 'triangleLeft' | 'triangleRight' | 'triangleUp' | 'trophy' | 'TVCinema' | 'TVRadio' | 'update' | 'upload' | 'user' | 'userAvatar' | 'users' | 'users2' | 'videoConfirmation' | 'view' | 'warning' | 'works' | 'writer' | 'youtube' | 'refresh' | 'star' | 'pause' | 'resume' | 'restart' | 'entity' | 'playCount' | 'processedLogs' | 'proposed' | 'unpaired' | 'unpairedV2' | 'clockOutlined' | 'userCheck' | 'undo' | 'bookmark' | 'tag' | 'triangleWarning' | 'audioOff' | 'audioOn' | 'imageFillOff' | 'imageFillOn' | 'imageOutlinedOff' | 'imageOutlinedOn' | 'videoFillOff' | 'videoFillOn' | 'videoOutlineOff' | 'videoOutlineOn';
1
+ export declare type AcceptedIconNames = 'account' | 'actions' | 'add' | 'alert' | 'analytics' | 'analyticsVideos' | 'ancient' | 'arrowDown' | 'arrowLeft' | 'arrowRight' | 'arrowToLeft' | 'arrowToRight' | 'artist' | 'asset' | 'assetMatching' | 'auto' | 'broadcast' | 'calendarEmpty' | 'calendarFilled' | 'catalog' | 'channel' | 'catalogOverview' | 'catalogFiles' | 'chatBubble' | 'check' | 'checkedList' | 'checkmark' | 'chevronExtraSmallDown' | 'chevronExtraSmallLeft' | 'chevronExtraSmallRight' | 'chevronExtraSmallUp' | 'chevronLargeDown' | 'chevronLargeLeft' | 'chevronLargeRight' | 'chevronLargeUp' | 'chevronSmallDown' | 'chevronSmallLeft' | 'chevronSmallRight' | 'chevronSmallUp' | 'claimList' | 'clock' | 'close' | 'closeTag' | 'cmsProcess' | 'composition' | 'compositionRecording' | 'compositionV2' | 'confirmedMatches' | 'conflicts' | 'copy' | 'concert' | 'dashboard' | 'dataset' | 'delete' | 'delivery' | 'details' | 'digitalUse' | 'distribution' | 'dotsVertical' | 'download' | 'duplicate' | 'duplicate2' | 'earnings' | 'earnings2' | 'edit' | 'entities' | 'error' | 'expenses' | 'externalLink' | 'externalLinkV2' | 'fatArrowDown' | 'fatArrowLeft' | 'fatArrowRight' | 'fatArrowUp' | 'file' | 'financialChart' | 'generatedReports' | 'genericFile' | 'genericOrdering' | 'globalItem' | 'heartFill' | 'heartStroke' | 'help' | 'hourglass' | 'income' | 'infoFilled' | 'info' | 'issues' | 'keyword' | 'legalFiles' | 'licence' | 'licencedVideo' | 'linked' | 'lock' | 'mail' | 'manual' | 'menu' | 'microphone' | 'minus' | 'moreOptionsHorizontal' | 'moreOptionsVertical' | 'musicNote' | 'myEarnings' | 'notifications' | 'notifications2' | 'oneWay' | 'others' | 'ownershipValidation' | 'pageFirst' | 'pageLast' | 'percentage' | 'play' | 'plus' | 'policies' | 'process' | 'processManagement' | 'publicPerformance' | 'publisher' | 'recording' | 'recordLabel' | 'recordLabelV2' | 'referenceFile' | 'relations' | 'restore' | 'result' | 'royaltyShares' | 'search' | 'searchMusic' | 'searchThunder' | 'settings' | 'sight' | 'sortAscending' | 'sortDescending' | 'stamp' | 'statements' | 'success' | 'television' | 'thumbsUp' | 'thunder' | 'ticTacToeArrow' | 'timeOut' | 'training' | 'triangleDown' | 'triangleLeft' | 'triangleRight' | 'triangleUp' | 'trophy' | 'TVCinema' | 'TVRadio' | 'update' | 'upload' | 'user' | 'userAvatar' | 'users' | 'users2' | 'videoConfirmation' | 'view' | 'warning' | 'works' | 'writer' | 'youtube' | 'refresh' | 'star' | 'pause' | 'resume' | 'restart' | 'entity' | 'playCount' | 'processedLogs' | 'proposed' | 'unpaired' | 'unpairedV2' | 'clockOutlined' | 'userCheck' | 'undo' | 'unlock' | 'bookmark' | 'tag' | 'triangleWarning' | 'audioOff' | 'audioOn' | 'imageFillOff' | 'imageFillOn' | 'imageOutlinedOff' | 'imageOutlinedOn' | 'videoFillOff' | 'videoFillOn' | 'videoOutlineOff' | 'videoOutlineOn';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orfium/ictinus",
3
- "version": "4.84.1",
3
+ "version": "4.85.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",