@aquera/nile-elements 0.1.73-beta-1.8 → 0.1.73
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/README.md +3 -1
- package/demo/index.html +9 -47
- package/dist/{fixture-5b79f853.cjs.js → fixture-3bfb4490.cjs.js} +2 -2
- package/dist/{fixture-5b79f853.cjs.js.map → fixture-3bfb4490.cjs.js.map} +1 -1
- package/dist/{fixture-cf7bfcf5.esm.js → fixture-8edec91c.esm.js} +1 -1
- package/dist/index.js +14 -14
- package/dist/nile-accordion/nile-accordian.test.cjs.js +1 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.cjs.js +1 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +1 -1
- package/dist/nile-badge/nile-badge.test.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.test.esm.js +1 -1
- package/dist/nile-button/nile-button.test.cjs.js +1 -1
- package/dist/nile-button/nile-button.test.esm.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +1 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +1 -1
- package/dist/nile-card/nile-card.test.cjs.js +1 -1
- package/dist/nile-card/nile-card.test.esm.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +1 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.cjs.js +1 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +1 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.test.esm.js +1 -1
- package/dist/nile-icon/nile-icon.test.cjs.js +1 -1
- package/dist/nile-icon/nile-icon.test.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +2 -2
- package/dist/nile-input/nile-input.test.cjs.js +1 -1
- package/dist/nile-input/nile-input.test.esm.js +1 -1
- package/dist/nile-link/nile-link.test.cjs.js +1 -1
- package/dist/nile-link/nile-link.test.esm.js +1 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +1 -1
- package/dist/nile-loader/nile-loader.test.esm.js +1 -1
- package/dist/nile-option-group/nile-option-group.cjs.js +1 -1
- package/dist/nile-option-group/nile-option-group.cjs.js.map +1 -1
- package/dist/nile-option-group/nile-option-group.esm.js +1 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.test.esm.js +1 -1
- package/dist/nile-popup/nile-popup.test.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.test.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +1 -1
- package/dist/nile-radio/nile-radio.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.cjs.js.map +1 -1
- package/dist/nile-radio/nile-radio.esm.js +2 -2
- package/dist/nile-radio/nile-radio.test.cjs.js +1 -1
- package/dist/nile-radio/nile-radio.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.esm.js +2 -2
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +3 -2
- package/dist/nile-select/nile-select.test.cjs.js +1 -1
- package/dist/nile-select/nile-select.test.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js.map +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +2 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -1
- package/dist/nile-virtual-select/renderer.esm.js +3 -4
- package/dist/src/nile-input/nile-input.d.ts +1 -0
- package/dist/src/nile-input/nile-input.js +4 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-option-group/nile-option-group.js +1 -1
- package/dist/src/nile-option-group/nile-option-group.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.d.ts +1 -0
- package/dist/src/nile-radio/nile-radio.js +8 -1
- package/dist/src/nile-radio/nile-radio.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.d.ts +4 -1
- package/dist/src/nile-radio-group/nile-radio-group.js +25 -2
- package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +4 -1
- package/dist/src/nile-select/nile-select.js +13 -1
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-virtual-select/nile-virtual-select.d.ts +1 -9
- package/dist/src/nile-virtual-select/nile-virtual-select.js +5 -55
- package/dist/src/nile-virtual-select/nile-virtual-select.js.map +1 -1
- package/dist/src/nile-virtual-select/renderer.d.ts +2 -2
- package/dist/src/nile-virtual-select/renderer.js +5 -6
- package/dist/src/nile-virtual-select/renderer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-input/nile-input.ts +5 -1
- package/src/nile-option-group/nile-option-group.ts +1 -1
- package/src/nile-radio/nile-radio.ts +7 -1
- package/src/nile-radio-group/nile-radio-group.ts +26 -4
- package/src/nile-select/nile-select.ts +22 -12
- package/src/nile-virtual-select/nile-virtual-select.ts +7 -68
- package/src/nile-virtual-select/renderer.ts +5 -7
- package/vscode-html-custom-data.json +19 -20
- package/dist/fixture-90b199c4.esm.js +0 -569
- package/dist/fixture-dbd66009.cjs.js +0 -395
- package/dist/fixture-dbd66009.cjs.js.map +0 -1
- package/dist/src/internal/resizable-helper.d.ts +0 -59
- package/dist/src/internal/resizable-helper.js +0 -115
- package/dist/src/internal/resizable-helper.js.map +0 -1
- package/dist/src/internal/resizable-styles.d.ts +0 -16
- package/dist/src/internal/resizable-styles.js +0 -144
- package/dist/src/internal/resizable-styles.js.map +0 -1
- package/dist/src/nile-badge/__snapshots__/nile-badge.test.snap.js +0 -17
- package/dist/src/nile-calendar/__snapshots__/nile-calendar.test.snap.js +0 -310
- package/dist/src/nile-card/__snapshots__/nile-card.test.snap.js +0 -34
- package/dist/src/nile-checkbox/__snapshots__/nile-checkbox.test.snap.js +0 -31
- package/dist/src/nile-grid/data-processor.d.ts +0 -37
- package/dist/src/nile-grid/data-processor.js +0 -122
- package/dist/src/nile-grid/data-processor.js.map +0 -1
- package/dist/src/nile-grid/event-handlers.d.ts +0 -35
- package/dist/src/nile-grid/event-handlers.js +0 -158
- package/dist/src/nile-grid/event-handlers.js.map +0 -1
- package/dist/src/nile-grid/index.d.ts +0 -5
- package/dist/src/nile-grid/index.js +0 -6
- package/dist/src/nile-grid/index.js.map +0 -1
- package/dist/src/nile-grid/nile-grid.css.d.ts +0 -1
- package/dist/src/nile-grid/nile-grid.css.js +0 -120
- package/dist/src/nile-grid/nile-grid.css.js.map +0 -1
- package/dist/src/nile-grid/nile-grid.d.ts +0 -39
- package/dist/src/nile-grid/nile-grid.js +0 -182
- package/dist/src/nile-grid/nile-grid.js.map +0 -1
- package/dist/src/nile-grid/renderer.d.ts +0 -8
- package/dist/src/nile-grid/renderer.js +0 -78
- package/dist/src/nile-grid/renderer.js.map +0 -1
- package/dist/src/nile-grid/resize-handler.d.ts +0 -4
- package/dist/src/nile-grid/resize-handler.js +0 -36
- package/dist/src/nile-grid/resize-handler.js.map +0 -1
- package/dist/src/nile-grid/types.d.ts +0 -32
- package/dist/src/nile-grid/types.js +0 -2
- package/dist/src/nile-grid/types.js.map +0 -1
- package/dist/src/nile-grid/utils.d.ts +0 -4
- package/dist/src/nile-grid/utils.js +0 -32
- package/dist/src/nile-grid/utils.js.map +0 -1
- package/dist/src/nile-hero/__snapshots__/nile-hero.test.snap.js +0 -47
- package/dist/src/nile-icon/__snapshots__/nile-icon.test.snap.js +0 -16
- package/dist/src/nile-icon/icons/svg/ng-action.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-action.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-action.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-activity.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-activity.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-activity.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-alert-circle.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-alert-circle.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-alert-circle.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-align-center.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-align-center.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-align-center.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-annotation-x.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-annotation-x.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-annotation-x.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-arrow-down.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-down.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-down.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-down.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-down.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-down.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-left.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-left.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-left.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-right.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-right.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-narrow-right.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-arrow-up.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-up.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-arrow-up.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-bar-chart-12.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bar-chart-12.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bar-chart-12.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-bell-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bell-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bell-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-bell-ringing-04.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bell-ringing-04.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bell-ringing-04.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-bold-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bold-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-bold-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-building-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-building-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-building-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-building-05.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-building-05.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-building-05.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-button-loading-blue-animated.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-button-loading-blue-animated.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-button-loading-blue-animated.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-button-loading-blue.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-button-loading-blue.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-button-loading-blue.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-calendar-plus-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-calendar-plus-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-calendar-plus-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-calendar.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-calendar.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-calendar.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-check-circle-broken.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check-circle-broken.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check-circle-broken.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-check-circle.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check-circle.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check-circle.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-check-square-broken.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check-square-broken.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check-square-broken.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-check.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-check.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-chevron-down.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-down.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-down.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-chevron-left.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-left.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-left.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-chevron-right.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-right.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-right.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-chevron-selector-vertical.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-selector-vertical.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-selector-vertical.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-chevron-up-double.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-up-double.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-up-double.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-chevron-up.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-up.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-chevron-up.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-copy-03.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-copy-03.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-copy-03.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-dataflow-04.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dataflow-04.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dataflow-04.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-dots-grid.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dots-grid.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dots-grid.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-dots-vertical.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dots-vertical.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dots-vertical.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-download-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-download-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-download-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-dropdown.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dropdown.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-dropdown.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-edit-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-edit-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-edit-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-edit-05.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-edit-05.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-edit-05.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-expand-06.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-expand-06.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-expand-06.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-eye-off.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-eye-off.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-eye-off.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-eye.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-eye.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-eye.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-file-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-file-06.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-06.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-06.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-file-check-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-check-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-check-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-file-question-03.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-question-03.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-file-question-03.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-filter-lines.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-filter-lines.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-filter-lines.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-grid-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-grid-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-grid-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-help-circle.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-help-circle.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-help-circle.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-image-03.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-image-03.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-image-03.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-image-user-left.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-image-user-left.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-image-user-left.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-info-circle.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-info-circle.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-info-circle.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-italic-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-italic-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-italic-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-layers-three-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-layers-three-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-layers-three-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-list.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-list.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-list.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-log-out-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-log-out-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-log-out-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-mail-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-mail-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-mail-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-mail-04.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-mail-04.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-mail-04.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-marker-pin-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-marker-pin-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-marker-pin-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-menu-05.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-menu-05.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-menu-05.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-message-text-square-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-message-text-square-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-message-text-square-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-minimize-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-minimize-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-minimize-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-minus.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-minus.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-minus.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-plus.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-plus.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-plus.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-refresh-cw-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-refresh-cw-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-refresh-cw-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-rocket-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-rocket-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-rocket-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-search-lg.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-search-lg.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-search-lg.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-send-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-send-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-send-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-settings-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-settings-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-settings-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-share-04.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-share-04.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-share-04.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-share-06.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-share-06.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-share-06.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-stars-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-stars-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-stars-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-trash-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-trash-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-trash-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-trash-03.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-trash-03.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-trash-03.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-trend-up-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-trend-up-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-trend-up-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-underline-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-underline-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-underline-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-upload-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-upload-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-upload-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-upload-cloud-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-upload-cloud-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-upload-cloud-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-user-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-user-check-02-1.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-check-02-1.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-check-02-1.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-user-check-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-check-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-check-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-user-plus-02.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-plus-02.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-plus-02.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-user-right-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-right-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-user-right-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-users-01.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-users-01.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-users-01.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-x-circle.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-x-circle.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-x-circle.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-x-close.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-x-close.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-x-close.js.map +0 -1
- package/dist/src/nile-icon/icons/svg/ng-x-square.d.ts +0 -5
- package/dist/src/nile-icon/icons/svg/ng-x-square.js +0 -5
- package/dist/src/nile-icon/icons/svg/ng-x-square.js.map +0 -1
- package/dist/src/nile-input/__snapshots__/nile-input.test.snap.js +0 -75
- package/dist/src/nile-popover/__snapshots__/nile-popover.test.snap.js +0 -22
- package/dist/src/nile-table-body/virtual-scroll-helper.d.ts +0 -9
- package/dist/src/nile-table-body/virtual-scroll-helper.js +0 -24
- package/dist/src/nile-table-body/virtual-scroll-helper.js.map +0 -1
- package/dist/src/nile-virtual-table-body/index.d.ts +0 -2
- package/dist/src/nile-virtual-table-body/index.js +0 -3
- package/dist/src/nile-virtual-table-body/index.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.d.ts +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js +0 -44
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.css.js.map +0 -1
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.d.ts +0 -50
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js +0 -135
- package/dist/src/nile-virtual-table-body/nile-virtual-table-body.js.map +0 -1
- package/dist/src/nile-virtual-table-body/renderer.d.ts +0 -16
- package/dist/src/nile-virtual-table-body/renderer.js +0 -49
- package/dist/src/nile-virtual-table-body/renderer.js.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-5b79f853.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-progress-bar.cjs.js","tslib","./nile-progress-bar.css.cjs.js","lit/decorators.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var s,a,r,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture003CjsJs){s=_fixture003CjsJs.f;a=_fixture003CjsJs.a;},function(_litStaticHtmlJs){r=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileProgressBarCjsJs){},function(_tslib){},function(_nileProgressBarCssCjsJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileProgressBar",function(){it("should have a default value of 0",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _e$shadowRoot$querySe;var e,t;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return s(r(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-progress-bar></nile-progress-bar>"]))));case 2:e=_context2.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe!==void 0?_e$shadowRoot$querySe:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context2.stop();}},_callee);}))),it("should set and display the provided value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _e$shadowRoot$querySe2;var e,t;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return s(r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-progress-bar value=\"50\"></nile-progress-bar>"]))));case 2:e=_context3.sent;a(e.value).to.equal(50);t=(_e$shadowRoot$querySe2=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe2!==void 0?_e$shadowRoot$querySe2:{};a(t.style.width).to.equal("50%");case 6:case"end":return _context3.stop();}},_callee2);}))),it("should handle boundary value 0%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _e$shadowRoot$querySe3;var e,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return s(r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-progress-bar value=\"0\"></nile-progress-bar>"]))));case 2:e=_context4.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe3=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe3!==void 0?_e$shadowRoot$querySe3:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context4.stop();}},_callee3);}))),it("should handle boundary value 100%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _e$shadowRoot$querySe4;var e,t;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return s(r(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-progress-bar value=\"100\"></nile-progress-bar>"]))));case 2:e=_context5.sent;a(e.value).to.equal(100);t=(_e$shadowRoot$querySe4=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe4!==void 0?_e$shadowRoot$querySe4:{};a(t.style.width).to.equal("100%");case 6:case"end":return _context5.stop();}},_callee4);}))),it("should revert values greater than 100",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _e$shadowRoot$querySe5;var e,t;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return s(r(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-progress-bar value=\"150\"></nile-progress-bar>"]))));case 2:e=_context6.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe5=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe5!==void 0?_e$shadowRoot$querySe5:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context6.stop();}},_callee5);}))),it("should revert negative values",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _e$shadowRoot$querySe6;var e,t;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return s(r(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-progress-bar value=\"-50\"></nile-progress-bar>"]))));case 2:e=_context7.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe6=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe6!==void 0?_e$shadowRoot$querySe6:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context7.stop();}},_callee6);}))),it("should update the value dynamically",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _e$shadowRoot$querySe7;var e,t;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return s(r(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-progress-bar value=\"20\"></nile-progress-bar>"]))));case 2:e=_context8.sent;e.value=80;_context8.next=6;return e.updateComplete;case 6:t=(_e$shadowRoot$querySe7=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe7!==void 0?_e$shadowRoot$querySe7:{};a(t.style.width).to.equal("80%");case 8:case"end":return _context8.stop();}},_callee7);})));});}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-3bfb4490.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-progress-bar.cjs.js","tslib","./nile-progress-bar.css.cjs.js","lit/decorators.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var s,a,r,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture003CjsJs){s=_fixture003CjsJs.f;a=_fixture003CjsJs.a;},function(_litStaticHtmlJs){r=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileProgressBarCjsJs){},function(_tslib){},function(_nileProgressBarCssCjsJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileProgressBar",function(){it("should have a default value of 0",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _e$shadowRoot$querySe;var e,t;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return s(r(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-progress-bar></nile-progress-bar>"]))));case 2:e=_context2.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe!==void 0?_e$shadowRoot$querySe:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context2.stop();}},_callee);}))),it("should set and display the provided value",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var _e$shadowRoot$querySe2;var e,t;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return s(r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-progress-bar value=\"50\"></nile-progress-bar>"]))));case 2:e=_context3.sent;a(e.value).to.equal(50);t=(_e$shadowRoot$querySe2=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe2!==void 0?_e$shadowRoot$querySe2:{};a(t.style.width).to.equal("50%");case 6:case"end":return _context3.stop();}},_callee2);}))),it("should handle boundary value 0%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _e$shadowRoot$querySe3;var e,t;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return s(r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-progress-bar value=\"0\"></nile-progress-bar>"]))));case 2:e=_context4.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe3=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe3!==void 0?_e$shadowRoot$querySe3:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context4.stop();}},_callee3);}))),it("should handle boundary value 100%",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _e$shadowRoot$querySe4;var e,t;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return s(r(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-progress-bar value=\"100\"></nile-progress-bar>"]))));case 2:e=_context5.sent;a(e.value).to.equal(100);t=(_e$shadowRoot$querySe4=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe4!==void 0?_e$shadowRoot$querySe4:{};a(t.style.width).to.equal("100%");case 6:case"end":return _context5.stop();}},_callee4);}))),it("should revert values greater than 100",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var _e$shadowRoot$querySe5;var e,t;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return s(r(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-progress-bar value=\"150\"></nile-progress-bar>"]))));case 2:e=_context6.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe5=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe5!==void 0?_e$shadowRoot$querySe5:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context6.stop();}},_callee5);}))),it("should revert negative values",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var _e$shadowRoot$querySe6;var e,t;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return s(r(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-progress-bar value=\"-50\"></nile-progress-bar>"]))));case 2:e=_context7.sent;a(e.value).to.equal(0);t=(_e$shadowRoot$querySe6=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe6!==void 0?_e$shadowRoot$querySe6:{};a(t.style.width).to.equal("0%");case 6:case"end":return _context7.stop();}},_callee6);}))),it("should update the value dynamically",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var _e$shadowRoot$querySe7;var e,t;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return s(r(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-progress-bar value=\"20\"></nile-progress-bar>"]))));case 2:e=_context8.sent;e.value=80;_context8.next=6;return e.updateComplete;case 6:t=(_e$shadowRoot$querySe7=e.shadowRoot.querySelector("span"))!==null&&_e$shadowRoot$querySe7!==void 0?_e$shadowRoot$querySe7:{};a(t.style.width).to.equal("80%");case 8:case"end":return _context8.stop();}},_callee7);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-progress-bar.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
import{f as s,a as e}from"../fixture-
|
1
|
+
import{f as s,a as e}from"../fixture-8edec91c.esm.js";import{html as a}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-progress-bar.esm.js";import"tslib";import"./nile-progress-bar.css.esm.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";describe("NileProgressBar",(()=>{it("should have a default value of 0",(async()=>{const r=await s(a`<nile-progress-bar></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should set and display the provided value",(async()=>{const r=await s(a`<nile-progress-bar value="50"></nile-progress-bar>`);e(r.value).to.equal(50);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("50%")})),it("should handle boundary value 0%",(async()=>{const r=await s(a`<nile-progress-bar value="0"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should handle boundary value 100%",(async()=>{const r=await s(a`<nile-progress-bar value="100"></nile-progress-bar>`);e(r.value).to.equal(100);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("100%")})),it("should revert values greater than 100",(async()=>{const r=await s(a`<nile-progress-bar value="150"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should revert negative values",(async()=>{const r=await s(a`<nile-progress-bar value="-50"></nile-progress-bar>`);e(r.value).to.equal(0);const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("0%")})),it("should update the value dynamically",(async()=>{const r=await s(a`<nile-progress-bar value="20"></nile-progress-bar>`);r.value=80,await r.updateComplete;const t=r.shadowRoot.querySelector("span")??{};e(t.style.width).to.equal("80%")}))}));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-radio.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var i,s,t,e,a,h,l,r,o,_templateObject,_templateObject2,d;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_lit){s=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;e=_litDecoratorsJs.state;a=_litDecoratorsJs.customElement;},function(_nileRadioCssCjsJs){h=_nileRadioCssCjsJs.s;},function(_litDirectivesClassMapJs){l=_litDirectivesClassMapJs.classMap;},function(_internalWatchCjsJs){r=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",d=/*#__PURE__*/function(_o){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.checked=!1,_this.hasFocus=!1,_this.value="",_this.size="medium",_this.disabled=!1,_this.islabelborder=!1;return _this;}_inherits(d,_o);return _createClass(d,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(d,"connectedCallback",this,3)([]),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.removeEventListeners(),this.emit("nile-destroy");}},{key:"addEventListeners",value:function addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus);}},{key:"removeEventListeners",value:function removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus);}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleClick",value:function handleClick(){this.disabled||(this.checked=!0);}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"setInitialAttributes",value:function setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"handleCheckedChange",value:function handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1");}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <span\n part=\"base\"\n class=","\n >\n <span part=\"","\" class=\"radio__control\">\n ","\n </span>\n\n <slot part=\"label\" class=\"radio__label\"></slot>\n </span>\n "])),l({radio:!0,"radio--checked":this.checked,"radio--disabled":this.disabled,"radio--focused":this.hasFocus,"radio--medium":"medium"===this.size,radio__label_border:this.islabelborder}),"control"+(this.checked?" control--checked":""),this.checked?s(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <span class=\"radio__checked-icon\"></span> "]))):"");}}]);}(o));d.styles=h,i([t({type:Boolean})],d.prototype,"checked",void 0),i([e()],d.prototype,"hasFocus",void 0),i([t()],d.prototype,"value",void 0),i([t({reflect:!0})],d.prototype,"size",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"islabelborder",void 0),i([r("checked")],d.prototype,"handleCheckedChange",null),i([r("disabled",{waitUntilFirstUpdate:!0})],d.prototype,"handleDisabledChange",null),_export("N",d=i([a("nile-radio")],d));}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-radio.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var i,s,t,e,a,h,l,r,o,_templateObject,_templateObject2,d;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){i=_tslib.__decorate;},function(_lit){s=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;e=_litDecoratorsJs.state;a=_litDecoratorsJs.customElement;},function(_nileRadioCssCjsJs){h=_nileRadioCssCjsJs.s;},function(_litDirectivesClassMapJs){l=_litDirectivesClassMapJs.classMap;},function(_internalWatchCjsJs){r=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",d=/*#__PURE__*/function(_o){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.checked=!1,_this.hasFocus=!1,_this.value="",_this.size="medium",_this.disabled=!1,_this.islabelborder=!1,_this.allowUncheck=!1;return _this;}_inherits(d,_o);return _createClass(d,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(d,"connectedCallback",this,3)([]),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){this.removeEventListeners(),this.emit("nile-destroy");}},{key:"addEventListeners",value:function addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus);}},{key:"removeEventListeners",value:function removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus);}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleClick",value:function handleClick(){this.allowUncheck&&!this.disabled?this.checked=!this.checked:this.disabled||(this.checked=!0);}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"setInitialAttributes",value:function setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"handleCheckedChange",value:function handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1");}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"render",value:function render(){return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <span\n part=\"base\"\n class=","\n >\n <span part=\"","\" class=\"radio__control\">\n ","\n </span>\n\n <slot part=\"label\" class=\"radio__label\"></slot>\n </span>\n "])),l({radio:!0,"radio--checked":this.checked,"radio--disabled":this.disabled,"radio--focused":this.hasFocus,"radio--medium":"medium"===this.size,radio__label_border:this.islabelborder}),"control"+(this.checked?" control--checked":""),this.checked?s(_templateObject2||(_templateObject2=_taggedTemplateLiteral([" <span class=\"radio__checked-icon\"></span> "]))):"");}}]);}(o));d.styles=h,i([t({type:Boolean})],d.prototype,"checked",void 0),i([e()],d.prototype,"hasFocus",void 0),i([t()],d.prototype,"value",void 0),i([t({reflect:!0})],d.prototype,"size",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"islabelborder",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"allowUncheck",void 0),i([r("checked")],d.prototype,"handleCheckedChange",null),i([r("disabled",{waitUntilFirstUpdate:!0})],d.prototype,"handleDisabledChange",null),_export("N",d=i([a("nile-radio")],d));}};});
|
2
2
|
//# sourceMappingURL=nile-radio.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-radio.cjs.js","sources":["../../../src/nile-radio/nile-radio.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport {styles} from './nile-radio.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { state } from 'lit/decorators.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-radio\n *\n *\n* @dependency nile-icon\n *\n * @slot - The radio's label.\n *\n * @event blur - Emitted when the control loses focus.\n * @event focus - Emitted when the control gains focus.\n *\n * @csspart base - The component's base wrapper.\n * @csspart control - The circular container that wraps the radio's checked state.\n * @csspart control--checked - The radio control when the radio is checked.\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart label - The container that wraps the radio's label.\n */\n@customElement('nile-radio')\nexport class NileRadio extends NileElement {\n static styles: CSSResultGroup = styles;\n\n @property({type:Boolean}) checked = false;\n @state() protected hasFocus = false;\n\n /** The radio's value. When selected, the radio group will receive this value. */\n @property() value: string = '';\n\n /** The radio's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Disables the radio. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The radio's labelborder. */\n @property({ type: Boolean, reflect: true }) islabelborder = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleBlur = this.handleBlur.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n\n this.setInitialAttributes();\n this.addEventListeners();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n this.removeEventListeners();\n this.emit('nile-destroy');\n }\n\n private addEventListeners() {\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('click', this.handleClick);\n this.addEventListener('focus', this.handleFocus);\n }\n\n private removeEventListeners() {\n this.removeEventListener('blur', this.handleBlur);\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('focus', this.handleFocus);\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur')\n }\n\n private handleClick() {\n if (!this.disabled) {\n this.checked = true;\n }\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus')\n }\n\n private setInitialAttributes() {\n this.setAttribute('role', 'radio');\n this.setAttribute('tabindex', '-1');\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('checked')\n handleCheckedChange() {\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n this.setAttribute('tabindex', this.checked ? '0' : '-1');\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n render() {\n return html`\n <span\n part=\"base\"\n class=${classMap({\n radio: true,\n 'radio--checked': this.checked,\n 'radio--disabled': this.disabled,\n 'radio--focused': this.hasFocus,\n 'radio--medium': this.size === 'medium',\n 'radio__label_border':this.islabelborder\n })}\n >\n <span part=\"${`control${this.checked ? ' control--checked' : ''}`}\" class=\"radio__control\">\n ${this.checked\n ? html` <span class=\"radio__checked-icon\"></span> `\n : ''}\n </span>\n\n <slot part=\"label\" class=\"radio__label\"></slot>\n </span>\n `;\n }\n}\n\nexport default NileRadio;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio': NileRadio;\n }\n}\n"],"names":["NileRadio","d","this","checked","hasFocus","value","size","disabled","islabelborder","_this","_inherits","_o","_createClass","key","connectedCallback","super","handleBlur","bind","handleClick","handleFocus","setInitialAttributes","addEventListeners","emit","disconnectedCallback","removeEventListeners","addEventListener","removeEventListener","setAttribute","handleCheckedChange","handleDisabledChange","render","html","_templateObject","_taggedTemplateLiteral","classMap","radio","radio__label_border","_templateObject2","NileElement","styles","__decorate","property","type","Boolean","prototype","state","reflect","watch","waitUntilFirstUpdate","customElement"],"mappings":"+2HAmCaA,4BAAN,SAAAC,EAAA,
|
1
|
+
{"version":3,"file":"nile-radio.cjs.js","sources":["../../../src/nile-radio/nile-radio.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {LitElement, html, CSSResultArray, TemplateResult} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport {styles} from './nile-radio.css';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { state } from 'lit/decorators.js';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\n/**\n * Nile icon component.\n *\n * @tag nile-radio\n *\n *\n* @dependency nile-icon\n *\n * @slot - The radio's label.\n *\n * @event blur - Emitted when the control loses focus.\n * @event focus - Emitted when the control gains focus.\n *\n * @csspart base - The component's base wrapper.\n * @csspart control - The circular container that wraps the radio's checked state.\n * @csspart control--checked - The radio control when the radio is checked.\n * @csspart checked-icon - The checked icon, an `<nile-icon>` element.\n * @csspart label - The container that wraps the radio's label.\n */\n@customElement('nile-radio')\nexport class NileRadio extends NileElement {\n static styles: CSSResultGroup = styles;\n\n @property({type:Boolean}) checked = false;\n @state() protected hasFocus = false;\n\n /** The radio's value. When selected, the radio group will receive this value. */\n @property() value: string = '';\n\n /** The radio's size. */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Disables the radio. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The radio's labelborder. */\n @property({ type: Boolean, reflect: true }) islabelborder = false;\n\n \n @property({ type: Boolean, reflect: true }) allowUncheck = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleBlur = this.handleBlur.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n\n this.setInitialAttributes();\n this.addEventListeners();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n this.removeEventListeners();\n this.emit('nile-destroy');\n }\n\n private addEventListeners() {\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('click', this.handleClick);\n this.addEventListener('focus', this.handleFocus);\n }\n\n private removeEventListeners() {\n this.removeEventListener('blur', this.handleBlur);\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('focus', this.handleFocus);\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur')\n }\n\n private handleClick() {\n\n if(this.allowUncheck && !this.disabled) {\n this.checked = !this.checked;\n } else if (!this.disabled) {\n this.checked = true;\n }\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus')\n }\n\n private setInitialAttributes() {\n this.setAttribute('role', 'radio');\n this.setAttribute('tabindex', '-1');\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n @watch('checked')\n handleCheckedChange() {\n this.setAttribute('aria-checked', this.checked ? 'true' : 'false');\n this.setAttribute('tabindex', this.checked ? '0' : '-1');\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n render() {\n return html`\n <span\n part=\"base\"\n class=${classMap({\n radio: true,\n 'radio--checked': this.checked,\n 'radio--disabled': this.disabled,\n 'radio--focused': this.hasFocus,\n 'radio--medium': this.size === 'medium',\n 'radio__label_border':this.islabelborder\n })}\n >\n <span part=\"${`control${this.checked ? ' control--checked' : ''}`}\" class=\"radio__control\">\n ${this.checked\n ? html` <span class=\"radio__checked-icon\"></span> `\n : ''}\n </span>\n\n <slot part=\"label\" class=\"radio__label\"></slot>\n </span>\n `;\n }\n}\n\nexport default NileRadio;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio': NileRadio;\n }\n}\n"],"names":["NileRadio","d","constructor","this","checked","hasFocus","value","size","disabled","islabelborder","allowUncheck","_this","_inherits","_o","_createClass","key","connectedCallback","super","handleBlur","bind","handleClick","handleFocus","setInitialAttributes","addEventListeners","emit","disconnectedCallback","removeEventListeners","addEventListener","removeEventListener","setAttribute","handleCheckedChange","handleDisabledChange","render","html","_templateObject","_taggedTemplateLiteral","classMap","radio","radio__label_border","_templateObject2","NileElement","styles","__decorate","property","type","Boolean","prototype","state","reflect","watch","waitUntilFirstUpdate","_export","customElement"],"mappings":"+2HAmCaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAGqBC,KAAAA,CAAOC,OAAG,CAAA,CAAA,CAAA,CACjBD,KAAAA,CAAQE,QAAG,CAAA,CAAA,CAAA,CAGlBF,KAAAA,CAAKG,KAAW,CAAA,EAAA,CAGCH,KAAAA,CAAII,IAAAA,CAAiC,QAGtBJ,CAAAA,KAAAA,CAAQK,UAAG,CAGXL,CAAAA,KAAAA,CAAaM,eAAG,CAGhBN,CAAAA,KAAAA,CAAYO,cAAG,CAyF5D,QAAAC,KAAA,EAvFCC,SAAA,CAAAX,CAAA,CAAAY,EAAA,SAAAC,YAAA,CAAAb,CAAA,GAAAc,GAAA,qBAAAT,KAAA,UAAAU,iBAAAA,CAAAA,CAAAA,CACEC,aAAAA,CAAAA,CAAAA,iCACAd,KAAKe,UAAaf,CAAAA,IAAAA,CAAKe,WAAWC,IAAKhB,CAAAA,IAAAA,CAAAA,CACvCA,KAAKiB,WAAcjB,CAAAA,IAAAA,CAAKiB,YAAYD,IAAKhB,CAAAA,IAAAA,CAAAA,CACzCA,KAAKkB,WAAclB,CAAAA,IAAAA,CAAKkB,YAAYF,IAAKhB,CAAAA,IAAAA,CAAAA,CAEzCA,KAAKmB,oBACLnB,CAAAA,CAAAA,CAAAA,IAAAA,CAAKoB,iBACLpB,CAAAA,CAAAA,CAAAA,IAAAA,CAAKqB,IAAK,CAAA,WAAA,CACX,EAED,GAAAT,GAAA,wBAAAT,KAAA,UAAAmB,oBAAAA,CAAAA,CAAAA,CACEtB,KAAKuB,oBACLvB,CAAAA,CAAAA,CAAAA,IAAAA,CAAKqB,KAAK,cACX,CAAA,EAEO,GAAAT,GAAA,qBAAAT,KAAA,UAAAiB,iBAAAA,CAAAA,CAAAA,CACNpB,IAAKwB,CA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html as s}from"lit";import{property as t,state as e,customElement as a}from"lit/decorators.js";import{s as h}from"./nile-radio.css.esm.js";import{classMap as l}from"lit/directives/class-map.js";import{w as r}from"../internal/watch.esm.js";import{N as o}from"../internal/nile-element.esm.js";let d=class extends o{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.value="",this.size="medium",this.disabled=!1,this.islabelborder=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners(),this.emit("nile-init")}disconnectedCallback(){this.removeEventListeners(),this.emit("nile-destroy")}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return s`
|
1
|
+
import{__decorate as i}from"tslib";import{html as s}from"lit";import{property as t,state as e,customElement as a}from"lit/decorators.js";import{s as h}from"./nile-radio.css.esm.js";import{classMap as l}from"lit/directives/class-map.js";import{w as r}from"../internal/watch.esm.js";import{N as o}from"../internal/nile-element.esm.js";let d=class extends o{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.value="",this.size="medium",this.disabled=!1,this.islabelborder=!1,this.allowUncheck=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners(),this.emit("nile-init")}disconnectedCallback(){this.removeEventListeners(),this.emit("nile-destroy")}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleClick(){this.allowUncheck&&!this.disabled?this.checked=!this.checked:this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return s`
|
2
2
|
<span
|
3
3
|
part="base"
|
4
4
|
class=${l({radio:!0,"radio--checked":this.checked,"radio--disabled":this.disabled,"radio--focused":this.hasFocus,"radio--medium":"medium"===this.size,radio__label_border:this.islabelborder})}
|
@@ -9,4 +9,4 @@ import{__decorate as i}from"tslib";import{html as s}from"lit";import{property as
|
|
9
9
|
|
10
10
|
<slot part="label" class="radio__label"></slot>
|
11
11
|
</span>
|
12
|
-
`}};d.styles=h,i([t({type:Boolean})],d.prototype,"checked",void 0),i([e()],d.prototype,"hasFocus",void 0),i([t()],d.prototype,"value",void 0),i([t({reflect:!0})],d.prototype,"size",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"islabelborder",void 0),i([r("checked")],d.prototype,"handleCheckedChange",null),i([r("disabled",{waitUntilFirstUpdate:!0})],d.prototype,"handleDisabledChange",null),d=i([a("nile-radio")],d);export{d as N};
|
12
|
+
`}};d.styles=h,i([t({type:Boolean})],d.prototype,"checked",void 0),i([e()],d.prototype,"hasFocus",void 0),i([t()],d.prototype,"value",void 0),i([t({reflect:!0})],d.prototype,"size",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"islabelborder",void 0),i([t({type:Boolean,reflect:!0})],d.prototype,"allowUncheck",void 0),i([r("checked")],d.prototype,"handleCheckedChange",null),i([r("disabled",{waitUntilFirstUpdate:!0})],d.prototype,"handleDisabledChange",null),d=i([a("nile-radio")],d);export{d as N};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-5b79f853.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio.cjs.js","tslib","lit/decorators.js","./nile-radio.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var i,a,e,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture003CjsJs){i=_fixture003CjsJs.f;a=_fixture003CjsJs.a;e=_fixture003CjsJs.e;},function(_litStaticHtmlJs){t=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileRadioCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileRadio",function(){it("should have the correct default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var e;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return i(t(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context2.sent;a(e.checked).to.be["false"],a(e.disabled).to.be["false"],a(e.size).to.equal("medium");case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect the disabled attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:e=_context3.sent;a(e.disabled).to.be["true"],a(e.hasAttribute("aria-disabled")).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should update aria-checked when checked changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var e;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return i(t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context4.sent;e.checked=!0;_context4.next=6;return e.updateComplete;case 6:a(e.getAttribute("aria-checked")).to.equal("true");case 7:case"end":return _context4.stop();}},_callee3);}))),it("should toggle checked state on click when not disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return i(t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context5.sent;s.click();_context5.next=6;return e(s);case 6:a(s.checked).to.be["true"];case 7:case"end":return _context5.stop();}},_callee4);}))),it("should not toggle checked state on click when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var s;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return i(t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:s=_context6.sent;s.click();_context6.next=6;return e(s);case 6:a(s.checked).to.be["false"];case 7:case"end":return _context6.stop();}},_callee5);}))),it("should emit nile-blur event on blur",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var e,s,o;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return i(t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context7.sent;s=new Promise(function(i){return e.addEventListener("nile-blur",i);});e.dispatchEvent(new Event("blur"));_context7.next=7;return s;case 7:o=_context7.sent;a(o).to.exist;case 9:case"end":return _context7.stop();}},_callee6);}))),it("should emit nile-focus event on focus",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var e,s,o;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return i(t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context8.sent;s=new Promise(function(i){return e.addEventListener("nile-focus",i);});e.dispatchEvent(new Event("focus"));_context8.next=7;return s;case 7:o=_context8.sent;a(o).to.exist;case 9:case"end":return _context8.stop();}},_callee7);}))),it("should apply the correct classes based on state",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var e,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return i(t(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context9.sent;e.checked=!0;e.disabled=!0;e.size="medium";_context9.next=8;return e.updateComplete;case 8:s=e.shadowRoot.querySelector('[part="base"]');a(s.classList.contains("radio--checked")).to.be["true"],a(s.classList.contains("radio--disabled")).to.be["true"],a(s.classList.contains("radio--medium")).to.be["true"];case 10:case"end":return _context9.stop();}},_callee8);}))),it("should update aria-disabled when disabled changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var s;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return i(t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context10.sent;s.disabled=!0;_context10.next=6;return e(s);case 6:a(s.getAttribute("aria-disabled")).to.equal("true");case 7:case"end":return _context10.stop();}},_callee9);}))),it("should set initial attributes correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var e;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return i(t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context11.sent;a(e.getAttribute("role")).to.equal("radio"),a(e.getAttribute("tabindex")).to.equal("-1"),a(e.getAttribute("aria-disabled")).to.equal("false");case 4:case"end":return _context11.stop();}},_callee10);})));});}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["../fixture-3bfb4490.cjs.js","lit/static-html.js","lit/html.js","lit/directive-helpers.js","lit","lit/directives/unsafe-html.js","./nile-radio.cjs.js","tslib","lit/decorators.js","./nile-radio.css.cjs.js","lit/directives/class-map.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var i,a,e,t,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject10;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}return{setters:[function(_fixture003CjsJs){i=_fixture003CjsJs.f;a=_fixture003CjsJs.a;e=_fixture003CjsJs.e;},function(_litStaticHtmlJs){t=_litStaticHtmlJs.html;},function(_litHtmlJs){},function(_litDirectiveHelpersJs){},function(_lit){},function(_litDirectivesUnsafeHtmlJs){},function(_nileRadioCjsJs){},function(_tslib){},function(_litDecoratorsJs){},function(_nileRadioCssCjsJs){},function(_litDirectivesClassMapJs){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){describe("NileRadio",function(){it("should have the correct default properties",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var e;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return i(t(_templateObject||(_templateObject=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context2.sent;a(e.checked).to.be["false"],a(e.disabled).to.be["false"],a(e.size).to.equal("medium");case 4:case"end":return _context2.stop();}},_callee);}))),it("should reflect the disabled attribute",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var e;return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.next=2;return i(t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:e=_context3.sent;a(e.disabled).to.be["true"],a(e.hasAttribute("aria-disabled")).to.be["true"];case 4:case"end":return _context3.stop();}},_callee2);}))),it("should update aria-checked when checked changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var e;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_context4.next=2;return i(t(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context4.sent;e.checked=!0;_context4.next=6;return e.updateComplete;case 6:a(e.getAttribute("aria-checked")).to.equal("true");case 7:case"end":return _context4.stop();}},_callee3);}))),it("should toggle checked state on click when not disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var s;return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_context5.next=2;return i(t(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context5.sent;s.click();_context5.next=6;return e(s);case 6:a(s.checked).to.be["true"];case 7:case"end":return _context5.stop();}},_callee4);}))),it("should not toggle checked state on click when disabled",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var s;return _regeneratorRuntime().wrap(function _callee5$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return i(t(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["<nile-radio disabled></nile-radio>"]))));case 2:s=_context6.sent;s.click();_context6.next=6;return e(s);case 6:a(s.checked).to.be["false"];case 7:case"end":return _context6.stop();}},_callee5);}))),it("should emit nile-blur event on blur",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var e,s,o;return _regeneratorRuntime().wrap(function _callee6$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_context7.next=2;return i(t(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context7.sent;s=new Promise(function(i){return e.addEventListener("nile-blur",i);});e.dispatchEvent(new Event("blur"));_context7.next=7;return s;case 7:o=_context7.sent;a(o).to.exist;case 9:case"end":return _context7.stop();}},_callee6);}))),it("should emit nile-focus event on focus",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(){var e,s,o;return _regeneratorRuntime().wrap(function _callee7$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return i(t(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context8.sent;s=new Promise(function(i){return e.addEventListener("nile-focus",i);});e.dispatchEvent(new Event("focus"));_context8.next=7;return s;case 7:o=_context8.sent;a(o).to.exist;case 9:case"end":return _context8.stop();}},_callee7);}))),it("should apply the correct classes based on state",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(){var e,s;return _regeneratorRuntime().wrap(function _callee8$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return i(t(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context9.sent;e.checked=!0;e.disabled=!0;e.size="medium";_context9.next=8;return e.updateComplete;case 8:s=e.shadowRoot.querySelector('[part="base"]');a(s.classList.contains("radio--checked")).to.be["true"],a(s.classList.contains("radio--disabled")).to.be["true"],a(s.classList.contains("radio--medium")).to.be["true"];case 10:case"end":return _context9.stop();}},_callee8);}))),it("should update aria-disabled when disabled changes",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(){var s;return _regeneratorRuntime().wrap(function _callee9$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_context10.next=2;return i(t(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:s=_context10.sent;s.disabled=!0;_context10.next=6;return e(s);case 6:a(s.getAttribute("aria-disabled")).to.equal("true");case 7:case"end":return _context10.stop();}},_callee9);}))),it("should set initial attributes correctly",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(){var e;return _regeneratorRuntime().wrap(function _callee10$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return i(t(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["<nile-radio></nile-radio>"]))));case 2:e=_context11.sent;a(e.getAttribute("role")).to.equal("radio"),a(e.getAttribute("tabindex")).to.equal("-1"),a(e.getAttribute("aria-disabled")).to.equal("false");case 4:case"end":return _context11.stop();}},_callee10);})));});}};});
|
2
2
|
//# sourceMappingURL=nile-radio.test.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
import{f as i,a as e,e as a}from"../fixture-
|
1
|
+
import{f as i,a as e,e as a}from"../fixture-8edec91c.esm.js";import{html as t}from"lit/static-html.js";import"lit/html.js";import"lit/directive-helpers.js";import"lit";import"lit/directives/unsafe-html.js";import"./nile-radio.esm.js";import"tslib";import"lit/decorators.js";import"./nile-radio.css.esm.js";import"lit/directives/class-map.js";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";describe("NileRadio",(()=>{it("should have the correct default properties",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);e(a.checked).to.be.false,e(a.disabled).to.be.false,e(a.size).to.equal("medium")})),it("should reflect the disabled attribute",(async()=>{const a=await i(t`<nile-radio disabled></nile-radio>`);e(a.disabled).to.be.true,e(a.hasAttribute("aria-disabled")).to.be.true})),it("should update aria-checked when checked changes",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);a.checked=!0,await a.updateComplete,e(a.getAttribute("aria-checked")).to.equal("true")})),it("should toggle checked state on click when not disabled",(async()=>{const s=await i(t`<nile-radio></nile-radio>`);s.click(),await a(s),e(s.checked).to.be.true})),it("should not toggle checked state on click when disabled",(async()=>{const s=await i(t`<nile-radio disabled></nile-radio>`);s.click(),await a(s),e(s.checked).to.be.false})),it("should emit nile-blur event on blur",(async()=>{const a=await i(t`<nile-radio></nile-radio>`),s=new Promise((i=>a.addEventListener("nile-blur",i)));a.dispatchEvent(new Event("blur"));const o=await s;e(o).to.exist})),it("should emit nile-focus event on focus",(async()=>{const a=await i(t`<nile-radio></nile-radio>`),s=new Promise((i=>a.addEventListener("nile-focus",i)));a.dispatchEvent(new Event("focus"));const o=await s;e(o).to.exist})),it("should apply the correct classes based on state",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);a.checked=!0,a.disabled=!0,a.size="medium",await a.updateComplete;const s=a.shadowRoot.querySelector('[part="base"]');e(s.classList.contains("radio--checked")).to.be.true,e(s.classList.contains("radio--disabled")).to.be.true,e(s.classList.contains("radio--medium")).to.be.true})),it("should update aria-disabled when disabled changes",(async()=>{const s=await i(t`<nile-radio></nile-radio>`);s.disabled=!0,await a(s),e(s.getAttribute("aria-disabled")).to.equal("true")})),it("should set initial attributes correctly",(async()=>{const a=await i(t`<nile-radio></nile-radio>`);e(a.getAttribute("role")).to.equal("radio"),e(a.getAttribute("tabindex")).to.equal("-1"),e(a.getAttribute("aria-disabled")).to.equal("false")}))}));
|
@@ -1,2 +1,2 @@
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,l,o,r,a,n,h,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;l=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_lit){a=_lit.html;},function(_internalWatchCjsJs){n=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){h=_internalNileElementCjsJs.N;},function(_nileRadioGroupCssCjsJs){d=_nileRadioGroupCssCjsJs.s;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_h){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.customValidityMessage="",_this.hasButtonGroup=!1,_this.defaultValue="",_this.label="",_this.name="option",_this.value="",_this.form="",_this.required=!1,_this.labelInline=!1,_this.disabled=!1,_this.helpText="",_this.errorMessage="",_this.islabelborder=!1;return _this;}_inherits(c,_h);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}},{key:"getAllRadios",value:function getAllRadios(){return _toConsumableArray(this.querySelectorAll("nile-radio"));}},{key:"handleRadioClick",value:function handleRadioClick(t){var e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,i.forEach(function(t){return t.checked=t===e;}),this.value!==s&&(this.emit("change",{value:this.value}),this.emit("input")));}},{key:"handleDisabledChange",value:function handleDisabledChange(){var _this2=this;this.getAllRadios().forEach(function(t){t.disabled=_this2.disabled;});}},{key:"handleInitialDisabledState",value:function handleInitialDisabledState(){var _this3=this;this.getAllRadios().forEach(function(t){t.disabled=t.hasAttribute("disabled")?t.disabled:_this3.disabled;});}},{key:"handleKeyDown",value:function handleKeyDown(t){var _e$find,_this4=this;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;var e=this.getAllRadios().filter(function(t){return!t.disabled;}),i=(_e$find=e.find(function(t){return t.checked;}))!==null&&_e$find!==void 0?_e$find:e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;var o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach(function(t){t.checked=!1,_this4.hasButtonGroup||(t.tabIndex=-1);}),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault();}},{key:"handleLabelClick",value:function handleLabelClick(){var t=this.getAllRadios(),e=t.find(function(t){return t.checked;})||t[0];e&&e.focus();}},{key:"handleSlotChange",value:function handleSlotChange(){var _this5=this,_this$shadowRoot;var t=this.getAllRadios();t.forEach(function(t){t.checked=t.value===_this5.value,_this5.islabelborder&&(t.islabelborder=!0);});if(this.hasButtonGroup=t.some(function(t){return"nile-radio-button"===t.tagName.toLowerCase();}),!t.some(function(t){return t.checked;}))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0;}else t[0].tabIndex=0;this.hasButtonGroup&&((_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector("nile-button-group"));}},{key:"updateCheckedRadio",value:function updateCheckedRadio(){var _this6=this;this.getAllRadios().forEach(function(t){return t.checked=t.value===_this6.value;});}},{key:"handleValueChange",value:function handleValueChange(){this.hasUpdated&&this.updateCheckedRadio();}},{key:"render",value:function render(){var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <slot\n @click=","\n @keydown=","\n @slotchange=","\n role=\"presentation\"\n ></slot>\n "])),this.handleRadioClick,this.handleKeyDown,this.handleSlotChange);return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <fieldset\n part=\"form-control\"\n class=","\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n ","\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=","\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ","\n </div>\n\n ","\n\n ","\n\n </fieldset>\n "])),e({"form-control":!0,"form-control--medium":!0,"form-control--radio-group":!0,"form-control--has-label":s,"form-control--has-help-text":l}),s?"false":"true",this.handleLabelClick,this.label,i?a(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot name=\"label-suffix\"></slot> "]))):"",this.required,this.hasButtonGroup?a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n ","\n "])),r):a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div part=\"options-base\" class=\"","\"> ","</div> "])),this.labelInline?"form-control--inline-radio":"",r),l?a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);}(h));c.styles=d,t([i("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([s()],c.prototype,"hasButtonGroup",void 0),t([s()],c.prototype,"defaultValue",void 0),t([l()],c.prototype,"label",void 0),t([l()],c.prototype,"name",void 0),t([l({reflect:!0})],c.prototype,"value",void 0),t([l({reflect:!0})],c.prototype,"form",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([l({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([l({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"islabelborder",void 0),t([n("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([n("value")],c.prototype,"handleValueChange",null),_export("N",c=t([o("nile-radio-group")],c));}};});
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-group.css.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,l,o,r,a,h,n,d,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,c;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDirectivesClassMapJs){e=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){i=_litDecoratorsJs.query;s=_litDecoratorsJs.state;l=_litDecoratorsJs.property;o=_litDecoratorsJs.customElement;},function(_internalSlotCjsJs){r=_internalSlotCjsJs.H;},function(_lit){a=_lit.html;},function(_internalWatchCjsJs){h=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_nileRadioGroupCssCjsJs){d=_nileRadioGroupCssCjsJs.s;}],execute:function execute(){_export("N",c=/*#__PURE__*/function(_n){function c(){var _this;_classCallCheck(this,c);_this=_callSuper(this,c,arguments),_this.hasSlotController=new r(_assertThisInitialized(_this),"help-text","label"),_this.customValidityMessage="",_this.hasButtonGroup=!1,_this.defaultValue="",_this.label="",_this.name="option",_this.value="",_this.form="",_this.required=!1,_this.labelInline=!1,_this.disabled=!1,_this.helpText="",_this.errorMessage="",_this.islabelborder=!1,_this.allowUncheckGroup=!1;return _this;}_inherits(c,_n);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(c,"connectedCallback",this,3)([]),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(c,"disconnectedCallback",this,3)([]),this.emit("nile-destroy");}},{key:"getAllRadios",value:function getAllRadios(){return _toConsumableArray(this.querySelectorAll("nile-radio"));}},{key:"handleRadioClick",value:function handleRadioClick(t){var e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,this.allowUncheckGroup||i.forEach(function(t){t.checked=t===e;}),this.allowUncheckGroup||this.value===s?this.allowUncheckGroup&&(this.emit("change",{value:this.value,checked:e.checked}),this.emit("input")):(this.emit("change",{value:this.value}),this.emit("input")));}},{key:"updated",value:function updated(t){_superPropGet(c,"updated",this,3)([t]),t.has("allowUncheckGroup")&&this.allowUncheckGroup&&this.getAllRadios().forEach(function(t){t.allowUncheck=!0;});}},{key:"handleDisabledChange",value:function handleDisabledChange(){var _this2=this;this.getAllRadios().forEach(function(t){t.disabled=_this2.disabled;});}},{key:"handleInitialDisabledState",value:function handleInitialDisabledState(){var _this3=this;this.getAllRadios().forEach(function(t){t.disabled=t.hasAttribute("disabled")?t.disabled:_this3.disabled;});}},{key:"handleKeyDown",value:function handleKeyDown(t){var _e$find,_this4=this;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;var e=this.getAllRadios().filter(function(t){return!t.disabled;}),i=(_e$find=e.find(function(t){return t.checked;}))!==null&&_e$find!==void 0?_e$find:e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;var o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach(function(t){t.checked=!1,_this4.hasButtonGroup||(t.tabIndex=-1);}),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault();}},{key:"handleLabelClick",value:function handleLabelClick(){var t=this.getAllRadios(),e=t.find(function(t){return t.checked;})||t[0];e&&e.focus();}},{key:"handleSlotChange",value:function handleSlotChange(){var _this5=this,_this$shadowRoot;var t=this.getAllRadios();t.forEach(function(t){t.checked=t.value===_this5.value,_this5.islabelborder&&(t.islabelborder=!0);});if(this.hasButtonGroup=t.some(function(t){return"nile-radio-button"===t.tagName.toLowerCase();}),!t.some(function(t){return t.checked;}))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0;}else t[0].tabIndex=0;this.hasButtonGroup&&((_this$shadowRoot=this.shadowRoot)===null||_this$shadowRoot===void 0?void 0:_this$shadowRoot.querySelector("nile-button-group"));}},{key:"updateCheckedRadio",value:function updateCheckedRadio(){var _this6=this;this.getAllRadios().forEach(function(t){return t.checked=t.value===_this6.value;});}},{key:"handleValueChange",value:function handleValueChange(){this.hasUpdated&&this.updateCheckedRadio();}},{key:"render",value:function render(){var t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");var i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <slot\n @click=","\n @keydown=","\n @slotchange=","\n role=\"presentation\"\n ></slot>\n "])),this.handleRadioClick,this.handleKeyDown,this.handleSlotChange);return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <fieldset\n part=\"form-control\"\n class=","\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=","\n @click=","\n >\n <slot name=\"label\">","</slot>\n </label>\n\n ","\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=","\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ","\n </div>\n\n ","\n\n ","\n\n </fieldset>\n "])),e({"form-control":!0,"form-control--medium":!0,"form-control--radio-group":!0,"form-control--has-label":s,"form-control--has-help-text":l}),s?"false":"true",this.handleLabelClick,this.label,i?a(_templateObject3||(_templateObject3=_taggedTemplateLiteral([" <slot name=\"label-suffix\"></slot> "]))):"",this.required,this.hasButtonGroup?a(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n ","\n "])),r):a(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div part=\"options-base\" class=\"","\"> ","</div> "])),this.labelInline?"form-control--inline-radio":"",r),l?a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n <nile-form-help-text>","</nile-form-help-text>\n "])),this.helpText):"",o?a(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n <nile-form-error-message\n >","</nile-form-error-message\n >\n "])),this.errorMessage):"");}}]);}(n));c.styles=d,t([i("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([s()],c.prototype,"hasButtonGroup",void 0),t([s()],c.prototype,"defaultValue",void 0),t([l()],c.prototype,"label",void 0),t([l()],c.prototype,"name",void 0),t([l({reflect:!0})],c.prototype,"value",void 0),t([l({reflect:!0})],c.prototype,"form",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([l({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([l({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"islabelborder",void 0),t([l({type:Boolean,reflect:!0,attribute:!0})],c.prototype,"allowUncheckGroup",void 0),t([h("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([h("value")],c.prototype,"handleValueChange",null),_export("N",c=t([o("nile-radio-group")],c));}};});
|
2
2
|
//# sourceMappingURL=nile-radio-group.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-radio-group.cjs.js","sources":["../../../src/nile-radio-group/nile-radio-group.ts"],"sourcesContent":["\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { HasSlotController } from '../internal/slot';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport styles from './nile-radio-group.css';\nimport type { CSSResultGroup } from 'lit';\nimport type NileRadio from '../nile-radio/nile-radio';\n\n/**\n * @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.\n *\n * @dependency nile-button-group\n *\n * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.\n * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`\n * attribute.\n *\n * @event change - Emitted when the radio group's selected value changes.\n * @event input - Emitted when the radio group receives user input.\n * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n * @csspart button-group - The button group that wraps radio buttons.\n * @csspart button-group__base - The button group's `base` part.\n */\n@customElement('nile-radio-group')\nexport class NileRadioGroup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private customValidityMessage = '';\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @state() private hasButtonGroup = false;\n\n @state() defaultValue = '';\n\n /**\n * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\n * instead.\n */\n @property() label = '';\n\n /** The name of the radio group, submitted as a name/value pair with form data. */\n @property() name = 'option';\n\n /** The current value of the radio group, submitted as a name/value pair with form data. */\n @property({ reflect: true }) value = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Ensures a child radio is checked before allowing the containing form to submit. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n\n /** Used to show radio in inline or not */\n @property({ type: Boolean, reflect: true }) labelInline = false;\n\n /** Used to disabled or not */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n /** The radio's labelborder for whole gp. */\n @property({ type: Boolean, reflect: true }) islabelborder = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.handleInitialDisabledState();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n private getAllRadios() {\n return [...this.querySelectorAll<NileRadio>('nile-radio')];\n }\n\n private handleRadioClick(event: MouseEvent) {\n const target = (event.target as HTMLElement).closest<NileRadio>('nile-radio')!;\n const radios = this.getAllRadios();\n const oldValue = this.value;\n\n if (target.disabled || this.disabled) {\n return;\n }\n\n this.value = target.value;\n radios.forEach(radio => (radio.checked = radio === target));\n\n if (this.value !== oldValue) {\n this.emit('change',{value: this.value });\n this.emit('input');\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = this.disabled;\n });\n }\n\n private handleInitialDisabledState() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = radio.hasAttribute('disabled') ? radio.disabled : this.disabled;\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key)) {\n return;\n }\n\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n const incr = event.key === ' ' ? 0 : ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;\n const oldValue = this.value;\n let index = radios.indexOf(checkedRadio) + incr;\n\n if (index < 0) {\n index = radios.length - 1;\n }\n\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this.getAllRadios().forEach(radio => {\n radio.checked = false;\n\n if (!this.hasButtonGroup) {\n radio.tabIndex = -1;\n }\n });\n\n this.value = radios[index].value;\n radios[index].checked = true;\n\n if (!this.hasButtonGroup) {\n radios[index].tabIndex = 0;\n radios[index].focus();\n } else {\n radios[index].shadowRoot!.querySelector('button')!.focus();\n }\n\n if (this.value !== oldValue) {\n this.emit('change');\n this.emit('input');\n }\n\n event.preventDefault();\n }\n\n private handleLabelClick() {\n const radios = this.getAllRadios();\n const checked = radios.find(radio => radio.checked);\n const radioToFocus = checked || radios[0];\n\n // Move focus to the checked radio (or the first one if none are checked) when clicking the label\n if (radioToFocus) {\n radioToFocus.focus();\n }\n }\n\n private handleSlotChange() {\n const radios = this.getAllRadios();\n\n radios.forEach(radio => {\n radio.checked = radio.value === this.value;\n if (this.islabelborder) {\n radio.islabelborder=true;\n }\n });\n const nile_radio_check='nile-radio-button';\n this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === nile_radio_check);\n\n if (!radios.some(radio => radio.checked)) {\n if (this.hasButtonGroup) {\n const buttonRadio = radios[0].shadowRoot!.querySelector('button')!;\n buttonRadio.tabIndex = 0;\n } else {\n radios[0].tabIndex = 0;\n }\n }\n\n if (this.hasButtonGroup) {\n const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');\n }\n }\n\n private updateCheckedRadio() {\n const radios = this.getAllRadios();\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n @watch('value')\n handleValueChange() {\n if (this.hasUpdated) {\n this.updateCheckedRadio();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n const defaultSlot = html`\n <slot\n @click=${this.handleRadioClick}\n @keydown=${this.handleKeyDown}\n @slotchange=${this.handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n\n return html`\n <fieldset\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--radio-group': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n ${hasLabelSuffixSlot ? html` <slot name=\"label-suffix\"></slot> ` : ``}\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=${this.required}\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ${this.hasButtonGroup\n ? html`\n ${defaultSlot}\n `\n : html`\n <div part=\"options-base\" class=\"${this.labelInline ? `form-control--inline-radio`:``}\"> ${defaultSlot}</div> `}\n </div>\n\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n\n </fieldset>\n `;\n }\n}\n\nexport default NileRadioGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-group': NileRadioGroup;\n }\n}\n"],"names":["NileRadioGroup","c","constructor","this","hasSlotController","HasSlotController","customValidityMessage","hasButtonGroup","defaultValue","label","name","value","form","required","labelInline","disabled","helpText","errorMessage","islabelborder","_this","_inherits","_h","_createClass","key","connectedCallback","super","handleInitialDisabledState","emit","disconnectedCallback","getAllRadios","_toConsumableArray","querySelectorAll","handleRadioClick","event","target","closest","radios","oldValue","forEach","radio","checked","handleDisabledChange","hasAttribute","handleKeyDown","_e$find","_this4","includes","filter","checkedRadio","find","incr","index","indexOf","length","tabIndex","shadowRoot","querySelector","focus","preventDefault","handleLabelClick","radioToFocus","handleSlotChange","_this5","_this$shadowRoot","some","tagName","toLowerCase","updateCheckedRadio","handleValueChange","hasUpdated","render","hasLabelSlot","test","hasLabelSuffixSlot","hasLabel","hasHelpText","hasErrorMessage","defaultSlot","html","_templateObject","_taggedTemplateLiteral","_templateObject2","classMap","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"whKA2BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAGYC,EAAAA,KAAAA,CAAiBC,kBAAG,GAAIC,CAAAA,CAAAA,CAAAA,sBAAAA,CAAAA,KAAAA,EAAwB,WAAa,CAAA,OAAA,CAAA,CACtEF,KAAAA,CAAqBG,qBAAAA,CAAG,EAIfH,CAAAA,KAAAA,CAAcI,gBAAG,CAEzBJ,CAAAA,KAAAA,CAAYK,aAAG,EAMZL,CAAAA,KAAAA,CAAKM,MAAG,EAGRN,CAAAA,KAAAA,CAAIO,IAAG,CAAA,QAAA,CAGUP,KAAAA,CAAKQ,KAAAA,CAAG,GAORR,KAAAA,CAAIS,IAAAA,CAAG,GAGQT,KAAAA,CAAQU,QAAAA,CAAAA,CAAG,EAIXV,KAAAA,CAAWW,WAAAA,CAAAA,CAAG,CAGdX,CAAAA,KAAAA,CAAQY,QAAG,CAAA,CAAA,CAAA,CAEFZ,KAAAA,CAAQa,QAAG,CAAA,EAAA,CAEPb,KAAAA,CAAYc,YAAG,CAAA,EAAA,CAG5Bd,KAAAA,CAAae,aAAG,CAAA,CAAA,CAqO7D,QAAAC,KAAA,EAnOCC,SAAA,CAAAnB,CAAA,CAAAoB,EAAA,SAAAC,YAAA,CAAArB,CAAA,GAAAsB,GAAA,qBAAAZ,KAAA,UAAAa,iBAAAA,CAAAA,CACEC,CAAAA,aAAAA,CAAAA,CAAAA,iCACAtB,IAAKK,CAAAA,YAAAA,CAAeL,KAAKQ,KACzBR,CAAAA,IAAAA,CAAKuB,6BACLvB,IAAKwB,CAAAA,IAAAA,CAAK,WACX,CAAA,EAED,G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AAA,CAD1BW,CAAAA,CAAc,qBACFrG"}
|
1
|
+
{"version":3,"file":"nile-radio-group.cjs.js","sources":["../../../src/nile-radio-group/nile-radio-group.ts"],"sourcesContent":["\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { HasSlotController } from '../internal/slot';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport styles from './nile-radio-group.css';\nimport type { CSSResultGroup, PropertyValues } from 'lit';\nimport type NileRadio from '../nile-radio/nile-radio';\n\n/**\n * @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.\n *\n * @dependency nile-button-group\n *\n * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.\n * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`\n * attribute.\n *\n * @event change - Emitted when the radio group's selected value changes.\n * @event input - Emitted when the radio group receives user input.\n * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n * @csspart button-group - The button group that wraps radio buttons.\n * @csspart button-group__base - The button group's `base` part.\n */\n@customElement('nile-radio-group')\nexport class NileRadioGroup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');\n private customValidityMessage = '';\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @state() private hasButtonGroup = false;\n\n @state() defaultValue = '';\n\n /**\n * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\n * instead.\n */\n @property() label = '';\n\n /** The name of the radio group, submitted as a name/value pair with form data. */\n @property() name = 'option';\n\n /** The current value of the radio group, submitted as a name/value pair with form data. */\n @property({ reflect: true }) value = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Ensures a child radio is checked before allowing the containing form to submit. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n\n /** Used to show radio in inline or not */\n @property({ type: Boolean, reflect: true }) labelInline = false;\n\n /** Used to disabled or not */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: 'help-text', reflect: true }) helpText = '';\n\n @property({ attribute: 'error-message', reflect: true }) errorMessage = '';\n\n /** The radio's labelborder for whole gp. */\n @property({ type: Boolean, reflect: true }) islabelborder = false;\n\n /** Allow the radio to be unchecked. */\n @property({ type: Boolean, reflect: true, attribute: true }) allowUncheckGroup = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.handleInitialDisabledState();\n this.emit('nile-init');\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.emit('nile-destroy');\n }\n\n private getAllRadios() {\n return [...this.querySelectorAll<NileRadio>('nile-radio')];\n }\n\n private handleRadioClick(event: MouseEvent) {\n const target = (event.target as HTMLElement).closest<NileRadio>('nile-radio')!;\n const radios = this.getAllRadios();\n const oldValue = this.value;\n\n if (target.disabled || this.disabled) {\n return;\n }\n\n this.value = target.value;\n if (!this.allowUncheckGroup) {\n radios.forEach(radio => {\n radio.checked = radio === target;\n });\n }\n\n if (!this.allowUncheckGroup && this.value !== oldValue) {\n this.emit('change', { value: this.value});\n this.emit('input');\n } else if (this.allowUncheckGroup) { \n this.emit('change', { value: this.value , checked: target.checked});\n this.emit('input');\n }\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('allowUncheckGroup')) {\n if (this.allowUncheckGroup) {\n this.getAllRadios().forEach(radio => {\n radio.allowUncheck = true;\n });\n }\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = this.disabled;\n });\n }\n\n private handleInitialDisabledState() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = radio.hasAttribute('disabled') ? radio.disabled : this.disabled;\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key)) {\n return;\n }\n\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n const incr = event.key === ' ' ? 0 : ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;\n const oldValue = this.value;\n let index = radios.indexOf(checkedRadio) + incr;\n\n if (index < 0) {\n index = radios.length - 1;\n }\n\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this.getAllRadios().forEach(radio => {\n radio.checked = false;\n\n if (!this.hasButtonGroup) {\n radio.tabIndex = -1;\n }\n });\n\n this.value = radios[index].value;\n radios[index].checked = true;\n\n if (!this.hasButtonGroup) {\n radios[index].tabIndex = 0;\n radios[index].focus();\n } else {\n radios[index].shadowRoot!.querySelector('button')!.focus();\n }\n\n if (this.value !== oldValue) {\n this.emit('change');\n this.emit('input');\n }\n\n event.preventDefault();\n }\n\n private handleLabelClick() {\n const radios = this.getAllRadios();\n const checked = radios.find(radio => radio.checked);\n const radioToFocus = checked || radios[0];\n\n // Move focus to the checked radio (or the first one if none are checked) when clicking the label\n if (radioToFocus) {\n radioToFocus.focus();\n }\n }\n\n private handleSlotChange() {\n const radios = this.getAllRadios();\n\n radios.forEach(radio => {\n radio.checked = radio.value === this.value;\n if (this.islabelborder) {\n radio.islabelborder=true;\n }\n });\n const nile_radio_check='nile-radio-button';\n this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === nile_radio_check);\n\n if (!radios.some(radio => radio.checked)) {\n if (this.hasButtonGroup) {\n const buttonRadio = radios[0].shadowRoot!.querySelector('button')!;\n buttonRadio.tabIndex = 0;\n } else {\n radios[0].tabIndex = 0;\n }\n }\n\n if (this.hasButtonGroup) {\n const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');\n }\n }\n\n private updateCheckedRadio() {\n const radios = this.getAllRadios();\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n @watch('value')\n handleValueChange() {\n if (this.hasUpdated) {\n this.updateCheckedRadio();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabelSuffixSlot = this.hasSlotController.test('label-suffix');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n const defaultSlot = html`\n <slot\n @click=${this.handleRadioClick}\n @keydown=${this.handleKeyDown}\n @slotchange=${this.handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n\n return html`\n <fieldset\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--radio-group': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText\n })}\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n ${hasLabelSuffixSlot ? html` <slot name=\"label-suffix\"></slot> ` : ``}\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=${this.required}\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ${this.hasButtonGroup\n ? html`\n ${defaultSlot}\n `\n : html`\n <div part=\"options-base\" class=\"${this.labelInline ? `form-control--inline-radio`:``}\"> ${defaultSlot}</div> `}\n </div>\n\n ${\n hasHelpText\n ? html`\n <nile-form-help-text>${this.helpText}</nile-form-help-text>\n `\n : ``\n }\n\n ${\n hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``\n }\n\n </fieldset>\n `;\n }\n}\n\nexport default NileRadioGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-group': NileRadioGroup;\n }\n}\n"],"names":["NileRadioGroup","c","constructor","this","hasSlotController","HasSlotController","customValidityMessage","hasButtonGroup","defaultValue","label","name","value","form","required","labelInline","disabled","helpText","errorMessage","islabelborder","allowUncheckGroup","_this","_inherits","_n","_createClass","key","connectedCallback","super","handleInitialDisabledState","emit","disconnectedCallback","getAllRadios","_toConsumableArray","querySelectorAll","handleRadioClick","event","target","closest","radios","oldValue","forEach","radio","checked","updated","changedProperties","has","allowUncheck","handleDisabledChange","hasAttribute","handleKeyDown","_e$find","_this4","includes","filter","checkedRadio","find","incr","index","indexOf","length","tabIndex","shadowRoot","querySelector","focus","preventDefault","handleLabelClick","radioToFocus","handleSlotChange","some","tagName","toLowerCase","updateCheckedRadio","handleValueChange","hasUpdated","render","hasLabelSlot","test","hasLabelSuffixSlot","hasLabel","hasHelpText","hasErrorMessage","defaultSlot","html","_templateObject","_taggedTemplateLiteral","_templateObject2","classMap","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","NileElement","styles","__decorate","query","prototype","state","property","reflect","type","Boolean","attribute","watch","waitUntilFirstUpdate","customElement"],"mappings":"whKA2BaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCAGYC,KAAAA,CAAiBC,iBAAG,CAAA,GAAIC,CAAAA,CAAkBF,CAAAA,sBAAAA,CAAAA,KAAAA,EAAM,WAAa,CAAA,OAAA,CAAA,CACtEA,KAAAA,CAAqBG,qBAAG,CAAA,EAAA,CAIfH,KAAAA,CAAcI,cAAAA,CAAAA,CAAG,CAEzBJ,CAAAA,KAAAA,CAAYK,aAAG,EAMZL,CAAAA,KAAAA,CAAKM,KAAG,CAAA,EAAA,CAGRN,KAAAA,CAAIO,IAAAA,CAAG,QAGUP,CAAAA,KAAAA,CAA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AA5DI,CAAS,CAAA,CAAEE,KAAMC,OAASF,CAAAA,OAAAA,CAAAA,CAAS,CAAMG,CAAAA,SAAAA,CAAAA,CAAW,KAAkCrG,CAAA+F,CAAAA,SAAAA,CAAA,wBAAA,EAwDvFF,CAAAA,CAAAA,CAAAA,CAAA,CADCS,CAAM,CAAA,UAAA,CAAY,CAAEC,oBAAAA,CAAAA,CAAsB,KAK1CvG,CAAA+F,CAAAA,SAAAA,CAAA,uBAAA,IAgGDF,CAAAA,CAAAA,CAAAA,CAAA,CADCS,CAAM,CAAA,OAAA,CAAA,CAAA,CAKNtG,CAAA+F,CAAAA,SAAAA,CAAA,oBAAA,IAjNU/F,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAc6F,EAAA,CAD1BW,CAAAA,CAAc,qBACFxG"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/class-map.js";import{query as i,state as s,property as l,customElement as o}from"lit/decorators.js";import{H as r}from"../internal/slot.esm.js";import{html as a}from"lit";import{w as
|
1
|
+
import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/class-map.js";import{query as i,state as s,property as l,customElement as o}from"lit/decorators.js";import{H as r}from"../internal/slot.esm.js";import{html as a}from"lit";import{w as h}from"../internal/watch.esm.js";import{N as n}from"../internal/nile-element.esm.js";import{s as d}from"./nile-radio-group.css.esm.js";let c=class extends n{constructor(){super(...arguments),this.hasSlotController=new r(this,"help-text","label"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.label="",this.name="option",this.value="",this.form="",this.required=!1,this.labelInline=!1,this.disabled=!1,this.helpText="",this.errorMessage="",this.islabelborder=!1,this.allowUncheckGroup=!1}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value,this.handleInitialDisabledState(),this.emit("nile-init")}disconnectedCallback(){super.disconnectedCallback(),this.emit("nile-destroy")}getAllRadios(){return[...this.querySelectorAll("nile-radio")]}handleRadioClick(t){const e=t.target.closest("nile-radio"),i=this.getAllRadios(),s=this.value;e.disabled||this.disabled||(this.value=e.value,this.allowUncheckGroup||i.forEach((t=>{t.checked=t===e})),this.allowUncheckGroup||this.value===s?this.allowUncheckGroup&&(this.emit("change",{value:this.value,checked:e.checked}),this.emit("input")):(this.emit("change",{value:this.value}),this.emit("input")))}updated(t){super.updated(t),t.has("allowUncheckGroup")&&this.allowUncheckGroup&&this.getAllRadios().forEach((t=>{t.allowUncheck=!0}))}handleDisabledChange(){this.getAllRadios().forEach((t=>{t.disabled=this.disabled}))}handleInitialDisabledState(){this.getAllRadios().forEach((t=>{t.disabled=t.hasAttribute("disabled")?t.disabled:this.disabled}))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),i=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,l=this.value;let o=e.indexOf(i)+s;o<0&&(o=e.length-1),o>e.length-1&&(o=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[o].value,e[o].checked=!0,this.hasButtonGroup?e[o].shadowRoot.querySelector("button").focus():(e[o].tabIndex=0,e[o].focus()),this.value!==l&&(this.emit("change"),this.emit("input")),t.preventDefault()}handleLabelClick(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleSlotChange(){const t=this.getAllRadios();t.forEach((t=>{t.checked=t.value===this.value,this.islabelborder&&(t.islabelborder=!0)}));if(this.hasButtonGroup=t.some((t=>"nile-radio-button"===t.tagName.toLowerCase())),!t.some((t=>t.checked)))if(this.hasButtonGroup){t[0].shadowRoot.querySelector("button").tabIndex=0}else t[0].tabIndex=0;this.hasButtonGroup&&this.shadowRoot?.querySelector("nile-button-group")}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value))}handleValueChange(){this.hasUpdated&&this.updateCheckedRadio()}render(){const t=this.hasSlotController.test("label");this.hasSlotController.test("help-text");const i=this.hasSlotController.test("label-suffix"),s=!!this.label||!!t,l=!!this.helpText,o=!!this.errorMessage,r=a`
|
2
2
|
<slot
|
3
3
|
@click=${this.handleRadioClick}
|
4
4
|
@keydown=${this.handleKeyDown}
|
@@ -56,4 +56,4 @@ import{__decorate as t}from"tslib";import{classMap as e}from"lit/directives/clas
|
|
56
56
|
`:""}
|
57
57
|
|
58
58
|
</fieldset>
|
59
|
-
`}};c.styles=d,t([i("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([s()],c.prototype,"hasButtonGroup",void 0),t([s()],c.prototype,"defaultValue",void 0),t([l()],c.prototype,"label",void 0),t([l()],c.prototype,"name",void 0),t([l({reflect:!0})],c.prototype,"value",void 0),t([l({reflect:!0})],c.prototype,"form",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([l({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([l({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"islabelborder",void 0),t([
|
59
|
+
`}};c.styles=d,t([i("slot:not([name])")],c.prototype,"defaultSlot",void 0),t([s()],c.prototype,"hasButtonGroup",void 0),t([s()],c.prototype,"defaultValue",void 0),t([l()],c.prototype,"label",void 0),t([l()],c.prototype,"name",void 0),t([l({reflect:!0})],c.prototype,"value",void 0),t([l({reflect:!0})],c.prototype,"form",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"required",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"labelInline",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([l({attribute:"help-text",reflect:!0})],c.prototype,"helpText",void 0),t([l({attribute:"error-message",reflect:!0})],c.prototype,"errorMessage",void 0),t([l({type:Boolean,reflect:!0})],c.prototype,"islabelborder",void 0),t([l({type:Boolean,reflect:!0,attribute:!0})],c.prototype,"allowUncheckGroup",void 0),t([h("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),t([h("value")],c.prototype,"handleValueChange",null),c=t([o("nile-radio-group")],c);export{c as N};
|