@aurodesignsystem/auro-formkit 5.9.1 → 5.9.2
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/CHANGELOG.md +16 -4
- package/components/checkbox/README.md +62 -62
- package/components/checkbox/demo/api.js +1 -1
- package/components/checkbox/demo/api.md +127 -84
- package/components/checkbox/demo/api.min.js +125 -42
- package/components/checkbox/demo/index.md +9 -281
- package/components/checkbox/demo/index.min.js +125 -42
- package/components/checkbox/demo/readme.html +3 -4
- package/components/checkbox/demo/readme.md +62 -62
- package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
- package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
- package/components/checkbox/dist/index.js +125 -42
- package/components/checkbox/dist/registered.js +125 -42
- package/components/combobox/README.md +76 -74
- package/components/combobox/demo/api.html +1 -0
- package/components/combobox/demo/api.js +11 -12
- package/components/combobox/demo/api.md +1302 -875
- package/components/combobox/demo/api.min.js +348 -420
- package/components/combobox/demo/index.html +1 -7
- package/components/combobox/demo/index.js +0 -19
- package/components/combobox/demo/index.md +43 -723
- package/components/combobox/demo/index.min.js +301 -230
- package/components/combobox/demo/readme.html +3 -4
- package/components/combobox/demo/readme.md +76 -74
- package/components/combobox/dist/auro-combobox.d.ts +39 -40
- package/components/combobox/dist/index.js +159 -143
- package/components/combobox/dist/registered.js +159 -143
- package/components/counter/README.md +81 -66
- package/components/counter/demo/api.html +1 -2
- package/components/counter/demo/api.js +2 -2
- package/components/counter/demo/api.md +777 -259
- package/components/counter/demo/api.min.js +84 -112
- package/components/counter/demo/index.html +0 -2
- package/components/counter/demo/index.md +20 -329
- package/components/counter/demo/index.min.js +82 -93
- package/components/counter/demo/readme.html +3 -4
- package/components/counter/demo/readme.md +81 -66
- package/components/counter/dist/auro-counter-group.d.ts +21 -36
- package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
- package/components/counter/dist/auro-counter.d.ts +5 -8
- package/components/counter/dist/index.js +82 -93
- package/components/counter/dist/registered.js +82 -93
- package/components/datepicker/README.md +57 -61
- package/components/datepicker/demo/api.js +8 -8
- package/components/datepicker/demo/api.md +720 -561
- package/components/datepicker/demo/api.min.js +427 -2424
- package/components/datepicker/demo/index.md +65 -117
- package/components/datepicker/demo/index.min.js +427 -2424
- package/components/datepicker/demo/readme.html +3 -4
- package/components/datepicker/demo/readme.md +57 -61
- package/components/datepicker/dist/auro-calendar.d.ts +60 -34
- package/components/datepicker/dist/auro-datepicker.d.ts +31 -31
- package/components/datepicker/dist/index.js +256 -2253
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +256 -2253
- package/components/dropdown/README.md +78 -62
- package/components/dropdown/demo/api.js +4 -4
- package/components/dropdown/demo/api.md +520 -478
- package/components/dropdown/demo/api.min.js +48 -39
- package/components/dropdown/demo/index.md +65 -119
- package/components/dropdown/demo/index.min.js +38 -29
- package/components/dropdown/demo/readme.html +3 -4
- package/components/dropdown/demo/readme.md +78 -62
- package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
- package/components/dropdown/dist/index.js +38 -29
- package/components/dropdown/dist/registered.js +38 -29
- package/components/form/README.md +16 -58
- package/components/form/demo/api.md +16 -21
- package/components/form/demo/api.min.js +13 -8
- package/components/form/demo/index.md +38 -39
- package/components/form/demo/index.min.js +13 -8
- package/components/form/demo/readme.md +16 -58
- package/components/form/dist/auro-form.d.ts +15 -3
- package/components/form/dist/index.js +13 -8
- package/components/form/dist/registered.js +13 -8
- package/components/input/README.md +55 -60
- package/components/input/demo/api.js +3 -5
- package/components/input/demo/api.md +558 -537
- package/components/input/demo/api.min.js +100 -113
- package/components/input/demo/index.js +0 -1
- package/components/input/demo/index.md +90 -203
- package/components/input/demo/index.min.js +85 -97
- package/components/input/demo/readme.html +3 -4
- package/components/input/demo/readme.md +55 -60
- package/components/input/dist/auro-input.d.ts +6 -5
- package/components/input/dist/base-input.d.ts +67 -68
- package/components/input/dist/index.js +85 -80
- package/components/input/dist/registered.js +85 -80
- package/components/menu/README.md +61 -61
- package/components/menu/demo/api.js +6 -8
- package/components/menu/demo/api.md +520 -572
- package/components/menu/demo/api.min.js +176 -92
- package/components/menu/demo/index.js +0 -5
- package/components/menu/demo/index.md +36 -119
- package/components/menu/demo/index.min.js +141 -96
- package/components/menu/demo/readme.html +3 -4
- package/components/menu/demo/readme.md +61 -61
- package/components/menu/dist/auro-menu.d.ts +70 -37
- package/components/menu/dist/auro-menuoption.d.ts +36 -11
- package/components/menu/dist/index.js +141 -45
- package/components/menu/dist/registered.js +141 -45
- package/components/radio/README.md +61 -57
- package/components/radio/demo/api.js +2 -2
- package/components/radio/demo/api.md +241 -170
- package/components/radio/demo/api.min.js +154 -77
- package/components/radio/demo/index.md +22 -99
- package/components/radio/demo/index.min.js +145 -68
- package/components/radio/demo/readme.html +3 -4
- package/components/radio/demo/readme.md +61 -57
- package/components/radio/dist/auro-radio-group.d.ts +67 -35
- package/components/radio/dist/auro-radio.d.ts +56 -33
- package/components/radio/dist/index.js +145 -68
- package/components/radio/dist/registered.js +145 -68
- package/components/select/README.md +68 -65
- package/components/select/demo/api.html +1 -0
- package/components/select/demo/api.js +7 -7
- package/components/select/demo/api.md +1305 -625
- package/components/select/demo/api.min.js +300 -199
- package/components/select/demo/index.html +0 -2
- package/components/select/demo/index.md +25 -833
- package/components/select/demo/index.min.js +299 -167
- package/components/select/demo/readme.html +3 -4
- package/components/select/demo/readme.md +68 -65
- package/components/select/dist/auro-select.d.ts +99 -90
- package/components/select/dist/index.js +158 -122
- package/components/select/dist/registered.js +158 -122
- package/package.json +3 -3
|
@@ -377,12 +377,9 @@ function dispatchMenuEvent(element, eventName, detail = null) {
|
|
|
377
377
|
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
|
-
* The auro-
|
|
380
|
+
* The `auro-menuoption` element provides users a way to define a menu option.
|
|
381
|
+
* @customElement auro-menuoption
|
|
381
382
|
*
|
|
382
|
-
* @attr {String} value - Specifies the value to be sent to a server.
|
|
383
|
-
* @attr {String} noCheckmark - When true, selected option will not show the checkmark.
|
|
384
|
-
* @attr {Boolean} disabled - When true specifies that the menuoption is disabled.
|
|
385
|
-
* @attr {Boolean} selected - Specifies that an option is selected.
|
|
386
383
|
* @event auroMenuOption-mouseover - Notifies that this option has been hovered over.
|
|
387
384
|
* @slot - Specifies text for an option, but is not the value.
|
|
388
385
|
*/
|
|
@@ -390,7 +387,7 @@ class AuroMenuOption extends AuroElement {
|
|
|
390
387
|
|
|
391
388
|
/**
|
|
392
389
|
* This will register this element with the browser.
|
|
393
|
-
* @param {string} [name="auro-menuoption"] - The name of element that you want to register
|
|
390
|
+
* @param {string} [name="auro-menuoption"] - The name of the element that you want to register.
|
|
394
391
|
*
|
|
395
392
|
* @example
|
|
396
393
|
* AuroMenuOption.register("custom-menuoption") // this will register this element to <custom-menuoption/>
|
|
@@ -454,38 +451,81 @@ class AuroMenuOption extends AuroElement {
|
|
|
454
451
|
static get properties() {
|
|
455
452
|
return {
|
|
456
453
|
...super.properties,
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* When true, disables the menu option.
|
|
457
|
+
*/
|
|
457
458
|
disabled: {
|
|
458
459
|
type: Boolean,
|
|
459
460
|
reflect: true
|
|
460
461
|
},
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @private
|
|
465
|
+
*/
|
|
461
466
|
event: {
|
|
462
467
|
type: String,
|
|
463
468
|
reflect: true
|
|
464
469
|
},
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @private
|
|
473
|
+
*/
|
|
474
|
+
layout: {
|
|
475
|
+
type: String
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Allows users to set a unique key for the menu option for specified option selection. If no key is provided, the value property will be used.
|
|
480
|
+
*/
|
|
465
481
|
key: {
|
|
466
482
|
type: String,
|
|
467
483
|
reflect: true
|
|
468
484
|
},
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* @private
|
|
488
|
+
*/
|
|
469
489
|
menuService: {
|
|
470
490
|
type: Object,
|
|
471
491
|
state: true
|
|
472
492
|
},
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* @private
|
|
496
|
+
*/
|
|
473
497
|
matchWord: {
|
|
474
498
|
type: String,
|
|
475
499
|
state: true
|
|
476
500
|
},
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* @private
|
|
504
|
+
*/
|
|
477
505
|
noCheckmark: {
|
|
478
506
|
type: Boolean,
|
|
479
507
|
reflect: true
|
|
480
508
|
},
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Specifies that an option is selected.
|
|
512
|
+
*/
|
|
481
513
|
selected: {
|
|
482
514
|
type: Boolean,
|
|
483
515
|
reflect: true
|
|
484
516
|
},
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Specifies the tab index of the menu option.
|
|
520
|
+
*/
|
|
485
521
|
tabIndex: {
|
|
486
522
|
type: Number,
|
|
487
523
|
reflect: true
|
|
488
524
|
},
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Specifies the value to be sent to a server.
|
|
528
|
+
*/
|
|
489
529
|
value: {
|
|
490
530
|
type: String,
|
|
491
531
|
reflect: true
|
|
@@ -1436,19 +1476,9 @@ const MenuContext = n$1('menu-context');
|
|
|
1436
1476
|
|
|
1437
1477
|
|
|
1438
1478
|
/**
|
|
1439
|
-
* The auro-menu element provides users a way to select from a list of options.
|
|
1440
|
-
* @
|
|
1441
|
-
*
|
|
1442
|
-
* @attr {string} matchword - Specifies a string used to highlight matched string parts in options.
|
|
1443
|
-
* @attr {boolean} disabled - When true, the entire menu and all options are disabled;
|
|
1444
|
-
* @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
|
|
1445
|
-
* @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
1446
|
-
* @attr {boolean} multiselect - When true, the selected option can be multiple options.
|
|
1447
|
-
* @attr {boolean} selectAllMatchingOptions - When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
|
|
1448
|
-
* @attr {string} value - The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
|
|
1449
|
-
* @prop {string} size - Sets the size of the menu. Accepted values are 'sm' and 'md'. Default is 'sm'.
|
|
1450
|
-
* @prop {string} shape - Sets the shape of the menu options. Accepted values are 'box' and 'round'. Default is 'box'.
|
|
1451
|
-
* @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
1479
|
+
* The `auro-menu` element provides users a way to select from a list of options.
|
|
1480
|
+
* @customElement auro-menu
|
|
1481
|
+
*
|
|
1452
1482
|
* @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
1453
1483
|
* @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
1454
1484
|
* @event {CustomEvent<{ loading: boolean; hasLoadingPlaceholder: boolean; }>} auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
@@ -1539,58 +1569,87 @@ class AuroMenu extends AuroElement {
|
|
|
1539
1569
|
type: Boolean,
|
|
1540
1570
|
reflect: true,
|
|
1541
1571
|
},
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
},
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* When true, the entire menu and all options are disabled.
|
|
1575
|
+
*/
|
|
1547
1576
|
disabled: {
|
|
1548
1577
|
type: Boolean,
|
|
1549
1578
|
reflect: true
|
|
1550
1579
|
},
|
|
1580
|
+
|
|
1581
|
+
/**
|
|
1582
|
+
* Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
|
|
1583
|
+
*/
|
|
1584
|
+
hasLoadingPlaceholder: {
|
|
1585
|
+
type: Boolean
|
|
1586
|
+
},
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* @private
|
|
1590
|
+
*/
|
|
1591
|
+
layout: {
|
|
1592
|
+
type: String
|
|
1593
|
+
},
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* Indent level for submenus.
|
|
1597
|
+
* @private
|
|
1598
|
+
*/
|
|
1599
|
+
level: {
|
|
1600
|
+
type: Number,
|
|
1601
|
+
reflect: false,
|
|
1602
|
+
attribute: false
|
|
1603
|
+
},
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* When true, displays a loading state using the loadingIcon and loadingText slots if provided.
|
|
1607
|
+
*/
|
|
1551
1608
|
loading: {
|
|
1552
1609
|
type: Boolean,
|
|
1553
1610
|
reflect: true
|
|
1554
1611
|
},
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
optionActive: {
|
|
1560
|
-
type: Object,
|
|
1561
|
-
attribute: 'optionactive'
|
|
1562
|
-
},
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* Specifies a string used to highlight matched string parts in options.
|
|
1615
|
+
*/
|
|
1563
1616
|
matchWord: {
|
|
1564
1617
|
type: String,
|
|
1565
1618
|
attribute: 'matchword'
|
|
1566
1619
|
},
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* When true, the selected option can be multiple options.
|
|
1623
|
+
*/
|
|
1567
1624
|
multiSelect: {
|
|
1568
1625
|
type: Boolean,
|
|
1569
1626
|
reflect: true,
|
|
1570
1627
|
attribute: 'multiselect'
|
|
1571
1628
|
},
|
|
1572
|
-
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* When true, selected option will not show the checkmark.
|
|
1632
|
+
*/
|
|
1633
|
+
noCheckmark: {
|
|
1573
1634
|
type: Boolean,
|
|
1574
1635
|
reflect: true,
|
|
1636
|
+
attribute: 'nocheckmark'
|
|
1575
1637
|
},
|
|
1576
1638
|
|
|
1577
1639
|
/**
|
|
1578
|
-
*
|
|
1640
|
+
* Specifies the current active menuOption.
|
|
1579
1641
|
*/
|
|
1580
|
-
|
|
1581
|
-
type:
|
|
1582
|
-
|
|
1583
|
-
attribute: 'value'
|
|
1642
|
+
optionActive: {
|
|
1643
|
+
type: Object,
|
|
1644
|
+
attribute: 'optionactive'
|
|
1584
1645
|
},
|
|
1585
1646
|
|
|
1586
1647
|
/**
|
|
1587
|
-
*
|
|
1588
|
-
* @private
|
|
1648
|
+
* An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements.
|
|
1589
1649
|
*/
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
attribute: false
|
|
1650
|
+
optionSelected: {
|
|
1651
|
+
// Allow HTMLElement, HTMLElement[] arrays and undefined
|
|
1652
|
+
type: Object
|
|
1594
1653
|
},
|
|
1595
1654
|
|
|
1596
1655
|
/**
|
|
@@ -1601,6 +1660,43 @@ class AuroMenu extends AuroElement {
|
|
|
1601
1660
|
type: Array,
|
|
1602
1661
|
reflect: false,
|
|
1603
1662
|
attribute: false
|
|
1663
|
+
},
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Sets the size of the menu.
|
|
1667
|
+
* @type {'sm' | 'md'}
|
|
1668
|
+
* @default 'sm'
|
|
1669
|
+
*/
|
|
1670
|
+
size: {
|
|
1671
|
+
type: String,
|
|
1672
|
+
reflect: true
|
|
1673
|
+
},
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* When true, selects all options that match the provided value/key when setting value and multiselect is enabled.
|
|
1677
|
+
*/
|
|
1678
|
+
selectAllMatchingOptions: {
|
|
1679
|
+
type: Boolean,
|
|
1680
|
+
reflect: true,
|
|
1681
|
+
},
|
|
1682
|
+
|
|
1683
|
+
/**
|
|
1684
|
+
* Sets the shape of the menu.
|
|
1685
|
+
* @type {'box' | 'round'}
|
|
1686
|
+
* @default 'box'
|
|
1687
|
+
*/
|
|
1688
|
+
shape: {
|
|
1689
|
+
type: String,
|
|
1690
|
+
reflect: true
|
|
1691
|
+
},
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* The value of the selected option. In multi-select mode, this is a JSON stringified array of selected option values.
|
|
1695
|
+
*/
|
|
1696
|
+
value: {
|
|
1697
|
+
type: String,
|
|
1698
|
+
reflect: true,
|
|
1699
|
+
attribute: 'value'
|
|
1604
1700
|
}
|
|
1605
1701
|
};
|
|
1606
1702
|
}
|
|
@@ -1646,7 +1742,7 @@ class AuroMenu extends AuroElement {
|
|
|
1646
1742
|
|
|
1647
1743
|
/**
|
|
1648
1744
|
* This will register this element with the browser.
|
|
1649
|
-
* @param {string} [name="auro-menu"] - The name of element that you want to register
|
|
1745
|
+
* @param {string} [name="auro-menu"] - The name of the element that you want to register.
|
|
1650
1746
|
*
|
|
1651
1747
|
* @example
|
|
1652
1748
|
* AuroMenu.register("custom-menu") // this will register this element to <custom-menu/>
|
|
@@ -2053,43 +2149,6 @@ class AuroMenu extends AuroElement {
|
|
|
2053
2149
|
}
|
|
2054
2150
|
}
|
|
2055
2151
|
|
|
2056
|
-
function initKeysExample() {
|
|
2057
|
-
const menu = document.getElementById('keys-menu');
|
|
2058
|
-
const stopsButton = document.getElementById('stopsButton');
|
|
2059
|
-
const stopsTopButton = document.getElementById('stopsTopButton');
|
|
2060
|
-
const output = document.getElementById('output');
|
|
2061
|
-
|
|
2062
|
-
const createConsoleEntry = (message) => {
|
|
2063
|
-
const node = document.createElement('span');
|
|
2064
|
-
node.innerHTML = message;
|
|
2065
|
-
output.appendChild(node);
|
|
2066
|
-
output.appendChild(document.createElement('br'));
|
|
2067
|
-
};
|
|
2068
|
-
|
|
2069
|
-
const resetConsole = () => {
|
|
2070
|
-
output.innerHTML = '';
|
|
2071
|
-
};
|
|
2072
|
-
|
|
2073
|
-
const updateMenuValue = (value) => {
|
|
2074
|
-
resetConsole();
|
|
2075
|
-
createConsoleEntry(`Setting menu.value: <em>"${value}"</em>`);
|
|
2076
|
-
menu.value = '';
|
|
2077
|
-
menu.value = value;
|
|
2078
|
-
createConsoleEntry(`menu.value before next lifecycle: <em>"${menu.value}"</em>`);
|
|
2079
|
-
setTimeout(() => {
|
|
2080
|
-
createConsoleEntry(`menu.value after lifecycle: <em>"${menu.value}"</em>`);
|
|
2081
|
-
});
|
|
2082
|
-
};
|
|
2083
|
-
|
|
2084
|
-
stopsButton.addEventListener('click', () => {
|
|
2085
|
-
updateMenuValue('stops');
|
|
2086
|
-
});
|
|
2087
|
-
|
|
2088
|
-
stopsTopButton.addEventListener('click', () => {
|
|
2089
|
-
updateMenuValue('stops-top');
|
|
2090
|
-
});
|
|
2091
|
-
}
|
|
2092
|
-
|
|
2093
2152
|
/* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
|
|
2094
2153
|
|
|
2095
2154
|
|
|
@@ -2099,20 +2158,6 @@ AuroMenu.register('custom-menu');
|
|
|
2099
2158
|
AuroMenuOption.register('custom-menuoption');
|
|
2100
2159
|
|
|
2101
2160
|
function initExamples(initCount) {
|
|
2102
|
-
initCount = initCount || 0;
|
|
2103
|
-
|
|
2104
|
-
try {
|
|
2105
|
-
// javascript example function calls to be added here upon creation to test examples
|
|
2106
|
-
// auroMenuResetExample();
|
|
2107
|
-
initKeysExample();
|
|
2108
|
-
} catch (err) {
|
|
2109
|
-
if (initCount <= 20) {
|
|
2110
|
-
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
2111
|
-
setTimeout(() => {
|
|
2112
|
-
initExamples(initCount + 1);
|
|
2113
|
-
}, 100);
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
2161
|
}
|
|
2117
2162
|
|
|
2118
2163
|
export { initExamples };
|
|
@@ -48,10 +48,9 @@
|
|
|
48
48
|
Prism.highlightAll();
|
|
49
49
|
})
|
|
50
50
|
</script>
|
|
51
|
-
<script type="module">
|
|
52
|
-
import { initExamples } from "./index.min.js";
|
|
51
|
+
<script src="./index.min.js" data-demo-script="true" type="module"></script>
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
56
55
|
</body>
|
|
57
56
|
</html>
|
|
@@ -18,6 +18,7 @@ The following sections are editable by making changes to the following files:
|
|
|
18
18
|
-->
|
|
19
19
|
|
|
20
20
|
# Menu
|
|
21
|
+
|
|
21
22
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
22
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
23
24
|
The `<auro-menu>` element provides a list of options for a user to select from.
|
|
@@ -31,7 +32,17 @@ The `<auro-menu>` element is designed for contextual menus, e.g. a dropdown menu
|
|
|
31
32
|
<!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
|
|
32
33
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
33
34
|
|
|
35
|
+
## Menu Use Cases
|
|
36
|
+
|
|
37
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
38
|
+
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
39
|
+
The `<auro-menu>` element should be used in situations where users may:
|
|
40
|
+
|
|
41
|
+
* A user needs to select one option from a list of options.
|
|
42
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
43
|
+
|
|
34
44
|
## Getting Started
|
|
45
|
+
|
|
35
46
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/componentInstall.md) -->
|
|
36
47
|
<!-- The below content is automatically added from ../../docs/templates/componentInstall.md -->
|
|
37
48
|
|
|
@@ -44,30 +55,7 @@ $ npm i @aurodesignsystem/auro-formkit
|
|
|
44
55
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/gettingStarted.md) -->
|
|
45
56
|
<!-- The below content is automatically added from ../../docs/templates/gettingStarted.md -->
|
|
46
57
|
|
|
47
|
-
###
|
|
48
|
-
|
|
49
|
-
#### Automatic Registration
|
|
50
|
-
|
|
51
|
-
For automatic registration, simply import the component:
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
// Registers <auro-menu> automatically
|
|
55
|
-
import '@aurodesignsystem/auro-formkit/auro-menu';
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
#### Custom Registration
|
|
59
|
-
|
|
60
|
-
To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our static `AuroMenu.register('custom-menu')` method on the component class and pass in a unique name.
|
|
61
|
-
|
|
62
|
-
```javascript
|
|
63
|
-
// Import the class only
|
|
64
|
-
import { AuroMenu } from '@aurodesignsystem/auro-formkit/auro-menu/class';
|
|
65
|
-
|
|
66
|
-
// Register with a custom name if desired
|
|
67
|
-
AuroMenu.register('custom-menu');
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
#### TypeScript Module Resolution
|
|
58
|
+
### TypeScript Module Resolution
|
|
71
59
|
|
|
72
60
|
When using TypeScript set `moduleResolution` to `bundler`, add the following to your `tsconfig.json`:
|
|
73
61
|
|
|
@@ -80,31 +68,10 @@ When using TypeScript set `moduleResolution` to `bundler`, add the following to
|
|
|
80
68
|
```
|
|
81
69
|
|
|
82
70
|
This configuration enables proper module resolution for the component's TypeScript files.
|
|
83
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
84
|
-
**Reference component in HTML**
|
|
85
|
-
|
|
86
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
87
|
-
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<auro-menu>
|
|
91
|
-
<auro-menuoption value="stops">Stops</auro-menuoption>
|
|
92
|
-
<auro-menuoption value="price">Price</auro-menuoption>
|
|
93
|
-
<auro-menuoption value="duration">Duration</auro-menuoption>
|
|
94
|
-
<auro-menuoption value="departure">Departure</auro-menuoption>
|
|
95
|
-
<auro-menuoption value="arrival">Arrival</auro-menuoption>
|
|
96
|
-
</auro-menu>
|
|
97
|
-
```
|
|
98
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
99
|
-
|
|
100
|
-
### Design Token CSS Custom Property dependency
|
|
101
|
-
|
|
102
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/development/designTokens.md) -->
|
|
103
|
-
The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
104
|
-
|
|
105
71
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
72
|
|
|
107
73
|
## Install from CDN
|
|
74
|
+
|
|
108
75
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/templates/bundleInstallDescription.md) -->
|
|
109
76
|
<!-- The below content is automatically added from ../../docs/templates/bundleInstallDescription.md -->
|
|
110
77
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
@@ -114,21 +81,7 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
114
81
|
```
|
|
115
82
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
83
|
|
|
117
|
-
##
|
|
118
|
-
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/browserSupport.md) -->
|
|
119
|
-
For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
|
|
120
|
-
|
|
121
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
122
|
-
|
|
123
|
-
## auro-menu use cases
|
|
124
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
125
|
-
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
126
|
-
The `<auro-menu>` element should be used in situations where users may:
|
|
127
|
-
|
|
128
|
-
* A user needs to select one option from a list of options.
|
|
129
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
130
|
-
|
|
131
|
-
## Formkit development
|
|
84
|
+
## Formkit Development
|
|
132
85
|
|
|
133
86
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=../../docs/partials/developmentDescription.md) -->
|
|
134
87
|
<!-- The below content is automatically added from ../../docs/partials/developmentDescription.md -->
|
|
@@ -142,4 +95,51 @@ To only develop a single component, use the `--filter` flag:
|
|
|
142
95
|
```shell
|
|
143
96
|
npx turbo dev --filter=@aurodesignsystem/auro-input
|
|
144
97
|
```
|
|
98
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
99
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
100
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
101
|
+
|
|
102
|
+
## Custom Component Registration for Version Management
|
|
103
|
+
|
|
104
|
+
There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition. The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
105
|
+
|
|
106
|
+
When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
|
|
107
|
+
|
|
108
|
+
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
|
|
109
|
+
|
|
110
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
// Import the class only
|
|
114
|
+
import { AuroMenu, AuroMenuOption } from '@aurodesignsystem/auro-formkit/auro-menu/class';
|
|
115
|
+
|
|
116
|
+
// Register with a custom name if desired
|
|
117
|
+
AuroMenu.register('custom-menu');
|
|
118
|
+
AuroMenuOption.register('custom-menu-option');
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
This will create a new custom element `<custom-menu>` and `<custom-menu-option>` that behaves exactly like `<auro-menu>` and `<auro-menu-option>`, allowing both to coexist on the same page without interfering with each other.
|
|
122
|
+
|
|
123
|
+
<div class="exampleWrapper exampleWrapper--flex">
|
|
124
|
+
<custom-menu>
|
|
125
|
+
<custom-menuoption value="stops">Stops</custom-menuoption>
|
|
126
|
+
<custom-menuoption value="price">Price</custom-menuoption>
|
|
127
|
+
<custom-menuoption value="duration">Duration</custom-menuoption>
|
|
128
|
+
<custom-menuoption value="departure">Departure</custom-menuoption>
|
|
129
|
+
<custom-menuoption value="arrival">Arrival</custom-menuoption>
|
|
130
|
+
</custom-menu>
|
|
131
|
+
</div>
|
|
132
|
+
<auro-accordion alignRight>
|
|
133
|
+
<span slot="trigger">See code</span>
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<custom-menu>
|
|
137
|
+
<custom-menuoption value="stops">Stops</custom-menuoption>
|
|
138
|
+
<custom-menuoption value="price">Price</custom-menuoption>
|
|
139
|
+
<custom-menuoption value="duration">Duration</custom-menuoption>
|
|
140
|
+
<custom-menuoption value="departure">Departure</custom-menuoption>
|
|
141
|
+
<custom-menuoption value="arrival">Arrival</custom-menuoption>
|
|
142
|
+
</custom-menu>
|
|
143
|
+
```
|
|
144
|
+
</auro-accordion>
|
|
145
145
|
<!-- AURO-GENERATED-CONTENT:END -->
|