empower-container 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/inputs/Select.js +5 -4
- package/dist/esm/inputs/Select.js +5 -4
- package/package.json +1 -1
- package/src/main/MenuBar.js +1 -1
- package/src/main/index.d.ts +3 -0
- package/src/main/index.js +10 -0
- package/src/main/inputs/Select.js +6 -5
- package/src/main/inputs/Select.tsx +3 -2
- package/src/sample/TestMenuBar.js +2 -2
@@ -306,6 +306,7 @@ var Dropdown = function (_a) {
|
|
306
306
|
}
|
307
307
|
}
|
308
308
|
function handleKeyPress(event) {
|
309
|
+
var updatedKey;
|
309
310
|
if (Boolean(dropdownPopover)) {
|
310
311
|
if (optionsArray && optionsArray.constructor === Array && optionsArray.length > 0) {
|
311
312
|
if (event.key === 'ArrowDown') {
|
@@ -313,7 +314,7 @@ var Dropdown = function (_a) {
|
|
313
314
|
setKeyOption(0);
|
314
315
|
}
|
315
316
|
else {
|
316
|
-
|
317
|
+
updatedKey = (keyOption + 1) >= optionsArray.length ? (optionsArray.length - 1) : keyOption + 1;
|
317
318
|
setKeyOption(updatedKey);
|
318
319
|
}
|
319
320
|
}
|
@@ -322,7 +323,7 @@ var Dropdown = function (_a) {
|
|
322
323
|
setKeyOption(0);
|
323
324
|
}
|
324
325
|
else {
|
325
|
-
|
326
|
+
updatedKey = keyOption > 0 ? (keyOption - 1) : 0;
|
326
327
|
setKeyOption(updatedKey);
|
327
328
|
}
|
328
329
|
}
|
@@ -362,8 +363,8 @@ var Dropdown = function (_a) {
|
|
362
363
|
}
|
363
364
|
else {
|
364
365
|
if (objectKeyOption > 0) {
|
365
|
-
var
|
366
|
-
setKeyOption(
|
366
|
+
var updatedKey_1 = optionsArray[optionsKeyArray[objectKeyOption - 1]].options.length - 1;
|
367
|
+
setKeyOption(updatedKey_1);
|
367
368
|
setObjectKeyOption(objectKeyOption - 1);
|
368
369
|
}
|
369
370
|
}
|
@@ -302,6 +302,7 @@ var Dropdown = function (_a) {
|
|
302
302
|
}
|
303
303
|
}
|
304
304
|
function handleKeyPress(event) {
|
305
|
+
var updatedKey;
|
305
306
|
if (Boolean(dropdownPopover)) {
|
306
307
|
if (optionsArray && optionsArray.constructor === Array && optionsArray.length > 0) {
|
307
308
|
if (event.key === 'ArrowDown') {
|
@@ -309,7 +310,7 @@ var Dropdown = function (_a) {
|
|
309
310
|
setKeyOption(0);
|
310
311
|
}
|
311
312
|
else {
|
312
|
-
|
313
|
+
updatedKey = (keyOption + 1) >= optionsArray.length ? (optionsArray.length - 1) : keyOption + 1;
|
313
314
|
setKeyOption(updatedKey);
|
314
315
|
}
|
315
316
|
}
|
@@ -318,7 +319,7 @@ var Dropdown = function (_a) {
|
|
318
319
|
setKeyOption(0);
|
319
320
|
}
|
320
321
|
else {
|
321
|
-
|
322
|
+
updatedKey = keyOption > 0 ? (keyOption - 1) : 0;
|
322
323
|
setKeyOption(updatedKey);
|
323
324
|
}
|
324
325
|
}
|
@@ -358,8 +359,8 @@ var Dropdown = function (_a) {
|
|
358
359
|
}
|
359
360
|
else {
|
360
361
|
if (objectKeyOption > 0) {
|
361
|
-
var
|
362
|
-
setKeyOption(
|
362
|
+
var updatedKey_1 = optionsArray[optionsKeyArray[objectKeyOption - 1]].options.length - 1;
|
363
|
+
setKeyOption(updatedKey_1);
|
363
364
|
setObjectKeyOption(objectKeyOption - 1);
|
364
365
|
}
|
365
366
|
}
|
package/package.json
CHANGED
package/src/main/MenuBar.js
CHANGED
@@ -52,7 +52,7 @@ var react_1 = __importStar(require("react"));
|
|
52
52
|
require("../scss/style.scss");
|
53
53
|
require("../scss/library/menubar.scss");
|
54
54
|
// Imports
|
55
|
-
var Asset_1 = require("
|
55
|
+
var Asset_1 = require("./assets/Asset");
|
56
56
|
var Constant_1 = require("./constants/Constant");
|
57
57
|
var Information_1 = __importDefault(require("./Information"));
|
58
58
|
var InputSelectionHandler_1 = __importDefault(require("./inputs/InputSelectionHandler"));
|
@@ -0,0 +1,10 @@
|
|
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.Modal = exports.MenuBar = void 0;
|
7
|
+
var MenuBar_1 = __importDefault(require("./MenuBar"));
|
8
|
+
exports.MenuBar = MenuBar_1.default;
|
9
|
+
var Modal_1 = __importDefault(require("./Modal"));
|
10
|
+
exports.Modal = Modal_1.default;
|
@@ -48,7 +48,7 @@ var react_1 = __importStar(require("react"));
|
|
48
48
|
require("../../scss/style.scss");
|
49
49
|
require("../../scss/library/select.scss");
|
50
50
|
// Imports
|
51
|
-
var Asset_1 = require("
|
51
|
+
var Asset_1 = require("../assets/Asset");
|
52
52
|
var Popover = function (_a) {
|
53
53
|
var open = _a.open, origin = _a.origin, children = _a.children, onClick = _a.onClick;
|
54
54
|
return (react_1.default.createElement(react_1.Fragment, null, open &&
|
@@ -330,6 +330,7 @@ var Dropdown = function (_a) {
|
|
330
330
|
}
|
331
331
|
}
|
332
332
|
function handleKeyPress(event) {
|
333
|
+
var updatedKey;
|
333
334
|
if (Boolean(dropdownPopover)) {
|
334
335
|
if (optionsArray && optionsArray.constructor === Array && optionsArray.length > 0) {
|
335
336
|
if (event.key === 'ArrowDown') {
|
@@ -337,7 +338,7 @@ var Dropdown = function (_a) {
|
|
337
338
|
setKeyOption(0);
|
338
339
|
}
|
339
340
|
else {
|
340
|
-
|
341
|
+
updatedKey = (keyOption + 1) >= optionsArray.length ? (optionsArray.length - 1) : keyOption + 1;
|
341
342
|
setKeyOption(updatedKey);
|
342
343
|
}
|
343
344
|
}
|
@@ -346,7 +347,7 @@ var Dropdown = function (_a) {
|
|
346
347
|
setKeyOption(0);
|
347
348
|
}
|
348
349
|
else {
|
349
|
-
|
350
|
+
updatedKey = keyOption > 0 ? (keyOption - 1) : 0;
|
350
351
|
setKeyOption(updatedKey);
|
351
352
|
}
|
352
353
|
}
|
@@ -386,8 +387,8 @@ var Dropdown = function (_a) {
|
|
386
387
|
}
|
387
388
|
else {
|
388
389
|
if (objectKeyOption > 0) {
|
389
|
-
var
|
390
|
-
setKeyOption(
|
390
|
+
var updatedKey_1 = optionsArray[optionsKeyArray[objectKeyOption - 1]].options.length - 1;
|
391
|
+
setKeyOption(updatedKey_1);
|
391
392
|
setObjectKeyOption(objectKeyOption - 1);
|
392
393
|
}
|
393
394
|
}
|
@@ -364,20 +364,21 @@ const Dropdown: React.FC<IPropsDropDown> = ({ config, customClass, onChanged, is
|
|
364
364
|
|
365
365
|
|
366
366
|
function handleKeyPress(event: React.KeyboardEvent<HTMLInputElement>) {
|
367
|
+
let updatedKey:any;
|
367
368
|
if (Boolean(dropdownPopover)) {
|
368
369
|
if (optionsArray && optionsArray.constructor === Array && optionsArray.length > 0) {
|
369
370
|
if (event.key === 'ArrowDown') {
|
370
371
|
if (keyOption === null) {
|
371
372
|
setKeyOption(0);
|
372
373
|
} else {
|
373
|
-
|
374
|
+
updatedKey = (keyOption + 1) >= optionsArray.length ? (optionsArray.length - 1) : keyOption + 1;
|
374
375
|
setKeyOption(updatedKey);
|
375
376
|
}
|
376
377
|
} else if (event.key === 'ArrowUp') {
|
377
378
|
if (keyOption === null) {
|
378
379
|
setKeyOption(0);
|
379
380
|
} else {
|
380
|
-
|
381
|
+
updatedKey = keyOption > 0 ? (keyOption - 1) : 0;
|
381
382
|
setKeyOption(updatedKey);
|
382
383
|
}
|
383
384
|
} else if (event.key === 'Enter') {
|
@@ -35,8 +35,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
35
|
};
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
37
37
|
var react_1 = __importStar(require("react"));
|
38
|
-
var main_1 = require("../main
|
39
|
-
var Asset_1 = require("../assets/Asset");
|
38
|
+
var main_1 = require("../main");
|
39
|
+
var Asset_1 = require("../main/assets/Asset");
|
40
40
|
var TestMenuBar = function () {
|
41
41
|
var MENUBAR = {
|
42
42
|
dropdown: {
|