blixify-ui-web 0.1.13 → 0.1.14
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/lib/components/auth/bareSignIn/index.d.ts +38 -0
- package/lib/components/auth/bareSignIn/index.d.ts.map +1 -0
- package/lib/components/auth/bareSignIn/index.js +188 -0
- package/lib/components/auth/bareSignIn/index.js.map +1 -0
- package/lib/components/auth/signIn/index.d.ts +3 -19
- package/lib/components/auth/signIn/index.d.ts.map +1 -1
- package/lib/components/auth/signIn/index.js +4 -112
- package/lib/components/auth/signIn/index.js.map +1 -1
- package/lib/components/auth/signUp/index.d.ts +1 -1
- package/lib/components/auth/signUp/index.d.ts.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/address/index.d.ts +2 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js +66 -20
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts +2 -1
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +76 -28
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/form/index.d.ts +1 -1
- package/lib/components/input/form/index.d.ts.map +1 -1
- package/lib/components/input/form/index.js +74 -19
- package/lib/components/input/form/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts +2 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +33 -21
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textArea/index.d.ts +2 -1
- package/lib/components/input/textArea/index.d.ts.map +1 -1
- package/lib/components/input/textArea/index.js +67 -21
- package/lib/components/input/textArea/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts +2 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +98 -45
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/components/input/uploadInput/index.d.ts +2 -1
- package/lib/components/input/uploadInput/index.d.ts.map +1 -1
- package/lib/components/input/uploadInput/index.js +62 -15
- package/lib/components/input/uploadInput/index.js.map +1 -1
- package/lib/components/navigation/bars/index.d.ts +1 -0
- package/lib/components/navigation/bars/index.d.ts.map +1 -1
- package/lib/components/navigation/bars/index.js +36 -2
- package/lib/components/navigation/bars/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -37,6 +37,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
37
|
__setModuleDefault(result, mod);
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (_) try {
|
|
56
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
40
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
77
|
exports.TextArea = void 0;
|
|
42
78
|
var react_1 = __importStar(require("react"));
|
|
@@ -48,32 +84,42 @@ var TextArea = /** @class */ (function (_super) {
|
|
|
48
84
|
_this.state = {
|
|
49
85
|
error: "",
|
|
50
86
|
};
|
|
87
|
+
_this.setAsyncState = function (newState) {
|
|
88
|
+
return new Promise(function (resolve) { return _this.setState(newState, resolve); });
|
|
89
|
+
};
|
|
51
90
|
_this.handleOnChange = function (e) {
|
|
52
91
|
if (_this.props.onChange) {
|
|
53
92
|
_this.props.onChange(e);
|
|
54
93
|
}
|
|
55
94
|
};
|
|
56
|
-
_this.handleSubmit = function () {
|
|
57
|
-
var testCond
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
_this.handleSubmit = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
96
|
+
var testCond, error, textFilter;
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
testCond = false;
|
|
101
|
+
error = "Please input a text";
|
|
102
|
+
if (!this.props.optional) {
|
|
103
|
+
textFilter = /^([a-zA-Z0-9]+\s)*[a-zA-Z0-9]+$/;
|
|
104
|
+
testCond = textFilter.test(this.props.value);
|
|
105
|
+
/* eslint-enable */
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
testCond = true;
|
|
109
|
+
}
|
|
110
|
+
if (!!testCond) return [3 /*break*/, 2];
|
|
111
|
+
return [4 /*yield*/, this.setAsyncState({ error: error })];
|
|
112
|
+
case 1:
|
|
113
|
+
_a.sent();
|
|
114
|
+
return [3 /*break*/, 4];
|
|
115
|
+
case 2: return [4 /*yield*/, this.setAsyncState({ error: "" })];
|
|
116
|
+
case 3:
|
|
117
|
+
_a.sent();
|
|
118
|
+
_a.label = 4;
|
|
119
|
+
case 4: return [2 /*return*/, testCond];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}); };
|
|
77
123
|
return _this;
|
|
78
124
|
}
|
|
79
125
|
TextArea.prototype.render = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/textArea/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components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9BC,yBAAM,GAAN;QACE,IAAI,gBAAgB,GAClB,wJAAwJ,CAAC;QAC3J,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACpB,gBAAgB,IAAI,wBAAwB,CAAC;SAC9C;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACxB,gBAAgB,IAAI,WAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAE,CAAC;SAChD;QAED,OAAO,CACL;YACE,yCAAO,SAAS,EAAC,yCAAyC,IACvD,IAAI,CAAC,KAAK,CAAC,KAAK,CACX;YACR,4CACE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EACrB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,cAAc,GAC7B;YACD,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CACnB,wCAAM,SAAS,EAAC,sBAAsB,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ,CACjE,CACG,CACP,CAAC;IACJ,CAAC;IACH,eAAC;AAAD,CAAC,AAjED,CAA8B,iBAAS,GAiEtC;AAjEY,4BAAQ"}
|
|
@@ -17,8 +17,9 @@ export declare class TextInput extends Component<Props> {
|
|
|
17
17
|
state: {
|
|
18
18
|
error: string;
|
|
19
19
|
};
|
|
20
|
+
setAsyncState: (newState: any) => Promise<unknown>;
|
|
20
21
|
handleOnChange: (e: any) => void;
|
|
21
|
-
handleSubmit: () => boolean
|
|
22
|
+
handleSubmit: () => Promise<boolean>;
|
|
22
23
|
render(): JSX.Element;
|
|
23
24
|
}
|
|
24
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/textInput/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,qBAAa,SAAU,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC7C,KAAK;;MAEH;IAEF,cAAc,MAAO,GAAG,UAItB;IAEF,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/textInput/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,qBAAa,SAAU,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC7C,KAAK;;MAEH;IAEF,aAAa,sCACqD;IAElE,cAAc,MAAO,GAAG,UAItB;IAEF,YAAY,yBAmDV;IAEF,MAAM;CA8BP"}
|
|
@@ -37,6 +37,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
37
|
__setModuleDefault(result, mod);
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (_) try {
|
|
56
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
40
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
77
|
exports.TextInput = void 0;
|
|
42
78
|
var react_1 = __importStar(require("react"));
|
|
@@ -48,58 +84,75 @@ var TextInput = /** @class */ (function (_super) {
|
|
|
48
84
|
_this.state = {
|
|
49
85
|
error: "",
|
|
50
86
|
};
|
|
87
|
+
_this.setAsyncState = function (newState) {
|
|
88
|
+
return new Promise(function (resolve) { return _this.setState(newState, resolve); });
|
|
89
|
+
};
|
|
51
90
|
_this.handleOnChange = function (e) {
|
|
52
91
|
if (_this.props.onChange) {
|
|
53
92
|
_this.props.onChange(e);
|
|
54
93
|
}
|
|
55
94
|
};
|
|
56
|
-
_this.handleSubmit = function () {
|
|
57
|
-
var testCond
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
_this.handleSubmit = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
96
|
+
var testCond, error, emailFilter, textFilter, passwordFilter, numberFilter, phoneFilter;
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0:
|
|
100
|
+
testCond = false;
|
|
101
|
+
error = "";
|
|
102
|
+
if (!this.props.optional) {
|
|
103
|
+
// INFO : Regrex Validation
|
|
104
|
+
/* eslint-disable */
|
|
105
|
+
switch (this.props.type) {
|
|
106
|
+
case "email":
|
|
107
|
+
emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
|
108
|
+
testCond = emailFilter.test(this.props.value);
|
|
109
|
+
error = "Please input the correct email format";
|
|
110
|
+
break;
|
|
111
|
+
case "text":
|
|
112
|
+
textFilter = /^([a-zA-Z0-9]+\s)*[a-zA-Z0-9]+$/;
|
|
113
|
+
testCond = textFilter.test(this.props.value);
|
|
114
|
+
error = "Please input a text";
|
|
115
|
+
break;
|
|
116
|
+
case "password":
|
|
117
|
+
passwordFilter = /^[A-Za-z\d#$@!%&*?]{6,30}$/;
|
|
118
|
+
testCond = passwordFilter.test(this.props.value);
|
|
119
|
+
error = "Please input at least 6-30 characters";
|
|
120
|
+
break;
|
|
121
|
+
case "number":
|
|
122
|
+
numberFilter = /^[1-9]\d*(\.\d+)?$/;
|
|
123
|
+
testCond = numberFilter.test(this.props.value);
|
|
124
|
+
error = "Please input a number";
|
|
125
|
+
break;
|
|
126
|
+
case "mobile":
|
|
127
|
+
phoneFilter = /^(\+60)-*[0-9]{8,10}$/;
|
|
128
|
+
testCond = phoneFilter.test(this.props.value);
|
|
129
|
+
error = "Please input the correct format (eg +60123456789)";
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
error = "Please input the correct format";
|
|
133
|
+
if (this.props.pattern) {
|
|
134
|
+
testCond = this.props.pattern.test(this.props.value);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
/* eslint-enable */
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
testCond = true;
|
|
87
142
|
}
|
|
88
|
-
break;
|
|
143
|
+
if (!!testCond) return [3 /*break*/, 2];
|
|
144
|
+
return [4 /*yield*/, this.setAsyncState({ error: error })];
|
|
145
|
+
case 1:
|
|
146
|
+
_a.sent();
|
|
147
|
+
return [3 /*break*/, 4];
|
|
148
|
+
case 2: return [4 /*yield*/, this.setAsyncState({ error: "" })];
|
|
149
|
+
case 3:
|
|
150
|
+
_a.sent();
|
|
151
|
+
_a.label = 4;
|
|
152
|
+
case 4: return [2 /*return*/, testCond];
|
|
89
153
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
else {
|
|
93
|
-
testCond = true;
|
|
94
|
-
}
|
|
95
|
-
if (!testCond) {
|
|
96
|
-
_this.setState({ error: error });
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
_this.setState({ error: "" });
|
|
100
|
-
}
|
|
101
|
-
return testCond;
|
|
102
|
-
};
|
|
154
|
+
});
|
|
155
|
+
}); };
|
|
103
156
|
return _this;
|
|
104
157
|
}
|
|
105
158
|
TextInput.prototype.render = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/textInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../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YACpB,gBAAgB,IAAI,wBAAwB,CAAC;SAC9C;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;YAC7B,gBAAgB,IAAI,WAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAE,CAAC;SACrD;QAED,OAAO,CACL,uCAAK,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC3C,yCAAO,SAAS,EAAC,yCAAyC,IACvD,IAAI,CAAC,KAAK,CAAC,KAAK,CACX;YACR,yCACE,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EACjB,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAC7B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GACrB;YACD,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CACnB,wCAAM,SAAS,EAAC,sBAAsB,IAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAQ,CACjE,CACG,CACP,CAAC;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AAjGD,CAA+B,iBAAS,GAiGvC;AAjGY,8BAAS"}
|
|
@@ -14,7 +14,8 @@ export declare class UploadInput extends Component<Props> {
|
|
|
14
14
|
state: {
|
|
15
15
|
error: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
setAsyncState: (newState: any) => Promise<unknown>;
|
|
18
|
+
handleSubmit: () => Promise<boolean>;
|
|
18
19
|
handleOnChange: (e: any) => void;
|
|
19
20
|
renderFileDescription: () => string;
|
|
20
21
|
render(): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/uploadInput/index.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,qBAAa,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC/C,KAAK;;MAEH;IAEF,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input/uploadInput/index.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAE5B,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC7B;AAED,qBAAa,WAAY,SAAQ,SAAS,CAAC,KAAK,CAAC;IAC/C,KAAK;;MAEH;IAEF,aAAa,sCACqD;IAElE,YAAY,yBAeV;IAEF,cAAc,MAAO,GAAG,UAItB;IAEF,qBAAqB,eAMnB;IAEF,MAAM;CA+CP"}
|
|
@@ -37,6 +37,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
37
|
__setModuleDefault(result, mod);
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (_) try {
|
|
56
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
40
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
77
|
exports.UploadInput = void 0;
|
|
42
78
|
var outline_1 = require("@heroicons/react/24/outline");
|
|
@@ -49,22 +85,33 @@ var UploadInput = /** @class */ (function (_super) {
|
|
|
49
85
|
_this.state = {
|
|
50
86
|
error: "",
|
|
51
87
|
};
|
|
52
|
-
_this.
|
|
53
|
-
|
|
54
|
-
if (!_this.props.optional) {
|
|
55
|
-
if (_this.props.file) {
|
|
56
|
-
var fileSize = _this.props.file.size / 1024 / 1024;
|
|
57
|
-
if (fileSize > 10) {
|
|
58
|
-
error = "File size cannot exceed 10MB";
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
error = "Please upload a file";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
_this.setState({ error: error });
|
|
66
|
-
return error ? false : true;
|
|
88
|
+
_this.setAsyncState = function (newState) {
|
|
89
|
+
return new Promise(function (resolve) { return _this.setState(newState, resolve); });
|
|
67
90
|
};
|
|
91
|
+
_this.handleSubmit = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
92
|
+
var error, fileSize;
|
|
93
|
+
return __generator(this, function (_a) {
|
|
94
|
+
switch (_a.label) {
|
|
95
|
+
case 0:
|
|
96
|
+
error = "";
|
|
97
|
+
if (!this.props.optional) {
|
|
98
|
+
if (this.props.file) {
|
|
99
|
+
fileSize = this.props.file.size / 1024 / 1024;
|
|
100
|
+
if (fileSize > 10) {
|
|
101
|
+
error = "File size cannot exceed 10MB";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
error = "Please upload a file";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return [4 /*yield*/, this.setAsyncState({ error: error })];
|
|
109
|
+
case 1:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [2 /*return*/, error ? false : true];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}); };
|
|
68
115
|
_this.handleOnChange = function (e) {
|
|
69
116
|
if (_this.props.onChange) {
|
|
70
117
|
_this.props.onChange(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/uploadInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/input/uploadInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6D;AAC7D,6CAAyC;AACzC,8BAA4B;AAa5B;IAAiC,+BAAgB;IAAjD;QAAA,qEAsFC;QArFC,WAAK,GAAG;YACN,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,mBAAa,GAAG,UAAC,QAAQ;YACvB,OAAA,IAAI,OAAO,CAAC,UAAC,OAAY,IAAK,OAAA,KAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAhC,CAAgC,CAAC;QAA/D,CAA+D,CAAC;QAElE,kBAAY,GAAG;;;;;wBACT,KAAK,GAAG,EAAE,CAAC;wBACf,IAAI,CAAC,IAAI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I,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,qBAAa,IAAK,SAAQ,SAAS,CAAC,KAAK,CAAC;IACxC,cAAc,SAAU,MAAM,YAAY,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/bars/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,oBAAoB,CAAC;AAM5B,UAAU,KAAK;IACb,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EACR,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,MAAM,GACN,QAAQ,GACR,QAAQ,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,qBAAa,IAAK,SAAQ,SAAS,CAAC,KAAK,CAAC;IACxC,cAAc,SAAU,MAAM,YAAY,OAAO,YA8D/C;IAEF,MAAM;CA4BP"}
|
|
@@ -55,13 +55,47 @@ var Bars = /** @class */ (function (_super) {
|
|
|
55
55
|
_this.renderBarColor = function (type, selected) {
|
|
56
56
|
var className = "";
|
|
57
57
|
var color = _this.props.primaryColor;
|
|
58
|
+
var cusColorText = "bg-primary-500";
|
|
59
|
+
var cusColorIcon = "hover:bg-primary-400";
|
|
60
|
+
switch (_this.props.customColor) {
|
|
61
|
+
case "red":
|
|
62
|
+
cusColorText = "bg-red-500";
|
|
63
|
+
cusColorIcon = "hover:bg-red-400";
|
|
64
|
+
break;
|
|
65
|
+
case "orange":
|
|
66
|
+
cusColorText = "bg-orange-500";
|
|
67
|
+
cusColorIcon = "hover:bg-orange-400";
|
|
68
|
+
break;
|
|
69
|
+
case "yellow":
|
|
70
|
+
cusColorText = "bg-yellow-500";
|
|
71
|
+
cusColorIcon = "hover:bg-yellow-400";
|
|
72
|
+
break;
|
|
73
|
+
case "green":
|
|
74
|
+
cusColorText = "bg-green-500";
|
|
75
|
+
cusColorIcon = "hover:bg-green-400";
|
|
76
|
+
break;
|
|
77
|
+
case "blue":
|
|
78
|
+
cusColorText = "bg-blue-500";
|
|
79
|
+
cusColorIcon = "hover:bg-blue-400";
|
|
80
|
+
break;
|
|
81
|
+
case "indigo":
|
|
82
|
+
cusColorText = "bg-indigo-500";
|
|
83
|
+
cusColorIcon = "hover:bg-indigo-400";
|
|
84
|
+
break;
|
|
85
|
+
case "violet":
|
|
86
|
+
cusColorText = "bg-violet-500";
|
|
87
|
+
cusColorIcon = "hover:bg-violet-400";
|
|
88
|
+
break;
|
|
89
|
+
default:
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
58
92
|
if (type === "text") {
|
|
59
93
|
if (selected) {
|
|
60
|
-
className = "".concat(color ? "
|
|
94
|
+
className = "".concat(color ? "".concat(cusColorText, " text-white") : "bg-gray-100 text-gray-900");
|
|
61
95
|
}
|
|
62
96
|
else {
|
|
63
97
|
className = "text-gray-600 ".concat(color
|
|
64
|
-
? "
|
|
98
|
+
? "".concat(cusColorIcon, " hover:text-white")
|
|
65
99
|
: "hover:bg-gray-50 hover:text-gray-900", " ");
|
|
66
100
|
}
|
|
67
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/navigation/bars/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8BAA4B;AAE5B,SAAS,UAAU;IAAC,iBAAU;SAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;QAAV,4BAAU;;IAC5B,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/navigation/bars/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,8BAA4B;AAE5B,SAAS,UAAU;IAAC,iBAAU;SAAV,UAAU,EAAV,qBAAU,EAAV,IAAU;QAAV,4BAAU;;IAC5B,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAiBD;IAA0B,wBAAgB;IAA1C;QAAA,qEA6FC;QA5FC,oBAAc,GAAG,UAAC,IAAY,EAAE,QAAiB;YAC/C,IAAI,SAAS,GAAG,EAAE,CAAC;YACnB,IAAM,KAAK,GAAG,KAAI,CAAC,KAAK,CAAC,YAAY,CAAC;YACtC,IAAI,YAAY,GAAG,gBAAgB,CAAC;YACpC,IAAI,YAAY,GAAG,sBAAsB,CAAC;YAE1C,QAAQ,KAAI,CAAC,KAAK,CAAC,WAAW,EAAE;gBAC9B,KAAK,KAAK;oBACR,YAAY,GAAG,YAAY,CAAC;oBAC5B,YAAY,GAAG,kBAAkB,CAAC;oBAClC,MAAM;gBACR,KAAK,QAAQ;oBACX,YAAY,GAAG,eAAe,CAAC;oBAC/B,YAAY,GAAG,qBAAqB,CAAC;oBACrC,MAAM;gBACR,KAAK,QAAQ;oBACX,YAAY,GAAG,eAAe,CAAC;oBAC/B,YAAY,GAAG,qBAAq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