@dktunited-techoff/techoff-suite-ui 1.14.5 → 1.14.7
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/esm/components/TsInput/TsInput/TsInput.js +1 -1
- package/esm/components/TsInput/TsInput/TsInput.js.map +1 -1
- package/esm/components/TsInput/TsInput/TsInput.tsx +7 -1
- package/esm/components/TsSwitcher/TsSwitcher.css +4 -0
- package/esm/components/TsSwitcher/TsSwitcher.d.ts +1 -1
- package/esm/components/TsSwitcher/TsSwitcher.js +6 -2
- package/esm/components/TsSwitcher/TsSwitcher.js.map +1 -1
- package/esm/components/TsSwitcher/TsSwitcher.types.d.ts +1 -0
- package/lib/components/TsInput/TsInput/TsInput.js +1 -1
- package/lib/components/TsInput/TsInput/TsInput.js.map +1 -1
- package/lib/components/TsInput/TsInput/TsInput.tsx +7 -1
- package/lib/components/TsSwitcher/TsSwitcher.css +4 -0
- package/lib/components/TsSwitcher/TsSwitcher.d.ts +1 -1
- package/lib/components/TsSwitcher/TsSwitcher.js +6 -2
- package/lib/components/TsSwitcher/TsSwitcher.js.map +1 -1
- package/lib/components/TsSwitcher/TsSwitcher.types.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/TsInput/TsInput/TsInput.tsx +7 -1
- package/src/components/TsSwitcher/TsSwitcher.css +4 -0
- package/src/components/TsSwitcher/TsSwitcher.tsx +7 -3
- package/src/components/TsSwitcher/TsSwitcher.types.ts +1 -1
|
@@ -7,7 +7,7 @@ export const TsInput = ({ byDefault, error, icon, label, value, warning, onChang
|
|
|
7
7
|
return (React.createElement("div", { className: `ts-input ${byDefault ? 'ts-input--padding-2' : icon ? 'ts-input--padding-1' : 'ts-input--padding-0'}` },
|
|
8
8
|
label && React.createElement("div", { className: "ts-input-label" }, label),
|
|
9
9
|
React.createElement("div", { className: `ts-input-container ${error || warning ? `ts-input-container--${error ? 'error' : 'warning'}` : ''}` },
|
|
10
|
-
React.createElement("input", { type: "text", value: value, onChange: e => onChange(e.target.value), ...props }),
|
|
10
|
+
React.createElement("input", { type: "text", value: value, onChange: e => onChange(e.target.value), onWheel: (e) => e.target.blur(), ...props }),
|
|
11
11
|
byDefault && React.createElement("div", { className: "ts-input-tag" },
|
|
12
12
|
byDefault,
|
|
13
13
|
" by default"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsInput.js","sourceRoot":"","sources":["../../../../src/components/TsInput/TsInput/TsInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,eAAe,CAAC;AAEvB,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC7G,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BACE,SAAS,EAAE,YAAY,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,EAAE;QAEhH,KAAK,IAAI,6BAAK,SAAS,EAAC,gBAAgB,IAAE,KAAK,CAAO;QACvD,6BACE,SAAS,EAAE,sBAAsB,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,uBAAuB,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;YAE/G,+
|
|
1
|
+
{"version":3,"file":"TsInput.js","sourceRoot":"","sources":["../../../../src/components/TsInput/TsInput/TsInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,eAAe,CAAC;AAE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AI,EAAC,cAAc,EAAC,IAAI,EAAC,IAAI,GAAG,CACpC;YACN,6BAAK,SAAS,EAAC,uBAAuB,IAAE,KAAK,IAAI,OAAO,CAAO,CAC3D,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -14,7 +14,13 @@ export const TsInput = ({ byDefault, error, icon, label, value, warning, onChang
|
|
|
14
14
|
<div
|
|
15
15
|
className={`ts-input-container ${error || warning ? `ts-input-container--${error ? 'error' : 'warning'}` : ''}`}
|
|
16
16
|
>
|
|
17
|
-
<input
|
|
17
|
+
<input
|
|
18
|
+
type="text"
|
|
19
|
+
value={value}
|
|
20
|
+
onChange={e => onChange(e.target.value)}
|
|
21
|
+
onWheel={(e) => (e.target as HTMLInputElement).blur()}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
18
24
|
{byDefault && <div className="ts-input-tag">{byDefault} by default</div>}
|
|
19
25
|
{icon && (
|
|
20
26
|
<div className="ts-input-icon">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TsSwitcherProps } from './TsSwitcher.types';
|
|
3
3
|
import './TsSwitcher.css';
|
|
4
|
-
export declare const TsSwitcher: ({ defaultSwitch, switchs, onChange }: TsSwitcherProps) => React.JSX.Element;
|
|
4
|
+
export declare const TsSwitcher: ({ disabled, defaultSwitch, switchs, onChange }: TsSwitcherProps) => React.JSX.Element;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { TsIcon } from '../TsIcon/TsIcon';
|
|
4
4
|
import './TsSwitcher.css';
|
|
5
|
-
export const TsSwitcher = ({ defaultSwitch, switchs, onChange }) => {
|
|
5
|
+
export const TsSwitcher = ({ disabled, defaultSwitch, switchs, onChange }) => {
|
|
6
6
|
const [selectedSwitch, setSelectedSwitch] = useState();
|
|
7
7
|
// ########
|
|
8
8
|
// Handlers
|
|
@@ -15,7 +15,11 @@ export const TsSwitcher = ({ defaultSwitch, switchs, onChange }) => {
|
|
|
15
15
|
useEffect(() => setSelectedSwitch(defaultSwitch ?? ''), [defaultSwitch]);
|
|
16
16
|
// #########
|
|
17
17
|
// Rendering
|
|
18
|
-
return (React.createElement("div", { className: "ts-content-switcher" }, switchs.map(s => (React.createElement("div", { key: s.value, className: `
|
|
18
|
+
return (React.createElement("div", { className: "ts-content-switcher" }, switchs.map(s => (React.createElement("div", { key: s.value, className: `
|
|
19
|
+
ts-switcher
|
|
20
|
+
${selectedSwitch === s.value ? 'ts-switcher--selected' : ''}
|
|
21
|
+
${disabled ? 'ts-switcher-disabled' : ''}
|
|
22
|
+
`, onClick: () => !disabled && handleChange(s.value) },
|
|
19
23
|
s.icon && (React.createElement("div", { className: "ts-switcher-icon" },
|
|
20
24
|
React.createElement(TsIcon, { name: s.icon }))),
|
|
21
25
|
React.createElement("div", { className: "ts-switcher-label" }, s.label))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsSwitcher.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAmB,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"TsSwitcher.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CA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 byDefault, error, icon, label, value, warning, onChange, ...p
|
|
|
10
10
|
return (React.createElement("div", { className: `ts-input ${byDefault ? 'ts-input--padding-2' : icon ? 'ts-input--padding-1' : 'ts-input--padding-0'}` },
|
|
11
11
|
label && React.createElement("div", { className: "ts-input-label" }, label),
|
|
12
12
|
React.createElement("div", { className: `ts-input-container ${error || warning ? `ts-input-container--${error ? 'error' : 'warning'}` : ''}` },
|
|
13
|
-
React.createElement("input", { type: "text", value: value, onChange: e => onChange(e.target.value), ...props }),
|
|
13
|
+
React.createElement("input", { type: "text", value: value, onChange: e => onChange(e.target.value), onWheel: (e) => e.target.blur(), ...props }),
|
|
14
14
|
byDefault && React.createElement("div", { className: "ts-input-tag" },
|
|
15
15
|
byDefault,
|
|
16
16
|
" by default"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsInput.js","sourceRoot":"","sources":["../../../../src/components/TsInput/TsInput/TsInput.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,gDAA6C;AAE7C,yBAAuB;AAEhB,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IAC7G,YAAY;IACZ,YAAY;IACZ,OAAO,CACL,6BACE,SAAS,EAAE,YAAY,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,EAAE;QAEhH,KAAK,IAAI,6BAAK,SAAS,EAAC,gBAAgB,IAAE,KAAK,CAAO;QACvD,6BACE,SAAS,EAAE,sBAAsB,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,uBAAuB,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;YAE/G,+
|
|
1
|
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AAO,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1E,6BAAK,SAAS,EAAC,sBAAsB;gBACnC,oBAAC,eAAM,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,IAAI,GAAG,CACpC;YACN,6BAAK,SAAS,EAAC,uBAAuB,IAAE,KAAK,IAAI,OAAO,CAAO,CAC3D,CACP,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AApCW,QAAA,OAAO,WAoClB"}
|
|
@@ -14,7 +14,13 @@ export const TsInput = ({ byDefault, error, icon, label, value, warning, onChang
|
|
|
14
14
|
<div
|
|
15
15
|
className={`ts-input-container ${error || warning ? `ts-input-container--${error ? 'error' : 'warning'}` : ''}`}
|
|
16
16
|
>
|
|
17
|
-
<input
|
|
17
|
+
<input
|
|
18
|
+
type="text"
|
|
19
|
+
value={value}
|
|
20
|
+
onChange={e => onChange(e.target.value)}
|
|
21
|
+
onWheel={(e) => (e.target as HTMLInputElement).blur()}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
18
24
|
{byDefault && <div className="ts-input-tag">{byDefault} by default</div>}
|
|
19
25
|
{icon && (
|
|
20
26
|
<div className="ts-input-icon">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { TsSwitcherProps } from './TsSwitcher.types';
|
|
3
3
|
import './TsSwitcher.css';
|
|
4
|
-
export declare const TsSwitcher: ({ defaultSwitch, switchs, onChange }: TsSwitcherProps) => React.JSX.Element;
|
|
4
|
+
export declare const TsSwitcher: ({ disabled, defaultSwitch, switchs, onChange }: TsSwitcherProps) => React.JSX.Element;
|
|
@@ -5,7 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const TsIcon_1 = require("../TsIcon/TsIcon");
|
|
7
7
|
require("./TsSwitcher.css");
|
|
8
|
-
const TsSwitcher = ({ defaultSwitch, switchs, onChange }) => {
|
|
8
|
+
const TsSwitcher = ({ disabled, defaultSwitch, switchs, onChange }) => {
|
|
9
9
|
const [selectedSwitch, setSelectedSwitch] = (0, react_1.useState)();
|
|
10
10
|
// ########
|
|
11
11
|
// Handlers
|
|
@@ -18,7 +18,11 @@ const TsSwitcher = ({ defaultSwitch, switchs, onChange }) => {
|
|
|
18
18
|
(0, react_1.useEffect)(() => setSelectedSwitch(defaultSwitch ?? ''), [defaultSwitch]);
|
|
19
19
|
// #########
|
|
20
20
|
// Rendering
|
|
21
|
-
return (React.createElement("div", { className: "ts-content-switcher" }, switchs.map(s => (React.createElement("div", { key: s.value, className: `
|
|
21
|
+
return (React.createElement("div", { className: "ts-content-switcher" }, switchs.map(s => (React.createElement("div", { key: s.value, className: `
|
|
22
|
+
ts-switcher
|
|
23
|
+
${selectedSwitch === s.value ? 'ts-switcher--selected' : ''}
|
|
24
|
+
${disabled ? 'ts-switcher-disabled' : ''}
|
|
25
|
+
`, onClick: () => !disabled && handleChange(s.value) },
|
|
22
26
|
s.icon && (React.createElement("div", { className: "ts-switcher-icon" },
|
|
23
27
|
React.createElement(TsIcon_1.TsIcon, { name: s.icon }))),
|
|
24
28
|
React.createElement("div", { className: "ts-switcher-label" }, s.label))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TsSwitcher.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAA4C;AAC5C,6CAA0C;AAE1C,4BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAmB,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"TsSwitcher.js","sourceRoot":"","sources":["../../../src/components/TsSwitcher/TsSwitcher.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iCAA4C;AAC5C,6CAA0C;AAE1C,4BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,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14
|
<div
|
|
15
15
|
className={`ts-input-container ${error || warning ? `ts-input-container--${error ? 'error' : 'warning'}` : ''}`}
|
|
16
16
|
>
|
|
17
|
-
<input
|
|
17
|
+
<input
|
|
18
|
+
type="text"
|
|
19
|
+
value={value}
|
|
20
|
+
onChange={e => onChange(e.target.value)}
|
|
21
|
+
onWheel={(e) => (e.target as HTMLInputElement).blur()}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
18
24
|
{byDefault && <div className="ts-input-tag">{byDefault} by default</div>}
|
|
19
25
|
{icon && (
|
|
20
26
|
<div className="ts-input-icon">
|
|
@@ -4,7 +4,7 @@ import { TsIcon } from '../TsIcon/TsIcon';
|
|
|
4
4
|
import { TsSwitcherProps } from './TsSwitcher.types';
|
|
5
5
|
import './TsSwitcher.css';
|
|
6
6
|
|
|
7
|
-
export const TsSwitcher = ({ defaultSwitch, switchs, onChange }: TsSwitcherProps) => {
|
|
7
|
+
export const TsSwitcher = ({ disabled, defaultSwitch, switchs, onChange }: TsSwitcherProps) => {
|
|
8
8
|
const [selectedSwitch, setSelectedSwitch] = useState<string>();
|
|
9
9
|
|
|
10
10
|
// ########
|
|
@@ -25,8 +25,12 @@ export const TsSwitcher = ({ defaultSwitch, switchs, onChange }: TsSwitcherProps
|
|
|
25
25
|
{switchs.map(s => (
|
|
26
26
|
<div
|
|
27
27
|
key={s.value}
|
|
28
|
-
className={`
|
|
29
|
-
|
|
28
|
+
className={`
|
|
29
|
+
ts-switcher
|
|
30
|
+
${selectedSwitch === s.value ? 'ts-switcher--selected' : ''}
|
|
31
|
+
${disabled ? 'ts-switcher-disabled' : ''}
|
|
32
|
+
`}
|
|
33
|
+
onClick={() => !disabled && handleChange(s.value)}
|
|
30
34
|
>
|
|
31
35
|
{s.icon && (
|
|
32
36
|
<div className="ts-switcher-icon">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type TsSwitchProps = { icon?: string; label: string; value: string };
|
|
2
|
-
export type TsSwitcherProps = { defaultSwitch?: string; switchs: TsSwitchProps[]; onChange: (val: string) => void };
|
|
2
|
+
export type TsSwitcherProps = { disabled?: boolean; defaultSwitch?: string; switchs: TsSwitchProps[]; onChange: (val: string) => void };
|