Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rc-component/tour

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rc-component/tour - npm Package Compare versions

Comparing version 1.14.0 to 1.14.1

2

es/hooks/useClosable.d.ts
import * as React from 'react';
import type { TourProps } from '../interface';
import type { TourStepInfo } from '../TourStep';
export declare function useClosable(prefixCls: string, stepClosable: TourStepInfo['closable'], stepCloseIcon: TourStepInfo['closeIcon'], closable: TourProps['closable'], closeIcon: TourProps['closeIcon']): {
export declare function useClosable(stepClosable: TourStepInfo['closable'], stepCloseIcon: TourStepInfo['closeIcon'], closable: TourProps['closable'], closeIcon: TourProps['closeIcon']): {
closeIcon?: React.ReactNode;
} & React.AriaAttributes;

@@ -11,13 +11,11 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";

*/
function getClosableConfig(prefixCls, closable, closeIcon, preset) {
function getClosableConfig(closable, closeIcon, preset) {
if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable.closeIcon)) {
return null;
}
var defaultIcon = /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-close-x")
}, "\xD7");
var mergedCloseIcon = typeof closeIcon !== 'boolean' && closeIcon || defaultIcon;
var mergedCloseIcon = typeof closeIcon !== 'boolean' ? closeIcon : undefined;
if (isConfigObj(closable)) {
var _closable$closeIcon;
return _objectSpread(_objectSpread({}, closable), {}, {
closeIcon: closable.closeIcon || mergedCloseIcon
closeIcon: (_closable$closeIcon = closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : mergedCloseIcon
});

@@ -31,6 +29,6 @@ }

}
export function useClosable(prefixCls, stepClosable, stepCloseIcon, closable, closeIcon) {
export function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {
return React.useMemo(function () {
var stepClosableConfig = getClosableConfig(prefixCls, stepClosable, stepCloseIcon, false);
var rootClosableConfig = getClosableConfig(prefixCls, closable, closeIcon, true);
var stepClosableConfig = getClosableConfig(stepClosable, stepCloseIcon, false);
var rootClosableConfig = getClosableConfig(closable, closeIcon, true);
if (stepClosableConfig !== 'empty') {

@@ -40,3 +38,3 @@ return stepClosableConfig;

return rootClosableConfig;
}, [closable, closeIcon, prefixCls, stepClosable, stepCloseIcon]);
}, [closable, closeIcon, stepClosable, stepCloseIcon]);
}

@@ -94,3 +94,3 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";

stepClosable = _ref.closable;
var mergedClosable = useClosable(prefixCls, stepClosable, stepCloseIcon, closable, closeIcon);
var mergedClosable = useClosable(stepClosable, stepCloseIcon, closable, closeIcon);
var mergedMask = mergedOpen && (stepMask !== null && stepMask !== void 0 ? stepMask : mask);

@@ -97,0 +97,0 @@ var mergedScrollIntoViewOptions = stepScrollIntoViewOptions !== null && stepScrollIntoViewOptions !== void 0 ? stepScrollIntoViewOptions : scrollIntoViewOptions;

@@ -7,2 +7,3 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";

export default function DefaultPanel(props) {
var _closable$closeIcon;
var prefixCls = props.prefixCls,

@@ -20,3 +21,5 @@ current = props.current,

var ariaProps = pickAttrs(closable || {}, true);
var closeIcon = closable === null || closable === void 0 ? void 0 : closable.closeIcon;
var closeIcon = (_closable$closeIcon = closable === null || closable === void 0 ? void 0 : closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-close-x")
}, "\xD7");
var mergedClosable = !!closable;

@@ -23,0 +26,0 @@ return /*#__PURE__*/React.createElement("div", {

import * as React from 'react';
import type { TourProps } from '../interface';
import type { TourStepInfo } from '../TourStep';
export declare function useClosable(prefixCls: string, stepClosable: TourStepInfo['closable'], stepCloseIcon: TourStepInfo['closeIcon'], closable: TourProps['closable'], closeIcon: TourProps['closeIcon']): {
export declare function useClosable(stepClosable: TourStepInfo['closable'], stepCloseIcon: TourStepInfo['closeIcon'], closable: TourProps['closable'], closeIcon: TourProps['closeIcon']): {
closeIcon?: React.ReactNode;
} & React.AriaAttributes;

@@ -19,13 +19,11 @@ "use strict";

*/
function getClosableConfig(prefixCls, closable, closeIcon, preset) {
function getClosableConfig(closable, closeIcon, preset) {
if (closable === false || closeIcon === false && (!isConfigObj(closable) || !closable.closeIcon)) {
return null;
}
var defaultIcon = /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-close-x")
}, "\xD7");
var mergedCloseIcon = typeof closeIcon !== 'boolean' && closeIcon || defaultIcon;
var mergedCloseIcon = typeof closeIcon !== 'boolean' ? closeIcon : undefined;
if (isConfigObj(closable)) {
var _closable$closeIcon;
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, closable), {}, {
closeIcon: closable.closeIcon || mergedCloseIcon
closeIcon: (_closable$closeIcon = closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : mergedCloseIcon
});

@@ -39,6 +37,6 @@ }

}
function useClosable(prefixCls, stepClosable, stepCloseIcon, closable, closeIcon) {
function useClosable(stepClosable, stepCloseIcon, closable, closeIcon) {
return React.useMemo(function () {
var stepClosableConfig = getClosableConfig(prefixCls, stepClosable, stepCloseIcon, false);
var rootClosableConfig = getClosableConfig(prefixCls, closable, closeIcon, true);
var stepClosableConfig = getClosableConfig(stepClosable, stepCloseIcon, false);
var rootClosableConfig = getClosableConfig(closable, closeIcon, true);
if (stepClosableConfig !== 'empty') {

@@ -48,3 +46,3 @@ return stepClosableConfig;

return rootClosableConfig;
}, [closable, closeIcon, prefixCls, stepClosable, stepCloseIcon]);
}, [closable, closeIcon, stepClosable, stepCloseIcon]);
}

@@ -102,3 +102,3 @@ "use strict";

stepClosable = _ref.closable;
var mergedClosable = (0, _useClosable.useClosable)(prefixCls, stepClosable, stepCloseIcon, closable, closeIcon);
var mergedClosable = (0, _useClosable.useClosable)(stepClosable, stepCloseIcon, closable, closeIcon);
var mergedMask = mergedOpen && (stepMask !== null && stepMask !== void 0 ? stepMask : mask);

@@ -105,0 +105,0 @@ var mergedScrollIntoViewOptions = stepScrollIntoViewOptions !== null && stepScrollIntoViewOptions !== void 0 ? stepScrollIntoViewOptions : scrollIntoViewOptions;

@@ -15,2 +15,3 @@ "use strict";

function DefaultPanel(props) {
var _closable$closeIcon;
var prefixCls = props.prefixCls,

@@ -28,3 +29,5 @@ current = props.current,

var ariaProps = (0, _pickAttrs.default)(closable || {}, true);
var closeIcon = closable === null || closable === void 0 ? void 0 : closable.closeIcon;
var closeIcon = (_closable$closeIcon = closable === null || closable === void 0 ? void 0 : closable.closeIcon) !== null && _closable$closeIcon !== void 0 ? _closable$closeIcon : /*#__PURE__*/React.createElement("span", {
className: "".concat(prefixCls, "-close-x")
}, "\xD7");
var mergedClosable = !!closable;

@@ -31,0 +34,0 @@ return /*#__PURE__*/React.createElement("div", {

{
"name": "@rc-component/tour",
"version": "1.14.0",
"version": "1.14.1",
"description": "React tour Component",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc