@onepercentio/one-ui 0.9.10 → 0.9.12
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/Countdown/Countdown.d.ts +6 -1
- package/dist/components/Countdown/Countdown.js +25 -3
- package/dist/components/Countdown/Countdown.js.map +1 -1
- package/dist/components/HSForms/HSForms.js +1 -1
- package/dist/components/HSForms/HSForms.js.map +1 -1
- package/dist/components/Select/Select.js.map +1 -1
- package/package.json +1 -1
- package/test/models/examples/contract.ts +4 -0
- package/test/models/examples/raw_erc.ts +367 -0
- package/dist/components/PaginationIndicator/PaginationIndicator.module.scss +0 -48
- package/dist/components/Recycler/Recycler.d.ts +0 -4
- package/dist/components/Recycler/Recycler.js +0 -14
- package/dist/components/Recycler/Recycler.js.map +0 -1
- package/dist/components/Recycler/Recycler.module.scss +0 -0
- package/dist/components/Recycler/index.d.ts +0 -1
- package/dist/components/Recycler/index.js +0 -9
- package/dist/components/Recycler/index.js.map +0 -1
- package/dist/hooks/usePaginationControls.d.ts +0 -5
- package/dist/hooks/usePaginationControls.js +0 -8
- package/dist/hooks/usePaginationControls.js.map +0 -1
- package/dist/utils.d.ts +0 -44
- package/dist/utils.js +0 -3
- package/dist/utils.js.map +0 -1
|
@@ -4,10 +4,15 @@ export declare type TimeObject = {
|
|
|
4
4
|
seconds: number;
|
|
5
5
|
};
|
|
6
6
|
export declare function calculateTimeFromTimespan(timespan: number): TimeObject;
|
|
7
|
+
export declare enum CountdownTextModel {
|
|
8
|
+
CLOCK = 0,
|
|
9
|
+
SHORT = 1
|
|
10
|
+
}
|
|
7
11
|
/**
|
|
8
12
|
* You five it some time, and a countdown is shown
|
|
9
13
|
**/
|
|
10
|
-
export default function Countdown({ timeRemaining, onFinish, }: {
|
|
14
|
+
export default function Countdown({ timeRemaining, onFinish, model }: {
|
|
11
15
|
timeRemaining: number;
|
|
12
16
|
onFinish?: () => void;
|
|
17
|
+
model?: CountdownTextModel;
|
|
13
18
|
}): JSX.Element;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.calculateTimeFromTimespan = void 0;
|
|
26
|
+
exports.CountdownTextModel = exports.calculateTimeFromTimespan = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
function calculateTimeFromTimespan(timespan) {
|
|
29
29
|
const seconds = Math.floor(timespan / 1000);
|
|
@@ -39,10 +39,15 @@ exports.calculateTimeFromTimespan = calculateTimeFromTimespan;
|
|
|
39
39
|
const IntegerFormatter = new Intl.NumberFormat(undefined, {
|
|
40
40
|
minimumIntegerDigits: 2,
|
|
41
41
|
});
|
|
42
|
+
var CountdownTextModel;
|
|
43
|
+
(function (CountdownTextModel) {
|
|
44
|
+
CountdownTextModel[CountdownTextModel["CLOCK"] = 0] = "CLOCK";
|
|
45
|
+
CountdownTextModel[CountdownTextModel["SHORT"] = 1] = "SHORT";
|
|
46
|
+
})(CountdownTextModel = exports.CountdownTextModel || (exports.CountdownTextModel = {}));
|
|
42
47
|
/**
|
|
43
48
|
* You five it some time, and a countdown is shown
|
|
44
49
|
**/
|
|
45
|
-
function Countdown({ timeRemaining, onFinish, }) {
|
|
50
|
+
function Countdown({ timeRemaining, onFinish, model = CountdownTextModel.CLOCK }) {
|
|
46
51
|
const [t, setT] = (0, react_1.useState)(() => calculateTimeFromTimespan(timeRemaining));
|
|
47
52
|
(0, react_1.useEffect)(() => {
|
|
48
53
|
const cl = setInterval(() => {
|
|
@@ -74,7 +79,24 @@ function Countdown({ timeRemaining, onFinish, }) {
|
|
|
74
79
|
clearInterval(cl);
|
|
75
80
|
};
|
|
76
81
|
}, [timeRemaining]);
|
|
77
|
-
|
|
82
|
+
const txt = (0, react_1.useMemo)(() => {
|
|
83
|
+
switch (model) {
|
|
84
|
+
case CountdownTextModel.CLOCK:
|
|
85
|
+
return (react_1.default.createElement(react_1.Fragment, null, `${IntegerFormatter.format(t.hours)}:${IntegerFormatter.format(t.minutes)}:${IntegerFormatter.format(t.seconds)}`));
|
|
86
|
+
case CountdownTextModel.SHORT:
|
|
87
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
|
88
|
+
IntegerFormatter.format(t.hours),
|
|
89
|
+
react_1.default.createElement("span", null, "h"),
|
|
90
|
+
"\u00A0",
|
|
91
|
+
IntegerFormatter.format(t.minutes),
|
|
92
|
+
react_1.default.createElement("span", null, "m"),
|
|
93
|
+
"\u00A0",
|
|
94
|
+
IntegerFormatter.format(t.seconds),
|
|
95
|
+
react_1.default.createElement("span", null, "s"),
|
|
96
|
+
"\u00A0"));
|
|
97
|
+
}
|
|
98
|
+
}, [model, t]);
|
|
99
|
+
return react_1.default.createElement("span", null, txt);
|
|
78
100
|
}
|
|
79
101
|
exports.default = Countdown;
|
|
80
102
|
//# sourceMappingURL=Countdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Countdown.js","sourceRoot":"","sources":["../../../src/components/Countdown/Countdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"Countdown.js","sourceRoot":"","sources":["../../../src/components/Countdown/Countdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsE;AAQtE,SAAgB,yBAAyB,CAAC,QAAgB;IACxD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,OAAO;QACL,KAAK;QACL,OAAO,EAAE,OAAO,GAAG,EAAE;QACrB,OAAO,EAAE,OAAO,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OAAO,EAAE,UAAU;oBACnB,OAAO,EAAE,UAAU;oBACnB,KAAK,EAAE,QAAQ;iBAChB,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,GAAG,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACvB,QAAQ,KAAK,EAAE;YACb,KAAK,kBAAkB,CAAC,KAAK;gBAC3B,OAAO,CACL,8BAAC,gBAAQ,QACN,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAE,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC,MAAM,CAC9D,CAAE,CAAC,OAAO,CACX,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAE,CAAC,OAAO,CAAC,EAAE,CACjC,CACZ,CAAC;YACJ,KAAK,kBAAkB,CAAC,KAAK;gBAC3B,OAAO,CACL,8BAAC,gBAAQ;oBACN,gBAAgB,CAAC,MAAM,CAAC,CAAE,CAAC,KAAK,CAAC;oBAClC,gDAAc;;oBACb,gBAAgB,CAAC,MAAM,CAAC,CAAE,CAAC,OAAO,CAAC;oBACpC,gDAAc;;oBACb,gBAAgB,CAAC,MAAM,CAAC,CAAE,CAAC,OAAO,CAAC;oBACpC,gDAAc;6BACL,CACZ,CAAC;SACL;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAEf,OAAO,4CAAO,GAAG,CAAQ,CAAC;AAC5B,CAAC;AAvED,4BAuEC"}
|
|
@@ -57,7 +57,7 @@ function HSForms({ region, partialId, formId, className, onFormReady, onFormSubm
|
|
|
57
57
|
css: ' ',
|
|
58
58
|
cssClass: '#',
|
|
59
59
|
onFormReady: ${idx},
|
|
60
|
-
|
|
60
|
+
onFormSubmit: ${idx2},
|
|
61
61
|
formInstanceId: ${funcId}
|
|
62
62
|
});`;
|
|
63
63
|
container.current.appendChild(createFormScript);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HSForms.js","sourceRoot":"","sources":["../../../src/components/HSForms/HSForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiD;AAEjD,SAAwB,OAAO,CAAC,EAC9B,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,WAAW,EACX,eAAe,GAQhB;IACC,IAAK,MAAc,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAE/C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,kDAAO,QAAS,IAAE,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE;YACtC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;YAC1D,MAAM,GAAG,GAAG,SAAS,MAAM,EAAE,CAAC;YAC9B,MAAM,IAAI,GAAG,WAAW,MAAM,EAAE,CAAC;YAChC,MAAc,CAAC,GAAU,CAAC,GAAG,UAAU,IAAS;gBAC/C,IAAI,WAAW;oBAAE,WAAW,CAAC,SAAS,CAAC,OAAQ,EAAE,IAAI,CAAC,CAAC;YACzD,CAAC,CAAC;YACD,MAAc,CAAC,IAAW,CAAC,GAAG;gBAC7B,IAAI,eAAe;oBAAE,eAAe,EAAE,CAAC;YACzC,CAAC,CAAC;YACD,MAAc,CAAC,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC;YAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAChD,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;YACjE,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,iBAAiB,CA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YACzC,CAAC,CAAC;YACD,MAAc,CAAC,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC;YAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAChD,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;YACjE,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;YAC/C,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;gBACnB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;gBAC1D,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;gBACzD,gBAAgB,CAAC,SAAS,GAAG;qBAChB,MAAM;uBACJ,SAAS;qBACX,MAAM;;;;yBAIF,GAAG;0BACF,IAAI;4BACF,MAAM;YACtB,CAAC;gBACL,SAAS,CAAC,OAAQ,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;YACnD,CAAC,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IAChC,OAAO,uCAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAQ,CAAC;AAC3D,CAAC;AAtDD,0BAsDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAOe;AACf,iEAAyC;AACzC,mDAA2B;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx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,CAAC,CAAC,KAAK,EACZ,SAAS,EAAE,GACT,CAAC,KAAK,SAAS;gBACb,CAAC,CAAC,GAAG,4BAAM,CAAC,QAAQ,IAAI,kBAAkB,CAAC,YAAY,EAAE;gBACzD,CAAC,CAAC,EACN,IAAI,kBAAkB,CAAC,IAAI,IAAI,EAAE,EAAE,EACnC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,IAExB,CAAC,CAAC,KAAK,CACH,CACR,CAAC,CACE,CACM,CACf,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,kBAAU,EAAC,CAAC,KAAU,EAAE,GAAQ,EAAE,EAAE,CAAC,CAClD,8BAAC,MAAM,oBAAK,KAAK,EAAI,CACtB,CAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.12",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
5
|
"repository": "git@github.com:onepercentio/one-ui.git",
|
|
6
6
|
"author": "Murilo Oliveira de Araujo <muritavo@outlook.com>",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import GenericContract, { ExtractMethodDefinition, TuplifyUnion } from "../../../src/models/GenericContract";
|
|
2
|
+
import { AbiItem, RAW_ERC1155ABI } from "./raw_erc"
|
|
3
|
+
import { Contract } from 'web3-eth-contract'
|
|
4
|
+
const xpto = new Contract(RAW_ERC1155ABI as unknown as AbiItem[]) as unknown as GenericContract<typeof RAW_ERC1155ABI>;
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
|
|
2
|
+
export interface AbiInput {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
indexed?: boolean;
|
|
6
|
+
components?: AbiInput[];
|
|
7
|
+
internalType?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AbiOutput {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
components?: AbiOutput[];
|
|
14
|
+
internalType?: string;
|
|
15
|
+
}
|
|
16
|
+
export type StateMutabilityType = 'pure' | 'view' | 'nonpayable' | 'payable';
|
|
17
|
+
|
|
18
|
+
export type AbiType = 'function' | 'constructor' | 'event' | 'fallback';
|
|
19
|
+
export interface AbiItem {
|
|
20
|
+
anonymous?: boolean;
|
|
21
|
+
constant?: boolean;
|
|
22
|
+
inputs?: AbiInput[];
|
|
23
|
+
name?: string;
|
|
24
|
+
outputs?: AbiOutput[];
|
|
25
|
+
payable?: boolean;
|
|
26
|
+
stateMutability?: StateMutabilityType;
|
|
27
|
+
type: AbiType;
|
|
28
|
+
gas?: number;
|
|
29
|
+
}
|
|
30
|
+
export const RAW_ERC1155ABI = [
|
|
31
|
+
{
|
|
32
|
+
"anonymous": false,
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"indexed": true,
|
|
36
|
+
"internalType": "address",
|
|
37
|
+
"name": "account",
|
|
38
|
+
"type": "address"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"indexed": true,
|
|
42
|
+
"internalType": "address",
|
|
43
|
+
"name": "operator",
|
|
44
|
+
"type": "address"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"indexed": false,
|
|
48
|
+
"internalType": "bool",
|
|
49
|
+
"name": "approved",
|
|
50
|
+
"type": "bool"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"name": "ApprovalForAll",
|
|
54
|
+
"type": "event"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"anonymous": false,
|
|
58
|
+
"inputs": [
|
|
59
|
+
{
|
|
60
|
+
"indexed": true,
|
|
61
|
+
"internalType": "address",
|
|
62
|
+
"name": "operator",
|
|
63
|
+
"type": "address"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"indexed": true,
|
|
67
|
+
"internalType": "address",
|
|
68
|
+
"name": "from",
|
|
69
|
+
"type": "address"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"indexed": true,
|
|
73
|
+
"internalType": "address",
|
|
74
|
+
"name": "to",
|
|
75
|
+
"type": "address"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"indexed": false,
|
|
79
|
+
"internalType": "uint256[]",
|
|
80
|
+
"name": "ids",
|
|
81
|
+
"type": "uint256[]"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"indexed": false,
|
|
85
|
+
"internalType": "uint256[]",
|
|
86
|
+
"name": "values",
|
|
87
|
+
"type": "uint256[]"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"name": "TransferBatch",
|
|
91
|
+
"type": "event"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"anonymous": false,
|
|
95
|
+
"inputs": [
|
|
96
|
+
{
|
|
97
|
+
"indexed": true,
|
|
98
|
+
"internalType": "address",
|
|
99
|
+
"name": "operator",
|
|
100
|
+
"type": "address"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"indexed": true,
|
|
104
|
+
"internalType": "address",
|
|
105
|
+
"name": "from",
|
|
106
|
+
"type": "address"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"indexed": true,
|
|
110
|
+
"internalType": "address",
|
|
111
|
+
"name": "to",
|
|
112
|
+
"type": "address"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"indexed": false,
|
|
116
|
+
"internalType": "uint256",
|
|
117
|
+
"name": "id",
|
|
118
|
+
"type": "uint256"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"indexed": false,
|
|
122
|
+
"internalType": "uint256",
|
|
123
|
+
"name": "value",
|
|
124
|
+
"type": "uint256"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"name": "TransferSingle",
|
|
128
|
+
"type": "event"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"anonymous": false,
|
|
132
|
+
"inputs": [
|
|
133
|
+
{
|
|
134
|
+
"indexed": false,
|
|
135
|
+
"internalType": "string",
|
|
136
|
+
"name": "value",
|
|
137
|
+
"type": "string"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"indexed": true,
|
|
141
|
+
"internalType": "uint256",
|
|
142
|
+
"name": "id",
|
|
143
|
+
"type": "uint256"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"name": "URI",
|
|
147
|
+
"type": "event"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"inputs": [
|
|
151
|
+
{
|
|
152
|
+
"internalType": "address",
|
|
153
|
+
"name": "account",
|
|
154
|
+
"type": "address"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"internalType": "uint256",
|
|
158
|
+
"name": "id",
|
|
159
|
+
"type": "uint256"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"name": "balanceOf",
|
|
163
|
+
"outputs": [
|
|
164
|
+
{
|
|
165
|
+
"internalType": "uint256",
|
|
166
|
+
"name": "",
|
|
167
|
+
"type": "uint256"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"stateMutability": "view",
|
|
171
|
+
"type": "function"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"inputs": [
|
|
175
|
+
{
|
|
176
|
+
"internalType": "address[]",
|
|
177
|
+
"name": "accounts",
|
|
178
|
+
"type": "address[]"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"internalType": "uint256[]",
|
|
182
|
+
"name": "ids",
|
|
183
|
+
"type": "uint256[]"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"name": "balanceOfBatch",
|
|
187
|
+
"outputs": [
|
|
188
|
+
{
|
|
189
|
+
"internalType": "uint256[]",
|
|
190
|
+
"name": "",
|
|
191
|
+
"type": "uint256[]"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"stateMutability": "view",
|
|
195
|
+
"type": "function"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"inputs": [
|
|
199
|
+
{
|
|
200
|
+
"internalType": "address",
|
|
201
|
+
"name": "account",
|
|
202
|
+
"type": "address"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"internalType": "address",
|
|
206
|
+
"name": "operator",
|
|
207
|
+
"type": "address"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"name": "isApprovedForAll",
|
|
211
|
+
"outputs": [
|
|
212
|
+
{
|
|
213
|
+
"internalType": "bool",
|
|
214
|
+
"name": "",
|
|
215
|
+
"type": "bool"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"stateMutability": "view",
|
|
219
|
+
"type": "function"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"inputs": [
|
|
223
|
+
{
|
|
224
|
+
"internalType": "address",
|
|
225
|
+
"name": "from",
|
|
226
|
+
"type": "address"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"internalType": "address",
|
|
230
|
+
"name": "to",
|
|
231
|
+
"type": "address"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"internalType": "uint256[]",
|
|
235
|
+
"name": "ids",
|
|
236
|
+
"type": "uint256[]"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"internalType": "uint256[]",
|
|
240
|
+
"name": "amounts",
|
|
241
|
+
"type": "uint256[]"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"internalType": "bytes",
|
|
245
|
+
"name": "data",
|
|
246
|
+
"type": "bytes"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"name": "safeBatchTransferFrom",
|
|
250
|
+
"outputs": [],
|
|
251
|
+
"stateMutability": "nonpayable",
|
|
252
|
+
"type": "function"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"inputs": [
|
|
256
|
+
{
|
|
257
|
+
"internalType": "address",
|
|
258
|
+
"name": "from",
|
|
259
|
+
"type": "address"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"internalType": "address",
|
|
263
|
+
"name": "to",
|
|
264
|
+
"type": "address"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"internalType": "uint256",
|
|
268
|
+
"name": "id",
|
|
269
|
+
"type": "uint256"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"internalType": "uint256",
|
|
273
|
+
"name": "amount",
|
|
274
|
+
"type": "uint256"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"internalType": "bytes",
|
|
278
|
+
"name": "data",
|
|
279
|
+
"type": "bytes"
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"name": "safeTransferFrom",
|
|
283
|
+
"outputs": [],
|
|
284
|
+
"stateMutability": "nonpayable",
|
|
285
|
+
"type": "function"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"inputs": [
|
|
289
|
+
{
|
|
290
|
+
"internalType": "address",
|
|
291
|
+
"name": "operator",
|
|
292
|
+
"type": "address"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"internalType": "bool",
|
|
296
|
+
"name": "approved",
|
|
297
|
+
"type": "bool"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"name": "setApprovalForAll",
|
|
301
|
+
"outputs": [],
|
|
302
|
+
"stateMutability": "nonpayable",
|
|
303
|
+
"type": "function"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"inputs": [
|
|
307
|
+
{
|
|
308
|
+
"internalType": "bytes4",
|
|
309
|
+
"name": "interfaceId",
|
|
310
|
+
"type": "bytes4"
|
|
311
|
+
}
|
|
312
|
+
],
|
|
313
|
+
"name": "supportsInterface",
|
|
314
|
+
"outputs": [
|
|
315
|
+
{
|
|
316
|
+
"internalType": "bool",
|
|
317
|
+
"name": "",
|
|
318
|
+
"type": "bool"
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
"stateMutability": "view",
|
|
322
|
+
"type": "function"
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
"inputs": [
|
|
326
|
+
{
|
|
327
|
+
"internalType": "uint256",
|
|
328
|
+
"name": "id",
|
|
329
|
+
"type": "uint256"
|
|
330
|
+
}
|
|
331
|
+
],
|
|
332
|
+
"name": "uri",
|
|
333
|
+
"outputs": [
|
|
334
|
+
{
|
|
335
|
+
"internalType": "string",
|
|
336
|
+
"name": "",
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"stateMutability": "view",
|
|
341
|
+
"type": "function"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
inputs: [
|
|
345
|
+
{
|
|
346
|
+
internalType: 'address',
|
|
347
|
+
name: 'wallet',
|
|
348
|
+
type: 'address',
|
|
349
|
+
},
|
|
350
|
+
],
|
|
351
|
+
name: 'balancesOf',
|
|
352
|
+
outputs: [
|
|
353
|
+
{
|
|
354
|
+
internalType: 'uint256[]',
|
|
355
|
+
name: 'tokens',
|
|
356
|
+
type: 'uint256[]',
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
internalType: 'uint256[]',
|
|
360
|
+
name: 'balances',
|
|
361
|
+
type: 'uint256[]',
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
stateMutability: 'view',
|
|
365
|
+
type: 'function',
|
|
366
|
+
},
|
|
367
|
+
] as const
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
$x: 0.1em;
|
|
2
|
-
|
|
3
|
-
.root {
|
|
4
|
-
position: relative;
|
|
5
|
-
height: 1.5em;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
filter: contrast(20);
|
|
10
|
-
background-color: #fff;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
> * {
|
|
13
|
-
height: 1em * 1.2;
|
|
14
|
-
width: 1em * 1.2;
|
|
15
|
-
margin: 0px 0.1em;
|
|
16
|
-
border-radius: 0.5em * 1.2;
|
|
17
|
-
background-color: #000;
|
|
18
|
-
position: relative;
|
|
19
|
-
filter: blur($x);
|
|
20
|
-
opacity: 0.485;
|
|
21
|
-
// animation-name: a;
|
|
22
|
-
// animation-iteration-count: infinite;
|
|
23
|
-
// animation-duration: 1s;
|
|
24
|
-
// animation-timing-function: linear;
|
|
25
|
-
// animation-direction: alternate;
|
|
26
|
-
}
|
|
27
|
-
&::after {
|
|
28
|
-
content: " ";
|
|
29
|
-
position: absolute;
|
|
30
|
-
background-color: #00f;
|
|
31
|
-
filter: blur($x * 2);
|
|
32
|
-
height: 1em * 0.8;
|
|
33
|
-
width: 1em * 0.8;
|
|
34
|
-
border-radius: 0.5em;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// @keyframes a {
|
|
39
|
-
// 0% {
|
|
40
|
-
// right: 2em;
|
|
41
|
-
// }
|
|
42
|
-
// 50% {
|
|
43
|
-
// right: 0em;
|
|
44
|
-
// }
|
|
45
|
-
// 100% {
|
|
46
|
-
// right: -2em;
|
|
47
|
-
// }
|
|
48
|
-
// }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
/**
|
|
8
|
-
* It shows only a limit of elements
|
|
9
|
-
**/
|
|
10
|
-
function Recycler() {
|
|
11
|
-
return react_1.default.createElement(react_1.default.Fragment, null, "Recycler");
|
|
12
|
-
}
|
|
13
|
-
exports.default = Recycler;
|
|
14
|
-
//# sourceMappingURL=Recycler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Recycler.js","sourceRoot":"","sources":["../../../src/components/Recycler/Recycler.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B;;IAEI;AACJ,SAAwB,QAAQ;IAC5B,OAAO,yEAAa,CAAC;AACzB,CAAC;AAFD,2BAEC"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Recycler';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var Recycler_1 = require("./Recycler");
|
|
8
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Recycler_1).default; } });
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Recycler/index.tsx"],"names":[],"mappings":";;;;;;AAAA,uCAAqC;AAA5B,oHAAA,OAAO,OAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/**
|
|
4
|
-
* This hook handles the display of pagination controls for the user to move to another page
|
|
5
|
-
*/
|
|
6
|
-
function usePaginationControls(containerRef) { }
|
|
7
|
-
exports.default = usePaginationControls;
|
|
8
|
-
//# sourceMappingURL=usePaginationControls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePaginationControls.js","sourceRoot":"","sources":["../../src/hooks/usePaginationControls.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,SAAwB,qBAAqB,CAC3C,YAAuC,IACtC,CAAC;AAFJ,wCAEI"}
|
package/dist/utils.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { FieldValues } from './fields';
|
|
2
|
-
import { NestedValue } from './form';
|
|
3
|
-
export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
4
|
-
export declare type EmptyObject = {
|
|
5
|
-
[K in string | number]: never;
|
|
6
|
-
};
|
|
7
|
-
export declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
8
|
-
export declare type LiteralUnion<T extends U, U extends Primitive> = T | (U & {
|
|
9
|
-
_?: never;
|
|
10
|
-
});
|
|
11
|
-
export declare type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
12
|
-
[key in keyof T]: T[key];
|
|
13
|
-
} ? {
|
|
14
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
15
|
-
} : T;
|
|
16
|
-
export declare type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
17
|
-
export declare type DeepMap<T, TValue> = {
|
|
18
|
-
[K in keyof T]?: IsAny<T[K]> extends true ? any : NonNullable<T[K]> extends NestedValue | Date | FileList | File ? TValue : NonUndefined<T[K]> extends object | null ? DeepMap<T[K], TValue> : NonUndefined<T[K]> extends Array<infer U> ? IsAny<U> extends true ? Array<any> : U extends NestedValue | Date | FileList ? Array<TValue> : U extends object ? Array<DeepMap<U, TValue>> : Array<TValue> : TValue;
|
|
19
|
-
};
|
|
20
|
-
export declare type IsFlatObject<T extends object> = Extract<Exclude<T[keyof T], NestedValue | Date | FileList>, any[] | object> extends never ? true : false;
|
|
21
|
-
declare type IsTuple<T extends ReadonlyArray<any>> = number extends T['length'] ? false : true;
|
|
22
|
-
declare type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
|
|
23
|
-
declare type ArrayKey = number;
|
|
24
|
-
declare type PathImpl<K extends string | number, V> = V extends Primitive ? `${K}` : `${K}` | `${K}.${Path<V>}`;
|
|
25
|
-
export declare type Path<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
26
|
-
[K in TupleKey<T>]-?: PathImpl<K & string, T[K]>;
|
|
27
|
-
}[TupleKey<T>] : PathImpl<ArrayKey, V> : {
|
|
28
|
-
[K in keyof T]-?: PathImpl<K & string, T[K]>;
|
|
29
|
-
}[keyof T];
|
|
30
|
-
export declare type FieldPath<TFieldValues extends FieldValues> = Path<TFieldValues>;
|
|
31
|
-
declare type ArrayPathImpl<K extends string | number, V> = V extends Primitive ? never : V extends ReadonlyArray<infer U> ? U extends Primitive ? never : `${K}` | `${K}.${ArrayPath<V>}` : `${K}.${ArrayPath<V>}`;
|
|
32
|
-
export declare type ArrayPath<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
33
|
-
[K in TupleKey<T>]-?: ArrayPathImpl<K & string, T[K]>;
|
|
34
|
-
}[TupleKey<T>] : ArrayPathImpl<ArrayKey, V> : {
|
|
35
|
-
[K in keyof T]-?: ArrayPathImpl<K & string, T[K]>;
|
|
36
|
-
}[keyof T];
|
|
37
|
-
export declare type FieldArrayPath<TFieldValues extends FieldValues> = ArrayPath<TFieldValues>;
|
|
38
|
-
export declare type PathValue<T, P extends Path<T> | ArrayPath<T>> = P extends `${infer K}.${infer R}` ? K extends keyof T ? R extends Path<T[K]> ? PathValue<T[K], R> : never : K extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? PathValue<V, R & Path<V>> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? V : never : never;
|
|
39
|
-
export declare type FieldPathValue<TFieldValues extends FieldValues, TFieldPath extends FieldPath<TFieldValues>> = PathValue<TFieldValues, TFieldPath>;
|
|
40
|
-
export declare type FieldArrayPathValue<TFieldValues extends FieldValues, TFieldArrayPath extends FieldArrayPath<TFieldValues>> = PathValue<TFieldValues, TFieldArrayPath>;
|
|
41
|
-
export declare type FieldPathValues<TFieldValues extends FieldValues, TPath extends FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[]> = {} & {
|
|
42
|
-
[K in keyof TPath]: FieldPathValue<TFieldValues, TPath[K] & FieldPath<TFieldValues>>;
|
|
43
|
-
};
|
|
44
|
-
export {};
|
package/dist/utils.js
DELETED
package/dist/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":""}
|