@alxgrn/telefrag-ui 0.0.47 → 0.0.50

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.
@@ -0,0 +1,136 @@
1
+ import o from "./components/icons/AlignBottom.js";
2
+ import r from "./components/icons/AlignCenter.js";
3
+ import m from "./components/icons/AlignJustify.js";
4
+ import i from "./components/icons/AlignLeft.js";
5
+ import t from "./components/icons/AlignMiddle.js";
6
+ import e from "./components/icons/AlignRight.js";
7
+ import f from "./components/icons/AlignTop.js";
8
+ import p from "./components/icons/Asterisk.js";
9
+ import n from "./components/icons/Bold.js";
10
+ import l from "./components/icons/Book.js";
11
+ import a from "./components/icons/Calendar.js";
12
+ import d from "./components/icons/CellsMerge.js";
13
+ import g from "./components/icons/CellsSplit.js";
14
+ import s from "./components/icons/Check.js";
15
+ import h from "./components/icons/ChevronDown.js";
16
+ import C from "./components/icons/ChevronLeft.js";
17
+ import u from "./components/icons/ChevronRight.js";
18
+ import c from "./components/icons/Clock.js";
19
+ import A from "./components/icons/Code.js";
20
+ import k from "./components/icons/CodeXml.js";
21
+ import S from "./components/icons/ColumnInsertAfter.js";
22
+ import H from "./components/icons/ColumnInsertBefore.js";
23
+ import I from "./components/icons/Expand.js";
24
+ import L from "./components/icons/Eye.js";
25
+ import M from "./components/icons/Feather.js";
26
+ import R from "./components/icons/Files.js";
27
+ import T from "./components/icons/Film.js";
28
+ import b from "./components/icons/FlipVertical.js";
29
+ import w from "./components/icons/Forum.js";
30
+ import y from "./components/icons/Gamepad.js";
31
+ import B from "./components/icons/Heading.js";
32
+ import F from "./components/icons/Heading1.js";
33
+ import v from "./components/icons/Heading2.js";
34
+ import x from "./components/icons/Heading3.js";
35
+ import U from "./components/icons/Heading4.js";
36
+ import _ from "./components/icons/Heading5.js";
37
+ import z from "./components/icons/Heading6.js";
38
+ import D from "./components/icons/Image.js";
39
+ import O from "./components/icons/IndentDecrease.js";
40
+ import P from "./components/icons/Italic.js";
41
+ import j from "./components/icons/JoinUp.js";
42
+ import E from "./components/icons/Link.js";
43
+ import J from "./components/icons/List.js";
44
+ import q from "./components/icons/ListOrdered.js";
45
+ import G from "./components/icons/Maximize.js";
46
+ import Q from "./components/icons/Menu.js";
47
+ import V from "./components/icons/Minimize.js";
48
+ import X from "./components/icons/Pilcrow.js";
49
+ import K from "./components/icons/Plus.js";
50
+ import N from "./components/icons/Quote.js";
51
+ import W from "./components/icons/Redo.js";
52
+ import Y from "./components/icons/Rocket.js";
53
+ import Z from "./components/icons/RowInsertAfter.js";
54
+ import $ from "./components/icons/RowInsertBefore.js";
55
+ import oo from "./components/icons/ShowSidebar.js";
56
+ import ro from "./components/icons/Shrink.js";
57
+ import mo from "./components/icons/SquareDashed.js";
58
+ import io from "./components/icons/Strikethrough.js";
59
+ import to from "./components/icons/Table.js";
60
+ import eo from "./components/icons/TelefragLogo.js";
61
+ import fo from "./components/icons/Trash.js";
62
+ import po from "./components/icons/Type.js";
63
+ import no from "./components/icons/Underline.js";
64
+ import lo from "./components/icons/Undo.js";
65
+ import ao from "./components/icons/Users.js";
66
+ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67
+ __proto__: null,
68
+ AlignBottom: o,
69
+ AlignCenter: r,
70
+ AlignJustify: m,
71
+ AlignLeft: i,
72
+ AlignMiddle: t,
73
+ AlignRight: e,
74
+ AlignTop: f,
75
+ Asterisk: p,
76
+ Bold: n,
77
+ Book: l,
78
+ Calendar: a,
79
+ CellsMerge: d,
80
+ CellsSplit: g,
81
+ Check: s,
82
+ ChevronDown: h,
83
+ ChevronLeft: C,
84
+ ChevronRight: u,
85
+ Clock: c,
86
+ Code: A,
87
+ CodeXml: k,
88
+ ColumnInsertAfter: S,
89
+ ColumnInsertBefore: H,
90
+ Expand: I,
91
+ Eye: L,
92
+ Feather: M,
93
+ Files: R,
94
+ Film: T,
95
+ FlipVertical: b,
96
+ Forum: w,
97
+ Gamepad: y,
98
+ Heading: B,
99
+ Heading1: F,
100
+ Heading2: v,
101
+ Heading3: x,
102
+ Heading4: U,
103
+ Heading5: _,
104
+ Heading6: z,
105
+ Image: D,
106
+ IndentDecrease: O,
107
+ Italic: P,
108
+ JoinUp: j,
109
+ Link: E,
110
+ List: J,
111
+ ListOrdered: q,
112
+ Maximize: G,
113
+ Menu: Q,
114
+ Minimize: V,
115
+ Pilcrow: X,
116
+ Plus: K,
117
+ Quote: N,
118
+ Redo: W,
119
+ Rocket: Y,
120
+ RowInsertAfter: Z,
121
+ RowInsertBefore: $,
122
+ ShowSidebar: oo,
123
+ Shrink: ro,
124
+ SquareDashed: mo,
125
+ Strikethrough: io,
126
+ Table: to,
127
+ TelefragLogo: eo,
128
+ Trash: fo,
129
+ Type: po,
130
+ Underline: no,
131
+ Undo: lo,
132
+ Users: ao
133
+ }, Symbol.toStringTag, { value: "Module" }));
134
+ export {
135
+ Lr as i
136
+ };
package/dist/main.d.ts CHANGED
@@ -32,7 +32,6 @@ import { default as Layout } from './components/layout/Layout';
32
32
  import { MainMenuItem } from './components/layout/MainMenu';
33
33
  import { default as Page } from './components/layout/Page';
34
34
  import { default as PageHeader } from './components/layout/PageHeader';
35
- import { MyInfiniteScroll as InfiniteScroll } from './components/ui/infinitescroll/InfiniteScroll';
36
35
  import * as Icons from './components/icons';
37
- export { Form, Date, Time, Files, Image, Input, Label, RadioList, Button, Select, Hidden, Checkbox, CheckboxList, Fieldset, FormRow, FormCol, DatePicker, Menu, Block, Panel, Modal, Overlay, Popup, Portal, Message, Alert, Confirm, Prompt, Sidebar, Editable, Layout, Page, PageHeader, Icons, InfiniteScroll, };
36
+ export { Form, Date, Time, Files, Image, Input, Label, RadioList, Button, Select, Hidden, Checkbox, CheckboxList, Fieldset, FormRow, FormCol, DatePicker, Menu, Block, Panel, Modal, Overlay, Popup, Portal, Message, Alert, Confirm, Prompt, Sidebar, Editable, Layout, Page, PageHeader, Icons, };
38
37
  export type { FormData, MainMenuItem, MenuItem, ModalProps, ButtonType, CheckboxListOption, RadioListOption, RadioListValue, SelectOption, };
package/dist/main.js CHANGED
@@ -2,18 +2,18 @@ import './assets/Page.css';/* empty css */
2
2
  import { Form as t } from "./components/form/form/Form.js";
3
3
  import { default as f } from "./components/form/form/FormRow.js";
4
4
  import { default as p } from "./components/form/form/FormCol.js";
5
- import { default as x } from "./components/form/date/Date.js";
6
- import { default as d } from "./components/form/date/DatePicker.js";
5
+ import { default as l } from "./components/form/date/Date.js";
6
+ import { default as s } from "./components/form/date/DatePicker.js";
7
7
  import { default as i } from "./components/form/time/Time.js";
8
- import { Files as c } from "./components/form/files/Files.js";
8
+ import { Files as P } from "./components/form/files/Files.js";
9
9
  import { Image as b } from "./components/form/image/Image.js";
10
- import { default as I } from "./components/form/input/Input.js";
11
- import { default as k } from "./components/form/label/Label.js";
12
- import { RadioList as L } from "./components/form/radio/RadioList.js";
13
- import { Button as S } from "./components/form/button/Button.js";
14
- import { Select as h } from "./components/form/select/Select.js";
15
- import { default as D } from "./components/form/hidden/Hidden.js";
16
- import { default as R } from "./components/form/checkbox/Checkbox.js";
10
+ import { default as g } from "./components/form/input/Input.js";
11
+ import { default as C } from "./components/form/label/Label.js";
12
+ import { RadioList as I } from "./components/form/radio/RadioList.js";
13
+ import { Button as h } from "./components/form/button/Button.js";
14
+ import { Select as B } from "./components/form/select/Select.js";
15
+ import { default as H } from "./components/form/hidden/Hidden.js";
16
+ import { default as S } from "./components/form/checkbox/Checkbox.js";
17
17
  import { CheckboxList as w } from "./components/form/checkbox/CheckboxList.js";
18
18
  import { default as E } from "./components/form/fieldset/Fieldset.js";
19
19
  import { Menu as T } from "./components/ui/menu/Menu.js";
@@ -29,33 +29,31 @@ import { default as eo } from "./components/ui/confirm/Confirm.js";
29
29
  import { default as to } from "./components/ui/prompt/Prompt.js";
30
30
  import { Sidebar as fo } from "./components/ui/sidebar/Sidebar.js";
31
31
  import { default as po } from "./components/ui/editable/Editable.js";
32
- import { default as xo } from "./components/layout/Layout.js";
32
+ import { default as lo } from "./components/layout/Layout.js";
33
33
  import { default as uo } from "./components/layout/Page.js";
34
34
  import { default as no } from "./components/layout/PageHeader.js";
35
- import { i as Po } from "./index-2Dtbwxm_.js";
36
- import { MyInfiniteScroll as Fo } from "./components/ui/infinitescroll/InfiniteScroll.js";
35
+ import { i as co } from "./index-fzAcu0Dr.js";
37
36
  export {
38
37
  $ as Alert,
39
38
  q as Block,
40
- S as Button,
41
- R as Checkbox,
39
+ h as Button,
40
+ S as Checkbox,
42
41
  w as CheckboxList,
43
42
  eo as Confirm,
44
- x as Date,
45
- d as DatePicker,
43
+ l as Date,
44
+ s as DatePicker,
46
45
  po as Editable,
47
46
  E as Fieldset,
48
- c as Files,
47
+ P as Files,
49
48
  t as Form,
50
49
  p as FormCol,
51
50
  f as FormRow,
52
- D as Hidden,
53
- Po as Icons,
51
+ H as Hidden,
52
+ co as Icons,
54
53
  b as Image,
55
- Fo as InfiniteScroll,
56
- I as Input,
57
- k as Label,
58
- xo as Layout,
54
+ g as Input,
55
+ C as Label,
56
+ lo as Layout,
59
57
  T as Menu,
60
58
  Z as Message,
61
59
  K as Modal,
@@ -66,8 +64,8 @@ export {
66
64
  V as Popup,
67
65
  X as Portal,
68
66
  to as Prompt,
69
- L as RadioList,
70
- h as Select,
67
+ I as RadioList,
68
+ B as Select,
71
69
  fo as Sidebar,
72
70
  i as Time
73
71
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alxgrn/telefrag-ui",
3
3
  "description": "UI library for The Daily Telefrag project",
4
- "version": "0.0.47",
4
+ "version": "0.0.50",
5
5
  "private": false,
6
6
  "author": "Alexander Fedorov <alex@molner.ru>",
7
7
  "license": "Apache-2.0",
@@ -31,7 +31,6 @@
31
31
  "react": "^19.0.0",
32
32
  "react-children-utilities": "^2.10.0",
33
33
  "react-dom": "^19.0.0",
34
- "react-infinite-scroll-component": "^6.1.0",
35
34
  "react-transition-group": "^4.4.5"
36
35
  },
37
36
  "devDependencies": {
@@ -1 +0,0 @@
1
- :root{--alxgrn-select-bg: var(--alxgrn-bg-accent);--alxgrn-select-color: var(--alxgrn-color-text);--alxgrn-select-border: var(--alxgrn-border-accent);--alxgrn-select-bg-focus: var(--alxgrn-bg-active);--alxgrn-select-color-focus: var(--alxgrn-color-text);--alxgrn-select-border-focus: var(--alxgrn-border-accent);--alxgrn-select-bg-error: var(--alxgrn-bg-error);--alxgrn-select-color-error: var(--alxgrn-color-error);--alxgrn-select-border-error: var(--alxgrn-border-error);--alxgrn-select-bg-success: var(--alxgrn-bg-success);--alxgrn-select-color-success: var(--alxgrn-color-success);--alxgrn-select-border-success: var(--alxgrn-border-success);--alxgrn-select-bg-disabled: var(--alxgrn-bg-light);--alxgrn-select-color-disabled: var(--alxgrn-color-light);--alxgrn-select-border-disabled: var(--alxgrn-border-light)}.FormItem select{color:var(--alxgrn-select-color);padding:var(--alxgrn-unit-half);margin:0;font-size:inherit;line-height:inherit;font-family:inherit;border-radius:var(--alxgrn-unit-small);border:1px solid var(--alxgrn-select-border);width:100%;display:block;background-color:var(--alxgrn-select-bg);appearance:none;-moz-appearance:none;-webkit-appearance:none;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.FormItem select:focus{outline:none;color:var(--alxgrn-select-color-focus);background-color:var(--alxgrn-select-bg-focus);border:1px solid var(--alxgrn-select-border-focus)}.FormItem select:disabled{color:var(--alxgrn-select-color-disabled);border-color:var(--alxgrn-select-border-disabled);background-color:var(--alxgrn-select-bg-disabled);cursor:default}.FormItem select{padding-right:var(--alxgrn-unit-double);cursor:pointer}.FormItem .SelectWrap{position:relative}.FormItem .SelectWrap:before{content:"";position:absolute;width:0;height:0;border:var(--alxgrn-unit-small) solid transparent;border-top-color:var(--alxgrn-select-border);top:var(--alxgrn-unit);right:calc(var(--alxgrn-unit) - var(--alxgrn-unit-small));cursor:pointer;pointer-events:none}.FormItem .SelectWrap.Disabled:before{border-top-color:var(--alxgrn-select-border-disabled);cursor:default}.FormItem .SelectWrap.Error:before{border-top-color:var(--alxgrn-select-border-error)}
@@ -1 +0,0 @@
1
- .FormItem .Time{display:flex;gap:var(--alxgrn-unit-half);align-items:center}
@@ -1,13 +0,0 @@
1
- import { FC, PropsWithChildren, ReactNode } from 'react';
2
- type Props = {
3
- dataLength: number;
4
- loadMore: () => void;
5
- hasMore: boolean;
6
- loader?: ReactNode;
7
- endMessage?: ReactNode;
8
- scrollThreshold?: number | string;
9
- className?: string;
10
- style?: object;
11
- };
12
- export declare const MyInfiniteScroll: FC<PropsWithChildren<Props>>;
13
- export default MyInfiniteScroll;
@@ -1,30 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { I as s } from "../../../index.es-CZnvHQxj.js";
3
- const c = ({
4
- dataLength: o,
5
- children: t,
6
- loadMore: r,
7
- hasMore: i,
8
- loader: n,
9
- endMessage: e,
10
- scrollThreshold: f = "200px",
11
- className: l,
12
- style: m
13
- }) => /* @__PURE__ */ p(
14
- s,
15
- {
16
- dataLength: o,
17
- next: r,
18
- hasMore: i,
19
- loader: n,
20
- endMessage: e,
21
- className: l,
22
- style: m,
23
- scrollThreshold: f,
24
- children: t
25
- }
26
- );
27
- export {
28
- c as MyInfiniteScroll,
29
- c as default
30
- };
@@ -1,130 +0,0 @@
1
- import o from "./components/icons/AlignBottom.js";
2
- import r from "./components/icons/AlignCenter.js";
3
- import m from "./components/icons/AlignJustify.js";
4
- import i from "./components/icons/AlignLeft.js";
5
- import t from "./components/icons/AlignMiddle.js";
6
- import e from "./components/icons/AlignRight.js";
7
- import f from "./components/icons/AlignTop.js";
8
- import p from "./components/icons/Asterisk.js";
9
- import n from "./components/icons/Bold.js";
10
- import l from "./components/icons/Book.js";
11
- import a from "./components/icons/Calendar.js";
12
- import d from "./components/icons/CellsMerge.js";
13
- import g from "./components/icons/CellsSplit.js";
14
- import s from "./components/icons/ChevronLeft.js";
15
- import u from "./components/icons/ChevronRight.js";
16
- import h from "./components/icons/Clock.js";
17
- import C from "./components/icons/Code.js";
18
- import A from "./components/icons/CodeXml.js";
19
- import c from "./components/icons/ColumnInsertAfter.js";
20
- import S from "./components/icons/ColumnInsertBefore.js";
21
- import k from "./components/icons/Expand.js";
22
- import H from "./components/icons/Feather.js";
23
- import I from "./components/icons/Files.js";
24
- import L from "./components/icons/Film.js";
25
- import M from "./components/icons/FlipVertical.js";
26
- import R from "./components/icons/Forum.js";
27
- import T from "./components/icons/Gamepad.js";
28
- import b from "./components/icons/Heading.js";
29
- import B from "./components/icons/Heading1.js";
30
- import F from "./components/icons/Heading2.js";
31
- import w from "./components/icons/Heading3.js";
32
- import x from "./components/icons/Heading4.js";
33
- import y from "./components/icons/Heading5.js";
34
- import U from "./components/icons/Heading6.js";
35
- import _ from "./components/icons/Image.js";
36
- import v from "./components/icons/IndentDecrease.js";
37
- import z from "./components/icons/Italic.js";
38
- import O from "./components/icons/JoinUp.js";
39
- import P from "./components/icons/Link.js";
40
- import j from "./components/icons/List.js";
41
- import D from "./components/icons/ListOrdered.js";
42
- import J from "./components/icons/Maximize.js";
43
- import q from "./components/icons/Menu.js";
44
- import E from "./components/icons/Minimize.js";
45
- import G from "./components/icons/Pilcrow.js";
46
- import Q from "./components/icons/Plus.js";
47
- import V from "./components/icons/Quote.js";
48
- import X from "./components/icons/Redo.js";
49
- import K from "./components/icons/Rocket.js";
50
- import N from "./components/icons/RowInsertAfter.js";
51
- import W from "./components/icons/RowInsertBefore.js";
52
- import Y from "./components/icons/ShowSidebar.js";
53
- import Z from "./components/icons/Shrink.js";
54
- import $ from "./components/icons/SquareDashed.js";
55
- import oo from "./components/icons/Strikethrough.js";
56
- import ro from "./components/icons/Table.js";
57
- import mo from "./components/icons/TelefragLogo.js";
58
- import io from "./components/icons/Trash.js";
59
- import to from "./components/icons/Type.js";
60
- import eo from "./components/icons/Underline.js";
61
- import fo from "./components/icons/Undo.js";
62
- import po from "./components/icons/Users.js";
63
- const Ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
64
- __proto__: null,
65
- AlignBottom: o,
66
- AlignCenter: r,
67
- AlignJustify: m,
68
- AlignLeft: i,
69
- AlignMiddle: t,
70
- AlignRight: e,
71
- AlignTop: f,
72
- Asterisk: p,
73
- Bold: n,
74
- Book: l,
75
- Calendar: a,
76
- CellsMerge: d,
77
- CellsSplit: g,
78
- ChevronLeft: s,
79
- ChevronRight: u,
80
- Clock: h,
81
- Code: C,
82
- CodeXml: A,
83
- ColumnInsertAfter: c,
84
- ColumnInsertBefore: S,
85
- Expand: k,
86
- Feather: H,
87
- Files: I,
88
- Film: L,
89
- FlipVertical: M,
90
- Forum: R,
91
- Gamepad: T,
92
- Heading: b,
93
- Heading1: B,
94
- Heading2: F,
95
- Heading3: w,
96
- Heading4: x,
97
- Heading5: y,
98
- Heading6: U,
99
- Image: _,
100
- IndentDecrease: v,
101
- Italic: z,
102
- JoinUp: O,
103
- Link: P,
104
- List: j,
105
- ListOrdered: D,
106
- Maximize: J,
107
- Menu: q,
108
- Minimize: E,
109
- Pilcrow: G,
110
- Plus: Q,
111
- Quote: V,
112
- Redo: X,
113
- Rocket: K,
114
- RowInsertAfter: N,
115
- RowInsertBefore: W,
116
- ShowSidebar: Y,
117
- Shrink: Z,
118
- SquareDashed: $,
119
- Strikethrough: oo,
120
- Table: ro,
121
- TelefragLogo: mo,
122
- Trash: io,
123
- Type: to,
124
- Underline: eo,
125
- Undo: fo,
126
- Users: po
127
- }, Symbol.toStringTag, { value: "Module" }));
128
- export {
129
- Ar as i
130
- };
@@ -1,176 +0,0 @@
1
- import h, { Component as T } from "react";
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
- this file except in compliance with the License. You may obtain a copy of the
6
- License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
- MERCHANTABLITY OR NON-INFRINGEMENT.
12
-
13
- See the Apache Version 2.0 License for specific language governing permissions
14
- and limitations under the License.
15
- ***************************************************************************** */
16
- var u = function(o, r) {
17
- return u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, e) {
18
- t.__proto__ = e;
19
- } || function(t, e) {
20
- for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
21
- }, u(o, r);
22
- };
23
- function S(o, r) {
24
- u(o, r);
25
- function t() {
26
- this.constructor = o;
27
- }
28
- o.prototype = r === null ? Object.create(r) : (t.prototype = r.prototype, new t());
29
- }
30
- var a = function() {
31
- return a = Object.assign || function(r) {
32
- for (var t, e = 1, n = arguments.length; e < n; e++) {
33
- t = arguments[e];
34
- for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (r[i] = t[i]);
35
- }
36
- return r;
37
- }, a.apply(this, arguments);
38
- };
39
- function _(o, r, t, e) {
40
- var n, i = !1, s = 0;
41
- function p() {
42
- n && clearTimeout(n);
43
- }
44
- function g() {
45
- p(), i = !0;
46
- }
47
- typeof r != "boolean" && (e = t, t = r, r = void 0);
48
- function f() {
49
- var w = this, d = Date.now() - s, E = arguments;
50
- if (i)
51
- return;
52
- function c() {
53
- s = Date.now(), t.apply(w, E);
54
- }
55
- function y() {
56
- n = void 0;
57
- }
58
- e && !n && c(), p(), e === void 0 && d > o ? c() : r !== !0 && (n = setTimeout(e ? y : c, e === void 0 ? o - d : o));
59
- }
60
- return f.cancel = g, f;
61
- }
62
- var l = {
63
- Pixel: "Pixel",
64
- Percent: "Percent"
65
- }, m = {
66
- unit: l.Percent,
67
- value: 0.8
68
- };
69
- function v(o) {
70
- return typeof o == "number" ? {
71
- unit: l.Percent,
72
- value: o * 100
73
- } : typeof o == "string" ? o.match(/^(\d*(\.\d+)?)px$/) ? {
74
- unit: l.Pixel,
75
- value: parseFloat(o)
76
- } : o.match(/^(\d*(\.\d+)?)%$/) ? {
77
- unit: l.Percent,
78
- value: parseFloat(o)
79
- } : (console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'), m) : (console.warn("scrollThreshold should be string or number"), m);
80
- }
81
- var D = (
82
- /** @class */
83
- function(o) {
84
- S(r, o);
85
- function r(t) {
86
- var e = o.call(this, t) || this;
87
- return e.lastScrollTop = 0, e.actionTriggered = !1, e.startY = 0, e.currentY = 0, e.dragging = !1, e.maxPullDownDistance = 0, e.getScrollableTarget = function() {
88
- return e.props.scrollableTarget instanceof HTMLElement ? e.props.scrollableTarget : typeof e.props.scrollableTarget == "string" ? document.getElementById(e.props.scrollableTarget) : (e.props.scrollableTarget === null && console.warn(`You are trying to pass scrollableTarget but it is null. This might
89
- happen because the element may not have been added to DOM yet.
90
- See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.
91
- `), null);
92
- }, e.onStart = function(n) {
93
- e.lastScrollTop || (e.dragging = !0, n instanceof MouseEvent ? e.startY = n.pageY : n instanceof TouchEvent && (e.startY = n.touches[0].pageY), e.currentY = e.startY, e._infScroll && (e._infScroll.style.willChange = "transform", e._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)"));
94
- }, e.onMove = function(n) {
95
- e.dragging && (n instanceof MouseEvent ? e.currentY = n.pageY : n instanceof TouchEvent && (e.currentY = n.touches[0].pageY), !(e.currentY < e.startY) && (e.currentY - e.startY >= Number(e.props.pullDownToRefreshThreshold) && e.setState({
96
- pullToRefreshThresholdBreached: !0
97
- }), !(e.currentY - e.startY > e.maxPullDownDistance * 1.5) && e._infScroll && (e._infScroll.style.overflow = "visible", e._infScroll.style.transform = "translate3d(0px, " + (e.currentY - e.startY) + "px, 0px)")));
98
- }, e.onEnd = function() {
99
- e.startY = 0, e.currentY = 0, e.dragging = !1, e.state.pullToRefreshThresholdBreached && (e.props.refreshFunction && e.props.refreshFunction(), e.setState({
100
- pullToRefreshThresholdBreached: !1
101
- })), requestAnimationFrame(function() {
102
- e._infScroll && (e._infScroll.style.overflow = "auto", e._infScroll.style.transform = "none", e._infScroll.style.willChange = "unset");
103
- });
104
- }, e.onScrollListener = function(n) {
105
- typeof e.props.onScroll == "function" && setTimeout(function() {
106
- return e.props.onScroll && e.props.onScroll(n);
107
- }, 0);
108
- var i = e.props.height || e._scrollableNode ? n.target : document.documentElement.scrollTop ? document.documentElement : document.body;
109
- if (!e.actionTriggered) {
110
- var s = e.props.inverse ? e.isElementAtTop(i, e.props.scrollThreshold) : e.isElementAtBottom(i, e.props.scrollThreshold);
111
- s && e.props.hasMore && (e.actionTriggered = !0, e.setState({ showLoader: !0 }), e.props.next && e.props.next()), e.lastScrollTop = i.scrollTop;
112
- }
113
- }, e.state = {
114
- showLoader: !1,
115
- pullToRefreshThresholdBreached: !1,
116
- prevDataLength: t.dataLength
117
- }, e.throttledOnScrollListener = _(150, e.onScrollListener).bind(e), e.onStart = e.onStart.bind(e), e.onMove = e.onMove.bind(e), e.onEnd = e.onEnd.bind(e), e;
118
- }
119
- return r.prototype.componentDidMount = function() {
120
- if (typeof this.props.dataLength > "u")
121
- throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');
122
- if (this._scrollableNode = this.getScrollableTarget(), this.el = this.props.height ? this._infScroll : this._scrollableNode || window, this.el && this.el.addEventListener("scroll", this.throttledOnScrollListener), typeof this.props.initialScrollY == "number" && this.el && this.el instanceof HTMLElement && this.el.scrollHeight > this.props.initialScrollY && this.el.scrollTo(0, this.props.initialScrollY), this.props.pullDownToRefresh && this.el && (this.el.addEventListener("touchstart", this.onStart), this.el.addEventListener("touchmove", this.onMove), this.el.addEventListener("touchend", this.onEnd), this.el.addEventListener("mousedown", this.onStart), this.el.addEventListener("mousemove", this.onMove), this.el.addEventListener("mouseup", this.onEnd), this.maxPullDownDistance = this._pullDown && this._pullDown.firstChild && this._pullDown.firstChild.getBoundingClientRect().height || 0, this.forceUpdate(), typeof this.props.refreshFunction != "function"))
123
- throw new Error(`Mandatory prop "refreshFunction" missing.
124
- Pull Down To Refresh functionality will not work
125
- as expected. Check README.md for usage'`);
126
- }, r.prototype.componentWillUnmount = function() {
127
- this.el && (this.el.removeEventListener("scroll", this.throttledOnScrollListener), this.props.pullDownToRefresh && (this.el.removeEventListener("touchstart", this.onStart), this.el.removeEventListener("touchmove", this.onMove), this.el.removeEventListener("touchend", this.onEnd), this.el.removeEventListener("mousedown", this.onStart), this.el.removeEventListener("mousemove", this.onMove), this.el.removeEventListener("mouseup", this.onEnd)));
128
- }, r.prototype.componentDidUpdate = function(t) {
129
- this.props.dataLength !== t.dataLength && (this.actionTriggered = !1, this.setState({
130
- showLoader: !1
131
- }));
132
- }, r.getDerivedStateFromProps = function(t, e) {
133
- var n = t.dataLength !== e.prevDataLength;
134
- return n ? a(a({}, e), { prevDataLength: t.dataLength }) : null;
135
- }, r.prototype.isElementAtTop = function(t, e) {
136
- e === void 0 && (e = 0.8);
137
- var n = t === document.body || t === document.documentElement ? window.screen.availHeight : t.clientHeight, i = v(e);
138
- return i.unit === l.Pixel ? t.scrollTop <= i.value + n - t.scrollHeight + 1 : t.scrollTop <= i.value / 100 + n - t.scrollHeight + 1;
139
- }, r.prototype.isElementAtBottom = function(t, e) {
140
- e === void 0 && (e = 0.8);
141
- var n = t === document.body || t === document.documentElement ? window.screen.availHeight : t.clientHeight, i = v(e);
142
- return i.unit === l.Pixel ? t.scrollTop + n >= t.scrollHeight - i.value : t.scrollTop + n >= i.value / 100 * t.scrollHeight;
143
- }, r.prototype.render = function() {
144
- var t = this, e = a({ height: this.props.height || "auto", overflow: "auto", WebkitOverflowScrolling: "touch" }, this.props.style), n = this.props.hasChildren || !!(this.props.children && this.props.children instanceof Array && this.props.children.length), i = this.props.pullDownToRefresh && this.props.height ? { overflow: "auto" } : {};
145
- return h.createElement(
146
- "div",
147
- { style: i, className: "infinite-scroll-component__outerdiv" },
148
- h.createElement(
149
- "div",
150
- { className: "infinite-scroll-component " + (this.props.className || ""), ref: function(s) {
151
- return t._infScroll = s;
152
- }, style: e },
153
- this.props.pullDownToRefresh && h.createElement(
154
- "div",
155
- { style: { position: "relative" }, ref: function(s) {
156
- return t._pullDown = s;
157
- } },
158
- h.createElement("div", { style: {
159
- position: "absolute",
160
- left: 0,
161
- right: 0,
162
- top: -1 * this.maxPullDownDistance
163
- } }, this.state.pullToRefreshThresholdBreached ? this.props.releaseToRefreshContent : this.props.pullDownToRefreshContent)
164
- ),
165
- this.props.children,
166
- !this.state.showLoader && !n && this.props.hasMore && this.props.loader,
167
- this.state.showLoader && this.props.hasMore && this.props.loader,
168
- !this.props.hasMore && this.props.endMessage
169
- )
170
- );
171
- }, r;
172
- }(T)
173
- );
174
- export {
175
- D as I
176
- };