@digigov/ui 2.0.0-cbc56209 → 2.0.0-fec6f1f7
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/cjs/content/SafeHTML/index.js +5 -8
- package/cjs/form/AutoComplete/AutoComplete.stories/index.js +44 -8
- package/cjs/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
- package/cjs/form/AutoComplete/Status/index.js +12 -5
- package/cjs/form/AutoComplete/__stories__/Multiple/index.js +24 -0
- package/cjs/form/AutoComplete/__stories__/{WithInLine → MultipleShowingTwoSelected}/index.js +7 -6
- package/cjs/form/AutoComplete/__stories__/MultipleWithDefaultValues/index.js +23 -0
- package/cjs/form/AutoComplete/__stories__/MultipleWithMinLength/index.js +26 -0
- package/cjs/form/AutoComplete/__stories__/WithShowAllValues/index.js +0 -1
- package/cjs/form/AutoComplete/index.js +312 -202
- package/cjs/form/AutoComplete/index.mdx +0 -8
- package/cjs/form/AutoComplete/utils/index.js +2 -1
- package/cjs/govgr/Footer/index.mdx +0 -2
- package/cjs/i18n/locales/el/index.js +2 -2
- package/cjs/i18n/locales/en/index.js +2 -2
- package/cjs/lazy/index.js +26 -8
- package/cjs/navigation/Dropdown/Dropdown.stories/index.js +12 -0
- package/cjs/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
- package/cjs/navigation/Dropdown/__stories__/ScrollableContent/index.js +68 -0
- package/content/SafeHTML/index.d.ts +1 -1
- package/content/SafeHTML/index.js +5 -8
- package/form/AutoComplete/AutoComplete.stories/index.js +4 -1
- package/form/AutoComplete/AutoComplete.stories.d.ts +4 -1
- package/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
- package/form/AutoComplete/Status/index.d.ts +4 -2
- package/form/AutoComplete/Status/index.js +11 -4
- package/form/AutoComplete/__stories__/Multiple/index.js +17 -0
- package/form/AutoComplete/__stories__/{WithInLine → Multiple}/package.json +1 -1
- package/form/AutoComplete/__stories__/Multiple.d.ts +3 -0
- package/form/AutoComplete/__stories__/{WithInLine → MultipleShowingTwoSelected}/index.js +6 -5
- package/form/AutoComplete/__stories__/MultipleShowingTwoSelected/package.json +6 -0
- package/form/AutoComplete/__stories__/MultipleShowingTwoSelected.d.ts +3 -0
- package/form/AutoComplete/__stories__/MultipleWithDefaultValues/index.js +16 -0
- package/form/AutoComplete/__stories__/MultipleWithDefaultValues/package.json +6 -0
- package/form/AutoComplete/__stories__/MultipleWithDefaultValues.d.ts +3 -0
- package/form/AutoComplete/__stories__/MultipleWithMinLength/index.js +19 -0
- package/form/AutoComplete/__stories__/MultipleWithMinLength/package.json +6 -0
- package/form/AutoComplete/__stories__/MultipleWithMinLength.d.ts +3 -0
- package/form/AutoComplete/__stories__/WithShowAllValues/index.js +0 -1
- package/form/AutoComplete/index.d.ts +12 -18
- package/form/AutoComplete/index.js +295 -197
- package/form/AutoComplete/index.mdx +0 -8
- package/form/AutoComplete/utils/index.js +2 -1
- package/form/AutoComplete/utils.d.ts +1 -0
- package/govgr/Footer/index.mdx +0 -2
- package/i18n/locales/el/index.js +2 -2
- package/i18n/locales/en/index.js +2 -2
- package/index.js +1 -1
- package/lazy/index.js +22 -8
- package/lazy.d.ts +8 -6
- package/navigation/Dropdown/Dropdown.stories/index.js +1 -0
- package/navigation/Dropdown/Dropdown.stories.d.ts +1 -0
- package/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
- package/navigation/Dropdown/__stories__/ScrollableContent/index.js +61 -0
- package/navigation/Dropdown/__stories__/ScrollableContent/package.json +6 -0
- package/navigation/Dropdown/__stories__/ScrollableContent.d.ts +3 -0
- package/navigation/NavList/types.d.ts +1 -2
- package/package.json +4 -6
- package/src/content/SafeHTML/index.tsx +3 -4
- package/src/form/AutoComplete/AutoComplete.stories.js +4 -1
- package/src/form/AutoComplete/AutoComplete.stories.playwright.json +33 -0
- package/src/form/AutoComplete/Status/index.tsx +10 -6
- package/src/form/AutoComplete/__stories__/Multiple.tsx +18 -0
- package/src/form/AutoComplete/__stories__/{WithInLine.tsx → MultipleShowingTwoSelected.tsx} +3 -8
- package/src/form/AutoComplete/__stories__/MultipleWithDefaultValues.tsx +16 -0
- package/src/form/AutoComplete/__stories__/MultipleWithMinLength.tsx +29 -0
- package/src/form/AutoComplete/__stories__/WithShowAllValues.tsx +0 -1
- package/src/form/AutoComplete/index.mdx +0 -8
- package/src/form/AutoComplete/index.tsx +351 -213
- package/src/form/AutoComplete/utils.ts +3 -2
- package/src/govgr/Footer/index.mdx +0 -2
- package/src/i18n/locales/el.ts +2 -2
- package/src/i18n/locales/en.ts +2 -2
- package/src/lazy.js +4 -2
- package/src/navigation/Dropdown/Dropdown.stories.js +1 -0
- package/src/navigation/Dropdown/Dropdown.stories.playwright.json +16 -0
- package/src/navigation/Dropdown/__stories__/ScrollableContent.tsx +82 -0
- package/src/navigation/NavList/types.tsx +1 -2
- package/form/AutoComplete/__stories__/WithInLine.d.ts +0 -3
|
@@ -20,14 +20,6 @@ through, select from large collections of options and help services get more con
|
|
|
20
20
|
story="WithAutoSelect.tsx"
|
|
21
21
|
/>
|
|
22
22
|
|
|
23
|
-
### AutoComplete with inline style
|
|
24
|
-
|
|
25
|
-
<Story
|
|
26
|
-
packageName="@digigov/ui"
|
|
27
|
-
component="form/AutoComplete"
|
|
28
|
-
story="WithInLine.tsx"
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
23
|
### AutoComplete with default value
|
|
32
24
|
|
|
33
25
|
<Story
|
|
@@ -12,7 +12,8 @@ var keyCodes = exports.keyCodes = {
|
|
|
12
12
|
27: 'escape',
|
|
13
13
|
32: 'space',
|
|
14
14
|
38: 'up',
|
|
15
|
-
40: 'down'
|
|
15
|
+
40: 'down',
|
|
16
|
+
8: 'backspace'
|
|
16
17
|
};
|
|
17
18
|
function isIosDevice() {
|
|
18
19
|
return typeof navigator !== 'undefined' && !!(navigator.userAgent.match(/(iPod|iPhone|iPad)/g) && navigator.userAgent.match(/AppleWebKit/g));
|
|
@@ -18,8 +18,8 @@ var _default = exports["default"] = {
|
|
|
18
18
|
string: 'Το πεδίο πρέπει να είναι string',
|
|
19
19
|
email: 'Συμπληρώστε μια έγκυρη ηλεκτρονική διεύθυνση (e-mail).',
|
|
20
20
|
afm: 'Ο Α.Φ.Μ που πληκτρολογήσατε είναι λανθασμένος.',
|
|
21
|
-
file_size: 'Το μέγεθος του αρχείου είναι μεγαλύτερο απο το
|
|
22
|
-
image_size: 'Το μέγεθος της φωτογραφίας είναι μεγαλύτερο απο το
|
|
21
|
+
file_size: 'Το μέγεθος του αρχείου είναι μεγαλύτερο απο το επιτρεπόμενο ({{maxSizeToMb}}Mb).',
|
|
22
|
+
image_size: 'Το μέγεθος της φωτογραφίας είναι μεγαλύτερο απο το επιτρεπόμενο ({{maxSizeToMb}}Mb).',
|
|
23
23
|
mobile_phone: 'Συμπληρώστε έναν έγκυρο αριθμό κινητού τηλεφώνου.',
|
|
24
24
|
phone_number: 'Συμπληρώστε έναν έγκυρο αριθμό τηλεφώνου.',
|
|
25
25
|
landline: 'Συμπληρώστε έναν έγκυρο αριθμό σταθερού τηλεφώνου.',
|
|
@@ -18,8 +18,8 @@ var _default = exports["default"] = {
|
|
|
18
18
|
string: 'This field must be a string',
|
|
19
19
|
email: 'Please enter a valid email address (e-mail).',
|
|
20
20
|
afm: 'The VAT number you entered is incorrect.',
|
|
21
|
-
file_size: 'File size is larger than allowed.',
|
|
22
|
-
image_size: 'Image size is larger than allowed.',
|
|
21
|
+
file_size: 'File size is larger than allowed ({{maxSizeToMb}}Mb).',
|
|
22
|
+
image_size: 'Image size is larger than allowed ({{maxSizeToMb}}Mb).',
|
|
23
23
|
mobile_phone: 'Fill in a valid mobile phone number.',
|
|
24
24
|
landline: 'Fill in a valid landline phone number.',
|
|
25
25
|
phone_number: 'Fill in a valid phone number.',
|
package/cjs/lazy/index.js
CHANGED
|
@@ -1405,6 +1405,15 @@ var _default = exports["default"] = {
|
|
|
1405
1405
|
};
|
|
1406
1406
|
});
|
|
1407
1407
|
}),
|
|
1408
|
+
'AutoCompleteContainer': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1409
|
+
return Promise.resolve().then(function () {
|
|
1410
|
+
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete'));
|
|
1411
|
+
}).then(function (module) {
|
|
1412
|
+
return {
|
|
1413
|
+
"default": module['AutoCompleteContainer']
|
|
1414
|
+
};
|
|
1415
|
+
});
|
|
1416
|
+
}),
|
|
1408
1417
|
'AutoCompleteInput': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1409
1418
|
return Promise.resolve().then(function () {
|
|
1410
1419
|
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete'));
|
|
@@ -1423,30 +1432,39 @@ var _default = exports["default"] = {
|
|
|
1423
1432
|
};
|
|
1424
1433
|
});
|
|
1425
1434
|
}),
|
|
1426
|
-
'
|
|
1435
|
+
'AutoCompleteMultipleInput': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1427
1436
|
return Promise.resolve().then(function () {
|
|
1428
1437
|
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete'));
|
|
1429
1438
|
}).then(function (module) {
|
|
1430
1439
|
return {
|
|
1431
|
-
"default": module['
|
|
1440
|
+
"default": module['AutoCompleteMultipleInput']
|
|
1432
1441
|
};
|
|
1433
1442
|
});
|
|
1434
1443
|
}),
|
|
1435
|
-
'
|
|
1444
|
+
'AutoCompleteMultipleInputContainer': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1436
1445
|
return Promise.resolve().then(function () {
|
|
1437
1446
|
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete'));
|
|
1438
1447
|
}).then(function (module) {
|
|
1439
1448
|
return {
|
|
1440
|
-
"default": module['
|
|
1449
|
+
"default": module['AutoCompleteMultipleInputContainer']
|
|
1441
1450
|
};
|
|
1442
1451
|
});
|
|
1443
1452
|
}),
|
|
1444
|
-
'
|
|
1453
|
+
'AutoCompleteResultList': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1445
1454
|
return Promise.resolve().then(function () {
|
|
1446
1455
|
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete'));
|
|
1447
1456
|
}).then(function (module) {
|
|
1448
1457
|
return {
|
|
1449
|
-
"default": module['
|
|
1458
|
+
"default": module['AutoCompleteResultList']
|
|
1459
|
+
};
|
|
1460
|
+
});
|
|
1461
|
+
}),
|
|
1462
|
+
'AutoCompleteResultListItem': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1463
|
+
return Promise.resolve().then(function () {
|
|
1464
|
+
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete'));
|
|
1465
|
+
}).then(function (module) {
|
|
1466
|
+
return {
|
|
1467
|
+
"default": module['AutoCompleteResultListItem']
|
|
1450
1468
|
};
|
|
1451
1469
|
});
|
|
1452
1470
|
}),
|
|
@@ -1459,12 +1477,12 @@ var _default = exports["default"] = {
|
|
|
1459
1477
|
};
|
|
1460
1478
|
});
|
|
1461
1479
|
}),
|
|
1462
|
-
'
|
|
1480
|
+
'AutoCompleteStatusContainer': /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1463
1481
|
return Promise.resolve().then(function () {
|
|
1464
1482
|
return _interopRequireWildcard(require('@digigov/ui/form/AutoComplete/Status'));
|
|
1465
1483
|
}).then(function (module) {
|
|
1466
1484
|
return {
|
|
1467
|
-
"default": module['
|
|
1485
|
+
"default": module['AutoCompleteStatusContainer']
|
|
1468
1486
|
};
|
|
1469
1487
|
});
|
|
1470
1488
|
}),
|
|
@@ -115,6 +115,18 @@ Object.keys(_ContentPosition).forEach(function (key) {
|
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
|
+
var _ScrollableContent = require("@digigov/ui/navigation/Dropdown/__stories__/ScrollableContent");
|
|
119
|
+
Object.keys(_ScrollableContent).forEach(function (key) {
|
|
120
|
+
if (key === "default" || key === "__esModule") return;
|
|
121
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
122
|
+
if (key in exports && exports[key] === _ScrollableContent[key]) return;
|
|
123
|
+
Object.defineProperty(exports, key, {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function get() {
|
|
126
|
+
return _ScrollableContent[key];
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
});
|
|
118
130
|
var _Dense = require("@digigov/ui/navigation/Dropdown/__stories__/Dense");
|
|
119
131
|
Object.keys(_Dense).forEach(function (key) {
|
|
120
132
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -64,6 +64,22 @@
|
|
|
64
64
|
"title": "Open dropdown action"
|
|
65
65
|
}
|
|
66
66
|
]
|
|
67
|
+
},
|
|
68
|
+
"digigov-ui-navigation-dropdown--scrollable-content": {
|
|
69
|
+
"actionSets": [
|
|
70
|
+
{
|
|
71
|
+
"actions": [
|
|
72
|
+
{
|
|
73
|
+
"name": "click",
|
|
74
|
+
"args": {
|
|
75
|
+
"selector": "html>body>div:nth-child(5)>details>summary"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"id": "rZUYM--IzpfW",
|
|
80
|
+
"title": "open content"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
67
83
|
}
|
|
68
84
|
}
|
|
69
85
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = exports.ScrollableContent = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Dropdown = require("@digigov/ui/navigation/Dropdown");
|
|
10
|
+
var _NavList = require("@digigov/ui/navigation/NavList");
|
|
11
|
+
var data = [{
|
|
12
|
+
name: 'Item 1',
|
|
13
|
+
href: '#'
|
|
14
|
+
}, {
|
|
15
|
+
name: 'Item 2',
|
|
16
|
+
href: '#'
|
|
17
|
+
}, {
|
|
18
|
+
name: 'Item 3',
|
|
19
|
+
href: '#'
|
|
20
|
+
}, {
|
|
21
|
+
name: 'Item 4',
|
|
22
|
+
href: '#'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'Item 5',
|
|
25
|
+
href: '#'
|
|
26
|
+
}, {
|
|
27
|
+
name: 'Item 6',
|
|
28
|
+
href: '#'
|
|
29
|
+
}, {
|
|
30
|
+
name: 'Item 7',
|
|
31
|
+
href: '#'
|
|
32
|
+
}, {
|
|
33
|
+
name: 'Item 8',
|
|
34
|
+
href: '#'
|
|
35
|
+
}, {
|
|
36
|
+
name: 'Item 9',
|
|
37
|
+
href: '#'
|
|
38
|
+
}, {
|
|
39
|
+
name: 'Item 10',
|
|
40
|
+
href: '#'
|
|
41
|
+
}, {
|
|
42
|
+
name: 'Item 11',
|
|
43
|
+
href: '#'
|
|
44
|
+
}, {
|
|
45
|
+
name: 'Item 12',
|
|
46
|
+
href: '#'
|
|
47
|
+
}];
|
|
48
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_Dropdown.DropdownButton, {
|
|
49
|
+
role: "button",
|
|
50
|
+
"aria-haspopup": "true",
|
|
51
|
+
"aria-controls": "menu2",
|
|
52
|
+
arrow: true
|
|
53
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2");
|
|
54
|
+
var ScrollableContent = exports.ScrollableContent = function ScrollableContent() {
|
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, null, _ref, /*#__PURE__*/_react["default"].createElement(_Dropdown.DropdownContent, {
|
|
56
|
+
role: "menu",
|
|
57
|
+
id: "menu2",
|
|
58
|
+
scrollable: true
|
|
59
|
+
}, /*#__PURE__*/_react["default"].createElement(_NavList.NavList, {
|
|
60
|
+
layout: "vertical"
|
|
61
|
+
}, data.map(function (item) {
|
|
62
|
+
return /*#__PURE__*/_react["default"].createElement(_NavList.NavListItemAction, {
|
|
63
|
+
role: "menuitem",
|
|
64
|
+
href: item.href
|
|
65
|
+
}, item.name);
|
|
66
|
+
}))));
|
|
67
|
+
};
|
|
68
|
+
var _default = exports["default"] = ScrollableContent;
|
|
@@ -6,5 +6,5 @@ export interface SafeHTMLProps {
|
|
|
6
6
|
Tag?: string;
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
8
|
}
|
|
9
|
-
export declare const SafeHTML: ({ content, tags, Tag,
|
|
9
|
+
export declare const SafeHTML: ({ content, tags, Tag, ...props }: SafeHTMLProps) => JSX.Element;
|
|
10
10
|
export default SafeHTML;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["content", "tags", "Tag"];
|
|
2
4
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
3
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
6
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -66,8 +68,7 @@ export var SafeHTML = function SafeHTML(_ref) {
|
|
|
66
68
|
tags = _ref.tags,
|
|
67
69
|
_ref$Tag = _ref.Tag,
|
|
68
70
|
Tag = _ref$Tag === void 0 ? 'span' : _ref$Tag,
|
|
69
|
-
|
|
70
|
-
style = _ref$style === void 0 ? {} : _ref$style;
|
|
71
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
71
72
|
if (tags) {
|
|
72
73
|
var _tags;
|
|
73
74
|
(_tags = tags).push.apply(_tags, defaultTags);
|
|
@@ -82,14 +83,10 @@ export var SafeHTML = function SafeHTML(_ref) {
|
|
|
82
83
|
}, [content]);
|
|
83
84
|
return /*#__PURE__*/React.createElement(Tag
|
|
84
85
|
// @ts-ignore
|
|
85
|
-
, {
|
|
86
|
-
style: _extends({
|
|
87
|
-
whiteSpace: 'break-spaces'
|
|
88
|
-
}, style),
|
|
89
|
-
className: "ds-body",
|
|
86
|
+
, _extends({
|
|
90
87
|
dangerouslySetInnerHTML: {
|
|
91
88
|
__html: parsedHTML
|
|
92
89
|
}
|
|
93
|
-
});
|
|
90
|
+
}, props));
|
|
94
91
|
};
|
|
95
92
|
export default SafeHTML;
|
|
@@ -5,8 +5,11 @@ export default {
|
|
|
5
5
|
displayName: 'AutoComplete'
|
|
6
6
|
};
|
|
7
7
|
export * from '@digigov/ui/form/AutoComplete/__stories__/Default';
|
|
8
|
+
export * from '@digigov/ui/form/AutoComplete/__stories__/Multiple';
|
|
9
|
+
export * from '@digigov/ui/form/AutoComplete/__stories__/MultipleWithDefaultValues';
|
|
10
|
+
export * from '@digigov/ui/form/AutoComplete/__stories__/MultipleShowingTwoSelected';
|
|
11
|
+
export * from '@digigov/ui/form/AutoComplete/__stories__/MultipleWithMinLength';
|
|
8
12
|
export * from '@digigov/ui/form/AutoComplete/__stories__/WithAutoSelect';
|
|
9
|
-
export * from '@digigov/ui/form/AutoComplete/__stories__/WithInLine';
|
|
10
13
|
export * from '@digigov/ui/form/AutoComplete/__stories__/WithDefaultValue';
|
|
11
14
|
export * from '@digigov/ui/form/AutoComplete/__stories__/WithPlaceHolder';
|
|
12
15
|
export * from '@digigov/ui/form/AutoComplete/__stories__/WithShowAllValues';
|
|
@@ -5,8 +5,11 @@ declare namespace _default {
|
|
|
5
5
|
}
|
|
6
6
|
export default _default;
|
|
7
7
|
export * from "@digigov/ui/form/AutoComplete/__stories__/Default";
|
|
8
|
+
export * from "@digigov/ui/form/AutoComplete/__stories__/Multiple";
|
|
9
|
+
export * from "@digigov/ui/form/AutoComplete/__stories__/MultipleWithDefaultValues";
|
|
10
|
+
export * from "@digigov/ui/form/AutoComplete/__stories__/MultipleShowingTwoSelected";
|
|
11
|
+
export * from "@digigov/ui/form/AutoComplete/__stories__/MultipleWithMinLength";
|
|
8
12
|
export * from "@digigov/ui/form/AutoComplete/__stories__/WithAutoSelect";
|
|
9
|
-
export * from "@digigov/ui/form/AutoComplete/__stories__/WithInLine";
|
|
10
13
|
export * from "@digigov/ui/form/AutoComplete/__stories__/WithDefaultValue";
|
|
11
14
|
export * from "@digigov/ui/form/AutoComplete/__stories__/WithPlaceHolder";
|
|
12
15
|
export * from "@digigov/ui/form/AutoComplete/__stories__/WithShowAllValues";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "4",
|
|
3
|
+
"stories": {
|
|
4
|
+
"digigov-ui-form-autocomplete--multiple": {
|
|
5
|
+
"actionSets": [
|
|
6
|
+
{
|
|
7
|
+
"actions": [
|
|
8
|
+
{
|
|
9
|
+
"name": "click",
|
|
10
|
+
"args": {
|
|
11
|
+
"selector": "html>body>div:nth-child(5)>div>div>fieldset>div>div:nth-child(2)>button"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "click",
|
|
16
|
+
"args": {
|
|
17
|
+
"selector": "html>body>div:nth-child(5)>div>div>fieldset>div>div:nth-child(2)>ul:nth-child(4)>div>li:nth-child(3)"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "click",
|
|
22
|
+
"args": {
|
|
23
|
+
"selector": "html>body>div:nth-child(5)>div>div>fieldset>div>div:nth-child(2)>button"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"id": "SP0dXbHKOZl7",
|
|
28
|
+
"title": "show chip"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import AutoCompleteStatus from '@digigov/react-core/AutoCompleteStatus';
|
|
3
|
-
import
|
|
3
|
+
import AutoCompleteStatusContainer from '@digigov/react-core/AutoCompleteStatusContainer';
|
|
4
4
|
type StatusProps = {
|
|
5
5
|
id: string;
|
|
6
6
|
length: number;
|
|
@@ -33,8 +33,10 @@ export default class Status extends Component<StatusProps, StateProps> {
|
|
|
33
33
|
silenced: boolean;
|
|
34
34
|
};
|
|
35
35
|
debounceStatusUpdate: () => void;
|
|
36
|
+
lastDebounceCall: any;
|
|
37
|
+
componentWillUnmount(): void;
|
|
36
38
|
UNSAFE_componentWillMount(): void;
|
|
37
39
|
UNSAFE_componentWillReceiveProps(): void;
|
|
38
40
|
render(): JSX.Element;
|
|
39
41
|
}
|
|
40
|
-
export {
|
|
42
|
+
export { AutoCompleteStatusContainer, AutoCompleteStatus };
|
|
@@ -7,7 +7,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React, { Component } from 'react';
|
|
9
9
|
import AutoCompleteStatus from '@digigov/react-core/AutoCompleteStatus';
|
|
10
|
-
import
|
|
10
|
+
import AutoCompleteStatusContainer from '@digigov/react-core/AutoCompleteStatusContainer';
|
|
11
11
|
var debounce = function debounce(func, wait, immediate) {
|
|
12
12
|
var timeout;
|
|
13
13
|
return function () {
|
|
@@ -26,6 +26,7 @@ var debounce = function debounce(func, wait, immediate) {
|
|
|
26
26
|
clearTimeout(timeout);
|
|
27
27
|
timeout = setTimeout(later, wait);
|
|
28
28
|
if (callNow) func.apply(context, args);
|
|
29
|
+
return timeout;
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
var statusDebounceMillis = 1400;
|
|
@@ -44,9 +45,15 @@ var Status = /*#__PURE__*/function (_Component) {
|
|
|
44
45
|
silenced: false
|
|
45
46
|
};
|
|
46
47
|
_this.debounceStatusUpdate = void 0;
|
|
48
|
+
_this.lastDebounceCall = void 0;
|
|
47
49
|
return _this;
|
|
48
50
|
}
|
|
49
51
|
_createClass(Status, [{
|
|
52
|
+
key: "componentWillUnmount",
|
|
53
|
+
value: function componentWillUnmount() {
|
|
54
|
+
clearTimeout(this.lastDebounceCall);
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
50
57
|
key: "UNSAFE_componentWillMount",
|
|
51
58
|
value: function UNSAFE_componentWillMount() {
|
|
52
59
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -101,8 +108,8 @@ var Status = /*#__PURE__*/function (_Component) {
|
|
|
101
108
|
} else {
|
|
102
109
|
content = tResults === null || tResults === void 0 ? void 0 : tResults(length, contentSelectedOption);
|
|
103
110
|
}
|
|
104
|
-
this.debounceStatusUpdate();
|
|
105
|
-
return /*#__PURE__*/React.createElement(
|
|
111
|
+
this.lastDebounceCall = this.debounceStatusUpdate();
|
|
112
|
+
return /*#__PURE__*/React.createElement(AutoCompleteStatusContainer, null, /*#__PURE__*/React.createElement(AutoCompleteStatus, {
|
|
106
113
|
id: id + '__status--A'
|
|
107
114
|
}, !silenced && debounced && bump ? content : ' '), /*#__PURE__*/React.createElement(AutoCompleteStatus, {
|
|
108
115
|
id: id + '__status--B'
|
|
@@ -130,4 +137,4 @@ Status.defaultProps = {
|
|
|
130
137
|
}
|
|
131
138
|
};
|
|
132
139
|
export { Status as default };
|
|
133
|
-
export {
|
|
140
|
+
export { AutoCompleteStatusContainer, AutoCompleteStatus };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoComplete } from '@digigov/ui/form/AutoComplete';
|
|
3
|
+
import { suggest } from '@digigov/ui/form/AutoComplete/utils';
|
|
4
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
5
|
+
import { FieldContainer, Fieldset } from '@digigov/ui/form/FieldContainer';
|
|
6
|
+
var _ref = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(Fieldset, {
|
|
7
|
+
marginBottom: 4
|
|
8
|
+
}, /*#__PURE__*/React.createElement(AutoComplete, {
|
|
9
|
+
source: suggest,
|
|
10
|
+
multiple: true,
|
|
11
|
+
width: "50%",
|
|
12
|
+
id: "multiple-select-default"
|
|
13
|
+
}))), /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE"));
|
|
14
|
+
export var Multiple = function Multiple() {
|
|
15
|
+
return _ref;
|
|
16
|
+
};
|
|
17
|
+
export default Multiple;
|
|
@@ -5,11 +5,12 @@ import { Button } from '@digigov/ui/form/Button';
|
|
|
5
5
|
import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
6
6
|
var _ref = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(AutoComplete, {
|
|
7
7
|
source: suggest,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
id: "
|
|
8
|
+
multiple: true,
|
|
9
|
+
width: "75%",
|
|
10
|
+
id: "multiple-showing-two-selected",
|
|
11
|
+
numberOfSelected: 2
|
|
11
12
|
})), /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE"));
|
|
12
|
-
export var
|
|
13
|
+
export var MultipleShowingTwoSelected = function MultipleShowingTwoSelected() {
|
|
13
14
|
return _ref;
|
|
14
15
|
};
|
|
15
|
-
export default
|
|
16
|
+
export default MultipleShowingTwoSelected;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoComplete } from '@digigov/ui/form/AutoComplete';
|
|
3
|
+
import { suggest } from '@digigov/ui/form/AutoComplete/utils';
|
|
4
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
5
|
+
import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
6
|
+
var _ref = /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE");
|
|
7
|
+
export var MultipleWithDefaultValues = function MultipleWithDefaultValues() {
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(AutoComplete, {
|
|
9
|
+
source: suggest,
|
|
10
|
+
multiple: true,
|
|
11
|
+
defaultValue: ['Ελλάδα', 'Ιταλία'],
|
|
12
|
+
width: "50%",
|
|
13
|
+
id: "govgr"
|
|
14
|
+
})), _ref);
|
|
15
|
+
};
|
|
16
|
+
export default MultipleWithDefaultValues;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoComplete } from '@digigov/ui/form/AutoComplete';
|
|
3
|
+
import { suggest } from '@digigov/ui/form/AutoComplete/utils';
|
|
4
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
5
|
+
import { FieldContainer, Fieldset } from '@digigov/ui/form/FieldContainer';
|
|
6
|
+
import Paragraph from '@digigov/ui/typography/Paragraph';
|
|
7
|
+
var _ref = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Paragraph, null, "\u0395\u03B4\u03CE, \u03BF \u03B5\u03BB\u03AC\u03C7\u03B9\u03C3\u03C4\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 \u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03C9\u03BD \u03C0\u03BF\u03C5 \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03B9\u03C3\u03B1\u03C7\u03B8\u03B5\u03AF \u03CE\u03C3\u03C4\u03B5 \u03BD\u03B1 \u03B1\u03C1\u03C7\u03AF\u03C3\u03B5\u03B9 \u03BD\u03B1 \u03C6\u03B9\u03BB\u03C4\u03C1\u03AC\u03C1\u03B5\u03C4\u03B1\u03B9 \u03B7 \u03B1\u03BD\u03B1\u03B6\u03AE\u03C4\u03B7\u03C3\u03B7 \u03B5\u03AF\u03BD\u03B1\u03B9 2."), /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(Fieldset, {
|
|
8
|
+
marginBottom: 4
|
|
9
|
+
}, /*#__PURE__*/React.createElement(AutoComplete, {
|
|
10
|
+
source: suggest,
|
|
11
|
+
multiple: true,
|
|
12
|
+
minLength: 2,
|
|
13
|
+
width: "50%",
|
|
14
|
+
id: "multiple-select-default"
|
|
15
|
+
}))), /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE"));
|
|
16
|
+
export var MultipleWithMinLength = function MultipleWithMinLength() {
|
|
17
|
+
return _ref;
|
|
18
|
+
};
|
|
19
|
+
export default MultipleWithMinLength;
|
|
@@ -6,7 +6,6 @@ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
|
6
6
|
var _ref = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(AutoComplete, {
|
|
7
7
|
source: suggest,
|
|
8
8
|
autoselect: true,
|
|
9
|
-
showAllValues: true,
|
|
10
9
|
id: "govgr"
|
|
11
10
|
})), /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE"));
|
|
12
11
|
export var WithShowAllValues = function WithShowAllValues() {
|