siam-ui-utils 3.1.3 → 3.1.5
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.
- package/dist/_virtual/index.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js +3 -3
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js +3 -3
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js.map +1 -1
- package/dist/react-notifications/index.js +3 -8
- package/dist/react-notifications/index.js.map +1 -1
- package/dist/select/custom-select/index.js +10 -89
- package/dist/select/custom-select/index.js.map +1 -1
- package/package.json +6 -4
- package/dist/_virtual/events.js +0 -6
- package/dist/_virtual/events.js.map +0 -1
- package/dist/_virtual/events2.js +0 -5
- package/dist/_virtual/events2.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -9
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
- package/dist/node_modules/dom-helpers/esm/addClass.js +0 -10
- package/dist/node_modules/dom-helpers/esm/addClass.js.map +0 -1
- package/dist/node_modules/dom-helpers/esm/hasClass.js +0 -8
- package/dist/node_modules/dom-helpers/esm/hasClass.js.map +0 -1
- package/dist/node_modules/dom-helpers/esm/removeClass.js +0 -16
- package/dist/node_modules/dom-helpers/esm/removeClass.js.map +0 -1
- package/dist/node_modules/events/events.js +0 -372
- package/dist/node_modules/events/events.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js +0 -275
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/Transition.js +0 -441
- package/dist/node_modules/react-transition-group/esm/Transition.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +0 -146
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +0 -6
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/config.js +0 -7
- package/dist/node_modules/react-transition-group/esm/config.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js +0 -100
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +0 -24
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js +0 -7
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js.map +0 -1
- package/dist/react-notifications/Notification.js +0 -73
- package/dist/react-notifications/Notification.js.map +0 -1
- package/dist/react-notifications/NotificationContainer.js +0 -59
- package/dist/react-notifications/NotificationContainer.js.map +0 -1
- package/dist/react-notifications/NotificationManager.js +0 -174
- package/dist/react-notifications/NotificationManager.js.map +0 -1
- package/dist/react-notifications/Notifications.js +0 -72
- package/dist/react-notifications/Notifications.js.map +0 -1
- package/dist/react-notifications/constants.js +0 -26
- package/dist/react-notifications/constants.js.map +0 -1
- package/dist/react-notifications/notifications.css +0 -213
- package/dist/select/custom-select/constants.js +0 -8
- package/dist/select/custom-select/constants.js.map +0 -1
|
@@ -1,89 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const [selectedIoption, setIoption] = useState({});
|
|
12
|
-
const [customStylesOption] = useState(props.customStylesOption);
|
|
13
|
-
const [customStyles, setCustomStyles] = useState({});
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (newItem) {
|
|
16
|
-
props.options.push(newItem);
|
|
17
|
-
}
|
|
18
|
-
}, [newItem, props.options]);
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
const { options = [] } = props;
|
|
21
|
-
if (firstElement && Number(options?.length) > 1) {
|
|
22
|
-
const propIOption = options.filter((item) => item === firstElement);
|
|
23
|
-
if (propIOption?.length === 0) {
|
|
24
|
-
props.options.unshift(firstElement);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}, [firstElement, props.options]);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
const { selectedValue } = props;
|
|
30
|
-
const errorProp = { value: null };
|
|
31
|
-
if (selectedValue || firstElement && firstElement.value === selectedValue) {
|
|
32
|
-
const propIOption = props.options.filter(({ value }) => {
|
|
33
|
-
return JSON.stringify(value) === JSON.stringify(selectedValue);
|
|
34
|
-
});
|
|
35
|
-
if (propIOption[0]) {
|
|
36
|
-
setIoption(propIOption[0]);
|
|
37
|
-
if (!Object.getOwnPropertyDescriptor(selectedIoption, "label")) {
|
|
38
|
-
props.onChange(propIOption[0]);
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
setIoption(errorProp);
|
|
42
|
-
props.onChange(errorProp);
|
|
43
|
-
}
|
|
44
|
-
} else if (props.options.length > 0) {
|
|
45
|
-
setIoption(errorProp);
|
|
46
|
-
props.onChange(errorProp);
|
|
47
|
-
}
|
|
48
|
-
}, [props.selectedValue, props.options, firstElement]);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (customStylesOption) {
|
|
51
|
-
const stylesOption = {
|
|
52
|
-
option: (base, { data }) => {
|
|
53
|
-
return {
|
|
54
|
-
...base,
|
|
55
|
-
color: data.fields && data.fields[customStylesOption.fieldMatch] === customStylesOption.valueMatch ? "blue !important" : "",
|
|
56
|
-
fontWeight: data.fields && data.fields[customStylesOption.fieldMatch] === customStylesOption.valueMatch ? "bold" : ""
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
setCustomStyles(stylesOption);
|
|
61
|
-
}
|
|
62
|
-
}, [customStylesOption]);
|
|
63
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
64
|
-
props.label && props.label !== "" && /* @__PURE__ */ jsxs(Label, { className: "mb-0", children: [
|
|
65
|
-
props.label,
|
|
66
|
-
":"
|
|
67
|
-
] }),
|
|
68
|
-
/* @__PURE__ */ jsx(
|
|
69
|
-
Select,
|
|
70
|
-
{
|
|
71
|
-
...props,
|
|
72
|
-
components: { Input: CustomSelectInput },
|
|
73
|
-
className: "react-select",
|
|
74
|
-
classNamePrefix: "react-select",
|
|
75
|
-
name: "form-field-name",
|
|
76
|
-
value: Object.getOwnPropertyDescriptor(selectedIoption, "label") ? selectedIoption : "",
|
|
77
|
-
onChange: props.onChange,
|
|
78
|
-
options: props.options,
|
|
79
|
-
placeholder: Number(props.options.length) === 0 ? SIN_DATOS : props.placeholder || SELECCIONE,
|
|
80
|
-
isDisabled: props.disabled,
|
|
81
|
-
styles: customStyles
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
] });
|
|
85
|
-
};
|
|
86
|
-
export {
|
|
87
|
-
CustomSelect
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Select } from "siam-ui";
|
|
3
|
+
const CustomSelect = (props) => {
|
|
4
|
+
const _props = { ...props, searchable: props.searchable || true };
|
|
5
|
+
return /* @__PURE__ */ jsx(Select, { ..._props, style: { fontSize: "12px" } });
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
CustomSelect
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/select/custom-select/index.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/select/custom-select/index.tsx"],"sourcesContent":["import { Select, type SelectProps } from 'siam-ui';\r\nimport React from 'react';\r\n\r\nexport const CustomSelect: React.FC<SelectProps> = (props) => {\r\n const _props = { ...props, searchable: props.searchable || true };\r\n return (\r\n <Select {..._props} style={{ fontSize: '12px' }} />\r\n )\r\n};\r\nexport default CustomSelect;\r\n"],"names":[],"mappings":";;AAGO,MAAM,eAAsC,CAAC,UAAU;AAC5D,QAAM,SAAS,EAAE,GAAG,OAAO,YAAY,MAAM,cAAc,KAAA;AAC3D,SACE,oBAAC,UAAQ,GAAG,QAAQ,OAAO,EAAE,UAAU,UAAU;AAErD;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "siam-ui-utils",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ampf-react",
|
|
6
6
|
"ampf-utils",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@neolution-ch/reactstrap": "^10.0.0",
|
|
94
94
|
"@types/react-intl": "^3.0.0",
|
|
95
|
-
"@whereby.com/browser-sdk": "^3.
|
|
95
|
+
"@whereby.com/browser-sdk": "^3.12.18",
|
|
96
96
|
"dropzone": "^6.0.0-beta.2",
|
|
97
97
|
"events": "^3.3.0",
|
|
98
98
|
"html5-file-selector": "^2.1.0",
|
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
"react-intl": "^7.1.14",
|
|
103
103
|
"react-notifications": "^1.7.4",
|
|
104
104
|
"react-select": "^5.10.2",
|
|
105
|
+
"siam-ui": "^1.1.6",
|
|
105
106
|
"siam-utils": "^1.1.4",
|
|
106
107
|
"styled-components": "^6.1.12"
|
|
107
108
|
},
|
|
@@ -131,6 +132,7 @@
|
|
|
131
132
|
"vitest": "^3.2.4"
|
|
132
133
|
},
|
|
133
134
|
"overrides": {
|
|
134
|
-
"react-popper": "2.3.0"
|
|
135
|
+
"react-popper": "2.3.0",
|
|
136
|
+
"ip-address": "^10.2.0"
|
|
135
137
|
}
|
|
136
|
-
}
|
|
138
|
+
}
|
package/dist/_virtual/events.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/_virtual/events2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assertThisInitialized.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"],"sourcesContent":["function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nexport { _assertThisInitialized as default };"],"names":[],"mappings":"AAAA,SAAS,uBAAuB,GAAG;AACjC,MAAI,WAAW,EAAG,OAAM,IAAI,eAAe,2DAA2D;AACtG,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function _extends() {
|
|
2
|
-
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
3
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
4
|
-
var t = arguments[e];
|
|
5
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
6
|
-
}
|
|
7
|
-
return n;
|
|
8
|
-
}, _extends.apply(null, arguments);
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
_extends as default
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=extends.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extends.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/extends.js"],"sourcesContent":["function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };"],"names":[],"mappings":"AAAA,SAAS,WAAW;AAClB,SAAO,WAAW,OAAO,SAAS,OAAO,OAAO,KAAI,IAAK,SAAU,GAAG;AACpE,aAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,UAAI,IAAI,UAAU,CAAC;AACnB,eAAS,KAAK,EAAG,EAAC,CAAA,GAAI,eAAe,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,IAChE;AACA,WAAO;AAAA,EACT,GAAG,SAAS,MAAM,MAAM,SAAS;AACnC;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _setPrototypeOf from "./setPrototypeOf.js";
|
|
2
|
-
function _inheritsLoose(t, o) {
|
|
3
|
-
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
_inheritsLoose as default
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=inheritsLoose.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inheritsLoose.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js"],"sourcesContent":["import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };"],"names":["setPrototypeOf"],"mappings":";AACA,SAAS,eAAe,GAAG,GAAG;AAC5B,IAAE,YAAY,OAAO,OAAO,EAAE,SAAS,GAAG,EAAE,UAAU,cAAc,GAAGA,gBAAe,GAAG,CAAC;AAC5F;","x_google_ignoreList":[0]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
2
|
-
if (null == r) return {};
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
5
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
6
|
-
t[n] = r[n];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
_objectWithoutPropertiesLoose as default
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=objectWithoutPropertiesLoose.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"objectWithoutPropertiesLoose.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"sourcesContent":["function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };"],"names":[],"mappings":"AAAA,SAAS,8BAA8B,GAAG,GAAG;AAC3C,MAAI,QAAQ,EAAG,QAAO,CAAA;AACtB,MAAI,IAAI,CAAA;AACR,WAAS,KAAK,EAAG,KAAI,CAAA,EAAG,eAAe,KAAK,GAAG,CAAC,GAAG;AACjD,QAAI,OAAO,EAAE,QAAQ,CAAC,EAAG;AACzB,MAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACZ;AACA,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
function _setPrototypeOf(t, e) {
|
|
2
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
|
3
|
-
return t2.__proto__ = e2, t2;
|
|
4
|
-
}, _setPrototypeOf(t, e);
|
|
5
|
-
}
|
|
6
|
-
export {
|
|
7
|
-
_setPrototypeOf as default
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=setPrototypeOf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setPrototypeOf.js","sources":["../../../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js"],"sourcesContent":["function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };"],"names":["t","e"],"mappings":"AAAA,SAAS,gBAAgB,GAAG,GAAG;AAC7B,SAAO,kBAAkB,OAAO,iBAAiB,OAAO,eAAe,KAAI,IAAK,SAAUA,IAAGC,IAAG;AAC9F,WAAOD,GAAE,YAAYC,IAAGD;AAAA,EAC1B,GAAG,gBAAgB,GAAG,CAAC;AACzB;","x_google_ignoreList":[0]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import hasClass from "./hasClass.js";
|
|
2
|
-
function addClass(element, className) {
|
|
3
|
-
if (element.classList) element.classList.add(className);
|
|
4
|
-
else if (!hasClass(element, className)) if (typeof element.className === "string") element.className = element.className + " " + className;
|
|
5
|
-
else element.setAttribute("class", (element.className && element.className.baseVal || "") + " " + className);
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
addClass as default
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=addClass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addClass.js","sources":["../../../../node_modules/dom-helpers/esm/addClass.js"],"sourcesContent":["import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}"],"names":[],"mappings":";AAQe,SAAS,SAAS,SAAS,WAAW;AACnD,MAAI,QAAQ,UAAW,SAAQ,UAAU,IAAI,SAAS;AAAA,WAAW,CAAC,SAAS,SAAS,SAAS,EAAG,KAAI,OAAO,QAAQ,cAAc,SAAU,SAAQ,YAAY,QAAQ,YAAY,MAAM;AAAA,MAAe,SAAQ,aAAa,UAAU,QAAQ,aAAa,QAAQ,UAAU,WAAW,MAAM,MAAM,SAAS;AAChT;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
function hasClass(element, className) {
|
|
2
|
-
if (element.classList) return !!className && element.classList.contains(className);
|
|
3
|
-
return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
hasClass as default
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=hasClass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasClass.js","sources":["../../../../node_modules/dom-helpers/esm/hasClass.js"],"sourcesContent":["/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}"],"names":[],"mappings":"AAMe,SAAS,SAAS,SAAS,WAAW;AACnD,MAAI,QAAQ,UAAW,QAAO,CAAC,CAAC,aAAa,QAAQ,UAAU,SAAS,SAAS;AACjF,UAAQ,OAAO,QAAQ,UAAU,WAAW,QAAQ,aAAa,KAAK,QAAQ,MAAM,YAAY,GAAG,MAAM;AAC3G;","x_google_ignoreList":[0]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
function replaceClassName(origClass, classToRemove) {
|
|
2
|
-
return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
3
|
-
}
|
|
4
|
-
function removeClass(element, className) {
|
|
5
|
-
if (element.classList) {
|
|
6
|
-
element.classList.remove(className);
|
|
7
|
-
} else if (typeof element.className === "string") {
|
|
8
|
-
element.className = replaceClassName(element.className, className);
|
|
9
|
-
} else {
|
|
10
|
-
element.setAttribute("class", replaceClassName(element.className && element.className.baseVal || "", className));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
removeClass as default
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=removeClass.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"removeClass.js","sources":["../../../../node_modules/dom-helpers/esm/removeClass.js"],"sourcesContent":["function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}"],"names":[],"mappings":"AAAA,SAAS,iBAAiB,WAAW,eAAe;AAClD,SAAO,UAAU,QAAQ,IAAI,OAAO,YAAY,gBAAgB,aAAa,GAAG,GAAG,IAAI,EAAE,QAAQ,QAAQ,GAAG,EAAE,QAAQ,cAAc,EAAE;AACxI;AASe,SAAS,YAAY,SAAS,WAAW;AACtD,MAAI,QAAQ,WAAW;AACrB,YAAQ,UAAU,OAAO,SAAS;AAAA,EACpC,WAAW,OAAO,QAAQ,cAAc,UAAU;AAChD,YAAQ,YAAY,iBAAiB,QAAQ,WAAW,SAAS;AAAA,EACnE,OAAO;AACL,YAAQ,aAAa,SAAS,iBAAiB,QAAQ,aAAa,QAAQ,UAAU,WAAW,IAAI,SAAS,CAAC;AAAA,EACjH;AACF;","x_google_ignoreList":[0]}
|