@phillips/seldon 1.7.0 → 1.7.1
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/_commonjsHelpers.js +3 -5
- package/dist/index.d.ts +0 -1
- package/dist/index.js +12 -14
- package/dist/utils/index.js +8 -10
- package/package.json +1 -1
- package/dist/_virtual/index2.js +0 -4
- package/dist/components/DatePicker/DatePicker.d.ts +0 -90
- package/dist/components/DatePicker/DatePicker.js +0 -92
- package/dist/node_modules/flatpickr/dist/esm/index.js +0 -947
- package/dist/node_modules/flatpickr/dist/esm/l10n/default.js +0 -75
- package/dist/node_modules/flatpickr/dist/esm/types/options.js +0 -80
- package/dist/node_modules/flatpickr/dist/esm/utils/dates.js +0 -90
- package/dist/node_modules/flatpickr/dist/esm/utils/dom.js +0 -45
- package/dist/node_modules/flatpickr/dist/esm/utils/formatting.js +0 -170
- package/dist/node_modules/flatpickr/dist/esm/utils/index.js +0 -23
- package/dist/node_modules/flatpickr/dist/esm/utils/polyfills.js +0 -15
- package/dist/node_modules/flatpickr/dist/l10n/index.js +0 -3471
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1
|
+
function e(t) {
|
|
2
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
4
3
|
}
|
|
5
4
|
export {
|
|
6
|
-
|
|
7
|
-
l as getDefaultExportFromCjs
|
|
5
|
+
e as getDefaultExportFromCjs
|
|
8
6
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as Button } from './components/Button/Button';
|
|
2
2
|
export { default as ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary';
|
|
3
|
-
export { default as DatePicker } from './components/DatePicker/DatePicker';
|
|
4
3
|
export { default as Header } from './components/Header/Header';
|
|
5
4
|
export { default as HeroBanner } from './components/HeroBanner/HeroBanner';
|
|
6
5
|
export { default as Input } from './components/Input/Input';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { default as a } from "./components/Button/Button.js";
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as u } from "./components/
|
|
4
|
-
import { default as l } from "./components/
|
|
5
|
-
import { default as m } from "./components/
|
|
6
|
-
import { default as x } from "./components/
|
|
7
|
-
import { default as B } from "./
|
|
8
|
-
import { default as H } from "./pages/Page.js";
|
|
2
|
+
import { default as t } from "./components/ErrorBoundary/ErrorBoundary.js";
|
|
3
|
+
import { default as u } from "./components/Header/Header.js";
|
|
4
|
+
import { default as l } from "./components/HeroBanner/HeroBanner.js";
|
|
5
|
+
import { default as m } from "./components/Input/Input.js";
|
|
6
|
+
import { default as x } from "./components/Select/Select.js";
|
|
7
|
+
import { default as B } from "./pages/Page.js";
|
|
9
8
|
export {
|
|
10
9
|
a as Button,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
l as
|
|
14
|
-
m as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
B as Select
|
|
10
|
+
t as ErrorBoundary,
|
|
11
|
+
u as Header,
|
|
12
|
+
l as HeroBanner,
|
|
13
|
+
m as Input,
|
|
14
|
+
B as Page,
|
|
15
|
+
x as Select
|
|
18
16
|
};
|
package/dist/utils/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
function u({
|
|
2
|
+
const n = "phillips";
|
|
3
|
+
function c({
|
|
5
4
|
disabled: l = !1,
|
|
6
5
|
id: r,
|
|
7
6
|
invalid: d = !1,
|
|
8
7
|
invalidText: t = "invalid",
|
|
9
8
|
readOnly: o = !1,
|
|
10
|
-
type:
|
|
9
|
+
type: a,
|
|
11
10
|
warn: v = !1,
|
|
12
11
|
warnText: e
|
|
13
12
|
}) {
|
|
@@ -15,7 +14,7 @@ function u({
|
|
|
15
14
|
disabled: !o && l,
|
|
16
15
|
invalid: !o && !l && d,
|
|
17
16
|
invalidId: `${r}-error-msg`,
|
|
18
|
-
type:
|
|
17
|
+
type: a === "toggle" ? "checkbox" : a,
|
|
19
18
|
warn: !o && !l && !d && v,
|
|
20
19
|
warnId: `${r}-warn-msg`,
|
|
21
20
|
validation: null
|
|
@@ -23,21 +22,20 @@ function u({
|
|
|
23
22
|
return i.invalid && (i.validation = /* @__PURE__ */ s(
|
|
24
23
|
"div",
|
|
25
24
|
{
|
|
26
|
-
className: `${
|
|
25
|
+
className: `${n}-input__validation ${n}-${a}-input--invalid`,
|
|
27
26
|
id: i.invalidId,
|
|
28
27
|
children: t
|
|
29
28
|
}
|
|
30
29
|
)), i.warn && (i.validation = /* @__PURE__ */ s(
|
|
31
30
|
"div",
|
|
32
31
|
{
|
|
33
|
-
className: `${
|
|
32
|
+
className: `${n}-input__validation ${n}-${a}-input--warn`,
|
|
34
33
|
id: i.warnId,
|
|
35
34
|
children: e
|
|
36
35
|
}
|
|
37
36
|
)), i;
|
|
38
37
|
}
|
|
39
38
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
u as useNormalizedInputProps
|
|
39
|
+
n as px,
|
|
40
|
+
c as useNormalizedInputProps
|
|
43
41
|
};
|
package/package.json
CHANGED
package/dist/_virtual/index2.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import flatpickr from 'flatpickr';
|
|
3
|
-
import { InputProps } from '../Input/Input';
|
|
4
|
-
export interface DatePickerProps extends Omit<InputProps, 'defaultValue'>, Record<string, unknown> {
|
|
5
|
-
/**
|
|
6
|
-
* Optionally allow manual entry to the date input
|
|
7
|
-
*/
|
|
8
|
-
allowInput?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Optionally provide the default value of the `<input>`. Should not be passed into controlled input!
|
|
11
|
-
*/
|
|
12
|
-
defaultValue?: (Date | string)[];
|
|
13
|
-
/**
|
|
14
|
-
* Booolean to specify whether the `<input>` should be disabled
|
|
15
|
-
*/
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Render time picker on dropdown
|
|
19
|
-
*/
|
|
20
|
-
enableTime?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Boolean to specify whether you want the underlying label to be visually hidden
|
|
23
|
-
*/
|
|
24
|
-
hideLabel?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* A custom `id` for the `<input>`
|
|
27
|
-
*/
|
|
28
|
-
id: string;
|
|
29
|
-
/**
|
|
30
|
-
* Boolean to dictate whether input is inline with the label or not. `true` to use the inline version.
|
|
31
|
-
*/
|
|
32
|
-
inline?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Boolean to specify whether the control is currently invalid
|
|
35
|
-
*/
|
|
36
|
-
invalid?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Validation text that is displayed when the control is in an invalid state
|
|
39
|
-
*/
|
|
40
|
-
invalidText?: React.ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
* Text that will be read by a screen reader when visiting this control
|
|
43
|
-
*/
|
|
44
|
-
labelText: string;
|
|
45
|
-
/**
|
|
46
|
-
* Locatiion you want the calendar to render for
|
|
47
|
-
*/
|
|
48
|
-
locale: string;
|
|
49
|
-
/**
|
|
50
|
-
* Optional `onChange` handler that is called whenever flatpickr is updated
|
|
51
|
-
* @param {array} selectedDates
|
|
52
|
-
* @param {string} dateStr
|
|
53
|
-
* @param {object} instance
|
|
54
|
-
*/
|
|
55
|
-
onChange?: flatpickr.Options.Hook;
|
|
56
|
-
/**
|
|
57
|
-
* Optional `onClick` handler that is called whenever the `<input>` is clicked
|
|
58
|
-
*/
|
|
59
|
-
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
60
|
-
/**
|
|
61
|
-
* Optional text to be used for the placeholder attribute of the `<input>`
|
|
62
|
-
*/
|
|
63
|
-
placeholder?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Boolean to deterimine whether the input should be read-only
|
|
66
|
-
*/
|
|
67
|
-
readOnly?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Enum to determine the height of the Text Input. Currently supports the following:
|
|
70
|
-
*/
|
|
71
|
-
size?: 'sm' | 'md' | 'lg';
|
|
72
|
-
/**
|
|
73
|
-
* Enum to determine whether component is a range or range and time
|
|
74
|
-
*/
|
|
75
|
-
type?: 'single' | 'range';
|
|
76
|
-
/**
|
|
77
|
-
* Specify the value of the `<input>` for controlled inputs
|
|
78
|
-
*/
|
|
79
|
-
value?: string | number | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Boolean to specify whether the control is currently in warning state
|
|
82
|
-
*/
|
|
83
|
-
warn?: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Text that is displayed when the control is in warning state
|
|
86
|
-
*/
|
|
87
|
-
warnText?: React.ReactNode;
|
|
88
|
-
}
|
|
89
|
-
declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
90
|
-
export default DatePicker;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { jsx as G } from "react/jsx-runtime";
|
|
2
|
-
import * as d from "react";
|
|
3
|
-
import O from "../../node_modules/flatpickr/dist/esm/index.js";
|
|
4
|
-
import k from "../../node_modules/flatpickr/dist/l10n/index.js";
|
|
5
|
-
import { noOP as R, useNormalizedInputProps as J } from "../../utils/index.js";
|
|
6
|
-
import Q from "../Input/Input.js";
|
|
7
|
-
k.en.weekdays.shorthand.forEach((u, o) => {
|
|
8
|
-
const c = k.en.weekdays.shorthand;
|
|
9
|
-
c[o] === "Thu" || c[o] === "Th" ? c[o] = "Th" : c[o] = c[o].charAt(0);
|
|
10
|
-
});
|
|
11
|
-
const W = d.forwardRef(({
|
|
12
|
-
allowInput: u = !1,
|
|
13
|
-
className: o,
|
|
14
|
-
defaultValue: c = [],
|
|
15
|
-
disabled: S,
|
|
16
|
-
enableTime: p = !1,
|
|
17
|
-
hideLabel: z,
|
|
18
|
-
id: a,
|
|
19
|
-
inline: A,
|
|
20
|
-
invalid: y,
|
|
21
|
-
invalidText: g,
|
|
22
|
-
labelText: H,
|
|
23
|
-
locale: D = "en",
|
|
24
|
-
onChange: f = R,
|
|
25
|
-
onClick: M = R,
|
|
26
|
-
placeholder: U,
|
|
27
|
-
readOnly: P,
|
|
28
|
-
size: _ = "md",
|
|
29
|
-
type: l = "range",
|
|
30
|
-
value: $,
|
|
31
|
-
warn: b,
|
|
32
|
-
warnText: j,
|
|
33
|
-
...q
|
|
34
|
-
}, e) => {
|
|
35
|
-
const m = J({ disabled: S, id: a, invalid: y, invalidText: g, readOnly: P, type: l, warn: b, warnText: j }), t = d.useRef(), s = d.useRef(), r = d.useRef();
|
|
36
|
-
d.useEffect(
|
|
37
|
-
() => {
|
|
38
|
-
const n = {
|
|
39
|
-
allowInput: u,
|
|
40
|
-
clickOpens: !m.disabled,
|
|
41
|
-
defaultDate: c,
|
|
42
|
-
enableTime: p,
|
|
43
|
-
locale: k[D],
|
|
44
|
-
mode: l,
|
|
45
|
-
onChange: f
|
|
46
|
-
};
|
|
47
|
-
return typeof e == "object" && (e != null && e.current) && (t.current = O(e.current, n)), e === null && typeof s == "object" && s != null && s.current && (t.current = O(s == null ? void 0 : s.current, n)), () => {
|
|
48
|
-
t.current && t.current.destroy && t.current.destroy();
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
[u, c, m.disabled, p, a, D, f, e, l]
|
|
52
|
-
);
|
|
53
|
-
const v = (n) => {
|
|
54
|
-
var i;
|
|
55
|
-
u && /[0-9-/:]+/g.test(n.key) && (r.current = (i = t == null ? void 0 : t.current) == null ? void 0 : i.selectedDates);
|
|
56
|
-
}, F = (n) => {
|
|
57
|
-
var i, E, N, T, B, K, L;
|
|
58
|
-
if (!(!u || n.relatedTarget instanceof HTMLElement && ((i = n.relatedTarget) != null && i.classList.value.includes("flatpickr"))) && "current" in r && (E = r == null ? void 0 : r.current) != null && E.length && ((N = r == null ? void 0 : r.current) == null ? void 0 : N.length) > 0 && ((T = r == null ? void 0 : r.current) == null ? void 0 : T.join().toString()) !== ((B = t == null ? void 0 : t.current) == null ? void 0 : B.selectedDates.join().toString())) {
|
|
59
|
-
const h = (K = t.current) == null ? void 0 : K.element;
|
|
60
|
-
r.current = [], f((L = t.current) == null ? void 0 : L.selectedDates, h == null ? void 0 : h.value, t.current);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return /* @__PURE__ */ G(
|
|
64
|
-
Q,
|
|
65
|
-
{
|
|
66
|
-
className: `${o} flatpickr`,
|
|
67
|
-
"data-testid": a,
|
|
68
|
-
disabled: m.disabled,
|
|
69
|
-
hideLabel: z,
|
|
70
|
-
id: a,
|
|
71
|
-
inline: A,
|
|
72
|
-
invalid: y,
|
|
73
|
-
invalidText: g,
|
|
74
|
-
labelText: H,
|
|
75
|
-
onClick: M,
|
|
76
|
-
placeholder: U,
|
|
77
|
-
readOnly: P,
|
|
78
|
-
ref: e || s,
|
|
79
|
-
size: _,
|
|
80
|
-
value: $,
|
|
81
|
-
warn: b,
|
|
82
|
-
warnText: j,
|
|
83
|
-
onKeyUp: v,
|
|
84
|
-
onBlur: F,
|
|
85
|
-
...q
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
W.displayName = "DatePicker";
|
|
90
|
-
export {
|
|
91
|
-
W as default
|
|
92
|
-
};
|