jy-headless 0.0.24 → 0.0.25
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/components/icons/DownArrowIcon.d.ts +4 -0
- package/dist/components/icons/UpArrowIcon.d.ts +4 -0
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/input/NumberInput.d.ts +11 -0
- package/dist/components/modal/Modal.d.ts +1 -1
- package/dist/components/tabs/Tab.d.ts +11 -0
- package/dist/index.esm.js +14 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
|
|
2
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
showLimit: boolean;
|
|
4
4
|
containerStyle?: CSSProperties;
|
|
5
5
|
containerClassName?: string;
|
|
6
6
|
prefixElement?: ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { InputProps } from './Input';
|
|
3
|
+
interface NumberInputProps extends InputProps {
|
|
4
|
+
increaseElement?: ReactNode;
|
|
5
|
+
decreaseElement?: ReactNode;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const NumberInput: React.FC<NumberInputProps>;
|
|
11
|
+
export default NumberInput;
|
package/dist/index.esm.js
CHANGED
|
@@ -54,7 +54,7 @@ const Spinner = ({ color = 'black', size = '1em', spinTime = '2s' }) => {
|
|
|
54
54
|
React.createElement("title", null, "ic_fluent_spinner_ios_20_filled"),
|
|
55
55
|
React.createElement("desc", null, "Created with Sketch."),
|
|
56
56
|
React.createElement("g", { id: "\uD83D\uDD0D-System-Icons", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" },
|
|
57
|
-
React.createElement("g", { id: "ic_fluent_spinner_ios_20_filled", fill:
|
|
57
|
+
React.createElement("g", { id: "ic_fluent_spinner_ios_20_filled", fill: color, fillRule: "nonzero" },
|
|
58
58
|
React.createElement("path", { d: "M10,3.5 C6.41015,3.5 3.5,6.41015 3.5,10 C3.5,10.4142 3.16421,10.75 2.75,10.75 C2.33579,10.75 2,10.4142 2,10 C2,5.58172 5.58172,2 10,2 C14.4183,2 18,5.58172 18,10 C18,14.4183 14.4183,18 10,18 C9.58579,18 9.25,17.6642 9.25,17.25 C9.25,16.8358 9.58579,16.5 10,16.5 C13.5899,16.5 16.5,13.5899 16.5,10 C16.5,6.41015 13.5899,3.5 10,3.5 Z", id: "\uD83C\uDFA8-Color" })))))));
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -67,13 +67,22 @@ const Button = (_a) => {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const Input = (_a) => {
|
|
70
|
-
var
|
|
70
|
+
var _b;
|
|
71
|
+
var { prefixElement, suffixElement, className, style, containerStyle, containerClassName, showError = false, error, maxLength, showLimit = false } = _a, restProps = __rest(_a, ["prefixElement", "suffixElement", "className", "style", "containerStyle", "containerClassName", "showError", "error", "maxLength", "showLimit"]);
|
|
72
|
+
const [inputValue, setInputValue] = useState(restProps.value);
|
|
73
|
+
const onChange = (e) => {
|
|
74
|
+
setInputValue(e.target.value);
|
|
75
|
+
restProps.onChange(e);
|
|
76
|
+
};
|
|
71
77
|
return (React.createElement("span", { className: containerClassName, style: Object.assign({ position: 'relative', display: 'inline-flex', alignItems: 'center' }, containerStyle) },
|
|
72
78
|
prefixElement,
|
|
73
|
-
React.createElement("input", Object.assign({}, restProps, { className: className, style: Object.assign({ all: 'unset' }, style) })),
|
|
79
|
+
React.createElement("input", Object.assign({}, restProps, { value: inputValue, onChange: onChange, maxLength: maxLength, className: className, style: Object.assign({ all: 'unset' }, style) })),
|
|
80
|
+
showLimit && maxLength && (React.createElement("span", { className: 'max-length' }, (_b = (inputValue !== null && inputValue !== undefined ? inputValue : '').toString().length) !== null && _b !== undefined ? _b : 0,
|
|
81
|
+
"/",
|
|
82
|
+
maxLength)),
|
|
74
83
|
suffixElement,
|
|
75
84
|
showError &&
|
|
76
|
-
(typeof error === 'string' ? (React.createElement("span", { style: { position: 'absolute', top: '100%', left: 0 } }, error)) : (error))));
|
|
85
|
+
(typeof error === 'string' ? (React.createElement("span", { className: 'error-message', style: { position: 'absolute', top: '100%', left: 0 } }, error)) : (error))));
|
|
77
86
|
};
|
|
78
87
|
|
|
79
88
|
const functionRow = [
|
|
@@ -381,7 +390,7 @@ const ModalContext = createContext({
|
|
|
381
390
|
setIsShow: (value) => { },
|
|
382
391
|
});
|
|
383
392
|
|
|
384
|
-
const Modal = ({ opener, children, targetSelector = 'root', }) => {
|
|
393
|
+
const Modal = ({ opener, children, targetSelector = '#root', }) => {
|
|
385
394
|
const [isShow, setIsShow] = useState(false);
|
|
386
395
|
const onHandleShow = () => {
|
|
387
396
|
setIsShow(true);
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ const Spinner = ({ color = 'black', size = '1em', spinTime = '2s' }) => {
|
|
|
56
56
|
React.createElement("title", null, "ic_fluent_spinner_ios_20_filled"),
|
|
57
57
|
React.createElement("desc", null, "Created with Sketch."),
|
|
58
58
|
React.createElement("g", { id: "\uD83D\uDD0D-System-Icons", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd" },
|
|
59
|
-
React.createElement("g", { id: "ic_fluent_spinner_ios_20_filled", fill:
|
|
59
|
+
React.createElement("g", { id: "ic_fluent_spinner_ios_20_filled", fill: color, fillRule: "nonzero" },
|
|
60
60
|
React.createElement("path", { d: "M10,3.5 C6.41015,3.5 3.5,6.41015 3.5,10 C3.5,10.4142 3.16421,10.75 2.75,10.75 C2.33579,10.75 2,10.4142 2,10 C2,5.58172 5.58172,2 10,2 C14.4183,2 18,5.58172 18,10 C18,14.4183 14.4183,18 10,18 C9.58579,18 9.25,17.6642 9.25,17.25 C9.25,16.8358 9.58579,16.5 10,16.5 C13.5899,16.5 16.5,13.5899 16.5,10 C16.5,6.41015 13.5899,3.5 10,3.5 Z", id: "\uD83C\uDFA8-Color" })))))));
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -69,13 +69,22 @@ const Button = (_a) => {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
const Input = (_a) => {
|
|
72
|
-
var
|
|
72
|
+
var _b;
|
|
73
|
+
var { prefixElement, suffixElement, className, style, containerStyle, containerClassName, showError = false, error, maxLength, showLimit = false } = _a, restProps = __rest(_a, ["prefixElement", "suffixElement", "className", "style", "containerStyle", "containerClassName", "showError", "error", "maxLength", "showLimit"]);
|
|
74
|
+
const [inputValue, setInputValue] = React.useState(restProps.value);
|
|
75
|
+
const onChange = (e) => {
|
|
76
|
+
setInputValue(e.target.value);
|
|
77
|
+
restProps.onChange(e);
|
|
78
|
+
};
|
|
73
79
|
return (React.createElement("span", { className: containerClassName, style: Object.assign({ position: 'relative', display: 'inline-flex', alignItems: 'center' }, containerStyle) },
|
|
74
80
|
prefixElement,
|
|
75
|
-
React.createElement("input", Object.assign({}, restProps, { className: className, style: Object.assign({ all: 'unset' }, style) })),
|
|
81
|
+
React.createElement("input", Object.assign({}, restProps, { value: inputValue, onChange: onChange, maxLength: maxLength, className: className, style: Object.assign({ all: 'unset' }, style) })),
|
|
82
|
+
showLimit && maxLength && (React.createElement("span", { className: 'max-length' }, (_b = (inputValue !== null && inputValue !== undefined ? inputValue : '').toString().length) !== null && _b !== undefined ? _b : 0,
|
|
83
|
+
"/",
|
|
84
|
+
maxLength)),
|
|
76
85
|
suffixElement,
|
|
77
86
|
showError &&
|
|
78
|
-
(typeof error === 'string' ? (React.createElement("span", { style: { position: 'absolute', top: '100%', left: 0 } }, error)) : (error))));
|
|
87
|
+
(typeof error === 'string' ? (React.createElement("span", { className: 'error-message', style: { position: 'absolute', top: '100%', left: 0 } }, error)) : (error))));
|
|
79
88
|
};
|
|
80
89
|
|
|
81
90
|
const functionRow = [
|
|
@@ -383,7 +392,7 @@ const ModalContext = React.createContext({
|
|
|
383
392
|
setIsShow: (value) => { },
|
|
384
393
|
});
|
|
385
394
|
|
|
386
|
-
const Modal = ({ opener, children, targetSelector = 'root', }) => {
|
|
395
|
+
const Modal = ({ opener, children, targetSelector = '#root', }) => {
|
|
387
396
|
const [isShow, setIsShow] = React.useState(false);
|
|
388
397
|
const onHandleShow = () => {
|
|
389
398
|
setIsShow(true);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|